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,KAAK8+R,SAAU,GAEjB9+R,KAAKm/R,YAAcd,IAAiBH,GAAekB,QAEnDp/R,KAAKw+R,YAAcA,GAAe5jR,GCtChC,MAAOykR,YAAwBlB,GACnCp+R,YACEu/R,EAEAlB,EACAE,EACAC,EACSp2I,GAET9gF,MACEi4N,EACAlB,EACAF,GAAegB,MACfZ,EACAC,EACAp2I,GAROnoJ,KAAUmoJ,WAAVA,GCPP,MAAOo3I,WAAuBpB,GAClCp+R,YACEu/R,EAEAlB,EACAE,EACAC,EACSp2I,GAET9gF,MACEi4N,EACAlB,EACAF,GAAehjR,KACfojR,EACAC,EACAp2I,GAROnoJ,KAAUmoJ,WAAVA,GCPP,MAAOq3I,YAAwBrB,GACnCp+R,YACEu/R,EAEAlB,EACAE,EACAC,EACSp2I,GAET9gF,MACEi4N,EACAlB,EACAF,GAAea,MACfT,EACAC,EACAp2I,GAROnoJ,KAAUmoJ,WAAVA,GCPP,MAAOs3I,YAAsBtB,GACjCp+R,YACEu/R,EAEAlB,EACAE,EACAC,EACSp2I,GAET9gF,MACEi4N,EACAlB,EACAF,GAAec,IACfV,EACAC,EACAp2I,GAROnoJ,KAAUmoJ,WAAVA,GCTP,MAAOu3I,YAAuBvB,GAClCp+R,YACE6a,EACA0jR,EACAC,GAEAl3N,MACEzsD,GACA,EACAsjR,GAAeprR,KACfwrR,EACAC,UCXOoB,IAAuB,IAAIn1M,GAAgC,uBCF5Do1M,SAAZ,SAAYA,GACVA,iEACAA,iFACAA,mEACAA,+DACAA,2DACAA,qDACAA,uEACAA,uDACAA,2CACAA,6CACAA,kDACAA,4CACAA,gDACAA,wDACAA,wCACAA,kDACAA,kBACAA,4CACAA,oCACAA,kDACAA,8EACAA,sEACAA,sCACAA,gCACAA,4BACAA,wCACAA,0CACAA,0DACAA,sFACAA,8CACAA,4CACAA,sCACAA,gDACAA,gDACAA,sDACAA,oDACAA,gFACAA,0EACAA,0DACAA,kCACAA,oDACAA,wFACAA,sDACAA,8EACAA,8DACAA,0D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mmB,GAAgBnmB,GAAgBa,uBAAuBsgP,GAS7D3sN,GAAc4sN,EAAgB,IACzB3sN,SAASrI,GAA0C,GACnDr1G,QAAQk1D,GAAc,CAACo1Q,EAAiBzxW,KACxCmnC,QACGsqU,EACA,KACE,IAAK1yV,EACH,MAAM,IAAI1qB,MACN,6FAGN,OAAO0qB,IAEZooB,QAAQo1G,GAAiB,CAAC2G,EAAkBljJ,KAC5CmnC,QACG+7G,EACA,CACEnH,GACCn2I,IACCm+I,GAAmBn+I,GACnB,MAAM5C,EAAwB,CAC5BgC,QAAS0sW,EAAY1tN,IAAmB9zI,KAAKoV,IAC3CvG,EAAW/b,EAAO+b,SAAW,IAAIslI,GAAkB/+H,EAAIvG,UACvDA,EAASvnB,IAAIukJ,IAObh9H,EAASvnB,IAAIi5H,IAAatlD,UAAU,IAAMoyE,GAAW33I,IAE9CmZ,KAGX,OAAO/b,KAGdkP,OAAO,CACN6pI,GAAWG,GACX,CAACt2I,EAA6Bk/I,KAC5BA,EAASD,SAASvI,GAA6BoB,GAAyB93I,GAAa,EAAC,IAIvF4rW,CACT,Cg1B9YEF,CARF,SAASI,IAAYthP,GAEnB,MAAMprH,EAAU6sW,GAAuBzhP,GAAgB8B,gBAAgB8+O,KACvEhsW,SAAQC,MAAO0M,GAAQtI,QAAQjE,MAAMuM,IAC9B3M,CACT,KAKAmqU,qBAA+ChgP,KAE/CxxF,QAAQ4sE,UAAU12E,SAASC,KAAM,CAAC,mBCzClC,eACA,8CACA,gCACAoR,CACA,CACA4sW,eACAA,cACAA,WACAj2T","names":["POLYFILL_CONSOLE_OUTPUT","prettifyConsoleOutput","fn","toString","requestAnimationFrame","window","observerConfig","attributes","characterData","childList","subtree","events","rafSlot","Map","resizeObserverSlot","scheduled","dispatchCallbacksOnNextFrame","runSchedule","t","frameCallbacks","resizeObserverCallbacks","forEach","callback","push","clear","scheduler","Scheduler","constructor","this","stopped","listener","schedule","run","frames","set","elementsHaveResized","process","start","stop","observe","cb","observer","document","body","addEventListener","MutationObserver","name","disconnect","removeEventListener","rafIdBase","Error","handle","cancelAnimationFrame","delete","ResizeObserverBoxOptions","BORDER_BOX","CONTENT_BOX","SCROLL_BOX","DEVICE_PIXEL_BORDER_BOX","DOMRectReadOnly","x","y","width","height","top","left","bottom","right","Object","freeze","static","rectangle","isSVG","target","SVGElement","isHidden","getBBox","offsetWidth","offsetHeight","getClientRects","length","cache","scrollRegexp","IE","test","navigator","userAgent","parseDimension","pixel","parseFloat","size","inlineSize","blockSize","zeroBoxes","borderBoxSize","contentBoxSize","scrollBoxSize","devicePixelBorderBoxSize","contentRect","calculateBoxSizes","has","get","cs","getComputedStyle","dpr","devicePixelRatio","svg","removePadding","boxSizing","canScrollVertically","overflowY","canScrollHorizontally","overflowX","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTop","borderTopWidth","borderRight","borderRightWidth","borderBottom","borderBottomWidth","horizontalPadding","verticalPadding","horizontalBorderArea","borderLeftWidth","verticalBorderArea","horizontalScrollbarThickness","clientHeight","verticalScrollbarThickness","clientWidth","widthReduction","heightReduction","contentWidth","contentHeight","borderBoxWidth","borderBoxHeight","boxes","calculateBoxSize","observedBox","ResizeObservation","lastReportedSize","isActive","ResizeObserverDetail","resizeObserver","activeTargets","skippedTargets","observationTargets","msg","ResizeObserverEntry","contentSize","scrollSize","calculateDepthForNode","node","Infinity","depth","parent","parentNode","broadcastActiveObservations","shallowestDepth","callbacks","resizeObservers","ro","entries","ot","entry","targetDepth","splice","gatherActiveObservationsAtDepth","sizeCache","observerMap","watching","updateCount","n","getObservationIndex","i","deliverResizeLoopError","event","ErrorEvent","message","createEvent","initEvent","dispatchEvent","ResizeObserverController","detail","options","box","index","indexOf","DPPB","ResizeObserver","arguments","TypeError","Element","tagName","unobserve","root","self","global","angular","fromJson","JSON","parse","bind","toJson","stringify","_forEach","obj","_this","isArray","keys","key","extend","assign","_extend","toObj","j","equals","_equals","o1","o2","t1","tup","all","_arraysEq","a1","a2","arrayTuples","reduce","b","isDate","getTime","isRegExp","isFunction","map","any","identity","noop","createProxyFunctions","source","fnNames","latebind","bindFunction","fnName","acc","apply","makeLateRebindFn","inherit","extra","create","inArray","curry","_inArray","array","removeFrom","_removeFrom","idx","pushTo","_pushTo","arr","val","deregAll","functions","slice","defaults","opts","defaultsList","defaultVals","reverse","pick","mergeR","memo","item","ancestors","first","second","path","propNames","objCopy","_prop","omit","filter","not","collection","result","accept","find","mapObj","values","allTrueR","elem","anyTrueR","unnestR","concat","flattenR","pushR","uniqR","token","unnest","assertPredicate","assertFn","predicateOrMap","errMsg","args","maxArrayLen","min","applyPairs","keyValTuple","value","isString","tail","undefined","copy","src","dest","silenceUncaughtInPromise","promise","catch","e","silentRejection","error","services","makeStub","service","methods","fnname","noImpl","$q","$injector","text","glob","split","regexpString","seg","join","regexp","RegExp","Glob","exec","is","curried","Array","prototype","call","__spreadArrays","compose","pipe","funcs","prop","propEq","_val","and","fn1","fn2","or","ctor","v","pattern","struct","toStr","tis","isUndefined","isDefined","isNull","o","isNullOrUndefined","isNumber","isObject","isInjectable","head","isPromise","Queue","_items","_limit","_evictListeners","items","evict","shift","current","noopConsoleStub","log","table","safeConsole","getSafeConsole","documentMode","console","ie9Console","bound","fallbackConsole","maxLength","max","str","substr","padString","kebobString","camelCase","replace","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","match","_fn","seen","isRejection","Rejection","stringifyPattern","_transitionRejection","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","uiViewString","uiview","id","$type","fqn","creationContext","normalizedCat","input","Category","_tid","_rid","transLbl","trans","trace","approximateDigests","Trace","enabled","categories","k","isNaN","category","_enabled","_set","TRANSITION","step","HOOK","context","registeredHook","hookResult","transitionOptions","when","RESOLVE","resolvable","data","reason","finalState","viewData","UIVIEW","traceUIViewEvent","html","pairs","VIEWCONFIG","uivheader","mapping","_a","uiView","viewConfig","cfg","viewDecl","$context","$name","_b","sort","a","localeCompare","view","$id","$uiViewName","$uiViewContextAnchor","viewConfigString","UIRouterGlobals","StateParams","transitionHistory","successfulTransitions","transition","lazyLoadHook","router","promises","entering","state","$$state","lazyLoad","then","retryTransition","originalTransition","orig","targetState","stateService","identifier","params","$url","urlService","parts","rule","type","sync","registerLazyLoadHook","transitionService","onBefore","lazyLoadState","lazyLoadFn","_promise","updateStateRegistry","states","_state","stateRegistry","register","err","hasOwn","hasOwnProperty","isShorthand","DefType","location","urlConfig","config","getParamDeclaration","paramName","dynamic","reloadOnSearch","SEARCH","defaultConfig","paramConfig","unwrapShorthand","getStaticDefaultValue","__cacheable","$$fn","getType","urlType","paramTypes","ParamType","CONFIG","PATH","arrayMode","getArrayMode","arrayDefaults","arrayParamNomenclature","$asArray","isOptional","raw","squash","getSquashPolicy","defaultPolicy","defaultSquashPolicy","getReplace","from","to","configuredKeys","Param","paramValues","_i","param","params_1","values1","values2","changed","validates","tuple","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","normalized","encoded","encode","def","sub","decode","mode","isSearch","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","paramTypeFn","$arrayMode","ParamTypes","types","defaultTypes","definition","definitionFn","typeQueue","enqueue","_flushTypeQueue","initDefaultTypes","makeDefaultType","valToString","defaultTypeBase","String","string","query","hash","int","bool","parseInt","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","r","json","newParams","$current","$to","parents","inherited","inheritList","parentParams","parentParamsKeys","PathNode","stateOrNode","paramSchema","resolvables","views","parameters","res","clone","pDef","paramDef","getParamVal","paramsFn","diff","PathUtils","registry","TargetState","toParams","$state","applyRawParams","fromPath","toPath","buildPath","inheritParams","$view","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","makeInheritedParamsNode","toNode","toParamVals","incomingParamVals","fromParamVals","nodeParamVals","ownParamVals","reloadState","Math","keep","nonDynamicParams","retained","exiting","retainedWithToParams","applyToParams","retainedNode","cloned","pathA","pathB","done","tuples","matching","nodeA","predicate","elementIdx","resolvePolicies","LAZY","EAGER","async","WAIT","NOWAIT","Resolvable","arg1","resolveFn","deps","policy","resolved","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","getPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","resolve","whens","ALL_WHENS","EAGER_WHENS","NATIVE_INJECTOR_TOKEN","ResolveContext","_path","newResolvables","matchedWhens","whenOption","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","subContext","getResult","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","injector","getNative","native","getResolvable","_routerInstance","locationServiceStub","locationConfigStub","UIRouter","locationService","locationConfig","ViewService","TransitionService","UrlMatcherFactory","UrlRouter","UrlService","StateRegistry","StateService","viewService","_pluginapi","_rootViewContext","globals","disposable","_disposables","dispose","_disposed","d","plugin","pluginInstance","_plugins","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateObject","stateDec","url","newStateDec","parsed","charAt","substring","parseUrl","compile","isMatcher","navigable","append","getNavigableBuilder","isRoot","getParamsBuilder","paramFactory","urlParams","nonUrlParams","fromConfig","p","pathBuilder","includesBuilder","includes","resolvablesBuilder","resolveObj","getToken","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","$inject","annotate","strictDi","item2Resolvable","decl","matcher","urlMatcherFactory","builders","parentBuilder","parentName","StateBuilder","chain","parentFn","segments","pop","StateMatcher","_states","stateName","stateOrName","base","matchGlob","isStr","isRelative","resolvePath","matches","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","parameter","__uiRouterState","StateQueueManager","builder","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","s","name_1","build","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","rules","urlRuleFactory","stateQueue","_registerRoot","_root","stateDefinition","getChildren","_children","children","deregistered","removeRule","deregisteredStates","_deregisterTree","found","property","builderFunction","$error$","stack","boundFns","defaultErrorHandler","invalidCallbacks","toState","fromState","latestThing","peekTail","latest","callbackQueue","checkForRedirect","valid","toPromise","transitionTo","invokeNextCallback","nextCallback","dequeue","reload","notify","transOpts","relative","defaultTransOpts","reg","latestSuccess","treeChanges","getCurrent","currentPath","getCurrentPath","exists","_handleInvalidTargetState","supercede","rejectedTransitionHandler","isLatest","lastStartedTransitionId","RejectType","urlRouter","update","redirected","redirect","errorHandler","transitionToPromise","schema","include","lossy","absolute","$inherit","nav","href","handler","_defaultErrorHandler","_stateRegistry","_identifier","_params","_options","_definition","newOpts","HookBuilder","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","baseHookOptions","hook","criteriaMatchPath","traceData","transitionHook","TransitionHook","scope","TransitionHookScope","tupleSort","reverseDepthSort","depthDelta","priority","reverseSort","$transitions","hookPhase","TransitionHookPhase","getHooks","matchState","criterion","toMatch","matchFn","matchGlobs","globStrings","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeLimit","RegisteredHook","nodes","_getPathTypes","criteria","_getDefaultMatchCriteria","paths","mn","pathtype","_matchingNodes","_getMatchingNodes","allMatched","every","_deregistered","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","rejection","SUPERSEDED","superseded","INVALID","IGNORED","ABORTED","ERROR","errored","stateSelf","Transition","_deferred","_targetState","_transitionCount","_treeChanges","createTransitionHookRegFns","onCreateHooks","_hookBuilder","buildHooksForPhase","applyViewConfigs","hookName","enteringStates","$from","compare","pathname","fromParams","allParamDescriptors","pathNode","changedValues","descriptor","pathName","getTokens","topath","targetNode","addResolvables","redirectedFrom","rf","redirects","redirectOpts","newOptions","withOptions","newTransition","originalEnteringNodes","matchingEnteringNodes","tc","pathsDiffer","nodeSchemas","changes","_changedParams","_ignoredReason","pending","same","newTC","pendTC","runAllHooks","getHooksFor","allBeforeHooks","allRunHooks","success","reject","_error","_aborted","paramDefs","invalidParams","invalidValues","fromStateOrName","toStateOrName","avoidEmptyHash","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","stateContext","waitFor","nextHook","invokeHook","doneCallback","remainingHooks","notCurrent","getNotCurrentRejection","handleError","handleResult","invokeCount","handleHookResult","isTargetState","isSuperseded","logError","addCoreResolvables","addResolvable","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","load","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","onSuccess","updateUrl","$urlRouter","ignoredHook","ignoredReason","abort","invalidTransitionHook","custom","_router","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onEvict","hooksArray","Phase","TH","_criteriaPaths","_defineEvent","CREATE","LOG_REJECTED_RESULT","THROW_ERROR","BEFORE","RUN","SUCCESS","LOG_ERROR","_definePathType","STATE","_eventTypes","transitionHookTypes","cmpByPhase","hookScope","fns","addCoreResolves","onCreate","registerAddCoreResolvables","ignored","registerIgnoredTransitionHook","invalid","registerInvalidTransitionHook","onStart","registerRedirectToHook","onExit","registerOnExitHook","onRetain","registerOnRetainHook","onEnter","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","onFinish","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","baseHref","newprefix","hashPrefix","host","html5Mode","port","protocol","_isCaseInsensitive","_defaultSquashPolicy","_isStrictMode","quoteRegExp","surroundPattern","splitOnSlash","strict","caseInsensitive","decodeParams","UrlMatcher","matchArray","details","segment","placeholder","searchPlaceholder","patterns","last","checkParamErrors","nameValidator","matchDetails","m","_segments","lastIndex","search","fromSearch","_compiled","_pattern","encodeURIComponent","c","charCodeAt","toUpperCase","staticSegments","pathParams","weights","_cache","pathSegmentsAndParams","weightsA","weightsB","padVal","len","padArrays","cmp","_pairs","paramValue","decodeURIComponent","memoizeTo","reverseString","allReversed","allParams","searchParams","nPathSegments","urlm","_getDecodedParamValue","findParam","validParamVal","urlMatchers","getDetails","queryParams","isValid","isDefaultValue","pathString","encodeDashes","queryString","paramDetails","ParamFactory","strictMode","__assign","_decodeParams","object","evt","listen","defer","deferIntercept","urlParts","initial","otherwise","compareFn","UrlRuleFactory","read","urlMatcher","isHtml5","appendBasePath","slash","cfgPort","interceptDeferred","what","isState","isStateDeclaration","makeRule","_what","fromUrlMatcher","fromRegExp","BaseUrlRule","_handler","matchPriority","optional","matchUrlParamters","stateOrDecl","sticky","Number","defaultRuleSortFn","getHandlerFn","prioritySort","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_rules","_otherwiseFn","handlerFn","_sorted","_id","ensureSorted","sorted","stableSort","_sortFn","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","newurl","onChange","defaultPrevented","best","applyResult","go","_stopListeningFn","weight","Promise","deferred","STRIP_COMMENTS","ARGUMENT_NAMES","invoke","locals","ensureExist","keyValsToObjectR","accum","getParams","orEmptyString","locationPluginFactory","serviceClass","configurationClass","uiRouter","configuration","fireAfterUpdate","_listeners","_get","_location","_history","BaseLocationServices","loc","searchObject","vals","buildUrl","HashLocationService","_super","_listener","__extends","title","MemoryLocationService","_url","PushStateLocationService","_config","basePrefix","_getBasePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","BrowserLocationConfig","_isHtml5","hostname","_hashPrefix","_baseHref","getBaseHref","baseTag","getElementsByTagName","servicesPlugin","_port","_protocol","_host","newval","_viewConfigFactory","_registeredUIView","_uiViews","_registeredUIViews","_activeViewConfigs","_viewConfigs","_onSync","rawViewName","viewAtContext","uiViewName","uiViewContextAnchor","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","factory","_viewConfigFactories","cfgFactory","cfgs","uiViewsByFqn","uiv","viewConfigDepth","count","depthCompare","depthFn","posNeg","uiViewTuples","uiViewDepth","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","configUpdated","allTuples","uiViews","vcSegments","uivSegments","fqnToFirstSegment","uiViewContext","exports","hookCallback","some","hasOwnProp","isObjectEmpty","getOwnPropertyNames","createUTC","locale","createLocalOrUTC","utc","getParsingFlags","_pf","empty","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidEra","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","era","meridiem","rfc2822","weekdayMismatch","_isValid","flags","parsedParts","isNowValid","_d","invalidWeekday","_strict","bigHour","isFrozen","createInvalid","NaN","fun","momentProperties","updateInProgress","copyConfig","_isAMomentObject","_f","_l","_tzm","_isUTC","_offset","_locale","Moment","updateOffset","isMoment","warn","suppressDeprecationWarnings","deprecate","firstTime","deprecationHandler","arg","deprecations","deprecateSimple","Function","mergeConfigs","parentConfig","childConfig","Locale","zeroFill","number","targetLength","forceSign","absNumber","abs","pow","formattingTokens","localFormattingTokens","formatFunctions","formatTokenFunctions","addFormatToken","padded","ordinal","func","localeData","removeFormattingTokens","formatMoment","expandFormat","makeFormatFunction","mom","output","invalidDate","replaceLongDateFormatTokens","longDateFormat","aliases","addUnitAlias","unit","shorthand","lowerCase","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","priorities","addUnitPriority","isLeapYear","year","absFloor","ceil","floor","toInt","argumentForCoercion","coercedNumber","isFinite","makeGetSet","keepTime","set$1","month","daysInMonth","regexes","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchOffset","matchShortOffset","matchWord","addRegexToken","regex","strictRegex","isStrict","getParseRegexForToken","unescapeFormat","regexEscape","matched","p1","p2","p3","p4","tokens","addParseToken","addWeekParseToken","_w","addTimeToArrayFromToken","YEAR","MONTH","DATE","HOUR","MINUTE","SECOND","MILLISECOND","WEEK","WEEKDAY","modMonth","mod","monthsShort","months","monthsShortRegex","monthsRegex","monthsParse","defaultLocaleMonths","defaultLocaleMonthsShort","MONTHS_IN_FORMAT","defaultMonthsShortRegex","defaultMonthsRegex","handleStrictParse","monthName","ii","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","setMonth","dayOfMonth","getSetMonth","computeMonthsParse","cmpLenRev","shortPieces","longPieces","mixedPieces","_monthsRegex","_monthsShortRegex","_monthsStrictRegex","_monthsShortStrictRegex","daysInYear","parseTwoDigitYear","getSetYear","createDate","h","M","ms","setFullYear","createUTCDate","UTC","getUTCFullYear","setUTCFullYear","firstWeekOffset","dow","doy","fwd","getUTCDay","dayOfYearFromWeeks","week","weekday","resYear","resDayOfYear","dayOfYear","weekOfYear","resWeek","weekOffset","weeksInYear","weekOffsetNext","shiftWeekdays","ws","weekdaysMin","weekdaysShort","weekdays","weekdaysMinRegex","weekdaysShortRegex","weekdaysRegex","weekdaysParse","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","defaultWeekdaysRegex","defaultWeekdaysShortRegex","defaultWeekdaysMinRegex","handleStrictParse$1","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","day","computeWeekdaysParse","minp","shortp","longp","minPieces","_weekdaysRegex","_weekdaysShortRegex","_weekdaysMinRegex","_weekdaysStrictRegex","_weekdaysShortStrictRegex","_weekdaysMinStrictRegex","hFormat","hours","lowercase","minutes","matchMeridiem","_meridiemParse","kFormat","seconds","kInput","_isPm","isPM","_meridiem","pos","pos1","pos2","getSetHour","globalLocale","baseConfig","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","LTS","LT","L","LL","LLL","LLLL","dayOfMonthOrdinalParse","relativeTime","future","past","ss","mm","hh","dd","w","ww","MM","yy","meridiemParse","locales","localeFamilies","commonPrefix","arr1","arr2","minl","normalizeLocale","loadLocale","oldLocale","module","_abbr","aliasedRequire","getSetGlobalLocale","getLocale","defineLocale","abbr","parentLocale","chooseLocale","names","next","checkOverflow","_overflowDayOfYear","_overflowWeeks","_overflowWeekday","extendedIsoRegex","basicIsoRegex","tzRegex","isoDates","isoTimes","aspNetJsonRegex","obsOffsets","UT","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","configFromISO","allowTime","dateFormat","timeFormat","tzFormat","configFromStringAndFormat","untruncateYear","yearStr","configFromRFC2822","parsedArray","preprocessRFC2822","extractFromRFC2822Strings","monthStr","dayStr","hourStr","minuteStr","secondStr","checkWeekday","weekdayStr","parsedInput","getDay","calculateOffset","obsOffset","militaryOffset","numOffset","hm","setUTCMinutes","getUTCMinutes","configFromArray","currentDate","expectedWeekday","yearToUse","currentDateArray","nowValue","now","_useUTC","getUTCMonth","getUTCDate","dayOfYearFromWeekInfo","weekYear","temp","weekdayOverflow","curWeek","GG","W","E","createLocal","_week","gg","_dayOfYear","_nextDay","ISO_8601","RFC_2822","skipped","stringLength","totalParsedInputLength","meridiemFixWrap","hour","isPm","meridiemHour","erasConvertYear","prepareConfig","preparse","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","validFormatFound","bestFormatIsValid","score","configFromInput","configFromString","createFromInputFallback","configFromObject","minute","millisecond","isUTC","createFromConfig","add","prototypeMin","other","prototypeMax","pickBy","moments","ordering","Duration","duration","years","quarters","quarter","weeks","isoWeek","days","milliseconds","isDurationValid","unitHasDecimal","_milliseconds","_days","_months","_data","_bubble","isDuration","absRound","round","offset","separator","utcOffset","sign","offsetFromString","chunkOffset","cloneWithOffset","model","setTime","local","getDateOffset","getTimezoneOffset","isUtc","aspNetRegex","isoRegex","createDuration","ret","diffRes","parseIso","momentsDifference","isBefore","positiveMomentsDifference","inp","isAfter","createAdder","direction","period","tmp","addSubtract","isAdding","createInvalid$1","subtract","isMomentInput","isNumberOrStringArray","arrayTest","dataTypeTest","isMomentInputObject","objectTest","propertyTest","properties","monthDiff","wholeMonthDiff","newLocaleData","defaultFormat","defaultFormatUtc","lang","MS_PER_SECOND","MS_PER_MINUTE","MS_PER_HOUR","MS_PER_400_YEARS","mod$1","dividend","divisor","localStartOfDate","utcStartOfDate","matchEraAbbr","erasAbbrRegex","computeErasParse","abbrPieces","namePieces","narrowPieces","eras","narrow","_erasRegex","_erasNameRegex","_erasAbbrRegex","_erasNarrowRegex","addWeekYearFormatToken","getter","getSetWeekYearHelper","weeksTarget","setWeekAll","dayOfYearData","matchEraName","erasNameRegex","matchEraNarrow","erasNarrowRegex","erasParse","matchEraYearOrdinal","_eraYearOrdinalRegex","eraYearOrdinalParse","isoWeekYear","_dayOfMonthOrdinalParse","_ordinalParse","_dayOfMonthOrdinalParseLenient","getSetDayOfMonth","getSetMinute","getSetMillisecond","getSetSecond","parseMs","proto","preParsePostFormat","calendar$1","time","formats","isCalendarSpec","sod","startOf","calendarFormat","asFloat","that","zoneDelta","endOf","startOfDate","isoWeekday","inputString","postformat","withoutSuffix","humanize","fromNow","toNow","stringGet","invalidAt","localInput","isBetween","inclusivity","localFrom","localTo","isSame","inputMs","isSameOrAfter","isSameOrBefore","isValid$2","parsingFlags","stringSet","prioritized","getPrioritizedUnits","unitsObj","u","toArray","toObject","toDate","toISOString","keepOffset","inspect","prefix","zone","isLocal","Symbol","for","toJSON","unix","creationData","eraName","getEraName","since","until","eraNarrow","getEraNarrow","eraAbbr","getEraAbbr","eraYear","getEraYear","dir","getIsLeapYear","getSetWeekYear","getSetISOWeekYear","getSetQuarter","getDaysInMonth","getSetWeek","isoWeeks","getSetISOWeek","getWeeksInYear","weekInfo","weeksInWeekYear","getWeeksInWeekYear","isoWeeksInYear","getISOWeeksInYear","isoWeeksInISOWeekYear","getISOWeeksInISOWeekYear","getSetDayOfWeek","parseWeekday","getSetLocaleDayOfWeek","getSetISODayOfWeek","parseIsoWeekday","getSetDayOfYear","getSetOffset","keepLocalTime","keepMinutes","localAdjust","_changeInProgress","setOffsetToUTC","setOffsetToLocal","parseZone","setOffsetToParsedOffset","tZone","hasAlignedHourOffset","isDST","isDaylightSavingTime","isUtcOffset","zoneAbbr","getZoneAbbr","zoneName","getZoneName","dates","getSetZone","isDSTShifted","isDaylightSavingTimeShifted","_isDSTShifted","compareArrays","array1","array2","dontConvert","lengthDiff","diffs","proto$1","get$1","field","setter","listMonthsImpl","out","listWeekdaysImpl","localeSorted","_calendar","_longDateFormat","formatUpper","tok","_invalidDate","_ordinal","isFuture","_relativeTime","pastFuture","localeEras","_eras","localeErasParse","localeErasConvertYear","localeMonths","isFormat","standalone","localeMonthsShort","_monthsShort","localeMonthsParse","_monthsParseExact","localeWeek","firstDayOfYear","localeFirstDayOfYear","firstDayOfWeek","localeFirstDayOfWeek","localeWeekdays","_weekdays","localeWeekdaysMin","_weekdaysMin","localeWeekdaysShort","_weekdaysShort","localeWeekdaysParse","_weekdaysParseExact","_fullWeekdaysParse","localeIsPM","localeMeridiem","isLower","langData","mathAbs","addSubtract$1","absCeil","daysToMonths","monthsToDays","makeAs","alias","as","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asQuarters","asYears","makeGetter","thresholds","substituteTimeAgo","abs$1","toISOString$1","totalSign","ymSign","daysSign","hmsSign","total","toFixed","proto$2","isValid$1","add$1","subtract$1","valueOf$1","bubble","monthsFromDays","clone$1","get$2","argWithSuffix","argThresholds","withSuffix","th","relativeTime$1","posNegDuration","toIsoString","version","setHookCallback","createUnix","listMonths","listWeekdays","createInZone","listMonthsShort","listWeekdaysMin","updateLocale","tmpLocale","listLocales","listWeekdaysShort","relativeTimeRounding","getSetRelativeTimeRounding","roundingFunction","relativeTimeThreshold","getSetRelativeTimeThreshold","threshold","limit","getCalendarFormat","myMoment","HTML5_FMT","DATETIME_LOCAL","DATETIME_LOCAL_SECONDS","DATETIME_LOCAL_MS","TIME","TIME_SECONDS","TIME_MS","_enable_super_gross_mode_that_will_cause_bad_things","useDeprecatedSynchronousErrorHandling","hostReportError","setTimeout","closed","complete","UnsubscriptionError","UnsubscriptionErrorImpl","errors","Subscription","unsubscribe","_ctorUnsubscribe","_unsubscribe","_parentOrParents","_subscriptions","remove","flattenUnsubscriptionErrors","teardown","subscription","EMPTY","subscriptions","subscriptionIndex","errs","rxSubscriber","random","Subscriber","destinationOrNext","super","destination","emptyObserver","syncErrorThrowable","SafeSubscriber","q","rxSubscriberSymbol","subscriber","isStopped","_next","_complete","_unsubscribeAndRecycle","_parentSubscriber","observerOrNext","_context","__tryOrSetError","__tryOrUnsub","syncErrorValue","syncErrorThrown","wrappedComplete","observable","Observable","subscribe","_subscribe","lift","operator","sink","toSubscriber","nextOrObserver","_trySubscribe","canReportError","promiseCtor","getPromiseCtor","N","Symbol_observable","operations","pipeFromArray","ObjectUnsubscribedError","ObjectUnsubscribedErrorImpl","SubjectSubscription","subject","observers","subscriberIndex","SubjectSubscriber","Subject","AnonymousSubject","hasError","thrownError","asObservable","isScheduler","project","thisArg","MapOperator","MapSubscriber","subscribeToArray","iterator","getSymbolIterator","isArrayLike","subscribeTo","obs","subscribeToObservable","subscribeToPromise","Symbol_iterator","iterable","return","subscribeToIterable","scheduleArray","isInteropObservable","scheduleObservable","schedulePromise","isIterable","scheduleIterable","SimpleInnerSubscriber","notifyNext","notifyError","notifyComplete","SimpleOuterSubscriber","innerValue","innerSubscribe","innerSubscriber","mergeMap","resultSelector","concurrent","POSITIVE_INFINITY","MergeMapOperator","MergeMapSubscriber","active","_tryNext","buffer","_innerSub","ish","innerSubscription","hasCompleted","mergeAll","fromArray","merge","observables","refCount","RefCountOperator","connectable","_refCount","refCounter","RefCountSubscriber","connection","connect","sharedConnection","_connection","ConnectableObservable","subjectFactory","getSubject","_subject","_isComplete","ConnectableSubscriber","higherOrderRefCount","connectableObservableDescriptor","connectableProto","writable","MulticastOperator","selector","shareSubjectFactory","share","multicast","subjectOrSubjectFactory","getClosureSafeProperty","objWithPropertyToExtract","overriddenName","newLineIndex","before","after","__forward_ref__","forwardRef","forwardRefFn","resolveForwardRef","isForwardRef","isEnvironmentProviders","ɵproviders","XSS_SECURITY_URL","RuntimeError","formatRuntimeError","code","trim","renderStringify","injectorName","actual","throwError","expected","comparison","ɵɵdefineInjectable","providedIn","ɵɵdefineInjector","providers","imports","getInjectableDef","getOwnDefinition","NG_PROV_DEF","NG_INJECTABLE_DEF","getInjectorDef","NG_INJ_DEF","NG_INJECTOR_DEF","ɵprov","ɵinj","ngInjectableDef","ngInjectorDef","InjectFlags","_injectImplementation","setInjectImplementation","impl","previous","injectRootLimpMode","notFoundValue","injectableDef","Optional","throwProviderNotFoundError","_global","globalThis","WorkerGlobalScope","THROW_IF_NOT_FOUND","DI_DECORATOR_FLAG","NG_TEMP_TOKEN_PATH","NG_TOKEN_PATH","NEW_LINE","NO_NEW_LINE","SOURCE","_currentInjector","setCurrentInjector","former","injectInjectorOnly","Default","ngDevMode","ɵɵinject","getInjectImplementation","inject","convertToBitFlags","skipSelf","injectArgs","meta","flag","getInjectFlag","decorator","noSideEffects","ChangeDetectionStrategy","ViewEncapsulation","EMPTY_OBJ","EMPTY_ARRAY","NG_COMP_DEF","ɵcmp","NG_DIR_DEF","ɵdir","NG_PIPE_DEF","ɵpipe","NG_MOD_DEF","ɵmod","NG_FACTORY_DEF","ɵfac","NG_ELEMENT_ID","__NG_ELEMENT_ID__","componentDefCount","ɵɵdefineComponent","componentDefinition","declaredInputs","providersResolver","decls","vars","template","consts","ngContentSelectors","hostBindings","hostVars","hostAttrs","contentQueries","inputs","outputs","exportAs","onPush","changeDetection","OnPush","directiveDefs","pipeDefs","getStandaloneInjector","selectors","viewQuery","features","encapsulation","Emulated","styles","_","setInput","schemas","tView","findHostDirectiveDefs","hostDirectives","feature","invertObject","extractDirectiveDef","nonNull","getPipeDef","getComponentDef","getDirectiveDef","ɵɵdefineNgModule","bootstrap","declarations","transitiveCompileScopes","secondary","newLookup","minifiedKey","publicName","declaredName","ɵɵdefineDirective","ɵɵdefinePipe","pipeDef","pure","onDestroy","ngOnDestroy","throwNotFound","ngModuleDef","HOST","TVIEW","FLAGS","PARENT","NEXT","TRANSPLANTED_VIEWS_TO_REFRESH","T_HOST","CLEANUP","CONTEXT","INJECTOR","RENDERER_FACTORY","RENDERER","SANITIZER","CHILD_HEAD","CHILD_TAIL","DECLARATION_VIEW","DECLARATION_COMPONENT_VIEW","DECLARATION_LCONTAINER","PREORDER_HOOK_FLAGS","QUERIES","ID","EMBEDDED_VIEW_INJECTOR","HEADER_OFFSET","TYPE","HAS_TRANSPLANTED_VIEWS","NATIVE","VIEW_REFS","MOVED_VIEWS","CONTAINER_HEADER_OFFSET","isLView","isLContainer","isContentQueryHost","tNode","isComponentHost","componentOffset","isDirectiveHost","isComponentDef","isRootView","SimpleChange","previousValue","currentValue","firstChange","isFirstChange","ɵɵNgOnChangesFeature","NgOnChangesFeatureImpl","ngOnChanges","ngOnChangesSetInput","rememberChangeHistoryAndInvokeOnChangesHook","simpleChangesStore","getSimpleChangesStore","instance","privateName","setSimpleChangesStore","store","SIMPLE_CHANGES_STORE","previousChange","ngInherit","profiler","hookOrListener","SVG_NAMESPACE","unwrapRNode","lView","nodeIndex","hostView","slotValue","viewAttachedToChangeDetector","resetPreOrderHookFlags","lContainer","amount","viewOrContainer","instructionState","lFrame","createLFrame","bindingsEnabled","getBindingsEnabled","getLView","getTView","ɵɵrestoreView","viewToRestore","contextLView","ɵɵresetView","getCurrentTNode","currentTNode","getCurrentTNodePlaceholderOk","isParent","isCurrentTNodeParent","setCurrentTNodeAsNotParent","getBindingRoot","bindingRootIndex","bindingStartIndex","getBindingIndex","bindingIndex","nextBindingIndex","incrementBindingIndex","currentDirectiveIndex","setCurrentDirectiveIndex","getCurrentQueryIndex","currentQueryIndex","setCurrentQueryIndex","getDeclarationTNode","declTNode","enterDI","SkipSelf","parentTNode","parentLView","Host","allocLFrame","enterView","newView","newLFrame","firstChild","inI18n","currentLFrame","childLFrame","child","selectedIndex","elementDepthCount","currentNamespace","leaveViewLight","oldLFrame","leaveDI","leaveView","getSelectedIndex","setSelectedIndex","getSelectedTNode","getTNode","directiveStart","end","directiveEnd","lifecycleHooks","ngAfterContentInit","ngAfterContentChecked","ngAfterViewInit","ngAfterViewChecked","contentHooks","contentCheckHooks","viewHooks","viewCheckHooks","destroyHooks","executeCheckHooks","callHooks","executeInitAndCheckHooks","initPhase","currentView","currentNodeIndex","nodeIndexLimit","lastNodeIndexFound","callHook","isInitHook","directive","NO_PARENT_INJECTOR","NodeInjectorFactory","isViewProvider","injectImplementation","resolving","canSeeViewProviders","injectImpl","setUpAttributes","renderer","attrs","namespaceURI","attrName","attrVal","setAttribute","isAnimationProp","setProperty","isNameOnlyAttributeMarker","marker","dst","srcMarker","mergeHostAttribute","key1","key2","markerInsertPosition","dstValue","hasParentInjector","parentLocation","getParentInjectorIndex","startView","viewOffset","getParentInjectorViewOffset","parentView","includeViewProviders","setIncludeViewProviders","oldValue","BLOOM_MASK","BLOOM_BUCKET_BITS","nextNgElementId","NOT_FOUND","existingInjectorIndex","getInjectorIndex","firstCreatePass","injectorIndex","insertBloom","blueprint","parentLoc","getParentInjectorLocation","parentIndex","getParentInjectorView","parentData","footer","declarationViewOffset","lViewCursor","getTNodeFromLView","diPublicInInjector","bloomAdd","bloomHash","notFoundValueOrThrow","lookupTokenUsingModuleInjector","Self","moduleInjector","previousInjectImplementation","embeddedInjectorValue","lookupTokenUsingEmbeddedInjector","currentLView","nodeInjectorValue","lookupTokenUsingNodeInjector","embeddedViewInjector","embeddedViewInjectorValue","bloomHashBitOrFactory","tokenId","createNodeInjector","previousTView","hostTElementNode","shouldSearchParent","bloomHasToken","searchTokensOnInjector","currentTView","injectableIdx","locateDirectiveOrProvider","getNodeInjectable","canAccessViewProviders","isHostSpecialCase","nodeProviderIndexes","providerIndexes","tInjectables","injectablesStart","directivesStart","cptViewProvidersCount","endIndex","providerTokenOrDef","dirDef","tData","isFactory","depPath","throwCyclicDependencyError","stringifyForError","previousIncludeViewProviders","registerPreOrderHooks","directiveIndex","directiveDef","ngOnInit","ngDoCheck","wrappedOnChanges","preOrderHooks","preOrderCheckHooks","injectorView","isFirstHostTNode","NodeInjector","_lView","_tNode","getOrCreateInjectable","ɵɵgetInheritedFactory","ownConstructor","ownFactory","getFactoryOf","objectPrototype","getPrototypeOf","getFactoryDef","tViewType","ANNOTATIONS","PARAMETERS","PROP_METADATA","makeParamDecorator","props","parentClass","metaCtor","makeMetadataCtor","propName","ParamDecoratorFactory","annotationInstance","ParamDecorator","annotation","cls","unusedKey","defineProperty","ngMetadataName","annotationCls","InjectionToken","_desc","multi","ANALYZE_FOR_ENTRY_COMPONENTS","Type","isType","deepForEach","addToArray","list","keyValueArraySet","keyValueArray","keyValueArrayIndexOf","arrayInsert2","value1","value2","_arrayIndexOfSorted","middle","ES5_DELEGATE_CTOR","ES2015_INHERITED_CLASS","ES2015_INHERITED_CLASS_WITH_CTOR","ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR","ReflectionCapabilities","reflect","_reflect","Reflect","_zipTypesAndAnnotations","paramAnnotations","newArray","_ownParameters","parentCtor","isDelegateCtor","typeStr","tsickleCtorParams","ctorParameters","ctorParam","convertTsickleDecoratorIntoMetadata","decorators","getOwnMetadata","getParentCtor","_ownAnnotations","typeOrFunc","annotations","ownAnnotations","_ownPropMetadata","propMetadata","propDecorators","parentPropMetadata","ownPropMetadata","hasLifecycleHook","lcProperty","decoratorInvocations","decoratorInvocation","parentProto","Inject","attachInjectFlag","getReflect","RendererStyleFlags2","TRACKED_LVIEWS","uniqueIdCounter","MONKEY_PATCH_KEY_NAME","registerLView","_icuContainerIterate","tIcuContainerNode","getLViewParent","getFirstLContainer","getNearestLContainer","getNextLContainer","container","applyToElementOrContainer","action","lNodeToHandle","beforeNode","isComponent","rNode","nativeAppendChild","nativeInsertBefore","nativeRemoveNode","isHostElement","nativeParent","nativeParentNode","nativeRemoveChild","removeChild","destroyNode","applyContainer","parentRElement","applyView","createElementNode","namespace","createElement","detachMovedView","declarationContainer","movedViews","declarationViewIndex","insertionLContainer","updateTransplantedViewCount","removeIndex","indexInContainer","viewToDetach","declarationLContainer","removedLView","removeFromArray","removeViewFromContainer","lQueries","detachView","destroyViewTree","rootView","lViewOrLContainer","cleanUpView","firstView","executeOnDestroys","toCall","callContext","processCleanups","tCleanup","cleanup","lCleanup","lastLCleanupIndex","targetIdx","instanceCleanupFn","destroy","unregisterLView","getParentRElement","getClosestRElement","None","getNativeByTNode","isMove","insertBefore","appendChild","nativeAppendOrInsertBefore","getInsertInFrontOfRNode","_getInsertInFrontOfRNodeWithI18n","_processI18nInsertBefore","DOCUMENT","getInsertInFrontOfRNodeWithNoI18n","childRNode","childTNode","parentRNode","anchorNode","getFirstNativeNode","tNodeType","getBeforeNodeForView","elIcuContainerChild","rNodeOrLContainer","icuContainerIterate","projectionNodes","getProjectionNodes","projection","viewIndexInContainer","nextViewIndex","firstTNodeOfView","applyNodes","isProjection","rawSlotValue","attachPatchData","nextRNode","applyProjectionRecursive","projectionNext","tProjectionNode","componentLView","nodeToProjectOrRNodes","writeDirectClass","element","newValue","removeAttribute","setupStaticAttributes","mergedAttrs","classes","writeDirectStyle","trustedHTMLFromString","trustedTypes","createPolicy","createHTML","createScript","createScriptURL","trustedHTMLFromStringBypass","trustedScriptURLFromStringBypass","SafeValueImpl","changingThisBreaksApplicationSecurity","SafeHtmlImpl","getTypeName","SafeStyleImpl","SafeScriptImpl","SafeUrlImpl","SafeResourceUrlImpl","unwrapSafeValue","actualType","getSanitizationBypassType","DOMParserHelper","inertDocumentHelper","getInertBodyElement","DOMParser","parseFromString","InertDocumentHelper","defaultDoc","inertDocument","implementation","createHTMLDocument","templateEl","innerHTML","SAFE_URL_PATTERN","_sanitizeUrl","tagSet","tags","sets","VOID_ELEMENTS","OPTIONAL_END_TAG_BLOCK_ELEMENTS","OPTIONAL_END_TAG_INLINE_ELEMENTS","VALID_ELEMENTS","URI_ATTRS","VALID_ATTRS","SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS","SanitizingHtmlSerializer","sanitizedSomething","buf","sanitizeChildren","el","traverseContent","nodeType","Node","ELEMENT_NODE","startElement","TEXT_NODE","chars","nodeValue","endElement","checkClobberedElement","nextSibling","nodeName","elAttrs","elAttr","lower","encodeEntities","nextNode","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","outerHTML","SURROGATE_PAIR_REGEXP","NON_ALPHANUMERIC_REGEXP","inertBodyHelper","unsafeHtmlInput","inertBodyElement","getInertBodyHelper","isDOMParserAvailable","unsafeHtml","mXSSAttempts","parsedHtml","getTemplateContent","isTemplateElement","content","SecurityContext","ɵɵsanitizeHtml","sanitizer","getSanitizer","sanitize","HTML","allowSanitizationBypassAndThrow","_sanitizeHtml","getDocument","ɵɵsanitizeUrl","unsafeUrl","URL","ɵɵsanitizeResourceUrl","unsafeResourceUrl","RESOURCE_URL","ENVIRONMENT_INITIALIZER","INJECTOR_DEF_TYPES","NullInjector","sources","internalImportProvidersFrom","ɵfromNgModule","checkForStandaloneCmp","providersOut","dedup","Set","injectorTypesWithProviders","internalSource","walkProviderTree","processInjectorTypesWithProviders","typesWithProviders","deepForEachProvider","provider","defType","injDef","cmpDef","ngModule","isDuplicate","dep","importTypesWithProviders","imported","defProviders","USE_VALUE","isValueProvider","isTypeProvider","INJECTOR_SCOPE","NOT_YET","CIRCULAR","NULL_INJECTOR","getNullInjector","EnvironmentInjector","R3Injector","destroyed","_destroyed","scopes","_onDestroyHooks","forEachSingleProvider","processProvider","records","makeRecord","record","injectorDefTypes","assertNotDestroyed","_ngOnDestroyHooks","runInContext","previousInjector","couldBeInjectableType","injectableDefInScope","injectableDefOrInjectorDefFactory","hydrate","unshift","catchInjectorError","injectorErrorName","tokenPath","formatError","resolveInjectorInitializers","initializers","initializer","providerToRecord","providerToFactory","multiRecord","hasOnDestroy","getUndecoratedInjectableFactory","paramLength","inheritedInjectableDef","getInheritedInjectableDef","ngModuleType","unwrappedProvider","isFactoryProvider","isExistingProvider","classRef","hasDeps","ComponentRef","ComponentFactory","_NullComponentFactoryResolver","resolveComponentFactory","component","noComponentFactoryError","ComponentFactoryResolver","injectElementRef","createElementRef","ElementRef","nativeElement","unwrapElementRef","RendererFactory2","Renderer2","injectRenderer2","nodeAtIndex","getComponentLViewByIndex","Sanitizer","Version","full","major","minor","patch","VERSION","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","ERROR_ORIGINAL_ERROR","getOriginalError","ErrorHandler","_console","originalError","_findOriginalError","ɵɵresolveWindow","ownerDocument","defaultView","maybeUnwrapFn","classIndexOf","className","classToSearch","startingIndex","foundIndex","NG_TEMPLATE_SELECTOR","isCssClassMatching","cssClassToMatch","isProjectionMode","isInlineTemplate","hasTagAndTypeMatch","currentSelector","isNodeMatchingSelector","nodeAttrs","nameOnlyMarkerIdx","getNameOnlyMarkerIndex","skipToNextSelector","isPositive","selectorAttrValue","attrIndexInNode","findAttrIndexInNode","nodeAttrValue","compareAgainstClassName","bindingsMode","maybeAttrName","matchTemplateAttribute","attr","isNodeMatchingSelectorList","selectorListLoop","currentSelectorInList","maybeWrapInNotSelector","isNegativeMode","chunk","stringifyCSSSelector","currentChunk","valueOrMarker","attrValue","ɵɵadvance","delta","selectIndexInternal","checkNoChangesMode","createInjector","additionalProviders","createInjectorWithoutInjectorInstances","importProvidersFrom","Injector","constructResolvingPath","findFirstClosedCycle","injectionError","constructResolvingMessage","wrappedError","addKey","injectors","signature","provider1","provider2","ReflectiveKey","displayName","_globalKeyRegistry","numberOfKeys","KeyRegistry","_allKeys","newKey","ReflectiveDependency","visibility","_EMPTY_LIST","ResolvedReflectiveProvider_","resolvedFactories","multiProvider","resolvedFactory","ResolvedReflectiveFactory","resolveReflectiveFactory","factoryFn","_dependenciesFor","aliasInstance","fromKey","_extractToken","constructDependencies","resolveReflectiveProvider","resolveReflectiveProviders","resolvedProviderMap","normalizedProvidersMap","existing","mixingMultiProvidersWithRegularProvidersError","resolvedProvider","mergeResolvedReflectiveProviders","_normalizeProviders","invalidProviderError","noAnnotationError","metadata","_createDependency","paramMetadata","UNDEFINED","ReflectiveInjector","ResolvedReflectiveProviders","fromResolvedProviders","ReflectiveInjector_","_parent","_constructionCounter","_providers","keyIds","objs","_getByKey","resolveAndCreateChild","createChildFromResolved","inj","resolveAndInstantiate","instantiateResolved","_instantiateProvider","getProviderAtIndex","outOfBoundsError","_new","_getMaxNumberOfObjects","cyclicDependencyError","_instantiate","_getByReflectiveDependency","instantiationError","originalException","originalStack","INJECTOR_KEY","_getByKeySelf","_getByKeyDefault","_getObjByKeyId","keyId","_throwOrNull","noProviderError","inj_","_mapProviders","ɵɵdirectiveInject","refreshContentQueries","directiveDefIdx","createLView","tHostNode","rendererFactory","getUniqueLViewId","getOrCreateTNode","createTNodeAtIndex","tParent","insertBeforeIndex","directiveStylingLast","propertyBindings","localNames","initialInputs","stylesWithoutHost","residualStyles","classesWithoutHost","residualClasses","classBindings","styleBindings","createTNode","isInI18nBlock","getCurrentParentTNode","setCurrentTNode","allocExpando","numSlotsToAlloc","initialValue","allocIdx","renderView","executeViewQueryFn","templateFn","executeTemplate","staticContentQueries","staticViewQueries","components","renderChildComponents","hostLView","renderComponent","incompleteFirstPass","refreshView","setBindingIndex","hooksInitPhaseCompleted","incrementInitPhaseFlags","markTransplantedViewsForRefresh","movedLView","refreshEmbeddedViews","embeddedLView","embeddedTView","hostBindingOpCodes","opCode","directiveIdx","bindingRootIndx","hostBindingFn","setBindingRootForHostBindings","processHostBindingOpCodes","refreshChildComponents","refreshComponent","firstUpdatePass","prevSelectedIndex","isUpdatePhase","executeContentQueries","createDirectivesInstances","instantiateAllDirectives","addComponentLogic","hostTNode","getOrCreateComponentTView","componentView","addToViewTree","createRenderer","getOrCreateNodeInjectorForNode","setInputsFromAttrs","invokeDirectivesHostBindings","saveResolvedLocalsInData","localRefExtractor","localIndex","createTView","directives","pipes","constsOrFactory","initialViewLength","createViewBlueprint","NO_CHANGE","queries","fill","expandoStartIndex","directiveRegistry","pipeRegistry","storeCleanupWithContext","cleanupFn","getOrCreateLViewCleanup","getOrCreateTViewCleanup","generatePropertyAliases","aliasMap","propertyAliases","hostDirectiveAliasMap","internalName","addPropertyAlias","elementPropertyInternal","nativeOnly","dataValue","inputData","setInputsForProperty","markDirtyIfOnPush","mapPropName","viewIndex","childComponentLView","resolveDirectives","localRefs","exportsMap","matchResult","findDirectiveDefMatches","hostDirectiveDefs","hostDirectiveMatches","markAsComponentHost","initializeDirectives","cacheMatchingLocalNames","mergeHostAttrs","initTNodeFlags","numberOfDirectives","preOrderHooksFound","preOrderCheckHooksFound","configureViewWithDirective","saveNameToExportMap","lifeCycleHooks","initializeInputAndOutputAliases","hostDirectiveDefinitionMap","tViewData","tNodeAttrs","inputsFromAttrs","inputsStore","outputsStore","aliasData","aliasedOutputs","generateInitialInputs","elementIndex","getCurrentDirectiveIndex","dirIndex","invokeHostBindingsInCreationMode","directiveFactory","nodeInjectorFactory","registerHostBindingOpCodes","directiveVarsIdx","elementIndx","lastSelectedElementIdx","strValue","setElementAttribute","initialInputData","inputsToStore","inputConfig","createLContainer","hostNative","componentHostIdx","refreshContainsDirtyView","componentTView","syncViewWithBlueprint","markViewDirty","detectChangesInternal","notifyErrorHandler","begin","viewQueryFn","textBindingInternal","getNativeByIndex","updateTextNode","setValue","computeStaticStyling","writeToHost","concatStringsWithSpace","lNode","lViewInAContainer","lViewFirstChildTNode","collectNativeNodes","nodesInSlot","ViewRef","rootNodes","_cdRefInjectingView","_appRef","_attachedToViewContainer","viewRefs","destroyLView","markForCheck","detach","reattach","detectChanges","checkNoChanges","attachToViewContainerRef","detachFromAppRef","renderDetachView","attachToAppRef","appRef","RootViewRef","_view","AbstractComponentFactoryResolver","componentDef","toRefArray","nonMinified","templateName","ChainedInjector","parentInjector","AbstractComponentFactory","componentType","stringifyCSSSelectorList","selectorList","isBoundToModule","projectableNodes","rootSelectorOrNode","environmentInjector","realEnvironmentInjector","rootViewInjector","hostRenderer","elementName","hostRNode","locateHostElement","elementOrSelector","selectRootElement","ShadowDom","getNamespace","rootFlags","rootTView","rootLView","tElementNode","rootComponentDef","rootDirectives","createRootComponentTNode","createRootComponentView","applyRootComponentStyling","viewRenderer","setRootNodeAttributes","extractAttrsAndClassesFromSelector","projectNodes","nodesforSlot","createRootComponent","hostFeatures","rootTNode","LifecycleHooksFeature","AbstractComponentRef","_rootLView","changeDetectorRef","registerPostOrderHooks","ɵɵInheritDefinitionFeature","superType","getSuperType","shouldInheritFields","inheritanceChain","superDef","writeableDef","maybeUnwrapEmpty","superHostBindings","inheritHostBindings","superViewQuery","superContentQueries","inheritViewQuery","inheritContentQueries","fillProperties","animation","defData","mergeHostAttrsAcrossInheritance","prevViewQuery","ctx","prevContentQueries","prevHostBindings","isListLikeIterable","isJsObject","updateBinding","bindingUpdated","bindingUpdated2","exp1","exp2","different","bindingUpdated3","exp3","ɵɵattribute","elementAttributeInternal","interpolation1","v0","suffix","ɵɵtemplate","attrsIndex","localRefsIndex","adjustedIndex","templateFirstCreatePass","tViewConsts","getConstant","comment","createComment","ɵɵreference","getContextLView","ɵɵproperty","setDirectiveInputsWhichShadowsStyling","isClassBased","ɵɵelementStart","elementStartFirstCreatePass","elementStart","hasDirectives","getElementDepthCount","increaseElementDepthCount","ɵɵelementEnd","decreaseElementDepthCount","elementEnd","hasClassInput","hasStyleInput","ɵɵelement","ɵɵelementContainerStart","elementContainerStartFirstCreatePass","ɵɵelementContainerEnd","ɵɵelementContainer","ɵɵgetCurrentView","isSubscribable","isObservable","ɵɵlistener","eventName","listenerFn","useCapture","eventTargetResolver","listenerInternal","isTNodeDirectiveHost","processOutputs","lCleanupIndex","idxOrTargetGetter","existingListener","findExistingListener","tNodeIdx","cleanupEventName","listenerIdxInLCleanup","__ngLastListenerFn__","__ngNextListenerFn__","wrapListener","propsLength","executeListenerWithErrorHandling","wrapWithPreventDefault","wrapListenerIn_markDirtyAndPreventDefault","nextListenerFn","preventDefault","returnValue","level","nextContextImpl","walkUpViews","nestingLevel","projectionSlots","wildcardNgContentIndex","ngProjectAsAttrVal","getProjectAsAttrValue","ngProjectAsAttrIdx","isSelectorInSelectorList","ɵɵprojectionDef","componentNode","projectionHeads","tails","componentChild","slotIndex","matchingProjectionSlotIndex","ɵɵprojection","selectorIndex","applyProjection","ɵɵpropertyInterpolate","ɵɵpropertyInterpolate1","interpolatedValue","getTStylingRangePrev","tStylingRange","setTStylingRangePrevDuplicate","getTStylingRangeNext","setTStylingRangeNextDuplicate","markDuplicates","tStylingKey","isPrevDir","isClassBinding","tStylingAtIndex","isMap","cursor","foundDuplicate","tStyleRangeAtCursor","isStylingMatch","tStylingKeyCursor","parserState","textEnd","keyEnd","valueEnd","getLastParsedKey","consumeClassToken","startIndex","consumeWhitespace","ɵɵstyleProp","checkStylingProperty","ɵɵclassProp","ɵɵclassMap","checkStylingMap","stringParser","stylingFirstUpdatePass","hasStylingInputShadow","isInHostBindings","staticPrefix","updateStylingMap","oldKeyValueArray","newKeyValueArray","oldIndex","newIndex","oldKey","setKey","updateStyling","toStylingKeyValueArray","styleKeyValueArray","unwrappedValue","classStringParser","parseClassName","resetParserState","parseClassNameNext","normalizeSuffix","isHostBindings","wrapInStaticStylingKey","stylingKey","hostDirectiveDef","getCurrentDirectiveDef","residual","collectStylingFromTAttrs","collectStylingFromDirectives","templateStylingKey","getTemplateHeadTStylingKey","bindings","setTemplateHeadTStylingKey","collectResidual","tStylingKeyWithStatic","isHostBinding","tBindings","tmplHead","tmplTail","isKeyDuplicateOfStatic","previousNode","toTStylingRange","setTStylingRangeNext","setTStylingRangePrev","markDuplicateOfResidualStyling","insertTStylingBinding","currentDirective","desiredMarker","currentMarker","tRange","higherPriorityValue","getTStylingRangeNextDuplicate","findStylingValue","isStylingValuePresent","getTStylingRangePrevDuplicate","applyStyling","addClass","removeClass","DashCase","removeStyle","endsWith","Important","setStyle","isPrevDirection","rawKey","containsStatics","isStylingMap","valueAtLViewIndex","keyValueArrayGet","ɵɵtext","textNative","createText","createTextNode","ɵɵtextInterpolate","ɵɵtextInterpolate1","interpolated","i0","v1","i1","v2","interpolation3","ɵɵtextInterpolate3","plural","LOCALE_DATA","findLocaleData","normalizedLocale","getLocaleData","localeEn","ng","common","LocaleDataIndex","DEFAULT_LOCALE_ID","LOCALE_ID","resolveProvider","lInjectablesBlueprint","providerFactory","beginIndex","existingFactoryIndex","registerDestroyHooksIfSupported","existingProvidersFactoryIndex","existingViewProvidersFactoryIndex","doesViewProvidersFactoryExist","multiFactory","f","componentProviders","multiFactoryAdd","multiViewProvidersFactoryResolver","multiProvidersFactoryResolver","contextIndex","indexInFactory","providerIsTypeProvider","providerIsClassProvider","isClassProvider","existingCallbacksIndex","isComponentProvider","lData","multiResolve","factories","componentCount","multiProviders","ɵɵProvidersFeature","viewProviders","processProvidersFn","NgModuleRef","NgModuleFactory","viewEngine_NgModuleRef","_bootstrapComponents","destroyCbs","getNgModuleDef","_r3Injector","viewEngine_ComponentFactoryResolver","componentFactoryResolver","viewEngine_NgModuleFactory","moduleType","EnvironmentNgModuleRefAdapter","StandaloneService","getOrCreateStandaloneInjector","cachedInjectors","standaloneInjector","createEnvironmentInjector","debugName","defineInjectable","ɵɵStandaloneFeature","ɵɵpureFunction2","slotOffset","pureFn","pureFunction2Internal","pureFunction3Internal","bindingRoot","getPureFunctionReturnValue","returnValueIndex","lastReturnValue","exp","pipeName","pipeFactory","pipeInstance","ɵɵpipeBind1","isPure","pureFunction1Internal","transform","ɵɵpipeBind2","_wrapInTimeout","EventEmitter","EventEmitter_","isAsync","__isAsync","emit","nextFn","errorFn","completeFn","symbolIterator","_results","QueryList","_changes","_emitDistinctChangesOnly","dirty","_changesDetected","init","reset","resultsTree","identityAccessor","newResultFlat","flatten","flat","arrayEquals","valueA","valueB","notifyOnChanges","setDirty","TemplateRef","injectTemplateRef","ViewEngineTemplateRef","R3TemplateRef","_declarationLView","_declarationTContainer","elementRef","createEmbeddedView","declarationViewLQueries","R3_ViewRef","createTemplateRef","ViewContainerRef","injectViewContainerRef","createContainerRef","VE_ViewContainerRef","R3ViewContainerRef","_lContainer","_hostTNode","_hostLView","getViewRefs","templateRef","indexOrOptions","viewRef","insert","createComponent","componentFactoryOrType","isComponentFactory","ngModuleRef","componentFactory","R3ComponentFactory","contextInjector","componentRef","viewAttachedToContainer","prevIdx","prevLContainer","prevVCRef","adjustedIdx","_adjustIndex","insertView","containerLength","trackMovedView","parentNativeNode","addViewToContainer","getOrCreateViewRefs","move","viewRefsArr","detachedView","R3ViewRef","commentNode","nativeNextSibling","LQuery_","queryList","LQueries_","tQueries","noOfInheritedQueries","viewLQueries","tQuery","getByIndex","indexInDeclarationView","dirtyQueriesWithMatches","getTQuery","TQueryMetadata_","TQueries_","queriesForTemplateRef","childQueryIndex","tqueryClone","track","tquery","TQuery_","crossesNgTemplate","_appliesToNextNode","_declarationNodeIndex","isApplyingToNode","matchTNode","addMatch","declarationNodeIdx","matchTNodeWithReadOption","getIdxOfMatchingSelector","ViewEngine_TemplateRef","nodeMatchIdx","ViewEngine_ElementRef","directiveOrProviderIdx","matchIdx","createResultForNode","matchingIdx","createResultByTNodeType","createSpecialToken","materializeViewResults","queryIndex","lQuery","tQueryMatches","matchedNodeIdx","collectQueryResults","lViewResults","embeddedLViews","ɵɵqueryRefresh","isCreationMode","ɵɵviewQuery","createTQuery","createLQuery","ɵɵloadQuery","loadQueryInternal","APP_INITIALIZER","ApplicationInitStatus","appInits","initialized","donePromise","rej","runInitializers","asyncInitPromises","initResult","observableAsPromise","core_inject","APP_ID","_appIdRandomProviderFactory","_randomChar","fromCharCode","PLATFORM_INITIALIZER","PLATFORM_ID","ANIMATION_MODULE_TYPE","Console","getGlobalLocale","$localize","ModuleWithComponentFactories","componentFactories","ngModuleFactory","Compiler","compileModuleSync","NgModuleFactoryR3","compileModuleAsync","compileModuleAndAllComponentsSync","declaration","ComponentFactoryR3","compileModuleAndAllComponentsAsync","clearCache","clearCacheFor","getModuleId","scheduleMicroTask","Zone","NgZone","enableLongStackTrace","shouldCoalesceEventChangeDetection","shouldCoalesceRunChangeDetection","hasPendingMacrotasks","hasPendingMicrotasks","isStable","assertZonePatched","_nesting","_outer","_inner","TaskTrackingZoneSpec","fork","longStackTraceZoneSpec","lastRequestAnimationFrameId","nativeRequestAnimationFrame","getNativeRequestAnimationFrame","nativeCancelAnimationFrame","unpatchedRequestAnimationFrame","__symbol__","unpatchedCancelAnimationFrame","forkInnerZoneWithAngularBehavior","delayChangeDetectionForEventsDelegate","delayChangeDetectionForEvents","isCheckStableRunning","fakeTopEventTask","scheduleEventTask","updateMicroTaskStatus","checkStable","isAngularZone","onInvokeTask","delegate","task","applyThis","applyArgs","invokeTask","onLeave","onInvoke","onHasTask","hasTaskState","hasTask","change","_hasPendingMicrotasks","microTask","macroTask","onHandleError","runOutsideAngular","onError","isInAngularZone","runTask","EMPTY_PAYLOAD","cancelTask","runGuarded","onMicrotaskEmpty","onStable","onUnstable","NoopNgZone","TESTABILITY","TESTABILITY_GETTER","_testabilityGetter","Testability","_ngZone","testabilityGetter","_pendingCount","_isZoneStable","_didWork","_callbacks","taskTrackingZone","setTestabilityGetter","addToWindow","_watchAngularEvents","assertNotInAngularZone","_runCallbacksIfReady","increasePendingRequestCount","decreasePendingRequestCount","clearTimeout","timeoutId","doneCb","getPendingTasks","updateCb","macroTasks","creationLocation","addCallback","timeout","whenStable","getPendingRequestCount","registerApplication","unregisterApplication","findProviders","using","exactMatch","TestabilityRegistry","testability","_applications","unregisterAllApplications","getTestability","getAllTestabilities","getAllRootElements","findTestabilityInTree","findInAncestors","NG_DEV_MODE","_platformInjector","ALLOW_MULTIPLE_PLATFORMS","PLATFORM_DESTROY_LISTENERS","APP_BOOTSTRAP_LISTENER","createPlatformFactory","parentPlatformFactory","desc","extraProviders","platform","getPlatform","platformProviders","createPlatform","PlatformRef","runPlatformInitializers","inits","createPlatformInjector","assertPlatform","requiredToken","_modules","_destroyListeners","bootstrapModuleFactory","moduleFactory","ngZone","getNgZone","ngZoneToUse","getNgZoneOptions","ngZoneEventCoalescing","ngZoneRunCoalescing","ngZoneInjector","moduleRef","exceptionHandler","_callAndReportToErrorHandler","initStatus","setLocaleId","localeId","assertDefined","_moduleDoBootstrap","bootstrapModule","compilerOptions","optionsReducer","compileNgModuleFactory","R3NgModuleFactory","ApplicationRef","ngDoBootstrap","destroyListeners","_zone","_exceptionHandler","_bootstrapListeners","_views","_runningTick","_stable","componentTypes","_onMicrotaskEmptySubscription","tick","isCurrentlyStable","stableSub","unstableSub","assertInAngularZone","componentOrFactory","isStandalone","cf","compRef","NULL","_loadComponent","attachView","viewCount","warnIfDestroyed","ChangeDetectorRef","injectChangeDetectorRef","createViewRef","isPipe","DefaultIterableDifferFactory","supports","trackByFn","DefaultIterableDiffer","trackByIdentity","_linkedRecords","_unlinkedRecords","_previousItHead","_itHead","_itTail","_additionsHead","_additionsTail","_movesHead","_movesTail","_removalsHead","_removalsTail","_identityChangesHead","_identityChangesTail","_trackByFn","forEachItem","forEachOperation","nextIt","nextRemove","addRemoveOffset","moveOffsets","currentIndex","getPreviousIndex","adjPreviousIndex","_nextRemoved","previousIndex","localMovePreviousIndex","localCurrentIndex","forEachPreviousItem","_nextPrevious","forEachAddedItem","_nextAdded","forEachMovedItem","_nextMoved","forEachRemovedItem","forEachIdentityChange","_nextIdentityChange","check","_reset","itemTrackBy","mayBeDirty","trackById","_verifyReinsertion","_addIdentityChange","_mismatch","iterateListLike","_truncate","isDirty","previousRecord","_prev","_remove","_reinsertAfter","_moveAfter","_addAfter","IterableChangeRecord_","reinsertRecord","_addToMoves","nextRecord","_addToRemovals","_unlink","prevRecord","_prevRemoved","_insertAfter","_DuplicateMap","put","toIndex","_prevDup","_nextDup","_DuplicateItemRecordList","_head","_tail","atOrAfterIndex","duplicates","recordList","isEmpty","moveOffset","DefaultKeyValueDifferFactory","DefaultKeyValueDiffer","_mapHead","_appendAfter","_previousMapHead","_changesHead","_changesTail","forEachChangedItem","_nextChanged","_maybeAddToChanges","_getOrCreateRecordForKey","_insertBeforeOrAppend","_records","KeyValueChangeRecord_","_addToAdditions","_addToChanges","defaultIterableDiffersFactory","IterableDiffers","copied","defaultKeyValueDiffersFactory","KeyValueDiffers","kv","platformCore","ApplicationModule","coerceToBoolean","_DOM","getDOM","DomAdapter","PlatformLocation","historyGo","relativePosition","useBrowserPlatformLocation","BrowserPlatformLocation","_doc","history","getBaseHrefFromDOM","onPopState","getGlobalEventTarget","onHashChange","newPath","supportsState","forward","back","createBrowserPlatformLocation","slashes","startsWith","stripTrailingSlash","pathEndIdx","normalizeQueryParams","LocationStrategy","fesm2020_core_inject","PathLocationStrategy","APP_BASE_HREF","_platformLocation","_removeListenerFns","origin","prepareExternalUrl","internal","joinWithSlash","includeHash","externalUrl","HashLocationStrategy","Location","locationStrategy","_urlChangeListeners","_urlChangeSubscription","_locationStrategy","_basePath","_stripOrigin","_stripIndexHtml","ev","normalize","isCurrentPathEqualTo","_stripBasePath","basePath","strippedUrl","_notifyUrlChangeListeners","onUrlChange","fnIndex","onNext","onThrow","onReturn","createLocation","FormStyle","TranslationWidth","FormatWidth","NumberSymbol","getLastDefinedValue","ɵfindLocaleData","ɵLocaleDataIndex","symbol","CurrencyDecimal","Decimal","CurrencyGroup","Group","checkFullData","extractTime","ISO8601_DATE_REGEX","NAMED_FORMATS","DATE_FORMATS_SPLIT","ZoneWidth","DateType","TranslationType","formatDate","timezone","parsedNb","isoStringToDate","tzHour","tzMin","dateSetter","timeSetter","setUTCHours","setHours","getNamedFormat","part","dateTimezoneOffset","timezoneToOffset","convertTimezoneToLocal","reverseValue","addDateMinutes","setMinutes","getMinutes","dateFormatter","getDateFormatter","DATE_FORMATS","formatter","dateStrGetter","Eras","Abbreviated","Wide","Narrow","dateGetter","FullYear","weekNumberingYearGetter","Month","Months","Standalone","weekGetter","Day","Days","Short","DayPeriods","Format","Hours","Minutes","Seconds","FractionalSeconds","timeZoneGetter","Extended","ShortGMT","Long","newDate","getLocaleId","formatValue","getLocaleDateFormat","Medium","Full","getLocaleTimeFormat","shortTime","shortDate","formatDateTime","getLocaleDateTimeFormat","mediumTime","mediumDate","longTime","longDate","fullTime","fullDate","opt_values","padNumber","num","digits","minusSign","negWrap","neg","strNum","getDatePart","getHours","getSeconds","getMilliseconds","formatFractionalSeconds","localeMinus","getLocaleNumberSymbol","MinusSign","form","extended","getDateTranslation","getLocaleMonthNames","formStyle","getLocaleDayNames","currentHours","currentMinutes","getLocaleExtraDayPeriodRules","dayPeriods","getLocaleExtraDayPeriods","findIndex","afterFrom","beforeTo","getLocaleDayPeriods","amPm","getLocaleEraNames","JANUARY","THURSDAY","getThursdayThisWeek","datetime","monthBased","nbDaysBefore1stDayOfMonth","today","thisThurs","firstThurs","getFirstThursdayOfYear","fallback","requestedTimezoneOffset","cookieStr","cookie","eqIndex","cookieName","cookieValue","WS_REGEXP","NgClass","_iterableDiffers","_keyValueDiffers","_ngEl","_renderer","initialClasses","klass","ngClass","rawClass","_updateState","_applyStateDiff","nextEnabled","stateMap","touched","stateEntry","_toggleClass","NgForOfContext","$implicit","ngForOf","even","odd","NgForOf","_ngForOf","_ngForOfDirty","ngForTrackBy","_viewContainer","_template","_differs","_differ","ngForTemplate","_applyChanges","viewContainer","adjustedPreviousIndex","applyViewChange","ilen","NgIf","NgIfContext","_thenTemplateRef","_elseTemplateRef","_thenViewRef","_elseViewRef","ngIf","condition","_updateView","ngIfThen","assertTemplate","ngIfElse","SwitchView","_templateRef","_viewContainerRef","_created","enforceState","created","NgSwitch","_defaultViews","_defaultUsed","_caseCount","_lastCaseCheckIndex","_lastCasesMatched","ngSwitch","_ngSwitch","_updateDefaultCases","_addCase","_addDefault","_matchCase","useDefault","NgSwitchCase","ngSwitchCase","NgTemplateOutlet","_viewRef","ngTemplateOutletContext","ngTemplateOutlet","ngTemplateOutletInjector","viewContainerRef","SubscribableStrategy","createSubscription","updateLatestValue","PromiseStrategy","_promiseStrategy","_subscribableStrategy","AsyncPipe","_latestValue","_subscription","_obj","_strategy","_ref","_dispose","_selectStrategy","_updateLatestValue","ɵisPromise","ɵisSubscribable","invalidPipeArgumentError","DATE_PIPE_DEFAULT_TIMEZONE","DATE_PIPE_DEFAULT_OPTIONS","DatePipe","defaultTimezone","CommonModule","PLATFORM_BROWSER_ID","isPlatformBrowser","platformId","XhrFactory","GenericBrowserDomAdapter","supportsDOMEvents","BrowserDomAdapter","setRootDomAdapter","adapter","onAndCancel","doc","getDefaultDocument","createHtmlDocument","isElementNode","isShadowRoot","DocumentFragment","getBaseElementHref","baseElement","querySelector","getAttribute","relativePath","urlParsingNode","resetBaseElement","getUserAgent","getCookie","parseCookieValue","TRANSITION_ID","SERVER_TRANSITION_PROVIDERS","appInitializerFactory","transitionId","dom","querySelectorAll","BrowserXhr","XMLHttpRequest","EVENT_MANAGER_PLUGINS","EventManager","plugins","manager","_findPluginFor","addGlobalEventListener","getZone","_eventNameToPlugin","EventManagerPlugin","SharedStylesHost","addStyles","style","changeUsageCount","onStyleAdded","removeStyles","onStyleRemoved","getAllStyles","usageCount","usage","DomSharedStylesHost","resetHostNodes","hostNodes","addStyleToHost","styleRef","addHost","hostNode","removeHost","styleEl","textContent","styleElRef","xhtml","xlink","xml","xmlns","math","COMPONENT_REGEX","REMOVE_STYLES_ON_COMPONENT_DESTROY","compId","decoratePreventDefault","eventHandler","DomRendererFactory2","eventManager","sharedStylesHost","appId","removeStylesOnCompDestory","defaultRenderer","DefaultDomRenderer2","getOrCreateRenderer","EmulatedEncapsulationDomRenderer2","applyToHost","NoneEncapsulationDomRenderer","applyStyles","rendererByCompId","ShadowDomRenderer","createElementNS","NAMESPACE_URIS","newChild","isTemplateNode","refChild","oldChild","selectorOrNode","preserveContent","namespaceUri","setAttributeNS","removeAttributeNS","classList","removeProperty","hostEl","shadowRoot","attachShadow","flattenStyles","nodeOrShadowRoot","rendererUsageCount","contentAttr","shimContentAttribute","componentShortId","hostAttr","shimHostAttribute","DomEventsPlugin","MODIFIER_KEYS","_keyMap","Del","Esc","Left","Right","Up","Down","Menu","Scroll","Win","MODIFIER_KEY_GETTERS","alt","altKey","control","ctrlKey","metaKey","shiftKey","KeyEventsPlugin","parseEventName","parsedEvent","outsideHandler","eventCallback","fullKey","domEventName","_normalizeKey","codeIX","modifierName","fullKeyCode","keycode","modifierGetter","matchEventFullKeyCode","keyName","initDomAdapter","makeCurrent","_document","ɵsetDocument","setDocument","platformBrowser","INTERNAL_BROWSER_PLATFORM_PROVIDERS","BROWSER_MODULE_PROVIDERS_MARKER","TESTABILITY_PROVIDERS","BrowserGetTestability","testabilities","didWork","decrement","didWork_","parentElement","BROWSER_MODULE_PROVIDERS","BrowserModule","providersAlreadyPresent","EVENT_NAMES","pan","panstart","panmove","panend","pancancel","panleft","panright","panup","pandown","pinch","pinchstart","pinchmove","pinchend","pinchcancel","pinchin","pinchout","press","pressup","rotate","rotatestart","rotatemove","rotateend","rotatecancel","swipe","swipeleft","swiperight","swipeup","swipedown","tap","doubletap","HAMMER_GESTURE_CONFIG","HAMMER_LOADER","HammerGestureConfig","overrides","buildHammer","mc","Hammer","enable","HammerGesturesPlugin","loader","_loaderPromise","isCustomEvent","cancelRegistration","eventObj","on","off","HammerModule","DomSanitizer","DomSanitizerImpl","allowSanitizationBypassOrThrow","bypassSecurityTrustHtml","bypassSanitizationTrustHtml","trustedHtml","bypassSecurityTrustStyle","bypassSanitizationTrustStyle","trustedStyle","bypassSecurityTrustScript","bypassSanitizationTrustScript","trustedScript","bypassSecurityTrustUrl","bypassSanitizationTrustUrl","trustedUrl","bypassSecurityTrustResourceUrl","bypassSanitizationTrustResourceUrl","trustedResourceUrl","domSanitizerImplFactory","noNg","noNgElement","cleanData","resumeBootstrap","getAngularJSGlobal","module_","$COMPILE","$DELEGATE","$INJECTOR","$INTERVAL","$PARSE","$PROVIDE","$ROOT_ELEMENT","$ROOT_SCOPE","$$TESTABILITY","DOWNGRADED_MODULE_COUNT_KEY","LAZY_MODULE_REF","UPGRADE_APP_TYPE_KEY","REQUIRE_INJECTOR","REQUIRE_NG_MODEL","UPGRADE_MODULE_NAME","PropertyBinding","bracketAttr","parenAttr","bracketParenAttr","capitalAttr","onAttr","bindAttr","bindonAttr","angularElement","isParentNode","controllerKey","destroyApp","$rootElement","$destroy","getDowngradedModuleCount","getUpgradeAppType","validateInjectionKey","downgradedModule","injectionKey","attemptedAction","upgradeAppType","downgradedModuleCount","INITIAL_VALUE","__UNINITIALIZED__","DowngradeComponentAdapter","ngModel","$compile","$parse","wrapCallback","implementsOnChanges","inputChangeCount","inputChanges","componentScope","$new","compileContents","compiledProjectableNodes","linkFns","groupProjectableNodes","linkFn","createComponentAndSetup","manuallyAttachView","propagateDigest","setupInputs","setupOutputs","registerCleanup","childInjector","viewChangeDetector","changeDetector","supportsNgModel","writeValue","registerOnChange","$render","$viewValue","$setViewValue","registerOnTouched","$setTouched","hookupNgModel","inputBinding","expr","observeFn","prevValue","currValue","strictEquals","updateInput","$observe","unwatch","$watch","watchFn","outputBindings","subscribeToOutput","isAssignment","emitter","static_getTypeName","$event","testabilityRegistry","destroyComponentRef","$on","jj","ngContentIndex","findMatchingNgContentIndex","groupNodesBySelector","contents","ngContentIndices","matchesSelector","elProto","msMatchesSelector","SyncPromise","valuesOrPromises","aggrPromise","resolvedCount","results","isThenable","downgradeComponent","info","isNgUpgradeLite","hasMultipleDowngradedModules","restrict","terminal","require","link","required","ranAsync","lazyModuleRefKey","lazyModuleRef","doDowngrade","injectorPromise","ParentInjectorPromise","facade","$evalAsync","downgradeFn","pInjector","mInjector","injectorKey","downgradeInjectable","tempInjectorRef","setTempInjectorRef","angular1Providers","injectorFactory","rootScopeFactory","compileFactory","parseFactory","NgAdapterInjector","modInjector","moduleUid","UpgradeModule","platformRef","modules","INIT_MODULE_NAME","angularModule","constant","$provide","testabilityDelegate","originalWhenStable","newWhenStable","ng2Testability","intervalDelegate","wrappedInterval","delay","invokeApply","pass","$rootScope","$$phase","$digest","upgradeModule","windowAngular","originalResumeBootstrap","asyncToGenerator_asyncToGenerator","asyncGeneratorStep","coerceBooleanProperty","coerceArray","coerceCssPixelValue","coerceElement","elementOrRef","of","fromEvent","setupSubscription","sourceObj","isEventTarget","isJQueryStyleEventEmitter","isNodeStyleEventEmitter","addListener","removeListener","Action","work","AsyncAction","recycleAsyncId","requestAsyncId","setInterval","clearInterval","execute","_execute","errorValue","actions","SchedulerAction","AsyncScheduler","animationFrameScheduler","AnimationFrameScheduler","AnimationFrameAction","nextHandle","RESOLVED","activeHandles","findAndClearHandle","Immediate","setImmediate","clearImmediate","asapScheduler","AsapScheduler","AsapAction","distinctUntilChanged","keySelector","DistinctUntilChangedOperator","DistinctUntilChangedSubscriber","hasKey","AuditOperator","durationSelector","AuditSubscriber","hasValue","throttled","clearThrottle","isNumeric","timer","dueTime","periodOrScheduler","due","dispatch","auditTime","audit","FilterOperator","FilterSubscriber","takeUntil","notifier","TakeUntilOperator","takeUntilSubscriber","TakeUntilSubscriber","notifierSubscription","seenValue","concatAll","startWith","switchMap","SwitchMapOperator","SwitchMapSubscriber","queueScheduler","QueueScheduler","QueueAction","emptyScheduled","Notification","kind","do","toObservable","undefinedValueNotification","completeNotification","ObserveOnOperator","ObserveOnSubscriber","notification","scheduleMessage","ObserveOnMessage","ReplaySubject","bufferSize","windowTime","_bufferSize","_windowTime","_infiniteTimeWindow","nextInfiniteTimeWindow","nextTimeWindow","_events","ReplayEvent","_getNow","_trimBufferThenGetEvents","eventsCount","spliceCount","shareReplay","configOrBufferSize","shareReplayOperator","useRefCount","isComplete","innerSub","hasV8BreakIterator","Intl","v8BreakIterator","Platform","_platformId","isBrowser","BLINK","chrome","CSS","EDGE","TRIDENT","WEBKIT","IOS","supportsPassiveEvents","rtlScrollAxisType","scrollBehaviorSupported","shadowDomIsSupported","normalizePassiveListenerOptions","supportsPassiveEventListeners","supportsScrollBehavior","documentElement","scrollToFunction","scrollTo","getRtlScrollAxisType","scrollContainer","containerStyle","pointerEvents","position","contentStyle","scrollLeft","_getShadowRoot","_supportsShadowDom","createShadowRoot","rootNode","getRootNode","ShadowRoot","_getEventTarget","composedPath","_isTestEnvironment","__karma__","jasmine","jest","Mocha","DIR_DOCUMENT","DIR_DOCUMENT_FACTORY","RTL_LOCALE_PATTERN","Directionality","_resolveDirectionality","rawValue","language","BidiModule","_c0","VIRTUAL_SCROLL_STRATEGY","ScrollDispatcher","_platform","_globalSubscription","_scrolledCount","scrollable","scrollContainers","elementScrolled","_scrolled","scrollableReference","scrolled","auditTimeInMs","_addGlobalListener","_removeGlobalListener","observableOf","ancestorScrolled","elementOrElementRef","getAncestorScrollContainers","scrollingContainers","_scrollableContainsElement","_getWindow","scrollableElement","getElementRef","CdkScrollable","scrollDispatcher","_elementScrolled","isRtl","scrollHeight","scrollWidth","_applyScrollToOptions","scrollTop","measureScrollOffset","LEFT","RIGHT","ViewportRuler","_change","_changeListener","_viewportSize","getViewportSize","_updateViewportSize","getViewportRect","scrollPosition","getViewportScrollPosition","documentRect","getBoundingClientRect","scrollY","scrollX","throttleTime","innerWidth","innerHeight","VIRTUAL_SCROLLABLE","CdkVirtualScrollable","measureViewportSize","orientation","viewportEl","SCROLL_SCHEDULER","CdkVirtualScrollViewport","_orientation","_calculateSpacerSize","appendOnly","_appendOnly","_changeDetectorRef","_scrollStrategy","viewportRuler","scrolledIndexChange","_renderedRangeSubject","_totalContentSize","_totalContentWidth","_totalContentHeight","_renderedRange","_dataLength","_renderedContentOffset","_renderedContentOffsetNeedsRewrite","_isChangeDetectionPending","_runAfterChangeDetection","_viewportChanges","checkViewportSize","_measureViewportSize","attach","onContentScrolled","_markChangeDetectionNeeded","_detachedSubject","forOf","_forOf","dataStream","newLength","onDataLengthChanged","_doChangeDetection","getDataLength","getRenderedRange","measureBoundingClientRectWithScrollOffset","setTotalContentSize","setRenderedRange","range","rangesEqual","r1","r2","onContentRendered","getOffsetToRenderedContentStart","setRenderedContentOffset","isHorizontal","axis","_renderedContentTransform","measureRenderedContentSize","onRenderedOffsetChanged","scrollToOffset","behavior","scrollToIndex","_from","measureViewportOffset","fromRect","scrollerClientRect","contentEl","_contentWrapper","measureRangeSize","runAfter","runAfterChangeDetection","virtualScrollable","viewport","CdkScrollableModule","ScrollingModule","BehaviorSubject","_value","getValue","DoOperator","TapSubscriber","_tapError","_tapComplete","_tapNext","debounceTime","DebounceTimeOperator","DebounceTimeSubscriber","clearDebounce","lastValue","debouncedSubscription","dispatchNext","debouncedNext","skip","SkipOperator","SkipSubscriber","MutationObserverFactory","ObserversModule","OuterSubscriber","outerValue","outerIndex","innerIndex","InnerSubscriber","subscribeToResult","outerSubscriber","NONE","combineLatest","CombineLatestOperator","CombineLatestSubscriber","toRespond","unused","_outerValue","_tryResultSelector","ArgumentOutOfRangeError","ArgumentOutOfRangeErrorImpl","take","TakeOperator","TakeSubscriber","mediaQueriesForWebkitCompatibility","mediaQueryStyleNode","MediaMatcher","_matchMedia","matchMedia","noopMatchMedia","createEmptyStyleRule","sheet","insertRule","media","BreakpointObserver","_mediaMatcher","_destroySubject","isMatched","splitQueries","mediaQuery","_registerQuery","mql","stateObservable","breakpointStates","response","breakpoints","_queries","isFakeMousedownFromScreenReader","buttons","offsetX","offsetY","isFakeTouchstartFromScreenReader","touch","touches","changedTouches","radiusX","radiusY","INPUT_MODALITY_DETECTOR_OPTIONS","INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS","ignoreKeys","modalityEventListenerOptions","passive","InputModalityDetector","mostRecentModality","_modality","_mostRecentTarget","_lastTouchMs","keyCode","modalityDetected","modalityChanged","_onKeydown","_onMousedown","_onTouchstart","FOCUS_MONITOR_DEFAULT_OPTIONS","captureEventListenerOptions","FocusMonitor","_inputModalityDetector","_origin","_windowFocused","_originFromTouchInteraction","_monitoredElementCount","_windowFocusListener","_windowFocusTimeoutId","_onFocus","_onBlur","_detectionMode","detectionMode","monitor","checkChildren","_getDocument","cachedInfo","_elementInfo","_registerGlobalListeners","stopMonitoring","elementInfo","_setClasses","_removeGlobalListeners","focusVia","activeElement","_getClosestElementsInfo","currentElement","_originChanged","_setOrigin","focus","_info","_getFocusOrigin","focusEventTarget","_shouldBeAttributedToTouch","_lastFocusOrigin","_isLastInteractionFromInputLabel","contains","toggle","isFromInteraction","_originTimeoutId","relatedTarget","_emitOrigin","rootNodeFocusListeners","_rootNodeFocusListenerCount","_rootNodeFocusAndBlurListener","_stopInputModalityDetector","modality","mostRecentTarget","disabled","labels","i2.InputModalityDetector","BLACK_ON_WHITE_CSS_CLASS","WHITE_ON_BLACK_CSS_CLASS","HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS","HighContrastModeDetector","_breakpointSubscription","_hasCheckedHighContrastMode","_applyBodyHighContrastModeCssClasses","getHighContrastMode","testElement","backgroundColor","documentWindow","computedStyle","computedColor","bodyClasses","A11yModule","highContrastModeDetector","i1.HighContrastModeDetector","counter","extendStyles","importantProperties","userSelect","toggleVisibility","opacity","initialTransform","parseCssTimeUnitsToMs","multiplier","parseCssPropertyValue","getPropertyValue","getMutableClientRect","clientRect","isInsideClientRect","adjustClientRect","isPointerNearClientRect","rect","pointerX","pointerY","xThreshold","yThreshold","ParentPositionTracker","positions","elements","handleScroll","cachedPosition","newTop","newLeft","viewportScrollPosition","topDifference","leftDifference","deepCloneNode","cloneNode","descendantsWithId","transferCanvasData","transferInputData","transferData","descendantElements","cloneElements","cloneUniqueId","getContext","drawImage","passiveEventListenerOptions","activeEventListenerOptions","dragImportantProperties","DragRef","_disabled","_dropContainer","_toggleNativeDragInteractions","_handles","toggleNativeDragInteractions","_viewportRuler","_dragDropRegistry","_passiveTransform","_activeTransform","_hasStartedDragging","_boundaryElement","_nativeInteractionsEnabled","_direction","dragStartDelay","_moveEvents","beforeStarted","targetHandle","_getTargetHandle","_disabledHandles","_initializeDragSequence","_rootElement","pointerPosition","_getPointerPositionOnPage","_pickupPositionOnPage","dragStartThreshold","isDelayElapsed","_dragStartTime","_getDragStartDelay","_endDragSequence","isDragging","isReceiving","_startDragSequence","constrainedPointerPosition","_getConstrainedPointerPosition","_hasMoved","_lastKnownPointerPosition","_updatePointerDirectionDelta","_updateActiveDropContainer","constrainPosition","_initialClientRect","activeTransform","_applyRootElementTransform","distance","_getDragDistance","_pointerDirectionDelta","withRootElement","withParent","parentDragRef","_parentPositions","registerDragItem","getPlaceholderElement","_placeholder","getRootElement","getVisibleElement","withHandles","handles","disabledHandles","withPreviewTemplate","_previewTemplate","withPlaceholderTemplate","_placeholderTemplate","rootElement","_removeRootElementListeners","_pointerDown","_nativeDragStart","_initialTransform","_ownerSVGElement","ownerSVGElement","withBoundaryElement","boundaryElement","_resizeSubscription","_containInsideBoundaryOnResize","_parentDragRef","_anchor","_destroyPreview","_destroyPlaceholder","removeDragItem","_removeSubscriptions","started","released","ended","entered","exited","dropped","disableHandle","enableHandle","withDirection","_withDropContainer","getFreeDragPosition","setFreeDragPosition","withPreviewContainer","_previewContainer","_sortFromLastPointerPosition","_pointerMoveSubscription","_pointerUpSubscription","_scrollSubscription","_preview","_previewRef","_placeholderRef","stopDragging","webkitTapHighlightColor","_rootElementTapHighlight","_stopScrolling","_animatePreviewToPlaceholder","_cleanupDragArtifacts","_cleanupCachedDimensions","dropPoint","isTouchEvent","_lastTouchEventTime","dropContainer","_createPlaceholderElement","_createPreviewElement","replaceChild","_getPreviewInsertionPoint","_initialContainer","_initialIndex","getItemIndex","getScrollableParents","referenceElement","stopPropagation","isTouchSequence","isAuxiliaryMouseButton","button","isSyntheticEvent","isFakeEvent","draggable","rootStyles","pointerMove","_pointerMove","pointerUp","_pointerUp","scrollEvent","_updateOnScroll","_boundaryRect","previewTemplate","_pickupPositionInElement","matchSize","_getPointerPositionInElement","_pointerPositionAtLastDirectionChange","startDragging","_previewRect","isPointerOverContainer","_isOverContainer","previousContainer","drop","rawX","rawY","newContainer","_getSiblingContainerFromPosition","exit","enter","sortingDisabled","_startScrollingIfNecessary","_sortItem","_applyPreviewTransform","previewConfig","previewClass","preview","rootRect","matchElementSize","getTransform","margin","zIndex","placeholderRect","getTransformTransitionDurationInMs","transitionedProperties","propertyIndex","rawDurations","rawDelays","propertyName","placeholderConfig","placeholderTemplate","elementRect","handleElement","referenceRect","point","targetTouches","_getViewportScrollPosition","pageX","pageY","svgMatrix","getScreenCTM","svgPoint","createSVGPoint","matrixTransform","inverse","dropContainerLock","lockAxis","pickupX","pickupY","boundaryRect","previewWidth","previewHeight","_getPreviewRect","minY","maxY","clamp","pointerPositionOnPage","positionSinceLastChange","changeX","changeY","pointerDirectionChangeThreshold","shouldEnable","combineTransforms","currentPosition","pickupPosition","leftOverflow","rightOverflow","topOverflow","bottomOverflow","mouse","scrollDifference","_cachedShadowRoot","initialParent","previewContainer","documentRef","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","sourceRect","SingleAxisSortStrategy","_element","_itemPositions","drag","overlaps","withItems","pointerDelta","siblings","_getItemIndexFromPointerPosition","currentItem","siblingAtNewPosition","newPosition","itemOffset","_getItemOffsetPx","siblingOffset","_getSiblingOffsetPx","oldOrder","moveItemInArray","fromIndex","sibling","isDraggedItem","elementToOffset","_previousSwap","activeDraggables","_activeDraggables","newPositionReference","_shouldEnterAsFirstChild","_cacheItemPositions","withSortPredicate","_sortPredicate","getActiveItemsSnapshot","updateOnScroll","elementToMeasure","immediateSibling","itemPositions","lastItemRect","firstItemRect","SCROLL_PROXIMITY_THRESHOLD","DropListRef","autoScrollDisabled","autoScrollStep","_isDragging","_draggables","_siblings","_startScrollInterval","interval","_stopScrollTimers","_scrollNode","scrollStep","_verticalScrollDirection","scrollBy","_horizontalScrollDirection","withScrollableParents","registerDropContainer","_sortStrategy","sortPredicate","_viewportScrollSubscription","receivingStarted","receivingStopped","_activeSiblings","removeDropContainer","_draggingStarted","_notifyReceivingSiblings","_cacheParentPositions","previousItems","connectedTo","withOrientation","_scrollableElements","_clientRect","scrollNode","verticalScrollDirection","horizontalScrollDirection","getElementScrollDirections","computedVertical","getVerticalScrollDirection","computedHorizontal","getHorizontalScrollDirection","_initialScrollSnap","msScrollSnapType","scrollSnapType","_listenToScrollEvents","_stopReceiving","_canReceive","enterPredicate","elementFromPoint","_startReceiving","activeSiblings","initiator","receiver","draggedItems","activeCapturingEventOptions","DragDropRegistry","_activeDragInstances","_draggingPredicate","_dropInstances","_dragInstances","_persistentTouchmoveListener","_globalListeners","scroll","_preventDefaultWhileDragging","_clearGlobalListeners","streams","eventOptions","DEFAULT_CONFIG","DragDrop","createDrag","createDropList","i2.DragDropRegistry","DragDropModule","forkJoin","forkJoinInternal","completed","emitted","BaseControlValueAccessor","_elementRef","onTouched","setDisabledState","isDisabled","BuiltInControlValueAccessor","NG_VALUE_ACCESSOR","DEFAULT_VALUE_ACCESSOR","DefaultValueAccessor","COMPOSITION_BUFFER_MODE","_compositionMode","_composing","_isAndroid","_handleInput","_compositionStart","_compositionEnd","isEmptyInputValue","NG_VALIDATORS","NG_ASYNC_VALIDATORS","requiredValidator","patternValidator","nullValidator","regexStr","requiredPattern","actualValue","isPresent","errorMessage","mergeErrors","arrayOfErrors","executeValidators","validators","validator","normalizeValidators","isValidatorFn","validate","presentValidators","composeValidators","composeAsync","composeAsyncValidators","controlValidators","dirValidator","getControlValidators","_rawValidators","getControlAsyncValidators","_rawAsyncValidators","makeValidatorsArray","currentValidators","validatorsToAdd","hasValidator","AbstractControlDirective","_onDestroyCallbacks","pristine","status","untouched","statusChanges","valueChanges","_setValidators","_composedValidatorFn","_setAsyncValidators","_composedAsyncValidatorFn","asyncValidator","_registerOnDestroy","_invokeOnDestroyCallbacks","errorCode","getError","ControlContainer","formDirective","NgControl","valueAccessor","AbstractControlStatus","cd","_cd","isTouched","isUntouched","isPristine","isInvalid","isPending","isSubmitted","submitted","NgControlStatus","NgControlStatusGroup","describeKey","isFormGroup","VALID","PENDING","DISABLED","pickValidators","validatorOrOpts","isOptionsObj","asyncValidators","AbstractControl","_pendingDirty","_hasOwnPendingAsyncValidator","_pendingTouched","_onDisabledChange","_assignValidators","_assignAsyncValidators","validatorFn","asyncValidatorFn","updateOn","_updateOn","setValidators","setAsyncValidators","addValidators","addAsyncValidators","removeValidators","removeAsyncValidators","hasAsyncValidator","clearValidators","clearAsyncValidators","markAsTouched","onlySelf","markAllAsTouched","_forEachChild","markAsUntouched","_updateTouched","markAsDirty","markAsPristine","_updatePristine","markAsPending","emitEvent","disable","skipPristineCheck","_parentMarkedDirty","_updateValue","_updateAncestors","changeFn","updateValueAndValidity","setParent","getRawValue","_setInitialStatus","_cancelExistingSubscription","_runValidator","_calculateStatus","_runAsyncValidator","_updateTreeValidity","ctrl","_allControlsDisabled","_asyncValidationSubscription","setErrors","_updateControlsErrors","currPath","_find","_initObservables","_anyControlsHaveStatus","_anyControls","_anyControlsDirty","_anyControlsTouched","_registerOnCollectionChange","_onCollectionChange","_setUpdateStrategy","coerceToValidator","coerceToAsyncValidator","FormGroup","controls","pickAsyncValidators","_setUpControls","registerControl","addControl","removeControl","setControl","controlName","assertAllValuesPresent","isGroup","missingControlValueError","assertControlPresent","noControlsError","missingControlError","patchValue","_reduceChildren","_syncPendingControls","subtreeUpdated","updated","_reduceValue","initValue","CALL_SET_DISABLED_STATE","setDisabledStateDefault","setUpControl","callSetDisabledState","setUpValidators","setUpViewChangePipeline","_pendingValue","_pendingChange","updateControl","setUpModelChangePipeline","emitModelEvent","viewToModelUpdate","_unregisterOnChange","setUpBlurPipeline","onDisabledChange","registerOnDisabledChange","_unregisterOnDisabledChange","setUpDisabledChangeHandler","registerOnValidatorChange","mergeValidators","onValidatorChange","emitModelToViewChange","viewModel","valueAccessors","defaultAccessor","builtinAccessor","customAccessor","isBuiltInAccessor","formDirectiveProvider","NgForm","resolvedPromise","_findContainer","_directives","getControl","addFormGroup","setUpFormContainer","removeFormGroup","getFormGroup","updateModel","onSubmit","syncPendingControls","ngSubmit","method","onReset","resetForm","isFormControlState","formState","FormControl","_onChange","_applyFormState","nonNullable","initialValueIsDefault","emitViewToModelChange","removeListItem","formControlBinding","NgModel","_registered","selectValueAccessor","_checkForErrors","_checkName","oldName","_getPath","_setUpControl","_updateDisabled","isPropertyUpdated","_isStandalone","_setUpStandalone","_checkParentType","disabledValue","controlPath","ɵNgNoValidate","RadioControlRegistryModule","NG_MODEL_WITH_FORM_CONTROL_WARNING","AbstractValidatorDirective","_validator","inputName","normalizeInput","createValidator","REQUIRED_VALIDATOR","RequiredValidator","PATTERN_VALIDATOR","PatternValidator","ɵInternalFormsSharedModule","FormsModule","ReactiveFormsModule","warnOnNgModelWithFormControl","observableFactory","concatMap","TranslateLoader","TranslateFakeLoader","getTranslation","MissingTranslationHandler","FakeMissingTranslationHandler","keySet","mergeDeep","TranslateParser","TranslateDefaultParser","templateMatcher","interpolate","interpolateString","interpolateFunction","TranslateCompiler","TranslateFakeCompiler","compileTranslations","translations","TranslateStore","currentLang","defaultLang","langs","onTranslationChange","onLangChange","onDefaultLangChange","USE_STORE","USE_DEFAULT_LANG","DEFAULT_LANGUAGE","USE_EXTEND","TranslateService","currentLoader","compiler","parser","missingTranslationHandler","useDefaultLang","isolate","defaultLanguage","_onTranslationChange","_onLangChange","_onDefaultLangChange","_langs","_translations","_translationRequests","setDefaultLang","_defaultLang","_currentLang","retrieveTranslations","changeDefaultLang","getDefaultLang","use","changeLang","loadingTranslations","updateLangs","setTranslation","shouldMerge","getLangs","addLangs","getParsedResult","interpolateParams","translateService","getStreamOnTranslationChange","stream","instant","reloadLang","resetLang","getBrowserLang","browserLang","languages","browserLanguage","userLanguage","getBrowserCultureLang","browserCultureLang","TranslateDirective","onTranslationChangeSub","checkNodes","onLangChangeSub","onDefaultLangChangeSub","translate","translateParams","currentParams","forceUpdate","childNodes","setContent","lastKey","lookupKey","getContent","trimmedContent","originalContent","updateValue","lastParams","onTranslation","TranslatePipe","validArgs","SyntaxError","TranslateModule","MapToOperator","MapToSubscriber","getTinymce","tinymce","Events","validEvents","listenTinyMCEEvent","editor","destroy$","parseStringProperty","unique","isTextarea","normalizePluginArray","mergePlugins","initPlugins","inputPlugins","ScriptLoader","createState","script$","scriptTag","referrerPolicy","mapTo","reinitialize","TINYMCE_SCRIPT_SRC","EDITOR_COMPONENT_VALUE_ACCESSOR","EditorComponent","tinymceScriptSrc","cloudChannel","apiKey","modelEvents","onTouchedCallback","initialise","finalInit","inline","readonly","toolbar","setup","_editor","initEditor","bindHandlers","ignoredEvents","ignoreEvents","allowedEvents","getValidEvents","eventEmitter","setMode","onChangeCallback","uuid","getScriptSrc","getElementById","emitOnChange","onInitNgModel","outputFormat","EditorModule","Trigger","close","open","isManual","DEFAULT_ALIASES","hover","parseTriggers","triggers","trimmedTriggers","parsedTriggers","trigger","triggerPair","manualTriggers","win","BsVerions","guessedVersion","_guessBsVersion","spanEl","innerText","checkPadding","isBs3","__theme","isBs4","getBsVer","isBs5","currentBsVersion","bsVer","resVersion","OnChange","sufix","propertyKey","_key","Utils","opener","crossorigin","integrity","cdnLink","ctx_r2","AlertConfig","dismissible","dismissOnTimeout","AlertComponent","isOpen","dismissibleChange","onClose","onClosed","i2","__decorate","__metadata","AlertModule","AnimationBuilder","AnimationFactory","AUTO_STYLE","definitions","animate","timings","sequence","steps","stateChangeExpr","NoopAnimationPlayer","_onDoneFns","_onStartFns","_onDestroyFns","_originalOnDoneFns","_originalOnStartFns","_started","_finished","_position","parentPlayer","totalTime","_onFinish","onDone","hasStarted","play","_onStart","triggerMicrotask","pause","restart","finish","setPosition","getPosition","triggerCallback","phaseName","AnimationGroupPlayer","_players","players","doneCount","destroyCount","startCount","player","_onDestroy","timeAtPosition","longestPlayer","longestSoFar","beforeDestroy","ɵPRE_STYLE","COLLAPSE_ANIMATION_TIMING","CollapseModule","isDateValid","_mapUnits","_unit","getUTCHours","getUTCSeconds","getUTCMilliseconds","date1","date2","isSameYear","isSameMonth","matchTimestamp","_token","getYear","defaultTimeUnit","getNum","setUTCMonth","setDate","setUTCDate","cloneDate","_date","setSeconds","setUTCSeconds","setMilliseconds","setUTCMilliseconds","setLocaleDayOfWeek","getLocaleDayOfWeek","setISODayOfWeek","setDayOfWeek","getDayOfWeek","getDayOfYear","defaultLongDateFormat","confKey","handleMonthStrictParse","_shortMonths","handleWeekStrictParse","formatLongDate","_getWeekYearFormatCb","getWeekYear","_getISOWeekYearFormatCb","getISOWeekYear","addOffsetFormatToken","getUTCOffset","childProp","parentProp","setDefaultLocale","en","initWeek","getWeek","getISOWeek","initWeekYear","initYear","initTimezone","initTimestamp","initSecond","initQuarter","getQuarter","initOffset","initMonth","initMinute","initMillisecond","initHour","initDayOfYear","initDayOfWeek","getISODayOfWeek","initDayOfMonth","orderingHash","mem","order","dur","localeKey","_units","markInvalid","_format","formatArr","inputLength","_hour","_arr","parseDate","_input","utcAsLocal","convertDuration","_other","offsetDiff","_num","_weekDay","pluralForm","plurals","pluralize","thBeLocale","monthsParseExact","weekdaysParseExact","processHoursFunction","MapPlacementInToRL","PlacementForBs5","css","getOffsetParent","offsetParent","nextElementSibling","getStyleComputedProperty","getRoot","element1","element2","DOCUMENT_POSITION_FOLLOWING","createRange","setStart","setEnd","commonAncestorContainer","isOffsetContainer","firstElementChild","element1root","findCommonOffsetParent","getFixedPositionOffsetParent","sideA","sideB","getSize","getWindowSizes","getClientRect","offsets","sizes","horizScrollbar","vertScrollbar","getBordersSize","getParentNode","getScrollParent","getOffsetRectRelativeToArbitraryNode","fixedPosition","isHTML","childrenRect","parentRect","marginTop","marginLeft","getScroll","side","upperSide","scrollingElement","isFixed","padding","boundariesElement","boundaries","getViewportOffsetRectRelativeToArtbitraryNode","excludeScroll","relativeOffset","boundariesNode","getArea","placement","refRect","allowedPositions","getBoundaries","rects","sortedAreas","area","filteredAreas","allowedPosition","computedPlacement","variation","getOuterSizes","marginBottom","marginRight","getReferenceOffsets","getTargetOffsets","hostOffsets","targetRect","targetOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","getOppositePlacement","modifiers","availablePositions","checkPosition","setStyles","arrow","arrowElement","isVertical","sideCapitalized","altSide","opSide","arrowElementSize","placementVariation","targetMarginSide","targetBorderSide","center","targetBorderRadius","borderRadius","targetSideArrowOffset","sideValue","flip","isModifierEnabled","adaptivePosition","computeAutoPlacement","flipOrder","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariation","getOppositeVariation","preventOverflow","transformProp","targetStyles","primary","isPlacementHorizontal","basePlacement","shiftVariation","shiftOffsets","positionService","Positioning","hostElement","targetElement","positionElements","appendToBody","chainOfModifiers","initData","hostElPosition","placementAuto","positionFixed","modifiedData","modifier","getOffsets","containerClass","dataPlacement","checkMargins","checkPopoverMargin","updateContainerClass","PositioningService","triggerEvent$","update$$","positionElement","_getHtmlElement","attachment","addPositionElement","event$","calcPosition","deletePositionElement","elRef","setOptions","ScanOperator","accumulator","seed","hasSeed","ScanSubscriber","_seed","MiniState","_initialState","actionsDispatcher$","reducer","observeOn","scan","MiniStore","_dispatcher","_reducer","state$","select","pathOrMapFn","TimepickerActions","WRITE_VALUE","payload","changeHours","CHANGE_HOURS","changeMinutes","CHANGE_MINUTES","changeSeconds","CHANGE_SECONDS","SET_TIME_UNIT","updateControls","UPDATE_CONTROLS","dex","hoursPerDay","hoursPerDayHalf","minutesPerHour","secondsPerMinute","isValidDate","toNumber","parseHours","parseMinutes","parseSeconds","parseTime","changeTime","isMinuteInputValid","isSecondInputValid","isHourInputValid","readonlyInput","mousewheel","arrowkeys","getControlsValue","hourStep","minuteStep","secondsStep","showSpinners","showMeridian","showSeconds","meridians","TimepickerConfig","allowEmptyTime","showMinutes","hoursPlaceholder","minutesPlaceholder","secondsPlaceholder","ariaLabelHours","ariaLabelMinutes","ariaLabelSeconds","initialState","canIncrementHours","canIncrementMinutes","canIncrementSeconds","canDecrementHours","canDecrementMinutes","canDecrementSeconds","canToggleMeridian","timepickerReducer","canChangeValue","canChangeHours","_newTime","isValidLimit","canChangeMinutes","canChangeSeconds","_newControlsState","_newHour","_newMinutes","_newSeconds","timepickerControls","_newState","TimepickerStore","TIMEPICKER_CONTROL_VALUE_ACCESSOR","TimepickerComponent","_store","_timepickerActions","meridian","invalidHours","invalidMinutes","invalidSeconds","labelHours","labelMinutes","labelSeconds","timepickerSub","_renderTime","controlsState","isTimepickerInputValid","isInputValid","isOneOfDatesIsEmpty","isSpinnersVisible","isEditable","resetValidation","prevDef","wheelSign","deltaY","updateHours","_updateTime","updateMinutes","updateSeconds","isInputLimitValid","isOneOfDatesEmpty","toggleMeridian","meridianChange","_hours","i4","TimepickerModule","ContentRef","ComponentLoader","_componentFactoryResolver","_applicationRef","_posService","_isHiding","containerDefaultSelector","_listenOpts","isShown","_componentRef","compType","_componentFactory","show","_subscribePositioning","_innerComponent","onBeforeShow","_contentRef","_getContentRef","selectedElement","onShown","_registerOutsideClick","hide","onBeforeHide","componentEl","onHidden","_unsubscribePositioning","_unregisterListenersFn","listenOpts","outsideClick","outsideEsc","registerHide","_registerHide","useToggle","showFn","_hide","unsubscribeFn","listenToTriggersV2","_globalListener","attachInline","vRef","_inlineViewRef","targets","registerOutsideClick","registerEscClick","getInnerComponent","_zoneSubscription","contentCmptFactory","modalContentInjector","ComponentLoaderFactory","createLoader","TooltipConfig","TooltipContainerComponent","_bsVersions","classMap","in","fade","TooltipDirective","cis","_positionService","tooltipId","tooltipAnimation","tooltipFadeDuration","_tooltip","htmlContent","tooltip","_placement","_isOpen","warnOnce","_enable","_appendToBody","_popupClass","_tooltipContext","_tooltipPopupDelay","_tooltipTrigger","tooltipChange","setAriaDescribedBy","_ariaDescribedby","_delayTimeoutId","showTooltip","cancelDelayedTooltipShowing","_tooltipCancelShowFn","_delaySubscription","TooltipModule","ctx_r10","BsDatepickerConfig","useUtc","isAnimated","returnFocusToInput","displayMonths","showWeekNumbers","dateInputFormat","rangeSeparator","rangeInputFormat","monthTitle","yearTitle","dayLabel","monthLabel","yearLabel","weekNumbers","showTodayButton","showClearButton","todayPosition","clearPosition","todayButtonLabel","clearButtonLabel","customRangeButtonLabel","withTimepicker","DATEPICKER_ANIMATION_TIMING","datepickerAnimation","BsDatepickerAbstractComponent","customRanges","chosenRange","minDate","_effects","setMinDate","maxDate","setMaxDate","daysDisabled","setDaysDisabled","datesDisabled","setDatesDisabled","datesEnabled","setDatesEnabled","setDisabled","dateCustomClasses","setDateCustomClasses","dateTooltipTexts","setDateTooltipTexts","daysCalendar$","_daysCalendar$","_daysCalendarSub","multipleCalendars","setViewMode","navigateTo","dayHoverHandler","weekHoverHandler","monthHoverHandler","yearHoverHandler","timeSelectHandler","daySelectHandler","monthSelectHandler","yearSelectHandler","setRangeOnCalendar","setToday","clearDate","_stopPropagation","BsDatepickerActions","calculate","CALCULATE","FORMAT","FLAG","SELECT","selectTime","SELECT_TIME","changeViewMode","CHANGE_VIEWMODE","NAVIGATE_TO","navigateStep","NAVIGATE_OFFSET","SET_OPTIONS","selectRange","SELECT_RANGE","hoverDay","HOVER","isHovered","cell","SET_MIN_DATE","SET_MAX_DATE","SET_DAYSDISABLED","SET_DATESDISABLED","SET_DATESENABLED","SET_IS_DISABLED","SET_DATE_CUSTOM_CLASSES","SET_DATE_TOOLTIP_TEXTS","setLocale","SET_LOCALE","BsLocaleService","_defaultLocale","localeChange","_localeChange","currentLocale","BsDatepickerEffects","_localeService","_actions","_subs","_bsDatepickerStore","setRangeValue","setBindings","selectedTime","times","flaggedMonths","monthsCalendar","flaggedMonthsCalendar","yearsCalendar","yearsCalendarFlagged","viewMode","options$","setEventHandlers","_cell","isOtherMonth","registerDatepickerSideEffects","monthsModel","monthModel","formattedMonths","selectedDate","selectedRange","yearsCalendarModel","hoveredDate","_initialView","initialDatepickerState","monthViewOptions","isMonthDisabled","minBound","maxBound","isYearDisabled","isDisabledDate","dateDisabled","isEnabledDate","enabledDate","getYearsCalendarInitialDate","calendarIndex","ranges","compareDateWithMaxDateHelper","setCurrentTimeOnDateSelect","setCurrentTimeHelper","setDateRangesCurrentTimeOnDateSelect","initialDate","matrix","shiftDate","startingDate","firstDay","getFirstDayOfMonth","isFirstDayOfWeek","startingDayOffset","_startingDayOffset","calculateDateOffset","getStartingDayOfCalendar","daysMatrix","createMatrix","getWeekNumbers","getShiftedWeekdays","minMode","viewDate","formatOptions","label","hideRightArrow","hideLeftArrow","disableRightArrow","disableLeftArrow","yearsPerCalendar","initialYearShift","formatYearsCalendar","previousInitialDate","calculateInitialDate","yearsMatrix","formatYearRangeTitle","sourceDate","bsDatepickerReducer","calculateReducer","displayOneMonthRange","isDisplayOneMonth","showPreviousMonth","monthIndex","calcDaysCalendar","preventChangeToNextMonth","viewMonth","formatMonthsCalendar","getFormatOptions","formatReducer","formatDaysCalendar","daysCalendar","weekIndex","dayIndex","flagReducer","formattedMonth","isSameDay","isSelectionStart","isSelectionEnd","isSelected","isInRange","isDateInRange","isDisabledDay","isToday","customClasses","dcc","tooltipText","tt","newDay","flagDaysCalendar","monthCalendar","rowIndex","hoveredMonth","newMonth","flagMonthsCalendar","yearIndex","hoveredYear","flagYearsCalendar","navigateOffsetReducer","shiftViewDate","middleDate","setFullDate","newState","canSwitchMode","_time","copyTime","getViewDate","dte","BsDatepickerStore","BsCustomDatesViewComponent","selectFromRanges","onSelect","BsNavigationDirection","BsCurrentDateViewComponent","BsTimepickerViewComponent","ampm","BsCalendarLayoutComponent","BsDatepickerDayDecoratorComponent","_elRef","customTodayClass","BsDatepickerNavigationViewComponent","navTo","down","onNavigate","DOWN","UP","onViewMode","BsDaysCalendarViewComponent","isiOS","maxTouchPoints","isShowTooltip","selectDay","selectWeek","selectWeekDateRange","selectFromOtherMonth","selectedDay","lastDayOfRange","isWeekHovered","onHoverWeek","isOtherMonthHovered","dateData","onHover","BsMonthCalendarViewComponent","hoverMonth","BsYearsCalendarViewComponent","viewYear","hoverYear","BsDatepickerContainerComponent","animationState","isRangePicker","isTopPosition","isOtherMonthsActive","showTodayBtn","todayBtnLbl","todayPos","showClearBtn","clearBtnLbl","clearPos","customRangeBtnLbl","valueChange","selectedTimeSub","startTimepicker","positionServiceEnable","i6","BsDatepickerDirective","_datepicker","isOpen$","bsValue","_bsValue","bsConfig","initCurrentTime","bsValueChange","dateInputFormat$","_dateInputFormat$","setConfig","_datepickerRef","initSubscribes","isDestroy$","checkBsValue","unsubscribeSubscriptions","BsDaterangepickerContainerComponent","_rangeStack","dateRange","endTimepicker","rangesProcessing","maxDateRange","setMaxDateRangeOnCalendar","currentSelection","maxDateValueInMilliseconds","maxDateRangeInMilliseconds","BS_DATEPICKER_VALUE_ACCESSOR","BsDatepickerInputDirective","BS_DATEPICKER_VALIDATOR","_picker","setBsValue","_setInputValue","_onTouched","onKeydownEvent","bsDate","_validatorChange","_localeKey","onBlur","blur","BsDaterangepickerConfig","BsDaterangepickerDirective","rangeInputFormat$","_rangeInputFormat$","checkRangesWithMaxDate","BS_DATERANGEPICKER_VALUE_ACCESSOR","BsDaterangepickerInputDirective","BS_DATERANGEPICKER_VALIDATOR","_isFirstDateValid","_isSecondDateValid","trimmedSeparator","BsDatepickerModule","FocusTrapManager","_focusTrapStack","focusTrap","ft","_disable","InteractivityChecker","hasAttribute","isVisible","hasGeometry","isTabbable","frameElement","getFrameElement","getWindow","getTabIndexValue","tabIndexValue","isPotentiallyTabbableIOS","inputType","FIREFOX","tabIndex","isFocusable","isPotentiallyFocusable","isHiddenInput","isInputElement","isNativeFormElement","isAnchorWithHref","isAnchorElement","hasValidTabIndex","ignoreVisibility","FocusTrap","_checker","deferAnchors","_hasAttached","startAnchorListener","focusLastTabbableElement","endAnchorListener","focusFirstTabbableElement","attachAnchors","_startAnchor","_endAnchor","_toggleAnchorTabIndex","startAnchor","endAnchor","_createAnchor","focusInitialElementWhenReady","_executeOnStable","focusInitialElement","focusFirstTabbableElementWhenReady","focusLastTabbableElementWhenReady","_getRegionBoundary","markers","_getFirstTabbableElement","_getLastTabbableElement","redirectToElement","focusableChild","hasAttached","tabbableChild","isEnabled","toggleAnchors","FocusTrapFactory","deferCaptureElements","FocusTrapDirective","_focusTrapFactory","_previouslyFocusedElement","_autoCapture","autoCapture","_captureFocus","autoCaptureChange","FocusTrapModule","BsModalRef","ModalOptions","modalConfigDefaults","backdrop","keyboard","ignoreBackdropClick","class","animated","closeInterceptor","MODAL_CONFIG_DEFAULT_OVERRIDE","ModalContainerComponent","isModalHiding","clickStartedInContent","bsModalService","getModalsCount","checkScrollbar","setScrollbar","onClickStarted","onClickStop","setDismissReason","onEsc","ModalBackdropComponent","_isAnimated","_isShown","currentId","BsModalService","clf","modalDefaultOption","isBodyOverflowing","originalBodyPadding","scrollbarWidth","modalsCount","loaders","_backdropLoader","_createLoaders","_showBackdrop","lastDismissReason","_showModal","_hideBackdrop","resetScrollbar","_hideModal","removeLoaders","isBackdropEnabled","isBackdropInDOM","backdropRef","removeBackdrop","modalLoader","bsModalRef","modalContainerRef","setClass","newClass","onHide","copyEvent","indexToRemove","getScrollbarWidth","scrollDiv","onShow","ModalModule","PaginationConfig","itemsPerPage","boundaryLinks","directionLinks","firstText","previousText","nextText","lastText","pageBtnClass","align","PAGER_CONTROL_VALUE_ACCESSOR","PagerComponent","paginationConfig","inited","_itemsPerPage","_totalItems","_totalPages","_page","configureOptions","main","pager","totalPages","calculateTotalPages","totalItems","numPages","selectPage","page","_previous","pageChanged","maxSize","pages","getPages","getText","noPrevious","noNext","makePage","currentPage","startPage","endPage","isMaxSized","previousPageSet","nextPageSet","PAGINATION_CONTROL_VALUE_ACCESSOR","PaginationComponent","PaginationModule","TabsModule","ToastaConfig","showClose","showDuration","theme","ToastaEventType","ToastaEvent","ToastaService","uniqueCounter","eventSource","default","warning","toastaOptions","_checkConfigItem","THEMES","toast","onAdd","onRemove","ADD","clearAll","CLEAR_ALL","CLEAR","toastaServiceFactory","ToastaModule","MATERIAL_SANITY_CHECKS","MATERIAL_SANITY_CHECKS_FACTORY","MatCommonModule","_sanityChecks","_hasDoneGlobalChecks","_checkIsEnabled","mixinDisabled","defaultColor","color","_color","colorPalette","mixinDisableRipple","disableRipple","_disableRipple","ErrorStateMatcher","isErrorState","RippleRef","_animationForciblyDisabledThroughCss","fadeOut","fadeOutRipple","passiveCapturingEventOptions","RippleEventManager","handlers","handleEvent","addHandler","handlersForEvent","handlersForElement","_delegateEventHandler","removeHandler","enterDuration","exitDuration","pointerDownEvents","pointerUpEvents","RippleRenderer","_target","_isPointerDown","_pointerUpEventsRegistered","_containerElement","fadeInRipple","containerRect","_containerRect","animationConfig","defaultRippleAnimationConfig","centered","radius","distanceToFurthestCorner","distX","distY","sqrt","ripple","transitionDuration","computedStyles","userTransitionDuration","animationForciblyDisabledThroughCss","transitionProperty","rippleRef","persistent","_mostRecentTransientRipple","eventListeners","onTransitionEnd","_finishRippleTransition","onTransitionCancel","_destroyRipple","_activeRipples","rippleEl","fadeOutAll","_getActiveRipples","fadeOutAllNonPersistent","setupTriggerEvents","_triggerElement","_removeTriggerEvents","_eventManager","_onTouchStart","_onPointerUp","_startFadeOutTransition","isMostRecentTransientRipple","isFakeMousedown","_lastTouchStartEvent","rippleDisabled","clientX","clientY","rippleConfig","terminateOnPointerUp","MAT_RIPPLE_GLOBAL_OPTIONS","MatRipple","_setupTriggerEventsIfEnabled","_trigger","globalOptions","_animationMode","_isInitialized","_globalOptions","_rippleRenderer","launch","configOrX","MatRippleModule","MatPseudoCheckboxModule","MatLegacyOptionModule","Portal","_attachedHost","isAttached","setAttachedHost","ComponentPortal","TemplatePortal","DomPortal","BasePortalOutlet","_isDisposed","attachDomPortal","_attachedPortal","portal","attachComponentPortal","attachTemplatePortal","_invokeDisposeFn","setDisposeFn","_disposeFn","DomPortalOutlet","outletElement","_defaultInjector","_getComponentRootNode","PortalModule","BlockScrollStrategy","_previousHTMLStyles","_isEnabled","_canBeEnabled","_previousScrollPosition","htmlStyle","bodyStyle","previousHtmlScrollBehavior","scrollBehavior","previousBodyScrollBehavior","CloseScrollStrategy","_scrollDispatcher","_detach","_overlayRef","overlayRef","_initialScrollPosition","updatePosition","NoopScrollStrategy","containerBounds","scrollContainerRect","RepositionScrollStrategy","scrollThrottle","autoClose","overlayRect","overlayElement","isElementScrolledOutsideView","ScrollStrategyOptions","reposition","OverlayConfig","panelClass","hasBackdrop","backdropClass","disposeOnNavigation","configKeys","ConnectedOverlayPositionChange","connectionPair","scrollableViewProperties","BaseOverlayDispatcher","_attachedOverlays","OverlayKeyboardDispatcher","overlays","_keydownEvents","keydownEvents","_isAttached","_keydownListener","OverlayOutsideClickDispatcher","_cursorStyleIsSet","_pointerDownEventTarget","_outsidePointerEvents","outsidePointerEvents","_addEventListeners","_cursorOriginalValue","_pointerDownListener","_clickListener","OverlayContainer","getContainerElement","_createContainer","oppositePlatformContainers","OverlayRef","_portalOutlet","_pane","_keyboardDispatcher","_outsideClickDispatcher","_animationsDisabled","_backdropElement","_backdropClick","_disposeBackdrop","scrollStrategy","_positionStrategy","positionStrategy","backdropElement","_previousHostParent","attachResult","_updateStackingOrder","_updateElementSize","_updateElementDirection","_togglePointerEvents","_attachBackdrop","_toggleClasses","_attachments","_locationChanges","detachBackdrop","detachmentResult","_detachments","_detachContentWhenStable","_disposeScrollStrategy","backdropClick","attachments","detachments","getConfig","updatePositionStrategy","strategy","updateSize","sizeConfig","setDirection","addPanelClass","removePanelClass","getDirection","updateScrollStrategy","minWidth","minHeight","maxWidth","maxHeight","enablePointer","showingClass","_backdropClickHandler","backdropToDetach","_backdropTransitionendHandler","_backdropTimeout","cssClasses","isAdd","boundingBoxClass","cssUnitPattern","FlexibleConnectedPositionStrategy","_preferredPositions","_overlayContainer","_lastBoundingBoxSize","_isPushed","_canPush","_growAfterOpen","_hasFlexibleDimensions","_positionLocked","_viewportMargin","_scrollables","_offsetX","_offsetY","_appliedPanelClasses","_positionChanges","setOrigin","_validatePositions","_boundingBox","_isInitialRender","_lastPosition","reapplyLastPosition","_clearPanelClasses","_resetOverlayElementStyles","_resetBoundingBoxStyles","_viewportRect","_getNarrowedViewportRect","_originRect","_getOriginRect","_overlayRect","originRect","viewportRect","flexibleFits","originPoint","_getOriginPoint","overlayPoint","_getOverlayPoint","overlayFit","_getOverlayFit","isCompletelyWithinViewport","_applyPosition","_canFitWithFlexibleDimensions","boundingBoxRect","_calculateBoundingBoxRect","visibleArea","bestFit","bestScore","fit","_previousPushAmount","alignItems","justifyContent","lastPosition","withScrollableContainers","scrollables","withPositions","withViewportMargin","withFlexibleDimensions","flexibleDimensions","withGrowAfterOpen","growAfterOpen","withPush","canPush","withLockedPosition","isLocked","withDefaultOffsetX","withDefaultOffsetY","withTransformOriginOn","_transformOriginSelector","originX","startX","_isRtl","endX","originY","overlayStartX","overlayStartY","overlayX","overlayY","rawOverlayRect","overlay","getRoundedBoundingClientRect","_getOffset","visibleWidth","_subtractOverflows","visibleHeight","fitsInViewportVertically","fitsInViewportHorizontally","availableHeight","availableWidth","getPixelValue","horizontalFit","_pushOverlayOnScreen","overflowRight","overflowBottom","overflowTop","overflowLeft","pushX","pushY","_setTransformOrigin","_setOverlayElementStyles","_setBoundingBoxStyles","_addPanelClasses","_getScrollVisibility","changeEvent","xOrigin","yOrigin","transformOrigin","smallestDistanceToViewportEdge","previousHeight","previousWidth","_hasExactPosition","hasExactPosition","hasFlexibleDimensions","_getExactOverlayY","_getExactOverlayX","transformString","horizontalStyleProperty","originBounds","overlayBounds","scrollContainerBounds","isOriginClipped","isElementClippedByScrolling","isOriginOutsideView","isOverlayClipped","isOverlayOutsideView","overflows","currentOverflow","cssClass","wrapperClass","GlobalPositionStrategy","_cssPosition","_topOffset","_bottomOffset","_alignItems","_xPosition","_xOffset","_width","_height","centerHorizontally","centerVertically","parentStyles","shouldBeFlushHorizontally","shouldBeFlushVertically","xPosition","xOffset","OverlayPositionBuilder","flexibleConnectedTo","i3.OverlayContainer","nextUniqueId","Overlay","scrollStrategies","_positionBuilder","_directionality","_animationsModuleType","_createHostElement","pane","_createPaneElement","portalOutlet","_createPortalOutlet","overlayConfig","i1.ScrollStrategyOptions","i2.OverlayContainer","i3.OverlayPositionBuilder","i4.OverlayKeyboardDispatcher","i5","i7.OverlayOutsideClickDispatcher","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY","OverlayModule","MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER","MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY","MatLegacyAutocompleteModule","BUTTON_HOST_ATTRIBUTES","_MatButtonBase","mixinColor","MatLegacyButton","_focusMonitor","isRoundButton","_hasHostAttributes","_getHostElement","_isRippleDisabled","attribute","MatLegacyButtonModule","MatLegacyCardModule","_MatCheckboxRequiredValidatorModule","MatLegacyCheckboxModule","MAT_LEGACY_CHIPS_DEFAULT_OPTIONS","MatLegacyChipsModule","separatorKeyCodes","MatDividerModule","CdkAccordionModule","MatExpansionModule","MatLegacyFormFieldModule","finalize","FinallyOperator","FinallySubscriber","HttpHandler","HttpBackend","HttpHeaders","headers","lazyUpdate","lazyInit","line","maybeSetNormalizedName","normalizedNames","getAll","op","lcName","copyFrom","applyUpdate","toDelete","HttpUrlEncodingCodec","encodeKey","standardEncoding","encodeValue","decodeKey","decodeValue","STANDARD_ENCODING_REGEX","STANDARD_ENCODING_REPLACEMENTS","valueToString","HttpParams","updates","cloneFrom","encoder","fromString","fromObject","paramParser","rawParams","codec","eqIdx","appendAll","eKey","HttpContext","isArrayBuffer","ArrayBuffer","isBlob","Blob","isFormData","FormData","HttpRequest","third","fourth","reportProgress","withCredentials","responseType","mightHaveBody","urlWithParams","qIdx","serializeBody","isUrlSearchParams","URLSearchParams","detectContentTypeHeader","setHeaders","setParams","HttpEventType","HttpResponseBase","defaultStatus","defaultStatusText","statusText","ok","HttpHeaderResponse","ResponseHeader","HttpResponse","Response","HttpErrorResponse","addBody","HttpClient","request","req","events$","res$","jsonp","callbackParam","post","interceptorChainEndFn","finalHandlerFn","adaptLegacyInterceptorToChain","chainTailFn","interceptor","initialRequest","intercept","downstreamRequest","HTTP_INTERCEPTORS","HTTP_INTERCEPTOR_FNS","legacyInterceptorFnFactory","reduceRight","HttpInterceptorHandler","backend","dedupedInterceptorFns","nextSequencedFn","interceptorFn","chainedInterceptorFn","XSSI_PREFIX","HttpXhrBackend","xhrFactory","xhr","setRequestHeader","detectedType","reqBody","headerResponse","partialFromXhr","getAllResponseHeaders","getResponseUrl","responseURL","getResponseHeader","onLoad","responseText","originalBody","sentHeaders","onDownProgress","progressEvent","DownloadProgress","loaded","lengthComputable","partialText","onUpProgress","progress","UploadProgress","upload","send","Sent","readyState","DONE","XSRF_ENABLED","XSRF_COOKIE_NAME","XSRF_HEADER_NAME","HttpXsrfTokenExtractor","HttpXsrfCookieExtractor","lastCookieString","lastToken","parseCount","cookieString","lcUrl","headerName","HttpFeatureKind","makeHttpFeature","ɵkind","xsrfInterceptorFn","makeEnvironmentProviders","LEGACY_INTERCEPTOR_FN","HttpClientModule","provideHttpClient","LegacyInterceptors","MatIconModule","TextFieldModule","MatLegacyInputModule","MAT_MENU_SCROLL_STRATEGY","MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER","MAT_MENU_SCROLL_STRATEGY_FACTORY","MatLegacyMenuModule","MatLegacyRadioModule","MAT_SELECT_SCROLL_STRATEGY_PROVIDER","MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY","MatLegacySelectModule","MatLegacySnackBarModule","CdkTableModule","MatLegacyTableModule","MAT_TOOLTIP_SCROLL_STRATEGY","MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER","MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY","MatLegacyTooltipModule","MatLegacyTabsModule","MatLegacySliderModule","SkipWhileOperator","SkipWhileSubscriber","skipping","tryCallPredicate","WithLatestFromOperator","WithLatestFromSubscriber","_tryProject","ApBaseClass","throwAsyncError","takeUntilDestroy","onDestroy$","SystemGuid","GuidEmpty","CareTeam","Everyone","BuildInMessageImplementation","ApproveMessageImplementation","RoutineMessageUrgency","AAMessageType","TCMessageType","RxMessageType","TaskMessageType","TaskMessageType_Procedure","HL7MessageType","ANMessageType","ClaimErrorMessageType","MessageAttachHTML","ERxRefillMessageType","RxRefillMessageType","ChangeRxMessageType","ChangeRxPriorAuthorizationMessageType","RxRefillRequestMessageType","SurveyMessageType","AuthorizationMessageType","MessageAttachmentType","InstantMessageMessageType","CollectionMessageMessageType","StrikeOutMessageType","LabMessageType","PatientLabOrderMessageType","ERxChangeMessageType","ERxEligibilityMessageType","ERxMedicationHistoryMessageType","PatientEmergencyChartAccessMessageType","VisitBillingReviewMessageType","VaccineAdministrationMessageType","PatientReferralMessageType","RefundTaskMessageType","FinancialChangeAlertMessageType","AmendmentMessageType","FacilityPortalMessageType","EPCSSignatureRightsMessageType","MessageRxRequestSubType","MessageRxResponseSubType","MessageRxElectronicTransmissionErrorSubType","JobEngineSubMessageType","DocumentFaxErrorSubMessageType","PatientSurveySubMessageType","PatientDemographicsSubMessageType","PatientAppointmentRequestSubMessageType","PatientRxRefillRequestSubMessageType","PatientAmendmentSubMessageType","AttachmentSubMessageType","PatientPortalRxRefillMessageSubType","PatientGeneralQuestionSubMessageType","PatientAppointmentQuestionSubMessageType","PatientRxQuestionSubMessageType","PatientDemographicsQuestionSubMessageType","PatientBillingQuestionSubMessageType","PatientEmailNewPatientAccountSubMessageType","PatientEmailNewPortalAccountSubMessageType","PatientPortalErrorSubMessageType","PatientSubmitLoginAssistanceType","CDSReminderSubMessageType","PatientRecallSubMessageType","PatientFamilyHistorySubMessageType","PatientServiceOrderSubMessageType","PatientWelcomeMessagePracticeDefaultSubMessageType","PatientWelcomeMessageProviderOverrideSubMessageType","HMRuleMessageSubType","ReplicationMessageSubType","MessageProcedureRequestSubType","PatientVisitNoteAccessSubMessageType","PatientChartAccessSubMessageType","CPOBillingMessageSubType","SecurityAlertMessageSubType","ScheduledReportMessageSubType","ClaimReportMessageSubType","CancelledServiceOrderSubType","CarePlanMessageSubType","CCMMessageSubType","CollectionStatusExpirationMessageSubType","AuthorizationRequestSubType","AuthorizationResponseSubType","AccountChangeAlertSubType","PatientLabOrderRequestSubType","PatientLabOrderResponseSubType","DocumentGenerationInstructionsSubType","CompleteChartPrintSubType","ProviderIDVerificationSubType","RequestGrantProviderEPCSRightsSubType","RequestRevokeProviderEPCSSubType","DirectMailWithoutAttachmentMessageSubType","DirectMailWithAttachmentMessageSubType","UrlLinkMessageSubType","ElectronicResultMessageSubType","ERxMessageDenyReasonRefillNotAppropriate","ERxMessageDenyReasonPatientUnknownToPractice","MessageStatusNew","MessageStatusView","MessageStatusComplete","MessageStatusWait","KdbSecurityGroup","ClinicalDelgateSecurityAllow","SecurityListEditorObjects","SecurityListReportObjects","SecurityListFilterObjects","ReportSecurity","AttachmentHandler_GraphicNote","AttachmentHandler_AllFiles","AttachmentHandler_Bmp","Report_CQM","Report_HEDIS","HL7ListenerJob","MainFinancialCenterUid","ClaimReportStatusNewUid","ClaimReportStatusReviewedUid","PaperClaimOptionDefaultToElectronicUid","PaperClaimOptionSecondaryClaimsPrintUid","PaperClaimOptionAllClaimsPrintUid","ETacticsHL7PartnerUid","ETacticsCreateHL7PartnerMessageUid","PrintStatementActionUid","SubmitStatementActionUid","PrintPreviewStatementActionUid","PracticeInsightElectronicStatementsHL7PartnerUid","PracticeInsightElectronicStatementsHL7PartnerMessageUid","ProcessStatementActionUid","PaymentTypeCheckUid","PaymentTypePureAdjustmentUid","ListDepositMacro_Visit","ListDepositMacro_Account","ListDepositMacro_RPOldestFirst","ListPayerCreditRefundStatus_Pending","ListPayerCreditRefundStatus_Approved","ListPayerCreditRefundStatus_Rejected","ListPayerCreditRefundStatus_Open","ListPayerCreditRefundStatus_Closed","ScheduledAppointmentStatusUid","CancelledAppointmentStatusUid","NoShowAppointmentStatusUid","CheckedInAppointmentStatusUid","DischargedAppointmentStatusUid","ReadyToDischageAppointmentStatusUid","AppointmentCallStatusConfirmed","NeedToRescheduleAppointmentStatusUid","DefaultAmountAllowedScheduleUid","UserDefinedGroupType","AttachmentType_Dictation","AttachmentType_CCDCDataExchangExport","ReportAppointment","ReportBalanceAndCloseCharges","ReportBalanceAndCloseTransactions","ReportCapitation","ReportCMS1500","ReportCMS1500NPI","ReportCMS1500NPI5010","ReportCollectionsInsurance","ReportCollectionsPatient","ReportDepositSlip","ReportHL7LabReport","ReportInsuranceAging","ReportNoSB_Encounters","ReportPatientLedger","ReportPracticeFinancials","ReportPrescription","ReportProcedureProductivity","ReportStatementBatch","ReportStatementDetails","ReportStatementBatchMainAccount","ReportStatementDetailsMainAccount","ReportTotalAR","ReportVisitsWithoutSBs","ReportMedicationTimeFlow","ReportSuperbill","ReportERA","ReportStatementBatchByFinancialCenter","ReportStatementDetailsByFinancialCenter","ReportStatementBatchMainAccountByFinancialCenter","ReportStatementDetailsMainAccountByFinancialCenter","ReportPrintAttachmentText","ReportPrintAttachmentImage","ReportPrintAttachmentNoNote","ReportPrintAttachmentImageOnly","ReportGroupVisitRosterSignInSheet","ReportPatientRecordDisclosure","ReportCDSReminders","ReportCallpointeMU","ReportPrintAttachmentTIF","ReportMedicationReviewForm","AppointmentChargeTicket","ListFindTable_Reports","ListFindTable_DiagnosisCode10","ReportRefundCheck","ReportRefundCheckRegister","ReportUB04","ReportCMSR131L","ReportResponsiblePartyAccountPage","Vital_BMI","Vital_Temperature","Vital_Temperature_Method","Vital_RR","Vital_RR_Condition","Vital_SpO2","Vital_SpO2_Condition","Vital_SpO2_Method","Vital_Comment","Vital_Metric_Head_Circ","Vital_HR_Method","Vital_HR_Value_Sitting","Vital_HR_Value_Standing","Vital_HR_Value_Supine","Vital_HR_Location_Sitting","Vital_HR_Location_Standing","Vital_HR_Location_Supine","Vital_HR_Regularity_Sitting","Vital_HR_Regularity_Standing","Vital_HR_Regularity_Supine","Vital_BP_Location_1","Vital_BP_Position_1","Vital_BP_Sys_1","Vital_BP_Dias_1","Vital_BP_Location_2","Vital_BP_Position_2","Vital_BP_Sys_2","Vital_BP_Dias_2","Vital_BP_Location_3","Vital_BP_Position_3","Vital_BP_Sys_3","Vital_BP_Dias_3","Vital_BP_Location_4","Vital_BP_Position_4","Vital_BP_Sys_4","Vital_BP_Dias_4","Vital_BP_Location_NotSelected","Vital_BP_Location_LeftArm","Vital_BP_Location_RightArm","Vital_BP_Location_LeftLeg","Vital_BP_Location_RightLeg","Vital_BP_Position_NotSelected","Vital_BP_Position_Sitting","Vital_BP_Position_Standing","Vital_BP_Position_Supine","Vital_Heart_Rate_1","Vital_Heart_Rate_2","Vital_Heart_Rate_3","Vital_Position_Sitting","Vital_Position_Standing","Vital_Position_Supine","Vital_Weight_Dress_NotSelected","Vital_Weight_Dress_Clothed","Vital_Weight_Dress_Unclothed","Vital_Respiratory_Rate_NotSelected","Vital_Respiratory_Rate_Quiet","Vital_Respiratory_Rate_Sleeping","Vital_Respiratory_Rate_Crying","Vital_Heart_Regularity_Regular","Vital_Heart_Regularity_Irregular","Vital_Heart_Regularity_RegularRegular","Vital_Heart_Regularity_RegularIrregular","Vital_Heart_Regularity_IrregularRegular","Vital_Heart_Regularity_IrregularIrregular","Vital_MetricWeight","Vital_MetricHeight","Vital_MetricTemp","Vital_ImperialTemp","Vital_BloodPressureMethod","Vital_MetricBloodPressure1","Vital_MetricBloodPressure2","Vital_MetricBloodPressure3","Vital_MetricBloodPressure4","Vital_HeadCircumference","Vital_WaistMeasure","ListSuperbillStatus_AprimaVaultDataConversionComplete","ListSuperbillStatus_Cancelled","ListSuperbillStatus_Complete","ListSuperbillStatus_Filed","ListSuperbillStatus_Hold","ListSuperbillStatus_Insurance_Action","ListSuperbillStatus_Account_Change_Alert","ListSuperbillStatus_Overpaid","ListSuperbillStatus_Pending_Patient_Payment","ListSuperbillStatus_Preliminary","ListSuperbillStatus_Queued","ListSuperbillStatus_Ready_to_Review","ListSuperbillStatus_Ready_to_Submit","ListSuperbillStatus_Rejected","ListSuperbillStatus_Succeeded","ListSuperbillStatus_Failed_Validation","ListSuperbillStatus_Passed_CodeValidation","ListSuperbillStatus_ERA_Claim_Rejected","ListSuperbillStatus_Queued_Rejected","ListSuperbillStatus_Batched","ListSuperbillStatus_Batching","PatientHistory_AnchorQuestion_Immunization","PatientHistory_AnchorQuestion_Menstrual","PatientHistory_AnchorQuestion_Pregnancy","HistoryGroupMedicalHistory","HistoryGroupInfectionHistory","HistoryGroupSurgicalHistory","HistoryGroupFamilyHistory","HistoryGroupGeneticScreening","HistoryGroupSocialHistory","HistoryGroupMedicationHistory","HistoryGroupFoodAllergy","HistoryGroupDrugAllergy","HistoryGroupEnvironmentAllergy","HistoryGroupImmunizationHistory","HistoryGroupSpecialtyHistory","HistoryGroupMenstrualHistory","HistoryGroupPregnancyHistory","HistoryGroupFlowsheet","HistoryGroupObservationHistory","HistoryGroupProblemDiagnosis","HistoryGroupAddressHistory","HistoryGroupNewFamilyHistory","HistoryGroupDSMIV","HistoryGroupCognitiveAssessment","HistoryGroupFunctionalAssessment","HistoryGroupProcedureHistory","HistoryGroupGenericFreeText","HistoryGroup_Immunization_Question_Vaccine","HistoryGroup_Immunization_Question_TypeofVaccine","HistoryGroup_Immunization_Question_DateGiven","HistoryGroup_Immunization_Question_Route","HistoryGroup_Immunization_Question_SiteGiven","HistoryGroup_Immunization_Question_LotNum","HistoryGroup_Immunization_Question_Manufacture","HistoryGroup_Immunization_Question_ExpDate","HistoryGroup_Immunization_Question_VISDate","HistoryGroup_Immunization_Question_VISGivenDate","HistoryGroup_Immunization_Question_Initial","HistoryGroup_Immunization_Question_Notes","HistoryGroup_Immunization_Question_FundingSource","HistoryGroup_Immunization_Answer_Date","HistoryGroup_Immunization_Answer_Text","HistoryGroup_Immunization_VaccineFunding_AnswerGroup","HistoryGroup_Immunization_FamilyImmunizationSection","VaccineRoute_PO","VaccineRoute_NS","VaccineRoute_OTH","HistoryGroup_ANSWERGOUP_TIMEFRAME","HistoryGroup_ANSWERGOUP_FAMILY_DISEASE","HistoryGroup_ANSWERGOUP_REACTION","HistoryGroup_MedicationHistory_PatientTakesNoMeds","SocialHistory_TobaccoHistory","SocialHistory_TobaccoHistory_NeverSmoked","SocialHistory_TobaccoHistory_QuitSmoking5","SocialHistory_TobaccoHistory_QuitSmoking10","SocialHistory_TobaccoHistory_QuitSmoking10Plus","SocialHistory_TobaccoHistory_CurrentlySmokeless","SocialHistory_TobaccoHistory_CurrentlySmokes","SocialHistory_TobaccoHistory_EverydaySmoker","SocialHistory_TobaccoHistory_SomeDaySmoker","SocialHistory_TobaccoHistory_Smoker_StatusUnknown","SocialHistory_TobaccoHistory_HeavySmoker","SocialHistory_TobaccoHistory_LightSmoker","PatientCommunicationType_SmokingCessation","PatientCommunicationType_PhysicalActivity","PatientCommunicationType_Nutrition","PatientCommunicationType_Underweight","PatientCommunicationType_Overweight","OBCaseTypeUid","Disease_Pregnancy","CaseTypeOBFlowsheet","CaseTypeOBEDD","eRxMessageType_new_rx","eRxMessageType_refill_request","eRxMessageType_refill_response","eRxMessageType_error_script","eRxMessageType_status","eRxMessageType_verify","eRxMessageType_eligibity","eRxMessageType_eligibility_response","eRxMessageType_rx_history_request","eRxMessageType_rx_history_response","eRxMessageType_rx_cancel_request","eRxMessageType_rx_cancel_response","eRxMessageType_rx_change_request","eRxMessageType_rx_change_response","eRxMessageType_rx_formularyupdate","eRxMessageType_rx_formularylist","eRxMessageType_rx_eprescribingactivityreportupdate","eRxMessageType_pharmacy_update","eRxMessageType_pharmacy_list","eRxMessageType_prescriber_update","eRxMessageType_prescriber_list","eRxMessageType_inboundmessageroutingregistration","eRxMessageType_inbound","eRxMessageType_providerdirectory","eRxMessageType_formulary_download","eRxMessageType_pharmacy_download","eRxMessageType_prescriber_download","eRxSentSuccessfulStatusUid","eRxQueueForTransmissionStatusUid","eRxQueueForRxRefillAcceptUid","eRxControlledDrugStatusUid","eRxControlledDrugRequiresSignatureUid","eRxUserDefinedDrugStatusUid","eRxUnknownDrugClassStatusUid","eRxNoMailOrderBenefitUid","eRxFailedValidationStatusUid","eRxSentFailureStatusUid","eRxProcessingErrorStatusUid","eRxProviderMappingErrorStatusUid","eRxPatientMappingErrorStatusUid","eRxDownloadInProgressStatusUid","eRxNoMedicationHistoryToDownloadStatusUid","eRxDownloadCompletedWithErrorStatusUid","eRxDownloadCompletedSuccessfulStatusUid","eRxDownloadWaitForRXBenefitsResponsStatusUid","JobScheduler","JobScheduledReports","JobScheduledERxMonitor","JobERAMessageProcessor","JobApplyERARules","JobEligibility","JobTimeIntervalSeconds","JobTimeIntervalMinutes","JobTimeIntervalHourly","JobTimeIntervalDaily","JobTimeIntervalWeekly","JobTimeIntervalMonthly","JobTimeIntervalRunOnce","ListTimespanToday","ListTimespanLast2Weeks","ListTimespanLast30Days","ListTimespanCustomDates","ListTimespanCurrentWeek","ListTimespanCurrentMonth","ListTimespanCurrentQuarter","ListTimespanCurrentYear","ListTimespanLast2WeeksFromSunday","ListTimespanLast60Days","ListTimespanLast90Days","ListTimespanLast365Days","ClaimFormatElectronic837","ClaimFormatElectronic837I","UPINClaimFormatValueTypeUid","DEAClaimFormatValueTypeUid","NPIClaimFormatValueTypeUid","SPIClaimFormatValueTypeUid","CTPClaimFormatValueTypeUid","MedicalLicenseNumberClaimFormatValueTypeUid","StateLicenseNumberClaimFormatValueTypeUid","SSNClaimFormatValueTypeUid","MedicareProviderIDClaimFormatValueTypeUid","MedicaidProviderIDClaimFormatValueTypeUid","PriorAuthorizationClaimFormatValueTypeUid","FileIDClaimFormatValueTypeUid","PPONumberClaimFormatValueTypeUid","PayerIdentificationNumberClaimFormatValueTypeUid","RxHubParticipantIDClaimFormatValueTypeUid","SurescriptsStateLicenseNumberClaimFormatValueTypeUid","ProcedureClaimFormatValueTypeUid","ClaimFormatValueTypeTypeFilingTypeGroupIndividual","ClaimFormatValueTypeTypeClaimValueFormat","ClaimFormatValueTypeTypeCodeBasedClaimValueFormat","ClaimFormatValueTypeTypeProcedureOverrideFormatValue","ClaimFormatValueTypeTypeTypeOfBillOverrideFormatValue","MiscPracticeUid","MiscProviderUid","MiscServiceSiteUid","MiscFinancialCenterUid","MiscMedicalServicesProviderUid","MiscProcedureOwnerUid","AttachmentTypePatientIndication","AttachmentTypeScheduledReport","AttachmentTypeDeposit","AttachmentTypeGeneratedDocument","AttachmentTypeAdvancedDirective","AttachmentTypeExternalPatient","AttachmentTypeLabResults","AttachmentTypeAssessmentForms","AttachmentTypeScannedChart","AttachmentTypeDirectMail","AttachmentTypeCareManagement","AttachmentTypeStatement","FinancialCenterDataSecurityUid","BatchSecurityUid","BatchOwnerDataSecurityUid","BatchProcessTypeSecurityUid","ClaimClearingHousePracticeInsightUid","PharmacyClearinghouseMedAvantUid","PharmacyClearinghouseSureScriptsUid","PharmacyClearinghouseFaxUid","eRxWSSureScripts","eRxWSJobSendMessages","eRxWSJobPharmacyDirectoryDownloadNightly","eRxWSJobMonitor","eRxWSJobPharmacyDirectoryDownloadFull","eRxWSJobFormularyDirectoryDownload","eRxWSJobProcessFormularyDirectory","eRxWSJobePrescribingActivityReportUpload","eRxWSJobGenerateePrescribingActivityReport","eRxWSJobPRVBRD","eRxWSJobPrescriberDirectoryDownloadFull","eRxWSJobPrescriberDirectoryDownloadNightly","eRxWSJobProcess_FormularyAlternative","eRxWSJobProcess_FormularyCopay","eRxWSJobProcess_FormularyCoverage","eRxWSJob_Process_FormularyStatus","eRxWSMessageType_refill_request","eRxWSMessageType_pharmacy_update","eRxWSMessageType_provider_update","eRxWSMessageType_error_prvbrd","eRxWSMessageType_error_script","eRxWSMessageType_new_rx","eRxWSMessageType_pharmacy_list","eRxWSMessageType_provider_list","eRxWSMessageType_refill_response","eRxWSMessageType_Download_Pharmacy_File_Nightly","eRxWSMessageType_Download_Pharmacy_File_Full","eRxWSMessageType_Process_Pharmacy_File_Nightly","eRxWSMessageType_Process_Pharmacy_File_Full","eRxWSMessageType_formulary_file_list","eRxWSMessageType_ePrescribingActivityReport","eRxWSMessageType_Download_FormularyAlternative","eRxWSMessageType_Download_FormularyCopay","eRxWSMessageType_Download_FormularyCoverage","eRxWSMessageType_Download_FormularyStatus","MessageSecurityUid","ListFindTable_Users","ListFindTable_UserSetting","Security_GeneralNoteTypeNotes","ListReferralTrackingStatusInitiated","ListReferralTrackingStatusRelationship","ListInstantMessageStatusBusy","ListInstantMessageStatusHidden","Relationship_Self","Relationship_Employee","Relationship_Spouse","Relationship_Significant","Relationship_Mother","Relationship_Father","Relationship_Child","Relationship_Unknown","Relationship_OtherAdult","Relationship_GuardianUid","Relationship_CareGiverUid","PQRIGroupMedicare","PQRIOperatorOR","PQRIOperatorAND","PQRIOperatorNOTOR","PQRIOperatorNOTAND","PQRICodeTypeICD9","PQRICodeTypeEM","PQRICodeTypeCPT","PQRICodeTypeCPTII","PQRIMeasure125Adoption_e_Prescribing","PQRIMeasure124Adoption_EMR","PQRIMeasure114TobaccoUse","PQRIMeasure115QuitSmoking","PQRIMeasure116InappropriateAntibiotic","PQRIMeasure128BMI","PQRIMeasure130CurrentMedication","PQRIMeasure142Osteoarthritis","PQRINumerator_130_NotDocumented_NotEligible_G8430","PQRINumerator_130_Documented_NotVerified_G8428","PQRINumerator_130_NotDocumented_G8429","PQRINumerator_130_Documented_Verified_G8427","PQRINumerator_114_TobaccoUseNotAssessed_1000F_8P","PQRINumerator_115_Smokeless_G8456","PQRINumerator_115_NonSmoker_G8457","PQRINumerator_128_BMI_Normal_G8420","PQRINumerator_128_BMI_Overweight_G8417","PQRINumerator_128_BMI_Underweight_G8418","PQRINumerator_128_BMI_NotEligible_G8422","PQRINumerator_128_BMI_NotPerformed_G8421","PQRINumerator_128_BMI_OverUnderWeight_NoEducation_G8419","PQRINumerator_142_OST_AntiInflam_Assessed_1007F","PQRINumerator_142_OST_AntiInflam_NotAssessed_1007F_8P","PQRINumerator_ERX_Incentive_G8553","DesktopControl_Calendar","DesktopControl_Waitlist","DesktopControl_Message","DesktopControl_Note","AddInType_Acquisition_Attachment","AddInType_Acquisition_Vitals","AddInType_PatientDemographics","AddInType_FNC","AddInType_Schedule","AddInType_Messaging","AddInType_PatientToolstrip","AddInType_Desktop","AddInType_CreditCardReader","AddInType_FNC_Slider","AddInType_FNC_SPSO","AddInType_AppointmentTypeFilter","AddInType_SuperbillChargeProcessor","AddInType_Find","AddInType_Find_Background","AddInType_SaveProcessor","AddInType_ServerObjectProcessor","AddInType_BillingRule","AddInType_CombinedServices","AddInType_OrderObservation","Compression_Zip","EraStatus_Error","MessageUrgency_Abnormal","MessageUrgency_Urgent","MessageUrgency_LowPriority","MessageUrgency_Routine","ListCreditType_Transfer","ListCreditType_Transfer_Adjustment","ListCreditType_Remark","ListCreditType_ContractualInsuranceAdjustmentType","ListCreditType_InsuranceAdjustmentType","ListCreditType_CarrierTransferType","ListCreditType_PatientPaymentType","ListCreditType_InsPaymentType","ListCreditType_PatientTransferType","ListGenderFemale","ListGenderMale","ListGenderUnknown","ProviderCareTypePrimaryCare","ProviderCareTypeReferring","FtpProtocol_FTP","FtpProtocol_FTPSSL","FtpProtocol_SFTP","ProcedureCodeType_CPT","ProcedureCodeType_HCPCS","ProcedureCodeType_LAB","ProcedureCodeType_ProcedureSet","ProcedureCodeType_PQRI","ProcedureCodeType_CarePlan","ProcedureCodeType_RiskAssessment","ProcedureCodeType_Lab","ProcedureCodeType_Radiology","ProcedureCodeType_Referral","AddIn_CSSNDriverLicense","AddIn_CSSNInsuranceCard","AddIn_ICSDriverLicense","AddIn_ICSInsuranceCard","AddIn_ICS6DriverLicense","AddIn_ICS6InsuranceCard","AddIn_ExistingImage","AddIn_ConsentForm","AddIn_TopazSignature","AddIn_BillTimeRule","AddIn_FeeScheduleRule","AddIn_CombinedServices","AddIn_PDRNetwork","AddIn_ePASurescripts","AddIn_VitalBMI","AddIn_VitalBP","KDB_MFU","KDB_PATIENT_MFU","KDB_DASP","KDB_DESP","KDB_CPP","KDB_ADDIN","KDB_ALL","CONTEXTREPORTTYPE_PATIENT","CONTEXTREPORTTYPE_VISIT","CONTEXTREPORTTYPE_SUPERBILL","CONTEXTREPORTTYPE_APPOINTMENT","USERGROUPTYPE_CARETEAM","USERGROUPTYPE_AUTHORIZATION","USERGROUPTYPE_SECURITY","USERGROUP_CLINICALADMINISTRATORS","USERGROUP_FINANCIALADMINISTRATORS","USERGROUP_ADMINISTRATORS","USERGROUP_PHYSICIANS","USERGROUP_NURSES","USERGROUP_REGISTRATION","USERGROUP_PAYMENTPOSTERS","medicationUnitTablets","medicationUnitCapsules","medicationUnitDrops","medicationUnitUnits","medicationUnitMilliliters","medicationUnitGrams","medicationUnitTeaspoons","medicationUnitTablespoons","medicationUnitOz","medicationUnitMilligrams","medicationUnitMicrograms","medicationUnitSpray","medicationUnitPuffs","DiscontinueReason_DC","DiscontinueReason_Refilled","DiscontinueReason_Deleted","DiscontinueReason_Unspecified","DiscontinueReason_Reaction","DiscontinueReason_Revised","FINDTABLE_RELCCSYSTEMSYMPTOM","FINDTABLE_DIAGNOSIS","FINDTABLE_SO","FINDTABLE_SP","FINDTABLE_MEDICATION","FINDTABLE_PATIENT","FINDTABLE_GENERALNOTETYPE","FINDTABLE_LISTASSESSMENTFORM","FINDTABLE_LISTLABORATORY","FINDTABLE_FINDVITALSOBSERVATION","FINDTABLE_WAITINGKLISTDETAIL","PhoneType_Work","PhoneType_Fax","PhoneType_Home","PhoneType_Cell","PhoneType_Pager","PhoneType_Rx","PhoneType_Other","PhoneType_Night","PhoneType_Office","ReimbursementRuleUidForQuestABN","LaboratoryUidQuest","ClinicalNoteType_FNC","ClinicalNoteType_SBC","ClinicalNoteType_Order","ClinicalNoteType_General","ClinicalNoteControl_SP","VisitType_StrikeOut","VisitType_Private","VisitType_Refill","VisitType_Lab","VisitType_CancelRX","VisitType_RxChange","VisitDiagnosisType_Differential","VisitDiagnosisType_PreOp","VisitDiagnosisType_PostOp","VisitDiagnosisAxisType_One","VisitDiagnosisAxisType_Two","VisitDiagnosisAxisType_Three","PatientTrackingEvent_General","PatientTrackingEvent_Visit","sigQtyUomCapsule","sigQtyUomInhaler","sigQtyUomKit","sigQtyUomSuppository","sigQtyUomTablet","sigQtyUomGum","sigQtyUomPacket","sigQtyUomBottle","sigQtyUomCartridge","sigQtyUomUnit","sigQtyUomLozenge","sigQtyUomSyringe","sigQtyUomMilliliter","sigQtyUomTablespoon","sigQtyUomTeaspoon","sigQtyUomNotSpecified","DosingCalculatorUnitGPerKgPerDay","DosingCalculatorUnitMcgPerKgPerDay","DosingCalculatorUnitMgPerKgPerDay","DosingCalculatorUnitMlPerKgPerDay","TransactionType_Payment","TransactionType_Adjustment","TransactionType_CollectableAdjustment","TransactionType_Remark","TransactionType_Transfer","TransactionType_Charge","TransactionType_CarrierTransfer","CoverageType_Medical","CoverageType_Dental","CoverageType_BehavioralHealth","CoverageType_Uninsured","PatientBill","InsuranceBill","ClientBill","EM1995RulesExamination","CardiovascularExamination","ENTExamination","EyeExamination","GeneralMultiSystemExamination","GenitourinaryExamination","HematologicLymphaticImmunologicExamination","MusculoskeletalExamination","NeurologicalExamination","PsychiatricExamination","RespiratoryExamination","SkinExamination","EMHistoryPresentIllness","EMReviewOfSystems","EMHistory","EMPhysicalExam","EMComplexity","SystemBodyAreaAbdomen","SystemBodyAreaAllergicImmunologic","SystemBodyAreaBack","SystemBodyAreaCardiovascular","SystemBodyAreaChestBreasts","SystemBodyAreaConstitutionalGeneral","SystemBodyAreaEachExtremity","SystemBodyAreaEndocrine","SystemBodyAreaENMT","SystemBodyAreaExtremities","SystemBodyAreaEyes","SystemBodyAreaGastrointestinal","SystemBodyAreaGenitaliaGroinButtocks","SystemBodyAreaGenitourinary","SystemBodyAreaGUfemale","SystemBodyAreaGUmale","SystemBodyAreaHeadFace","SystemBodyAreaHematologicLymphatic","SystemBodyAreaIntegumentary","SystemBodyAreaMusculoskeletal","SystemBodyAreaNeck","SystemBodyAreaNeurological","SystemBodyAreaPsychiatric","SystemBodyAreaRespiratory","BulletExaminationGaitAndStation","BulletHeadNeckAssessmentMuscleStrength","BulletHeadNeckAssessmentRangeMotion","BulletHeadNeckAssessmentStability","BulletHeadNeckInspectionPercussionPalpation","BulletLLEAssessmentMuscleStrength","BulletLLEAssessmentRangeMotion","BulletLLEAssessmentStability","BulletLLEInspectionPercussionPalpation","BulletLUEAssessmentMuscleStrength","BulletLUEAssessmentRangeMotion","BulletLUEAssessmentStability","BulletLUEInspectionPercussionPalpation","BulletRLEAssessmentMuscleStrength","BulletRLEAssessmentRangeMotion","BulletRLEAssessmentStability","BulletRLEInspectionPercussionPalpation","BulletRUEAssessmentMuscleStrength","BulletRUEAssessmentRangeMotion","BulletRUEAssessmentStability","BulletRUEInspectionPercussionPalpation","BulletSpineRibsPelvisAssessmentMuscleStrength","BulletSpineRibsPelvisAssessmentRangeMotion","BulletSpineRibsPelvisAssessmentStability","BulletSpineRibsPelvisInspectionPercussionPalpation","BulletBilateralLowerExtremitiesAssessmentMuscleStrength","BulletBilateralLowerExtremitiesAssessmentRangeMotion","BulletBilateralLowerExtremitiesAssessmentStability","BulletBilateralLowerExtremitiesInspectionPercussionPalpation","BulletBilateralUpperExtremitiesAssessmentMuscleStrength","BulletBilateralUpperExtremitiesAssessmentRangeMotion","BulletBilateralUpperExtremitiesAssessmentStability","BulletBilateralUpperExtremitiesInspectionPercussionPalpation","BulletSkinInspectionEccrineandApocrineGlands","BulletSkinPalpationofScalpInspectionofHair","BulletSkinChestBreastsAxillaInspectionPalpation","BulletSkinGenitaliaGroinButtocksInspectionPalpation","BulletSkinBackInspectionpalpation","BulletSkinAbdomenInspectionPalpation","BulletSkinNeckInspectionPalpation","BulletSkinHeadFaceInspectionPalpation","BulletSkinRLEInspectionPalpation","BulletSkinRUEInspectionPalpation","BulletSkinLUEInspectionPalpation","BulletSkinLLEInspectionPalpation","BulletSkinBilateralLowerExtremitiesInspectionPalpation","BulletSkinBilateralUpperExtremitiesInspectionPalpation","AnswerGroupGestationalAge","GestationalAge24Weeks","GestationalAge25Weeks","GestationalAge26Weeks","GestationalAge27Weeks","GestationalAge28Weeks","GestationalAge29Weeks","GestationalAge30Weeks","GestationalAge31Weeks","GestationalAge32Weeks","GestationalAge33Weeks","GestationalAge34Weeks","GestationalAge35Weeks","GestationalAge36Weeks","GestationalAge37Weeks","GestationalAge38Weeks","GestationalAge39Weeks","HistoryStateActive","HistoryStateInactive","HistoryStateResolved","HistoryStateChronic","JobeRxPollMessageUID","JobeRxSendMessageUID","JobeRxProcessScriptUID","JobeRxProcessPharmacyUID","JobeRxSendRXHMessageUID","JobeRxSendELGMessageUID","JobeRxCreateRXHMessagesFromCalendarUID","JobeRxCreateELGMessagesFromCalendarUID","JobeRxProcessPRVBRDUpdateMessagesUID","JobeRxProcessX12ScriptUID","JobeRxProccessePrescribingActivityReportUID","JobScheduleeRxPollAllUID","JobScheduleeRxPollPrescriptionUID","JobScheduleeRxPollPharmacyUID","JobScheduleeRxPollPrescriberUID","JobScheduleeRxServiceCreateeMedHxMessagesUID","JobScheduleeRxServiceDownloadPrescriberOrganizationDirectoryUID","JobScheduleeRxServiceCreateRxBenefitsMessagesUID","JobScheduleeRxServiceDownloadPharmacyDirectoryUID","AuditTypeSecurity","AuditEventTypeFindControl","AuditEventTypeWorkflow","Control_Type_Blood_Pressure","Control_Type_Generic_Kilogram","Control_Type_Generic_Length","Control_Type_Generic_Observation","Control_Type_Head_Circumference","Control_Type_Heart_Rate","Control_Type_Height","Control_Type_Respiratory_Rate","Control_Type_SpO2","Control_Type_Temperature","Control_Type_Weight","Control_Type_Generic_Number","Control_Type_Generic_Date","Control_Type_Eyeglass_Prescription","ObservationItemSource","StandardCustomVitals","GAFObservation","DefaultOPSTemplate","DefaultVisitTemplate","DefaultRPNTemplate","DefaultRPNPrintAttachmentTemplate","AccessDeniedTemplate","AccessDeniedTemplatePatientChart","DefaultPatientWelcomeEmailTemplate","DefaultPortalMessageNotificationEmailTemplate","DefaultPortalWelcomeEmailTemplate","DefaultPortalChangePasswordEmailTemplate","DefaultPortalNewMessageFromPrmEmailTemplate","DefaultPortalResetPasswordFromPortalTemplate","DefaultPortalAccountResponsiblePartyStatementEmailTemplate","DefaultCheckoutTemplate","DefaultOPSPrintHeader","DefaultOPSPrintFilteredHeader","CompleteChartZippedAttachment","CompleteChartNotIncludedAttachment","DefaultClinicalSummaryTemplateUid","DefaultRPNPrintButton","DefaultOPSPrintButton","AllFileTypesToFiles","ChartAccessControlsSecurityUid","EmergencyChartAccessSecurityUid","ListVaccineAdmin_PediatricVaccineCard","ListVaccineAdmin_AdultVaccineCard","ListImmzCompletion_Refused","ListImmzCompletion_NotAdministered","ProductParameter_PatientPortalRouteMessagesByServiceSite","ProductParameter_PatientPortalUpdateDemographics","ProductParameter_PatientPortalUpdateDemographicsPhoto","ProductParameter_PatientPortalTagLine","ProductParameter_PatientPortalPracticeConsent","ProductParameter_PatientPortalChartConsent","ProductParameter_PatientPortalURL","ProductParameter_PatientPortal_ViewClinicalSummary","ProductParameter_PatientPortal_ViewCompleteChart","ProductParameter_PatientPortal_ViewImmunizations","ProductParameter_PatientPortal_ViewEducationalMaterial","ProductParameter_PatientPortal_UpdateInsurance","ProductParameter_PatientPortal_MakeAPayment","ProductParameter_PatientPortal_UpdateDemographics","ProductParameter_Practice_Email","ProductParameter_Practice_Website","ProductParameter_Practice_From_Email","ProductParameter_AutoAddOnSetToDX","ProductParameter_DocumentLinkingWarningNumber","ProductParameter_PatientPortalSecurityQuestions","ProductParameter_PatientPortalContentAttributes","ProductParameter_PatientPortalMessageSubHeading","ProductParameter_PatientPortalPracticeName","ProductParameterDPNActionPrint","ProductParameterDPNActionGenerateCCD","ProductParameterDPNActionSendDocument","ProductParameterDPNActionCreateReferral","ProductParameter_ApexAffinity","ProductParameterFacilityAccountEditingEnabled","ProductParameterDirectMailUserAccountCreationWarning","ProductParameterDirectMailUserAccountDeletionWarning","ProductParameterDirectMailNitorOneFacilityPerDomain","ProductParameterDirectMailNitorFacilityInactivePollSeconds","ProductParameterDirectMailNitorFacilityActivePollSeconds","ProductParameterDiagnosisOneUrl","ProductParameterDiagnosisOnePassword","ProductParameterDiagnosisOneUserName","ProductParameterDiagnosisOneRuleSet","ProductParameterDiagnosisOneSaveToFileEnabled","ProductParameterDiagnosisOneMaxBatchSize","ProductParameterDiagnosisOneOAuthPath","ProductParameterDiagnosisOneBaseINROrderUrl","ProductParameterDiagnosisOneBaseINRReportUrl","ProductParameterDiagnosisOneEnterpriseID","ProductParameterDiagnosisOneINROrderUsername","ProductParameterDiagnosisOneINROrderPassword","ProductParameterDiagnosisOneTokenGeneratorUsername","ProductParameterDiagnosisOneTokenGeneratorPassword","ProductParameterDefualtCCM_CPOTime","ProductParameterValidePAPayors","ProductParameterTransmissionSettingsCreateNewMailbox","ProductParameterAprimaNowLockoutTimeout","ProductParameterFoxitLicenseSN","ProductParameterFoxitLicenseKey","ProductParameterFoxitDefaultTool","ProductParameterFoxitDefaultViewMode","ResultStatus_Approved","ResultStatus_Resulted","ResultStatus_Received","ResultStatus_Reviewed","ResultStatus_Collected","ResultStatus_Performed","ResultStatus_Cancelled","ResultStatus_Pending","ResultStatus_Ordered","ResultStatus_PendingResulted","UserSetting_Default","UserSetting_ICS","UserSetting_Midmark","ServiceSiteType_Home","RelationalOperator_IsNull","RelationalOperator_IsNotNull","RelationalOperator_InList","RelationalOperator_NotInList","RelationalOperator_GreaterThan","RelationalOperator_GreaterThanOrEqual","RelationalOperator_NotLike","RelationalOperator_NotEqualTo","RelationalOperator_LessThan","RelationalOperator_LessThanOrEqualTo","RelationalOperator_EqualTo","RelationalOperator_Like","UserDefinedControl_Find","UserDefinedControl_TextRange","UserDefinedControl_DateRange","UserDefinedControl_NumericRange","UserDefinedControl_Timespan","CPOExternalType","ChronicCareManagementType","CarePlanOversightType","HMRules_OperandUid_LessThan","HMRules_OperandUid_GreaterThan","HMRules_ConjUid_AND","HMRules_ConjUid_OR","Scrub_Superbills","Scrub_Claims","TimeFrame_Clear","TimeFrame_Default","TimeFrame_FreeText","TimeFrame_Calendar","TimeFrame_Birth","TimeFrame_Childhood","TimeFrame_Teenage","ProblemStatus_Active","ProblemStatus_Resolved","ProblemStatus_Inactive","ProblemHistoryCategory","ListEthnicity_Hispanic","ListEthnicity_Hispanic_Or_Latino","ProblemDiagnosisSortName","ProblemDiagnosisSortOnset","ProblemDiagnosisSortResolved","ProblemDiagnosisSortProblemStatus","ProblemDiagnosisSortProblemDuration","ProblemDiagnosisSortRecordDate","ProblemDiagnosisDurationSortUnknown","ProblemDiagnosisDurationSortAcute","ProblemDiagnosisDurationSortChronic","ProblemDiagnosisNameSortLevel","ProblemDiagnosisOnsetSortLevel","ProblemDiagnosisResolvedSortLevel","ProblemDiagnosisProblemStatusSortLevel","ProblemDiagnosisProblemDurationSortLevel","ProblemDiagnosisRecordDateSortLevel","ProblemDiagnosisStatusInactive","ProblemDiagnosisStatusActive","ProblemDiagnosisStatusChronic","ProblemDiagnosisStatusResolved","ProblemDiagnosisStatusDeleted","CollectionStatusGlobal","ListDisclosureReasonReleasedToPatient","ListDisclosureReasonCompleteChartSummary","ListDisclosureReasonReferral","ListDisclosureReasonReleasedByPatient","ListCustomNotePrintCompleteChart","FaxServer_Interfax","FaxServer_Fax2Mail","FaxServer_GFIFaxMaker","FaxServer_Biscomfax","FaxServer_RightFax","FaxServer_FaXit","FaxServer_Kno2","DocumentLinkingGeneralFolder","DocumentLinkingIgnoreFolder","DocumentLinkingRejectedFolder","DocumentLinkingDirectMailFolder","DocumentLinkingFaXitFolder","MapSource_ClaimsMapping","MapSource_BeaconCarrierMapping","MapSource_FromSurescriptsPhoneType","MapSource_ToSurescriptsPhoneType","UIControlType_ChargeTicket","UIControlType_DataInput","UIControlType_ClinicalNoteTab","UIControlType_ClinicalNoteSlider","UIControlType_ClinicalAssessmentForm","UIControl_ChargeTicket_Designer","UIControl_ChargeTicket_Standard","UIControl_DataEntry_Designer","UIControl_Note_DesignerInput","UIControl_Note_DesignerCaseInput","UIControl_Note_Plan","UIControl_Note_CC","UIControl_Note_SO","UIControl_Note_HPI","UIControl_Note_PE","UIControl_Note_VisitText","UIControl_Note_AssessmentForms","UIControl_Note_Vitals","UIControl_Note_ROS","UIControl_Note_Confidential","UIControl_Note_Results","UIControl_Note_CCHPI","UIControl_Note_RX","UIControl_Note_ROSPE","UIControl_Note_DX","UIControl_Note_DXDSM","UIControl_Note_GeneralNote","UIControl_Note_SP","UIControl_Note_HX","PrimaryInsType_IsPrimary","CHCSystemDefault","DefaultOrderingProvider","LanguageEnglish","LanguageSpanish","ListClaimBatchStatus_InProgress","ListClaimBatchStatus_ReadyToSend","ListClaimBatchStatus_Sent","ListClaimBatchStatus_Failed","DeclinedToSpecify","CallPointePerson","NotificationMethodEmail","NotificationMethodMail","NotificationMethodPhone","NotificationMethodText","NotificationMethodUnknown","RecallTypeClinicalDecisionSupport","RecallTypePatientsByCondition","ListRuleMeasure_HEDIS","ListRuleMeasure_MUII_QRDA_Aggregate","ListRuleMeasure_MUII_QRDA_Aggregate_2014","ListRuleMeasure_PQRS","ListEligibilityStatusCannotProcess","ListIntegrationPartnerSurescriptseRxServiceUid","ListIntegrationPartnerSurescriptsDirectMessageUid","ListIntegrationPartnerSurescriptsRLEUid","ListIntegrationPartnerNitorDirectMessageWithCertificateUid","ListIntegrationPartnereTacticsUid","ListIntegrationPartnerCommonWellUid","ListIntegrationPartnerCircleLinkUid","ListIntegrationPartnerPersiviaUid","TransmissionConfigurationSurescriptsDirectMessageUid","TransmissionConfigurationeRxOrganizationDirectoryUid","TransmissionConfigurationeRxProviderDirectoryUid","TransmissionConfigurationSurescriptsDirectMessageInboundUid","ClinicalDelgateSecurityCanCreateOrder","ClinicalDelgateSecurityCanCanCreatePrescription","ClinicalDelgateSecurityCanSendDirectMail","ClinicalDelgateSecurityCanCompleteNote","ListRuleMeasureCcdaCcdDocumentTypeUid","ListRuleMeasureC32CcdDocumentTypeUid","ListRuleMeasureCcrDocumentTypeUid","ListRuleMeasureCqmDocumentTypeUid","ProcedureNegationReasonUid","ImmzRefusalOtherUid","ImmzRefusalParentalDecisionUid","ImmzRefusalPatientDecisionUid","CdaSectionC32","CdaSectionCcda","ABNNotRequiredUid","ABNRequiredUid","ABNCompletedUid","FormTitleGeneric","FormTitleFNC","FormTitleDemographics","PatientStatus_TestPatient","PatientStatus_Transfer","PatientStatus_Deceased","PatientStatus_Consult","PatientStatus_Relocated","PatientStatus_Inactive","HMRULEPatientDeclineUid","HMRULENoInsuranceUid","HMRULENotNecessaryUid","NegationReasonProcRefusedUid","NegationReasonUninsuredUid","NegationReasonProcNotIndicatedUid","AdultAgeGroupUid","PediatricAgeGroupUid","MedicalServicesProviderTypeHospice","MedicalServicesProviderTypeInHome","AddressType_Home","AddressType_Homeless","AddressType_BirthPlace","PatientPortalMessageRoutingDefaultMessageSubTypeUid","PatientPortalMessageRoutingDefaultServiceSiteUid","PatientPortalMessageRoutingDefaultProviderUid","PatientPortalDefaultMessageRoutingUid","CCDABatchProcessTypeUid","CQMBatchProcessTypeUid","ClaimsBatchProcessTypeUid","RemittanceBatchProcessTypeUid","StatementsBatchProcessTypeUid","CreditCardConsentsBatchProcessTypeUid","BPatientChartsatchProcessTypeUid","CancerRegistryBatchProcessTypeUid","DpnGroupGenericNos","DpnNodePlanRecall","DpnNodePlanPatientInstructions","DpnNodePlanPlanNotes","DpnNodePlanInternalNotes","Default_ListUIConfigurationUid","NOS_ListDxTileConfigurationUid","FndHardBreakUid","FndActiveProblemsTileUid","FndMedicationTileUid","FndPatientStoryTileUid","FndVisitActionItemTileUid","FndRecentVisitsTileUid","FndActivitySinceLastVisitTileUid","FndVisitInformationTileUid","FndClinicalDecisionSupportTileUid","FndCCHPITileUid","FndROSTileUid","FndPhysicalExamTileUid","FndPlanTileUid","FndVitalsResultsTileUid","FndDiagnosisSpecificTileUid","FndEducationFormTileUid","FndNoteActionTileUid","FndVisitDiagnosisTileUid","FndAttachmentsTileUid","FndServicesOrderedTileUid","FndServicesPerformedTileUid","FndAllergiesTileUid","FndAppointmentHistoryTileUid","FndHistoryTileUid","FndPatientCarePlanTileUid","FndAssessmentTileUid","FndFhirClientsTileUid","MacroGroupSystemUid","MacroGroupCommonUid","HdUnsentPrescriptionsTileUid","HdPatientAllergiesTileUid","HdPatientMedicationsTileUid","HdPatientActiveProblemsTileUid","HdPatientVitalsTileUid","HdPatientInfoVisitsTileUid","HdRecentVisitsTileUid","HdReplicationMonitorTileUid","HdWaitingListTileUid","HdDocumentLinkingTileUid","HdMessageCountsTileUid","HdMessagesTileUid","HdAppointmentQueueTileUid","HdExternalPatientsTileUid","HdVisitNotesTileUid","HdPromotingInteroperabilityTileUid","HdProviderEMTileUid","HdFhirClientsTileUid","RxWorkflowPendingEpaUid","RxWorkflowPendingSpeUid","RxWorkflowPendingFormularyUid","HomepageDefaultConfiguration","HomepageClinicalConfiguration","HomepageAdministratorConfiguration","hdAppointmentQueueSortOptionAppointmentTimeUid","EmsCategoryHomepageQuickStartGuide","EmsCategoryAprimaToday","EmsCategoryTutorial","HomepageConfigurationFindControl","FndConfigurationFindControl","ListFindControlBehaviorFindControl","UserSettingAngularHomepageUid","UserSettingPrintSetUid","UserSettingArBatchUid","AngularHomepagePatientCenterMenuItemUid","AngularHomepagePatientProviderTrackingMenuItemUid","AngularHomepagePatientRecallsMenuItemUid","AngularHomepageCareManagementReviewMenuItemUid","AngularHomepageSchedulerMenuItemUid","AngularHomepageMassAppointmentsUpdateMenuItemUid","AngularHomepageExternalPatientsMenuItemUid","AngularHomepageNewMessageParentMenuItemUid","AngularHomepageMessageCenterMenuItemUid","AngularHomepageInstantMessageMenuItemUid","AngularHomepageListEditorMenuItemUid","AngularHomepageConfigureQuickSearchMenuItemUid","AngularHomepagePracticeSettingsMenuItemUid","AngularHomepagePatientPortalSettingsMenuItemUid","AngularHomepageFacilityPortalSettingsMenuItemUid","AngularHomepageConfigurePatientConnectMenuItemUid","AngularHomepageConfigureSignaturePadMenuItemUid","AngularHomepageConfigureRequiredFieldsMenuItemUid","AngularHomepageModifyCurrentUserMenuItemUid","AngularHomepageModifyCurrentSettingsMenuItemUid","AngularHomepageResetMyConfigurationMenuItemUid","AngularHomepageConfigureMyPrintSetMenuItemUid","AngularHomepageHomeConfigurationMenuItemUid","AngularHomepageFndConfigurationMenuItemUid","AngularHomepageConfigureFndDstMenuItemUid","AngularHomepageReviewPriorAuthMenuItemUid","AngularHomepageTrackRxMenuItemUid","AngularHomepageReferralTrackingMenuItemUid","AngularHomepageTrackOutstandingOrdersMenuItemUid","AngularHomepageTrackResultsMenuItemUid","AngularHomepageInterfaceDataDetailMenuItemUid","AngularHomepageTrackEMedHxMenuItemUid","AngularHomepageTrackRxBenefitsMenuItemUid","AngularHomepageTrackFaxMenuItemUid","AngularHomepageTrackVoiceTranscriptionsMenuItemUid","AngularHomepageTrackingVisitCenterMenuItemUid","AngularHomepageFinancialBatchMenuItemUid","AngularHomepageTrackSuperbillsMenuItemUid","AngularHomepageTrackSBProceduresMenuItemUid","AngularHomepageTrackVisitWithoutSBMenuItemUid","AngularHomepageTrackAppointmentWithoutSBMenuItemUid","AngularHomepageTrackFinancialsMenuItemUid","AngularHomepageProcessClaimsMenuItemUid","AngularHomepageSuperbillReportsMenuItemUid","AngularHomepageFilingHistoryMenuItemUid","AngularHomepageAlignHcfaMenuItemUid","AngularHomepageCopayLogMenuItemUid","AngularHomepageTrackPaymentsMenuItemUid","AngularHomepageTrackPayerCreditsMenuItemUid","AngularHomepageTrackTransactionsMenuItemUid","AngularHomepageEdiResponsesMenuItemUid","AngularHomepageCreditCardSettlementsMenuItemUid","AngularHomepageCreditCardTransactionsMenuItemUid","AngularHomepageCreditCardPaymentsMenuItemUid","AngularHomepageBatchCreditCardConsentProcessingMenuItemUid","AngularHomepageResponsiblePartyCollectionsMenuItemUid","AngularHomepageAccountReceivableInsurancePromisesMenuItemUid","AngularHomepagePrintCollectionLettersMenuItemUid","AngularHomepageAccountReceivableStatementMenuItemUid","AngularHomepageBillingUpdateClosingDateMenuItemUid","AngularHomepageInsurancePayerPlanCenterMenuItemUid","AngularHomepageDocumentManagementMenuItemUid","AngularHomepageDocumentImportingMenuItemUid","AngularHomepageDocumentLinkingV1MenuItemUid","AngularHomepageDocumentLinkingV2MenuItemUid","AngularHomepageDicomImageViewerMenuItemUid","AngularHomepageDocumentBatchProcessingMenuItemUid","AngularHomepageBulkPatientImportMenuItemUid","AngularHomepageReportsMenuItemUid","AngularHomepageDocBatchMgmtCqmMenuItemUid","AngularHomepageAuditTrailMenuItemUid","AngularHomepageJobHistoryMenuItemUid","AngularHomepageReplicationClientMenuItemUid","AngularHomepageUnlockPatientMenuItemUid","AngularHomepageReloadLicenseMenuItemUid","AngularHomepageReloadUserMenuItemUid","AngularHomepageQuickStartGuideMenuItemUid","AngularHomepageHelpContentsMenuItemUid","AngularHomepageReleaseNotesMenuItemUid","AngularHomepageHelpFaqMenuItemUid","AngularHomepageHelpSupportMenuItemUid","AngularHomepageHelpCgmPortalMenuItemUid","AngularHomepageHelpEngageMenuItemUid","AngularHomepageHelpDocumentationMenuItemUid","AngularHomepageHelpAboutMenuItemUid","AngularHomepageFindPatientMenuItemUid","AngularHomepageFindPatientAndOpenOpsMenuItemUid","AngularHomepageFindPatientAndOpenRpnMenuItemUid","AngularHomepageExternalSiteParentMenuItemUid","AngularHomepageDisplaySettingMenuItemUid","AngularHomePageSetLocalLogin","ajsFactoryName","Guid","_coerceToGuidStr","guidPattern","replaceRegex","replacer","validRegex","ApDocumentType","ApDocumentBase","dataIsObjectUrl","documentType","extension","pageCount","trustedData","isImage","isText","isHtml","isPdf","isCCD","isAudio","image","pdf","CCD","audio","isSupported","unknown","ApAudioDocument","dataUrl","ApHtmlDocument","ApImageDocument","ApPdfDocument","ApTextDocument","FoxitLicenseDtoToken","ServerFeature","NgZoneService","wrapToRun","innerArgs","wrapToRunOutsideNg","contextRun","runInZoneIfNecessary","wrapToRunInZoneIfNecessary","enterZoneObj","eq","_assocIndexOf","assocIndexOf","ListCache","listCacheClear","__data__","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","_freeGlobal","freeSelf","freeGlobal","_Symbol","objectProto","nativeObjectToString","symToStringTag","baseGetTag","getRawTag","isOwn","tag","unmasked","objectToString","lodash_es_isObject","_coreJsData","maskSrcKey","uid","coreJsData","funcToString","toSource","reIsHostCtor","reIsNative","baseIsNative","isMasked","_getNative","_Map","_nativeCreate","Hash","hashClear","nativeCreate","hashDelete","hashGet","hashHas","hashSet","_getMapData","getMapData","isKeyable","MapCache","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","Stack","stackClear","stackDelete","stackGet","stackHas","stackSet","LARGE_ARRAY_SIZE","_baseAssignValue","baseAssignValue","configurable","enumerable","assignValue","objValue","_copyObject","copyObject","customizer","isNew","lodash_es_isObjectLike","isObjectLike","baseIsArguments","propertyIsEnumerable","isArguments","lodash_es_isArray","freeExports","freeModule","Buffer","isBuffer","stubFalse","reIsUint","isIndex","isLength","typedArrayTags","_baseUnary","baseUnary","freeProcess","binding","nodeIsTypedArray","nodeUtil","baseIsTypedArray","arrayLikeKeys","isArr","isArg","isBuff","isTypedArray","skipIndexes","baseTimes","iteratee","isPrototype","Ctor","_overArg","overArg","_nativeKeys","lodash_es_isArrayLike","lodash_es_keys","baseKeys","nativeKeys","baseKeysIn","nativeKeysIn","isProto","lodash_es_keysIn","keysIn","allocUnsafe","lodash_es_stubArray","stubArray","nativeGetSymbols","getOwnPropertySymbols","getSymbols","arrayFilter","resIndex","_arrayPush","arrayPush","_getPrototype","getSymbolsIn","getPrototype","_baseGetAllKeys","baseGetAllKeys","keysFunc","symbolsFunc","_getAllKeys","getAllKeys","_getAllKeysIn","getAllKeysIn","_DataView","_Promise","_Set","_WeakMap","mapTag","promiseTag","setTag","weakMapTag","dataViewTag","dataViewCtorString","DataView","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","WeakMap","getTag","ctorString","_Uint8Array","_cloneArrayBuffer","cloneArrayBuffer","arrayBuffer","byteLength","Uint8Array","reFlags","symbolProto","symbolValueOf","initCloneByTag","isDeep","cloneDataView","dataView","byteOffset","cloneTypedArray","typedArray","cloneRegExp","cloneSymbol","objectCreate","baseCreate","nodeIsMap","baseIsMap","nodeIsSet","baseIsSet","argsTag","funcTag","objectTag","cloneableTags","baseClone","bitmask","isFlat","isFull","initCloneArray","copyArray","isFunc","cloneBuffer","initCloneObject","copySymbolsIn","baseAssignIn","copySymbols","baseAssign","stacked","isSet","subValue","arrayEach","cloneDeep","CLONE_DEEP_FLAG","nativeFloor","baseRepeat","_arrayMap","arrayMap","isSymbol","symbolToString","baseToString","_castSlice","castSlice","baseSlice","reHasUnicode","hasUnicode","_baseProperty","baseProperty","_asciiSize","rsAstralRange","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsModifier","rsOptVar","rsSeq","rsSymbol","reUnicode","_stringSize","stringSize","unicodeSize","asciiSize","_stringToArray","stringToArray","unicodeToArray","asciiToArray","nativeCeil","createPadding","charsLength","reWhitespace","reTrimStart","baseTrim","trimmedEndIndex","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toFinite","isBinary","lodash_es_toString","pad","strLength","toInteger","remainder","mid","baseFor","createBaseFor","fromRight","_baseForOwn","baseForOwn","SetCache","setCacheAdd","setCacheHas","_arraySome","arraySome","_cacheHas","cacheHas","equalArrays","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","arrValue","othValue","compared","othIndex","_mapToArray","mapToArray","_setToArray","setToArray","arrayTag","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalByTag","convert","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects","objProps","objLength","objStacked","skipCtor","objCtor","othCtor","_baseIsEqual","baseIsEqual","_isStrictComparable","isStrictComparable","_matchesStrictComparable","matchesStrictComparable","srcValue","_baseMatches","baseMatches","matchData","getMatchData","baseIsMatch","noCustomizer","COMPARE_PARTIAL_FLAG","reIsDeepProp","reIsPlainProp","isKey","FUNC_ERROR_TEXT","memoize","resolver","memoized","Cache","rePropName","reEscapeChar","stringToPath","memoizeCapped","quote","subString","_castPath","castPath","toKey","_baseGet","baseGet","_baseHasIn","baseHasIn","_hasPath","hasPath","hasFunc","baseMatchesProperty","hasIn","lodash_es_identity","lodash_es_property","basePropertyDeep","_baseIteratee","baseIteratee","lodash_es_mapValues","mapValues","_apply","nativeMax","lodash_es_constant","baseSetToString","HOT_COUNT","HOT_SPAN","nativeNow","setToString","shortOut","lastCalled","stamp","remaining","_baseRest","baseRest","overRest","otherArgs","_isIterateeCall","isIterateeCall","createAssigner","assigner","guard","propsIndex","_baseIsNaN","baseIsNaN","_arrayIncludes","arrayIncludes","baseIndexOf","strictIndexOf","baseFindIndex","_arrayIncludesWith","arrayIncludesWith","comparator","nativeMin","_castArrayLikeObject","castArrayLikeObject","isArrayLikeObject","intersection","arrays","mapped","baseIntersection","caches","outer","computed","bubbleUp","heap","weightFunc","parentN","bubbleDown","nodeWeight","child2N","child1N","swap","BinaryHeap","compareFunc","front","removed","defaults$1","MAX_VALUE","utils","assignMsg","defineProperties","accessed","$$cacheFlushInterval","$$capacity","$$deleteOnExpire","$$enabled","$$maxAge","$$onExpire","$$recycleFreq","$$storageMode","$$storagePrefix","$$storeOnReject","$$storeOnResolve","$$initializing","$$cacheFlushIntervalId","$$recycleFreqId","removeAll","$$storage","removeItem","$$prefix","$$data","$$lruHeap","$$expiresHeap","$$parent","_this2","onExpire","$$promises","itemJson","getItem","expires","setItem","capacity","maxAge","deleteOnExpire","cacheFlushInterval","recycleFreq","storageMode","keysJson","_this3","storeOnResolve","storeOnReject","getHandler","shouldStore","isError","peek","storage","_this5","expired","expiredItem","_this7","setRecycleFreq","_this8","removeExpired","storagePrefix","setDeleteOnExpire","setMaxAge","setCapacity","setCacheFlushInterval","setOnExpire","storageImpl","setStorageMode","_this9","shouldReInsert","prevStorage","prevData","_this10","prevDataIsObject","localStorage","sessionStorage","_this11","_this12","CacheFactory","cacheId","ReferenceError","_this6","TranslateHttpLoader","http","APRIMA_HTTP_CONTEXT_CACHE_INSTANCE","HttpContextToken","webcommonHttpInterceptorProviders","CacheInterceptor","cacheInstance","cachedValue","cacheInfo","debug","httpLogPrefix","AppRouteService","AppRouteServiceFactory","BridgeService","bridge","loadConfiguration","validateConfiguration","hasConfiguration","fireEvent","callbackFn","once","AprimaAnalyticsService","sendEvent","sendPageView","sendException","startTiming","startTime","endTime","stopTiming","timingValue","moment","ObjUtilService","defineReadonlyProps","propertiesObj","defineStaticProps","AprimaCacheService","objUtilService","cacheFactory","disableAllCaches","initialize","additionalCaches","cacheSettings","Lists","description","Permissions","ImoTerms","ImoDetails","settings","cacheName","createNew","createNewClean","createNewOverride","destroyAll","disableAll","enableAll","enabledAll","getOrCreate","getOrCreateClean","getOrCreateOverride","removeExpiredFromAll","touchAll","createCache","infoFn","infoFnResult","getClone","getFnResult","addHttpModes","httpSubset","getWithHttpLogging","wrap","httpIgnoreSubset","getIgnoreCacheWithHttpLogging","httpMode","httpIgnoreMode","methodName","BrowserService","navigatorObj","getNavigator","windowObj","isIphone","MSStream","isIpad","isIosOS","isAndroidOS","isAndroidPhone","isPhone","isTablet","isMobileDevice","base64ToBlob","base64String","contentType","byteCharacters","atob","byteArrayBuffer","byteArrayInt","downloadDocumentToFile","fileNameToSaveAs","blob","saveBlob","tryDownloadDocumentToFile","supportsDownloadToFile","getDefaultSpinnerName","getLocation","isBlobCompatible","blobObj","fileName","downloadLink","download","objectUrl","createObjectURL","onclick","display","click","shouldAlwaysIgnoreCache","supportsInlinePdf","ConfigurationRepository","appConfiguration","API_KEY","CLIENT_FEATURES","CLIENT_VERSION","DEV_HOSTED","EXPERIMENTAL_FEATURES","GATEWAYS","GIT_COMMIT_HASH","MIN_PRM_DASHBOARD_VERSION","SERVER_API_VERSION","throwInvalidKeyError","StorageInMemoryRepository","getItemOrThrow","StoragePerSessionRepository","storageInMemoryRepository","browserService","supported","isSessionStorageSupported","StorageAcrossSessionRepository","storagePerSessionRepository","isLocalStorageSupported","trueRegex","falseRegex","WebCommonStorageRepository","storageAcrossSessionRepository","setOrRemove","setOrRemoveObj","setObj","getOrThrow","getObj","getObjOrDefault","overwritePropertiesAndSave","destinationGetter","storageKey","defaultPropertiesAndSave","getUserIdOrThrow","getUserId","removeUserId","setUserId","userId","getIsActiveDirectoryUser","setIsActiveDirectoryUser","isActiveDirectoryUser","getPatientPortalActivePatient","getDeviceId","setDeviceId","deviceId","getUserFullName","setUserFullName","fullName","getClientId","setClientId","clientId","formatClientUrl","clientUrl","getClientUrl","setClientUrl","formattedClientUrl","getJsonWebToken","removeJsonWebToken","setJsonWebToken","jwt","setProviderSettings","providerSettings","getProviderSettings","getPrmAssemblyVersion","setPrmAssemblyVersion","assemblyVersion","getPrmDatabaseVersion","setPrmDatabaseVersion","databaseVersion","getPrmDatabaseBuild","setPrmDatabaseBuild","databaseBuild","getMobileAssemblyVersion","setMobileAssemblyVersion","getSupportedFeatures","setSupportedFeatures","supportedFeatures","getDatabaseName","setDatabaseName","databaseName","getUserName","setUserName","userName","setSiteSettings","siteSettings","getSiteSettings","getUserPermissions","setUserPermissions","permissions","mappedPermissions","mapPermissions","permissionObj","getDashboardTileSettings","setDashboardTileSettings","setDefaultDashboardTileSettings","getAppointmentsListSettings","setAppointmentsListSettings","setDefaultAppointmentsListSettings","getMessagesListSettings","setMessagesListSettings","setDefaultMessagesListSettings","messageFilterId","getAppointmentsBadgeSettings","setAppointmentsBadgeSettings","setDefaultAppointmentsBadgeSettings","getPhoneMessageGeneralNoteTypeId","setPhoneMessageGeneralNoteTypeId","getTaskMessageGeneralNoteTypeId","setTaskMessageGeneralNoteTypeId","getPharmacyGeneralNoteTypeId","setPharmacyGeneralNoteTypeId","getPortalMessageGeneralNoteTypeId","setPortalMessageGeneralNoteTypeId","getRxRefillMessageGeneralNoteTypeId","setRxRefillMessageGeneralNoteTypeId","getPharmacyRefillMessageGeneralNoteTypeId","setPharmacyRefillMessageGeneralNoteTypeId","getMedicationOverrideGeneralNoteTypeId","setMedicationOverrideGeneralNoteTypeId","getPatientVitalsDefaultSettingId","setPatientVitalsDefaultSettingId","getIsCacheUser","DesktopSettings","IsCacheUser","getIsCacheClient","setIsCacheClient","isCacheClient","AprimaHttpClientService","configurationRepository","httpClient","webCommonStorageRepository","getFullUrl","endpointBase","endpointUrl","urlComponents","buildRequestParams","ApiKey","ignoreCache","sendGetRequest","requestParams","sendPostRequest","sendPutRequest","sendDeleteRequest","AprimaTranslateLoader","DeviceSettingsRepository","deviceSettings","loadBasedOnBrowser","browserConfig","isDevice","isBrowserOrOverride","isBrowserOverride","isDeviceOrOverride","isTabletOverride","isPhoneOrOverride","isPhoneOverride","isTabletOrOverride","isAndroid","isIos","isPrm","isStandaloneBrowser","hostedFromDesktop","LogInService","deviceSettingsRepository","redirectState","redirectParams","isCustomRedirect","setDefaultRedirect","setRedirect","customTransition","replaceCurrentState","getRedirect","appRoute","LogOffService","aprimaAnalyticsService","logoff","TransitionManagerService","transitionManager","goBack","getPreviousTransition","CurrentUserService","logInService","logOffService","transitionManagerService","forceLogoffUser","previousTransition","isAuthenticated","clientURL","ErrorServiceUpgrade","ErrorServiceFactory","ServerInfoRepository","isFeatureSupported","featuresToCheck","featureStrings","UrlParsingService","locationObj","getParameterByName","parsePortalUrl","markerIndex","restOfUrlIndex","hostUrl","restOfUrl","firstSlashIndex","clientConfig","WebViewManagerService","webViewManager","browserWebViewManager","hostedWebViewManager","activateView","scopeFunction","UnitConversionServiceAjsProvider","UnitConversionServiceUpgrade","UnitConversionServiceFactory","PrmHttpClientService","aprimaHttpClientService","AttachmentRepository","httpClientService","getAttachmentGroup","attachmentGroupId","getAttachment","attachmentId","requestConfig","retainPdfFormat","retainPdf","getAttachmentStaticUrl","setAttachmentContent","editAttachmentDto","getAttachmentContent","getPatientAdvancedDirective","patientId","getAttachmentHandler","documentId","getAttachmentContentRaw","FoxitLicenseRepository","getFoxitLicense","licenseSNId","licenseKeyId","defaultToolId","defaultViewModeId","PatientPortalHttpClientService","PatientPortalAttachmentRepository","getDocumentList","getAttachmentForViewing","httpParams","getAttachmentForDownload","ProviderRepository","getProviders","getProvidersInternal","GetCurrentProviderSigningSignature","getProviderCCMLicensing","ListRepository","getListJs","listName","getList","BillingRepository","getTelehealthBilling","appointmentId","redirectUrl","postApplyTelehealthPayment","LoginUserPatientId","getReceiptHtml","LoginAssistanceRepository","getLoginAssistanceInformation","TelehealthRepository","postTelehealthLogin","PatientIdentityRepository","getPersonIdentitySubject","personId","registerPersonIdentity","fromEventPattern","retValue","HostedBridgeService","getBridge","app","ngZoneHandler","WebBridgeService","FoxitModuleToken","foxitCssChunkName","RuntimeUtils","assetManifest$","Pragma","Expires","getFileUrlByChunk","chunkName","fileUrl","ApBaseComponent","MAX_HEIGHT","tempHeight","_LOADING","loading","setLoadingHeight","loadingChange","firstHeightSet","_HEIGHT","setMaxHeightWhenDone","getHeight","waitForLoadingHeightChange","delaySub","delayObs","skipWhile","ApBaseDirective","ViewportService","documentObj","getWidth","bodyElement","docElement","getWindowWidth","getWindowHeight","getScrollY","SpinnerService","applySpinner","specifiedSpinnerName","specifiedSize","spinnerConfiguration","getSpinner","spinnerName","spinnerHtml","startSpinner","override","spinner","spinners","createSvgElement","viewBox","g","animations","defaultRequestAnimationFrame","mozRequestAnimationFrame","fallbackRequestAnimationFrame","setSvgAttribute","ele","SHORTCUTS","subData","an","at","da","os","lc","rc","sw","android","rIndex","rotateCircle","svgEle","circleEle","easeInOutCubic","scaleX","translateX","dasharray","dashoffset","rotateLine","TRANSLATE32","STROKE_OPACITY","ROUND","INDEFINITE","DURATION","animationValues","strValues","SPIN_ANIMATION","IOS_SPINNER","y1","y2","cx","cy","ios","bubbles","cos","PI","sin","circles","crescent","dots","lines","x1","x2","circle","keyTimes","keySplines","calcMode","spiral","defs","linearGradient","gradientUnits","stroke","StyleService","addStyleToDom","replaceCurrent","fullId","addStyleUrlToDom","stylesheetUrl","_stylesheetUrl","onload","onerror","rel","ApSpinnerDirective","spinnerService","icon","ApActiveModal","_dismiss","_close","closedOrDismissed","readyToHide","emitAndClose","tryHide","dismiss","markReadyToHide","ApModalHelper","activeModal","hideHandler","isShownPreviousVal","thisLoader","hasContainerComponent","containerComponent","doCheck","onInit","ApModalHelperFactory","elementInjector","ApBaseModalComponent","modalHelper","closeModal","dismissModal","ApModalReason","apModalClosed","isSuccess","Closed","resultValue","apModalCancelled","ApComplexModal","apClose","modalResult","apCloseWithPromise","modalResultPromise","apUserCancel","UserCancel","Unknown","ApModalComponentOptions","ApModalService","showComponentModal","ScopeProvider","completeConfig","messagePrefix","showComponentModal$","provideClasses","ApZoomableDirective","initScale","initialXCoordinate","initialYCoordinate","minOffsetX","maxOffsetX","minOffsetY","maxOffsetY","scale","resetSrc","resetElement","zoomState","touchHandlerDummy","onPinch","currentState","requestElementUpdate","onRelease","snapToContainer","onDoubleTap","onDrag","targetY","deltaX","updateElementTransform","fullTransform","ApPdfComponent","IosDocumentHelper","openUrlInSeparateTab","url$","openInSeparateTab","supportsOpenInSeparateTab","WebDocumentHelper","newWindow","write","DefaultDocumentHelper","DocumentHelperBase","iosDocumentHelper","webDocumentHelper","defaultDocumentHelper","innerHelper","ImageFormats","HtmlFormats","TextFormats","PdfFormats","CCDFormats","AudioFormats","pdfMimeType","htmlDownloadContentType","audioContentType","DocumentService","base64Data","domSanitizer","serverInfoRepository","documentHelper","hasStaticUrl","tryDownloadToFile","defaultFileName","downloadToFile","Extension","Data","FileName","mapFromAttachment","imageDataUrl","getImageDataUrl","PageCount","htmlData","getHtmlData","textData","pdfData","getPdfData","ccdData","audioData","getAudioData","audioDoc","disposeDocument","revokeObjectURL","FoxitPdfRenderer","attachmentRepository","providerRepository","foxitModule","foxitSetup","pageIndex","providerSignatureWidth","providerSignatureHeight","pdfUI","createPDFUI","PDFUI","addons","customs","defaultStateHandler","DefaultTool","fragments","saveAttachment","renderTo","viewerOptions","jr","licenseKey","LicenseKey","licenseSN","LicenseSN","libPath","newPageNumber","getPDFViewer","viewer","annotAdd","getTitle","stampId","getUniqueID","pageRender","getPDFPageRender","getPDFPage","signatureRect","getRect","removeAnnotById","addProviderSignatureWithTimestampMessage","addViewerEventListener","currentPDFDoc","getPageCount","singlePageModeButton","getViewModeManager","viewModeMgr","switchTo","DefaultViewMode","annotUpdate","firstAnnot","isMarkup","groupElements","getGroupElements","datetimeStampAnnot","datetimeStampAnnotRect","setRect","getAnnotRender","getComponent","registerMatchRule","annot","ParentClass","showReplyDialog","setDefaultAnnotConfig","borderInfo","defaultAppearance","fillColor","intent","textColor","textSize","destroyViewer","openPDFData","openPDFByFile","removeDefaultStamps","setProviderStamp","providerSignatureData","getProviderSignatureBase64","providerName","loadImage","annotType","fileType","pdfViewer","addAnnotationIcon","Image","removeAnnotationIcon","pdfDocumentStream","pdfDoc","bufferArray","getStream","currentAttachmentUid","getCurrentPDFDoc","pdfBlob","editedAttachment","blobToBase64","AttachmentUid","setAttachment","reader","FileReader","onloadend","base64dataUrl","base64data","readAsDataURL","Signature","signatureString","ProviderName","setupDragBehavior","mousedown$","withLatestFrom","endEvent","startEvent","isRegularPageDrag","isRegularDrag","handleDrag","pageScale","pageRect","getHandlerDOM","getScale","reversedRect","reverseDeviceRect","addDate","teardown1","select-text","pdfui-end-scrolling-page","annotArray","iconCategory","getRotation","addAnnotGroup","annotJson","_this13","addAnnot","addTextBox","annots","batchSaveAttachments","obv","attachmentsToSave","attachmentModified","docId","getModifiedAttachmentData","pdfBase64","checkIfAttachmentDirty","checkIfAttachmentGroupDirty","startPoints","endPoints","includeTime","formatString","adjustZoom","zoomTo","PdfRendererFactory","styleService","runtimeUtils","createDeferred","resultPromise","_ref4","pdfRenderer","_this14","createOnElement","_this15","__webpack_require__","pdfRenderers","ApSignPdfComponent","documentValue","currentDocumentChange","pdfRendererFactory","documentService","foxitLicenseRepository","systemGuid","disableFullscreen","downloadingDocument","loadError","loadingDocument","onDocumentLoad","pageWidth","viewportService","pageHeight","deferredPdfRenderer","foxitLicense","_this16","pdfViewerRef","loadDocumentInternal","documentIdChanges","previousDocumentId","loadDocument","documentLoadComplete","documentLoadSuccess","documentLoadError","currentAttachment","documentLoad","_this17","existingData","ajsComponentName","onSwipeImg","ApImageViewerComponent","currentPageValue","isFullscreenMode","loadingImage","currentPageChange","imageData","loadPage","ApDocumentViewerComponent","loadingDocumentValue","loadingDocumentChange","disableInlinePdf","ApSaveToFileDirective","onClick","documentDownload","documentLoaded","currentDocumentChanged","ɵɵnextContext","openWindowsViewer","onDocumentOpenInSeparateTab","ApEnhancedDocumentViewerComponent","apSignPdf","attachmentHandler","_attachmentHandler","attachmentHandlerChanged","setAttachmentHandler","isReadOnly","getViewer","onDocumentDownload","documentDownloadComplete","bridgeService","enableDownload","messageStatus","attachmentHandlerLoading","attachmentAutoOpen","onDocumentDownloadRef","useViewerOverride","onHandlerLoadComplete","onHandlerLoadSuccess","HandlerAQN","AutoOpen","canDownloadDocument","canOpenInSeparateTab","documentGetStaticUrl","angularMaterialComponents","MatCheckboxModule","MatAutocompleteModule","MatButtonModule","MatCardModule","MatChipsModule","MatFormFieldModule","MatInputModule","MatMenuModule","MatSelectModule","MatSliderModule","MatSnackBarModule","MatRadioModule","MatTableModule","MatTooltipModule","MatTabsModule","CoreUiModule","BaseHammerConfig","ApPaymentFrameComponent","expectedMessageOrigin","safeUrl","onPostMessage","paymentWidgetFrame","contentWindow","isTCEvent","applyPayment","ContentAttributeServiceUpgrade","ContentAttributeServiceUpgradeAjsProvider","ContentAttributeServiceUpgradeFactory","environment","PatientPortalConfigurationRepository","BrowserWebViewManagerJs","BrowserWebViewManagerJsFactory","TransitionManagerJs","TransitionManagerJsFactory","XamarinWebViewManagerJs","XamarinWebViewManagerJsFactory","ForceLoadAngularComponent","transitionManagerJs","webViewManagerService","xamarinWebViewManagerJs","browserWebViewManagerJs","angularInitialized","WebCommonAngularJSModule","parentModule","AppRoutesAjsProvider","BrowserWebViewManagerJsFactoryAjsProvider","ErrorServiceAjsProvider","TransitionManagerJsFactoryAjsProvider","XamarinWebViewManagerJsFactoryAjsProvider","PatientDocumentViewerModalComponent","patientPortalAttachmentRepository","loadAttachment","downloadAttachmentRef","downloadAttachment","cancel","PatientDocumentsViewerModalService","apModalService","openModal","FileExtension","updateFilter","filter_r4","viewDocument","setDocumentDownloading","ALL_FILTER","DocumentWithDownload","Downloading","AttachmentTypeName","AttachmentTypeUid","PatientUid","FileDate","LastModifiedDate","PatientDocumentsComponent","patientDocumentViewerModalService","activeFilter","documentClone","documents","filters","activePatientId","restoreDocuments","populateFilters","attachmentTypes","Documents","AttachmentTypes","hasDocuments","PendingCopy","textarea","_textarea","readOnly","successful","currentFocus","setSelectionRange","execCommand","Clipboard","pendingCopy","beginCopy","ApPersonalHealthAppsModalComponent","patientIdentityRepository","clipboard","isPatientRegistered","isPatientRegisteredForFHIR","displayRegistrationResponse","setId","registeringPatient","onGetPersonIdentitySubjectSuccess","fhirUserRevokeUrl","FhirUserRevokeUrl","fhirResourceUrl","FhirResourceUrl","registrationError","ModelState","commandResult","registrationErrorMessage","revoke","copyToClipboard","isRegistrated","Id","baseId","ApPersonalHealthAppsModalService","PatientPortalAngularJSModule","CoreModule","UIRouterRx","start$","success$","params$","states$","onStatesChangedEvent","currentStates","deregisterFns","onStatesChanged","ng2ViewsBuilder","viewsObject","$default","Ng2ViewConfig","MergeInjector","UIView","_uiViewData","_name","parentFqn","_viewConfigUpdated","_deregisterUiCanExitHook","_invokeUiCanExitHook","_deregisterUiOnParamsChangedHook","_invokeUiOnParamsChangedHook","_deregisterUIView","registerUIView","uiCanExitFn","uiCanExit","$transition$","uiOnParamsChanged","viewState","getNodeSchema","toSchema","fromSchema","changedToParams","changedKeys","newValues","_disposeLast","_applyUpdatedConfig","componentInjector","_getComponentInjector","componentClass","compFactory","_componentTarget","_applyInputBindings","newProviders","PARENT_INJECT","parentComponentInjector","mergedParentInjector","explicitBoundProps","renamedInputProp","explicitInputTuples","implicitInputTuples","ng2ComponentInputs","UIROUTER_ROOT_MODULE","UIROUTER_MODULE_TOKEN","applyModuleConfig","multiProviderParentChildDelta","childVals","parentVals","loadNgModuleFn","loadChildren","loadNgModule","moduleToLoad","ng2Injector","__esModule","loadModuleFactory","applyNgModule","ng2Module","originalName","originalState","replacementName","newRootModules","newChildModules","newStateObjects","replacementState","newParentStates","Ng2LocationServices","hashWithPrefix","urlPath","Ng2LocationConfig","uiRouterFactory","rootModules","viewConfigFactory","ng2LazyLoadBuilder","ng2InjectorResolvable","$get","moduleConfig","applyRootModuleConfig","parentUIViewInjectFactory","appInitializer","_UIROUTER_SERVICE_PROVIDERS","fnStateService","fnTransitionService","fnUrlMatcherFactory","fnUrlRouter","fnUrlService","fnViewService","fnStateRegistry","fnGlobals","deferInitialRender","makeRootProviders","onTransitionReady","makeChildProviders","useHash","_UIROUTER_INSTANCE_PROVIDERS","UIRouterModule","ng_from_global","ng_from_import","hasAnyKey","ng1ViewsBuilder","compKeys","nonCompKeys","allViewKeys","resolveAs","Ng1ViewConfig","makeComponentTemplate","controller","getController","controllerProvider","providerFn","TemplateFactory","$http","$templateCache","$templateRequest","_useHttp","asTemplate","asComponent","templateUrl","fromUrl","templateProvider","fromProvider","componentProvider","fromComponentProvider","Accept","kebob","kebobed","getComponentBindings","cmpDefs","getBindings","resolveName","arrayIdxStr","kebobName","bindToController","scopeBindings","bindingsObj","StateProvider","onInvalid","getStateHookBuilder","decoratedNg1Hook","getLocals","$state$","Ng1LocationServices","$locationProvider","_lp","pathType","_urlListeners","$sniffer","$browser","$window","newUrl","$location","_loc","UrlRouterProvider","$match","$stateParams","ruleFn","urlRules","injectableHandler","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","stateProvider","getNg1ViewConfigFactory","templateFactory","ng1LocationService","_runtimeServices","getProviderFor","serviceName","$urp","runBlock","$uiRouter","checkStrictDi","watchDigests","urlRouterProvider","$urlMatcherFactory","uiSrefDirective","uiStateDirective","uiSrefActiveDirective","parseStateRef","paramsOnly","paramExpr","$uiView","inheritedData","processedDef","$element","uiState","uiStateOpts","defaultOpts","uiStateParams","getTypeInfo","isSvg","isForm","isAnchor","clickable","clickHook","$timeout","getDef","which","transition_1","ignorePreventDefaultCount_1","bindEvents","events_1","events_2","$IsStateFilter","isFilter","$stateful","$IncludedByStateFilter","includesFilter","$ViewDirectiveFill","$controller","getControllerAs","getResolveAs","tElement","$cfg","getTemplate","resolveCtx","controllerAs","controllerInstance","$scope","registerControllerCallbacks","tagRegexp_1","deregisterWatch_1","directiveEl","ctrlInstance","uiSrefActive","unlinkInfoFn","rawDef","uiSref","$$addStateInfo","$set","uiSrefOpts","$eval","inputAttrs","watchDeregFns","$interpolate","$attrs","activeEqClass","uiSrefActiveEq","updateAfterTransition","handleStatesChanged","setStatesFromDefinitionObject","statesDefinition","activeClass","addStateForClass","addState","stateParams","stateInfo","splitClasses","getClasses","stateList","allClasses","fuzzyClasses","exactClasses","addClasses","removeClasses","setupEventListeners","deregisterStatesChangedListener","deregisterOnStartListener","deregisterStateChangeSuccessListener","$animate","$uiViewScroll","rootData","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","onloadExp","autoScrollExp","autoscroll","getRenderer","leave","activeUIView","configUpdatedCallback","configsEqual","config1","config2","updateView","fromParentTagConfig","fromParentTag","unregister","newScope","animEnter","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cleanupLastView","_viewData_1","hasComponentImpl","_uiCanExitId","$onInit","hookOptions","viewCreationTrans_1","changedKeys_1","id_1","cacheProp_1","prevTruthyAnswer_1","ids","$ViewScrollProvider","useAnchorScroll","$anchorScroll","scrollIntoView","getAngularLib","objectFactory","UIViewNgUpgrade","ng1elem","getUIRouter","getParentUIViewInject","UIRouterUpgradeModule","uiRouterUpgradeFactory","ng1Injector","ng2NotFoundValue","$stateRegistry","viewName","$templateFactory","ng1ViewConfig","ContactUsComponent","loginAssistanceRepository","onLoadComplete","onLoadSuccess","onLoadError","loginAssistanceInfo","loginAppRoutes","contactus","portalSettings","hideHeader","hideToolbar","toolbarItem","route","loginRoutes","LoginModule","appRouteService","setupAppRoutes","ThLoginComponent","patientPortalConfigurationRepository","contentAttributeService","telehealthRepository","apptId","getClientConfig","telehealthLogin","submitting","thLoginForm","AppointmentId","BirthDate","birthDate","ClientFeatures","ClientId","DeviceId","ZipCode","zipCode","JsonWebToken","hasLoginError","ThPaymentSummaryComponent","billingRepository","txId","loadReciept","receiptRequestDto","RecipientEnumText","RemoteSessionId","toLocaleDateString","TxId","receiptHtml","ReceiptHtml","print","continueClicked","ThPaymentComponent","loadBilling","getPaymentRedirectUrl","PaymentUrl","billingCoPayAmount","BillingCoPayAmount","BillingBalance","billingBalance","billingBalanceString","isNegativeBalance","redirectUrlString","ApplicationSubmittingPayment","AppointmentGuid","PaymentResponseString","IsCanceled","hasPaymentError","telehealthAppRoutes","telehealth","hideFooter","thPayment","thPaymentSummary","telehealthRoutes","TelehealthModule","DashboardModule","invalidTimingValue","isNode","optimizeGroupPlayer","ɵAnimationGroupPlayer","normalizeKeyframes","driver","normalizer","keyframes","preStyles","postStyles","normalizedKeyframes","previousOffset","previousKeyframe","kf","isSameOffset","normalizedKeyframe","normalizedValue","normalizePropertyName","PRE_STYLE","normalizeStyleValue","animationFailed","listenOnPlayer","copyAnimationEvent","makeAnimationEvent","triggerName","getOrSetDefaultValue","parseTimelineCommand","command","separatorPos","_contains","elm1","elm2","_query","_documentElement","getParentElement","_CACHED_BODY","_IS_WEBKIT","containsElement","invokeQuery","NoopAnimationDriver","validateStyleProperty","getBodyNode","containsVendorPrefix","matchesElement","_selector","computeStyle","easing","previousPlayers","scrubberAccessRequested","AnimationDriver","ONE_SECOND","ENTER_CLASSNAME","LEAVE_CLASSNAME","NG_TRIGGER_CLASSNAME","NG_TRIGGER_SELECTOR","NG_ANIMATING_CLASSNAME","NG_ANIMATING_SELECTOR","resolveTimingValue","_convertTimeValueToMS","resolveTiming","allowNegativeValues","parseTimeExpression","delayMatch","easingVal","containsErrors","negativeStepValue","negativeDelayValue","copyObj","convertToMap","styleMap","copyStyles","backfill","getStyleAttributeString","writeStyleAttribute","styleAttrValue","camelCaseToDashCase","formerStyles","camelProp","dashCaseToCamelCase","normalizeAnimationEntry","PARAM_REGEX","extractStyleParams","original","varName","localVal","invalidParamValue","iteratorToArray","DASH_CASE_REGEXP","visitDslNode","visitor","visitTrigger","visitState","visitTransition","visitSequence","visitGroup","visitAnimate","visitKeyframes","visitStyle","visitReference","visitAnimateChild","visitAnimateRef","visitQuery","visitStagger","invalidNodeType","ANY_STATE","transitionValue","expressions","parseInnerTransitionStr","eventStr","parseAnimationAlias","invalidTransitionAlias","invalidExpression","makeLambdaFromStates","TRUE_BOOLEAN_VALUES","FALSE_BOOLEAN_VALUES","lhs","rhs","LHS_MATCH_BOOLEAN","RHS_MATCH_BOOLEAN","lhsMatch","rhsMatch","SELF_TOKEN_REGEX","buildAnimationAst","warnings","AnimationAstBuilderVisitor","_driver","AnimationAstBuilderContext","_resetContextStyleTimingState","currentQuerySelector","collectedStyles","currentTime","queryCount","depCount","transitions","invalidTrigger","stateDef","invalidDefinition","styleAst","astParams","containsDynamicStyles","missingSubs","metadataName","invalidState","matchers","parseTransitionExpr","normalizeAnimationOptions","furthestTime","innerAst","timingAst","constructTimingAst","makeTimingAst","ast","currentAnimateTimings","styleMetadata","newStyleData","_styleAst","isEmptyStep","_makeStyleAst","_validateStyleAst","metadataStyles","styleTuple","collectedEasing","styleData","collectedEntry","updateCollectedStyle","invalidParallelAnimation","firstStart","firstEnd","secondStart","secondEnd","validateStyleParams","invalidStyleParams","invalidKeyframes","totalKeyframesWithOffsets","offsetsOutOfOrder","keyframesOutOfRange","offsetVal","consumeOffset","invalidOffset","keyframeOffsetsOutOfOrder","generatedOffset","keyframesMissingOffsets","animateDuration","durationUpToThisFrame","parentSelector","currentQuery","includeSelf","normalizeSelector","hasAmpersand","originalSelector","invalidStagger","currentTransition","normalizeParams","createTimelineInstruction","preStyleProps","postStyleProps","subTimeline","ElementInstructionMap","_map","instructions","existingInstructions","ENTER_TOKEN_REGEX","LEAVE_TOKEN_REGEX","enterClassName","leaveClassName","startingStyles","finalStyles","subInstructions","AnimationTimelineBuilderVisitor","buildKeyframes","AnimationTimelineContext","currentTimeline","delayNextStep","timelines","timeline","containsAnimation","lastRootTimeline","allowOnlyTimelineStyles","elementInstructions","innerContext","createSubContext","_visitSubInstructions","transformIntoNewTimeline","_applyAnimationRefDelays","animationsRefsOptions","animationRefOptions","animationDelay","animationDelayValue","instruction","instructionTimings","appendInstructionToTimeline","updateOptions","subContextCount","snapshotCurrentStyles","DEFAULT_NOOP_PREVIOUS_NODE","applyStylesToKeyframe","innerTimelines","mergeTimelineCollectedStyles","_visitTiming","incrementTime","hasCurrentStyleProperties","forwardFrame","applyEmptyStep","innerTimeline","forwardTime","elms","currentQueryTotal","sameElementTimeline","parentContext","tl","maxTime","currentStaggerTime","startingTime","_enterClassName","_leaveClassName","initialTimeline","TimelineBuilder","skipIfExists","optionsToUpdate","paramsToUpdate","_copyOptions","oldParams","newTime","updatedTimings","SubTimelineBuilder","stretchStartingKeyframe","invalidQuery","_elementTimelineStylesLookup","_currentEmptyStepKeyframe","_globalTimelineStyles","_localTimelineStyles","_loadKeyframe","_keyframes","_currentKeyframe","hasPreStyleStep","_pendingStyles","_previousKeyframe","_updateStyle","_styleSummary","_backFill","allStyles","allProperties","getFinalKeyframe","details1","details0","finalKeyframes","keyframe","finalKeyframe","preProps","postProps","kf0","kf1","_stretchStartingKeyframe","newKeyframes","startingGap","newFirstKeyframe","oldFirstKeyframe","roundOffset","oldOffset","decimalPoints","mult","AnimationStyleNormalizer","DIMENSIONAL_PROP_SET","WebAnimationsStyleNormalizer","userProvidedProperty","normalizedProperty","strVal","valAndSuffixMatch","invalidCssUnitValue","createTransitionInstruction","isRemovalTransition","fromStyles","toStyles","queriedElements","EMPTY_OBJECT","AnimationTransitionFactory","_triggerName","_stateStyles","nextState","oneOrMoreTransitionsMatch","matchFns","buildStyles","styler","currentOptions","nextOptions","skipAstBuild","transitionAnimationParams","currentStateStyles","nextAnimationParams","nextStateStyles","preStyleMap","postStyleMap","isRemoval","animationOptions","applyParamDefaults","buildAnimationTimelines","elm","queriedElementsList","userParams","AnimationStateStyles","defaultParams","combinedParams","AnimationTrigger","_normalizer","transitionFactories","balanceProperties","fallbackTransition","createFallbackTransition","containsQueries","matchTransition","matchStyles","EMPTY_INSTRUCTION_MAP","TimelineAnimationEngine","bodyNode","registerFailed","_animations","_buildPlayer","autoStylesMap","inst","missingOrDestroyedAnimation","createAnimationFailed","_playersById","_getPlayer","missingPlayer","baseEvent","QUEUED_CLASSNAME","DISABLED_CLASSNAME","EMPTY_PLAYER_ARRAY","NULL_REMOVAL_STATE","namespaceId","setForRemoval","setForMove","hasAnimation","removedBeforeQueried","NULL_REMOVED_QUERIED_STATE","REMOVAL_FLAG","StateValue","isObj","normalizeTriggerValue","absorbOptions","VOID_VALUE","DEFAULT_STATE_VALUE","AnimationTransitionNamespace","_engine","_queue","_hostClassName","_triggers","missingTrigger","missingEvent","isTriggerEventValid","unsupportedTriggerEvent","_elementListeners","triggersWithStates","statesByElement","afterFlush","_getTrigger","unregisteredTrigger","defaultToFallback","TransitionAnimationPlayer","objEquals","k1","k2","reportError","eraseStyles","playersOnElement","playersByElement","queued","isFallbackTransition","totalQueuedPlayers","clearElementCache","elementPlayers","_signalRemovalForInnerTriggers","namespaces","fetchNamespacesByElement","ns","triggerLeaveAnimation","afterFlushAnimationsDone","destroyAfterComplete","triggerStates","previousTriggersValues","markElementAsRemoved","processLeaveNode","prepareLeaveAnimationListeners","elementStates","visitedTriggers","removeNode","engine","childElementCount","containsPotentialParentTransition","totalAnimations","currentPlayers","playersByQueriedElement","removalFlag","destroyInnerAnimations","_onRemovalComplete","insertNode","drainQueuedTransitions","microtaskId","markedForDestroy","d0","d1","elementContainsData","containsData","TransitionAnimationEngine","onRemovalComplete","_namespaceLookup","_namespaceList","_flushFns","_whenQuietFns","collectedEnterElements","collectedLeaveElements","queuedPlayers","createNamespace","_balanceNamespaceList","newHostElements","collectEnterElement","namespaceList","namespacesByHostElement","ancestor","ancestorNs","registerTrigger","_fetchNamespace","stateValue","markElementAsDisabled","disabledNodes","hostNS","_buildInstruction","subTimelines","skipBuildAst","containerElement","destroyActiveAnimationsForElement","finishActiveQueriedAnimationOnElement","whenRenderingDone","cleanupFns","_flushAnimations","quietFns","triggerTransitionsFailed","skippedPlayers","skippedPlayersMap","queuedInstructions","allPreStyleElements","allPostStyleElements","disabledElementsSet","nodesThatAreDisabled","allTriggerElements","enterNodeMap","buildRootMap","enterNodeMapIds","allLeaveNodes","mergedLeaveNodes","leaveNodesWithoutAnimations","leaveNodeMapIds","leaveNodeMap","allPlayers","erroneousTransitions","nodeIsOrphaned","stringMap","setVal","transitionFailed","allPreviousPlayersMap","animationElementMap","_beforeAnimationBuild","_getPreviousPlayers","prevPlayer","replaceNodes","replacePostStylesAsPre","postStylesMap","cloakAndComputeStyles","preStylesMap","pre","rootPlayers","subPlayers","NO_PARENT_ANIMATION_ELEMENT_DETECTED","overrideTotalTime","parentWithAnimation","parentsToAdd","detectedParent","innerPlayer","_buildAnimation","setRealPlayer","parentPlayers","playersForElement","syncPlayerEvents","queriedPlayerResults","queriedInnerElements","queriedPlayers","activePlayers","removeNodesAfterAnimationDone","isQueriedElement","toStateValue","queriedElementPlayers","isRemovalAnimation","targetNameSpaceId","targetTriggerName","timelineInstruction","realPlayer","getRealPlayer","allQueriedPlayers","allConsumedElements","allSubElements","allNewPlayers","flattenGroupPlayers","finalPlayers","_flattenGroupPlayersRecur","wrappedPlayer","deleteOrUnsetInMap","currentValues","_containsRealPlayer","_player","_queuedCallbacks","_queueEvent","cloakElement","valuesMap","elementPropsMap","defaultStyle","cloakVals","failedElements","roots","rootMap","NULL_NODE","nodeSet","localRootMap","postEntry","preEntry","AnimationEngine","_triggerCache","_transitionEngine","_timelineEngine","componentId","cacheKey","triggerBuildFailed","buildTrigger","onInsert","disableAnimations","eventPhase","SpecialCasedStyles","_startStyles","_endStyles","initialStyles","initialStylesByElement","_initialStyles","filterNonAnimatableStyles","isNonAnimatableStyle","WebAnimationsPlayer","_specialStyles","_initialized","_duration","_delay","_preparePlayerBeforeStart","domPlayer","_triggerWebAnimation","_finalKeyframe","_resetDomPlayerState","_convertKeyframesToObject","kfs","frame","fromEntries","currentSnapshot","WebAnimationsDriver","validateAnimatableStyleProperty","playerOptions","previousStyles","previousWebAnimationPlayers","allowPreviousPlayerStylesMerge","balancePreviousStylesIntoKeyframes","startingKeyframe","missingStyleProps","specialStyles","startStyles","endStyles","packageNonAnimatableStyles","BrowserAnimationBuilder","_nextAnimationId","rootRenderer","issueAnimationCommand","BrowserAnimationFactory","RendererAnimationPlayer","_command","_listen","DISABLE_ANIMATIONS_FLAG","AnimationRendererFactory","_currentId","_microtaskId","_animationCallbacksBuffer","_cdRecurDepth","_rendererCache","BaseAnimationRenderer","onRendererDestroy","animationTriggers","AnimationRenderer","_scheduleCountTask","scheduleListenerCallback","resolveElementFromTarget","parseTriggerCallbackName","dotIndex","InjectableAnimationEngine","SHARED_ANIMATION_PROVIDERS","instantiateDefaultStyleNormalizer","instantiateRendererFactory","BROWSER_ANIMATIONS_PROVIDERS","BROWSER_NOOP_ANIMATIONS_PROVIDERS","BrowserAnimationsModule","defaultToastaConfig","WebCommonModule","AppModule","aprimaCacheService","portalConfigurationRepository","webBridgeService","setTheme","conditionalImports","downgradeModule","moduleOrBootstrapFn","lazyModuleName","lazyInjectorKey","bootstrapFn","isNgModuleType","ɵNG_MOD_DEF","__NgCli_bootstrap_1","webpackEmptyContext"],"sourceRoot":"webpack:///","sources":["./node_modules/@juggle/resize-observer/lib/utils/prettify.js","./node_modules/@juggle/resize-observer/lib/utils/scheduler.js","./node_modules/@juggle/resize-observer/lib/ResizeObserverBoxOptions.js","./node_modules/@juggle/resize-observer/lib/DOMRectReadOnly.js","./node_modules/@juggle/resize-observer/lib/utils/element.js","./node_modules/@juggle/resize-observer/lib/algorithms/calculateBoxSize.js","./node_modules/@juggle/resize-observer/lib/ResizeObservation.js","./node_modules/@juggle/resize-observer/lib/ResizeObserverDetail.js","./node_modules/@juggle/resize-observer/lib/algorithms/hasActiveObservations.js","./node_modules/@juggle/resize-observer/lib/algorithms/deliverResizeLoopError.js","./node_modules/@juggle/resize-observer/lib/ResizeObserverEntry.js","./node_modules/@juggle/resize-observer/lib/algorithms/calculateDepthForNode.js","./node_modules/@juggle/resize-observer/lib/algorithms/broadcastActiveObservations.js","./node_modules/@juggle/resize-observer/lib/algorithms/gatherActiveObservationsAtDepth.js","./node_modules/@juggle/resize-observer/lib/ResizeObserverController.js","./node_modules/@juggle/resize-observer/lib/algorithms/hasSkippedObservations.js","./node_modules/@juggle/resize-observer/lib/ResizeObserver.js","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/common.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/coreservices.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/glob.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/hof.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/predicates.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/queue.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/safeConsole.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/strings.ts","./node_modules/@uirouter/core/lib-esm/common/@uirouter/core/common/trace.ts","./node_modules/@uirouter/core/lib-esm/@uirouter/core/globals.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/lazyLoad.ts","./node_modules/@uirouter/core/lib-esm/params/@uirouter/core/params/param.ts","./node_modules/@uirouter/core/lib-esm/params/@uirouter/core/params/paramType.ts","./node_modules/@uirouter/core/lib-esm/params/@uirouter/core/params/paramTypes.ts","./node_modules/@uirouter/core/lib-esm/params/@uirouter/core/params/stateParams.ts","./node_modules/@uirouter/core/lib-esm/path/@uirouter/core/path/pathNode.ts","./node_modules/@uirouter/core/lib-esm/path/@uirouter/core/path/pathUtils.ts","./node_modules/@uirouter/core/lib-esm/resolve/@uirouter/core/resolve/interface.ts","./node_modules/@uirouter/core/lib-esm/resolve/@uirouter/core/resolve/resolvable.ts","./node_modules/@uirouter/core/lib-esm/resolve/@uirouter/core/resolve/resolveContext.ts","./node_modules/@uirouter/core/lib-esm/@uirouter/core/router.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/stateBuilder.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/stateMatcher.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/stateObject.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/stateQueueManager.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/stateRegistry.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/stateService.ts","./node_modules/@uirouter/core/lib-esm/state/@uirouter/core/state/targetState.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/hookBuilder.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/hookRegistry.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/interface.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/rejectFactory.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/transition.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/transitionEventType.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/transitionHook.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/coreResolvables.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/redirectTo.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/onEnterExitRetain.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/resolve.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/views.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/updateGlobals.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/url.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/ignoredTransition.ts","./node_modules/@uirouter/core/lib-esm/hooks/@uirouter/core/hooks/invalidTransition.ts","./node_modules/@uirouter/core/lib-esm/transition/@uirouter/core/transition/transitionService.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlConfig.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlMatcher.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlMatcherFactory.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlRouter.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlRule.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlRules.ts","./node_modules/@uirouter/core/lib-esm/url/@uirouter/core/url/urlService.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/q.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/injector.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/utils.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/baseLocationService.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/hashLocationService.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/memoryLocationService.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/pushStateLocationService.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/browserLocationConfig.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/plugins.ts","./node_modules/@uirouter/core/lib-esm/vanilla/@uirouter/core/vanilla/memoryLocationConfig.ts","./node_modules/@uirouter/core/lib-esm/view/@uirouter/core/view/view.ts","./node_modules/moment/moment.js","./source/WebCommon/local_packages/angular-noop/index.js","./node_modules/rxjs/src/internal/util/isFunction.ts","./node_modules/rxjs/src/internal/config.ts","./node_modules/rxjs/src/internal/util/hostReportError.ts","./node_modules/rxjs/src/internal/Observer.ts","./node_modules/rxjs/src/internal/util/isArray.ts","./node_modules/rxjs/src/internal/util/isObject.ts","./node_modules/rxjs/src/internal/util/UnsubscriptionError.ts","./node_modules/rxjs/src/internal/Subscription.ts","./node_modules/rxjs/src/internal/symbol/rxSubscriber.ts","./node_modules/rxjs/src/internal/Subscriber.ts","./node_modules/rxjs/src/internal/symbol/observable.ts","./node_modules/rxjs/src/internal/util/identity.ts","./node_modules/rxjs/src/internal/Observable.ts","./node_modules/rxjs/src/internal/util/toSubscriber.ts","./node_modules/rxjs/src/internal/util/canReportError.ts","./node_modules/rxjs/src/internal/util/pipe.ts","./node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts","./node_modules/rxjs/src/internal/SubjectSubscription.ts","./node_modules/rxjs/src/internal/Subject.ts","./node_modules/rxjs/src/internal/util/isScheduler.ts","./node_modules/rxjs/src/internal/operators/map.ts","./node_modules/rxjs/src/internal/util/subscribeToArray.ts","./node_modules/rxjs/src/internal/symbol/iterator.ts","./node_modules/rxjs/src/internal/util/isArrayLike.ts","./node_modules/rxjs/src/internal/util/isPromise.ts","./node_modules/rxjs/src/internal/util/subscribeTo.ts","./node_modules/rxjs/src/internal/util/subscribeToObservable.ts","./node_modules/rxjs/src/internal/util/subscribeToPromise.ts","./node_modules/rxjs/src/internal/util/subscribeToIterable.ts","./node_modules/rxjs/src/internal/scheduled/scheduleArray.ts","./node_modules/rxjs/src/internal/observable/from.ts","./node_modules/rxjs/src/internal/scheduled/scheduled.ts","./node_modules/rxjs/src/internal/util/isInteropObservable.ts","./node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts","./node_modules/rxjs/src/internal/scheduled/schedulePromise.ts","./node_modules/rxjs/src/internal/util/isIterable.ts","./node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts","./node_modules/rxjs/src/internal/innerSubscribe.ts","./node_modules/rxjs/src/internal/operators/mergeMap.ts","./node_modules/rxjs/src/internal/operators/mergeAll.ts","./node_modules/rxjs/src/internal/observable/fromArray.ts","./node_modules/rxjs/src/internal/observable/merge.ts","./node_modules/rxjs/src/internal/operators/refCount.ts","./node_modules/rxjs/src/internal/observable/ConnectableObservable.ts","./node_modules/rxjs/src/internal/operators/multicast.ts","./node_modules/rxjs/src/internal/operators/share.ts","../packages/core/src/util/property.ts","../packages/core/src/util/stringify.ts","../packages/core/src/di/forward_ref.ts","../packages/core/src/di/interface/provider.ts","../packages/core/src/error_details_base_url.ts","../packages/core/src/errors.ts","../packages/core/src/render3/util/stringify_utils.ts","../packages/core/src/render3/errors_di.ts","../packages/core/src/util/assert.ts","../packages/core/src/di/interface/defs.ts","../packages/core/src/di/interface/injector.ts","../packages/core/src/di/inject_switch.ts","../packages/core/src/util/global.ts","../packages/core/src/di/injector_compatibility.ts","../packages/core/src/util/closure.ts","../packages/core/src/change_detection/constants.ts","../packages/core/src/metadata/view.ts","../packages/core/src/util/empty.ts","../packages/core/src/render3/fields.ts","../packages/core/src/render3/definition.ts","../packages/core/src/render3/interfaces/view.ts","../packages/core/src/render3/interfaces/container.ts","../packages/core/src/render3/interfaces/type_checks.ts","../packages/core/src/render3/definition_factory.ts","../packages/core/src/interface/simple_change.ts","../packages/core/src/render3/features/ng_onchanges_feature.ts","../packages/core/src/render3/profiler.ts","../packages/core/src/render3/namespaces.ts","../packages/core/src/render3/util/view_utils.ts","../packages/core/src/render3/state.ts","../packages/core/src/render3/hooks.ts","../packages/core/src/render3/interfaces/injector.ts","../packages/core/src/render3/util/attrs_utils.ts","../packages/core/src/render3/util/injector_utils.ts","../packages/core/src/render3/di.ts","../packages/core/src/util/decorators.ts","../packages/core/src/di/injection_token.ts","../packages/core/src/metadata/di.ts","../packages/core/src/interface/type.ts","../packages/core/src/util/array_utils.ts","../packages/core/src/reflection/reflection_capabilities.ts","../packages/core/src/di/metadata.ts","../packages/core/src/di/jit/util.ts","../packages/core/src/render/api_flags.ts","../packages/core/src/render3/interfaces/lview_tracking.ts","../packages/core/src/render3/context_discovery.ts","../packages/core/src/render3/i18n/i18n_tree_shaking.ts","../packages/core/src/render3/util/view_traversal_utils.ts","../packages/core/src/render3/node_manipulation.ts","../packages/core/src/util/security/trusted_types.ts","../packages/core/src/render3/interfaces/document.ts","../packages/core/src/util/security/trusted_types_bypass.ts","../packages/core/src/sanitization/bypass.ts","../packages/core/src/sanitization/inert_body.ts","../packages/core/src/sanitization/url_sanitizer.ts","../packages/core/src/sanitization/html_sanitizer.ts","../packages/core/src/sanitization/security.ts","../packages/core/src/sanitization/sanitization.ts","../packages/core/src/di/initializer_token.ts","../packages/core/src/di/injector_token.ts","../packages/core/src/di/internal_tokens.ts","../packages/core/src/di/null_injector.ts","../packages/core/src/di/provider_collection.ts","../packages/core/src/di/scope.ts","../packages/core/src/di/r3_injector.ts","../packages/core/src/linker/component_factory.ts","../packages/core/src/linker/component_factory_resolver.ts","../packages/core/src/linker/element_ref.ts","../packages/core/src/render/api.ts","../packages/core/src/sanitization/sanitizer.ts","../packages/core/src/version.ts","../packages/core/src/view/provider_flags.ts","../packages/core/src/util/errors.ts","../packages/core/src/error_handler.ts","../packages/core/src/render3/util/misc_utils.ts","../packages/core/src/render3/styling/class_differ.ts","../packages/core/src/render3/node_selector_matcher.ts","../packages/core/src/render3/tokens.ts","../packages/core/src/render3/instructions/advance.ts","../packages/core/src/di/create_injector.ts","../packages/core/src/di/injector.ts","../packages/core/src/di/reflective_errors.ts","../packages/core/src/di/reflective_key.ts","../packages/core/src/di/reflective_provider.ts","../packages/core/src/di/reflective_injector.ts","../packages/core/src/render3/instructions/di.ts","../packages/core/src/render3/instructions/shared.ts","../packages/core/src/render3/styling/static_styling.ts","../packages/core/src/render3/collect_native_nodes.ts","../packages/core/src/render3/view_ref.ts","../packages/core/src/render3/component_ref.ts","../packages/core/src/render3/features/inherit_definition_feature.ts","../packages/core/src/util/iterable.ts","../packages/core/src/render3/bindings.ts","../packages/core/src/render3/instructions/attribute.ts","../packages/core/src/render3/instructions/interpolation.ts","../packages/core/src/render3/instructions/template.ts","../packages/core/src/render3/instructions/storage.ts","../packages/core/src/render3/instructions/property.ts","../packages/core/src/render3/instructions/element.ts","../packages/core/src/render3/interfaces/node.ts","../packages/core/src/render3/instructions/element_container.ts","../packages/core/src/render3/instructions/get_current_view.ts","../packages/core/src/util/lang.ts","../packages/core/src/render3/instructions/listener.ts","../packages/core/src/render3/instructions/next_context.ts","../packages/core/src/render3/instructions/projection.ts","../packages/core/src/render3/instructions/property_interpolation.ts","../packages/core/src/render3/interfaces/styling.ts","../packages/core/src/render3/styling/style_binding_list.ts","../packages/core/src/render3/styling/styling_parser.ts","../packages/core/src/render3/instructions/styling.ts","../packages/core/src/render3/instructions/text.ts","../packages/core/src/render3/instructions/text_interpolation.ts","../packages/core/src/i18n/locale_en.ts","../packages/core/src/i18n/locale_data_api.ts","../packages/core/src/i18n/localization.ts","../packages/core/src/render3/i18n/i18n_locale_id.ts","../packages/core/src/render3/di_setup.ts","../packages/core/src/render3/features/providers_feature.ts","../packages/core/src/linker/ng_module_factory.ts","../packages/core/src/render3/ng_module_ref.ts","../packages/core/src/render3/features/standalone_feature.ts","../packages/core/src/render3/pure_function.ts","../packages/core/src/render3/pipe.ts","../packages/core/src/event_emitter.ts","../packages/core/src/linker/query_list.ts","../packages/core/src/linker/template_ref.ts","../packages/core/src/linker/view_container_ref.ts","../packages/core/src/render3/query.ts","../packages/core/src/render3/view_engine_compatibility_prebound.ts","../packages/core/src/util/noop.ts","../packages/core/src/r3_symbols.ts","../packages/core/src/application_init.ts","../packages/core/src/application_tokens.ts","../packages/core/src/console.ts","../packages/core/src/i18n/tokens.ts","../packages/core/src/linker/compiler.ts","../packages/core/src/util/microtask.ts","../packages/core/src/zone/ng_zone.ts","../packages/core/src/util/raf.ts","../packages/core/src/testability/testability.ts","../packages/core/src/application_ref.ts","../packages/core/src/change_detection/change_detector_ref.ts","../packages/core/src/change_detection/differs/default_iterable_differ.ts","../packages/core/src/change_detection/differs/default_keyvalue_differ.ts","../packages/core/src/change_detection/differs/iterable_differs.ts","../packages/core/src/change_detection/differs/keyvalue_differs.ts","../packages/core/src/change_detection/change_detection.ts","../packages/core/src/platform_core_providers.ts","../packages/core/src/application_module.ts","../packages/core/src/util/coercion.ts","../packages/common/src/dom_adapter.ts","../packages/common/src/dom_tokens.ts","../packages/common/src/location/platform_location.ts","../packages/common/src/location/util.ts","../packages/common/src/location/location_strategy.ts","../packages/common/src/location/hash_location_strategy.ts","../packages/common/src/location/location.ts","../packages/common/src/i18n/locale_data_api.ts","../packages/common/src/i18n/format_date.ts","../packages/common/src/cookie.ts","../packages/common/src/directives/ng_class.ts","../packages/common/src/directives/ng_for_of.ts","../packages/common/src/directives/ng_if.ts","../packages/common/src/directives/ng_switch.ts","../packages/common/src/directives/ng_template_outlet.ts","../packages/common/src/pipes/invalid_pipe_argument_error.ts","../packages/common/src/pipes/async_pipe.ts","../packages/common/src/pipes/date_pipe_config.ts","../packages/common/src/pipes/date_pipe.ts","../packages/common/src/common_module.ts","../packages/common/src/platform_id.ts","../packages/common/src/xhr.ts","../packages/platform-browser/src/browser/generic_browser_adapter.ts","../packages/platform-browser/src/browser/browser_adapter.ts","../packages/platform-browser/src/browser/server-transition.ts","../packages/platform-browser/src/browser/xhr.ts","../packages/platform-browser/src/dom/events/event_manager.ts","../packages/platform-browser/src/dom/shared_styles_host.ts","../packages/platform-browser/src/dom/dom_renderer.ts","../packages/platform-browser/src/dom/events/dom_events.ts","../packages/platform-browser/src/dom/events/key_events.ts","../packages/platform-browser/src/browser.ts","../packages/platform-browser/src/browser/testability.ts","../packages/platform-browser/src/browser/tools/browser.ts","../packages/platform-browser/src/dom/events/hammer_gestures.ts","../packages/platform-browser/src/security/dom_sanitization_service.ts","../packages/upgrade/src/common/src/angular1.ts","../packages/upgrade/src/common/src/constants.ts","../packages/upgrade/src/common/src/component_info.ts","../packages/upgrade/src/common/src/util.ts","../packages/upgrade/src/common/src/downgrade_component_adapter.ts","../packages/upgrade/src/common/src/promise_util.ts","../packages/upgrade/src/common/src/downgrade_component.ts","../packages/upgrade/src/common/src/downgrade_injectable.ts","../packages/upgrade/static/src/angular1_providers.ts","../packages/upgrade/static/src/util.ts","../packages/upgrade/static/src/downgrade_module.ts","../packages/upgrade/static/src/upgrade_component.ts","../packages/upgrade/static/src/upgrade_module.ts","./node_modules/@angular-devkit/build-angular/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../src/cdk/coercion/boolean-property.ts","../src/cdk/coercion/array.ts","../src/cdk/coercion/css-pixel-value.ts","../src/cdk/coercion/element.ts","./node_modules/rxjs/src/internal/observable/of.ts","./node_modules/rxjs/src/internal/observable/fromEvent.ts","./node_modules/rxjs/src/internal/scheduler/Action.ts","./node_modules/rxjs/src/internal/scheduler/AsyncAction.ts","./node_modules/rxjs/src/internal/Scheduler.ts","./node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts","./node_modules/rxjs/src/internal/scheduler/animationFrame.ts","./node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts","./node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts","./node_modules/rxjs/src/internal/util/Immediate.ts","./node_modules/rxjs/src/internal/scheduler/asap.ts","./node_modules/rxjs/src/internal/scheduler/AsapScheduler.ts","./node_modules/rxjs/src/internal/scheduler/AsapAction.ts","./node_modules/rxjs/src/internal/util/isObservable.ts","./node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts","./node_modules/rxjs/src/internal/scheduler/async.ts","./node_modules/rxjs/src/internal/operators/audit.ts","./node_modules/rxjs/src/internal/util/isNumeric.ts","./node_modules/rxjs/src/internal/observable/timer.ts","./node_modules/rxjs/src/internal/operators/auditTime.ts","./node_modules/rxjs/src/internal/operators/filter.ts","./node_modules/rxjs/src/internal/operators/takeUntil.ts","./node_modules/rxjs/src/internal/observable/concat.ts","./node_modules/rxjs/src/internal/operators/concatAll.ts","./node_modules/rxjs/src/internal/operators/startWith.ts","./node_modules/rxjs/src/internal/operators/switchMap.ts","./node_modules/rxjs/src/internal/scheduler/queue.ts","./node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts","./node_modules/rxjs/src/internal/scheduler/QueueAction.ts","./node_modules/rxjs/src/internal/observable/empty.ts","./node_modules/rxjs/src/internal/observable/throwError.ts","./node_modules/rxjs/src/internal/Notification.ts","./node_modules/rxjs/src/internal/operators/observeOn.ts","./node_modules/rxjs/src/internal/ReplaySubject.ts","./node_modules/rxjs/src/internal/operators/shareReplay.ts","../src/cdk/platform/platform.ts","../src/cdk/platform/features/passive-listeners.ts","../src/cdk/platform/features/scrolling.ts","../src/cdk/platform/features/shadow-dom.ts","../src/cdk/platform/features/test-environment.ts","../src/cdk/bidi/dir-document-token.ts","../src/cdk/bidi/directionality.ts","../src/cdk/bidi/bidi-module.ts","../src/cdk/scrolling/virtual-scroll-strategy.ts","../src/cdk/scrolling/fixed-size-virtual-scroll.ts","../src/cdk/scrolling/scroll-dispatcher.ts","../src/cdk/scrolling/scrollable.ts","../src/cdk/scrolling/viewport-ruler.ts","../src/cdk/scrolling/virtual-scrollable.ts","../src/cdk/scrolling/virtual-scroll-viewport.ts","../src/cdk/scrolling/virtual-scroll-viewport.html","../src/cdk/scrolling/virtual-for-of.ts","../src/cdk/scrolling/scrolling-module.ts","./node_modules/rxjs/src/internal/BehaviorSubject.ts","./node_modules/rxjs/src/internal/util/noop.ts","./node_modules/rxjs/src/internal/operators/tap.ts","./node_modules/rxjs/src/internal/operators/debounceTime.ts","./node_modules/rxjs/src/internal/operators/skip.ts","../src/cdk/observers/observe-content.ts","./node_modules/rxjs/src/internal/OuterSubscriber.ts","./node_modules/rxjs/src/internal/InnerSubscriber.ts","./node_modules/rxjs/src/internal/util/subscribeToResult.ts","./node_modules/rxjs/src/internal/observable/combineLatest.ts","./node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts","./node_modules/rxjs/src/internal/operators/take.ts","../src/cdk/layout/media-matcher.ts","../src/cdk/layout/breakpoints-observer.ts","../src/cdk/a11y/fake-event-detection.ts","../src/cdk/a11y/input-modality/input-modality-detector.ts","../src/cdk/keycodes/keycodes.ts","../src/cdk/a11y/aria-describer/aria-describer.ts","../src/cdk/a11y/focus-monitor/focus-monitor.ts","../src/cdk/a11y/high-contrast-mode/high-contrast-mode-detector.ts","../src/cdk/a11y/a11y-module.ts","./node_modules/rxjs/src/internal/observable/interval.ts","../src/cdk/drag-drop/dom/styling.ts","../src/cdk/drag-drop/dom/transition-duration.ts","../src/cdk/drag-drop/dom/client-rect.ts","../src/cdk/drag-drop/dom/parent-position-tracker.ts","../src/cdk/drag-drop/dom/clone-node.ts","../src/cdk/drag-drop/drag-ref.ts","../src/cdk/drag-drop/drag-utils.ts","../src/cdk/drag-drop/sorting/single-axis-sort-strategy.ts","../src/cdk/drag-drop/drop-list-ref.ts","../src/cdk/drag-drop/drag-drop-registry.ts","../src/cdk/drag-drop/drag-drop.ts","../src/cdk/drag-drop/drag-drop-module.ts","./node_modules/rxjs/src/internal/observable/forkJoin.ts","../packages/forms/src/directives/control_value_accessor.ts","../packages/forms/src/directives/default_value_accessor.ts","../packages/forms/src/validators.ts","../packages/forms/src/directives/abstract_control_directive.ts","../packages/forms/src/directives/control_container.ts","../packages/forms/src/directives/ng_control.ts","../packages/forms/src/directives/ng_control_status.ts","../packages/forms/src/directives/reactive_errors.ts","../packages/forms/src/model/abstract_model.ts","../packages/forms/src/model/form_group.ts","../packages/forms/src/directives/shared.ts","../packages/forms/src/directives/ng_form.ts","../packages/forms/src/util.ts","../packages/forms/src/model/form_control.ts","../packages/forms/src/directives/ng_model.ts","../packages/forms/src/directives/ng_no_validate_directive.ts","../packages/forms/src/directives/number_value_accessor.ts","../packages/forms/src/directives/radio_control_value_accessor.ts","../packages/forms/src/directives/reactive_directives/form_control_directive.ts","../packages/forms/src/directives/select_multiple_control_value_accessor.ts","../packages/forms/src/directives/validators.ts","../packages/forms/src/directives.ts","../packages/forms/src/form_providers.ts","./node_modules/rxjs/src/internal/observable/defer.ts","./node_modules/rxjs/src/internal/operators/concatMap.ts","./node_modules/@ngx-translate/core/fesm2020/ngx-translate-core.mjs","./node_modules/rxjs/src/internal/operators/mapTo.ts","./node_modules/tinymce-angular-component/src/main/ts/TinyMCE.ts","./node_modules/tinymce-angular-component/src/main/ts/editor/Events.ts","./node_modules/tinymce-angular-component/src/main/ts/utils/Utils.ts","./node_modules/tinymce-angular-component/src/main/ts/utils/ScriptLoader.ts","./node_modules/tinymce-angular-component/src/main/ts/editor/editor.component.ts","./node_modules/tinymce-angular-component/src/main/ts/editor/editor.module.ts","./node_modules/tslib/tslib.es6.js","./src/utils/trigger.class.ts","./src/utils/triggers.ts","./src/utils/facade/browser.ts","./src/utils/theme-provider.ts","./src/utils/decorators.ts","./src/utils/utils.class.ts","./src/alert/alert.component.html","./src/utils/warn-once.ts","./src/alert/alert.config.ts","./src/alert/alert.component.ts","./src/alert/alert.module.ts","../packages/animations/src/animation_builder.ts","../packages/animations/src/animation_metadata.ts","../packages/animations/src/util.ts","../packages/animations/src/players/animation_player.ts","../packages/animations/src/players/animation_group_player.ts","../packages/animations/src/private_export.ts","./src/collapse/collapse-animations.ts","./src/collapse/collapse.module.ts","./src/chronos/utils.ts","./src/chronos/utils/type-checks.ts","./src/chronos/units/aliases.ts","./src/chronos/units/constants.ts","./src/chronos/utils/zero-fill.ts","./src/chronos/format/format.ts","./src/chronos/create/date-from-array.ts","./src/chronos/utils/date-getters.ts","./src/chronos/parse/regex.ts","./src/chronos/parse/token.ts","./src/chronos/units/priorities.ts","./src/chronos/create/parsing-flags.ts","./src/chronos/units/year.ts","./src/chronos/units/month.ts","./src/chronos/utils/date-setters.ts","./src/chronos/create/clone.ts","./src/chronos/utils/start-end-of.ts","./src/chronos/units/day-of-week.ts","./src/chronos/moment/add-subtract.ts","./src/chronos/units/day-of-year.ts","./src/chronos/units/week-calendar-utils.ts","./src/chronos/locale/locale.class.ts","./src/chronos/locale/locale.defaults.ts","./src/chronos/locale/calendar.ts","./src/chronos/utils/compare-arrays.ts","./src/chronos/units/week-year.ts","./src/chronos/units/offset.ts","./src/chronos/locale/locales.ts","./src/chronos/units/week.ts","./src/chronos/units/timezone.ts","./src/chronos/units/timestamp.ts","./src/chronos/units/second.ts","./src/chronos/units/quarter.ts","./src/chronos/units/minute.ts","./src/chronos/units/millisecond.ts","./src/chronos/units/hour.ts","./src/chronos/units/day-of-month.ts","./src/chronos/duration/valid.ts","./src/chronos/utils/abs-ceil.ts","./src/chronos/duration/bubble.ts","./src/chronos/duration/humanize.ts","./src/chronos/duration/constructor.ts","./src/chronos/create/valid.ts","./src/chronos/create/from-string.ts","./src/chronos/format.ts","./src/chronos/utils/defaults.ts","./src/chronos/create/from-array.ts","./src/chronos/create/check-overflow.ts","./src/chronos/create/from-string-and-format.ts","./src/chronos/create/from-anything.ts","./src/chronos/create/from-string-and-array.ts","./src/chronos/create/from-object.ts","./src/chronos/create/local.ts","./src/chronos/utils/abs-round.ts","./src/chronos/utils/date-compare.ts","./src/chronos/duration/create.ts","./src/chronos/i18n/ar.ts","./src/chronos/i18n/bg.ts","./src/chronos/i18n/ca.ts","./src/chronos/i18n/cs.ts","./src/chronos/i18n/da.ts","./src/chronos/i18n/de.ts","./src/chronos/i18n/en-gb.ts","./src/chronos/i18n/es-do.ts","./src/chronos/i18n/es.ts","./src/chronos/i18n/es-pr.ts","./src/chronos/i18n/es-us.ts","./src/chronos/i18n/et.ts","./src/chronos/i18n/fi.ts","./src/chronos/i18n/fr.ts","./src/chronos/i18n/gl.ts","./src/chronos/i18n/he.ts","./src/chronos/i18n/hi.ts","./src/chronos/i18n/hu.ts","./src/chronos/i18n/hr.ts","./src/chronos/i18n/id.ts","./src/chronos/i18n/it.ts","./src/chronos/i18n/ja.ts","./src/chronos/i18n/ka.ts","./src/chronos/i18n/kk.ts","./src/chronos/i18n/ko.ts","./src/chronos/i18n/lt.ts","./src/chronos/i18n/lv.ts","./src/chronos/i18n/mn.ts","./src/chronos/i18n/nb.ts","./src/chronos/i18n/nl-be.ts","./src/chronos/i18n/nl.ts","./src/chronos/i18n/pl.ts","./src/chronos/i18n/pt-br.ts","./src/chronos/i18n/ro.ts","./src/chronos/i18n/ru.ts","./src/chronos/i18n/sk.ts","./src/chronos/i18n/sl.ts","./src/chronos/i18n/sq.ts","./src/chronos/i18n/sv.ts","./src/chronos/i18n/th.ts","./src/chronos/i18n/th-be.ts","./src/chronos/i18n/uk.ts","./src/chronos/i18n/tr.ts","./src/chronos/i18n/vi.ts","./src/chronos/i18n/zh-cn.ts","./src/positioning/models/index.ts","./src/positioning/utils/getStyleComputedProperty.ts","./src/positioning/utils/getOffsetParent.ts","./src/positioning/utils/getRoot.ts","./src/positioning/utils/findCommonOffsetParent.ts","./src/positioning/utils/isOffsetContainer.ts","./src/positioning/utils/getFixedPositionOffsetParent.ts","./src/positioning/utils/getBordersSize.ts","./src/positioning/utils/getWindowSizes.ts","./src/positioning/utils/getClientRect.ts","./src/positioning/utils/isNumeric.ts","./src/positioning/utils/getBoundingClientRect.ts","./src/positioning/utils/getParentNode.ts","./src/positioning/utils/getScrollParent.ts","./src/positioning/utils/getOffsetRectRelativeToArbitraryNode.ts","./src/positioning/utils/getScroll.ts","./src/positioning/utils/isFixed.ts","./src/positioning/utils/getBoundaries.ts","./src/positioning/utils/getViewportOffsetRectRelativeToArtbitraryNode.ts","./src/positioning/utils/computeAutoPlacement.ts","./src/positioning/utils/getOuterSizes.ts","./src/positioning/utils/getReferenceOffsets.ts","./src/positioning/utils/getTargetOffsets.ts","./src/positioning/utils/getOppositePlacement.ts","./src/positioning/utils/isModifierEnabled.ts","./src/positioning/utils/checkMargin.ts","./src/positioning/utils/setStyles.ts","./src/positioning/modifiers/arrow.ts","./src/positioning/modifiers/flip.ts","./src/positioning/utils/getOppositeVariation.ts","./src/positioning/modifiers/preventOverflow.ts","./src/positioning/modifiers/shift.ts","./src/positioning/ng-positioning.ts","./src/positioning/modifiers/initData.ts","./src/positioning/utils/getOffsets.ts","./src/positioning/utils/updateContainerClass.ts","./src/positioning/positioning.service.ts","./node_modules/rxjs/src/internal/operators/scan.ts","./src/mini-ngrx/state.class.ts","./src/mini-ngrx/store.class.ts","./src/timepicker/timepicker.component.html","./src/timepicker/reducer/timepicker.actions.ts","./src/timepicker/timepicker.utils.ts","./src/timepicker/timepicker-controls.util.ts","./src/timepicker/timepicker.config.ts","./src/timepicker/reducer/timepicker.reducer.ts","./src/timepicker/reducer/timepicker.store.ts","./src/timepicker/timepicker.component.ts","./src/timepicker/timepicker.module.ts","./src/component-loader/content-ref.class.ts","./src/component-loader/component-loader.class.ts","./src/component-loader/component-loader.factory.ts","./src/tooltip/tooltip.config.ts","./src/tooltip/tooltip-container.component.ts","./src/tooltip/tooltip.directive.ts","./src/tooltip/tooltip.module.ts","./src/datepicker/bs-datepicker.config.ts","./src/datepicker/themes/bs/bs-datepicker-view.html","./src/datepicker/datepicker-animations.ts","./src/datepicker/base/bs-datepicker-container.ts","./src/datepicker/reducer/bs-datepicker.actions.ts","./src/datepicker/bs-locale.service.ts","./src/datepicker/reducer/bs-datepicker.effects.ts","./src/datepicker/reducer/bs-datepicker.state.ts","./src/datepicker/reducer/_defaults.ts","./src/datepicker/utils/bs-calendar-utils.ts","./src/datepicker/utils/matrix-utils.ts","./src/datepicker/engine/calc-days-calendar.ts","./src/datepicker/engine/format-days-calendar.ts","./src/datepicker/engine/view-mode.ts","./src/datepicker/engine/format-months-calendar.ts","./src/datepicker/engine/format-years-calendar.ts","./src/datepicker/utils/copy-time-utils.ts","./src/datepicker/reducer/bs-datepicker.reducer.ts","./src/datepicker/engine/flag-days-calendar.ts","./src/datepicker/engine/flag-months-calendar.ts","./src/datepicker/engine/flag-years-calendar.ts","./src/datepicker/reducer/bs-datepicker.store.ts","./src/datepicker/themes/bs/bs-custom-dates-view.component.ts","./src/datepicker/models/index.ts","./src/datepicker/themes/bs/bs-current-date-view.component.ts","./src/datepicker/themes/bs/bs-timepicker-view.component.ts","./src/datepicker/themes/bs/bs-calendar-layout.component.ts","./src/datepicker/themes/bs/bs-datepicker-day-decorator.directive.ts","./src/datepicker/themes/bs/bs-datepicker-navigation-view.component.ts","./src/datepicker/themes/bs/bs-days-calendar-view.component.ts","./src/datepicker/themes/bs/bs-months-calendar-view.component.ts","./src/datepicker/themes/bs/bs-years-calendar-view.component.ts","./src/datepicker/themes/bs/bs-datepicker-container.component.ts","./src/datepicker/bs-datepicker.component.ts","./src/datepicker/themes/bs/bs-daterangepicker-container.component.ts","./src/datepicker/bs-datepicker-input.directive.ts","./src/datepicker/bs-daterangepicker.config.ts","./src/datepicker/bs-daterangepicker.component.ts","./src/datepicker/bs-daterangepicker-input.directive.ts","./src/focus-trap/platform.ts","./src/datepicker/bs-datepicker.module.ts","./src/focus-trap/focus-trap-manager.ts","./src/focus-trap/interactivity-checker.ts","./src/focus-trap/boolean-property.ts","./src/focus-trap/focus-trap.ts","./src/focus-trap/focus-trap.module.ts","./src/modal/bs-modal-ref.service.ts","./src/modal/modal-options.class.ts","./src/modal/modal-container.component.ts","./src/modal/modal-backdrop.component.ts","./src/modal/bs-modal.service.ts","./src/modal/modal.module.ts","./src/pagination/pagination.config.ts","./src/pagination/pagination.component.html","./src/pagination/pager.component.ts","./src/pagination/pager.component.html","./src/pagination/pagination.component.ts","./src/pagination/pagination.module.ts","./src/tabs/tabs.module.ts","./projects/ngx-toasta/src/lib/toasta.utils.ts","./projects/ngx-toasta/src/lib/toasta.service.ts","./projects/ngx-toasta/src/lib/toasta.module.ts","../src/material/core/common-behaviors/common-module.ts","../src/material/core/common-behaviors/disabled.ts","../src/material/core/common-behaviors/color.ts","../src/material/core/common-behaviors/disable-ripple.ts","../src/material/core/datetime/index.ts","../src/material/core/error/error-options.ts","../src/material/core/ripple/ripple-ref.ts","../src/material/core/ripple/ripple-event-manager.ts","../src/material/core/ripple/ripple-renderer.ts","../src/material/core/ripple/ripple.ts","../src/material/core/ripple/index.ts","../src/material/core/selection/pseudo-checkbox/pseudo-checkbox-module.ts","../src/material/legacy-core/option/index.ts","../src/cdk/portal/portal.ts","../src/cdk/portal/dom-portal-outlet.ts","../src/cdk/portal/portal-directives.ts","../src/cdk/overlay/scroll/block-scroll-strategy.ts","../src/cdk/overlay/scroll/close-scroll-strategy.ts","../src/cdk/overlay/scroll/noop-scroll-strategy.ts","../src/cdk/overlay/position/scroll-clip.ts","../src/cdk/overlay/scroll/reposition-scroll-strategy.ts","../src/cdk/overlay/scroll/scroll-strategy-options.ts","../src/cdk/overlay/overlay-config.ts","../src/cdk/overlay/position/connected-position.ts","../src/cdk/overlay/dispatchers/base-overlay-dispatcher.ts","../src/cdk/overlay/dispatchers/overlay-keyboard-dispatcher.ts","../src/cdk/overlay/dispatchers/overlay-outside-click-dispatcher.ts","../src/cdk/overlay/overlay-container.ts","../src/cdk/overlay/overlay-ref.ts","../src/cdk/overlay/position/flexible-connected-position-strategy.ts","../src/cdk/overlay/position/global-position-strategy.ts","../src/cdk/overlay/position/overlay-position-builder.ts","../src/cdk/overlay/overlay.ts","../src/cdk/overlay/overlay-directives.ts","../src/cdk/overlay/overlay-module.ts","../src/material/autocomplete/autocomplete-trigger.ts","../src/material/legacy-autocomplete/autocomplete-trigger.ts","../src/material/legacy-autocomplete/autocomplete-module.ts","../src/material/legacy-button/button.ts","../src/material/legacy-button/button.html","../src/material/legacy-button/button-module.ts","../src/material/legacy-card/card-module.ts","../src/material/checkbox/checkbox.ts","../src/material/checkbox/module.ts","../src/material/legacy-checkbox/checkbox.ts","../src/material/legacy-checkbox/checkbox-module.ts","../src/material/legacy-chips/chip-default-options.ts","../src/material/legacy-chips/chip-list.ts","../src/material/legacy-chips/chips-module.ts","../src/material/divider/divider-module.ts","../src/cdk/accordion/accordion.ts","../src/cdk/accordion/accordion-module.ts","../src/material/expansion/expansion-panel-header.ts","../src/material/expansion/expansion-module.ts","../src/material/expansion/expansion-panel-content.ts","../src/material/legacy-form-field/form-field.ts","../src/material/legacy-form-field/form-field-module.ts","../src/material/legacy-form-field/error.ts","./node_modules/rxjs/src/internal/operators/finalize.ts","../packages/common/http/src/backend.ts","../packages/common/http/src/headers.ts","../packages/common/http/src/params.ts","../packages/common/http/src/context.ts","../packages/common/http/src/request.ts","../packages/common/http/src/response.ts","../packages/common/http/src/client.ts","../packages/common/http/src/interceptor.ts","../packages/common/http/src/xhr.ts","../packages/common/http/src/xsrf.ts","../packages/common/http/src/provider.ts","../packages/common/http/src/module.ts","../src/material/icon/icon.ts","../src/material/icon/icon-module.ts","../src/material/icon/icon-registry.ts","../src/cdk/text-field/autofill.ts","../src/cdk/text-field/text-field-module.ts","../src/material/input/input.ts","../src/material/legacy-input/input-module.ts","../src/material/menu/menu-trigger.ts","../src/material/legacy-menu/menu-item.html","../src/material/legacy-menu/menu-module.ts","../src/material/legacy-menu/menu.ts","../src/material/legacy-radio/radio.ts","../src/material/legacy-radio/radio-module.ts","../src/material/select/select.ts","../src/material/legacy-select/select.ts","../src/material/legacy-select/select-module.ts","../src/material/legacy-snack-bar/snack-bar-module.ts","../src/material/legacy-snack-bar/simple-snack-bar.ts","../src/cdk/table/table-module.ts","../src/material/legacy-table/table-module.ts","../src/material/tooltip/tooltip.ts","../src/material/legacy-tooltip/tooltip.ts","../src/material/legacy-tooltip/tooltip-module.ts","../src/material/legacy-tabs/tabs-module.ts","../src/material/legacy-slider/slider-module.ts","../src/material/legacy-slider/slider.ts","./node_modules/rxjs/src/internal/operators/skipWhile.ts","./node_modules/rxjs/src/internal/operators/withLatestFrom.ts","./source/WebCommon/projects/webcommon/shared/ap-base-class/ap-base-class.ts","./source/WebCommon/projects/webcommon/shared/errors/throwAsyncError.ts","./source/WebCommon/projects/webcommon/shared/constants/SystemGuid.ts","./source/WebCommon/projects/webcommon/shared/helpers/Guid.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApDocumentType.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApDocumentBase.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApAudioDocument.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApHtmlDocument.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApImageDocument.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApPdfDocument.ts","./source/WebCommon/projects/webcommon/shared/models/core-ui/ApTextDocument.ts","./source/WebCommon/projects/webcommon/shared/models/webapi/Attachments/FoxitLicenseDto.ts","./source/WebCommon/projects/webcommon/shared/models/webapi/Versions/ServerFeature.ts","./source/WebCommon/projects/webcommon/shared/models/patient/patientdemographics/PatientDemographicsDto.ts","./source/WebCommon/projects/webcommon/shared/ng-zone/NgZoneService.ts","./node_modules/lodash-es/eq.js","./node_modules/lodash-es/_assocIndexOf.js","./node_modules/lodash-es/_listCacheDelete.js","./node_modules/lodash-es/_ListCache.js","./node_modules/lodash-es/_listCacheClear.js","./node_modules/lodash-es/_listCacheGet.js","./node_modules/lodash-es/_listCacheHas.js","./node_modules/lodash-es/_listCacheSet.js","./node_modules/lodash-es/_freeGlobal.js","./node_modules/lodash-es/_root.js","./node_modules/lodash-es/_Symbol.js","./node_modules/lodash-es/_getRawTag.js","./node_modules/lodash-es/_objectToString.js","./node_modules/lodash-es/_baseGetTag.js","./node_modules/lodash-es/isObject.js","./node_modules/lodash-es/isFunction.js","./node_modules/lodash-es/_coreJsData.js","./node_modules/lodash-es/_isMasked.js","./node_modules/lodash-es/_toSource.js","./node_modules/lodash-es/_baseIsNative.js","./node_modules/lodash-es/_getNative.js","./node_modules/lodash-es/_getValue.js","./node_modules/lodash-es/_Map.js","./node_modules/lodash-es/_nativeCreate.js","./node_modules/lodash-es/_hashGet.js","./node_modules/lodash-es/_hashHas.js","./node_modules/lodash-es/_Hash.js","./node_modules/lodash-es/_hashClear.js","./node_modules/lodash-es/_hashDelete.js","./node_modules/lodash-es/_hashSet.js","./node_modules/lodash-es/_getMapData.js","./node_modules/lodash-es/_isKeyable.js","./node_modules/lodash-es/_MapCache.js","./node_modules/lodash-es/_mapCacheClear.js","./node_modules/lodash-es/_mapCacheDelete.js","./node_modules/lodash-es/_mapCacheGet.js","./node_modules/lodash-es/_mapCacheHas.js","./node_modules/lodash-es/_mapCacheSet.js","./node_modules/lodash-es/_Stack.js","./node_modules/lodash-es/_stackClear.js","./node_modules/lodash-es/_stackDelete.js","./node_modules/lodash-es/_stackGet.js","./node_modules/lodash-es/_stackHas.js","./node_modules/lodash-es/_stackSet.js","./node_modules/lodash-es/_defineProperty.js","./node_modules/lodash-es/_baseAssignValue.js","./node_modules/lodash-es/_assignValue.js","./node_modules/lodash-es/_copyObject.js","./node_modules/lodash-es/isObjectLike.js","./node_modules/lodash-es/_baseIsArguments.js","./node_modules/lodash-es/isArguments.js","./node_modules/lodash-es/isArray.js","./node_modules/lodash-es/isBuffer.js","./node_modules/lodash-es/stubFalse.js","./node_modules/lodash-es/_isIndex.js","./node_modules/lodash-es/isLength.js","./node_modules/lodash-es/_baseIsTypedArray.js","./node_modules/lodash-es/_baseUnary.js","./node_modules/lodash-es/_nodeUtil.js","./node_modules/lodash-es/isTypedArray.js","./node_modules/lodash-es/_arrayLikeKeys.js","./node_modules/lodash-es/_baseTimes.js","./node_modules/lodash-es/_isPrototype.js","./node_modules/lodash-es/_overArg.js","./node_modules/lodash-es/_nativeKeys.js","./node_modules/lodash-es/_baseKeys.js","./node_modules/lodash-es/isArrayLike.js","./node_modules/lodash-es/keys.js","./node_modules/lodash-es/_baseKeysIn.js","./node_modules/lodash-es/_nativeKeysIn.js","./node_modules/lodash-es/keysIn.js","./node_modules/lodash-es/_cloneBuffer.js","./node_modules/lodash-es/stubArray.js","./node_modules/lodash-es/_getSymbols.js","./node_modules/lodash-es/_arrayFilter.js","./node_modules/lodash-es/_arrayPush.js","./node_modules/lodash-es/_getPrototype.js","./node_modules/lodash-es/_getSymbolsIn.js","./node_modules/lodash-es/_baseGetAllKeys.js","./node_modules/lodash-es/_getAllKeys.js","./node_modules/lodash-es/_getAllKeysIn.js","./node_modules/lodash-es/_DataView.js","./node_modules/lodash-es/_Promise.js","./node_modules/lodash-es/_Set.js","./node_modules/lodash-es/_WeakMap.js","./node_modules/lodash-es/_getTag.js","./node_modules/lodash-es/_initCloneArray.js","./node_modules/lodash-es/_Uint8Array.js","./node_modules/lodash-es/_cloneArrayBuffer.js","./node_modules/lodash-es/_cloneRegExp.js","./node_modules/lodash-es/_cloneSymbol.js","./node_modules/lodash-es/_initCloneByTag.js","./node_modules/lodash-es/_cloneDataView.js","./node_modules/lodash-es/_cloneTypedArray.js","./node_modules/lodash-es/_baseCreate.js","./node_modules/lodash-es/isMap.js","./node_modules/lodash-es/_baseIsMap.js","./node_modules/lodash-es/isSet.js","./node_modules/lodash-es/_baseIsSet.js","./node_modules/lodash-es/_baseClone.js","./node_modules/lodash-es/_copyArray.js","./node_modules/lodash-es/_initCloneObject.js","./node_modules/lodash-es/_copySymbolsIn.js","./node_modules/lodash-es/_baseAssignIn.js","./node_modules/lodash-es/_copySymbols.js","./node_modules/lodash-es/_baseAssign.js","./node_modules/lodash-es/_arrayEach.js","./node_modules/lodash-es/cloneDeep.js","./node_modules/lodash-es/_baseRepeat.js","./node_modules/lodash-es/_arrayMap.js","./node_modules/lodash-es/isSymbol.js","./node_modules/lodash-es/_baseToString.js","./node_modules/lodash-es/_castSlice.js","./node_modules/lodash-es/_baseSlice.js","./node_modules/lodash-es/_hasUnicode.js","./node_modules/lodash-es/_baseProperty.js","./node_modules/lodash-es/_asciiSize.js","./node_modules/lodash-es/_unicodeSize.js","./node_modules/lodash-es/_stringSize.js","./node_modules/lodash-es/_unicodeToArray.js","./node_modules/lodash-es/_stringToArray.js","./node_modules/lodash-es/_asciiToArray.js","./node_modules/lodash-es/_createPadding.js","./node_modules/lodash-es/_trimmedEndIndex.js","./node_modules/lodash-es/_baseTrim.js","./node_modules/lodash-es/toNumber.js","./node_modules/lodash-es/toFinite.js","./node_modules/lodash-es/toString.js","./node_modules/lodash-es/pad.js","./node_modules/lodash-es/toInteger.js","./node_modules/lodash-es/_baseFor.js","./node_modules/lodash-es/_createBaseFor.js","./node_modules/lodash-es/_baseForOwn.js","./node_modules/lodash-es/_SetCache.js","./node_modules/lodash-es/_setCacheAdd.js","./node_modules/lodash-es/_setCacheHas.js","./node_modules/lodash-es/_arraySome.js","./node_modules/lodash-es/_cacheHas.js","./node_modules/lodash-es/_equalArrays.js","./node_modules/lodash-es/_mapToArray.js","./node_modules/lodash-es/_setToArray.js","./node_modules/lodash-es/_equalByTag.js","./node_modules/lodash-es/_equalObjects.js","./node_modules/lodash-es/_baseIsEqualDeep.js","./node_modules/lodash-es/_baseIsEqual.js","./node_modules/lodash-es/_baseIsMatch.js","./node_modules/lodash-es/_isStrictComparable.js","./node_modules/lodash-es/_matchesStrictComparable.js","./node_modules/lodash-es/_baseMatches.js","./node_modules/lodash-es/_getMatchData.js","./node_modules/lodash-es/_isKey.js","./node_modules/lodash-es/memoize.js","./node_modules/lodash-es/_stringToPath.js","./node_modules/lodash-es/_memoizeCapped.js","./node_modules/lodash-es/_castPath.js","./node_modules/lodash-es/_toKey.js","./node_modules/lodash-es/_baseGet.js","./node_modules/lodash-es/_baseHasIn.js","./node_modules/lodash-es/_hasPath.js","./node_modules/lodash-es/_baseMatchesProperty.js","./node_modules/lodash-es/get.js","./node_modules/lodash-es/hasIn.js","./node_modules/lodash-es/identity.js","./node_modules/lodash-es/property.js","./node_modules/lodash-es/_basePropertyDeep.js","./node_modules/lodash-es/_baseIteratee.js","./node_modules/lodash-es/mapValues.js","./node_modules/lodash-es/_apply.js","./node_modules/lodash-es/_overRest.js","./node_modules/lodash-es/constant.js","./node_modules/lodash-es/_baseSetToString.js","./node_modules/lodash-es/_shortOut.js","./node_modules/lodash-es/_setToString.js","./node_modules/lodash-es/_baseRest.js","./node_modules/lodash-es/_isIterateeCall.js","./node_modules/lodash-es/assign.js","./node_modules/lodash-es/_createAssigner.js","./node_modules/lodash-es/defaults.js","./node_modules/lodash-es/_baseEach.js","./node_modules/lodash-es/_baseIsNaN.js","./node_modules/lodash-es/_arrayIncludes.js","./node_modules/lodash-es/_baseIndexOf.js","./node_modules/lodash-es/_strictIndexOf.js","./node_modules/lodash-es/_baseFindIndex.js","./node_modules/lodash-es/_arrayIncludesWith.js","./node_modules/lodash-es/_baseIntersection.js","./node_modules/lodash-es/_castArrayLikeObject.js","./node_modules/lodash-es/isArrayLikeObject.js","./node_modules/lodash-es/intersection.js","./source/WebCommon/node_modules/cachefactory/src/BinaryHeap.js","./source/WebCommon/node_modules/cachefactory/src/defaults.js","./source/WebCommon/node_modules/cachefactory/src/utils.js","./source/WebCommon/node_modules/cachefactory/src/Cache.js","./source/WebCommon/node_modules/cachefactory/src/CacheFactory.js","./source/WebCommon/node_modules/cachefactory/src/index.js","./node_modules/@ngx-translate/http-loader/fesm2020/ngx-translate-http-loader.mjs","./source/WebCommon/projects/webcommon/legacy-common/http-interceptors/context-tokens.ts","./source/WebCommon/projects/webcommon/legacy-common/http-interceptors/webcommon-http-interceptors.ts","./source/WebCommon/projects/webcommon/legacy-common/http-interceptors/cache.interceptor.ts","./source/WebCommon/projects/webcommon/legacy-common/services/AppRouteService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/BridgeService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/AprimaAnalyticsService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/ObjUtilService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/AprimaCacheService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/BrowserService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/ConfigurationRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/IStorageRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/StorageInMemoryRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/StoragePerSessionRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/StorageAcrossSessionRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/WebCommonStorageRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/AprimaHttpClientService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/AprimaTranslateLoader.ts","./source/WebCommon/projects/webcommon/legacy-common/services/DeviceSettingsRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/LogInService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/LogOffService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/TransitionManagerService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/CurrentUserService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/ErrorServiceUpgrade.ts","./source/WebCommon/projects/webcommon/legacy-common/services/ServerInfoRepository.ts","./source/WebCommon/projects/webcommon/legacy-common/services/UrlParsingService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/WebViewManagerService.ts","./source/WebCommon/projects/webcommon/legacy-common/services/fnc/ScopeProvider.ts","./source/WebCommon/projects/webcommon/legacy-common/services/utilities/UnitConversionServiceUpgrade.ts","./source/WebCommon/projects/webcommon/webapi/services/PrmHttpClientService.ts","./source/WebCommon/projects/webcommon/webapi/services/Common/AttachmentRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/Common/FoxitLicenseRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/PatientPortalHttpClientService.ts","./source/WebCommon/projects/webcommon/webapi/services/Common/PatientPortalAttachmentRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/Common/ProviderRespository.ts","./source/WebCommon/projects/webcommon/webapi/services/Lists/ListRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/PatientPortal/BillingRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/PatientPortal/LoginAssistanceRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/PatientPortal/TelehealthRepository.ts","./source/WebCommon/projects/webcommon/webapi/services/PatientPortal/PatientIdentityRepository.ts","./node_modules/rxjs/src/internal/observable/fromEventPattern.ts","./source/WebCommon/projects/webcommon/common-api/services/bridge/HostedBridgeService.ts","./source/WebCommon/projects/webcommon/common-api/services/bridge/WebBridgeService.ts","./source/WebCommon/projects/webcommon/foxit/FoxitUtil.ts","./source/WebCommon/projects/webcommon/runtime-info/RuntimeUtils.ts","./source/WebCommon/projects/webcommon/core-ui/ap-base-component/ap-base-component.ts","./source/WebCommon/projects/webcommon/core-ui/ap-base-component/ap-base-directive.ts","./source/WebCommon/projects/webcommon/core-ui/services/ViewportService.ts","./source/WebCommon/projects/webcommon/core-ui/services/SpinnerService.ts","./source/WebCommon/projects/webcommon/core-ui/services/StyleService.ts","./source/WebCommon/projects/webcommon/core-ui/directives/ap-spinner.directive.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApActiveModal.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApModalHelper.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApModalHelperFactory.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ap-base-modal.component.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApModalReason.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApModalResult.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ap-complex-modal.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApModalComponentOptions.ts","./source/WebCommon/projects/webcommon/core-ui/modals/ApModalService.ts","./source/WebCommon/projects/webcommon/core-ui/directives/ap-color-border.directive.ts","./source/WebCommon/projects/webcommon/core-ui/directives/ap-zoomable.directive.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/pdfs/ap-pdf.component.html","./source/WebCommon/projects/webcommon/core-ui/document-viewing/pdfs/ap-pdf.component.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/IosDocumentHelper.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/WebDocumentHelper.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/DefaultDocumentHelper.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/DocumentHelperBase.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/DocumentService.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/pdfs/FoxitPdfRenderer.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/pdfs/PdfRendererFactory.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/pdfs/ap-sign-pdf.component.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/pdfs/ap-sign-pdf.component.html","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-image-viewer.component.html","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-image-viewer.component.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-document-viewer.component.html","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-document-viewer.component.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-save-to-file.directive.ts","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-enhanced-document-viewer.component.html","./source/WebCommon/projects/webcommon/core-ui/document-viewing/ap-enhanced-document-viewer.component.ts","./source/WebCommon/projects/webcommon/core-ui/core-ui.module.ts","./source/WebCommon/projects/webcommon/core-ui/hammer/BaseHammerConfig.ts","./source/web/src/app/core/components/ap-payment-frame.ts","./source/web/src/app/core/components/ap-payment-frame.component.html","./source/web/src/app/core/services/ContentAttributeServiceUpgrade.ts","./source/web/src/environments/environment.prod.ts","./source/web/src/environments/base-environment.ts","./source/web/src/app/core/services/PatientPortalConfigurationRepository.ts","./source/WebCommon/projects/webcommon/ajs/services/BrowserWebViewManagerJs.ts","./source/WebCommon/projects/webcommon/ajs/services/TransitionManagerJs.ts","./source/WebCommon/projects/webcommon/ajs/services/XamarinWebViewManagerJs.ts","./source/WebCommon/projects/webcommon/ajs/force-load-angular.component.ts","./source/WebCommon/projects/webcommon/ajs/ajs.module.ts","./source/WebCommon/projects/webcommon/patient/documents/patient-portal/patient-document-viewer-modal/patient-document-viewer-modal.component.ts","./source/WebCommon/projects/webcommon/patient/documents/patient-portal/patient-document-viewer-modal/patient-document-viewer-modal.component.html","./source/WebCommon/projects/webcommon/patient/documents/patient-portal/patient-document-viewer-modal/patient-document-viewer-modal.service.ts","./source/WebCommon/projects/webcommon/patient/documents/patient-portal/file-extension.pipe.ts","./source/WebCommon/projects/webcommon/patient/documents/patient-portal/patient-documents.component.html","./source/WebCommon/projects/webcommon/patient/documents/patient-portal/patient-documents.component.ts","../src/cdk/clipboard/pending-copy.ts","../src/cdk/clipboard/clipboard.ts","./source/web/src/app/dashboard/third-party/ap-personal-health-apps-modal.component.html","./source/web/src/app/dashboard/third-party/ap-personal-health-apps-modal.component.ts","./source/web/src/app/dashboard/third-party/ap-personal-health-apps-modal.service.ts","./source/web/src/app/ajs/ajs.module.ts","./source/web/src/app/core/core.module.ts","./node_modules/@uirouter/rx/lib-esm/@uirouter/rx/ui-router-rx.ts","./node_modules/@uirouter/src/statebuilders/views.ts","./node_modules/@uirouter/src/mergeInjector.ts","./node_modules/@uirouter/src/directives/uiView.ts","./node_modules/@uirouter/src/directives/directives.ts","./node_modules/@uirouter/src/injectionTokens.ts","./node_modules/@uirouter/src/uiRouterConfig.ts","./node_modules/@uirouter/src/lazyLoad/lazyLoadNgModule.ts","./node_modules/@uirouter/src/statebuilders/lazyLoad.ts","./node_modules/@uirouter/src/location/locationService.ts","./node_modules/@uirouter/src/location/locationConfig.ts","./node_modules/@uirouter/src/providers.ts","./node_modules/@uirouter/src/uiRouterNgModule.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/angular.ts","./node_modules/@uirouter/angularjs/lib-esm/statebuilders/@uirouter/angularjs/statebuilders/views.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/templateFactory.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/stateProvider.ts","./node_modules/@uirouter/angularjs/lib-esm/statebuilders/@uirouter/angularjs/statebuilders/onEnterExitRetain.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/locationServices.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/urlRouterProvider.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/services.ts","./node_modules/@uirouter/angularjs/lib-esm/directives/@uirouter/angularjs/directives/stateDirectives.ts","./node_modules/@uirouter/angularjs/lib-esm/directives/@uirouter/angularjs/directives/viewDirective.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/stateFilters.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/viewScroll.ts","./node_modules/@uirouter/angularjs/lib-esm/@uirouter/angularjs/index.ts","./node_modules/@uirouter/src/angular-hybrid.ts","./source/web/src/app/login/contact-us/contact-us.component.html","./source/web/src/app/login/contact-us/contact-us.component.ts","./source/web/src/app/login/login.module.ts","./source/web/src/app/telehealth/th-login/th-login.component.html","./source/web/src/app/telehealth/th-login/th-login.component.ts","./source/web/src/app/telehealth/th-payment/th-payment-summary.component.html","./source/web/src/app/telehealth/th-payment/th-payment-summary.component.ts","./source/web/src/app/telehealth/th-payment/th-payment.component.html","./source/web/src/app/telehealth/th-payment/th-payment.component.ts","./source/web/src/app/telehealth/telehealth.module.ts","./source/web/src/app/dashboard/dashboard.module.ts","./source/web/src/app/conditional.module.prod.ts","../packages/animations/browser/src/error_helpers.ts","../packages/animations/browser/src/render/shared.ts","../packages/animations/browser/src/render/animation_driver.ts","../packages/animations/browser/src/util.ts","../packages/animations/browser/src/dsl/animation_transition_expr.ts","../packages/animations/browser/src/dsl/animation_ast_builder.ts","../packages/animations/browser/src/dsl/animation_timeline_instruction.ts","../packages/animations/browser/src/dsl/element_instruction_map.ts","../packages/animations/browser/src/dsl/animation_timeline_builder.ts","../packages/animations/browser/src/dsl/style_normalization/animation_style_normalizer.ts","../packages/animations/browser/src/dsl/style_normalization/web_animations_style_normalizer.ts","../packages/animations/browser/src/dsl/animation_transition_instruction.ts","../packages/animations/browser/src/dsl/animation_transition_factory.ts","../packages/animations/browser/src/dsl/animation_trigger.ts","../packages/animations/browser/src/render/timeline_animation_engine.ts","../packages/animations/browser/src/render/transition_animation_engine.ts","../packages/animations/browser/src/render/animation_engine_next.ts","../packages/animations/browser/src/render/special_cased_styles.ts","../packages/animations/browser/src/render/web_animations/web_animations_player.ts","../packages/animations/browser/src/render/web_animations/web_animations_driver.ts","../packages/platform-browser/animations/src/animation_builder.ts","../packages/platform-browser/animations/src/animation_renderer.ts","../packages/platform-browser/animations/src/providers.ts","../packages/platform-browser/animations/src/module.ts","./source/WebCommon/projects/webcommon/src/lib/webcommon.module.ts","./source/web/src/app/app.module.ts","./source/web/src/main.ts","./node_modules/moment/locale/ sync \\b\\B"],"sourcesContent":["const POLYFILL_CONSOLE_OUTPUT = 'function ResizeObserver () { [polyfill code] }';\nconst prettifyConsoleOutput = (fn) => {\n fn.toString = function () {\n return POLYFILL_CONSOLE_OUTPUT;\n };\n return fn;\n};\nexport { POLYFILL_CONSOLE_OUTPUT, prettifyConsoleOutput };\n","import { process } from '../ResizeObserverController';\nimport { prettifyConsoleOutput } from './prettify';\nconst CATCH_FRAMES = 60 / 5;\nconst requestAnimationFrame = window.requestAnimationFrame;\nconst observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };\nconst events = [\n 'resize',\n 'load',\n 'transitionend',\n 'animationend',\n 'animationstart',\n 'animationiteration',\n 'keyup',\n 'keydown',\n 'mouseup',\n 'mousedown',\n 'mouseover',\n 'mouseout',\n 'blur',\n 'focus'\n];\nconst rafSlot = new Map();\nconst resizeObserverSlot = new Map();\nlet scheduled;\nconst dispatchCallbacksOnNextFrame = () => {\n if (scheduled) {\n return;\n }\n scheduled = true;\n function runSchedule(t) {\n scheduled = false;\n const frameCallbacks = [];\n const resizeObserverCallbacks = [];\n rafSlot.forEach(callback => frameCallbacks.push(callback));\n resizeObserverSlot.forEach(callback => resizeObserverCallbacks.push(callback));\n rafSlot.clear();\n resizeObserverSlot.clear();\n try {\n for (let callback of frameCallbacks) {\n callback(t);\n }\n }\n finally {\n for (let callback of resizeObserverCallbacks) {\n callback(t);\n }\n }\n }\n ;\n requestAnimationFrame(runSchedule);\n};\nclass Scheduler {\n constructor() {\n this.stopped = true;\n this.listener = () => this.schedule();\n }\n run(frames) {\n const scheduler = this;\n resizeObserverSlot.set(this, function ResizeObserver() {\n let elementsHaveResized = false;\n try {\n elementsHaveResized = process();\n }\n finally {\n if (elementsHaveResized) {\n scheduler.run(60);\n }\n else if (frames) {\n scheduler.run(frames - 1);\n }\n else {\n scheduler.start();\n }\n }\n });\n dispatchCallbacksOnNextFrame();\n }\n schedule() {\n this.stop();\n this.run(CATCH_FRAMES);\n }\n observe() {\n const cb = () => this.observer && this.observer.observe(document.body, observerConfig);\n document.body ? cb() : window.addEventListener('DOMContentLoaded', cb);\n }\n start() {\n if (this.stopped) {\n this.stopped = false;\n if ('MutationObserver' in window) {\n this.observer = new MutationObserver(this.listener);\n this.observe();\n }\n events.forEach(name => window.addEventListener(name, this.listener, true));\n }\n }\n stop() {\n if (!this.stopped) {\n this.observer && this.observer.disconnect();\n events.forEach(name => window.removeEventListener(name, this.listener, true));\n this.stopped = true;\n }\n }\n}\nconst scheduler = new Scheduler();\nlet rafIdBase = 0;\nwindow.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new Error('requestAnimationFrame expects 1 callback argument of type function.');\n }\n const handle = rafIdBase += 1;\n rafSlot.set(handle, function AnimationFrame(t) { return callback(t); });\n dispatchCallbacksOnNextFrame();\n return handle;\n};\nwindow.cancelAnimationFrame = function (handle) {\n rafSlot.delete(handle);\n};\nprettifyConsoleOutput(window.requestAnimationFrame);\nprettifyConsoleOutput(window.cancelAnimationFrame);\nexport { scheduler };\n","var ResizeObserverBoxOptions;\n(function (ResizeObserverBoxOptions) {\n ResizeObserverBoxOptions[\"BORDER_BOX\"] = \"border-box\";\n ResizeObserverBoxOptions[\"CONTENT_BOX\"] = \"content-box\";\n ResizeObserverBoxOptions[\"SCROLL_BOX\"] = \"scroll-box\";\n ResizeObserverBoxOptions[\"DEVICE_PIXEL_BORDER_BOX\"] = \"device-pixel-border-box\";\n})(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));\nexport { ResizeObserverBoxOptions };\n","class DOMRectReadOnly {\n constructor(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.top = this.y;\n this.left = this.x;\n this.bottom = this.top + this.height;\n this.right = this.left + this.width;\n return Object.freeze(this);\n }\n static fromRect(rectangle) {\n return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n }\n}\nexport { DOMRectReadOnly };\n","const isSVG = (target) => target instanceof SVGElement && 'getBBox' in target;\nconst isHidden = (target) => {\n if (isSVG(target)) {\n const { width, height } = target.getBBox();\n return !width && !height;\n }\n const { offsetWidth, offsetHeight } = target;\n return !(offsetWidth || offsetHeight || target.getClientRects().length);\n};\nexport { isSVG, isHidden };\n","import { ResizeObserverBoxOptions } from '../ResizeObserverBoxOptions';\nimport { DOMRectReadOnly } from '../DOMRectReadOnly';\nimport { isSVG, isHidden } from '../utils/element';\nconst cache = new Map();\nconst scrollRegexp = /auto|scroll/;\nconst IE = (/msie|trident/i).test(navigator.userAgent);\nconst parseDimension = (pixel) => parseFloat(pixel || '0');\nconst size = (inlineSize = 0, blockSize = 0) => {\n return Object.freeze({ inlineSize, blockSize });\n};\nconst zeroBoxes = Object.freeze({\n borderBoxSize: size(),\n contentBoxSize: size(),\n scrollBoxSize: size(),\n devicePixelBorderBoxSize: size(),\n contentRect: new DOMRectReadOnly(0, 0, 0, 0)\n});\nconst calculateBoxSizes = (target) => {\n if (cache.has(target)) {\n return cache.get(target);\n }\n if (isHidden(target)) {\n cache.set(target, zeroBoxes);\n return zeroBoxes;\n }\n const cs = getComputedStyle(target);\n const dpr = window.devicePixelRatio;\n const svg = isSVG(target) && target.getBBox();\n const removePadding = !IE && cs.boxSizing === 'border-box';\n const canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || '');\n const canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || '');\n const paddingTop = svg ? 0 : parseDimension(cs.paddingTop);\n const paddingRight = svg ? 0 : parseDimension(cs.paddingRight);\n const paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom);\n const paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft);\n const borderTop = svg ? 0 : parseDimension(cs.borderTopWidth);\n const borderRight = svg ? 0 : parseDimension(cs.borderRightWidth);\n const borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth);\n const borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth);\n const horizontalPadding = paddingLeft + paddingRight;\n const verticalPadding = paddingTop + paddingBottom;\n const horizontalBorderArea = borderLeft + borderRight;\n const verticalBorderArea = borderTop + borderBottom;\n const horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;\n const verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;\n const widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;\n const heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;\n const contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;\n const contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;\n const borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;\n const borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;\n const boxes = Object.freeze({\n borderBoxSize: size(borderBoxWidth, borderBoxHeight),\n contentBoxSize: size(contentWidth, contentHeight),\n scrollBoxSize: size(contentWidth + horizontalPadding, contentHeight + verticalPadding),\n devicePixelBorderBoxSize: size(borderBoxWidth * dpr, borderBoxHeight * dpr),\n contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)\n });\n cache.set(target, boxes);\n return boxes;\n};\nconst calculateBoxSize = (target, observedBox) => {\n const boxes = calculateBoxSizes(target);\n switch (observedBox) {\n case ResizeObserverBoxOptions.BORDER_BOX:\n return boxes.borderBoxSize;\n case ResizeObserverBoxOptions.SCROLL_BOX:\n return boxes.scrollBoxSize;\n case ResizeObserverBoxOptions.DEVICE_PIXEL_BORDER_BOX:\n return boxes.devicePixelBorderBoxSize;\n case ResizeObserverBoxOptions.CONTENT_BOX:\n default:\n return boxes.contentBoxSize;\n }\n};\nexport { calculateBoxSize, calculateBoxSizes, cache };\n","import { ResizeObserverBoxOptions } from './ResizeObserverBoxOptions';\nimport { calculateBoxSize } from './algorithms/calculateBoxSize';\nclass ResizeObservation {\n constructor(target, observedBox) {\n this.target = target;\n this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;\n this.lastReportedSize = {\n inlineSize: 0,\n blockSize: 0\n };\n }\n isActive() {\n const size = calculateBoxSize(this.target, this.observedBox);\n return this.lastReportedSize.inlineSize !== size.inlineSize\n || this.lastReportedSize.blockSize !== size.blockSize;\n }\n}\nexport { ResizeObservation };\n","class ResizeObserverDetail {\n constructor(resizeObserver, callback) {\n this.activeTargets = [];\n this.skippedTargets = [];\n this.observationTargets = [];\n this.observer = resizeObserver;\n this.callback = callback;\n }\n}\nexport { ResizeObserverDetail };\n","import { resizeObservers } from '../ResizeObserverController';\nconst hasActiveObservations = () => {\n return resizeObservers.some((ro) => ro.activeTargets.length > 0);\n};\nexport { hasActiveObservations };\n","const msg = 'ResizeObserver loop completed with undelivered notifications.';\nconst deliverResizeLoopError = () => {\n let event;\n if (typeof ErrorEvent === 'function') {\n event = new ErrorEvent('error', {\n message: msg\n });\n }\n else {\n event = document.createEvent('Event');\n event.initEvent('error', false, false);\n event.message = msg;\n }\n window.dispatchEvent(event);\n};\nexport { deliverResizeLoopError };\n","import { calculateBoxSizes } from './algorithms/calculateBoxSize';\nclass ResizeObserverEntry {\n constructor(target) {\n const boxes = calculateBoxSizes(target);\n this.target = target;\n this.contentRect = boxes.contentRect;\n this.borderBoxSize = boxes.borderBoxSize;\n this.contentSize = boxes.contentBoxSize;\n this.scrollSize = boxes.scrollBoxSize;\n this.devicePixelBorderBoxSize = boxes.devicePixelBorderBoxSize;\n }\n}\nexport { ResizeObserverEntry };\n","import { isHidden } from '../utils/element';\nconst calculateDepthForNode = (node) => {\n if (isHidden(node)) {\n return Infinity;\n }\n let depth = 0;\n let parent = node.parentNode;\n while (parent) {\n depth += 1;\n parent = parent.parentNode;\n }\n return depth;\n};\nexport { calculateDepthForNode };\n","import { resizeObservers } from '../ResizeObserverController';\nimport { ResizeObserverEntry } from '../ResizeObserverEntry';\nimport { calculateDepthForNode } from './calculateDepthForNode';\nimport { calculateBoxSize } from './calculateBoxSize';\nconst broadcastActiveObservations = () => {\n let shallowestDepth = Infinity;\n const callbacks = [];\n resizeObservers.forEach(function processObserver(ro) {\n if (ro.activeTargets.length === 0) {\n return;\n }\n const entries = [];\n ro.activeTargets.forEach(function processTarget(ot) {\n const entry = new ResizeObserverEntry(ot.target);\n const targetDepth = calculateDepthForNode(ot.target);\n entries.push(entry);\n ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);\n if (targetDepth < shallowestDepth) {\n shallowestDepth = targetDepth;\n }\n });\n callbacks.push(function resizeObserverCallback() { ro.callback(entries, ro.observer); });\n ro.activeTargets.splice(0, ro.activeTargets.length);\n });\n for (let callback of callbacks) {\n callback();\n }\n return shallowestDepth;\n};\nexport { broadcastActiveObservations };\n","import { resizeObservers } from '../ResizeObserverController';\nimport { calculateDepthForNode } from './calculateDepthForNode';\nimport { cache as sizeCache } from './calculateBoxSize';\nconst gatherActiveObservationsAtDepth = (depth) => {\n sizeCache.clear();\n resizeObservers.forEach(function processObserver(ro) {\n ro.activeTargets.splice(0, ro.activeTargets.length);\n ro.skippedTargets.splice(0, ro.skippedTargets.length);\n ro.observationTargets.forEach(function processTarget(ot) {\n if (ot.isActive()) {\n if (calculateDepthForNode(ot.target) > depth) {\n ro.activeTargets.push(ot);\n }\n else {\n ro.skippedTargets.push(ot);\n }\n }\n });\n });\n};\nexport { gatherActiveObservationsAtDepth };\n","import { scheduler } from './utils/scheduler';\nimport { ResizeObservation } from './ResizeObservation';\nimport { ResizeObserverDetail } from './ResizeObserverDetail';\nimport { hasActiveObservations } from './algorithms/hasActiveObservations';\nimport { hasSkippedObservations } from './algorithms/hasSkippedObservations';\nimport { deliverResizeLoopError } from './algorithms/deliverResizeLoopError';\nimport { broadcastActiveObservations } from './algorithms/broadcastActiveObservations';\nimport { gatherActiveObservationsAtDepth } from './algorithms/gatherActiveObservationsAtDepth';\nconst resizeObservers = [];\nconst observerMap = new Map();\nlet watching = 0;\nconst updateCount = (n) => {\n !watching && n > 0 && scheduler.start();\n watching += n;\n !watching && scheduler.stop();\n};\nconst getObservationIndex = (observationTargets, target) => {\n for (let i = 0; i < observationTargets.length; i += 1) {\n if (observationTargets[i].target === target) {\n return i;\n }\n }\n return -1;\n};\nconst process = () => {\n let depth = 0;\n gatherActiveObservationsAtDepth(depth);\n while (hasActiveObservations()) {\n depth = broadcastActiveObservations();\n gatherActiveObservationsAtDepth(depth);\n }\n if (hasSkippedObservations()) {\n deliverResizeLoopError();\n }\n return depth > 0;\n};\nclass ResizeObserverController {\n static connect(resizeObserver, callback) {\n const detail = new ResizeObserverDetail(resizeObserver, callback);\n resizeObservers.push(detail);\n observerMap.set(resizeObserver, detail);\n }\n static observe(resizeObserver, target, options) {\n if (observerMap.has(resizeObserver)) {\n const detail = observerMap.get(resizeObserver);\n if (getObservationIndex(detail.observationTargets, target) < 0) {\n detail.observationTargets.push(new ResizeObservation(target, options && options.box));\n updateCount(1);\n scheduler.schedule();\n }\n }\n }\n static unobserve(resizeObserver, target) {\n if (observerMap.has(resizeObserver)) {\n const detail = observerMap.get(resizeObserver);\n const index = getObservationIndex(detail.observationTargets, target);\n if (index >= 0) {\n detail.observationTargets.splice(index, 1);\n updateCount(-1);\n }\n }\n }\n static disconnect(resizeObserver) {\n if (observerMap.has(resizeObserver)) {\n const detail = observerMap.get(resizeObserver);\n resizeObservers.splice(resizeObservers.indexOf(detail), 1);\n observerMap.delete(resizeObserver);\n updateCount(-detail.observationTargets.length);\n }\n }\n}\nexport { ResizeObserverController, resizeObservers, process };\n","import { resizeObservers } from '../ResizeObserverController';\nconst hasSkippedObservations = () => {\n return resizeObservers.some((ro) => ro.skippedTargets.length > 0);\n};\nexport { hasSkippedObservations };\n","import { ResizeObserverController } from './ResizeObserverController';\nimport { ResizeObserverBoxOptions } from './ResizeObserverBoxOptions';\nimport { POLYFILL_CONSOLE_OUTPUT } from './utils/prettify';\nconst DPPB = ResizeObserverBoxOptions.DEVICE_PIXEL_BORDER_BOX;\nclass ResizeObserver {\n constructor(callback) {\n if (arguments.length === 0) {\n throw new TypeError(`Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.`);\n }\n if (typeof callback !== 'function') {\n throw new TypeError(`Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.`);\n }\n ResizeObserverController.connect(this, callback);\n }\n observe(target, options) {\n if (arguments.length === 0) {\n throw new TypeError(`Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.`);\n }\n if (target instanceof Element === false) {\n throw new TypeError(`Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element`);\n }\n if (options && options.box === DPPB && target.tagName !== 'CANVAS') {\n throw new Error(`Can only watch ${options.box} on canvas elements.`);\n }\n ResizeObserverController.observe(this, target, options);\n }\n unobserve(target) {\n if (arguments.length === 0) {\n throw new TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.`);\n }\n if (target instanceof Element === false) {\n throw new TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element`);\n }\n ResizeObserverController.unobserve(this, target);\n }\n disconnect() {\n ResizeObserverController.disconnect(this);\n }\n static toString() {\n return POLYFILL_CONSOLE_OUTPUT;\n }\n}\nexport default ResizeObserver;\nexport { ResizeObserver };\n","/**\r\n * Random utility functions used in the UI-Router code\r\n *\r\n * These functions are exported, but are subject to change without notice.\r\n *\r\n * @packageDocumentation\r\n * @preferred\r\n */\r\nimport { isFunction, isString, isArray, isRegExp, isDate } from './predicates';\r\nimport { all, any, prop, curry, not } from './hof';\r\nimport { services } from './coreservices';\r\nimport { StateObject } from '../state/stateObject';\r\n\r\ndeclare const global;\r\nexport const root: any =\r\n (typeof self === 'object' && self.self === self && self) ||\r\n (typeof global === 'object' && global.global === global && global) ||\r\n this;\r\nconst angular = root.angular || {};\r\n\r\nexport const fromJson = angular.fromJson || JSON.parse.bind(JSON);\r\nexport const toJson = angular.toJson || JSON.stringify.bind(JSON);\r\nexport const forEach = angular.forEach || _forEach;\r\nexport const extend = Object.assign || _extend;\r\nexport const equals = angular.equals || _equals;\r\nexport function identity(x: any) {\r\n return x;\r\n}\r\nexport function noop(): any {}\r\n\r\nexport type Mapper<X, T> = (x: X, key?: string | number) => T;\r\nexport interface TypedMap<T> {\r\n [key: string]: T;\r\n}\r\nexport type Predicate<X> = (x?: X) => boolean;\r\nexport type PredicateBinary<X, Y> = (x?: X, y?: Y) => boolean;\r\n/**\r\n * An ng1-style injectable\r\n *\r\n * This could be a (non-minified) function such as:\r\n * ```js\r\n * function injectableFunction(SomeDependency) {\r\n *\r\n * }\r\n * ```\r\n *\r\n * or an explicitly annotated function (minify safe)\r\n * ```js\r\n * injectableFunction.$inject = [ 'SomeDependency' ];\r\n * function injectableFunction(SomeDependency) {\r\n *\r\n * }\r\n * ```\r\n *\r\n * or an array style annotated function (minify safe)\r\n * ```js\r\n * ['SomeDependency', function injectableFunction(SomeDependency) {\r\n *\r\n * }];\r\n * ```\r\n */\r\nexport type IInjectable = Function | any[];\r\n\r\nexport interface Obj extends Object {\r\n [key: string]: any;\r\n}\r\n\r\n/**\r\n * Builds proxy functions on the `to` object which pass through to the `from` object.\r\n *\r\n * For each key in `fnNames`, creates a proxy function on the `to` object.\r\n * The proxy function calls the real function on the `from` object.\r\n *\r\n *\r\n * #### Example:\r\n * This example creates an new class instance whose functions are prebound to the new'd object.\r\n * ```js\r\n * class Foo {\r\n * constructor(data) {\r\n * // Binds all functions from Foo.prototype to 'this',\r\n * // then copies them to 'this'\r\n * bindFunctions(Foo.prototype, this, this);\r\n * this.data = data;\r\n * }\r\n *\r\n * log() {\r\n * console.log(this.data);\r\n * }\r\n * }\r\n *\r\n * let myFoo = new Foo([1,2,3]);\r\n * var logit = myFoo.log;\r\n * logit(); // logs [1, 2, 3] from the myFoo 'this' instance\r\n * ```\r\n *\r\n * #### Example:\r\n * This example creates a bound version of a service function, and copies it to another object\r\n * ```\r\n *\r\n * var SomeService = {\r\n * this.data = [3, 4, 5];\r\n * this.log = function() {\r\n * console.log(this.data);\r\n * }\r\n * }\r\n *\r\n * // Constructor fn\r\n * function OtherThing() {\r\n * // Binds all functions from SomeService to SomeService,\r\n * // then copies them to 'this'\r\n * bindFunctions(SomeService, this, SomeService);\r\n * }\r\n *\r\n * let myOtherThing = new OtherThing();\r\n * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'\r\n * ```\r\n *\r\n * @param source A function that returns the source object which contains the original functions to be bound\r\n * @param target A function that returns the target object which will receive the bound functions\r\n * @param bind A function that returns the object which the functions will be bound to\r\n * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object)\r\n * @param latebind If true, the binding of the function is delayed until the first time it's invoked\r\n */\r\nexport function createProxyFunctions(\r\n source: Function,\r\n target: Obj,\r\n bind: Function,\r\n fnNames?: string[],\r\n latebind = false\r\n): Obj {\r\n const bindFunction = (fnName) => source()[fnName].bind(bind());\r\n\r\n const makeLateRebindFn = (fnName) =>\r\n function lateRebindFunction() {\r\n target[fnName] = bindFunction(fnName);\r\n return target[fnName].apply(null, arguments);\r\n };\r\n\r\n fnNames = fnNames || Object.keys(source());\r\n\r\n return fnNames.reduce((acc, name) => {\r\n acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);\r\n return acc;\r\n }, target);\r\n}\r\n\r\n/**\r\n * prototypal inheritance helper.\r\n * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it\r\n */\r\nexport const inherit = (parent: Obj, extra?: Obj) => extend(Object.create(parent), extra);\r\n\r\n/** Given an array, returns true if the object is found in the array, (using indexOf) */\r\nexport const inArray: typeof _inArray = curry(_inArray) as any;\r\nexport function _inArray(array: any[], obj: any): boolean;\r\nexport function _inArray(array: any[]): (obj: any) => boolean;\r\nexport function _inArray(array, obj?): any {\r\n return array.indexOf(obj) !== -1;\r\n}\r\n\r\n/**\r\n * Given an array, and an item, if the item is found in the array, it removes it (in-place).\r\n * The same array is returned\r\n */\r\nexport const removeFrom: typeof _removeFrom = curry(_removeFrom) as any;\r\nexport function _removeFrom<T>(array: T[], obj: T): T[];\r\nexport function _removeFrom<T>(array: T[]): (obj: T) => T[];\r\nexport function _removeFrom(array, obj?) {\r\n const idx = array.indexOf(obj);\r\n if (idx >= 0) array.splice(idx, 1);\r\n return array;\r\n}\r\n\r\n/** pushes a values to an array and returns the value */\r\nexport const pushTo: typeof _pushTo = curry(_pushTo) as any;\r\nexport function _pushTo<T>(arr: T[], val: T): T;\r\nexport function _pushTo<T>(arr: T[]): (val: T) => T;\r\nexport function _pushTo(arr, val?): any {\r\n return arr.push(val), val;\r\n}\r\n\r\n/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */\r\nexport const deregAll = (functions: Function[]) =>\r\n functions.slice().forEach((fn) => {\r\n typeof fn === 'function' && fn();\r\n removeFrom(functions, fn);\r\n });\r\n/**\r\n * Applies a set of defaults to an options object. The options object is filtered\r\n * to only those properties of the objects in the defaultsList.\r\n * Earlier objects in the defaultsList take precedence when applying defaults.\r\n */\r\nexport function defaults(opts, ...defaultsList: Obj[]) {\r\n const defaultVals = extend({}, ...defaultsList.reverse());\r\n return extend(defaultVals, pick(opts || {}, Object.keys(defaultVals)));\r\n}\r\n\r\n/** Reduce function that merges each element of the list into a single object, using extend */\r\nexport const mergeR = (memo: Obj, item: Obj) => extend(memo, item);\r\n\r\n/**\r\n * Finds the common ancestor path between two states.\r\n *\r\n * @param {Object} first The first state.\r\n * @param {Object} second The second state.\r\n * @return {Array} Returns an array of state names in descending order, not including the root.\r\n */\r\nexport function ancestors(first: StateObject, second: StateObject) {\r\n const path: StateObject[] = [];\r\n\r\n // tslint:disable-next-line:forin\r\n for (const n in first.path) {\r\n if (first.path[n] !== second.path[n]) break;\r\n path.push(first.path[n]);\r\n }\r\n return path;\r\n}\r\n\r\n/**\r\n * Return a copy of the object only containing the whitelisted properties.\r\n *\r\n * #### Example:\r\n * ```\r\n * var foo = { a: 1, b: 2, c: 3 };\r\n * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }\r\n * ```\r\n * @param obj the source object\r\n * @param propNames an Array of strings, which are the whitelisted property names\r\n */\r\nexport function pick(obj: Obj, propNames: string[]): Obj {\r\n const objCopy = {};\r\n for (const _prop in obj) {\r\n if (propNames.indexOf(_prop) !== -1) {\r\n objCopy[_prop] = obj[_prop];\r\n }\r\n }\r\n return objCopy;\r\n}\r\n\r\n/**\r\n * Return a copy of the object omitting the blacklisted properties.\r\n *\r\n * @example\r\n * ```\r\n *\r\n * var foo = { a: 1, b: 2, c: 3 };\r\n * var ab = omit(foo, ['a', 'b']); // { c: 3 }\r\n * ```\r\n * @param obj the source object\r\n * @param propNames an Array of strings, which are the blacklisted property names\r\n */\r\nexport function omit(obj: Obj, propNames: string[]): Obj {\r\n return Object.keys(obj)\r\n .filter(not(inArray(propNames)))\r\n .reduce((acc, key) => ((acc[key] = obj[key]), acc), {});\r\n}\r\n\r\n/** Given an array of objects, maps each element to a named property of the element. */\r\nexport function pluck<T>(collection: Obj[], propName: string): T[];\r\n/** Given an object, maps each property of the object to a named property of the property. */\r\nexport function pluck(collection: { [key: string]: any }, propName: string): { [key: string]: any };\r\n/**\r\n * Maps an array, or object to a property (by name)\r\n */\r\nexport function pluck(collection: any, propName: string): any {\r\n return map(collection, <Mapper<any, string>>prop(propName));\r\n}\r\n\r\n/** Given an array of objects, returns a new array containing only the elements which passed the callback predicate */\r\nexport function filter<T>(collection: T[], callback: (t: T, key?: number) => boolean): T[];\r\n/** Given an object, returns a new object with only those properties that passed the callback predicate */\r\nexport function filter<T>(collection: TypedMap<T>, callback: (t: T, key?: string) => boolean): TypedMap<T>;\r\n/** Filters an Array or an Object's properties based on a predicate */\r\nexport function filter<T>(collection: any, callback: Function): T {\r\n const arr = isArray(collection),\r\n result: any = arr ? [] : {};\r\n const accept = arr ? (x) => result.push(x) : (x, key) => (result[key] = x);\r\n forEach(collection, function (item, i) {\r\n if (callback(item, i)) accept(item, i);\r\n });\r\n return <T>result;\r\n}\r\n\r\n/** Given an object, return the first property of that object which passed the callback predicate */\r\nexport function find<T>(collection: TypedMap<T>, callback: Predicate<T>): T;\r\n/** Given an array of objects, returns the first object which passed the callback predicate */\r\nexport function find<T>(collection: T[], callback: Predicate<T>): T;\r\n/** Finds an object from an array, or a property of an object, that matches a predicate */\r\nexport function find(collection: any, callback: any) {\r\n let result;\r\n\r\n forEach(collection, function (item, i) {\r\n if (result) return;\r\n if (callback(item, i)) result = item;\r\n });\r\n\r\n return result;\r\n}\r\n\r\n/** Given an object, returns a new object, where each property is transformed by the callback function */\r\nexport let mapObj: <T, U>(\r\n collection: { [key: string]: T },\r\n callback: Mapper<T, U>,\r\n target?: typeof collection\r\n) => { [key: string]: U } = map;\r\n/** Given an array, returns a new array, where each element is transformed by the callback function */\r\nexport function map<T, U>(collection: T[], callback: Mapper<T, U>, target?: typeof collection): U[];\r\nexport function map<T, U>(\r\n collection: { [key: string]: T },\r\n callback: Mapper<T, U>,\r\n target?: typeof collection\r\n): { [key: string]: U };\r\n/** Maps an array or object properties using a callback function */\r\nexport function map(collection: any, callback: any, target: typeof collection): any {\r\n target = target || (isArray(collection) ? [] : {});\r\n forEach(collection, (item, i) => (target[i] = callback(item, i)));\r\n return target;\r\n}\r\n\r\n/**\r\n * Given an object, return its enumerable property values\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let foo = { a: 1, b: 2, c: 3 }\r\n * let vals = values(foo); // [ 1, 2, 3 ]\r\n * ```\r\n */\r\nexport const values: <T>(obj: TypedMap<T>) => T[] = (obj: Obj) => Object.keys(obj).map((key) => obj[key]);\r\n\r\n/**\r\n * Reduce function that returns true if all of the values are truthy.\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let vals = [ 1, true, {}, \"hello world\"];\r\n * vals.reduce(allTrueR, true); // true\r\n *\r\n * vals.push(0);\r\n * vals.reduce(allTrueR, true); // false\r\n * ```\r\n */\r\nexport const allTrueR = (memo: boolean, elem: any) => memo && elem;\r\n\r\n/**\r\n * Reduce function that returns true if any of the values are truthy.\r\n *\r\n * * @example\r\n * ```\r\n *\r\n * let vals = [ 0, null, undefined ];\r\n * vals.reduce(anyTrueR, true); // false\r\n *\r\n * vals.push(\"hello world\");\r\n * vals.reduce(anyTrueR, true); // true\r\n * ```\r\n */\r\nexport const anyTrueR = (memo: boolean, elem: any) => memo || elem;\r\n\r\n/**\r\n * Reduce function which un-nests a single level of arrays\r\n * @example\r\n * ```\r\n *\r\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\r\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\r\n * ```\r\n */\r\nexport const unnestR = (memo: any[], elem: any[]) => memo.concat(elem);\r\n\r\n/**\r\n * Reduce function which recursively un-nests all arrays\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\r\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\r\n * ```\r\n */\r\nexport const flattenR = (memo: any[], elem: any) =>\r\n isArray(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem);\r\n\r\n/**\r\n * Reduce function that pushes an object to an array, then returns the array.\r\n * Mostly just for [[flattenR]] and [[uniqR]]\r\n */\r\nexport function pushR(arr: any[], obj: any) {\r\n arr.push(obj);\r\n return arr;\r\n}\r\n\r\n/** Reduce function that filters out duplicates */\r\nexport const uniqR = <T>(acc: T[], token: T): T[] => (inArray(acc, token) ? acc : pushR(acc, token));\r\n\r\n/**\r\n * Return a new array with a single level of arrays unnested.\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\r\n * unnest(input) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\r\n * ```\r\n */\r\nexport const unnest = (arr: any[]) => arr.reduce(unnestR, []);\r\n/**\r\n * Return a completely flattened version of an array.\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\r\n * flatten(input) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\r\n * ```\r\n */\r\nexport const flatten = (arr: any[]) => arr.reduce(flattenR, []);\r\n\r\n/**\r\n * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.\r\n * @example\r\n * ```\r\n *\r\n * let isNumber = (obj) => typeof(obj) === 'number';\r\n * let allNumbers = [ 1, 2, 3, 4, 5 ];\r\n * allNumbers.filter(assertPredicate(isNumber)); //OK\r\n *\r\n * let oneString = [ 1, 2, 3, 4, \"5\" ];\r\n * oneString.filter(assertPredicate(isNumber, \"Not all numbers\")); // throws Error(\"\"Not all numbers\"\");\r\n * ```\r\n */\r\nexport const assertPredicate: <T>(predicate: Predicate<T>, errMsg: string | Function) => Predicate<T> = assertFn;\r\n/**\r\n * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test.\r\n * @example\r\n * ```\r\n *\r\n * var data = { foo: 1, bar: 2 };\r\n *\r\n * let keys = [ 'foo', 'bar' ]\r\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\r\n * // values is [1, 2]\r\n *\r\n * let keys = [ 'foo', 'bar', 'baz' ]\r\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\r\n * // throws Error(\"Key not found\")\r\n * ```\r\n */\r\nexport const assertMap: <T, U>(mapFn: (t: T) => U, errMsg: string | Function) => (t: T) => U = assertFn;\r\nexport function assertFn(predicateOrMap: Function, errMsg: string | Function = 'assert failure'): any {\r\n return (obj) => {\r\n const result = predicateOrMap(obj);\r\n if (!result) {\r\n throw new Error(isFunction(errMsg) ? (<Function>errMsg)(obj) : errMsg);\r\n }\r\n return result;\r\n };\r\n}\r\n\r\n/**\r\n * Like _.pairs: Given an object, returns an array of key/value pairs\r\n *\r\n * @example\r\n * ```\r\n *\r\n * pairs({ foo: \"FOO\", bar: \"BAR }) // [ [ \"foo\", \"FOO\" ], [ \"bar\": \"BAR\" ] ]\r\n * ```\r\n */\r\nexport const pairs = (obj: Obj) => Object.keys(obj).map((key) => [key, obj[key]]);\r\n\r\n/**\r\n * Given two or more parallel arrays, returns an array of tuples where\r\n * each tuple is composed of [ a[i], b[i], ... z[i] ]\r\n *\r\n * @example\r\n * ```\r\n *\r\n * let foo = [ 0, 2, 4, 6 ];\r\n * let bar = [ 1, 3, 5, 7 ];\r\n * let baz = [ 10, 30, 50, 70 ];\r\n * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]\r\n * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]\r\n * ```\r\n */\r\nexport function arrayTuples(...args: any[]): any[] {\r\n if (args.length === 0) return [];\r\n const maxArrayLen = args.reduce((min, arr) => Math.min(arr.length, min), 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER\r\n const result = [];\r\n\r\n for (let i = 0; i < maxArrayLen; i++) {\r\n // This is a hot function\r\n // Unroll when there are 1-4 arguments\r\n switch (args.length) {\r\n case 1:\r\n result.push([args[0][i]]);\r\n break;\r\n case 2:\r\n result.push([args[0][i], args[1][i]]);\r\n break;\r\n case 3:\r\n result.push([args[0][i], args[1][i], args[2][i]]);\r\n break;\r\n case 4:\r\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\r\n break;\r\n default:\r\n result.push(args.map((array) => array[i]));\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Reduce function which builds an object from an array of [key, value] pairs.\r\n *\r\n * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration.\r\n *\r\n * Each keyValueTuple should be an array with values [ key: string, value: any ]\r\n *\r\n * @example\r\n * ```\r\n *\r\n * var pairs = [ [\"fookey\", \"fooval\"], [\"barkey\", \"barval\"] ]\r\n *\r\n * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {})\r\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\r\n *\r\n * // Or, more simply:\r\n * var pairsToObj = pairs.reduce(applyPairs, {})\r\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\r\n * ```\r\n */\r\nexport function applyPairs(memo: TypedMap<any>, keyValTuple: any[]) {\r\n let key: string, value: any;\r\n if (isArray(keyValTuple)) [key, value] = keyValTuple;\r\n if (!isString(key)) throw new Error('invalid parameters to applyPairs');\r\n memo[key] = value;\r\n return memo;\r\n}\r\n\r\n/** Get the last element of an array */\r\nexport function tail<T>(arr: T[]): T {\r\n return (arr.length && arr[arr.length - 1]) || undefined;\r\n}\r\n\r\n/**\r\n * shallow copy from src to dest\r\n */\r\nexport function copy(src: Obj, dest?: Obj) {\r\n if (dest) Object.keys(dest).forEach((key) => delete dest[key]);\r\n if (!dest) dest = {};\r\n return extend(dest, src);\r\n}\r\n\r\n/** Naive forEach implementation works with Objects or Arrays */\r\nfunction _forEach(obj: any[] | any, cb: (el, idx?) => void, _this: Obj) {\r\n if (isArray(obj)) return obj.forEach(cb, _this);\r\n Object.keys(obj).forEach((key) => cb(obj[key], key));\r\n}\r\n\r\n/** Like Object.assign() */\r\nexport function _extend(toObj: Obj, ...fromObjs: Obj[]): any;\r\nexport function _extend(toObj: Obj): any {\r\n for (let i = 1; i < arguments.length; i++) {\r\n const obj = arguments[i];\r\n if (!obj) continue;\r\n const keys = Object.keys(obj);\r\n\r\n for (let j = 0; j < keys.length; j++) {\r\n toObj[keys[j]] = obj[keys[j]];\r\n }\r\n }\r\n\r\n return toObj;\r\n}\r\n\r\nfunction _equals(o1: any, o2: any): boolean {\r\n if (o1 === o2) return true;\r\n if (o1 === null || o2 === null) return false;\r\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\r\n const t1 = typeof o1,\r\n t2 = typeof o2;\r\n if (t1 !== t2 || t1 !== 'object') return false;\r\n\r\n const tup = [o1, o2];\r\n if (all(isArray)(tup)) return _arraysEq(o1, o2);\r\n if (all(isDate)(tup)) return o1.getTime() === o2.getTime();\r\n if (all(isRegExp)(tup)) return o1.toString() === o2.toString();\r\n if (all(isFunction)(tup)) return true; // meh\r\n\r\n const predicates = [isFunction, isArray, isDate, isRegExp];\r\n if (predicates.map(any).reduce((b, fn) => b || !!fn(tup), false)) return false;\r\n\r\n const keys: { [i: string]: boolean } = {};\r\n // tslint:disable-next-line:forin\r\n for (const key in o1) {\r\n if (!_equals(o1[key], o2[key])) return false;\r\n keys[key] = true;\r\n }\r\n for (const key in o2) {\r\n if (!keys[key]) return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\nfunction _arraysEq(a1: any[], a2: any[]) {\r\n if (a1.length !== a2.length) return false;\r\n return arrayTuples(a1, a2).reduce((b, t) => b && _equals(t[0], t[1]), true);\r\n}\r\n\r\n// issue #2676\r\nexport const silenceUncaughtInPromise = (promise: Promise<any>) => promise.catch((e) => 0) && promise;\r\nexport const silentRejection = (error: any) => silenceUncaughtInPromise(services.$q.reject(error));\r\n","/**\r\n * This module is a stub for core services such as Dependency Injection or Browser Location.\r\n * Core services may be implemented by a specific framework, such as ng1 or ng2, or be pure javascript.\r\n *\r\n * @packageDocumentation\r\n */\r\nimport { IInjectable, Obj } from './common';\r\nimport { Disposable } from '../interface';\r\nimport { UrlConfig, UrlService } from '../url';\r\n\r\nconst noImpl = (fnname: string) => () => {\r\n throw new Error(`No implementation for ${fnname}. The framework specific code did not implement this method.`);\r\n};\r\n\r\nexport const makeStub = <T>(service: string, methods: (keyof T)[]): T =>\r\n methods.reduce((acc, key) => ((acc[key] = noImpl(`${service}.${key}()`) as any), acc), {} as T);\r\n\r\nconst services: CoreServices = {\r\n $q: undefined,\r\n $injector: undefined,\r\n};\r\n\r\nexport interface $QLikeDeferred {\r\n resolve: (val?: any) => void;\r\n reject: (reason?: any) => void;\r\n promise: Promise<any>;\r\n}\r\n\r\nexport interface $QLike {\r\n when<T>(value?: T | PromiseLike<T>): Promise<T>;\r\n reject<T>(reason: any): Promise<T>;\r\n defer(): $QLikeDeferred;\r\n all(promises: { [key: string]: Promise<any> }): Promise<any>;\r\n all(promises: Promise<any>[]): Promise<any[]>;\r\n}\r\n\r\nexport interface $InjectorLike {\r\n strictDi?: boolean;\r\n get(token: any): any;\r\n get<T>(token: any): T;\r\n has(token: any): boolean;\r\n invoke(fn: IInjectable, context?: any, locals?: Obj): any;\r\n annotate(fn: IInjectable, strictDi?: boolean): any[];\r\n}\r\n\r\nexport interface CoreServices {\r\n $q: $QLike;\r\n $injector: $InjectorLike;\r\n}\r\n\r\n/**\r\n * Handles low level URL read/write\r\n *\r\n * This service handles low level reads and updates of the URL and listens for url changes.\r\n * Implementors should pass these through to the underlying URL mechanism.\r\n * The underlying URL mechanism might be browser APIs, framework APIs, or some 3rd party URL management library.\r\n *\r\n * UI-Router Core includes three basic implementations:\r\n *\r\n * - [[PushStateLocationService]]\r\n * - [[HashLocationService]]\r\n * - [[MemoryLocationService]]\r\n */\r\nexport interface LocationServices extends Disposable {\r\n /** See: [[UrlService.url]] */ url: UrlService['url'];\r\n /** See: [[UrlService.path]] */ path: UrlService['path'];\r\n /** See: [[UrlService.search]] */ search: UrlService['search'];\r\n /** See: [[UrlService.hash]] */ hash: UrlService['hash'];\r\n /** See: [[UrlService.onChange]] */ onChange: UrlService['onChange'];\r\n}\r\n\r\n/**\r\n * Returns low level URL configuration and metadata\r\n *\r\n * This service returns information about the location configuration.\r\n * This service is primarily used when building URLs (e.g., for `hrefs`)\r\n *\r\n * Implementors should pass these through to the underlying URL APIs.\r\n * The underlying URL mechanism might be browser APIs, framework APIs, or some 3rd party URL management library.\r\n *\r\n * UI-Router Core includes two basic implementations:\r\n *\r\n * - [[BrowserLocationConfig]]\r\n * - [[MemoryLocationConfig]]\r\n */\r\nexport interface LocationConfig extends Disposable {\r\n /** See: [[UrlConfig.port]] */ port: UrlConfig['port'];\r\n /** See: [[UrlConfig.protocol]] */ protocol: UrlConfig['protocol'];\r\n /** See: [[UrlConfig.host]] */ host: UrlConfig['host'];\r\n /** See: [[UrlConfig.baseHref]] */ baseHref: UrlConfig['baseHref'];\r\n /** See: [[UrlConfig.html5Mode]] */ html5Mode: UrlConfig['html5Mode'];\r\n /** See: [[UrlConfig.hashPrefix]] */ hashPrefix: UrlConfig['hashPrefix'];\r\n}\r\n\r\nexport { services };\r\n","/**\r\n * Matches state names using glob-like pattern strings.\r\n *\r\n * Globs can be used in specific APIs including:\r\n *\r\n * - [[StateService.is]]\r\n * - [[StateService.includes]]\r\n * - The first argument to Hook Registration functions like [[TransitionService.onStart]]\r\n * - [[HookMatchCriteria]] and [[HookMatchCriterion]]\r\n *\r\n * A `Glob` string is a pattern which matches state names.\r\n * Nested state names are split into segments (separated by a dot) when processing.\r\n * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz']\r\n *\r\n * Globs work according to the following rules:\r\n *\r\n * ### Exact match:\r\n *\r\n * The glob `'A.B'` matches the state named exactly `'A.B'`.\r\n *\r\n * | Glob |Matches states named|Does not match state named|\r\n * |:------------|:--------------------|:---------------------|\r\n * | `'A'` | `'A'` | `'B'` , `'A.C'` |\r\n * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` |\r\n * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`|\r\n *\r\n * ### Single star (`*`)\r\n *\r\n * A single star (`*`) is a wildcard that matches exactly one segment.\r\n *\r\n * | Glob |Matches states named |Does not match state named |\r\n * |:------------|:---------------------|:--------------------------|\r\n * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` |\r\n * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` |\r\n * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`|\r\n *\r\n * ### Double star (`**`)\r\n *\r\n * A double star (`'**'`) is a wildcard that matches *zero or more segments*\r\n *\r\n * | Glob |Matches states named |Does not match state named |\r\n * |:------------|:----------------------------------------------|:----------------------------------|\r\n * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) |\r\n * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` |\r\n * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` |\r\n * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` |\r\n *\r\n * @packageDocumentation\r\n */\r\nexport class Glob {\r\n text: string;\r\n glob: Array<string>;\r\n regexp: RegExp;\r\n\r\n /** Returns true if the string has glob-like characters in it */\r\n static is(text: string) {\r\n return !!/[!,*]+/.exec(text);\r\n }\r\n\r\n /** Returns a glob from the string, or null if the string isn't Glob-like */\r\n static fromString(text: string) {\r\n return Glob.is(text) ? new Glob(text) : null;\r\n }\r\n\r\n constructor(text: string) {\r\n this.text = text;\r\n this.glob = text.split('.');\r\n\r\n const regexpString = this.text\r\n .split('.')\r\n .map((seg) => {\r\n if (seg === '**') return '(?:|(?:\\\\.[^.]*)*)';\r\n if (seg === '*') return '\\\\.[^.]*';\r\n return '\\\\.' + seg;\r\n })\r\n .join('');\r\n\r\n this.regexp = new RegExp('^' + regexpString + '$');\r\n }\r\n\r\n matches(name: string) {\r\n return this.regexp.test('.' + name);\r\n }\r\n}\r\n","/**\r\n * Higher order functions\r\n *\r\n * These utility functions are exported, but are subject to change without notice.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { Predicate } from './common';\r\n/**\r\n * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.\r\n *\r\n * Given a function with N parameters, returns a new function that supports partial application.\r\n * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,\r\n * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to\r\n * accept more parameters until all N parameters have been supplied.\r\n *\r\n *\r\n * This contrived example uses a partially applied function as an predicate, which returns true\r\n * if an object is found in both arrays.\r\n * @example\r\n * ```\r\n * // returns true if an object is in both of the two arrays\r\n * function inBoth(array1, array2, object) {\r\n * return array1.indexOf(object) !== -1 &&\r\n * array2.indexOf(object) !== 1;\r\n * }\r\n * let obj1, obj2, obj3, obj4, obj5, obj6, obj7\r\n * let foos = [obj1, obj3]\r\n * let bars = [obj3, obj4, obj5]\r\n *\r\n * // A curried \"copy\" of inBoth\r\n * let curriedInBoth = curry(inBoth);\r\n * // Partially apply both the array1 and array2\r\n * let inFoosAndBars = curriedInBoth(foos, bars);\r\n *\r\n * // Supply the final argument; since all arguments are\r\n * // supplied, the original inBoth function is then called.\r\n * let obj1InBoth = inFoosAndBars(obj1); // false\r\n *\r\n * // Use the inFoosAndBars as a predicate.\r\n * // Filter, on each iteration, supplies the final argument\r\n * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];\r\n * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]\r\n *\r\n * ```\r\n *\r\n * @param fn\r\n * @returns {*|function(): (*|any)}\r\n */\r\nexport function curry(fn: Function): Function {\r\n return function curried() {\r\n if (arguments.length >= fn.length) {\r\n return fn.apply(this, arguments);\r\n }\r\n const args = Array.prototype.slice.call(arguments);\r\n return curried.bind(this, ...args);\r\n };\r\n}\r\n\r\n/**\r\n * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left\r\n * given: f(x), g(x), h(x)\r\n * let composed = compose(f,g,h)\r\n * then, composed is: f(g(h(x)))\r\n */\r\nexport function compose() {\r\n const args = arguments;\r\n const start = args.length - 1;\r\n return function () {\r\n let i = start,\r\n result = args[start].apply(this, arguments);\r\n while (i--) result = args[i].call(this, result);\r\n return result;\r\n };\r\n}\r\n\r\n/**\r\n * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right\r\n * given: f(x), g(x), h(x)\r\n * let piped = pipe(f,g,h);\r\n * then, piped is: h(g(f(x)))\r\n */\r\nexport function pipe(...funcs: Function[]): (obj: any) => any {\r\n return compose.apply(null, [].slice.call(arguments).reverse());\r\n}\r\n\r\n/**\r\n * Given a property name, returns a function that returns that property from an object\r\n * let obj = { foo: 1, name: \"blarg\" };\r\n * let getName = prop(\"name\");\r\n * getName(obj) === \"blarg\"\r\n */\r\nexport const prop = (name: string) => (obj: any) => obj && obj[name];\r\n\r\n/**\r\n * Given a property name and a value, returns a function that returns a boolean based on whether\r\n * the passed object has a property that matches the value\r\n * let obj = { foo: 1, name: \"blarg\" };\r\n * let getName = propEq(\"name\", \"blarg\");\r\n * getName(obj) === true\r\n */\r\nexport const propEq = curry((name: string, _val: any, obj: any) => obj && obj[name] === _val);\r\n\r\n/**\r\n * Given a dotted property name, returns a function that returns a nested property from an object, or undefined\r\n * let obj = { id: 1, nestedObj: { foo: 1, name: \"blarg\" }, };\r\n * let getName = prop(\"nestedObj.name\");\r\n * getName(obj) === \"blarg\"\r\n * let propNotFound = prop(\"this.property.doesnt.exist\");\r\n * propNotFound(obj) === undefined\r\n */\r\nexport const parse = (name: string) => pipe.apply(null, name.split('.').map(prop));\r\n\r\n/**\r\n * Given a function that returns a truthy or falsey value, returns a\r\n * function that returns the opposite (falsey or truthy) value given the same inputs\r\n */\r\nexport const not: (fn: Predicate<any>) => Predicate<any> = (fn: Predicate<any>) => (...args: any[]) =>\r\n !fn.apply(null, args);\r\n\r\n/**\r\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\r\n * if both functions return truthy for the given arguments\r\n */\r\nexport function and(fn1: Predicate<any>, fn2: Predicate<any>): Predicate<any> {\r\n return (...args: any[]) => fn1.apply(null, args) && fn2.apply(null, args);\r\n}\r\n\r\n/**\r\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\r\n * if at least one of the functions returns truthy for the given arguments\r\n */\r\nexport function or(fn1: Predicate<any>, fn2: Predicate<any>): Predicate<any> {\r\n return (...args: any[]) => fn1.apply(null, args) || fn2.apply(null, args);\r\n}\r\n\r\n/**\r\n * Check if all the elements of an array match a predicate function\r\n *\r\n * @param fn1 a predicate function `fn1`\r\n * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array\r\n */\r\nexport const all = (fn1: Predicate<any>) => (arr: any[]) => arr.reduce((b, x) => b && !!fn1(x), true) as boolean;\r\n\r\n// tslint:disable-next-line:variable-name\r\nexport const any = (fn1: Predicate<any>) => (arr: any[]) => arr.reduce((b, x) => b || !!fn1(x), false) as boolean;\r\n\r\n/** Given a class, returns a Predicate function that returns true if the object is of that class */\r\nexport const is = <T>(ctor: { new (...args): T }) => (obj: any): obj is T =>\r\n (obj != null && obj.constructor === ctor) || obj instanceof ctor;\r\n\r\n/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */\r\nexport const eq: (comp: any) => Predicate<any> = (value: any) => (other: any) => value === other;\r\n\r\n/** Given a value, returns a function which returns the value */\r\nexport const val = <T>(v: T) => () => v;\r\n\r\nexport function invoke(fnName: string): Function;\r\nexport function invoke(fnName: string, args: any[]): Function;\r\nexport function invoke(fnName: string, args?: any[]): Function {\r\n return (obj: any) => obj[fnName].apply(obj, args);\r\n}\r\n\r\n/**\r\n * Sorta like Pattern Matching (a functional programming conditional construct)\r\n *\r\n * See http://c2.com/cgi/wiki?PatternMatching\r\n *\r\n * This is a conditional construct which allows a series of predicates and output functions\r\n * to be checked and then applied. Each predicate receives the input. If the predicate\r\n * returns truthy, then its matching output function (mapping function) is provided with\r\n * the input and, then the result is returned.\r\n *\r\n * Each combination (2-tuple) of predicate + output function should be placed in an array\r\n * of size 2: [ predicate, mapFn ]\r\n *\r\n * These 2-tuples should be put in an outer array.\r\n *\r\n * @example\r\n * ```\r\n *\r\n * // Here's a 2-tuple where the first element is the isString predicate\r\n * // and the second element is a function that returns a description of the input\r\n * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];\r\n *\r\n * // Second tuple: predicate \"isNumber\", mapfn returns a description\r\n * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];\r\n *\r\n * let third = [ (input) => input === null, (input) => `Oh, null...` ];\r\n *\r\n * let fourth = [ (input) => input === undefined, (input) => `notdefined` ];\r\n *\r\n * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);\r\n *\r\n * console.log(descriptionOf(undefined)); // 'notdefined'\r\n * console.log(descriptionOf(55)); // '(55) That's a number!'\r\n * console.log(descriptionOf(\"foo\")); // 'Here's your string foo'\r\n * ```\r\n *\r\n * @param struct A 2D array. Each element of the array should be an array, a 2-tuple,\r\n * with a Predicate and a mapping/output function\r\n * @returns {function(any): *}\r\n */\r\nexport function pattern(struct: Function[][]): Function {\r\n return function (x: any) {\r\n for (let i = 0; i < struct.length; i++) {\r\n if (struct[i][0](x)) return struct[i][1](x);\r\n }\r\n };\r\n}\r\n","/**\r\n * Predicates\r\n *\r\n * These predicates return true/false based on the input.\r\n * Although these functions are exported, they are subject to change without notice.\r\n *\r\n * @packageDocumentation\r\n */\r\nimport { and, not, pipe, prop, or } from './hof';\r\nimport { Predicate } from './common'; // has or is using\r\nimport { StateObject } from '../state/stateObject';\r\n\r\nconst toStr = Object.prototype.toString;\r\nconst tis = (t: string) => (x: any) => typeof x === t;\r\nexport const isUndefined = tis('undefined');\r\nexport const isDefined = not(isUndefined);\r\nexport const isNull = (o: any) => o === null;\r\nexport const isNullOrUndefined = or(isNull, isUndefined);\r\nexport const isFunction: (x: any) => x is Function = <any>tis('function');\r\nexport const isNumber: (x: any) => x is number = <any>tis('number');\r\nexport const isString = <(x: any) => x is string>tis('string');\r\nexport const isObject = (x: any) => x !== null && typeof x === 'object';\r\nexport const isArray = Array.isArray;\r\nexport const isDate: (x: any) => x is Date = <any>((x: any) => toStr.call(x) === '[object Date]');\r\nexport const isRegExp: (x: any) => x is RegExp = <any>((x: any) => toStr.call(x) === '[object RegExp]');\r\n\r\n/**\r\n * Predicate which checks if a value is injectable\r\n *\r\n * A value is \"injectable\" if it is a function, or if it is an ng1 array-notation-style array\r\n * where all the elements in the array are Strings, except the last one, which is a Function\r\n */\r\nexport function isInjectable(val: any) {\r\n if (isArray(val) && val.length) {\r\n const head = val.slice(0, -1),\r\n tail = val.slice(-1);\r\n return !(head.filter(not(isString)).length || tail.filter(not(isFunction)).length);\r\n }\r\n return isFunction(val);\r\n}\r\n\r\n/**\r\n * Predicate which checks if a value looks like a Promise\r\n *\r\n * It is probably a Promise if it's an object, and it has a `then` property which is a Function\r\n */\r\nexport const isPromise = <(x: any) => x is Promise<any>>and(isObject, pipe(prop('then'), isFunction));\r\n","import { pushTo } from './common';\r\n\r\nexport class Queue<T> {\r\n private _evictListeners: ((item: T) => void)[] = [];\r\n public onEvict = pushTo(this._evictListeners);\r\n\r\n constructor(private _items: T[] = [], private _limit: number = null) {}\r\n\r\n enqueue(item: T) {\r\n const items = this._items;\r\n items.push(item);\r\n if (this._limit && items.length > this._limit) this.evict();\r\n return item;\r\n }\r\n\r\n evict(): T {\r\n const item: T = this._items.shift();\r\n this._evictListeners.forEach((fn) => fn(item));\r\n return item;\r\n }\r\n\r\n dequeue(): T {\r\n if (this.size()) return this._items.splice(0, 1)[0];\r\n }\r\n\r\n clear(): Array<T> {\r\n const current = this._items;\r\n this._items = [];\r\n return current;\r\n }\r\n\r\n size(): number {\r\n return this._items.length;\r\n }\r\n\r\n remove(item: T) {\r\n const idx = this._items.indexOf(item);\r\n return idx > -1 && this._items.splice(idx, 1)[0];\r\n }\r\n\r\n peekTail(): T {\r\n return this._items[this._items.length - 1];\r\n }\r\n\r\n peekHead(): T {\r\n if (this.size()) return this._items[0];\r\n }\r\n}\r\n","/**\r\n * workaround for missing console object in IE9 when dev tools haven't been opened o_O\r\n * @packageDocumentation\r\n */\r\n/* tslint:disable:no-console */\r\nimport { noop } from './common';\r\n\r\nconst noopConsoleStub = { log: noop, error: noop, table: noop };\r\n\r\nfunction ie9Console(console) {\r\n const bound = (fn: Function) => Function.prototype.bind.call(fn, console);\r\n return {\r\n log: bound(console.log),\r\n error: bound(console.log),\r\n table: bound(console.log),\r\n };\r\n}\r\n\r\nfunction fallbackConsole(console) {\r\n const log = console.log.bind(console);\r\n const error = console.error ? console.error.bind(console) : log;\r\n const table = console.table ? console.table.bind(console) : log;\r\n return { log, error, table };\r\n}\r\n\r\nfunction getSafeConsole() {\r\n // @ts-ignore\r\n const isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9;\r\n if (isIE9) {\r\n return window && window.console ? ie9Console(window.console) : noopConsoleStub;\r\n } else if (!console.table || !console.error) {\r\n return fallbackConsole(console);\r\n } else {\r\n return console;\r\n }\r\n}\r\n\r\nexport const safeConsole = getSafeConsole();\r\n","/**\r\n * Functions that manipulate strings\r\n *\r\n * Although these functions are exported, they are subject to change without notice.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nimport { isArray, isFunction, isInjectable, isNull, isObject, isPromise, isString, isUndefined } from './predicates';\r\nimport { Rejection } from '../transition/rejectFactory';\r\nimport { identity, IInjectable, pushR, tail } from './common';\r\nimport { pattern, val } from './hof';\r\n\r\n/**\r\n * Returns a string shortened to a maximum length\r\n *\r\n * If the string is already less than the `max` length, return the string.\r\n * Else return the string, shortened to `max - 3` and append three dots (\"...\").\r\n *\r\n * @param max the maximum length of the string to return\r\n * @param str the input string\r\n */\r\nexport function maxLength(max: number, str: string) {\r\n if (str.length <= max) return str;\r\n return str.substr(0, max - 3) + '...';\r\n}\r\n\r\n/**\r\n * Returns a string, with spaces added to the end, up to a desired str length\r\n *\r\n * If the string is already longer than the desired length, return the string.\r\n * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.\r\n *\r\n * @param length the desired length of the string to return\r\n * @param str the input string\r\n */\r\nexport function padString(length: number, str: string) {\r\n while (str.length < length) str += ' ';\r\n return str;\r\n}\r\n\r\nexport function kebobString(camelCase: string) {\r\n return camelCase\r\n .replace(/^([A-Z])/, ($1) => $1.toLowerCase()) // replace first char\r\n .replace(/([A-Z])/g, ($1) => '-' + $1.toLowerCase()); // replace rest\r\n}\r\n\r\nexport function functionToString(fn: Function) {\r\n const fnStr = fnToString(fn);\r\n const namedFunctionMatch = fnStr.match(/^(function [^ ]+\\([^)]*\\))/);\r\n const toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr;\r\n\r\n const fnName = fn['name'] || '';\r\n if (fnName && toStr.match(/function \\(/)) {\r\n return 'function ' + fnName + toStr.substr(9);\r\n }\r\n return toStr;\r\n}\r\n\r\nexport function fnToString(fn: IInjectable) {\r\n const _fn = isArray(fn) ? fn.slice(-1)[0] : fn;\r\n return (_fn && _fn.toString()) || 'undefined';\r\n}\r\n\r\nexport function stringify(o: any) {\r\n const seen: any[] = [];\r\n\r\n const isRejection = Rejection.isRejectionPromise;\r\n const hasToString = (obj: any) =>\r\n isObject(obj) && !isArray(obj) && obj.constructor !== Object && isFunction(obj.toString);\r\n\r\n const stringifyPattern = pattern([\r\n [isUndefined, val('undefined')],\r\n [isNull, val('null')],\r\n [isPromise, val('[Promise]')],\r\n [isRejection, (x: any) => x._transitionRejection.toString()],\r\n [hasToString, (x: object) => x.toString()],\r\n [isInjectable, functionToString],\r\n [val(true), identity],\r\n ]) as (val: any) => string;\r\n\r\n function format(value: any) {\r\n if (isObject(value)) {\r\n if (seen.indexOf(value) !== -1) return '[circular ref]';\r\n seen.push(value);\r\n }\r\n return stringifyPattern(value);\r\n }\r\n\r\n if (isUndefined(o)) {\r\n // Workaround for IE & Edge Spec incompatibility where replacer function would not be called when JSON.stringify\r\n // is given `undefined` as value. To work around that, we simply detect `undefined` and bail out early by\r\n // manually stringifying it.\r\n return format(o);\r\n }\r\n\r\n return JSON.stringify(o, (key, value) => format(value)).replace(/\\\\\"/g, '\"');\r\n}\r\n\r\n/** Returns a function that splits a string on a character or substring */\r\nexport const beforeAfterSubstr =\r\n (char: string) =>\r\n (str: string): string[] => {\r\n if (!str) return ['', ''];\r\n const idx = str.indexOf(char);\r\n if (idx === -1) return [str, ''];\r\n return [str.substr(0, idx), str.substr(idx + 1)];\r\n };\r\n\r\nexport const hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/');\r\nexport const stripLastPathElement = (str: string) => str.replace(/\\/[^/]*$/, '');\r\nexport const splitHash = beforeAfterSubstr('#');\r\nexport const splitQuery = beforeAfterSubstr('?');\r\nexport const splitEqual = beforeAfterSubstr('=');\r\nexport const trimHashVal = (str: string) => (str ? str.replace(/^#/, '') : '');\r\n\r\n/**\r\n * Splits on a delimiter, but returns the delimiters in the array\r\n *\r\n * #### Example:\r\n * ```js\r\n * var splitOnSlashes = splitOnDelim('/');\r\n * splitOnSlashes(\"/foo\"); // [\"/\", \"foo\"]\r\n * splitOnSlashes(\"/foo/\"); // [\"/\", \"foo\", \"/\"]\r\n * ```\r\n */\r\nexport function splitOnDelim(delim: string) {\r\n const re = new RegExp('(' + delim + ')', 'g');\r\n return (str: string) => str.split(re).filter(identity);\r\n}\r\n\r\n/**\r\n * Reduce fn that joins neighboring strings\r\n *\r\n * Given an array of strings, returns a new array\r\n * where all neighboring strings have been joined.\r\n *\r\n * #### Example:\r\n * ```js\r\n * let arr = [\"foo\", \"bar\", 1, \"baz\", \"\", \"qux\" ];\r\n * arr.reduce(joinNeighborsR, []) // [\"foobar\", 1, \"bazqux\" ]\r\n * ```\r\n */\r\nexport function joinNeighborsR(acc: any[], x: any) {\r\n if (isString(tail(acc)) && isString(x)) return acc.slice(0, -1).concat(tail(acc) + x);\r\n return pushR(acc, x);\r\n}\r\n","/**\r\n * # Transition tracing (debug)\r\n *\r\n * Enable transition tracing to print transition information to the console,\r\n * in order to help debug your application.\r\n * Tracing logs detailed information about each Transition to your console.\r\n *\r\n * To enable tracing, import the [[Trace]] singleton and enable one or more categories.\r\n *\r\n * ### ES6\r\n * ```js\r\n * import {trace} from \"@uirouter/core\";\r\n * trace.enable(1, 5); // TRANSITION and VIEWCONFIG\r\n * ```\r\n *\r\n * ### CJS\r\n * ```js\r\n * let trace = require(\"@uirouter/core\").trace;\r\n * trace.enable(\"TRANSITION\", \"VIEWCONFIG\");\r\n * ```\r\n *\r\n * ### Globals\r\n * ```js\r\n * let trace = window[\"@uirouter/core\"].trace;\r\n * trace.enable(); // Trace everything (very verbose)\r\n * ```\r\n *\r\n * ### Angular 1:\r\n * ```js\r\n * app.run($trace => $trace.enable());\r\n * ```\r\n *\r\n * @packageDocumentation\r\n */\r\nimport { parse } from '../common/hof';\r\nimport { isNumber } from '../common/predicates';\r\nimport { Transition } from '../transition/transition';\r\nimport { ViewTuple } from '../view';\r\nimport { ActiveUIView, ViewConfig, ViewContext } from '../view/interface';\r\nimport { stringify, functionToString, maxLength, padString } from './strings';\r\nimport { safeConsole } from './safeConsole';\r\nimport { Resolvable } from '../resolve/resolvable';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { PolicyWhen } from '../resolve/interface';\r\nimport { TransitionHook } from '../transition/transitionHook';\r\nimport { HookResult } from '../transition/interface';\r\nimport { StateObject } from '../state/stateObject';\r\n\r\nfunction uiViewString(uiview: ActiveUIView) {\r\n if (!uiview) return 'ui-view (defunct)';\r\n const state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';\r\n return `[ui-view#${uiview.id} ${uiview.$type}:${uiview.fqn} (${uiview.name}@${state})]`;\r\n}\r\n\r\nconst viewConfigString = (viewConfig: ViewConfig) => {\r\n const view = viewConfig.viewDecl;\r\n const state = view.$context.name || '(root)';\r\n return `[View#${viewConfig.$id} from '${state}' state]: target ui-view: '${view.$uiViewName}@${view.$uiViewContextAnchor}'`;\r\n};\r\n\r\nfunction normalizedCat(input: Category | string): string {\r\n return isNumber(input) ? Category[input] : Category[Category[input]];\r\n}\r\n\r\n/**\r\n * Trace categories Enum\r\n *\r\n * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]\r\n *\r\n * `trace.enable(Category.TRANSITION)`\r\n *\r\n * These can also be provided using a matching string, or position ordinal\r\n *\r\n * `trace.enable(\"TRANSITION\")`\r\n *\r\n * `trace.enable(1)`\r\n */\r\nenum Category {\r\n RESOLVE,\r\n TRANSITION,\r\n HOOK,\r\n UIVIEW,\r\n VIEWCONFIG,\r\n}\r\n\r\nexport { Category };\r\n\r\nconst _tid = parse('$id');\r\nconst _rid = parse('router.$id');\r\n\r\nconst transLbl = (trans) => `Transition #${_tid(trans)}-${_rid(trans)}`;\r\n\r\n/**\r\n * Prints UI-Router Transition trace information to the console.\r\n */\r\nexport class Trace {\r\n /** @internal */\r\n approximateDigests: number;\r\n\r\n /** @internal */\r\n private _enabled: { [key: string]: boolean } = {};\r\n\r\n /** @internal */\r\n constructor() {\r\n this.approximateDigests = 0;\r\n }\r\n\r\n /** @internal */\r\n private _set(enabled: boolean, categories: Category[]) {\r\n if (!categories.length) {\r\n categories = <any>Object.keys(Category)\r\n .map((k) => parseInt(k, 10))\r\n .filter((k) => !isNaN(k))\r\n .map((key) => Category[key]);\r\n }\r\n categories.map(normalizedCat).forEach((category) => (this._enabled[category] = enabled));\r\n }\r\n\r\n /**\r\n * Enables a trace [[Category]]\r\n *\r\n * ```js\r\n * trace.enable(\"TRANSITION\");\r\n * ```\r\n *\r\n * @param categories categories to enable. If `categories` is omitted, all categories are enabled.\r\n * Also takes strings (category name) or ordinal (category position)\r\n */\r\n enable(...categories: (Category | string | number)[]);\r\n enable(...categories: any[]) {\r\n this._set(true, categories);\r\n }\r\n /**\r\n * Disables a trace [[Category]]\r\n *\r\n * ```js\r\n * trace.disable(\"VIEWCONFIG\");\r\n * ```\r\n *\r\n * @param categories categories to disable. If `categories` is omitted, all categories are disabled.\r\n * Also takes strings (category name) or ordinal (category position)\r\n */\r\n disable(...categories: (Category | string | number)[]);\r\n disable(...categories: any[]) {\r\n this._set(false, categories);\r\n }\r\n\r\n /**\r\n * Retrieves the enabled stateus of a [[Category]]\r\n *\r\n * ```js\r\n * trace.enabled(\"VIEWCONFIG\"); // true or false\r\n * ```\r\n *\r\n * @returns boolean true if the category is enabled\r\n */\r\n enabled(category: Category | string | number): boolean {\r\n return !!this._enabled[normalizedCat(category)];\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceTransitionStart(trans: Transition) {\r\n if (!this.enabled(Category.TRANSITION)) return;\r\n safeConsole.log(`${transLbl(trans)}: Started -> ${stringify(trans)}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceTransitionIgnored(trans: Transition) {\r\n if (!this.enabled(Category.TRANSITION)) return;\r\n safeConsole.log(`${transLbl(trans)}: Ignored <> ${stringify(trans)}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceHookInvocation(step: TransitionHook, trans: Transition, options: any) {\r\n if (!this.enabled(Category.HOOK)) return;\r\n const event = parse('traceData.hookType')(options) || 'internal',\r\n context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown',\r\n name = functionToString((step as any).registeredHook.callback);\r\n safeConsole.log(`${transLbl(trans)}: Hook -> ${event} context: ${context}, ${maxLength(200, name)}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceHookResult(hookResult: HookResult, trans: Transition, transitionOptions: any) {\r\n if (!this.enabled(Category.HOOK)) return;\r\n safeConsole.log(`${transLbl(trans)}: <- Hook returned: ${maxLength(200, stringify(hookResult))}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceResolvePath(path: PathNode[], when: PolicyWhen, trans?: Transition) {\r\n if (!this.enabled(Category.RESOLVE)) return;\r\n safeConsole.log(`${transLbl(trans)}: Resolving ${path} (${when})`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceResolvableResolved(resolvable: Resolvable, trans?: Transition) {\r\n if (!this.enabled(Category.RESOLVE)) return;\r\n safeConsole.log(\r\n `${transLbl(trans)}: <- Resolved ${resolvable} to: ${maxLength(200, stringify(resolvable.data))}`\r\n );\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceError(reason: any, trans: Transition) {\r\n if (!this.enabled(Category.TRANSITION)) return;\r\n safeConsole.log(`${transLbl(trans)}: <- Rejected ${stringify(trans)}, reason: ${reason}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceSuccess(finalState: StateObject, trans: Transition) {\r\n if (!this.enabled(Category.TRANSITION)) return;\r\n safeConsole.log(`${transLbl(trans)}: <- Success ${stringify(trans)}, final state: ${finalState.name}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceUIViewEvent(event: string, viewData: ActiveUIView, extra = '') {\r\n if (!this.enabled(Category.UIVIEW)) return;\r\n safeConsole.log(`ui-view: ${padString(30, event)} ${uiViewString(viewData)}${extra}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceUIViewConfigUpdated(viewData: ActiveUIView, context: ViewContext) {\r\n if (!this.enabled(Category.UIVIEW)) return;\r\n this.traceUIViewEvent('Updating', viewData, ` with ViewConfig from context='${context}'`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceUIViewFill(viewData: ActiveUIView, html: string) {\r\n if (!this.enabled(Category.UIVIEW)) return;\r\n this.traceUIViewEvent('Fill', viewData, ` with: ${maxLength(200, html)}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceViewSync(pairs: ViewTuple[]) {\r\n if (!this.enabled(Category.VIEWCONFIG)) return;\r\n const uivheader = 'uiview component fqn';\r\n const cfgheader = 'view config state (view name)';\r\n const mapping = pairs\r\n .map(({ uiView, viewConfig }) => {\r\n const uiv = uiView && uiView.fqn;\r\n const cfg = viewConfig && `${viewConfig.viewDecl.$context.name}: (${viewConfig.viewDecl.$name})`;\r\n return { [uivheader]: uiv, [cfgheader]: cfg };\r\n })\r\n .sort((a, b) => (a[uivheader] || '').localeCompare(b[uivheader] || ''));\r\n\r\n safeConsole.table(mapping);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceViewServiceEvent(event: string, viewConfig: ViewConfig) {\r\n if (!this.enabled(Category.VIEWCONFIG)) return;\r\n safeConsole.log(`VIEWCONFIG: ${event} ${viewConfigString(viewConfig)}`);\r\n }\r\n\r\n /** @internal called by ui-router code */\r\n traceViewServiceUIViewEvent(event: string, viewData: ActiveUIView) {\r\n if (!this.enabled(Category.VIEWCONFIG)) return;\r\n safeConsole.log(`VIEWCONFIG: ${event} ${uiViewString(viewData)}`);\r\n }\r\n}\r\n\r\n/**\r\n * The [[Trace]] singleton\r\n *\r\n * #### Example:\r\n * ```js\r\n * import {trace} from \"@uirouter/core\";\r\n * trace.enable(1, 5);\r\n * ```\r\n */\r\nconst trace = new Trace();\r\nexport { trace };\r\n","import { StateParams } from './params/stateParams';\r\nimport { StateDeclaration } from './state/interface';\r\nimport { StateObject } from './state/stateObject';\r\nimport { Transition } from './transition/transition';\r\nimport { Queue } from './common/queue';\r\nimport { Disposable } from './interface';\r\n\r\n/**\r\n * Global router state\r\n *\r\n * This is where we hold the global mutable state such as current state, current\r\n * params, current transition, etc.\r\n */\r\nexport class UIRouterGlobals implements Disposable {\r\n /**\r\n * Current parameter values\r\n *\r\n * The parameter values from the latest successful transition\r\n */\r\n params: StateParams = new StateParams();\r\n\r\n /**\r\n * Current state\r\n *\r\n * The to-state from the latest successful transition\r\n */\r\n current: StateDeclaration;\r\n\r\n /**\r\n * Current state (internal object)\r\n *\r\n * The to-state from the latest successful transition\r\n * @internal\r\n */\r\n $current: StateObject;\r\n\r\n /**\r\n * The current started/running transition.\r\n * This transition has reached at least the onStart phase, but is not yet complete\r\n */\r\n transition: Transition;\r\n\r\n /** @internal */\r\n lastStartedTransitionId = -1;\r\n\r\n /** @internal */\r\n transitionHistory = new Queue<Transition>([], 1);\r\n\r\n /** @internal */\r\n successfulTransitions = new Queue<Transition>([], 1);\r\n\r\n dispose() {\r\n this.transitionHistory.clear();\r\n this.successfulTransitions.clear();\r\n this.transition = null;\r\n }\r\n}\r\n","import { Transition } from '../transition/transition';\r\nimport { TransitionService } from '../transition/transitionService';\r\nimport { TransitionHookFn } from '../transition/interface';\r\nimport { StateDeclaration, LazyLoadResult } from '../state/interface';\r\nimport { services } from '../common/coreservices';\r\nimport { StateRule } from '../url/interface';\r\n\r\n/**\r\n * A [[TransitionHookFn]] that performs lazy loading\r\n *\r\n * When entering a state \"abc\" which has a `lazyLoad` function defined:\r\n * - Invoke the `lazyLoad` function (unless it is already in process)\r\n * - Flag the hook function as \"in process\"\r\n * - The function should return a promise (that resolves when lazy loading is complete)\r\n * - Wait for the promise to settle\r\n * - If the promise resolves to a [[LazyLoadResult]], then register those states\r\n * - Flag the hook function as \"not in process\"\r\n * - If the hook was successful\r\n * - Remove the `lazyLoad` function from the state declaration\r\n * - If all the hooks were successful\r\n * - Retry the transition (by returning a TargetState)\r\n *\r\n * ```\r\n * .state('abc', {\r\n * component: 'fooComponent',\r\n * lazyLoad: () => import('./fooComponent')\r\n * });\r\n * ```\r\n *\r\n * See [[StateDeclaration.lazyLoad]]\r\n */\r\nconst lazyLoadHook: TransitionHookFn = (transition: Transition) => {\r\n const router = transition.router;\r\n\r\n function retryTransition() {\r\n if (transition.originalTransition().options().source !== 'url') {\r\n // The original transition was not triggered via url sync\r\n // The lazy state should be loaded now, so re-try the original transition\r\n const orig = transition.targetState();\r\n return router.stateService.target(orig.identifier(), orig.params(), orig.options());\r\n }\r\n\r\n // The original transition was triggered via url sync\r\n // Run the URL rules and find the best match\r\n const $url = router.urlService;\r\n const result = $url.match($url.parts());\r\n const rule = result && result.rule;\r\n\r\n // If the best match is a state, redirect the transition (instead\r\n // of calling sync() which supersedes the current transition)\r\n if (rule && rule.type === 'STATE') {\r\n const state = (rule as StateRule).state;\r\n const params = result.match;\r\n return router.stateService.target(state, params, transition.options());\r\n }\r\n\r\n // No matching state found, so let .sync() choose the best non-state match/otherwise\r\n router.urlService.sync();\r\n }\r\n\r\n const promises = transition\r\n .entering()\r\n .filter((state) => !!state.$$state().lazyLoad)\r\n .map((state) => lazyLoadState(transition, state));\r\n\r\n return services.$q.all(promises).then(retryTransition);\r\n};\r\n\r\nexport const registerLazyLoadHook = (transitionService: TransitionService) =>\r\n transitionService.onBefore({ entering: (state) => !!state.lazyLoad }, lazyLoadHook);\r\n\r\n/**\r\n * Invokes a state's lazy load function\r\n *\r\n * @param transition a Transition context\r\n * @param state the state to lazy load\r\n * @returns A promise for the lazy load result\r\n */\r\nexport function lazyLoadState(transition: Transition, state: StateDeclaration): Promise<LazyLoadResult> {\r\n const lazyLoadFn = state.$$state().lazyLoad;\r\n\r\n // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked\r\n let promise = lazyLoadFn['_promise'];\r\n if (!promise) {\r\n const success = (result) => {\r\n delete state.lazyLoad;\r\n delete state.$$state().lazyLoad;\r\n delete lazyLoadFn['_promise'];\r\n return result;\r\n };\r\n\r\n const error = (err) => {\r\n delete lazyLoadFn['_promise'];\r\n return services.$q.reject(err);\r\n };\r\n\r\n promise = lazyLoadFn['_promise'] = services.$q\r\n .when(lazyLoadFn(transition, state))\r\n .then(updateStateRegistry)\r\n .then(success, error);\r\n }\r\n\r\n /** Register any lazy loaded state definitions */\r\n function updateStateRegistry(result: LazyLoadResult) {\r\n if (result && Array.isArray(result.states)) {\r\n result.states.forEach((_state) => transition.router.stateRegistry.register(_state));\r\n }\r\n return result;\r\n }\r\n\r\n return promise;\r\n}\r\n","import { extend, filter, map, allTrueR, find } from '../common/common';\r\nimport { prop } from '../common/hof';\r\nimport { isInjectable, isDefined, isString, isArray, isUndefined } from '../common/predicates';\r\nimport { RawParams, ParamDeclaration } from '../params/interface';\r\nimport { services } from '../common/coreservices';\r\nimport { ParamType } from './paramType';\r\nimport { ParamTypes } from './paramTypes';\r\nimport { StateDeclaration } from '../state';\r\nimport { UrlConfig } from '../url';\r\n\r\nconst hasOwn = Object.prototype.hasOwnProperty;\r\n\r\nconst isShorthand = (cfg: ParamDeclaration) =>\r\n ['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0;\r\n\r\nenum DefType {\r\n PATH,\r\n SEARCH,\r\n CONFIG,\r\n}\r\nexport { DefType };\r\n\r\nfunction getParamDeclaration(paramName: string, location: DefType, state: StateDeclaration): ParamDeclaration {\r\n const noReloadOnSearch = (state.reloadOnSearch === false && location === DefType.SEARCH) || undefined;\r\n const dynamic = find([state.dynamic, noReloadOnSearch], isDefined);\r\n const defaultConfig = isDefined(dynamic) ? { dynamic } : {};\r\n const paramConfig = unwrapShorthand(state && state.params && state.params[paramName]);\r\n return extend(defaultConfig, paramConfig);\r\n}\r\n\r\nfunction unwrapShorthand(cfg: ParamDeclaration): ParamDeclaration {\r\n cfg = isShorthand(cfg) ? ({ value: cfg } as ParamDeclaration) : cfg;\r\n\r\n getStaticDefaultValue['__cacheable'] = true;\r\n function getStaticDefaultValue() {\r\n return cfg.value;\r\n }\r\n\r\n const $$fn = isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue;\r\n return extend(cfg, { $$fn });\r\n}\r\n\r\nfunction getType(cfg: ParamDeclaration, urlType: ParamType, location: DefType, id: string, paramTypes: ParamTypes) {\r\n if (cfg.type && urlType && urlType.name !== 'string') throw new Error(`Param '${id}' has two type configurations.`);\r\n if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type as string))\r\n return paramTypes.type(cfg.type as string);\r\n if (urlType) return urlType;\r\n if (!cfg.type) {\r\n const type =\r\n location === DefType.CONFIG\r\n ? 'any'\r\n : location === DefType.PATH\r\n ? 'path'\r\n : location === DefType.SEARCH\r\n ? 'query'\r\n : 'string';\r\n return paramTypes.type(type);\r\n }\r\n return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type as string);\r\n}\r\n\r\n/** returns false, true, or the squash value to indicate the \"default parameter url squash policy\". */\r\nfunction getSquashPolicy(config: ParamDeclaration, isOptional: boolean, defaultPolicy: boolean | string) {\r\n const squash = config.squash;\r\n if (!isOptional || squash === false) return false;\r\n if (!isDefined(squash) || squash == null) return defaultPolicy;\r\n if (squash === true || isString(squash)) return squash;\r\n throw new Error(`Invalid squash policy: '${squash}'. Valid policies: false, true, or arbitrary string`);\r\n}\r\n\r\nfunction getReplace(config: ParamDeclaration, arrayMode: boolean, isOptional: boolean, squash: string | boolean) {\r\n const defaultPolicy = [\r\n { from: '', to: isOptional || arrayMode ? undefined : '' },\r\n { from: null, to: isOptional || arrayMode ? undefined : '' },\r\n ];\r\n\r\n const replace = isArray(config.replace) ? config.replace : [];\r\n if (isString(squash)) replace.push({ from: squash, to: undefined });\r\n\r\n const configuredKeys = map(replace, prop('from'));\r\n return filter(defaultPolicy, (item) => configuredKeys.indexOf(item.from) === -1).concat(replace);\r\n}\r\n\r\nexport class Param {\r\n id: string;\r\n type: ParamType;\r\n location: DefType;\r\n isOptional: boolean;\r\n dynamic: boolean;\r\n raw: boolean;\r\n squash: boolean | string;\r\n replace: [{ to: any; from: any }];\r\n inherit: boolean;\r\n array: boolean;\r\n config: any;\r\n /** Cache the default value if it is a static value */\r\n _defaultValueCache: {\r\n defaultValue: any;\r\n };\r\n\r\n static values(params: Param[], values: RawParams = {}): RawParams {\r\n const paramValues = {} as RawParams;\r\n for (const param of params) {\r\n paramValues[param.id] = param.value(values[param.id]);\r\n }\r\n return paramValues;\r\n }\r\n\r\n /**\r\n * Finds [[Param]] objects which have different param values\r\n *\r\n * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects\r\n *\r\n * @param params: The list of Param objects to filter\r\n * @param values1: The first set of parameter values\r\n * @param values2: the second set of parameter values\r\n *\r\n * @returns any Param objects whose values were different between values1 and values2\r\n */\r\n static changed(params: Param[], values1: RawParams = {}, values2: RawParams = {}): Param[] {\r\n return params.filter((param) => !param.type.equals(values1[param.id], values2[param.id]));\r\n }\r\n\r\n /**\r\n * Checks if two param value objects are equal (for a set of [[Param]] objects)\r\n *\r\n * @param params The list of [[Param]] objects to check\r\n * @param values1 The first set of param values\r\n * @param values2 The second set of param values\r\n *\r\n * @returns true if the param values in values1 and values2 are equal\r\n */\r\n static equals(params: Param[], values1 = {}, values2 = {}): boolean {\r\n return Param.changed(params, values1, values2).length === 0;\r\n }\r\n\r\n /** Returns true if a the parameter values are valid, according to the Param definitions */\r\n static validates(params: Param[], values: RawParams = {}): boolean {\r\n return params.map((param) => param.validates(values[param.id])).reduce(allTrueR, true);\r\n }\r\n\r\n constructor(id: string, type: ParamType, location: DefType, urlConfig: UrlConfig, state: StateDeclaration) {\r\n const config: ParamDeclaration = getParamDeclaration(id, location, state);\r\n type = getType(config, type, location, id, urlConfig.paramTypes);\r\n const arrayMode = getArrayMode();\r\n type = arrayMode ? type.$asArray(arrayMode, location === DefType.SEARCH) : type;\r\n const isOptional = config.value !== undefined || location === DefType.SEARCH;\r\n const dynamic = isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic;\r\n const raw = isDefined(config.raw) ? !!config.raw : !!type.raw;\r\n const squash = getSquashPolicy(config, isOptional, urlConfig.defaultSquashPolicy());\r\n const replace = getReplace(config, arrayMode, isOptional, squash);\r\n const inherit = isDefined(config.inherit) ? !!config.inherit : !!type.inherit;\r\n\r\n // array config: param name (param[]) overrides default settings. explicit config overrides param name.\r\n function getArrayMode() {\r\n const arrayDefaults = { array: location === DefType.SEARCH ? 'auto' : false };\r\n const arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\r\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\r\n }\r\n\r\n extend(this, { id, type, location, isOptional, dynamic, raw, squash, replace, inherit, array: arrayMode, config });\r\n }\r\n\r\n isDefaultValue(value: any): boolean {\r\n return this.isOptional && this.type.equals(this.value(), value);\r\n }\r\n\r\n /**\r\n * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\r\n * default value, which may be the result of an injectable function.\r\n */\r\n value(value?: any): any {\r\n /**\r\n * [Internal] Get the default value of a parameter, which may be an injectable function.\r\n */\r\n const getDefaultValue = () => {\r\n if (this._defaultValueCache) return this._defaultValueCache.defaultValue;\r\n\r\n if (!services.$injector) throw new Error('Injectable functions cannot be called at configuration time');\r\n\r\n const defaultValue = services.$injector.invoke(this.config.$$fn);\r\n\r\n if (defaultValue !== null && defaultValue !== undefined && !this.type.is(defaultValue))\r\n throw new Error(\r\n `Default value (${defaultValue}) for parameter '${this.id}' is not an instance of ParamType (${this.type.name})`\r\n );\r\n\r\n if (this.config.$$fn['__cacheable']) {\r\n this._defaultValueCache = { defaultValue };\r\n }\r\n\r\n return defaultValue;\r\n };\r\n\r\n const replaceSpecialValues = (val: any) => {\r\n for (const tuple of this.replace) {\r\n if (tuple.from === val) return tuple.to;\r\n }\r\n return val;\r\n };\r\n\r\n value = replaceSpecialValues(value);\r\n\r\n return isUndefined(value) ? getDefaultValue() : this.type.$normalize(value);\r\n }\r\n\r\n isSearch(): boolean {\r\n return this.location === DefType.SEARCH;\r\n }\r\n\r\n validates(value: any): boolean {\r\n // There was no parameter value, but the param is optional\r\n if ((isUndefined(value) || value === null) && this.isOptional) return true;\r\n\r\n // The value was not of the correct ParamType, and could not be decoded to the correct ParamType\r\n const normalized = this.type.$normalize(value);\r\n if (!this.type.is(normalized)) return false;\r\n\r\n // The value was of the correct type, but when encoded, did not match the ParamType's regexp\r\n const encoded = this.type.encode(normalized);\r\n return !(isString(encoded) && !this.type.pattern.exec(<string>encoded));\r\n }\r\n\r\n toString() {\r\n return `{Param:${this.id} ${this.type} squash: '${this.squash}' optional: ${this.isOptional}}`;\r\n }\r\n}\r\n","import { extend, filter, map } from '../common/common';\r\nimport { isArray, isDefined } from '../common/predicates';\r\nimport { ParamTypeDefinition } from './interface';\r\n\r\n/**\r\n * An internal class which implements [[ParamTypeDefinition]].\r\n *\r\n * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types.\r\n * When a param type definition is registered, an instance of this class is created internally.\r\n *\r\n * This class has naive implementations for all the [[ParamTypeDefinition]] methods.\r\n *\r\n * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var paramTypeDef = {\r\n * decode: function(val) { return parseInt(val, 10); },\r\n * encode: function(val) { return val && val.toString(); },\r\n * equals: function(a, b) { return this.is(a) && a === b; },\r\n * is: function(val) { return angular.isNumber(val) && isFinite(val) && val % 1 === 0; },\r\n * pattern: /\\d+/\r\n * }\r\n *\r\n * var paramType = new ParamType(paramTypeDef);\r\n * ```\r\n */\r\nexport class ParamType implements ParamTypeDefinition {\r\n /** @inheritdoc */\r\n pattern: RegExp = /.*/;\r\n /** The name/id of the parameter type */\r\n name: string;\r\n /** @inheritdoc */\r\n raw: boolean;\r\n /** @inheritdoc */\r\n dynamic: boolean;\r\n /** @inheritdoc */\r\n inherit = true;\r\n\r\n /**\r\n * @param def A configuration object which contains the custom type definition. The object's\r\n * properties will override the default methods and/or pattern in `ParamType`'s public interface.\r\n * @returns a new ParamType object\r\n */\r\n constructor(def: ParamTypeDefinition) {\r\n extend(this, def);\r\n }\r\n\r\n // consider these four methods to be \"abstract methods\" that should be overridden\r\n /** @inheritdoc */\r\n is(val: any, key?: string): boolean {\r\n return true;\r\n }\r\n /** @inheritdoc */\r\n encode(val: any, key?: string): string | string[] {\r\n return val;\r\n }\r\n /** @inheritdoc */\r\n decode(val: string, key?: string): any {\r\n return val;\r\n }\r\n /** @inheritdoc */\r\n equals(a: any, b: any): boolean {\r\n // tslint:disable-next-line:triple-equals\r\n return a == b;\r\n }\r\n\r\n $subPattern() {\r\n const sub = this.pattern.toString();\r\n return sub.substr(1, sub.length - 2);\r\n }\r\n\r\n toString() {\r\n return `{ParamType:${this.name}}`;\r\n }\r\n\r\n /** Given an encoded string, or a decoded object, returns a decoded object */\r\n $normalize(val: any) {\r\n return this.is(val) ? val : this.decode(val);\r\n }\r\n\r\n /**\r\n * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.\r\n * e.g.:\r\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\r\n * - url: \"/path?queryParam=1&queryParam=2\r\n * - $stateParams.queryParam will be [1, 2]\r\n * if `mode` is \"auto\", then\r\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\r\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\r\n */\r\n $asArray(mode: boolean | 'auto', isSearch: boolean) {\r\n if (!mode) return this;\r\n if (mode === 'auto' && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\r\n return new (<any>ArrayType)(this, mode);\r\n }\r\n}\r\n\r\n/** Wraps up a `ParamType` object to handle array values. */\r\nfunction ArrayType(type: ParamType, mode: boolean | 'auto') {\r\n // Wrap non-array value as array\r\n function arrayWrap(val: any): any[] {\r\n return isArray(val) ? val : isDefined(val) ? [val] : [];\r\n }\r\n\r\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\r\n function arrayUnwrap(val: any) {\r\n switch (val.length) {\r\n case 0:\r\n return undefined;\r\n case 1:\r\n return mode === 'auto' ? val[0] : val;\r\n default:\r\n return val;\r\n }\r\n }\r\n\r\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\r\n function arrayHandler(callback: (x: any) => any, allTruthyMode?: boolean) {\r\n return function handleArray(val: any) {\r\n if (isArray(val) && val.length === 0) return val;\r\n const arr = arrayWrap(val);\r\n const result = map(arr, callback);\r\n return allTruthyMode === true ? filter(result, (x) => !x).length === 0 : arrayUnwrap(result);\r\n };\r\n }\r\n\r\n // Wraps type (.equals) functions to operate on each value of an array\r\n function arrayEqualsHandler(callback: (l: any, r: any) => boolean) {\r\n return function handleArray(val1: any, val2: any) {\r\n const left = arrayWrap(val1),\r\n right = arrayWrap(val2);\r\n if (left.length !== right.length) return false;\r\n for (let i = 0; i < left.length; i++) {\r\n if (!callback(left[i], right[i])) return false;\r\n }\r\n return true;\r\n };\r\n }\r\n\r\n ['encode', 'decode', 'equals', '$normalize'].forEach((name) => {\r\n const paramTypeFn = type[name].bind(type);\r\n const wrapperFn: Function = name === 'equals' ? arrayEqualsHandler : arrayHandler;\r\n this[name] = wrapperFn(paramTypeFn);\r\n });\r\n\r\n extend(this, {\r\n dynamic: type.dynamic,\r\n name: type.name,\r\n pattern: type.pattern,\r\n inherit: type.inherit,\r\n raw: type.raw,\r\n is: arrayHandler(type.is.bind(type), true),\r\n $arrayMode: mode,\r\n });\r\n}\r\n","import { fromJson, toJson, identity, equals, inherit, map, extend, pick } from '../common/common';\r\nimport { isDefined, isNullOrUndefined } from '../common/predicates';\r\nimport { is } from '../common/hof';\r\nimport { services } from '../common/coreservices';\r\nimport { ParamType } from './paramType';\r\nimport { ParamTypeDefinition } from './interface';\r\n\r\n/**\r\n * A registry for parameter types.\r\n *\r\n * This registry manages the built-in (and custom) parameter types.\r\n *\r\n * The built-in parameter types are:\r\n *\r\n * - [[string]]\r\n * - [[path]]\r\n * - [[query]]\r\n * - [[hash]]\r\n * - [[int]]\r\n * - [[bool]]\r\n * - [[date]]\r\n * - [[json]]\r\n * - [[any]]\r\n *\r\n * To register custom parameter types, use [[UrlConfig.type]], i.e.,\r\n *\r\n * ```js\r\n * router.urlService.config.type(customType)\r\n * ```\r\n */\r\nexport class ParamTypes {\r\n /**\r\n * Built-in parameter type: `string`\r\n *\r\n * This parameter type coerces values to strings.\r\n * It matches anything (`new RegExp(\".*\")`) in the URL\r\n */\r\n static string: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `path`\r\n *\r\n * This parameter type is the default type for path parameters.\r\n * A path parameter is any parameter declared in the path portion of a url\r\n *\r\n * - `/foo/:param1/:param2`: two path parameters\r\n *\r\n * This parameter type behaves exactly like the [[string]] type with one exception.\r\n * When matching parameter values in the URL, the `path` type does not match forward slashes `/`.\r\n *\r\n * #### Angular 1 note:\r\n * In ng1, this type is overridden with one that pre-encodes slashes as `~2F` instead of `%2F`.\r\n * For more details about this angular 1 behavior, see: https://github.com/angular-ui/ui-router/issues/2598\r\n */\r\n static path: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `query`\r\n *\r\n * This parameter type is the default type for query/search parameters.\r\n * It behaves the same as the [[string]] parameter type.\r\n *\r\n * A query parameter is any parameter declared in the query/search portion of a url\r\n *\r\n * - `/bar?param2`: a query parameter\r\n */\r\n static query: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `hash`\r\n *\r\n * This parameter type is used for the `#` parameter (the hash)\r\n * It behaves the same as the [[string]] parameter type.\r\n */\r\n static hash: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `int`\r\n *\r\n * This parameter type serializes javascript integers (`number`s which represent an integer) to the URL.\r\n *\r\n * #### Example:\r\n * ```js\r\n * .state({\r\n * name: 'user',\r\n * url: '/user/{id:int}'\r\n * });\r\n * ```\r\n * ```js\r\n * $state.go('user', { id: 1298547 });\r\n * ```\r\n *\r\n * The URL will serialize to: `/user/1298547`.\r\n *\r\n * When the parameter value is read, it will be the `number` `1298547`, not the string `\"1298547\"`.\r\n */\r\n static int: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `bool`\r\n *\r\n * This parameter type serializes `true`/`false` as `1`/`0`\r\n *\r\n * #### Example:\r\n * ```js\r\n * .state({\r\n * name: 'inbox',\r\n * url: '/inbox?{unread:bool}'\r\n * });\r\n * ```\r\n * ```js\r\n * $state.go('inbox', { unread: true });\r\n * ```\r\n *\r\n * The URL will serialize to: `/inbox?unread=1`.\r\n *\r\n * Conversely, if the url is `/inbox?unread=0`, the value of the `unread` parameter will be a `false`.\r\n */\r\n static bool: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `date`\r\n *\r\n * This parameter type can be used to serialize Javascript dates as parameter values.\r\n *\r\n * #### Example:\r\n * ```js\r\n * .state({\r\n * name: 'search',\r\n * url: '/search?{start:date}'\r\n * });\r\n * ```\r\n * ```js\r\n * $state.go('search', { start: new Date(2000, 0, 1) });\r\n * ```\r\n *\r\n * The URL will serialize to: `/search?start=2000-01-01`.\r\n *\r\n * Conversely, if the url is `/search?start=2016-12-25`, the value of the `start` parameter will be a `Date` object where:\r\n *\r\n * - `date.getFullYear() === 2016`\r\n * - `date.getMonth() === 11` (month is 0-based)\r\n * - `date.getDate() === 25`\r\n */\r\n static date: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `json`\r\n *\r\n * This parameter type can be used to serialize javascript objects into the URL using JSON serialization.\r\n *\r\n * #### Example:\r\n * This example serializes an plain javascript object to the URL\r\n * ```js\r\n * .state({\r\n * name: 'map',\r\n * url: '/map/{coords:json}'\r\n * });\r\n * ```\r\n * ```js\r\n * $state.go('map', { coords: { x: 10399.2, y: 49071 });\r\n * ```\r\n *\r\n * The URL will serialize to: `/map/%7B%22x%22%3A10399.2%2C%22y%22%3A49071%7D`\r\n */\r\n static json: ParamTypeDefinition;\r\n\r\n /**\r\n * Built-in parameter type: `any`\r\n *\r\n * This parameter type is used by default for url-less parameters (parameters that do not appear in the URL).\r\n * This type does not encode or decode.\r\n * It is compared using a deep `equals` comparison.\r\n *\r\n * #### Example:\r\n * This example defines a non-url parameter on a [[StateDeclaration]].\r\n * ```js\r\n * .state({\r\n * name: 'new',\r\n * url: '/new',\r\n * params: {\r\n * inrepyto: null\r\n * }\r\n * });\r\n * ```\r\n * ```js\r\n * $state.go('new', { inreplyto: currentMessage });\r\n * ```\r\n */\r\n static any: ParamTypeDefinition;\r\n\r\n types: any;\r\n enqueue = true;\r\n typeQueue: any[] = [];\r\n\r\n private defaultTypes: any = pick(ParamTypes.prototype, [\r\n 'hash',\r\n 'string',\r\n 'query',\r\n 'path',\r\n 'int',\r\n 'bool',\r\n 'date',\r\n 'json',\r\n 'any',\r\n ]);\r\n\r\n constructor() {\r\n // Register default types. Store them in the prototype of this.types.\r\n const makeType = (definition: ParamTypeDefinition, name: string) => new ParamType(extend({ name }, definition));\r\n this.types = inherit(map(this.defaultTypes, makeType), {});\r\n }\r\n\r\n dispose() {\r\n this.types = {};\r\n }\r\n\r\n /**\r\n * Registers a parameter type\r\n *\r\n * End users should call [[UrlMatcherFactory.type]], which delegates to this method.\r\n */\r\n type(name: string, definition?: ParamTypeDefinition, definitionFn?: () => ParamTypeDefinition) {\r\n if (!isDefined(definition)) return this.types[name];\r\n if (this.types.hasOwnProperty(name)) throw new Error(`A type named '${name}' has already been defined.`);\r\n\r\n this.types[name] = new ParamType(extend({ name }, definition));\r\n\r\n if (definitionFn) {\r\n this.typeQueue.push({ name, def: definitionFn });\r\n if (!this.enqueue) this._flushTypeQueue();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n _flushTypeQueue() {\r\n while (this.typeQueue.length) {\r\n const type = this.typeQueue.shift();\r\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\r\n extend(this.types[type.name], services.$injector.invoke(type.def));\r\n }\r\n }\r\n}\r\n\r\nfunction initDefaultTypes() {\r\n const makeDefaultType = (def) => {\r\n const valToString = (val: any) => (val != null ? val.toString() : val);\r\n\r\n const defaultTypeBase = {\r\n encode: valToString,\r\n decode: valToString,\r\n is: is(String),\r\n pattern: /.*/,\r\n // tslint:disable-next-line:triple-equals\r\n equals: (a: any, b: any) => a == b, // allow coersion for null/undefined/\"\"\r\n };\r\n\r\n return extend({}, defaultTypeBase, def) as ParamTypeDefinition;\r\n };\r\n\r\n // Default Parameter Type Definitions\r\n extend(ParamTypes.prototype, {\r\n string: makeDefaultType({}),\r\n\r\n path: makeDefaultType({\r\n pattern: /[^/]*/,\r\n }),\r\n\r\n query: makeDefaultType({}),\r\n\r\n hash: makeDefaultType({\r\n inherit: false,\r\n }),\r\n\r\n int: makeDefaultType({\r\n decode: (val: string) => parseInt(val, 10),\r\n is: function (val: any) {\r\n return !isNullOrUndefined(val) && this.decode(val.toString()) === val;\r\n },\r\n pattern: /-?\\d+/,\r\n }),\r\n\r\n bool: makeDefaultType({\r\n encode: (val: any) => (val && 1) || 0,\r\n decode: (val: string) => parseInt(val, 10) !== 0,\r\n is: is(Boolean),\r\n pattern: /0|1/,\r\n }),\r\n\r\n date: makeDefaultType({\r\n encode: function (val: any) {\r\n return !this.is(val)\r\n ? undefined\r\n : [val.getFullYear(), ('0' + (val.getMonth() + 1)).slice(-2), ('0' + val.getDate()).slice(-2)].join('-');\r\n },\r\n decode: function (val: string) {\r\n if (this.is(val)) return (<any>val) as Date;\r\n const match = this.capture.exec(val);\r\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\r\n },\r\n is: (val: any) => val instanceof Date && !isNaN(val.valueOf()),\r\n equals(l: any, r: any) {\r\n return ['getFullYear', 'getMonth', 'getDate'].reduce((acc, fn) => acc && l[fn]() === r[fn](), true);\r\n },\r\n pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\r\n capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/,\r\n }),\r\n\r\n json: makeDefaultType({\r\n encode: toJson,\r\n decode: fromJson,\r\n is: is(Object),\r\n equals: equals,\r\n pattern: /[^/]*/,\r\n }),\r\n\r\n // does not encode/decode\r\n any: makeDefaultType({\r\n encode: identity,\r\n decode: identity,\r\n is: () => true,\r\n equals: equals,\r\n }),\r\n });\r\n}\r\n\r\ninitDefaultTypes();\r\n","import { Param } from '.';\r\nimport { extend, ancestors, Obj } from '../common/common';\r\nimport { StateObject } from '../state/stateObject';\r\n\r\nexport class StateParams {\r\n [key: string]: any;\r\n\r\n constructor(params: Obj = {}) {\r\n extend(this, params);\r\n }\r\n\r\n /**\r\n * Merges a set of parameters with all parameters inherited between the common parents of the\r\n * current state and a given destination state.\r\n *\r\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\r\n * @param {Object} $current Internal definition of object representing the current state.\r\n * @param {Object} $to Internal definition of object representing state to transition to.\r\n */\r\n $inherit(newParams: Obj, $current: StateObject, $to: StateObject) {\r\n const parents = ancestors($current, $to),\r\n inherited: Obj = {},\r\n inheritList: string[] = [];\r\n\r\n for (const i in parents) {\r\n if (!parents[i] || !parents[i].params) continue;\r\n const parentParams = parents[i].params;\r\n const parentParamsKeys = Object.keys(parentParams);\r\n if (!parentParamsKeys.length) continue;\r\n\r\n for (const j in parentParamsKeys) {\r\n if (parentParams[parentParamsKeys[j]].inherit == false || inheritList.indexOf(parentParamsKeys[j]) >= 0)\r\n continue;\r\n inheritList.push(parentParamsKeys[j]);\r\n inherited[parentParamsKeys[j]] = this[parentParamsKeys[j]];\r\n }\r\n }\r\n return extend({}, inherited, newParams);\r\n }\r\n}\r\n","import { extend, applyPairs, find, allTrueR, pairs, arrayTuples } from '../common/common';\r\nimport { propEq } from '../common/hof';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { RawParams } from '../params/interface';\r\nimport { Param } from '../params/param';\r\nimport { Resolvable } from '../resolve/resolvable';\r\nimport { ViewConfig } from '../view/interface';\r\n\r\n/**\r\n * A node in a [[TreeChanges]] path\r\n *\r\n * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path.\r\n * Each PathNode corresponds to a state being entered, exited, or retained.\r\n * The stateful information includes parameter values and resolve data.\r\n */\r\nexport class PathNode {\r\n /** The state being entered, exited, or retained */\r\n public state: StateObject;\r\n /** The parameters declared on the state */\r\n public paramSchema: Param[];\r\n /** The parameter values that belong to the state */\r\n public paramValues: { [key: string]: any };\r\n /** The individual (stateful) resolvable objects that belong to the state */\r\n public resolvables: Resolvable[];\r\n /** The state's declared view configuration objects */\r\n public views: ViewConfig[];\r\n\r\n /**\r\n * Returns a clone of the PathNode\r\n * @deprecated use instance method `node.clone()`\r\n */\r\n static clone = (node: PathNode) => node.clone();\r\n\r\n /** Creates a copy of a PathNode */\r\n constructor(node: PathNode);\r\n /** Creates a new (empty) PathNode for a State */\r\n constructor(state: StateObject);\r\n constructor(stateOrNode: any) {\r\n if (stateOrNode instanceof PathNode) {\r\n const node: PathNode = stateOrNode;\r\n this.state = node.state;\r\n this.paramSchema = node.paramSchema.slice();\r\n this.paramValues = extend({}, node.paramValues);\r\n this.resolvables = node.resolvables.slice();\r\n this.views = node.views && node.views.slice();\r\n } else {\r\n const state: StateObject = stateOrNode;\r\n this.state = state;\r\n this.paramSchema = state.parameters({ inherit: false });\r\n this.paramValues = {};\r\n this.resolvables = state.resolvables.map((res) => res.clone());\r\n }\r\n }\r\n\r\n clone() {\r\n return new PathNode(this);\r\n }\r\n\r\n /** Sets [[paramValues]] for the node, from the values of an object hash */\r\n applyRawParams(params: RawParams): PathNode {\r\n const getParamVal = (paramDef: Param) => [paramDef.id, paramDef.value(params[paramDef.id])];\r\n this.paramValues = this.paramSchema.reduce((memo, pDef) => applyPairs(memo, getParamVal(pDef)), {});\r\n return this;\r\n }\r\n\r\n /** Gets a specific [[Param]] metadata that belongs to the node */\r\n parameter(name: string): Param {\r\n return find(this.paramSchema, propEq('id', name));\r\n }\r\n\r\n /**\r\n * @returns true if the state and parameter values for another PathNode are\r\n * equal to the state and param values for this PathNode\r\n */\r\n equals(node: PathNode, paramsFn?: GetParamsFn): boolean {\r\n const diff = this.diff(node, paramsFn);\r\n return diff && diff.length === 0;\r\n }\r\n\r\n /**\r\n * Finds Params with different parameter values on another PathNode.\r\n *\r\n * Given another node (of the same state), finds the parameter values which differ.\r\n * Returns the [[Param]] (schema objects) whose parameter values differ.\r\n *\r\n * Given another node for a different state, returns `false`\r\n *\r\n * @param node The node to compare to\r\n * @param paramsFn A function that returns which parameters should be compared.\r\n * @returns The [[Param]]s which differ, or null if the two nodes are for different states\r\n */\r\n diff(node: PathNode, paramsFn?: GetParamsFn): Param[] | false {\r\n if (this.state !== node.state) return false;\r\n\r\n const params: Param[] = paramsFn ? paramsFn(this) : this.paramSchema;\r\n return Param.changed(params, this.paramValues, node.paramValues);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type GetParamsFn = (pathNode: PathNode) => Param[];\r\n","import {\r\n extend,\r\n find,\r\n pick,\r\n omit,\r\n tail,\r\n mergeR,\r\n values,\r\n unnestR,\r\n Predicate,\r\n inArray,\r\n arrayTuples,\r\n} from '../common/common';\r\nimport { prop, propEq, not } from '../common/hof';\r\n\r\nimport { RawParams } from '../params/interface';\r\nimport { TreeChanges } from '../transition/interface';\r\nimport { ViewConfig } from '../view/interface';\r\nimport { _ViewDeclaration } from '../state/interface';\r\n\r\nimport { StateObject } from '../state/stateObject';\r\nimport { TargetState } from '../state/targetState';\r\nimport { GetParamsFn, PathNode } from './pathNode';\r\nimport { ViewService } from '../view/view';\r\nimport { Param } from '../params/param';\r\nimport { StateRegistry } from '../state';\r\n\r\n/**\r\n * This class contains functions which convert TargetStates, Nodes and paths from one type to another.\r\n */\r\nexport class PathUtils {\r\n /** Given a PathNode[], create an TargetState */\r\n static makeTargetState(registry: StateRegistry, path: PathNode[]): TargetState {\r\n const state = tail(path).state;\r\n return new TargetState(registry, state, path.map(prop('paramValues')).reduce(mergeR, {}), {});\r\n }\r\n\r\n static buildPath(targetState: TargetState) {\r\n const toParams = targetState.params();\r\n return targetState.$state().path.map((state) => new PathNode(state).applyRawParams(toParams));\r\n }\r\n\r\n /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */\r\n static buildToPath(fromPath: PathNode[], targetState: TargetState): PathNode[] {\r\n const toPath: PathNode[] = PathUtils.buildPath(targetState);\r\n if (targetState.options().inherit) {\r\n return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params()));\r\n }\r\n return toPath;\r\n }\r\n\r\n /**\r\n * Creates ViewConfig objects and adds to nodes.\r\n *\r\n * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state\r\n */\r\n static applyViewConfigs($view: ViewService, path: PathNode[], states: StateObject[]) {\r\n // Only apply the viewConfigs to the nodes for the given states\r\n path\r\n .filter((node) => inArray(states, node.state))\r\n .forEach((node) => {\r\n const viewDecls: _ViewDeclaration[] = values(node.state.views || {});\r\n const subPath = PathUtils.subPath(path, (n) => n === node);\r\n const viewConfigs: ViewConfig[][] = viewDecls.map((view) => $view.createViewConfig(subPath, view));\r\n node.views = viewConfigs.reduce(unnestR, []);\r\n });\r\n }\r\n\r\n /**\r\n * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath\r\n *\r\n * For a parameter in a node to be inherited from the from path:\r\n * - The toPath's node must have a matching node in the fromPath (by state).\r\n * - The parameter name must not be found in the toKeys parameter array.\r\n *\r\n * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some\r\n * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,\r\n * it is not inherited from the fromPath.\r\n */\r\n static inheritParams(fromPath: PathNode[], toPath: PathNode[], toKeys: string[] = []): PathNode[] {\r\n function nodeParamVals(path: PathNode[], state: StateObject): RawParams {\r\n const node: PathNode = find(path, propEq('state', state));\r\n return extend({}, node && node.paramValues);\r\n }\r\n\r\n const noInherit = fromPath\r\n .map((node) => node.paramSchema)\r\n .reduce(unnestR, [])\r\n .filter((param) => !param.inherit)\r\n .map(prop('id'));\r\n\r\n /**\r\n * Given an [[PathNode]] \"toNode\", return a new [[PathNode]] with param values inherited from the\r\n * matching node in fromPath. Only inherit keys that aren't found in \"toKeys\" from the node in \"fromPath\"\"\r\n */\r\n function makeInheritedParamsNode(toNode: PathNode): PathNode {\r\n // All param values for the node (may include default key/vals, when key was not found in toParams)\r\n let toParamVals = extend({}, toNode && toNode.paramValues);\r\n // limited to only those keys found in toParams\r\n const incomingParamVals = pick(toParamVals, toKeys);\r\n toParamVals = omit(toParamVals, toKeys);\r\n const fromParamVals = omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit);\r\n // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals\r\n const ownParamVals: RawParams = extend(toParamVals, fromParamVals, incomingParamVals);\r\n return new PathNode(toNode.state).applyRawParams(ownParamVals);\r\n }\r\n\r\n // The param keys specified by the incoming toParams\r\n return <PathNode[]>toPath.map(makeInheritedParamsNode);\r\n }\r\n\r\n static nonDynamicParams = (node: PathNode): Param[] =>\r\n node.state.parameters({ inherit: false }).filter((param) => !param.dynamic);\r\n\r\n /**\r\n * Computes the tree changes (entering, exiting) between a fromPath and toPath.\r\n */\r\n static treeChanges(fromPath: PathNode[], toPath: PathNode[], reloadState: StateObject): TreeChanges {\r\n const max = Math.min(fromPath.length, toPath.length);\r\n let keep = 0;\r\n\r\n const nodesMatch = (node1: PathNode, node2: PathNode) => node1.equals(node2, PathUtils.nonDynamicParams);\r\n\r\n while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) {\r\n keep++;\r\n }\r\n\r\n /** Given a retained node, return a new node which uses the to node's param values */\r\n function applyToParams(retainedNode: PathNode, idx: number): PathNode {\r\n const cloned = retainedNode.clone();\r\n cloned.paramValues = toPath[idx].paramValues;\r\n return cloned;\r\n }\r\n\r\n let from: PathNode[], retained: PathNode[], exiting: PathNode[], entering: PathNode[], to: PathNode[];\r\n\r\n from = fromPath;\r\n retained = from.slice(0, keep);\r\n exiting = from.slice(keep);\r\n\r\n // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped\r\n const retainedWithToParams = retained.map(applyToParams);\r\n entering = toPath.slice(keep);\r\n to = retainedWithToParams.concat(entering);\r\n\r\n return { from, to, retained, retainedWithToParams, exiting, entering };\r\n }\r\n\r\n /**\r\n * Returns a new path which is: the subpath of the first path which matches the second path.\r\n *\r\n * The new path starts from root and contains any nodes that match the nodes in the second path.\r\n * It stops before the first non-matching node.\r\n *\r\n * Nodes are compared using their state property and their parameter values.\r\n * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.\r\n *\r\n * @param pathA the first path\r\n * @param pathB the second path\r\n * @param paramsFn a function which returns the parameters to consider when comparing\r\n *\r\n * @returns an array of PathNodes from the first path which match the nodes in the second path\r\n */\r\n static matching(pathA: PathNode[], pathB: PathNode[], paramsFn?: GetParamsFn): PathNode[] {\r\n let done = false;\r\n const tuples: PathNode[][] = arrayTuples(pathA, pathB);\r\n return tuples.reduce((matching, [nodeA, nodeB]) => {\r\n done = done || !nodeA.equals(nodeB, paramsFn);\r\n return done ? matching : matching.concat(nodeA);\r\n }, []);\r\n }\r\n\r\n /**\r\n * Returns true if two paths are identical.\r\n *\r\n * @param pathA\r\n * @param pathB\r\n * @param paramsFn a function which returns the parameters to consider when comparing\r\n * @returns true if the the states and parameter values for both paths are identical\r\n */\r\n static equals(pathA: PathNode[], pathB: PathNode[], paramsFn?: GetParamsFn): boolean {\r\n return pathA.length === pathB.length && PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length;\r\n }\r\n\r\n /**\r\n * Return a subpath of a path, which stops at the first matching node\r\n *\r\n * Given an array of nodes, returns a subset of the array starting from the first node,\r\n * stopping when the first node matches the predicate.\r\n *\r\n * @param path a path of [[PathNode]]s\r\n * @param predicate a [[Predicate]] fn that matches [[PathNode]]s\r\n * @returns a subpath up to the matching node, or undefined if no match is found\r\n */\r\n static subPath(path: PathNode[], predicate: Predicate<PathNode>): PathNode[] {\r\n const node = find(path, predicate);\r\n const elementIdx = path.indexOf(node);\r\n return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);\r\n }\r\n\r\n /** Gets the raw parameter values from a path */\r\n static paramValues = (path: PathNode[]) => path.reduce((acc, node) => extend(acc, node.paramValues), {});\r\n}\r\n","/**\r\n * # The Resolve subsystem\r\n *\r\n * This subsystem is an asynchronous, hierarchical Dependency Injection system.\r\n *\r\n * Typically, resolve is configured on a state using a [[StateDeclaration.resolve]] declaration.\r\n *\r\n * @packageDocumentation\r\n */\r\n/**\r\n * An interface which is similar to an Angular 2 `Provider`\r\n */\r\nexport interface ProviderLike {\r\n provide: any;\r\n useClass?: any;\r\n useFactory?: Function;\r\n useValue?: any;\r\n useExisting?: any;\r\n deps?: any[];\r\n}\r\n\r\n/**\r\n * A plain object used to describe a [[Resolvable]]\r\n *\r\n * These objects may be used in the [[StateDeclaration.resolve]] array to declare\r\n * async data that the state or substates require.\r\n *\r\n * #### Example:\r\n * ```js\r\n *\r\n * var state = {\r\n * name: 'main',\r\n * resolve: [\r\n * { token: 'myData', deps: [MyDataApi], resolveFn: (myDataApi) => myDataApi.getData() },\r\n * ],\r\n * }\r\n * ```\r\n */\r\nexport interface ResolvableLiteral {\r\n /**\r\n * A Dependency Injection token\r\n *\r\n * This Resolvable's DI token.\r\n * The Resolvable will be injectable elsewhere using the token.\r\n */\r\n token: any;\r\n\r\n /**\r\n * A function which fetches the Resolvable's data\r\n *\r\n * A function which returns one of:\r\n *\r\n * - The resolved value (synchronously)\r\n * - A promise for the resolved value\r\n * - An Observable of the resolved value(s)\r\n *\r\n * This function will be provided the dependencies listed in [[deps]] as its arguments.\r\n * The resolve system will asynchronously fetch the dependencies before invoking this function.\r\n */\r\n resolveFn: Function;\r\n\r\n /**\r\n * Defines the Resolve Policy\r\n *\r\n * A policy that defines when to invoke the resolve,\r\n * and whether to wait for async and unwrap the data\r\n */\r\n policy?: ResolvePolicy;\r\n\r\n /**\r\n * The Dependency Injection tokens\r\n *\r\n * This is an array of Dependency Injection tokens for the dependencies of the [[resolveFn]].\r\n *\r\n * The DI tokens are references to other `Resolvables`, or to other\r\n * services from the native DI system.\r\n */\r\n deps?: any[];\r\n\r\n /** Pre-resolved data. */\r\n data?: any;\r\n}\r\n\r\n/**\r\n * Defines how a resolve is processed during a transition\r\n *\r\n * This object is the [[StateDeclaration.resolvePolicy]] property.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Fetched when the resolve's state is being entered.\r\n * // Wait for the promise to resolve.\r\n * var policy1 = { when: \"LAZY\", async: \"WAIT\" }\r\n *\r\n * // Fetched when the Transition is starting.\r\n * // Do not wait for the returned promise to resolve.\r\n * // Inject the raw promise/value\r\n * var policy2 = { when: \"EAGER\", async: \"NOWAIT\" }\r\n * ```\r\n *\r\n * The policy for a given Resolvable is merged from three sources (highest priority first):\r\n *\r\n * - 1) Individual resolve definition\r\n * - 2) State definition\r\n * - 3) Global default\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Wait for an Observable to emit one item.\r\n * // Since `wait` is not specified, it uses the `wait`\r\n * // policy defined on the state, or the global default\r\n * // if no `wait` policy is defined on the state\r\n * import { RXWAIT } from '@uirouter/rx';\r\n *\r\n * var myResolvablePolicy = { async: RXWAIT }\r\n * ```\r\n */\r\nexport interface ResolvePolicy {\r\n /**\r\n * Defines when a Resolvable is resolved (fetched) during a transition\r\n *\r\n * - `LAZY` (default)\r\n * - Resolved as the resolve's state is being entered\r\n * - `EAGER`\r\n * - Resolved as the transition is starting\r\n *\r\n * #### Example:\r\n * Resolves for `main` and `main.home` are fetched when each state is entered.\r\n * All of `main` resolves are processed before fetching `main.home` resolves.\r\n * ```js\r\n * var state = {\r\n * name: 'main',\r\n * resolve: mainResolves, // defined elsewhere\r\n * resolvePolicy: { when: 'LAZY' }, // default\r\n * }\r\n *\r\n * var state = {\r\n * name: 'main.home',\r\n * resolve: homeResolves, // defined elsewhere\r\n * resolvePolicy: { when: 'LAZY' }, // default\r\n * }\r\n * ```\r\n *\r\n * #### Example:\r\n * Resolves for `main` and `main.home` are fetched at the same time when the transition starts.\r\n * This happens earlier in the lifecycle than when states are entered.\r\n * All of the `main` and `main.home` resolves are fetched as soon as possible.\r\n * ```js\r\n * var mainState = {\r\n * name: 'main',\r\n * resolve: mainResolves, // defined elsewhere\r\n * resolvePolicy: { when: 'EAGER' },\r\n * }\r\n *\r\n * var homeState = {\r\n * name: 'main.home',\r\n * resolve: homeResolves, // defined elsewhere\r\n * resolvePolicy: { when: 'EAGER' },\r\n * }\r\n * ```\r\n */\r\n when?: PolicyWhen;\r\n\r\n /**\r\n * Determines the unwrapping behavior of asynchronous resolve values.\r\n *\r\n * - `WAIT` (default)\r\n * - If a promise is returned from the resolveFn, wait for the promise before proceeding\r\n * - The unwrapped value from the promise\r\n * - `NOWAIT`\r\n * - If a promise is returned from the resolve, do not wait for the promise.\r\n * - Any other value returned is wrapped in a promise.\r\n * - The promise will not be unwrapped.\r\n * - The promise itself will be provided when the resolve is injected or bound elsewhere.\r\n * - {@link CustomAsyncPolicy}\r\n * - You can define a custom function that will be called with the resolveFn value.\r\n * - This function must return a promise.\r\n * - The transition will wait for this promise before proceeding\r\n *\r\n * NOTE: The previous `RXWAIT` policy has become a CustomAsyncPolicy function exported in `@uirouter/rx` package.\r\n *\r\n * #### Example:\r\n * The `Transition` will not wait for the resolve promise(s) from `main` to settle before continuing.\r\n * Resolves for `main` will be provided to components wrapped in a `Promise`.\r\n *\r\n * The `Transition` will wait for the `main.home` resolve promises.\r\n * Resolved values will be unwrapped before being provided to components.\r\n * ```js\r\n * var mainState = {\r\n * name: 'main',\r\n * resolve: mainResolves, // defined elsewhere\r\n * resolvePolicy: { async: 'NOWAIT' },\r\n * }\r\n * var homeState = {\r\n * name: 'main.home',\r\n * resolve: homeResolves, // defined elsewhere\r\n * resolvePolicy: { async: 'WAIT' }, // default\r\n * }\r\n * ```\r\n */\r\n async?: PolicyAsync;\r\n}\r\n\r\nexport type PolicyWhen = 'LAZY' | 'EAGER';\r\nexport type PolicyAsync = 'WAIT' | 'NOWAIT' | CustomAsyncPolicy;\r\nexport interface CustomAsyncPolicy {\r\n (data: any): Promise<any>;\r\n}\r\n\r\nexport let resolvePolicies = {\r\n when: {\r\n LAZY: 'LAZY',\r\n EAGER: 'EAGER',\r\n },\r\n async: {\r\n WAIT: 'WAIT',\r\n NOWAIT: 'NOWAIT',\r\n },\r\n};\r\n","import { extend, identity } from '../common/common';\r\nimport { services } from '../common/coreservices';\r\nimport { trace } from '../common/trace';\r\nimport { ResolvePolicy, ResolvableLiteral, PolicyAsync } from './interface';\r\n\r\nimport { ResolveContext } from './resolveContext';\r\nimport { stringify } from '../common/strings';\r\nimport { isFunction, isObject } from '../common/predicates';\r\nimport { Transition } from '../transition/transition';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { isNullOrUndefined } from '../common/predicates';\r\n\r\n// TODO: explicitly make this user configurable\r\nexport let defaultResolvePolicy: ResolvePolicy = {\r\n when: 'LAZY',\r\n async: 'WAIT',\r\n};\r\n\r\n/**\r\n * The basic building block for the resolve system.\r\n *\r\n * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise),\r\n * and the unwrapped-when-complete (.data) result of the resolveFn.\r\n *\r\n * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the\r\n * resolveFn) and returns the resulting promise.\r\n *\r\n * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first\r\n * parameter to those fns.\r\n */\r\nexport class Resolvable implements ResolvableLiteral {\r\n token: any;\r\n policy: ResolvePolicy;\r\n resolveFn: Function;\r\n deps: any[];\r\n\r\n data: any;\r\n resolved = false;\r\n promise: Promise<any> = undefined;\r\n\r\n static fromData = (token: any, data: any) => new Resolvable(token, () => data, null, null, data);\r\n\r\n /** This constructor creates a Resolvable copy */\r\n constructor(resolvable: Resolvable);\r\n\r\n /** This constructor creates a new Resolvable from the plain old [[ResolvableLiteral]] javascript object */\r\n constructor(resolvable: ResolvableLiteral);\r\n\r\n /**\r\n * This constructor creates a new `Resolvable`\r\n *\r\n * #### Example:\r\n * ```js\r\n * var resolvable1 = new Resolvable('mytoken', http => http.get('foo.json').toPromise(), [Http]);\r\n *\r\n * var resolvable2 = new Resolvable(UserService, dep => new UserService(dep.data), [SomeDependency]);\r\n *\r\n * var resolvable1Clone = new Resolvable(resolvable1);\r\n * ```\r\n *\r\n * @param token The new resolvable's injection token, such as `\"userList\"` (a string) or `UserService` (a class).\r\n * When this token is used during injection, the resolved value will be injected.\r\n * @param resolveFn The function that returns the resolved value, or a promise for the resolved value\r\n * @param deps An array of dependencies, which will be injected into the `resolveFn`\r\n * @param policy the [[ResolvePolicy]] defines when and how the Resolvable is processed\r\n * @param data Pre-resolved data. If the resolve value is already known, it may be provided here.\r\n */\r\n constructor(token: any, resolveFn: Function, deps?: any[], policy?: ResolvePolicy, data?: any);\r\n constructor(arg1: any, resolveFn?: Function, deps?: any[], policy?: ResolvePolicy, data?: any) {\r\n if (arg1 instanceof Resolvable) {\r\n extend(this, arg1);\r\n } else if (isFunction(resolveFn)) {\r\n if (isNullOrUndefined(arg1)) throw new Error('new Resolvable(): token argument is required');\r\n if (!isFunction(resolveFn)) throw new Error('new Resolvable(): resolveFn argument must be a function');\r\n\r\n this.token = arg1;\r\n this.policy = policy;\r\n this.resolveFn = resolveFn;\r\n this.deps = deps || [];\r\n\r\n this.data = data;\r\n this.resolved = data !== undefined;\r\n this.promise = this.resolved ? services.$q.when(this.data) : undefined;\r\n } else if (isObject(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) {\r\n const literal = <ResolvableLiteral>arg1;\r\n return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data);\r\n }\r\n }\r\n\r\n getPolicy(state: StateObject): ResolvePolicy {\r\n const thisPolicy = this.policy || {};\r\n const statePolicy = (state && state.resolvePolicy) || {};\r\n return {\r\n when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,\r\n async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,\r\n };\r\n }\r\n\r\n /**\r\n * Asynchronously resolve this Resolvable's data\r\n *\r\n * Given a ResolveContext that this Resolvable is found in:\r\n * Wait for this Resolvable's dependencies, then invoke this Resolvable's function\r\n * and update the Resolvable's state\r\n */\r\n resolve(resolveContext: ResolveContext, trans?: Transition) {\r\n const $q = services.$q;\r\n\r\n // Gets all dependencies from ResolveContext and wait for them to be resolved\r\n const getResolvableDependencies = () =>\r\n $q.all(\r\n resolveContext.getDependencies(this).map((resolvable) => resolvable.get(resolveContext, trans))\r\n ) as Promise<any[]>;\r\n\r\n // Invokes the resolve function passing the resolved dependencies as arguments\r\n const invokeResolveFn = (resolvedDeps: any[]) => this.resolveFn.apply(null, resolvedDeps);\r\n const node: PathNode = resolveContext.findNode(this);\r\n const state: StateObject = node && node.state;\r\n\r\n const asyncPolicy: PolicyAsync = this.getPolicy(state).async;\r\n const customAsyncPolicy = isFunction(asyncPolicy) ? asyncPolicy : identity;\r\n\r\n // After the final value has been resolved, update the state of the Resolvable\r\n const applyResolvedValue = (resolvedValue: any) => {\r\n this.data = resolvedValue;\r\n this.resolved = true;\r\n this.resolveFn = null;\r\n trace.traceResolvableResolved(this, trans);\r\n return this.data;\r\n };\r\n\r\n // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick.\r\n return (this.promise = $q\r\n .when()\r\n .then(getResolvableDependencies)\r\n .then(invokeResolveFn)\r\n .then(customAsyncPolicy)\r\n .then(applyResolvedValue));\r\n }\r\n\r\n /**\r\n * Gets a promise for this Resolvable's data.\r\n *\r\n * Fetches the data and returns a promise.\r\n * Returns the existing promise if it has already been fetched once.\r\n */\r\n get(resolveContext: ResolveContext, trans?: Transition): Promise<any> {\r\n return this.promise || this.resolve(resolveContext, trans);\r\n }\r\n\r\n toString() {\r\n return `Resolvable(token: ${stringify(this.token)}, requires: [${this.deps.map(stringify)}])`;\r\n }\r\n\r\n clone(): Resolvable {\r\n return new Resolvable(this);\r\n }\r\n}\r\n","import { find, tail, uniqR, unnestR, inArray } from '../common/common';\r\nimport { propEq, not } from '../common/hof';\r\nimport { trace } from '../common/trace';\r\nimport { services, $InjectorLike } from '../common/coreservices';\r\nimport { resolvePolicies, PolicyWhen, ResolvePolicy } from './interface';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { Resolvable } from './resolvable';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { PathUtils } from '../path/pathUtils';\r\nimport { stringify } from '../common/strings';\r\nimport { Transition } from '../transition/transition';\r\nimport { UIInjector } from '../interface';\r\nimport { isUndefined } from '../common';\r\n\r\nconst whens = resolvePolicies.when;\r\nconst ALL_WHENS = [whens.EAGER, whens.LAZY];\r\nconst EAGER_WHENS = [whens.EAGER];\r\n\r\n// tslint:disable-next-line:no-inferrable-types\r\nexport const NATIVE_INJECTOR_TOKEN: string = 'Native Injector';\r\n\r\n/**\r\n * Encapsulates Dependency Injection for a path of nodes\r\n *\r\n * UI-Router states are organized as a tree.\r\n * A nested state has a path of ancestors to the root of the tree.\r\n * When a state is being activated, each element in the path is wrapped as a [[PathNode]].\r\n * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.\r\n *\r\n * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.\r\n */\r\nexport class ResolveContext {\r\n _injector: UIInjector;\r\n\r\n constructor(private _path: PathNode[]) {}\r\n\r\n /** Gets all the tokens found in the resolve context, de-duplicated */\r\n getTokens(): any[] {\r\n return this._path.reduce((acc, node) => acc.concat(node.resolvables.map((r) => r.token)), []).reduce(uniqR, []);\r\n }\r\n\r\n /**\r\n * Gets the Resolvable that matches the token\r\n *\r\n * Gets the last Resolvable that matches the token in this context, or undefined.\r\n * Throws an error if it doesn't exist in the ResolveContext\r\n */\r\n getResolvable(token: any): Resolvable {\r\n const matching = this._path\r\n .map((node) => node.resolvables)\r\n .reduce(unnestR, [])\r\n .filter((r: Resolvable) => r.token === token);\r\n return tail(matching);\r\n }\r\n\r\n /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */\r\n getPolicy(resolvable: Resolvable): ResolvePolicy {\r\n const node = this.findNode(resolvable);\r\n return resolvable.getPolicy(node.state);\r\n }\r\n\r\n /**\r\n * Returns a ResolveContext that includes a portion of this one\r\n *\r\n * Given a state, this method creates a new ResolveContext from this one.\r\n * The new context starts at the first node (root) and stops at the node for the `state` parameter.\r\n *\r\n * #### Why\r\n *\r\n * When a transition is created, the nodes in the \"To Path\" are injected from a ResolveContext.\r\n * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.\r\n * The \"To State\" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).\r\n * This method is used to create a narrower context when injecting ancestor nodes.\r\n *\r\n * @example\r\n * `let ABCD = new ResolveContext([A, B, C, D]);`\r\n *\r\n * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:\r\n * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.\r\n * However, `B` should only be able to access resolvables from `A`, `B`.\r\n *\r\n * When resolving for the `B` node, first take the full \"To Path\" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.\r\n * `let AB = ABCD.subcontext(a)`\r\n */\r\n subContext(state: StateObject): ResolveContext {\r\n return new ResolveContext(PathUtils.subPath(this._path, (node) => node.state === state));\r\n }\r\n\r\n /**\r\n * Adds Resolvables to the node that matches the state\r\n *\r\n * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).\r\n * The resolvable is added to the node matching the `state` parameter.\r\n *\r\n * These new resolvables are not automatically fetched.\r\n * The calling code should either fetch them, fetch something that depends on them,\r\n * or rely on [[resolvePath]] being called when some state is being entered.\r\n *\r\n * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.\r\n *\r\n * @param newResolvables the new Resolvables\r\n * @param state Used to find the node to put the resolvable on\r\n */\r\n addResolvables(newResolvables: Resolvable[], state: StateObject) {\r\n const node = <PathNode>find(this._path, propEq('state', state));\r\n const keys = newResolvables.map((r) => r.token);\r\n node.resolvables = node.resolvables.filter((r) => keys.indexOf(r.token) === -1).concat(newResolvables);\r\n }\r\n\r\n /**\r\n * Returns a promise for an array of resolved path Element promises\r\n *\r\n * @param when\r\n * @param trans\r\n * @returns {Promise<any>|any}\r\n */\r\n resolvePath(when: PolicyWhen = 'LAZY', trans?: Transition): Promise<{ token: any; value: any }[]> {\r\n // This option determines which 'when' policy Resolvables we are about to fetch.\r\n const whenOption: string = inArray(ALL_WHENS, when) ? when : 'LAZY';\r\n // If the caller specified EAGER, only the EAGER Resolvables are fetched.\r\n // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.`\r\n const matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;\r\n\r\n // get the subpath to the state argument, if provided\r\n trace.traceResolvePath(this._path, when, trans);\r\n\r\n const matchesPolicy = (acceptedVals: string[], whenOrAsync: 'when' | 'async') => (resolvable: Resolvable) =>\r\n inArray(acceptedVals, this.getPolicy(resolvable)[whenOrAsync]);\r\n\r\n // Trigger all the (matching) Resolvables in the path\r\n // Reduce all the \"WAIT\" Resolvables into an array\r\n const promises: Promise<any>[] = this._path.reduce((acc, node) => {\r\n const nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));\r\n const nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));\r\n const wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async')));\r\n\r\n // For the matching Resolvables, start their async fetch process.\r\n const subContext = this.subContext(node.state);\r\n const getResult = (r: Resolvable) =>\r\n r\r\n .get(subContext, trans)\r\n // Return a tuple that includes the Resolvable's token\r\n .then((value) => ({ token: r.token, value: value }));\r\n nowait.forEach(getResult);\r\n return acc.concat(wait.map(getResult));\r\n }, []);\r\n\r\n // Wait for all the \"WAIT\" resolvables\r\n return services.$q.all(promises);\r\n }\r\n\r\n injector(): UIInjector {\r\n return this._injector || (this._injector = new UIInjectorImpl(this));\r\n }\r\n\r\n findNode(resolvable: Resolvable): PathNode {\r\n return find(this._path, (node: PathNode) => inArray(node.resolvables, resolvable));\r\n }\r\n\r\n /**\r\n * Gets the async dependencies of a Resolvable\r\n *\r\n * Given a Resolvable, returns its dependencies as a Resolvable[]\r\n */\r\n getDependencies(resolvable: Resolvable): Resolvable[] {\r\n const node = this.findNode(resolvable);\r\n // Find which other resolvables are \"visible\" to the `resolvable` argument\r\n // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path)\r\n const subPath: PathNode[] = PathUtils.subPath(this._path, (x) => x === node) || this._path;\r\n const availableResolvables: Resolvable[] = subPath\r\n .reduce((acc, _node) => acc.concat(_node.resolvables), []) // all of subpath's resolvables\r\n .filter((res) => res !== resolvable); // filter out the `resolvable` argument\r\n\r\n const getDependency = (token: any) => {\r\n const matching = availableResolvables.filter((r) => r.token === token);\r\n if (matching.length) return tail(matching);\r\n\r\n const fromInjector = this.injector().getNative(token);\r\n if (isUndefined(fromInjector)) {\r\n throw new Error('Could not find Dependency Injection token: ' + stringify(token));\r\n }\r\n\r\n return new Resolvable(token, () => fromInjector, [], fromInjector);\r\n };\r\n\r\n return resolvable.deps.map(getDependency);\r\n }\r\n}\r\n\r\n/** @internal */\r\nclass UIInjectorImpl implements UIInjector {\r\n native: $InjectorLike;\r\n\r\n constructor(public context: ResolveContext) {\r\n this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector;\r\n }\r\n\r\n get(token: any) {\r\n const resolvable = this.context.getResolvable(token);\r\n if (resolvable) {\r\n if (this.context.getPolicy(resolvable).async === 'NOWAIT') {\r\n return resolvable.get(this.context);\r\n }\r\n\r\n if (!resolvable.resolved) {\r\n throw new Error('Resolvable async .get() not complete:' + stringify(resolvable.token));\r\n }\r\n return resolvable.data;\r\n }\r\n\r\n return this.getNative(token);\r\n }\r\n\r\n getAsync(token: any) {\r\n const resolvable = this.context.getResolvable(token);\r\n if (resolvable) return resolvable.get(this.context);\r\n return services.$q.when(this.native.get(token));\r\n }\r\n\r\n getNative(token: any) {\r\n return this.native && this.native.get(token);\r\n }\r\n}\r\n","import { UrlMatcherFactory } from './url/urlMatcherFactory';\r\nimport { UrlRouter } from './url/urlRouter';\r\nimport { TransitionService } from './transition/transitionService';\r\nimport { ViewService } from './view/view';\r\nimport { StateRegistry } from './state/stateRegistry';\r\nimport { StateService } from './state/stateService';\r\nimport { UIRouterGlobals } from './globals';\r\nimport { UIRouterPlugin, Disposable } from './interface';\r\nimport { values, removeFrom } from './common/common';\r\nimport { isFunction } from './common/predicates';\r\nimport { UrlService } from './url/urlService';\r\nimport { LocationServices, LocationConfig } from './common/coreservices';\r\nimport { Trace, trace } from './common/trace';\r\nimport { makeStub } from './common';\r\n\r\n/** @internal */\r\nlet _routerInstance = 0;\r\n\r\n/** @internal */\r\nconst locSvcFns: (keyof LocationServices)[] = ['url', 'path', 'search', 'hash', 'onChange'];\r\n/** @internal */\r\nconst locCfgFns: (keyof LocationConfig)[] = ['port', 'protocol', 'host', 'baseHref', 'html5Mode', 'hashPrefix'];\r\n/** @internal */\r\nconst locationServiceStub = makeStub<LocationServices>('LocationServices', locSvcFns);\r\n/** @internal */\r\nconst locationConfigStub = makeStub<LocationConfig>('LocationConfig', locCfgFns);\r\n\r\n/**\r\n * An instance of UI-Router.\r\n *\r\n * This object contains references to service APIs which define your application's routing behavior.\r\n */\r\nexport class UIRouter {\r\n /** @internal */ $id = _routerInstance++;\r\n /** @internal */ _disposed = false;\r\n /** @internal */ private _disposables: Disposable[] = [];\r\n\r\n /** Enable/disable tracing to the javascript console */\r\n trace: Trace = trace;\r\n\r\n /** Provides services related to ui-view synchronization */\r\n viewService = new ViewService(this);\r\n\r\n /** An object that contains global router state, such as the current state and params */\r\n globals: UIRouterGlobals = new UIRouterGlobals();\r\n\r\n /** A service that exposes global Transition Hooks */\r\n transitionService: TransitionService = new TransitionService(this);\r\n\r\n /**\r\n * Deprecated for public use. Use [[urlService]] instead.\r\n * @deprecated Use [[urlService]] instead\r\n */\r\n urlMatcherFactory: UrlMatcherFactory = new UrlMatcherFactory(this);\r\n\r\n /**\r\n * Deprecated for public use. Use [[urlService]] instead.\r\n * @deprecated Use [[urlService]] instead\r\n */\r\n urlRouter: UrlRouter = new UrlRouter(this);\r\n\r\n /** Provides services related to the URL */\r\n urlService: UrlService = new UrlService(this);\r\n\r\n /** Provides a registry for states, and related registration services */\r\n stateRegistry: StateRegistry = new StateRegistry(this);\r\n\r\n /** Provides services related to states */\r\n stateService = new StateService(this);\r\n\r\n /** @internal plugin instances are registered here */\r\n private _plugins: { [key: string]: UIRouterPlugin } = {};\r\n\r\n /** Registers an object to be notified when the router is disposed */\r\n disposable(disposable: Disposable) {\r\n this._disposables.push(disposable);\r\n }\r\n\r\n /**\r\n * Disposes this router instance\r\n *\r\n * When called, clears resources retained by the router by calling `dispose(this)` on all\r\n * registered [[disposable]] objects.\r\n *\r\n * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only.\r\n *\r\n * @internal\r\n * @param disposable (optional) the disposable to dispose\r\n */\r\n dispose(disposable?: any): void {\r\n if (disposable && isFunction(disposable.dispose)) {\r\n disposable.dispose(this);\r\n return undefined;\r\n }\r\n\r\n this._disposed = true;\r\n this._disposables.slice().forEach((d) => {\r\n try {\r\n typeof d.dispose === 'function' && d.dispose(this);\r\n removeFrom(this._disposables, d);\r\n } catch (ignored) {}\r\n });\r\n }\r\n\r\n /**\r\n * Creates a new `UIRouter` object\r\n *\r\n * @param locationService a [[LocationServices]] implementation\r\n * @param locationConfig a [[LocationConfig]] implementation\r\n * @internal\r\n */\r\n constructor(\r\n public locationService: LocationServices = locationServiceStub,\r\n public locationConfig: LocationConfig = locationConfigStub\r\n ) {\r\n this.viewService._pluginapi._rootViewContext(this.stateRegistry.root());\r\n this.globals.$current = this.stateRegistry.root();\r\n this.globals.current = this.globals.$current.self;\r\n\r\n this.disposable(this.globals);\r\n this.disposable(this.stateService);\r\n this.disposable(this.stateRegistry);\r\n this.disposable(this.transitionService);\r\n this.disposable(this.urlService);\r\n this.disposable(locationService);\r\n this.disposable(locationConfig);\r\n }\r\n\r\n /** Add plugin (as ES6 class) */\r\n plugin<T extends UIRouterPlugin>(plugin: { new (router: UIRouter, options?: any): T }, options?: any): T;\r\n /** Add plugin (as javascript constructor function) */\r\n plugin<T extends UIRouterPlugin>(plugin: { (router: UIRouter, options?: any): void }, options?: any): T;\r\n /** Add plugin (as javascript factory function) */\r\n plugin<T extends UIRouterPlugin>(plugin: PluginFactory<T>, options?: any): T;\r\n /**\r\n * Adds a plugin to UI-Router\r\n *\r\n * This method adds a UI-Router Plugin.\r\n * A plugin can enhance or change UI-Router behavior using any public API.\r\n *\r\n * #### Example:\r\n * ```js\r\n * import { MyCoolPlugin } from \"ui-router-cool-plugin\";\r\n *\r\n * var plugin = router.addPlugin(MyCoolPlugin);\r\n * ```\r\n *\r\n * ### Plugin authoring\r\n *\r\n * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object.\r\n *\r\n * The plugin can implement its functionality using any of the public APIs of [[UIRouter]].\r\n * For example, it may configure router options or add a Transition Hook.\r\n *\r\n * The plugin can then be published as a separate module.\r\n *\r\n * #### Example:\r\n * ```js\r\n * export class MyAuthPlugin implements UIRouterPlugin {\r\n * constructor(router: UIRouter, options: any) {\r\n * this.name = \"MyAuthPlugin\";\r\n * let $transitions = router.transitionService;\r\n * let $state = router.stateService;\r\n *\r\n * let authCriteria = {\r\n * to: (state) => state.data && state.data.requiresAuth\r\n * };\r\n *\r\n * function authHook(transition: Transition) {\r\n * let authService = transition.injector().get('AuthService');\r\n * if (!authService.isAuthenticated()) {\r\n * return $state.target('login');\r\n * }\r\n * }\r\n *\r\n * $transitions.onStart(authCriteria, authHook);\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param plugin one of:\r\n * - a plugin class which implements [[UIRouterPlugin]]\r\n * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance\r\n * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance\r\n * @param options options to pass to the plugin class/factory\r\n * @returns the registered plugin instance\r\n */\r\n plugin<T extends UIRouterPlugin>(plugin: any, options: any = {}): T {\r\n const pluginInstance = new plugin(this, options);\r\n if (!pluginInstance.name) throw new Error('Required property `name` missing on plugin: ' + pluginInstance);\r\n this._disposables.push(pluginInstance);\r\n return (this._plugins[pluginInstance.name] = pluginInstance);\r\n }\r\n\r\n /**\r\n * Returns a plugin registered with the given `pluginName`.\r\n *\r\n * @param pluginName the name of the plugin to get\r\n * @return the plugin, or undefined\r\n */\r\n getPlugin(pluginName: string): UIRouterPlugin;\r\n /**\r\n * Returns all registered plugins\r\n * @return all registered plugins\r\n */\r\n getPlugin(): UIRouterPlugin[];\r\n getPlugin(pluginName?: string): UIRouterPlugin | UIRouterPlugin[] {\r\n return pluginName ? this._plugins[pluginName] : values(this._plugins);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type PluginFactory<T> = (router: UIRouter, options?: any) => T;\r\n","import { applyPairs, extend, identity, inherit, mapObj, noop, Obj, omit, tail, values, copy } from '../common/common';\r\nimport { isArray, isDefined, isFunction, isString } from '../common/predicates';\r\nimport { stringify } from '../common/strings';\r\nimport { is, pattern, pipe, prop, val } from '../common/hof';\r\nimport { StateDeclaration } from './interface';\r\n\r\nimport { StateObject } from './stateObject';\r\nimport { StateMatcher } from './stateMatcher';\r\nimport { Param } from '../params/param';\r\nimport { UrlMatcherFactory } from '../url/urlMatcherFactory';\r\nimport { UrlMatcher } from '../url/urlMatcher';\r\nimport { Resolvable } from '../resolve/resolvable';\r\nimport { services } from '../common/coreservices';\r\nimport { ResolvePolicy } from '../resolve/interface';\r\nimport { ParamDeclaration } from '../params';\r\nimport { ParamFactory } from '../url';\r\n\r\nconst parseUrl = (url: string): any => {\r\n if (!isString(url)) return false;\r\n const root = url.charAt(0) === '^';\r\n return { val: root ? url.substring(1) : url, root };\r\n};\r\n\r\n/**\r\n * A function that builds the final value for a specific field on a [[StateObject]].\r\n *\r\n * A series of builder functions for a given field are chained together.\r\n * The final value returned from the chain of builders is applied to the built [[StateObject]].\r\n * Builder functions should call the [[parent]] function either first or last depending on the desired composition behavior.\r\n *\r\n * @param state the _partially built_ [[StateObject]]. The [[StateDeclaration]] can be inspected via [[StateObject.self]]\r\n * @param parent the previous builder function in the series.\r\n */\r\nexport type BuilderFunction = (state: StateObject, parent?: BuilderFunction) => any;\r\n\r\ninterface Builders {\r\n [key: string]: BuilderFunction[];\r\n\r\n name: BuilderFunction[];\r\n parent: BuilderFunction[];\r\n data: BuilderFunction[];\r\n url: BuilderFunction[];\r\n navigable: BuilderFunction[];\r\n params: BuilderFunction[];\r\n views: BuilderFunction[];\r\n path: BuilderFunction[];\r\n includes: BuilderFunction[];\r\n resolvables: BuilderFunction[];\r\n}\r\n\r\nfunction nameBuilder(state: StateObject) {\r\n return state.name;\r\n}\r\n\r\nfunction selfBuilder(state: StateObject) {\r\n state.self.$$state = () => state;\r\n return state.self;\r\n}\r\n\r\nfunction dataBuilder(state: StateObject) {\r\n if (state.parent && state.parent.data) {\r\n state.data = state.self.data = inherit(state.parent.data, state.data);\r\n }\r\n return state.data;\r\n}\r\n\r\nconst getUrlBuilder = ($urlMatcherFactoryProvider: UrlMatcherFactory, root: () => StateObject) =>\r\n function urlBuilder(stateObject: StateObject) {\r\n let stateDec: StateDeclaration = stateObject.self;\r\n\r\n // For future states, i.e., states whose name ends with `.**`,\r\n // match anything that starts with the url prefix\r\n if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\\.\\*\\*$/)) {\r\n const newStateDec: StateDeclaration = {};\r\n copy(stateDec, newStateDec);\r\n newStateDec.url += '{remainder:any}'; // match any path (.*)\r\n stateDec = newStateDec;\r\n }\r\n\r\n const parent = stateObject.parent;\r\n const parsed = parseUrl(stateDec.url);\r\n const url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, { state: stateDec });\r\n\r\n if (!url) return null;\r\n if (!$urlMatcherFactoryProvider.isMatcher(url)) throw new Error(`Invalid url '${url}' in state '${stateObject}'`);\r\n return parsed && parsed.root ? url : ((parent && parent.navigable) || root()).url.append(<UrlMatcher>url);\r\n };\r\n\r\nconst getNavigableBuilder = (isRoot: (state: StateObject) => boolean) =>\r\n function navigableBuilder(state: StateObject) {\r\n return !isRoot(state) && state.url ? state : state.parent ? state.parent.navigable : null;\r\n };\r\n\r\nconst getParamsBuilder = (paramFactory: ParamFactory) =>\r\n function paramsBuilder(state: StateObject): { [key: string]: Param } {\r\n const makeConfigParam = (config: ParamDeclaration, id: string) => paramFactory.fromConfig(id, null, state.self);\r\n const urlParams: Param[] = (state.url && state.url.parameters({ inherit: false })) || [];\r\n const nonUrlParams: Param[] = values(mapObj(omit(state.params || {}, urlParams.map(prop('id'))), makeConfigParam));\r\n return urlParams\r\n .concat(nonUrlParams)\r\n .map((p) => [p.id, p])\r\n .reduce(applyPairs, {});\r\n };\r\n\r\nfunction pathBuilder(state: StateObject) {\r\n return state.parent ? state.parent.path.concat(state) : /*root*/ [state];\r\n}\r\n\r\nfunction includesBuilder(state: StateObject) {\r\n const includes = state.parent ? extend({}, state.parent.includes) : {};\r\n includes[state.name] = true;\r\n return includes;\r\n}\r\n\r\n/**\r\n * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]].\r\n *\r\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\r\n * validates the `resolve` property and converts it to a [[Resolvable]] array.\r\n *\r\n * resolve: input value can be:\r\n *\r\n * {\r\n * // analyzed but not injected\r\n * myFooResolve: function() { return \"myFooData\"; },\r\n *\r\n * // function.toString() parsed, \"DependencyName\" dep as string (not min-safe)\r\n * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() },\r\n *\r\n * // Array split; \"DependencyName\" dep as string\r\n * myBazResolve: [ \"DependencyName\", function(dep) { return dep.fetchSomethingAsPromise() },\r\n *\r\n * // Array split; DependencyType dep as token (compared using ===)\r\n * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() },\r\n *\r\n * // val.$inject used as deps\r\n * // where:\r\n * // corgeResolve.$inject = [\"DependencyName\"];\r\n * // function corgeResolve(dep) { dep.fetchSometingAsPromise() }\r\n * // then \"DependencyName\" dep as string\r\n * myCorgeResolve: corgeResolve,\r\n *\r\n * // inject service by name\r\n * // When a string is found, desugar creating a resolve that injects the named service\r\n * myGraultResolve: \"SomeService\"\r\n * }\r\n *\r\n * or:\r\n *\r\n * [\r\n * new Resolvable(\"myFooResolve\", function() { return \"myFooData\" }),\r\n * new Resolvable(\"myBarResolve\", function(dep) { return dep.fetchSomethingAsPromise() }, [ \"DependencyName\" ]),\r\n * { provide: \"myBazResolve\", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ \"DependencyName\" ] }\r\n * ]\r\n */\r\nexport function resolvablesBuilder(state: StateObject): Resolvable[] {\r\n interface Tuple {\r\n token: any;\r\n val: any;\r\n deps: any[];\r\n policy: ResolvePolicy;\r\n }\r\n\r\n /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */\r\n const objects2Tuples = (resolveObj: Obj, resolvePolicies: { [key: string]: ResolvePolicy }) =>\r\n Object.keys(resolveObj || {}).map((token) => ({\r\n token,\r\n val: resolveObj[token],\r\n deps: undefined,\r\n policy: resolvePolicies[token],\r\n }));\r\n\r\n /** fetch DI annotations from a function or ng1-style array */\r\n const annotate = (fn: Function) => {\r\n const $injector = services.$injector;\r\n // ng1 doesn't have an $injector until runtime.\r\n // If the $injector doesn't exist, use \"deferred\" literal as a\r\n // marker indicating they should be annotated when runtime starts\r\n return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || <any>'deferred';\r\n };\r\n\r\n /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */\r\n const isResolveLiteral = (obj: any) => !!(obj.token && obj.resolveFn);\r\n\r\n /** true if the object looks like a provide literal, or a ng2 Provider */\r\n const isLikeNg2Provider = (obj: any) =>\r\n !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass));\r\n\r\n /** true if the object looks like a tuple from obj2Tuples */\r\n const isTupleFromObj = (obj: any) =>\r\n !!(obj && obj.val && (isString(obj.val) || isArray(obj.val) || isFunction(obj.val)));\r\n\r\n /** extracts the token from a Provider or provide literal */\r\n const getToken = (p: any) => p.provide || p.token;\r\n\r\n // prettier-ignore: Given a literal resolve or provider object, returns a Resolvable\r\n const literal2Resolvable = pattern([\r\n [prop('resolveFn'), (p) => new Resolvable(getToken(p), p.resolveFn, p.deps, p.policy)],\r\n [prop('useFactory'), (p) => new Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy)],\r\n [prop('useClass'), (p) => new Resolvable(getToken(p), () => new (<any>p.useClass)(), [], p.policy)],\r\n [prop('useValue'), (p) => new Resolvable(getToken(p), () => p.useValue, [], p.policy, p.useValue)],\r\n [prop('useExisting'), (p) => new Resolvable(getToken(p), identity, [p.useExisting], p.policy)],\r\n ]);\r\n\r\n // prettier-ignore\r\n const tuple2Resolvable = pattern([\r\n [pipe(prop('val'), isString), (tuple: Tuple) => new Resolvable(tuple.token, identity, [tuple.val], tuple.policy)],\r\n [pipe(prop('val'), isArray), (tuple: Tuple) => new Resolvable(tuple.token, tail(<any[]>tuple.val), tuple.val.slice(0, -1), tuple.policy)],\r\n [pipe(prop('val'), isFunction), (tuple: Tuple) => new Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy)],\r\n ]);\r\n\r\n // prettier-ignore\r\n const item2Resolvable = <(obj: any) => Resolvable>pattern([\r\n [is(Resolvable), (r: Resolvable) => r],\r\n [isResolveLiteral, literal2Resolvable],\r\n [isLikeNg2Provider, literal2Resolvable],\r\n [isTupleFromObj, tuple2Resolvable],\r\n [val(true), (obj: any) => { throw new Error('Invalid resolve value: ' + stringify(obj)); }, ],\r\n ]);\r\n\r\n // If resolveBlock is already an array, use it as-is.\r\n // Otherwise, assume it's an object and convert to an Array of tuples\r\n const decl = state.resolve;\r\n const items: any[] = isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {});\r\n return items.map(item2Resolvable);\r\n}\r\n\r\n/**\r\n * A internal global service\r\n *\r\n * StateBuilder is a factory for the internal [[StateObject]] objects.\r\n *\r\n * When you register a state with the [[StateRegistry]], you register a plain old javascript object which\r\n * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding\r\n * [[StateObject]] object, which has an API and is used internally.\r\n *\r\n * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function\r\n * using the [[builder]] method.\r\n */\r\nexport class StateBuilder {\r\n /** An object that contains all the BuilderFunctions registered, key'd by the name of the State property they build */\r\n private builders: Builders;\r\n\r\n constructor(private matcher: StateMatcher, urlMatcherFactory: UrlMatcherFactory) {\r\n const self = this;\r\n\r\n const root = () => matcher.find('');\r\n const isRoot = (state: StateObject) => state.name === '';\r\n\r\n function parentBuilder(state: StateObject) {\r\n if (isRoot(state)) return null;\r\n return matcher.find(self.parentName(state)) || root();\r\n }\r\n\r\n this.builders = {\r\n name: [nameBuilder],\r\n self: [selfBuilder],\r\n parent: [parentBuilder],\r\n data: [dataBuilder],\r\n // Build a URLMatcher if necessary, either via a relative or absolute URL\r\n url: [getUrlBuilder(urlMatcherFactory, root)],\r\n // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\r\n navigable: [getNavigableBuilder(isRoot)],\r\n params: [getParamsBuilder(urlMatcherFactory.paramFactory)],\r\n // Each framework-specific ui-router implementation should define its own `views` builder\r\n // e.g., src/ng1/statebuilders/views.ts\r\n views: [],\r\n // Keep a full path from the root down to this state as this is needed for state activation.\r\n path: [pathBuilder],\r\n // Speed up $state.includes() as it's used a lot\r\n includes: [includesBuilder],\r\n resolvables: [resolvablesBuilder],\r\n };\r\n }\r\n\r\n /**\r\n * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).\r\n * More than one BuilderFunction can be registered for a given property.\r\n *\r\n * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.\r\n *\r\n * @param property The name of the State property being registered for.\r\n * @param fn The BuilderFunction which will be used to build the State property\r\n * @returns a function which deregisters the BuilderFunction\r\n */\r\n builder(property: string, fn: BuilderFunction): Function;\r\n /**\r\n * Gets the registered builder functions for a given property of [[StateObject]].\r\n *\r\n * @param property The name of the State property being registered for.\r\n * @returns the registered builder(s).\r\n * note: for backwards compatibility, this may be a single builder or an array of builders\r\n */\r\n builder(property: string): BuilderFunction | BuilderFunction[];\r\n builder(name: string, fn?: BuilderFunction): any {\r\n const builders = this.builders;\r\n const array = builders[name] || [];\r\n // Backwards compat: if only one builder exists, return it, else return whole arary.\r\n if (isString(name) && !isDefined(fn)) return array.length > 1 ? array : array[0];\r\n if (!isString(name) || !isFunction(fn)) return;\r\n\r\n builders[name] = array;\r\n builders[name].push(fn);\r\n return () => builders[name].splice(builders[name].indexOf(fn, 1)) && null;\r\n }\r\n\r\n /**\r\n * Builds all of the properties on an essentially blank State object, returning a State object which has all its\r\n * properties and API built.\r\n *\r\n * @param state an uninitialized State object\r\n * @returns the built State object\r\n */\r\n build(state: StateObject): StateObject {\r\n const { matcher, builders } = this;\r\n const parent = this.parentName(state);\r\n\r\n if (parent && !matcher.find(parent, undefined, false)) {\r\n return null;\r\n }\r\n\r\n for (const key in builders) {\r\n if (!builders.hasOwnProperty(key)) continue;\r\n const chain = builders[key].reduce(\r\n (parentFn: BuilderFunction, step: BuilderFunction) => (_state) => step(_state, parentFn),\r\n noop\r\n );\r\n state[key] = chain(state);\r\n }\r\n return state;\r\n }\r\n\r\n parentName(state: StateObject) {\r\n // name = 'foo.bar.baz.**'\r\n const name = state.name || '';\r\n // segments = ['foo', 'bar', 'baz', '.**']\r\n const segments = name.split('.');\r\n // segments = ['foo', 'bar', 'baz']\r\n const lastSegment = segments.pop();\r\n // segments = ['foo', 'bar'] (ignore .** segment for future states)\r\n if (lastSegment === '**') segments.pop();\r\n\r\n if (segments.length) {\r\n if (state.parent) {\r\n throw new Error(`States that specify the 'parent:' property should not have a '.' in their name (${name})`);\r\n }\r\n\r\n // 'foo.bar'\r\n return segments.join('.');\r\n }\r\n\r\n if (!state.parent) return '';\r\n return isString(state.parent) ? state.parent : state.parent.name;\r\n }\r\n\r\n name(state: StateObject) {\r\n const name = state.name;\r\n if (name.indexOf('.') !== -1 || !state.parent) return name;\r\n\r\n const parentName = isString(state.parent) ? state.parent : state.parent.name;\r\n return parentName ? parentName + '.' + name : name;\r\n }\r\n}\r\n","import { isString } from '../common/predicates';\r\nimport { StateOrName } from './interface';\r\nimport { StateObject } from './stateObject';\r\nimport { values } from '../common/common';\r\nimport { safeConsole } from '../common/safeConsole';\r\n\r\nexport class StateMatcher {\r\n constructor(private _states: { [key: string]: StateObject }) {}\r\n\r\n isRelative(stateName: string) {\r\n stateName = stateName || '';\r\n return stateName.indexOf('.') === 0 || stateName.indexOf('^') === 0;\r\n }\r\n\r\n find(stateOrName: StateOrName, base?: StateOrName, matchGlob = true): StateObject {\r\n if (!stateOrName && stateOrName !== '') return undefined;\r\n const isStr = isString(stateOrName);\r\n let name: string = isStr ? stateOrName : (<any>stateOrName).name;\r\n\r\n if (this.isRelative(name)) name = this.resolvePath(name, base);\r\n const state = this._states[name];\r\n\r\n if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\r\n return state;\r\n } else if (isStr && matchGlob) {\r\n const _states = values(this._states);\r\n const matches = _states.filter(\r\n (_state) => _state.__stateObjectCache.nameGlob && _state.__stateObjectCache.nameGlob.matches(name)\r\n );\r\n\r\n if (matches.length > 1) {\r\n safeConsole.error(\r\n `stateMatcher.find: Found multiple matches for ${name} using glob: `,\r\n matches.map((match) => match.name)\r\n );\r\n }\r\n return matches[0];\r\n }\r\n return undefined;\r\n }\r\n\r\n resolvePath(name: string, base: StateOrName) {\r\n if (!base) throw new Error(`No reference point given for path '${name}'`);\r\n\r\n const baseState: StateObject = this.find(base);\r\n\r\n const splitName = name.split('.');\r\n const pathLength = splitName.length;\r\n let i = 0,\r\n current = baseState;\r\n\r\n for (; i < pathLength; i++) {\r\n if (splitName[i] === '' && i === 0) {\r\n current = baseState;\r\n continue;\r\n }\r\n if (splitName[i] === '^') {\r\n if (!current.parent) throw new Error(`Path '${name}' not valid for state '${baseState.name}'`);\r\n current = current.parent;\r\n continue;\r\n }\r\n break;\r\n }\r\n const relName = splitName.slice(i).join('.');\r\n return current.name + (current.name && relName ? '.' : '') + relName;\r\n }\r\n}\r\n","import { StateDeclaration, _ViewDeclaration, _StateDeclaration, LazyLoadResult } from './interface';\r\nimport { defaults, values, find, inherit } from '../common/common';\r\nimport { propEq } from '../common/hof';\r\nimport { Param } from '../params/param';\r\nimport { UrlMatcher } from '../url/urlMatcher';\r\nimport { Resolvable } from '../resolve/resolvable';\r\nimport { TransitionStateHookFn } from '../transition/interface';\r\nimport { TargetState } from './targetState';\r\nimport { Transition } from '../transition/transition';\r\nimport { Glob } from '../common/glob';\r\nimport { isObject, isFunction } from '../common/predicates';\r\n\r\n/**\r\n * Internal representation of a UI-Router state.\r\n *\r\n * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]].\r\n *\r\n * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object.\r\n *\r\n * This class prototypally inherits from the corresponding [[StateDeclaration]].\r\n * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].\r\n */\r\nexport class StateObject {\r\n /** The parent [[StateObject]] */\r\n public parent: StateObject;\r\n\r\n /** The name used to register the state */\r\n public name: string;\r\n\r\n /** Prototypally inherits from [[StateDeclaration.abstract]] */\r\n public abstract: boolean;\r\n\r\n /** Prototypally inherits from [[StateDeclaration.resolve]] */\r\n public resolve: { [key: string]: string | any[] | Function } | any[];\r\n\r\n /** A list of [[Resolvable]] objects. The internal representation of [[resolve]]. */\r\n public resolvables: Resolvable[];\r\n\r\n /** Prototypally inherits from [[StateDeclaration.resolvePolicy]] */\r\n public resolvePolicy: any;\r\n\r\n /** A compiled URLMatcher which detects when the state's URL is matched */\r\n public url: UrlMatcher;\r\n\r\n /** The parameters for the state, built from the URL and [[StateDeclaration.params]] */\r\n public params: { [key: string]: Param };\r\n\r\n /**\r\n * The views for the state.\r\n * Note: `@uirouter/core` does not register a builder for views.\r\n * The framework specific code should register a `views` builder.\r\n */\r\n public views: { [key: string]: _ViewDeclaration };\r\n\r\n /**\r\n * The original [[StateDeclaration]] used to build this [[StateObject]].\r\n * Note: `this` object also prototypally inherits from the `self` declaration object.\r\n */\r\n public self: StateDeclaration;\r\n\r\n /** The nearest parent [[StateObject]] which has a URL */\r\n public navigable: StateObject;\r\n\r\n /** The parent [[StateObject]] objects from this state up to the root */\r\n public path: StateObject[];\r\n\r\n /**\r\n * Prototypally inherits from [[StateDeclaration.data]]\r\n * Note: This is the only field on the [[StateDeclaration]] which is mutated.\r\n * The definition object's `data` field is replaced with a new object\r\n * which prototypally inherits from the parent state definition's `data` field.\r\n */\r\n public data: any;\r\n\r\n /**\r\n * An object containing the parent States' names as keys and\r\n * true as their values.\r\n */\r\n public includes: { [name: string]: boolean };\r\n\r\n /** Prototypally inherits from [[StateDeclaration.onExit]] */\r\n public onExit: TransitionStateHookFn;\r\n /** Prototypally inherits from [[StateDeclaration.onRetain]] */\r\n public onRetain: TransitionStateHookFn;\r\n /** Prototypally inherits from [[StateDeclaration.onEnter]] */\r\n public onEnter: TransitionStateHookFn;\r\n\r\n /** Prototypally inherits from [[StateDeclaration.lazyLoad]] */\r\n public lazyLoad: (transition: Transition, state: StateDeclaration) => Promise<LazyLoadResult>;\r\n\r\n /** Prototypally inherits from [[StateDeclaration.redirectTo]] */\r\n redirectTo:\r\n | string\r\n | (($transition$: Transition) => TargetState)\r\n | { state: string | StateDeclaration; params: { [key: string]: any } };\r\n\r\n /** @internal */\r\n __stateObjectCache: {\r\n /** Might be null */\r\n nameGlob?: Glob;\r\n };\r\n\r\n /**\r\n * Create a state object to put the private/internal implementation details onto.\r\n * The object's prototype chain looks like:\r\n * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)\r\n *\r\n * @param stateDecl the user-supplied State Declaration\r\n * @returns {StateObject} an internal State object\r\n */\r\n static create(stateDecl: _StateDeclaration): StateObject {\r\n stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl;\r\n\r\n const state = inherit(inherit(stateDecl, StateObject.prototype)) as StateObject;\r\n stateDecl.$$state = () => state;\r\n state.self = stateDecl;\r\n state.__stateObjectCache = {\r\n nameGlob: Glob.fromString(state.name), // might return null\r\n };\r\n return state;\r\n }\r\n\r\n /** Predicate which returns true if the object is an class with @State() decorator */\r\n static isStateClass = (stateDecl: _StateDeclaration): stateDecl is { new (): StateDeclaration } =>\r\n isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;\r\n\r\n /** Predicate which returns true if the object is a [[StateDeclaration]] object */\r\n static isStateDeclaration = (obj: any): obj is StateDeclaration => isFunction(obj['$$state']);\r\n\r\n /** Predicate which returns true if the object is an internal [[StateObject]] object */\r\n static isState = (obj: any): obj is StateObject => isObject(obj['__stateObjectCache']);\r\n\r\n /** @deprecated use State.create() */\r\n constructor(config?: StateDeclaration) {\r\n return StateObject.create(config || {});\r\n }\r\n\r\n /**\r\n * Returns true if the provided parameter is the same state.\r\n *\r\n * Compares the identity of the state against the passed value, which is either an object\r\n * reference to the actual `State` instance, the original definition object passed to\r\n * `$stateProvider.state()`, or the fully-qualified name.\r\n *\r\n * @param ref Can be one of (a) a `State` instance, (b) an object that was passed\r\n * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.\r\n * @returns Returns `true` if `ref` matches the current `State` instance.\r\n */\r\n is(ref: StateObject | StateDeclaration | string): boolean {\r\n return this === ref || this.self === ref || this.fqn() === ref;\r\n }\r\n\r\n /**\r\n * @deprecated this does not properly handle dot notation\r\n * @returns Returns a dot-separated name of the state.\r\n */\r\n fqn(): string {\r\n if (!this.parent || !(this.parent instanceof this.constructor)) return this.name;\r\n const name = this.parent.fqn();\r\n return name ? name + '.' + this.name : this.name;\r\n }\r\n\r\n /**\r\n * Returns the root node of this state's tree.\r\n *\r\n * @returns The root of this state's tree.\r\n */\r\n root(): StateObject {\r\n return (this.parent && this.parent.root()) || this;\r\n }\r\n\r\n /**\r\n * Gets the state's `Param` objects\r\n *\r\n * Gets the list of [[Param]] objects owned by the state.\r\n * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.\r\n * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object\r\n *\r\n * @param opts options\r\n */\r\n parameters(opts?: { inherit?: boolean; matchingKeys?: any }): Param[] {\r\n opts = defaults(opts, { inherit: true, matchingKeys: null });\r\n const inherited = (opts.inherit && this.parent && this.parent.parameters()) || [];\r\n return inherited\r\n .concat(values(this.params))\r\n .filter((param) => !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id));\r\n }\r\n\r\n /**\r\n * Returns a single [[Param]] that is owned by the state\r\n *\r\n * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.\r\n * @param id the name of the [[Param]] to return\r\n * @param opts options\r\n */\r\n parameter(id: string, opts: { inherit?: boolean } = {}): Param {\r\n return (\r\n (this.url && this.url.parameter(id, opts)) ||\r\n find(values(this.params), propEq('id', id)) ||\r\n (opts.inherit && this.parent && this.parent.parameter(id))\r\n );\r\n }\r\n\r\n toString() {\r\n return this.fqn();\r\n }\r\n}\r\n","import { inArray, isString, prop } from '../common';\r\nimport { _StateDeclaration } from './interface';\r\nimport { StateObject } from './stateObject';\r\nimport { StateBuilder } from './stateBuilder';\r\nimport { StateRegistryListener } from './stateRegistry';\r\nimport { Disposable } from '../interface';\r\nimport { UIRouter } from '../router';\r\n\r\nexport class StateQueueManager implements Disposable {\r\n queue: StateObject[] = [];\r\n\r\n constructor(\r\n private router: UIRouter,\r\n public states: { [key: string]: StateObject },\r\n public builder: StateBuilder,\r\n public listeners: StateRegistryListener[]\r\n ) {}\r\n\r\n dispose() {\r\n this.queue = [];\r\n }\r\n\r\n register(stateDecl: _StateDeclaration) {\r\n const queue = this.queue;\r\n const state = StateObject.create(stateDecl);\r\n const name = state.name;\r\n\r\n if (!isString(name)) throw new Error('State must have a valid name');\r\n if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name))\r\n throw new Error(`State '${name}' is already defined`);\r\n\r\n queue.push(state);\r\n this.flush();\r\n\r\n return state;\r\n }\r\n\r\n flush() {\r\n const { queue, states, builder } = this;\r\n const registered: StateObject[] = [], // states that got registered\r\n orphans: StateObject[] = [], // states that don't yet have a parent registered\r\n previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered\r\n const getState = (name) => this.states.hasOwnProperty(name) && this.states[name];\r\n const notifyListeners = () => {\r\n if (registered.length) {\r\n this.listeners.forEach((listener) =>\r\n listener(\r\n 'registered',\r\n registered.map((s) => s.self)\r\n )\r\n );\r\n }\r\n };\r\n\r\n while (queue.length > 0) {\r\n const state: StateObject = queue.shift();\r\n const name = state.name;\r\n const result: StateObject = builder.build(state);\r\n const orphanIdx: number = orphans.indexOf(state);\r\n\r\n if (result) {\r\n const existingState = getState(name);\r\n if (existingState && existingState.name === name) {\r\n throw new Error(`State '${name}' is already defined`);\r\n }\r\n\r\n const existingFutureState = getState(name + '.**');\r\n if (existingFutureState) {\r\n // Remove future state of the same name\r\n this.router.stateRegistry.deregister(existingFutureState);\r\n }\r\n\r\n states[name] = state;\r\n this.attachRoute(state);\r\n if (orphanIdx >= 0) orphans.splice(orphanIdx, 1);\r\n registered.push(state);\r\n continue;\r\n }\r\n\r\n const prev = previousQueueLength[name];\r\n previousQueueLength[name] = queue.length;\r\n if (orphanIdx >= 0 && prev === queue.length) {\r\n // Wait until two consecutive iterations where no additional states were dequeued successfully.\r\n // throw new Error(`Cannot register orphaned state '${name}'`);\r\n queue.push(state);\r\n notifyListeners();\r\n return states;\r\n } else if (orphanIdx < 0) {\r\n orphans.push(state);\r\n }\r\n\r\n queue.push(state);\r\n }\r\n\r\n notifyListeners();\r\n return states;\r\n }\r\n\r\n attachRoute(state: StateObject) {\r\n if (state.abstract || !state.url) return;\r\n const rulesApi = this.router.urlService.rules;\r\n rulesApi.rule(rulesApi.urlRuleFactory.create(state));\r\n }\r\n}\r\n","import { StateObject } from './stateObject';\r\nimport { StateMatcher } from './stateMatcher';\r\nimport { StateBuilder } from './stateBuilder';\r\nimport { StateQueueManager } from './stateQueueManager';\r\nimport { StateDeclaration, _StateDeclaration } from './interface';\r\nimport { BuilderFunction } from './stateBuilder';\r\nimport { StateOrName } from './interface';\r\nimport { removeFrom } from '../common/common';\r\nimport { UIRouter } from '../router';\r\nimport { propEq } from '../common/hof';\r\n\r\n/**\r\n * The signature for the callback function provided to [[StateRegistry.onStatesChanged]].\r\n *\r\n * This callback receives two parameters:\r\n *\r\n * @param event a string; either \"registered\" or \"deregistered\"\r\n * @param states the list of [[StateDeclaration]]s that were registered (or deregistered).\r\n */\r\nexport type StateRegistryListener = (event: 'registered' | 'deregistered', states: StateDeclaration[]) => void;\r\n\r\n/**\r\n * A registry for all of the application's [[StateDeclaration]]s\r\n *\r\n * This API is found at `router.stateRegistry` ([[UIRouter.stateRegistry]])\r\n */\r\nexport class StateRegistry {\r\n private _root: StateObject;\r\n private states: { [key: string]: StateObject } = {};\r\n\r\n /** @internal */\r\n matcher: StateMatcher;\r\n private builder: StateBuilder;\r\n /** @internal */\r\n stateQueue: StateQueueManager;\r\n\r\n /** @internal */\r\n listeners: StateRegistryListener[] = [];\r\n\r\n /** @internal */\r\n constructor(private router: UIRouter) {\r\n this.matcher = new StateMatcher(this.states);\r\n this.builder = new StateBuilder(this.matcher, router.urlMatcherFactory);\r\n this.stateQueue = new StateQueueManager(router, this.states, this.builder, this.listeners);\r\n this._registerRoot();\r\n }\r\n\r\n /** @internal */\r\n private _registerRoot() {\r\n const rootStateDef: StateDeclaration = {\r\n name: '',\r\n url: '^',\r\n views: null,\r\n params: {\r\n '#': { value: null, type: 'hash', dynamic: true },\r\n },\r\n abstract: true,\r\n };\r\n\r\n const _root = (this._root = this.stateQueue.register(rootStateDef));\r\n _root.navigable = null;\r\n }\r\n\r\n /** @internal */\r\n dispose() {\r\n this.stateQueue.dispose();\r\n this.listeners = [];\r\n this.get().forEach((state) => this.get(state) && this.deregister(state));\r\n }\r\n\r\n /**\r\n * Listen for a State Registry events\r\n *\r\n * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.\r\n *\r\n * #### Example:\r\n * ```js\r\n * let allStates = registry.get();\r\n *\r\n * // Later, invoke deregisterFn() to remove the listener\r\n * let deregisterFn = registry.onStatesChanged((event, states) => {\r\n * switch(event) {\r\n * case: 'registered':\r\n * states.forEach(state => allStates.push(state));\r\n * break;\r\n * case: 'deregistered':\r\n * states.forEach(state => {\r\n * let idx = allStates.indexOf(state);\r\n * if (idx !== -1) allStates.splice(idx, 1);\r\n * });\r\n * break;\r\n * }\r\n * });\r\n * ```\r\n *\r\n * @param listener a callback function invoked when the registered states changes.\r\n * The function receives two parameters, `event` and `state`.\r\n * See [[StateRegistryListener]]\r\n * @return a function that deregisters the listener\r\n */\r\n onStatesChanged(listener: StateRegistryListener): () => void {\r\n this.listeners.push(listener);\r\n return function deregisterListener() {\r\n removeFrom(this.listeners)(listener);\r\n }.bind(this);\r\n }\r\n\r\n /**\r\n * Gets the implicit root state\r\n *\r\n * Gets the root of the state tree.\r\n * The root state is implicitly created by UI-Router.\r\n * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]\r\n *\r\n * @return the root [[StateObject]]\r\n */\r\n root() {\r\n return this._root;\r\n }\r\n\r\n /**\r\n * Adds a state to the registry\r\n *\r\n * Registers a [[StateDeclaration]] or queues it for registration.\r\n *\r\n * Note: a state will be queued if the state's parent isn't yet registered.\r\n *\r\n * @param stateDefinition the definition of the state to register.\r\n * @returns the internal [[StateObject]] object.\r\n * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).\r\n * If the state was only queued, then the object is not fully built.\r\n */\r\n register(stateDefinition: _StateDeclaration): StateObject {\r\n return this.stateQueue.register(stateDefinition);\r\n }\r\n\r\n /** @internal */\r\n private _deregisterTree(state: StateObject) {\r\n const all = this.get().map((s) => s.$$state());\r\n const getChildren = (states: StateObject[]) => {\r\n const _children = all.filter((s) => states.indexOf(s.parent) !== -1);\r\n return _children.length === 0 ? _children : _children.concat(getChildren(_children));\r\n };\r\n\r\n const children = getChildren([state]);\r\n const deregistered: StateObject[] = [state].concat(children).reverse();\r\n\r\n deregistered.forEach((_state) => {\r\n const rulesApi = this.router.urlService.rules;\r\n\r\n // Remove URL rule\r\n rulesApi\r\n .rules()\r\n .filter(propEq('state', _state))\r\n .forEach((rule) => rulesApi.removeRule(rule));\r\n\r\n // Remove state from registry\r\n delete this.states[_state.name];\r\n });\r\n\r\n return deregistered;\r\n }\r\n\r\n /**\r\n * Removes a state from the registry\r\n *\r\n * This removes a state from the registry.\r\n * If the state has children, they are are also removed from the registry.\r\n *\r\n * @param stateOrName the state's name or object representation\r\n * @returns {StateObject[]} a list of removed states\r\n */\r\n deregister(stateOrName: StateOrName) {\r\n const _state = this.get(stateOrName);\r\n if (!_state) throw new Error(\"Can't deregister state; not found: \" + stateOrName);\r\n const deregisteredStates = this._deregisterTree(_state.$$state());\r\n\r\n this.listeners.forEach((listener) =>\r\n listener(\r\n 'deregistered',\r\n deregisteredStates.map((s) => s.self)\r\n )\r\n );\r\n return deregisteredStates;\r\n }\r\n\r\n /**\r\n * Gets all registered states\r\n *\r\n * Calling this method with no arguments will return a list of all the states that are currently registered.\r\n * Note: this does not return states that are *queued* but not yet registered.\r\n *\r\n * @return a list of [[StateDeclaration]]s\r\n */\r\n get(): StateDeclaration[];\r\n\r\n /**\r\n * Gets a registered state\r\n *\r\n * Given a state or a name, finds and returns the [[StateDeclaration]] from the registry.\r\n * Note: this does not return states that are *queued* but not yet registered.\r\n *\r\n * @param stateOrName either the name of a state, or a state object.\r\n * @param base the base state to use when stateOrName is relative.\r\n * @return a registered [[StateDeclaration]] that matched the `stateOrName`, or null if the state isn't registered.\r\n */\r\n get(stateOrName: StateOrName, base?: StateOrName): StateDeclaration;\r\n get(stateOrName?: StateOrName, base?: StateOrName): any {\r\n if (arguments.length === 0)\r\n return <StateDeclaration[]>Object.keys(this.states).map((name) => this.states[name].self);\r\n const found = this.matcher.find(stateOrName, base);\r\n return (found && found.self) || null;\r\n }\r\n\r\n /**\r\n * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).\r\n * More than one BuilderFunction can be registered for a given property.\r\n *\r\n * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.\r\n *\r\n * @param property The name of the State property being registered for.\r\n * @param builderFunction The BuilderFunction which will be used to build the State property\r\n * @returns a function which deregisters the BuilderFunction\r\n */\r\n decorator(property: string, builderFunction: BuilderFunction) {\r\n return this.builder.builder(property, builderFunction);\r\n }\r\n}\r\n","import {\r\n createProxyFunctions,\r\n defaults,\r\n extend,\r\n inArray,\r\n noop,\r\n removeFrom,\r\n silenceUncaughtInPromise,\r\n silentRejection,\r\n} from '../common/common';\r\nimport { isDefined, isObject, isString } from '../common/predicates';\r\nimport { Queue } from '../common/queue';\r\nimport { services } from '../common/coreservices';\r\n\r\nimport { PathUtils } from '../path/pathUtils';\r\nimport { PathNode } from '../path/pathNode';\r\n\r\nimport { HookResult, TransitionOptions } from '../transition/interface';\r\nimport { defaultTransOpts } from '../transition/transitionService';\r\nimport { Rejection, RejectType } from '../transition/rejectFactory';\r\nimport { Transition } from '../transition/transition';\r\n\r\nimport { HrefOptions, LazyLoadResult, StateDeclaration, StateOrName, TransitionPromise } from './interface';\r\nimport { StateObject } from './stateObject';\r\nimport { TargetState } from './targetState';\r\n\r\nimport { RawParams } from '../params/interface';\r\nimport { Param } from '../params/param';\r\nimport { Glob } from '../common/glob';\r\nimport { UIRouter } from '../router';\r\nimport { UIInjector } from '../interface';\r\nimport { ResolveContext } from '../resolve/resolveContext';\r\nimport { lazyLoadState } from '../hooks/lazyLoad';\r\nimport { not, val } from '../common/hof';\r\nimport { StateParams } from '../params/stateParams';\r\n\r\nexport type OnInvalidCallback = (toState?: TargetState, fromState?: TargetState, injector?: UIInjector) => HookResult;\r\n\r\n/**\r\n * Provides services related to ui-router states.\r\n *\r\n * This API is located at `router.stateService` ([[UIRouter.stateService]])\r\n */\r\nexport class StateService {\r\n /** @internal */\r\n invalidCallbacks: OnInvalidCallback[] = [];\r\n\r\n /**\r\n * The [[Transition]] currently in progress (or null)\r\n *\r\n * @deprecated This is a passthrough through to [[UIRouterGlobals.transition]]\r\n */\r\n get transition() {\r\n return this.router.globals.transition;\r\n }\r\n /**\r\n * The latest successful state parameters\r\n *\r\n * @deprecated This is a passthrough through to [[UIRouterGlobals.params]]\r\n */\r\n get params(): StateParams {\r\n return this.router.globals.params;\r\n }\r\n /**\r\n * The current [[StateDeclaration]]\r\n *\r\n * @deprecated This is a passthrough through to [[UIRouterGlobals.current]]\r\n */\r\n get current() {\r\n return this.router.globals.current;\r\n }\r\n /**\r\n * The current [[StateObject]] (an internal API)\r\n *\r\n * @deprecated This is a passthrough through to [[UIRouterGlobals.$current]]\r\n */\r\n get $current() {\r\n return this.router.globals.$current;\r\n }\r\n\r\n /** @internal */\r\n constructor(/** @internal */ private router: UIRouter) {\r\n const getters = ['current', '$current', 'params', 'transition'];\r\n const boundFns = Object.keys(StateService.prototype).filter(not(inArray(getters)));\r\n createProxyFunctions(val(StateService.prototype), this, val(this), boundFns);\r\n }\r\n\r\n /** @internal */\r\n dispose() {\r\n this.defaultErrorHandler(noop);\r\n this.invalidCallbacks = [];\r\n }\r\n\r\n /**\r\n * Handler for when [[transitionTo]] is called with an invalid state.\r\n *\r\n * Invokes the [[onInvalid]] callbacks, in natural order.\r\n * Each callback's return value is checked in sequence until one of them returns an instance of TargetState.\r\n * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises.\r\n *\r\n * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned.\r\n *\r\n * @internal\r\n */\r\n private _handleInvalidTargetState(fromPath: PathNode[], toState: TargetState) {\r\n const fromState = PathUtils.makeTargetState(this.router.stateRegistry, fromPath);\r\n const globals = this.router.globals;\r\n const latestThing = () => globals.transitionHistory.peekTail();\r\n const latest = latestThing();\r\n const callbackQueue = new Queue<OnInvalidCallback>(this.invalidCallbacks.slice());\r\n const injector = new ResolveContext(fromPath).injector();\r\n\r\n const checkForRedirect = (result: HookResult) => {\r\n if (!(result instanceof TargetState)) {\r\n return;\r\n }\r\n\r\n let target = <TargetState>result;\r\n // Recreate the TargetState, in case the state is now defined.\r\n target = this.target(target.identifier(), target.params(), target.options());\r\n\r\n if (!target.valid()) {\r\n return Rejection.invalid(target.error()).toPromise();\r\n }\r\n\r\n if (latestThing() !== latest) {\r\n return Rejection.superseded().toPromise();\r\n }\r\n\r\n return this.transitionTo(target.identifier(), target.params(), target.options());\r\n };\r\n\r\n function invokeNextCallback() {\r\n const nextCallback = callbackQueue.dequeue();\r\n if (nextCallback === undefined) return Rejection.invalid(toState.error()).toPromise();\r\n\r\n const callbackResult = services.$q.when(nextCallback(toState, fromState, injector));\r\n return callbackResult.then(checkForRedirect).then((result) => result || invokeNextCallback());\r\n }\r\n\r\n return invokeNextCallback();\r\n }\r\n\r\n /**\r\n * Registers an Invalid State handler\r\n *\r\n * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]]\r\n * has been called with an invalid state reference parameter\r\n *\r\n * Example:\r\n * ```js\r\n * stateService.onInvalid(function(to, from, injector) {\r\n * if (to.name() === 'foo') {\r\n * let lazyLoader = injector.get('LazyLoadService');\r\n * return lazyLoader.load('foo')\r\n * .then(() => stateService.target('foo'));\r\n * }\r\n * });\r\n * ```\r\n *\r\n * @param {function} callback invoked when the toState is invalid\r\n * This function receives the (invalid) toState, the fromState, and an injector.\r\n * The function may optionally return a [[TargetState]] or a Promise for a TargetState.\r\n * If one is returned, it is treated as a redirect.\r\n *\r\n * @returns a function which deregisters the callback\r\n */\r\n onInvalid(callback: OnInvalidCallback): Function {\r\n this.invalidCallbacks.push(callback);\r\n return function deregisterListener() {\r\n removeFrom(this.invalidCallbacks)(callback);\r\n }.bind(this);\r\n }\r\n\r\n /**\r\n * Reloads the current state\r\n *\r\n * A method that force reloads the current state, or a partial state hierarchy.\r\n * All resolves are re-resolved, and components reinstantiated.\r\n *\r\n * #### Example:\r\n * ```js\r\n * let app angular.module('app', ['ui.router']);\r\n *\r\n * app.controller('ctrl', function ($scope, $state) {\r\n * $scope.reload = function(){\r\n * $state.reload();\r\n * }\r\n * });\r\n * ```\r\n *\r\n * Note: `reload()` is just an alias for:\r\n *\r\n * ```js\r\n * $state.transitionTo($state.current, $state.params, {\r\n * reload: true, inherit: false\r\n * });\r\n * ```\r\n *\r\n * @param reloadState A state name or a state object.\r\n * If present, this state and all its children will be reloaded, but ancestors will not reload.\r\n *\r\n * #### Example:\r\n * ```js\r\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item'\r\n * //and current state is 'contacts.detail.item'\r\n * let app angular.module('app', ['ui.router']);\r\n *\r\n * app.controller('ctrl', function ($scope, $state) {\r\n * $scope.reload = function(){\r\n * //will reload 'contact.detail' and nested 'contact.detail.item' states\r\n * $state.reload('contact.detail');\r\n * }\r\n * });\r\n * ```\r\n *\r\n * @returns A promise representing the state of the new transition. See [[StateService.go]]\r\n */\r\n reload(reloadState?: StateOrName): Promise<StateObject> {\r\n return this.transitionTo(this.current, this.params, {\r\n reload: isDefined(reloadState) ? reloadState : true,\r\n inherit: false,\r\n notify: false,\r\n });\r\n }\r\n\r\n /**\r\n * Transition to a different state and/or parameters\r\n *\r\n * Convenience method for transitioning to a new state.\r\n *\r\n * `$state.go` calls `$state.transitionTo` internally but automatically sets options to\r\n * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`.\r\n * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`).\r\n * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters\r\n * inherit from the current parameter values (because of `inherit: true`).\r\n *\r\n * #### Example:\r\n * ```js\r\n * let app = angular.module('app', ['ui.router']);\r\n *\r\n * app.controller('ctrl', function ($scope, $state) {\r\n * $scope.changeState = function () {\r\n * $state.go('contact.detail');\r\n * };\r\n * });\r\n * ```\r\n *\r\n * @param to Absolute state name, state object, or relative state path (relative to current state).\r\n *\r\n * Some examples:\r\n *\r\n * - `$state.go('contact.detail')` - will go to the `contact.detail` state\r\n * - `$state.go('^')` - will go to the parent state\r\n * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state\r\n * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state\r\n *\r\n * @param params A map of the parameters that will be sent to the state, will populate $stateParams.\r\n *\r\n * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`).\r\n * This allows, for example, going to a sibling state that shares parameters defined by a parent state.\r\n *\r\n * @param options Transition options\r\n *\r\n * @returns {promise} A promise representing the state of the new transition.\r\n */\r\n go(to: StateOrName, params?: RawParams, options?: TransitionOptions): TransitionPromise {\r\n const defautGoOpts = { relative: this.$current, inherit: true };\r\n const transOpts = defaults(options, defautGoOpts, defaultTransOpts);\r\n return this.transitionTo(to, params, transOpts);\r\n }\r\n\r\n /**\r\n * Creates a [[TargetState]]\r\n *\r\n * This is a factory method for creating a TargetState\r\n *\r\n * This may be returned from a Transition Hook to redirect a transition, for example.\r\n */\r\n target(identifier: StateOrName, params?: RawParams, options: TransitionOptions = {}): TargetState {\r\n // If we're reloading, find the state object to reload from\r\n if (isObject(options.reload) && !(<any>options.reload).name) throw new Error('Invalid reload state object');\r\n const reg = this.router.stateRegistry;\r\n options.reloadState =\r\n options.reload === true ? reg.root() : reg.matcher.find(<any>options.reload, options.relative);\r\n\r\n if (options.reload && !options.reloadState)\r\n throw new Error(\r\n `No such reload state '${isString(options.reload) ? options.reload : (<any>options.reload).name}'`\r\n );\r\n\r\n return new TargetState(this.router.stateRegistry, identifier, params, options);\r\n }\r\n\r\n /** @internal */\r\n private getCurrentPath(): PathNode[] {\r\n const globals = this.router.globals;\r\n const latestSuccess: Transition = globals.successfulTransitions.peekTail();\r\n const rootPath = () => [new PathNode(this.router.stateRegistry.root())];\r\n return latestSuccess ? latestSuccess.treeChanges().to : rootPath();\r\n }\r\n\r\n /**\r\n * Low-level method for transitioning to a new state.\r\n *\r\n * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations.\r\n *\r\n * #### Example:\r\n * ```js\r\n * let app = angular.module('app', ['ui.router']);\r\n *\r\n * app.controller('ctrl', function ($scope, $state) {\r\n * $scope.changeState = function () {\r\n * $state.transitionTo('contact.detail');\r\n * };\r\n * });\r\n * ```\r\n *\r\n * @param to State name or state object.\r\n * @param toParams A map of the parameters that will be sent to the state,\r\n * will populate $stateParams.\r\n * @param options Transition options\r\n *\r\n * @returns A promise representing the state of the new transition. See [[go]]\r\n */\r\n transitionTo(to: StateOrName, toParams: RawParams = {}, options: TransitionOptions = {}): TransitionPromise {\r\n const router = this.router;\r\n const globals = router.globals;\r\n options = defaults(options, defaultTransOpts);\r\n const getCurrent = () => globals.transition;\r\n options = extend(options, { current: getCurrent });\r\n\r\n const ref: TargetState = this.target(to, toParams, options);\r\n const currentPath = this.getCurrentPath();\r\n\r\n if (!ref.exists()) return this._handleInvalidTargetState(currentPath, ref);\r\n\r\n if (!ref.valid()) return <TransitionPromise>silentRejection(ref.error());\r\n\r\n if (options.supercede === false && getCurrent()) {\r\n return <TransitionPromise>(\r\n Rejection.ignored(\r\n '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.'\r\n ).toPromise()\r\n );\r\n }\r\n\r\n /**\r\n * Special handling for Ignored, Aborted, and Redirected transitions\r\n *\r\n * The semantics for the transition.run() promise and the StateService.transitionTo()\r\n * promise differ. For instance, the run() promise may be rejected because it was\r\n * IGNORED, but the transitionTo() promise is resolved because from the user perspective\r\n * no error occurred. Likewise, the transition.run() promise may be rejected because of\r\n * a Redirect, but the transitionTo() promise is chained to the new Transition's promise.\r\n */\r\n const rejectedTransitionHandler = (trans: Transition) => (error: any): Promise<any> => {\r\n if (error instanceof Rejection) {\r\n const isLatest = router.globals.lastStartedTransitionId <= trans.$id;\r\n\r\n if (error.type === RejectType.IGNORED) {\r\n isLatest && router.urlRouter.update();\r\n // Consider ignored `Transition.run()` as a successful `transitionTo`\r\n return services.$q.when(globals.current);\r\n }\r\n\r\n const detail: any = error.detail;\r\n if (error.type === RejectType.SUPERSEDED && error.redirected && detail instanceof TargetState) {\r\n // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully\r\n // by returning the promise for the new (redirect) `Transition.run()`.\r\n const redirect: Transition = trans.redirect(detail);\r\n return redirect.run().catch(rejectedTransitionHandler(redirect));\r\n }\r\n\r\n if (error.type === RejectType.ABORTED) {\r\n isLatest && router.urlRouter.update();\r\n return services.$q.reject(error);\r\n }\r\n }\r\n\r\n const errorHandler = this.defaultErrorHandler();\r\n errorHandler(error);\r\n\r\n return services.$q.reject(error);\r\n };\r\n\r\n const transition = this.router.transitionService.create(currentPath, ref);\r\n const transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition));\r\n silenceUncaughtInPromise(transitionToPromise); // issue #2676\r\n\r\n // Return a promise for the transition, which also has the transition object on it.\r\n return extend(transitionToPromise, { transition });\r\n }\r\n\r\n /**\r\n * Checks if the current state *is* the provided state\r\n *\r\n * Similar to [[includes]] but only checks for the full state name.\r\n * If params is supplied then it will be tested for strict equality against the current\r\n * active params object, so all params must match with none missing and no extras.\r\n *\r\n * #### Example:\r\n * ```js\r\n * $state.$current.name = 'contacts.details.item';\r\n *\r\n * // absolute name\r\n * $state.is('contact.details.item'); // returns true\r\n * $state.is(contactDetailItemStateObject); // returns true\r\n * ```\r\n *\r\n * // relative name (. and ^), typically from a template\r\n * // E.g. from the 'contacts.details' template\r\n * ```html\r\n * <div ng-class=\"{highlighted: $state.is('.item')}\">Item</div>\r\n * ```\r\n *\r\n * @param stateOrName The state name (absolute or relative) or state object you'd like to check.\r\n * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like\r\n * to test against the current active state.\r\n * @param options An options object. The options are:\r\n * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will\r\n * test relative to `options.relative` state (or name).\r\n *\r\n * @returns Returns true if it is the state.\r\n */\r\n is(stateOrName: StateOrName, params?: RawParams, options?: { relative?: StateOrName }): boolean {\r\n options = defaults(options, { relative: this.$current });\r\n const state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\r\n if (!isDefined(state)) return undefined;\r\n if (this.$current !== state) return false;\r\n if (!params) return true;\r\n\r\n const schema: Param[] = state.parameters({ inherit: true, matchingKeys: params });\r\n return Param.equals(schema, Param.values(schema, params), this.params);\r\n }\r\n\r\n /**\r\n * Checks if the current state *includes* the provided state\r\n *\r\n * A method to determine if the current active state is equal to or is the child of the\r\n * state stateName. If any params are passed then they will be tested for a match as well.\r\n * Not all the parameters need to be passed, just the ones you'd like to test for equality.\r\n *\r\n * #### Example when `$state.$current.name === 'contacts.details.item'`\r\n * ```js\r\n * // Using partial names\r\n * $state.includes(\"contacts\"); // returns true\r\n * $state.includes(\"contacts.details\"); // returns true\r\n * $state.includes(\"contacts.details.item\"); // returns true\r\n * $state.includes(\"contacts.list\"); // returns false\r\n * $state.includes(\"about\"); // returns false\r\n * ```\r\n *\r\n * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`:\r\n * ```js\r\n * $state.includes(\"*.details.*.*\"); // returns true\r\n * $state.includes(\"*.details.**\"); // returns true\r\n * $state.includes(\"**.item.**\"); // returns true\r\n * $state.includes(\"*.details.item.url\"); // returns true\r\n * $state.includes(\"*.details.*.url\"); // returns true\r\n * $state.includes(\"*.details.*\"); // returns false\r\n * $state.includes(\"item.**\"); // returns false\r\n * ```\r\n *\r\n * @param stateOrName A partial name, relative name, glob pattern,\r\n * or state object to be searched for within the current state name.\r\n * @param params A param object, e.g. `{sectionId: section.id}`,\r\n * that you'd like to test against the current active state.\r\n * @param options An options object. The options are:\r\n * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will\r\n * test relative to `options.relative` state (or name).\r\n *\r\n * @returns {boolean} Returns true if it does include the state\r\n */\r\n includes(stateOrName: StateOrName, params?: RawParams, options?: TransitionOptions): boolean {\r\n options = defaults(options, { relative: this.$current });\r\n const glob = isString(stateOrName) && Glob.fromString(<string>stateOrName);\r\n\r\n if (glob) {\r\n if (!glob.matches(this.$current.name)) return false;\r\n stateOrName = this.$current.name;\r\n }\r\n const state = this.router.stateRegistry.matcher.find(stateOrName, options.relative),\r\n include = this.$current.includes;\r\n\r\n if (!isDefined(state)) return undefined;\r\n if (!isDefined(include[state.name])) return false;\r\n if (!params) return true;\r\n\r\n const schema: Param[] = state.parameters({ inherit: true, matchingKeys: params });\r\n return Param.equals(schema, Param.values(schema, params), this.params);\r\n }\r\n\r\n /**\r\n * Generates a URL for a state and parameters\r\n *\r\n * Returns the url for the given state populated with the given params.\r\n *\r\n * #### Example:\r\n * ```js\r\n * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\r\n * ```\r\n *\r\n * @param stateOrName The state name or state object you'd like to generate a url from.\r\n * @param params An object of parameter values to fill the state's required parameters.\r\n * @param options Options object. The options are:\r\n *\r\n * @returns {string} compiled state url\r\n */\r\n href(stateOrName: StateOrName, params?: RawParams, options?: HrefOptions): string {\r\n const defaultHrefOpts = {\r\n lossy: true,\r\n inherit: true,\r\n absolute: false,\r\n relative: this.$current,\r\n };\r\n options = defaults(options, defaultHrefOpts);\r\n params = params || {};\r\n\r\n const state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\r\n\r\n if (!isDefined(state)) return null;\r\n if (options.inherit) params = <any>this.params.$inherit(params, this.$current, state);\r\n\r\n const nav = state && options.lossy ? state.navigable : state;\r\n\r\n if (!nav || nav.url === undefined || nav.url === null) {\r\n return null;\r\n }\r\n\r\n return this.router.urlRouter.href(nav.url, params, { absolute: options.absolute });\r\n }\r\n\r\n /** @internal */\r\n private _defaultErrorHandler: (_error: any) => void = function $defaultErrorHandler($error$) {\r\n if ($error$ instanceof Error && $error$.stack) {\r\n console.error($error$);\r\n console.error($error$.stack);\r\n } else if ($error$ instanceof Rejection) {\r\n console.error($error$.toString());\r\n if ($error$.detail && $error$.detail.stack) console.error($error$.detail.stack);\r\n } else {\r\n console.error($error$);\r\n }\r\n };\r\n\r\n /**\r\n * Sets or gets the default [[transitionTo]] error handler.\r\n *\r\n * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition.\r\n * This includes errors caused by resolves and transition hooks.\r\n *\r\n * Note:\r\n * This handler does not receive certain Transition rejections.\r\n * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]].\r\n *\r\n * The built-in default error handler logs the error to the console.\r\n *\r\n * You can provide your own custom handler.\r\n *\r\n * #### Example:\r\n * ```js\r\n * stateService.defaultErrorHandler(function() {\r\n * // Do not log transitionTo errors\r\n * });\r\n * ```\r\n *\r\n * @param handler a global error handler function\r\n * @returns the current global error handler\r\n */\r\n defaultErrorHandler(handler?: (error: any) => void): (error: any) => void {\r\n return (this._defaultErrorHandler = handler || this._defaultErrorHandler);\r\n }\r\n\r\n /**\r\n * Gets a registered [[StateDeclaration]] object\r\n *\r\n * Returns the state declaration object for any specific state, or for all registered states.\r\n *\r\n * @param stateOrName (absolute or relative) If provided, will only get the declaration object for the requested state.\r\n * If not provided, returns an array of ALL states.\r\n * @param base When `stateOrName` is a relative state reference (such as `.bar.baz`), the state will be retrieved relative to this state.\r\n *\r\n * @returns a [[StateDeclaration]] object (or array of all registered [[StateDeclaration]] objects.)\r\n * @deprecated use [[StateRegistry.get]]\r\n */\r\n get(stateOrName: StateOrName, base: StateOrName): StateDeclaration;\r\n get(stateOrName: StateOrName): StateDeclaration;\r\n get(): StateDeclaration[];\r\n get(stateOrName?: StateOrName, base?: StateOrName): any {\r\n const reg = this.router.stateRegistry;\r\n if (arguments.length === 0) return reg.get();\r\n return reg.get(stateOrName, base || this.$current);\r\n }\r\n\r\n /**\r\n * Lazy loads a state\r\n *\r\n * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function.\r\n *\r\n * @param stateOrName the state that should be lazy loaded\r\n * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc)\r\n * Note: If no transition is provided, a noop transition is created using the from the current state to the current state.\r\n * This noop transition is not actually run.\r\n *\r\n * @returns a promise to lazy load\r\n */\r\n lazyLoad(stateOrName: StateOrName, transition?: Transition): Promise<LazyLoadResult> {\r\n const state: StateDeclaration = this.get(stateOrName);\r\n if (!state || !state.lazyLoad) throw new Error('Can not lazy load ' + stateOrName);\r\n\r\n const currentPath = this.getCurrentPath();\r\n const target = PathUtils.makeTargetState(this.router.stateRegistry, currentPath);\r\n transition = transition || this.router.transitionService.create(currentPath, target);\r\n\r\n return lazyLoadState(transition, state);\r\n }\r\n}\r\n","import { StateDeclaration, StateOrName, TargetStateDef } from './interface';\r\nimport { TransitionOptions } from '../transition/interface';\r\nimport { StateObject } from './stateObject';\r\nimport { isObject, isString } from '../common/predicates';\r\nimport { stringify } from '../common/strings';\r\nimport { extend } from '../common';\r\nimport { StateRegistry } from './stateRegistry';\r\nimport { RawParams } from '../params';\r\n\r\n/**\r\n * Encapsulate the target (destination) state/params/options of a [[Transition]].\r\n *\r\n * This class is frequently used to redirect a transition to a new destination.\r\n *\r\n * See:\r\n *\r\n * - [[HookResult]]\r\n * - [[TransitionHookFn]]\r\n * - [[TransitionService.onStart]]\r\n *\r\n * To create a `TargetState`, use [[StateService.target]].\r\n *\r\n * ---\r\n *\r\n * This class wraps:\r\n *\r\n * 1) an identifier for a state\r\n * 2) a set of parameters\r\n * 3) and transition options\r\n * 4) the registered state object (the [[StateDeclaration]])\r\n *\r\n * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can\r\n * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string).\r\n * The `TargetState` class normalizes those options.\r\n *\r\n * A `TargetState` may be valid (the state being targeted exists in the registry)\r\n * or invalid (the state being targeted is not registered).\r\n */\r\nexport class TargetState {\r\n private _definition: StateObject;\r\n private _params: RawParams;\r\n private _options: TransitionOptions;\r\n\r\n /** Returns true if the object has a state property that might be a state or state name */\r\n static isDef = (obj): obj is TargetStateDef => {\r\n return obj && obj.state && (isString(obj.state) || (isObject(obj.state) && isString(obj.state.name)));\r\n };\r\n\r\n /**\r\n * The TargetState constructor\r\n *\r\n * Note: Do not construct a `TargetState` manually.\r\n * To create a `TargetState`, use the [[StateService.target]] factory method.\r\n *\r\n * @param _stateRegistry The StateRegistry to use to look up the _definition\r\n * @param _identifier An identifier for a state.\r\n * Either a fully-qualified state name, or the object used to define the state.\r\n * @param _params Parameters for the target state\r\n * @param _options Transition options.\r\n *\r\n * @internal\r\n */\r\n constructor(\r\n private _stateRegistry: StateRegistry,\r\n private _identifier: StateOrName,\r\n _params?: RawParams,\r\n _options?: TransitionOptions\r\n ) {\r\n this._identifier = _identifier;\r\n this._params = extend({}, _params || {});\r\n this._options = extend({}, _options || {});\r\n this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative);\r\n }\r\n\r\n /** The name of the state this object targets */\r\n name(): string {\r\n return (this._definition && this._definition.name) || <string>this._identifier;\r\n }\r\n\r\n /** The identifier used when creating this TargetState */\r\n identifier(): StateOrName {\r\n return this._identifier;\r\n }\r\n\r\n /** The target parameter values */\r\n params(): RawParams {\r\n return this._params;\r\n }\r\n\r\n /** The internal state object (if it was found) */\r\n $state(): StateObject {\r\n return this._definition;\r\n }\r\n\r\n /** The internal state declaration (if it was found) */\r\n state(): StateDeclaration {\r\n return this._definition && this._definition.self;\r\n }\r\n\r\n /** The target options */\r\n options() {\r\n return this._options;\r\n }\r\n\r\n /** True if the target state was found */\r\n exists(): boolean {\r\n return !!(this._definition && this._definition.self);\r\n }\r\n\r\n /** True if the object is valid */\r\n valid(): boolean {\r\n return !this.error();\r\n }\r\n\r\n /** If the object is invalid, returns the reason why */\r\n error(): string {\r\n const base = <any>this.options().relative;\r\n if (!this._definition && !!base) {\r\n const stateName = base.name ? base.name : base;\r\n return `Could not resolve '${this.name()}' from state '${stateName}'`;\r\n }\r\n if (!this._definition) return `No such state '${this.name()}'`;\r\n if (!this._definition.self) return `State '${this.name()}' has an invalid definition`;\r\n }\r\n\r\n toString() {\r\n return `'${this.name()}'${stringify(this.params())}`;\r\n }\r\n\r\n /**\r\n * Returns a copy of this TargetState which targets a different state.\r\n * The new TargetState has the same parameter values and transition options.\r\n *\r\n * @param state The new state that should be targeted\r\n */\r\n withState(state: StateOrName): TargetState {\r\n return new TargetState(this._stateRegistry, state, this._params, this._options);\r\n }\r\n\r\n /**\r\n * Returns a copy of this TargetState, using the specified parameter values.\r\n *\r\n * @param params the new parameter values to use\r\n * @param replace When false (default) the new parameter values will be merged with the current values.\r\n * When true the parameter values will be used instead of the current values.\r\n */\r\n withParams(params: RawParams, replace = false): TargetState {\r\n const newParams: RawParams = replace ? params : extend({}, this._params, params);\r\n return new TargetState(this._stateRegistry, this._identifier, newParams, this._options);\r\n }\r\n\r\n /**\r\n * Returns a copy of this TargetState, using the specified Transition Options.\r\n *\r\n * @param options the new options to use\r\n * @param replace When false (default) the new options will be merged with the current options.\r\n * When true the options will be used instead of the current options.\r\n */\r\n withOptions(options: TransitionOptions, replace = false): TargetState {\r\n const newOpts = replace ? options : extend({}, this._options, options);\r\n return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts);\r\n }\r\n}\r\n","import { extend, tail, assertPredicate, unnestR, identity } from '../common/common';\r\nimport { isArray } from '../common/predicates';\r\n\r\nimport {\r\n TransitionOptions,\r\n TransitionHookOptions,\r\n IHookRegistry,\r\n TreeChanges,\r\n IMatchingNodes,\r\n TransitionHookPhase,\r\n TransitionHookScope,\r\n} from './interface';\r\n\r\nimport { Transition } from './transition';\r\nimport { TransitionHook } from './transitionHook';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { TransitionService } from './transitionService';\r\nimport { TransitionEventType } from './transitionEventType';\r\nimport { RegisteredHook } from './hookRegistry';\r\n\r\n/**\r\n * This class returns applicable TransitionHooks for a specific Transition instance.\r\n *\r\n * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g.\r\n * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is\r\n * determined by the type of hook)\r\n *\r\n * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition.\r\n *\r\n * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder\r\n * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private\r\n * in the Transition class, so we must also provide the Transition's _treeChanges)\r\n */\r\nexport class HookBuilder {\r\n constructor(private transition: Transition) {}\r\n\r\n buildHooksForPhase(phase: TransitionHookPhase): TransitionHook[] {\r\n const $transitions = this.transition.router.transitionService;\r\n return $transitions._pluginapi\r\n ._getEvents(phase)\r\n .map((type) => this.buildHooks(type))\r\n .reduce(unnestR, [])\r\n .filter(identity);\r\n }\r\n\r\n /**\r\n * Returns an array of newly built TransitionHook objects.\r\n *\r\n * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]].\r\n * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s)\r\n * - For each of the [[PathNode]]s, creates a TransitionHook\r\n *\r\n * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'.\r\n */\r\n buildHooks(hookType: TransitionEventType): TransitionHook[] {\r\n const transition = this.transition;\r\n const treeChanges = transition.treeChanges();\r\n\r\n // Find all the matching registered hooks for a given hook type\r\n const matchingHooks = this.getMatchingHooks(hookType, treeChanges, transition);\r\n if (!matchingHooks) return [];\r\n\r\n const baseHookOptions = <TransitionHookOptions>{\r\n transition: transition,\r\n current: transition.options().current,\r\n };\r\n\r\n const makeTransitionHooks = (hook: RegisteredHook) => {\r\n // Fetch the Nodes that caused this hook to match.\r\n const matches: IMatchingNodes = hook.matches(treeChanges, transition);\r\n // Select the PathNode[] that will be used as TransitionHook context objects\r\n const matchingNodes: PathNode[] = matches[hookType.criteriaMatchPath.name];\r\n\r\n // Return an array of HookTuples\r\n return matchingNodes.map((node) => {\r\n const _options = extend(\r\n {\r\n bind: hook.bind,\r\n traceData: { hookType: hookType.name, context: node },\r\n },\r\n baseHookOptions\r\n );\r\n\r\n const state = hookType.criteriaMatchPath.scope === TransitionHookScope.STATE ? node.state.self : null;\r\n const transitionHook = new TransitionHook(transition, state, hook, _options);\r\n return <HookTuple>{ hook, node, transitionHook };\r\n });\r\n };\r\n\r\n return matchingHooks\r\n .map(makeTransitionHooks)\r\n .reduce(unnestR, [])\r\n .sort(tupleSort(hookType.reverseSort))\r\n .map((tuple) => tuple.transitionHook);\r\n }\r\n\r\n /**\r\n * Finds all RegisteredHooks from:\r\n * - The Transition object instance hook registry\r\n * - The TransitionService ($transitions) global hook registry\r\n *\r\n * which matched:\r\n * - the eventType\r\n * - the matchCriteria (to, from, exiting, retained, entering)\r\n *\r\n * @returns an array of matched [[RegisteredHook]]s\r\n */\r\n public getMatchingHooks(\r\n hookType: TransitionEventType,\r\n treeChanges: TreeChanges,\r\n transition: Transition\r\n ): RegisteredHook[] {\r\n const isCreate = hookType.hookPhase === TransitionHookPhase.CREATE;\r\n\r\n // Instance and Global hook registries\r\n const $transitions = this.transition.router.transitionService;\r\n const registries = isCreate ? [$transitions] : [this.transition, $transitions];\r\n\r\n return registries\r\n .map((reg: IHookRegistry) => reg.getHooks(hookType.name)) // Get named hooks from registries\r\n .filter(assertPredicate(isArray, `broken event named: ${hookType.name}`)) // Sanity check\r\n .reduce(unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array\r\n .filter((hook) => hook.matches(treeChanges, transition)); // Only those satisfying matchCriteria\r\n }\r\n}\r\n\r\ninterface HookTuple {\r\n hook: RegisteredHook;\r\n node: PathNode;\r\n transitionHook: TransitionHook;\r\n}\r\n\r\n/**\r\n * A factory for a sort function for HookTuples.\r\n *\r\n * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares\r\n * the EventHook priority.\r\n *\r\n * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth\r\n * @returns a tuple sort function\r\n */\r\nfunction tupleSort(reverseDepthSort = false) {\r\n return function nodeDepthThenPriority(l: HookTuple, r: HookTuple): number {\r\n const factor = reverseDepthSort ? -1 : 1;\r\n const depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor;\r\n return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority;\r\n };\r\n}\r\n","import { isString, isFunction, Glob, extend, removeFrom, tail, values, identity, mapObj } from '../common';\r\nimport { PathNode } from '../path/pathNode';\r\nimport {\r\n TransitionStateHookFn,\r\n TransitionHookFn,\r\n TransitionHookPhase, // has or is using\r\n TransitionHookScope,\r\n IHookRegistry,\r\n PathType,\r\n} from './interface';\r\n\r\nimport {\r\n HookRegOptions,\r\n HookMatchCriteria,\r\n TreeChanges,\r\n HookMatchCriterion,\r\n IMatchingNodes,\r\n HookFn,\r\n} from './interface';\r\nimport { Transition } from './transition';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { TransitionEventType } from './transitionEventType';\r\nimport { TransitionService } from './transitionService';\r\n\r\n/**\r\n * Determines if the given state matches the matchCriteria\r\n *\r\n * @internal\r\n *\r\n * @param state a State Object to test against\r\n * @param criterion\r\n * - If a string, matchState uses the string as a glob-matcher against the state name\r\n * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name\r\n * and returns a positive match if any of the globs match.\r\n * - If a function, matchState calls the function with the state and returns true if the function's result is truthy.\r\n * @returns {boolean}\r\n */\r\nexport function matchState(state: StateObject, criterion: HookMatchCriterion, transition: Transition) {\r\n const toMatch = isString(criterion) ? [criterion] : criterion;\r\n\r\n function matchGlobs(_state: StateObject) {\r\n const globStrings = <string[]>toMatch;\r\n for (let i = 0; i < globStrings.length; i++) {\r\n const glob = new Glob(globStrings[i]);\r\n\r\n if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n const matchFn = <any>(isFunction(toMatch) ? toMatch : matchGlobs);\r\n return !!matchFn(state, transition);\r\n}\r\n\r\n/**\r\n * The registration data for a registered transition hook\r\n */\r\nexport class RegisteredHook {\r\n priority: number;\r\n bind: any;\r\n invokeCount = 0;\r\n invokeLimit: number;\r\n _deregistered = false;\r\n\r\n constructor(\r\n public tranSvc: TransitionService,\r\n public eventType: TransitionEventType,\r\n public callback: HookFn,\r\n public matchCriteria: HookMatchCriteria,\r\n public removeHookFromRegistry: (hook: RegisteredHook) => void,\r\n options: HookRegOptions = {} as any\r\n ) {\r\n this.priority = options.priority || 0;\r\n this.bind = options.bind || null;\r\n this.invokeLimit = options.invokeLimit;\r\n }\r\n\r\n /**\r\n * Gets the matching [[PathNode]]s\r\n *\r\n * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing\r\n * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes.\r\n *\r\n * Returning `null` is significant to distinguish between the default\r\n * \"match-all criterion value\" of `true` compared to a `() => true` function,\r\n * when the nodes is an empty array.\r\n *\r\n * This is useful to allow a transition match criteria of `entering: true`\r\n * to still match a transition, even when `entering === []`. Contrast that\r\n * with `entering: (state) => true` which only matches when a state is actually\r\n * being entered.\r\n */\r\n private _matchingNodes(nodes: PathNode[], criterion: HookMatchCriterion, transition: Transition): PathNode[] {\r\n if (criterion === true) return nodes;\r\n const matching = nodes.filter((node) => matchState(node.state, criterion, transition));\r\n return matching.length ? matching : null;\r\n }\r\n\r\n /**\r\n * Gets the default match criteria (all `true`)\r\n *\r\n * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:\r\n *\r\n * ```js\r\n * {\r\n * to: true,\r\n * from: true,\r\n * entering: true,\r\n * exiting: true,\r\n * retained: true,\r\n * }\r\n */\r\n private _getDefaultMatchCriteria(): HookMatchCriteria {\r\n return mapObj(this.tranSvc._pluginapi._getPathTypes(), () => true);\r\n }\r\n\r\n /**\r\n * Gets matching nodes as [[IMatchingNodes]]\r\n *\r\n * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to:\r\n *\r\n * ```js\r\n * let matches: IMatchingNodes = {\r\n * to: _matchingNodes([tail(treeChanges.to)], mc.to),\r\n * from: _matchingNodes([tail(treeChanges.from)], mc.from),\r\n * exiting: _matchingNodes(treeChanges.exiting, mc.exiting),\r\n * retained: _matchingNodes(treeChanges.retained, mc.retained),\r\n * entering: _matchingNodes(treeChanges.entering, mc.entering),\r\n * };\r\n * ```\r\n */\r\n private _getMatchingNodes(treeChanges: TreeChanges, transition: Transition): IMatchingNodes {\r\n const criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria);\r\n const paths: PathType[] = values(this.tranSvc._pluginapi._getPathTypes());\r\n\r\n return paths.reduce((mn: IMatchingNodes, pathtype: PathType) => {\r\n // STATE scope criteria matches against every node in the path.\r\n // TRANSITION scope criteria matches against only the last node in the path\r\n const isStateHook = pathtype.scope === TransitionHookScope.STATE;\r\n const path = treeChanges[pathtype.name] || [];\r\n const nodes: PathNode[] = isStateHook ? path : [tail(path)];\r\n\r\n mn[pathtype.name] = this._matchingNodes(nodes, criteria[pathtype.name], transition);\r\n return mn;\r\n }, {} as IMatchingNodes);\r\n }\r\n\r\n /**\r\n * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]\r\n *\r\n * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values\r\n * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering)\r\n */\r\n matches(treeChanges: TreeChanges, transition: Transition): IMatchingNodes {\r\n const matches = this._getMatchingNodes(treeChanges, transition);\r\n\r\n // Check if all the criteria matched the TreeChanges object\r\n const allMatched = values(matches).every(identity);\r\n return allMatched ? matches : null;\r\n }\r\n\r\n deregister() {\r\n this.removeHookFromRegistry(this);\r\n this._deregistered = true;\r\n }\r\n}\r\n\r\n/** Return a registration function of the requested type. */\r\nexport function makeEvent(\r\n registry: IHookRegistry,\r\n transitionService: TransitionService,\r\n eventType: TransitionEventType\r\n) {\r\n // Create the object which holds the registered transition hooks.\r\n const _registeredHooks = (registry._registeredHooks = registry._registeredHooks || {});\r\n const hooks = (_registeredHooks[eventType.name] = []);\r\n const removeHookFn: (hook: RegisteredHook) => void = removeFrom(hooks);\r\n\r\n // Create hook registration function on the IHookRegistry for the event\r\n registry[eventType.name] = hookRegistrationFn;\r\n\r\n function hookRegistrationFn(matchObject, callback, options = {}) {\r\n const registeredHook = new RegisteredHook(\r\n transitionService,\r\n eventType,\r\n callback,\r\n matchObject,\r\n removeHookFn,\r\n options\r\n );\r\n hooks.push(registeredHook);\r\n return registeredHook.deregister.bind(registeredHook);\r\n }\r\n\r\n return hookRegistrationFn;\r\n}\r\n","import { StateDeclaration } from '../state/interface';\r\nimport { PredicateBinary } from '../common/common';\r\n\r\nimport { Transition } from './transition';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { TargetState } from '../state/targetState';\r\nimport { RegisteredHook } from './hookRegistry';\r\n\r\n/**\r\n * The TransitionOptions object can be used to change the behavior of a transition.\r\n *\r\n * It is passed as the third argument to [[StateService.go]], [[StateService.transitionTo]].\r\n * It can also be used with a `uiSref`.\r\n */\r\nexport interface TransitionOptions {\r\n /**\r\n * This option changes how the Transition interacts with the browser's location bar (URL).\r\n *\r\n * - If `true`, it will update the url in the location bar.\r\n * - If `false`, it will not update the url in the location bar.\r\n * - If it is the string `\"replace\"`, it will update the url and also replace the last history record.\r\n *\r\n * @default `true`\r\n */\r\n location?: boolean | 'replace';\r\n\r\n /**\r\n * When transitioning to relative path (e.g '`^`'), this option defines which state to be relative from.\r\n * @default `$state.current`\r\n */\r\n relative?: string | StateDeclaration | StateObject;\r\n\r\n /**\r\n * This option sets whether or not the transition's parameter values should be inherited from\r\n * the current parameter values.\r\n *\r\n * - If `true`, it will inherit parameter values from the current parameter values.\r\n * - If `false`, only the parameters which are provided to `transitionTo` will be used.\r\n *\r\n * @default `true`\r\n */\r\n inherit?: boolean;\r\n\r\n /**\r\n * @deprecated\r\n */\r\n notify?: boolean;\r\n\r\n /**\r\n * This option may be used to force states which are currently active to reload.\r\n *\r\n * During a normal transition, a state is \"retained\" if:\r\n * - It was previously active\r\n * - The state's parameter values have not changed\r\n * - All the parent states' parameter values have not changed\r\n *\r\n * Forcing a reload of a state will cause it to be exited and entered, which will:\r\n * - Refetch that state's resolve data\r\n * - Exit the state (onExit hook)\r\n * - Re-enter the state (onEnter hook)\r\n * - Re-render the views (controllers and templates)\r\n *\r\n * - When `true`, the destination state (and all parent states) will be reloaded.\r\n * - When it is a string and is the name of a state, or when it is a State object,\r\n * that state and any children states will be reloaded.\r\n *\r\n * @default `false`\r\n */\r\n reload?: boolean | string | StateDeclaration | StateObject;\r\n /**\r\n * You can define your own Transition Options inside this property and use them, e.g., from a Transition Hook\r\n */\r\n custom?: any;\r\n /**\r\n * This option may be used to cancel the active transition (if one is active) in favour of the this one.\r\n * This is the default behaviour or ui-router.\r\n *\r\n *\r\n * - When `true`, the active transition will be canceled and new transition will begin.\r\n * - when `false`, the transition will be canceled if a transition is already running. This can be useful in cases where\r\n * you only want to navigate to a different state if you are not already navigating somewhere.\r\n *\r\n * @default `true`\r\n */\r\n supercede?: boolean;\r\n /** @internal */\r\n reloadState?: StateObject;\r\n /** @internal\r\n * If this transition is a redirect, this property should be the original Transition (which was redirected to this one)\r\n */\r\n redirectedFrom?: Transition;\r\n /** @internal */\r\n current?: () => Transition;\r\n /** @internal */\r\n source?: 'sref' | 'url' | 'redirect' | 'otherwise' | 'unknown';\r\n}\r\n\r\nexport interface TransitionHookOptions {\r\n current?: () => Transition; // path?\r\n transition?: Transition;\r\n hookType?: string;\r\n target?: any;\r\n traceData?: any;\r\n bind?: any;\r\n stateHook?: boolean;\r\n}\r\n\r\n/**\r\n * TreeChanges encapsulates the various Paths that are involved in a Transition.\r\n *\r\n * Get a TreeChanges object using [[Transition.treeChanges]]\r\n *\r\n * A UI-Router Transition is from one Path in a State Tree to another Path. For a given Transition,\r\n * this object stores the \"to\" and \"from\" paths, as well as subsets of those: the \"retained\",\r\n * \"exiting\" and \"entering\" paths.\r\n *\r\n * Each path in TreeChanges is an array of [[PathNode]] objects. Each PathNode in the array corresponds to a portion\r\n * of a nested state.\r\n *\r\n * For example, if you had a nested state named `foo.bar.baz`, it would have three\r\n * portions, `foo, bar, baz`. If you transitioned **to** `foo.bar.baz` and inspected the [[TreeChanges.to]]\r\n * Path, you would find a node in the array for each portion: `foo`, `bar`, and `baz`.\r\n *\r\n * ---\r\n *\r\n * @todo show visual state tree\r\n */\r\nexport interface TreeChanges {\r\n /** @nodoc */\r\n [key: string]: PathNode[] | undefined;\r\n\r\n /** The path of nodes in the state tree that the transition is coming *from* */\r\n from: PathNode[];\r\n\r\n /** The path of nodes in the state tree that the transition is going *to* */\r\n to: PathNode[];\r\n\r\n /**\r\n * The path of active nodes that the transition is retaining.\r\n *\r\n * These nodes are neither exited, nor entered.\r\n * Before and after the transition is successful, these nodes are active.\r\n */\r\n retained: PathNode[];\r\n\r\n /**\r\n * The path of active nodes that the transition is retaining with updated \"to params\" applied.\r\n *\r\n * These nodes are neither exited, nor entered.\r\n * Before and after the transition is successful, these nodes are active.\r\n *\r\n * This is a shallow copy of [[retained]], but with new (dynamic) parameter values from [[to]] applied.\r\n */\r\n retainedWithToParams: PathNode[];\r\n\r\n /**\r\n * The path of previously active nodes that the transition is exiting.\r\n *\r\n * After the Transition is successful, these nodes are no longer active.\r\n *\r\n * Note that a state that is being reloaded (due to parameter values changing, or `reload: true`) may be in both the\r\n * `exiting` and `entering` paths.\r\n */\r\n exiting: PathNode[];\r\n\r\n /**\r\n * The path of nodes that the transition is entering.\r\n *\r\n * After the Transition is successful, these nodes will be active.\r\n * Because they are entering, they have their resolves fetched, `onEnter` hooks run, and their views\r\n * (component(s) or controller(s)+template(s)) refreshed.\r\n *\r\n * Note that a state that is reloaded (due to parameter values changing, or `reload: true`) may be in both the\r\n * `exiting` and `entering` paths.\r\n */\r\n entering: PathNode[];\r\n}\r\n\r\nexport type IHookRegistration = (\r\n matchCriteria: HookMatchCriteria,\r\n callback: HookFn,\r\n options?: HookRegOptions\r\n) => Function;\r\n\r\n/**\r\n * The signature for Transition Hooks.\r\n *\r\n * Transition hooks are callback functions that hook into the lifecycle of transitions.\r\n * As a transition runs, it reaches certain lifecycle events.\r\n * As each event occurs, the hooks which are registered for the event are called (in priority order).\r\n *\r\n * A transition hook may alter a Transition by returning a [[HookResult]].\r\n *\r\n * #### See:\r\n *\r\n * - [[IHookRegistry.onBefore]]\r\n * - [[IHookRegistry.onStart]]\r\n * - [[IHookRegistry.onFinish]]\r\n * - [[IHookRegistry.onSuccess]]\r\n * - [[IHookRegistry.onError]]\r\n *\r\n * @param transition the current [[Transition]]\r\n * @param injector (for ng1 or ng2 only) the injector service\r\n *\r\n * @returns a [[HookResult]] which may alter the transition\r\n *\r\n */\r\nexport interface TransitionHookFn {\r\n (transition: Transition): HookResult;\r\n}\r\n\r\n/**\r\n * The signature for Transition State Hooks.\r\n *\r\n * A function which hooks into a lifecycle event for a specific state.\r\n *\r\n * Transition State Hooks are callback functions that hook into the lifecycle events of specific states during a transition.\r\n * As a transition runs, it may exit some states, retain (keep) states, and enter states.\r\n * As each lifecycle event occurs, the hooks which are registered for the event and that state are called (in priority order).\r\n *\r\n * #### See:\r\n *\r\n * - [[IHookRegistry.onExit]]\r\n * - [[IHookRegistry.onRetain]]\r\n * - [[IHookRegistry.onEnter]]\r\n *\r\n * @param transition the current [[Transition]]\r\n * @param state the [[StateObject]] that the hook is bound to\r\n * @param injector (for ng1 or ng2 only) the injector service\r\n *\r\n * @returns a [[HookResult]] which may alter the transition\r\n */\r\nexport interface TransitionStateHookFn {\r\n (transition: Transition, state: StateDeclaration): HookResult;\r\n}\r\n\r\n/**\r\n * The signature for Transition onCreate Hooks.\r\n *\r\n * Transition onCreate Hooks are callbacks that allow customization or preprocessing of\r\n * a Transition before it is returned from [[TransitionService.create]]\r\n *\r\n * @param transition the [[Transition]] that was just created\r\n * @return a [[Transition]] which will then be returned from [[TransitionService.create]]\r\n */\r\nexport interface TransitionCreateHookFn {\r\n (transition: Transition): void;\r\n}\r\n\r\nexport type HookFn = TransitionHookFn | TransitionStateHookFn | TransitionCreateHookFn;\r\n\r\n/**\r\n * The return value of a [[TransitionHookFn]] or [[TransitionStateHookFn]]\r\n *\r\n * When returned from a [[TransitionHookFn]] or [[TransitionStateHookFn]], these values alter the running [[Transition]]:\r\n *\r\n * - `false`: the transition will be cancelled.\r\n * - [[TargetState]]: the transition will be redirected to the new target state (see: [[StateService.target]])\r\n * - `Promise`: the transition will wait for the promise to resolve or reject\r\n * - If the promise is rejected (or resolves to `false`), the transition will be cancelled\r\n * - If the promise resolves to a [[TargetState]], the transition will be redirected\r\n * - If the promise resolves to anything else, the transition will resume\r\n * - Anything else: the transition will resume\r\n */\r\nexport type HookResult = boolean | TargetState | void | Promise<boolean | TargetState | void>;\r\n\r\n/**\r\n * These options may be provided when registering a Transition Hook (such as `onStart`)\r\n */\r\nexport interface HookRegOptions {\r\n /**\r\n * Sets the priority of the registered hook\r\n *\r\n * Hooks of the same type (onBefore, onStart, etc) are invoked in priority order. A hook with a higher priority\r\n * is invoked before a hook with a lower priority.\r\n *\r\n * The default hook priority is 0\r\n */\r\n priority?: number;\r\n\r\n /**\r\n * Specifies what `this` is bound to during hook invocation.\r\n */\r\n bind?: any;\r\n\r\n /**\r\n * Limits the number of times that the hook will be invoked.\r\n * Once the hook has been invoked this many times, it is automatically deregistered.\r\n */\r\n invokeLimit?: number;\r\n}\r\n\r\n/**\r\n * This interface specifies the api for registering Transition Hooks. Both the\r\n * [[TransitionService]] and also the [[Transition]] object itself implement this interface.\r\n * Note: the Transition object only allows hooks to be registered before the Transition is started.\r\n */\r\nexport interface IHookRegistry {\r\n /** @internal place to store the hooks */\r\n _registeredHooks: { [key: string]: RegisteredHook[] };\r\n\r\n /**\r\n * Registers a [[TransitionHookFn]], called *before a transition starts*.\r\n *\r\n * Registers a transition lifecycle hook, which is invoked before a transition even begins.\r\n * This hook can be useful to implement logic which prevents a transition from even starting, such\r\n * as authentication, redirection\r\n *\r\n * See [[TransitionHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onBefore` hooks are invoked *before a Transition starts*.\r\n * No resolves have been fetched yet.\r\n * Each `onBefore` hook is invoked synchronously, in the same call stack as [[StateService.transitionTo]].\r\n * The registered `onBefore` hooks are invoked in priority order.\r\n *\r\n * Note: during the `onBefore` phase, additional hooks can be added to the specific [[Transition]] instance.\r\n * These \"on-the-fly\" hooks only affect the currently running transition..\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value can be used to pause, cancel, or redirect the current Transition.\r\n * See [[HookResult]] for more information.\r\n *\r\n * If any hook modifies the transition *synchronously* (by throwing, returning `false`, or returning\r\n * a [[TargetState]]), the remainder of the hooks are skipped.\r\n * If a hook returns a promise, the remainder of the `onBefore` hooks are still invoked synchronously.\r\n * All promises are resolved, and processed asynchronously before the `onStart` phase of the Transition.\r\n *\r\n * ### Examples\r\n *\r\n * #### Default Substate\r\n *\r\n * This example redirects any transition from 'home' to 'home.dashboard'. This is commonly referred to as a\r\n * \"default substate\".\r\n *\r\n * @example\r\n * ```js\r\n * // ng2\r\n * transitionService.onBefore({ to: 'home' }, (trans: Transition) =>\r\n * trans.router.stateService.target(\"home.dashboard\"));\r\n * ```\r\n *\r\n * #### Data Driven Default Substate\r\n *\r\n * This example provides data-driven default substate functionality. It matches on a transition to any state\r\n * which has `defaultSubstate: \"some.sub.state\"` defined. See: [[Transition.to]] which returns the \"to state\"\r\n * definition.\r\n *\r\n * @example\r\n * ```js\r\n * // ng1\r\n * // state declaration\r\n * {\r\n * name: 'home',\r\n * template: '<div ui-view/>',\r\n * defaultSubstate: 'home.dashboard'\r\n * }\r\n *\r\n * var criteria = {\r\n * to: function(state) {\r\n * return state.defaultSubstate != null;\r\n * }\r\n * }\r\n *\r\n * $transitions.onBefore(criteria, function(trans: Transition) {\r\n * var substate = trans.to().defaultSubstate;\r\n * return trans.router.stateService.target(substate);\r\n * });\r\n * ```\r\n *\r\n *\r\n * #### Require authentication\r\n *\r\n * This example cancels a transition to a state which requires authentication, if the user is not currently authenticated.\r\n *\r\n * This example assumes a state tree where all states which require authentication are children of a parent `'requireauth'` state.\r\n * This example assumes `MyAuthService` synchronously returns a boolean from `isAuthenticated()`.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // ng1\r\n * $transitions.onBefore( { to: 'requireauth.**' }, function(trans) {\r\n * var myAuthService = trans.injector().get('MyAuthService');\r\n * // If isAuthenticated returns false, the transition is cancelled.\r\n * return myAuthService.isAuthenticated();\r\n * });\r\n * ```\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onBefore(matchCriteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionHookFn]], called when a transition starts.\r\n *\r\n * Registers a transition lifecycle hook, which is invoked as a transition starts running.\r\n * This hook can be useful to perform some asynchronous action before completing a transition.\r\n *\r\n * See [[TransitionHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onStart` hooks are invoked asynchronously when the Transition starts running.\r\n * This happens after the `onBefore` phase is complete.\r\n * At this point, the Transition has not yet exited nor entered any states.\r\n * The registered `onStart` hooks are invoked in priority order.\r\n *\r\n * Note: A built-in `onStart` hook with high priority is used to fetch any eager resolve data.\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value can be used to pause, cancel, or redirect the current Transition.\r\n * See [[HookResult]] for more information.\r\n *\r\n * ### Example\r\n *\r\n * #### Login during transition\r\n *\r\n * This example intercepts any transition to a state which requires authentication, when the user is\r\n * not currently authenticated. It allows the user to authenticate asynchronously, then resumes the\r\n * transition. If the user did not authenticate successfully, it redirects to the \"guest\" state, which\r\n * does not require authentication.\r\n *\r\n * This example assumes:\r\n * - a state tree where all states which require authentication are children of a parent `'auth'` state.\r\n * - `MyAuthService.isAuthenticated()` synchronously returns a boolean.\r\n * - `MyAuthService.authenticate()` presents a login dialog, and returns a promise which is resolved\r\n * or rejected, whether or not the login attempt was successful.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // ng1\r\n * $transitions.onStart( { to: 'auth.**' }, function(trans) {\r\n * var $state = trans.router.stateService;\r\n * var MyAuthService = trans.injector().get('MyAuthService');\r\n *\r\n * // If the user is not authenticated\r\n * if (!MyAuthService.isAuthenticated()) {\r\n *\r\n * // Then return a promise for a successful login.\r\n * // The transition will wait for this promise to settle\r\n *\r\n * return MyAuthService.authenticate().catch(function() {\r\n *\r\n * // If the authenticate() method failed for whatever reason,\r\n * // redirect to a 'guest' state which doesn't require auth.\r\n * return $state.target(\"guest\");\r\n * });\r\n * }\r\n * });\r\n * ```\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onStart(matchCriteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionStateHookFn]], called when a specific state is entered.\r\n *\r\n * Registers a lifecycle hook, which is invoked (during a transition) when a specific state is being entered.\r\n *\r\n * Since this hook is run only when the specific state is being *entered*, it can be useful for\r\n * performing tasks when entering a submodule/feature area such as initializing a stateful service,\r\n * or for guarding access to a submodule/feature area.\r\n *\r\n * See [[TransitionStateHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * `onEnter` hooks generally specify `{ entering: 'somestate' }`.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onEnter` hooks are invoked when the Transition is entering a state.\r\n * States are entered after the `onRetain` phase is complete.\r\n * If more than one state is being entered, the parent state is entered first.\r\n * The registered `onEnter` hooks for a state are invoked in priority order.\r\n *\r\n * Note: A built-in `onEnter` hook with high priority is used to fetch lazy resolve data for states being entered.\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value can be used to pause, cancel, or redirect the current Transition.\r\n * See [[HookResult]] for more information.\r\n *\r\n * ### Inside a state declaration\r\n *\r\n * Instead of registering `onEnter` hooks using the [[TransitionService]], you may define an `onEnter` hook\r\n * directly on a state declaration (see: [[StateDeclaration.onEnter]]).\r\n *\r\n *\r\n * ### Examples\r\n *\r\n * #### Audit Log\r\n *\r\n * This example uses a service to log that a user has entered the admin section of an app.\r\n * This assumes that there are substates of the \"admin\" state, such as \"admin.users\", \"admin.pages\", etc.\r\n * @example\r\n * ```\r\n *\r\n * $transitions.onEnter({ entering: 'admin' }, function(transition, state) {\r\n * var AuditService = trans.injector().get('AuditService');\r\n * AuditService.log(\"Entered \" + state.name + \" module while transitioning to \" + transition.to().name);\r\n * }\r\n * ```\r\n *\r\n * #### Audit Log (inside a state declaration)\r\n *\r\n * The `onEnter` inside this state declaration is syntactic sugar for the previous Audit Log example.\r\n * ```\r\n * {\r\n * name: 'admin',\r\n * component: 'admin',\r\n * onEnter: function($transition$, $state$) {\r\n * var AuditService = $transition$.injector().get('AuditService');\r\n * AuditService.log(\"Entered \" + state.name + \" module while transitioning to \" + transition.to().name);\r\n * }\r\n * }\r\n * ```\r\n *\r\n * Note: A state declaration's `onEnter` function is injected for Angular 1 only.\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onEnter(matchCriteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionStateHookFn]], called when a specific state is retained/kept.\r\n *\r\n * Registers a lifecycle hook, which is invoked (during a transition) for\r\n * a specific state that was previously active will remain active (is not being entered nor exited).\r\n *\r\n * This hook is invoked when a state is \"retained\" or \"kept\".\r\n * It means the transition is coming *from* a substate of the retained state *to* a substate of the retained state.\r\n * This hook can be used to perform actions when the user moves from one substate to another, such as between steps in a wizard.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * `onRetain` hooks generally specify `{ retained: 'somestate' }`.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onRetain` hooks are invoked after any `onExit` hooks have been fired.\r\n * If more than one state is retained, the child states' `onRetain` hooks are invoked first.\r\n * The registered `onRetain` hooks for a state are invoked in priority order.\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value can be used to pause, cancel, or redirect the current Transition.\r\n * See [[HookResult]] for more information.\r\n *\r\n * ### Inside a state declaration\r\n *\r\n * Instead of registering `onRetain` hooks using the [[TransitionService]], you may define an `onRetain` hook\r\n * directly on a state declaration (see: [[StateDeclaration.onRetain]]).\r\n *\r\n * Note: A state declaration's `onRetain` function is injected for Angular 1 only.\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onRetain(matchCriteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionStateHookFn]], called when a specific state is exited.\r\n *\r\n * Registers a lifecycle hook, which is invoked (during a transition) when a specific state is being exited.\r\n *\r\n * Since this hook is run only when the specific state is being *exited*, it can be useful for\r\n * performing tasks when leaving a submodule/feature area such as cleaning up a stateful service,\r\n * or for preventing the user from leaving a state or submodule until some criteria is satisfied.\r\n *\r\n * See [[TransitionStateHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * `onExit` hooks generally specify `{ exiting: 'somestate' }`.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onExit` hooks are invoked when the Transition is exiting a state.\r\n * States are exited after any `onStart` phase is complete.\r\n * If more than one state is being exited, the child states are exited first.\r\n * The registered `onExit` hooks for a state are invoked in priority order.\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value can be used to pause, cancel, or redirect the current Transition.\r\n * See [[HookResult]] for more information.\r\n *\r\n * ### Inside a state declaration\r\n *\r\n * Instead of registering `onExit` hooks using the [[TransitionService]], you may define an `onExit` hook\r\n * directly on a state declaration (see: [[StateDeclaration.onExit]]).\r\n *\r\n * Note: A state declaration's `onExit` function is injected for Angular 1 only.\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onExit(matchCriteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionHookFn]], called *just before a transition finishes*.\r\n *\r\n * Registers a transition lifecycle hook, which is invoked just before a transition finishes.\r\n * This hook is a last chance to cancel or redirect a transition.\r\n *\r\n * See [[TransitionHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onFinish` hooks are invoked after the `onEnter` phase is complete.\r\n * These hooks are invoked just before the transition is \"committed\".\r\n * Each hook is invoked in priority order.\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value can be used to pause, cancel, or redirect the current Transition.\r\n * See [[HookResult]] for more information.\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onFinish(matchCriteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionHookFn]], called after a successful transition completed.\r\n *\r\n * Registers a transition lifecycle hook, which is invoked after a transition successfully completes.\r\n *\r\n * See [[TransitionHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onSuccess` hooks are chained off the Transition's promise (see [[Transition.promise]]).\r\n * If the Transition is successful and its promise is resolved, then the `onSuccess` hooks are invoked.\r\n * Since these hooks are run after the transition is over, their return value is ignored.\r\n * The `onSuccess` hooks are invoked in priority order.\r\n *\r\n * ### Return value\r\n *\r\n * Since the Transition is already completed, the hook's return value is ignored\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onSuccess(matchCriteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Registers a [[TransitionHookFn]], called after a transition has errored.\r\n *\r\n * Registers a transition lifecycle hook, which is invoked after a transition has been rejected for any reason.\r\n *\r\n * See [[TransitionHookFn]] for the signature of the function.\r\n *\r\n * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.\r\n * To match all Transitions, use an empty criteria object `{}`.\r\n *\r\n * ### Lifecycle\r\n *\r\n * The `onError` hooks are chained off the Transition's promise (see [[Transition.promise]]).\r\n * If a Transition fails, its promise is rejected and the `onError` hooks are invoked.\r\n * The `onError` hooks are invoked in priority order.\r\n *\r\n * Since these hooks are run after the transition is over, their return value is ignored.\r\n *\r\n * A transition \"errors\" if it was started, but failed to complete (for any reason).\r\n * A *non-exhaustive list* of reasons a transition can error:\r\n *\r\n * - A transition was cancelled because a new transition started while it was still running (`Transition superseded`)\r\n * - A transition was cancelled by a Transition Hook returning false\r\n * - A transition was redirected by a Transition Hook returning a [[TargetState]]\r\n * - A Transition Hook or resolve function threw an error\r\n * - A Transition Hook returned a rejected promise\r\n * - A resolve function returned a rejected promise\r\n *\r\n * To check the failure reason, inspect the return value of [[Transition.error]].\r\n *\r\n * Note: `onError` should be used for targeted error handling, or error recovery.\r\n * For simple catch-all error reporting, use [[StateService.defaultErrorHandler]].\r\n *\r\n * ### Return value\r\n *\r\n * Since the Transition is already completed, the hook's return value is ignored\r\n *\r\n * @param matchCriteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be injected and invoked.\r\n * @returns a function which deregisters the hook.\r\n */\r\n onError(matchCriteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function;\r\n\r\n /**\r\n * Returns all the registered hooks of a given `hookName` type\r\n *\r\n * #### Example:\r\n * ```\r\n * $transitions.getHooks(\"onEnter\")\r\n * ```\r\n */\r\n getHooks(hookName: string): RegisteredHook[];\r\n}\r\n\r\n/** A predicate type which tests if a [[StateObject]] and [[Transition]] passes some test. Returns a boolean. */\r\nexport type IStateMatch = PredicateBinary<StateObject, Transition>;\r\n\r\n/**\r\n * This object is used to configure whether or not a Transition Hook is invoked for a particular transition,\r\n * based on the Transition's \"to state\" and \"from state\".\r\n *\r\n * Each property (`to`, `from`, `exiting`, `retained`, and `entering`) can be a state [[Glob]] string,\r\n * a boolean, or a function that takes a state and returns a boolean (see [[HookMatchCriterion]])\r\n *\r\n * All properties are optional. If any property is omitted, it is replaced with the value `true`, and always matches.\r\n * To match any transition, use an empty criteria object `{}`.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // This matches a transition coming from the `parent` state and going to the `parent.child` state.\r\n * var match = {\r\n * to: 'parent',\r\n * from: 'parent.child'\r\n * }\r\n * ```\r\n *\r\n * #### Example:\r\n * ```js\r\n * // This matches a transition coming from any substate of `parent` and going directly to the `parent` state.\r\n * var match = {\r\n * to: 'parent',\r\n * from: 'parent.**'\r\n * }\r\n * ```\r\n *\r\n * #### Example:\r\n * ```js\r\n * // This matches a transition coming from any state and going to any substate of `mymodule`\r\n * var match = {\r\n * to: 'mymodule.**'\r\n * }\r\n * ```\r\n *\r\n * #### Example:\r\n * ```js\r\n * // This matches a transition coming from any state and going to any state that has `data.authRequired`\r\n * // set to a truthy value.\r\n * var match = {\r\n * to: function(state) {\r\n * return state.data != null && state.data.authRequired === true;\r\n * }\r\n * }\r\n * ```\r\n * #### Example:\r\n * ```js\r\n * // This will match when route is just entered (initial load) or when the state is hard-refreshed\r\n * // by specifying `{refresh: true}` as transition options.\r\n * var match = {\r\n * from: (state, transition) => state.self.name === '' || transition.options().reload\r\n * }\r\n * ```\r\n *\r\n * #### Example:\r\n * ```js\r\n * // This matches a transition that is exiting `parent.child`\r\n * var match = {\r\n * exiting: 'parent.child'\r\n * }\r\n * ```\r\n */\r\nexport interface HookMatchCriteria {\r\n [key: string]: HookMatchCriterion | undefined;\r\n\r\n /** A [[HookMatchCriterion]] to match the destination state */\r\n to?: HookMatchCriterion;\r\n /** A [[HookMatchCriterion]] to match the original (from) state */\r\n from?: HookMatchCriterion;\r\n /** A [[HookMatchCriterion]] to match any state that would be exiting */\r\n exiting?: HookMatchCriterion;\r\n /** A [[HookMatchCriterion]] to match any state that would be retained */\r\n retained?: HookMatchCriterion;\r\n /** A [[HookMatchCriterion]] to match any state that would be entering */\r\n entering?: HookMatchCriterion;\r\n}\r\n\r\nexport interface IMatchingNodes {\r\n [key: string]: PathNode[];\r\n\r\n to: PathNode[];\r\n from: PathNode[];\r\n exiting: PathNode[];\r\n retained: PathNode[];\r\n entering: PathNode[];\r\n}\r\n\r\n/** @internal */\r\nexport interface RegisteredHooks {\r\n [key: string]: RegisteredHook[];\r\n}\r\n\r\n/** @internal */\r\nexport interface PathTypes {\r\n [key: string]: PathType;\r\n\r\n to: PathType;\r\n from: PathType;\r\n exiting: PathType;\r\n retained: PathType;\r\n entering: PathType;\r\n}\r\n\r\n/** @internal */\r\nexport interface PathType {\r\n name: string;\r\n scope: TransitionHookScope;\r\n}\r\n\r\n/**\r\n * Hook Criterion used to match a transition.\r\n *\r\n * A [[Glob]] string that matches the name of a state.\r\n *\r\n * Or, a function with the signature `function(state, transition) { return matches; }`\r\n * which should return a boolean to indicate if a state matches.\r\n *\r\n * Or, `true` to always match\r\n */\r\nexport type HookMatchCriterion = string | IStateMatch | boolean;\r\n\r\nenum TransitionHookPhase {\r\n CREATE,\r\n BEFORE,\r\n RUN,\r\n SUCCESS,\r\n ERROR,\r\n}\r\nenum TransitionHookScope {\r\n TRANSITION,\r\n STATE,\r\n}\r\n\r\nexport { TransitionHookPhase, TransitionHookScope };\r\n","'use strict';\r\nimport { extend, silentRejection } from '../common/common';\r\nimport { stringify } from '../common/strings';\r\nimport { is } from '../common/hof';\r\n\r\n/** An enum for Transition Rejection reasons */\r\nenum RejectType {\r\n /**\r\n * A new transition superseded this one.\r\n *\r\n * While this transition was running, a new transition started.\r\n * This transition is cancelled because it was superseded by new transition.\r\n */\r\n SUPERSEDED = 2,\r\n\r\n /**\r\n * The transition was aborted\r\n *\r\n * The transition was aborted by a hook which returned `false`\r\n */\r\n ABORTED = 3,\r\n\r\n /**\r\n * The transition was invalid\r\n *\r\n * The transition was never started because it was invalid\r\n */\r\n INVALID = 4,\r\n\r\n /**\r\n * The transition was ignored\r\n *\r\n * The transition was ignored because it would have no effect.\r\n *\r\n * Either:\r\n *\r\n * - The transition is targeting the current state and parameter values\r\n * - The transition is targeting the same state and parameter values as the currently running transition.\r\n */\r\n IGNORED = 5,\r\n\r\n /**\r\n * The transition errored.\r\n *\r\n * This generally means a hook threw an error or returned a rejected promise\r\n */\r\n ERROR = 6,\r\n}\r\n\r\nexport { RejectType };\r\n\r\n/** @internal */\r\nlet id = 0;\r\n\r\nexport class Rejection {\r\n /** @internal */\r\n $id = id++;\r\n /**\r\n * The type of the rejection.\r\n *\r\n * This value is an number representing the type of transition rejection.\r\n * If using Typescript, this is a Typescript enum.\r\n *\r\n * - [[RejectType.SUPERSEDED]] (`2`)\r\n * - [[RejectType.ABORTED]] (`3`)\r\n * - [[RejectType.INVALID]] (`4`)\r\n * - [[RejectType.IGNORED]] (`5`)\r\n * - [[RejectType.ERROR]] (`6`)\r\n *\r\n */\r\n type: RejectType;\r\n\r\n /**\r\n * A message describing the rejection\r\n */\r\n message: string;\r\n\r\n /**\r\n * A detail object\r\n *\r\n * This value varies based on the mechanism for rejecting the transition.\r\n * For example, if an error was thrown from a hook, the `detail` will be the `Error` object.\r\n * If a hook returned a rejected promise, the `detail` will be the rejected value.\r\n */\r\n detail: any;\r\n\r\n /**\r\n * Indicates if the transition was redirected.\r\n *\r\n * When a transition is redirected, the rejection [[type]] will be [[RejectType.SUPERSEDED]] and this flag will be true.\r\n */\r\n redirected: boolean;\r\n\r\n /** Returns true if the obj is a rejected promise created from the `asPromise` factory */\r\n static isRejectionPromise(obj: any): boolean {\r\n return obj && typeof obj.then === 'function' && is(Rejection)(obj._transitionRejection);\r\n }\r\n\r\n /** Returns a Rejection due to transition superseded */\r\n static superseded(detail?: any, options?: any): Rejection {\r\n const message = 'The transition has been superseded by a different transition';\r\n const rejection = new Rejection(RejectType.SUPERSEDED, message, detail);\r\n if (options && options.redirected) {\r\n rejection.redirected = true;\r\n }\r\n return rejection;\r\n }\r\n\r\n /** Returns a Rejection due to redirected transition */\r\n static redirected(detail?: any): Rejection {\r\n return Rejection.superseded(detail, { redirected: true });\r\n }\r\n\r\n /** Returns a Rejection due to invalid transition */\r\n static invalid(detail?: any): Rejection {\r\n const message = 'This transition is invalid';\r\n return new Rejection(RejectType.INVALID, message, detail);\r\n }\r\n\r\n /** Returns a Rejection due to ignored transition */\r\n static ignored(detail?: any): Rejection {\r\n const message = 'The transition was ignored';\r\n return new Rejection(RejectType.IGNORED, message, detail);\r\n }\r\n\r\n /** Returns a Rejection due to aborted transition */\r\n static aborted(detail?: any): Rejection {\r\n const message = 'The transition has been aborted';\r\n return new Rejection(RejectType.ABORTED, message, detail);\r\n }\r\n\r\n /** Returns a Rejection due to aborted transition */\r\n static errored(detail?: any): Rejection {\r\n const message = 'The transition errored';\r\n return new Rejection(RejectType.ERROR, message, detail);\r\n }\r\n\r\n /**\r\n * Returns a Rejection\r\n *\r\n * Normalizes a value as a Rejection.\r\n * If the value is already a Rejection, returns it.\r\n * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR).\r\n *\r\n * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection.\r\n */\r\n static normalize(detail?: Rejection | Error | any): Rejection {\r\n return is(Rejection)(detail) ? detail : Rejection.errored(detail);\r\n }\r\n\r\n constructor(type: number, message?: string, detail?: any) {\r\n this.type = type;\r\n this.message = message;\r\n this.detail = detail;\r\n }\r\n\r\n toString() {\r\n const detailString = (d: any) => (d && d.toString !== Object.prototype.toString ? d.toString() : stringify(d));\r\n const detail = detailString(this.detail);\r\n const { $id, type, message } = this;\r\n return `Transition Rejection($id: ${$id} type: ${type}, message: ${message}, detail: ${detail})`;\r\n }\r\n\r\n toPromise(): Promise<any> {\r\n return extend(silentRejection(this), { _transitionRejection: this });\r\n }\r\n}\r\n","import { trace } from '../common/trace';\r\nimport { services } from '../common/coreservices';\r\nimport { stringify } from '../common/strings';\r\nimport { map, find, extend, mergeR, tail, omit, arrayTuples, unnestR, identity, anyTrueR } from '../common/common';\r\nimport { isObject, isUndefined } from '../common/predicates';\r\nimport { prop, propEq, val, not, is } from '../common/hof';\r\nimport { StateDeclaration, StateOrName } from '../state/interface';\r\nimport {\r\n TransitionOptions,\r\n TreeChanges,\r\n IHookRegistry,\r\n TransitionHookPhase,\r\n RegisteredHooks,\r\n HookRegOptions,\r\n HookMatchCriteria,\r\n TransitionStateHookFn,\r\n TransitionHookFn,\r\n} from './interface'; // has or is using\r\nimport { TransitionHook } from './transitionHook';\r\nimport { matchState, makeEvent, RegisteredHook } from './hookRegistry';\r\nimport { HookBuilder } from './hookBuilder';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { PathUtils } from '../path/pathUtils';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { TargetState } from '../state/targetState';\r\nimport { Param } from '../params/param';\r\nimport { Resolvable } from '../resolve/resolvable';\r\nimport { ViewConfig } from '../view/interface';\r\nimport { ResolveContext } from '../resolve/resolveContext';\r\nimport { UIRouter } from '../router';\r\nimport { UIInjector } from '../interface';\r\nimport { RawParams } from '../params/interface';\r\nimport { ResolvableLiteral } from '../resolve/interface';\r\nimport { Rejection } from './rejectFactory';\r\nimport { applyPairs, flattenR, uniqR } from '../common';\r\n\r\n/** @internal */\r\nconst stateSelf: (_state: StateObject) => StateDeclaration = prop('self');\r\n\r\n/**\r\n * Represents a transition between two states.\r\n *\r\n * When navigating to a state, we are transitioning **from** the current state **to** the new state.\r\n *\r\n * This object contains all contextual information about the to/from states, parameters, resolves.\r\n * It has information about all states being entered and exited as a result of the transition.\r\n */\r\nexport class Transition implements IHookRegistry {\r\n /** @internal */\r\n static diToken = Transition;\r\n\r\n /**\r\n * A unique identifier for the transition.\r\n *\r\n * This is an auto incrementing integer, starting from `0`.\r\n */\r\n $id: number;\r\n\r\n /**\r\n * A reference to the [[UIRouter]] instance\r\n *\r\n * This reference can be used to access the router services, such as the [[StateService]]\r\n */\r\n router: UIRouter;\r\n\r\n /** @internal */\r\n private _deferred = services.$q.defer();\r\n /**\r\n * This promise is resolved or rejected based on the outcome of the Transition.\r\n *\r\n * When the transition is successful, the promise is resolved\r\n * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error\r\n */\r\n promise: Promise<any> = this._deferred.promise;\r\n /**\r\n * A boolean which indicates if the transition was successful\r\n *\r\n * After a successful transition, this value is set to true.\r\n * After an unsuccessful transition, this value is set to false.\r\n *\r\n * The value will be undefined if the transition is not complete\r\n */\r\n success: boolean;\r\n /** @internal */\r\n _aborted: boolean;\r\n /** @internal */\r\n private _error: Rejection;\r\n\r\n /** @internal Holds the hook registration functions such as those passed to Transition.onStart() */\r\n _registeredHooks: RegisteredHooks = {};\r\n\r\n /** @internal */\r\n private _options: TransitionOptions;\r\n /** @internal */\r\n private _treeChanges: TreeChanges;\r\n /** @internal */\r\n private _targetState: TargetState;\r\n /** @internal */\r\n private _hookBuilder = new HookBuilder(this);\r\n\r\n /** @internal */\r\n onBefore(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onStart(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onExit(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onRetain(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onEnter(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onFinish(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onSuccess(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onError(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n\r\n /** @internal\r\n * Creates the transition-level hook registration functions\r\n * (which can then be used to register hooks)\r\n */\r\n private createTransitionHookRegFns() {\r\n this.router.transitionService._pluginapi\r\n ._getEvents()\r\n .filter((type) => type.hookPhase !== TransitionHookPhase.CREATE)\r\n .forEach((type) => makeEvent(this, this.router.transitionService, type));\r\n }\r\n\r\n /** @internal */\r\n getHooks(hookName: string): RegisteredHook[] {\r\n return this._registeredHooks[hookName];\r\n }\r\n\r\n /**\r\n * Creates a new Transition object.\r\n *\r\n * If the target state is not valid, an error is thrown.\r\n *\r\n * @internal\r\n *\r\n * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`\r\n * encapsulates the \"from state\".\r\n * @param targetState The target state and parameters being transitioned to (also, the transition options)\r\n * @param router The [[UIRouter]] instance\r\n * @internal\r\n */\r\n constructor(fromPath: PathNode[], targetState: TargetState, router: UIRouter) {\r\n this.router = router;\r\n this._targetState = targetState;\r\n\r\n if (!targetState.valid()) {\r\n throw new Error(targetState.error());\r\n }\r\n\r\n // current() is assumed to come from targetState.options, but provide a naive implementation otherwise.\r\n this._options = extend({ current: val(this) }, targetState.options());\r\n this.$id = router.transitionService._transitionCount++;\r\n const toPath = PathUtils.buildToPath(fromPath, targetState);\r\n this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);\r\n this.createTransitionHookRegFns();\r\n\r\n const onCreateHooks = this._hookBuilder.buildHooksForPhase(TransitionHookPhase.CREATE);\r\n TransitionHook.invokeHooks(onCreateHooks, () => null);\r\n\r\n this.applyViewConfigs(router);\r\n }\r\n\r\n private applyViewConfigs(router: UIRouter) {\r\n const enteringStates = this._treeChanges.entering.map((node) => node.state);\r\n PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @returns the internal from [State] object\r\n */\r\n $from() {\r\n return tail(this._treeChanges.from).state;\r\n }\r\n\r\n /**\r\n * @internal\r\n * @returns the internal to [State] object\r\n */\r\n $to() {\r\n return tail(this._treeChanges.to).state;\r\n }\r\n\r\n /**\r\n * Returns the \"from state\"\r\n *\r\n * Returns the state that the transition is coming *from*.\r\n *\r\n * @returns The state declaration object for the Transition's (\"from state\").\r\n */\r\n from(): StateDeclaration {\r\n return this.$from().self;\r\n }\r\n\r\n /**\r\n * Returns the \"to state\"\r\n *\r\n * Returns the state that the transition is going *to*.\r\n *\r\n * @returns The state declaration object for the Transition's target state (\"to state\").\r\n */\r\n to(): StateDeclaration {\r\n return this.$to().self;\r\n }\r\n\r\n /**\r\n * Gets the Target State\r\n *\r\n * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.\r\n *\r\n * @returns the [[TargetState]] of this Transition\r\n */\r\n targetState() {\r\n return this._targetState;\r\n }\r\n\r\n /**\r\n * Determines whether two transitions are equivalent.\r\n * @deprecated\r\n */\r\n is(compare: Transition | { to?: any; from?: any }): boolean {\r\n if (compare instanceof Transition) {\r\n // TODO: Also compare parameters\r\n return this.is({ to: compare.$to().name, from: compare.$from().name });\r\n }\r\n return !(\r\n (compare.to && !matchState(this.$to(), compare.to, this)) ||\r\n (compare.from && !matchState(this.$from(), compare.from, this))\r\n );\r\n }\r\n\r\n /**\r\n * Gets transition parameter values\r\n *\r\n * Returns the parameter values for a transition as key/value pairs.\r\n * This object is immutable.\r\n *\r\n * By default, returns the new parameter values (for the \"to state\").\r\n *\r\n * #### Example:\r\n * ```js\r\n * var toParams = transition.params();\r\n * ```\r\n *\r\n * To return the previous parameter values, supply `'from'` as the `pathname` argument.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var fromParams = transition.params('from');\r\n * ```\r\n *\r\n * @param pathname the name of the treeChanges path to get parameter values for:\r\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\r\n *\r\n * @returns transition parameter values for the desired path.\r\n */\r\n params(pathname?: string): { [paramName: string]: any };\r\n params<T>(pathname?: string): T;\r\n params(pathname = 'to') {\r\n return Object.freeze(this._treeChanges[pathname].map(prop('paramValues')).reduce(mergeR, {}));\r\n }\r\n\r\n /**\r\n * Gets the new values of any parameters that changed during this transition.\r\n *\r\n * Returns any parameter values that have changed during a transition, as key/value pairs.\r\n *\r\n * - Any parameter values that have changed will be present on the returned object reflecting the new value.\r\n * - Any parameters that *not* have changed will not be present on the returned object.\r\n * - Any new parameters that weren't present in the \"from\" state, but are now present in the \"to\" state will be present on the returned object.\r\n * - Any previous parameters that are no longer present (because the \"to\" state doesn't have them) will be included with a value of `undefined`.\r\n *\r\n * The returned object is immutable.\r\n *\r\n * #### Examples:\r\n *\r\n * Given:\r\n * ```js\r\n * var stateA = { name: 'stateA', url: '/stateA/:param1/param2' }\r\n * var stateB = { name: 'stateB', url: '/stateB/:param3' }\r\n * var stateC = { name: 'stateB.nest', url: '/nest/:param4' }\r\n * ```\r\n *\r\n * #### Example 1\r\n *\r\n * From `/stateA/abc/def` to `/stateA/abc/xyz`\r\n *\r\n * ```js\r\n * var changed = transition.paramsChanged()\r\n * // changed is { param2: 'xyz' }\r\n * ```\r\n *\r\n * The value of `param2` changed to `xyz`.\r\n * The value of `param1` stayed the same so its value is not present.\r\n *\r\n * #### Example 2\r\n *\r\n * From `/stateA/abc/def` to `/stateB/123`\r\n *\r\n * ```js\r\n * var changed = transition.paramsChanged()\r\n * // changed is { param1: undefined, param2: undefined, param3: '123' }\r\n * ```\r\n *\r\n * The value `param3` is present because it is a new param.\r\n * Both `param1` and `param2` are no longer present so their value is undefined.\r\n *\r\n * #### Example 3\r\n *\r\n * From `/stateB/123` to `/stateB/123/nest/456`\r\n *\r\n * ```js\r\n * var changed = transition.paramsChanged()\r\n * // changed is { param4: '456' }\r\n * ```\r\n *\r\n * The value `param4` is present because it is a new param.\r\n * The value of `param3` did not change, so its value is not present.\r\n *\r\n * @returns an immutable object with changed parameter keys/values.\r\n */\r\n paramsChanged(): { [paramName: string]: any };\r\n paramsChanged<T>(): T;\r\n paramsChanged() {\r\n const fromParams = this.params('from');\r\n const toParams = this.params('to');\r\n\r\n // All the parameters declared on both the \"to\" and \"from\" paths\r\n const allParamDescriptors: Param[] = []\r\n .concat(this._treeChanges.to)\r\n .concat(this._treeChanges.from)\r\n .map((pathNode) => pathNode.paramSchema)\r\n .reduce(flattenR, [])\r\n .reduce(uniqR, []);\r\n\r\n const changedParamDescriptors = Param.changed(allParamDescriptors, fromParams, toParams);\r\n\r\n return changedParamDescriptors.reduce((changedValues, descriptor) => {\r\n changedValues[descriptor.id] = toParams[descriptor.id];\r\n return changedValues;\r\n }, {});\r\n }\r\n\r\n /**\r\n * Creates a [[UIInjector]] Dependency Injector\r\n *\r\n * Returns a Dependency Injector for the Transition's target state (to state).\r\n * The injector provides resolve values which the target state has access to.\r\n *\r\n * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).\r\n *\r\n * #### Example:\r\n * ```js\r\n * .onEnter({ entering: 'myState' }, trans => {\r\n * var myResolveValue = trans.injector().get('myResolve');\r\n * // Inject a global service from the global/native injector (if it exists)\r\n * var MyService = trans.injector().get('MyService');\r\n * })\r\n * ```\r\n *\r\n * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.\r\n * You can use [[UIInjector.getAsync]] to get a promise for the data.\r\n * #### Example:\r\n * ```js\r\n * .onBefore({}, trans => {\r\n * return trans.injector().getAsync('myResolve').then(myResolveValue =>\r\n * return myResolveValue !== 'ABORT';\r\n * });\r\n * });\r\n * ```\r\n *\r\n * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.\r\n * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.\r\n * #### Example:\r\n * ```js\r\n * .onEnter({ to: 'foo.bar' }, trans => {\r\n * // returns result of `foo` state's `myResolve` resolve\r\n * // even though `foo.bar` also has a `myResolve` resolve\r\n * var fooData = trans.injector('foo').get('myResolve');\r\n * });\r\n * ```\r\n *\r\n * If you need resolve data from the exiting states, pass `'from'` as `pathName`.\r\n * The resolve data from the `from` path will be returned.\r\n * #### Example:\r\n * ```js\r\n * .onExit({ exiting: 'foo.bar' }, trans => {\r\n * // Gets the resolve value of `myResolve` from the state being exited\r\n * var fooData = trans.injector(null, 'from').get('myResolve');\r\n * });\r\n * ```\r\n *\r\n *\r\n * @param state Limits the resolves provided to only the resolves the provided state has access to.\r\n * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.\r\n *\r\n * @returns a [[UIInjector]]\r\n */\r\n injector(state?: StateOrName, pathName = 'to'): UIInjector {\r\n let path: PathNode[] = this._treeChanges[pathName];\r\n if (state) path = PathUtils.subPath(path, (node) => node.state === state || node.state.name === state);\r\n return new ResolveContext(path).injector();\r\n }\r\n\r\n /**\r\n * Gets all available resolve tokens (keys)\r\n *\r\n * This method can be used in conjunction with [[injector]] to inspect the resolve values\r\n * available to the Transition.\r\n *\r\n * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states\r\n * in the Transition's [[TreeChanges.to]] path.\r\n *\r\n * #### Example:\r\n * This example logs all resolve values\r\n * ```js\r\n * let tokens = trans.getResolveTokens();\r\n * tokens.forEach(token => console.log(token + \" = \" + trans.injector().get(token)));\r\n * ```\r\n *\r\n * #### Example:\r\n * This example creates promises for each resolve value.\r\n * This triggers fetches of resolves (if any have not yet been fetched).\r\n * When all promises have all settled, it logs the resolve values.\r\n * ```js\r\n * let tokens = trans.getResolveTokens();\r\n * let promise = tokens.map(token => trans.injector().getAsync(token));\r\n * Promise.all(promises).then(values => console.log(\"Resolved values: \" + values));\r\n * ```\r\n *\r\n * Note: Angular 1 users whould use `$q.all()`\r\n *\r\n * @param pathname resolve context's path name (e.g., `to` or `from`)\r\n *\r\n * @returns an array of resolve tokens (keys)\r\n */\r\n getResolveTokens(pathname = 'to'): any[] {\r\n return new ResolveContext(this._treeChanges[pathname]).getTokens();\r\n }\r\n\r\n /**\r\n * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.\r\n *\r\n * Allows a transition hook to dynamically add a Resolvable to this Transition.\r\n *\r\n * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).\r\n *\r\n * If a `state` argument is provided, the Resolvable is processed when that state is being entered.\r\n * If no `state` is provided then the root state is used.\r\n * If the given `state` has already been entered, the Resolvable is processed when any child state is entered.\r\n * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition.\r\n *\r\n * The `state` argument also scopes the resolved data.\r\n * The resolved data is available from the injector for that `state` and any children states.\r\n *\r\n * #### Example:\r\n * ```js\r\n * transitionService.onBefore({}, transition => {\r\n * transition.addResolvable({\r\n * token: 'myResolve',\r\n * deps: ['MyService'],\r\n * resolveFn: myService => myService.getData()\r\n * });\r\n * });\r\n * ```\r\n *\r\n * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])\r\n * @param state the state in the \"to path\" which should receive the new resolve (otherwise, the root state)\r\n */\r\n addResolvable(resolvable: Resolvable | ResolvableLiteral, state: StateOrName = ''): void {\r\n resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable);\r\n\r\n const stateName: string = typeof state === 'string' ? state : state.name;\r\n const topath = this._treeChanges.to;\r\n const targetNode = find(topath, (node) => node.state.name === stateName);\r\n const resolveContext: ResolveContext = new ResolveContext(topath);\r\n resolveContext.addResolvables([resolvable as Resolvable], targetNode.state);\r\n }\r\n\r\n /**\r\n * Gets the transition from which this transition was redirected.\r\n *\r\n * If the current transition is a redirect, this method returns the transition that was redirected.\r\n *\r\n * #### Example:\r\n * ```js\r\n * let transitionA = $state.go('A').transition\r\n * transitionA.onStart({}, () => $state.target('B'));\r\n * $transitions.onSuccess({ to: 'B' }, (trans) => {\r\n * trans.to().name === 'B'; // true\r\n * trans.redirectedFrom() === transitionA; // true\r\n * });\r\n * ```\r\n *\r\n * @returns The previous Transition, or null if this Transition is not the result of a redirection\r\n */\r\n redirectedFrom(): Transition {\r\n return this._options.redirectedFrom || null;\r\n }\r\n\r\n /**\r\n * Gets the original transition in a redirect chain\r\n *\r\n * A transition might belong to a long chain of multiple redirects.\r\n * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // states\r\n * registry.register({ name: 'A', redirectTo: 'B' });\r\n * registry.register({ name: 'B', redirectTo: 'C' });\r\n * registry.register({ name: 'C', redirectTo: 'D' });\r\n * registry.register({ name: 'D' });\r\n *\r\n * let transitionA = $state.go('A').transition\r\n *\r\n * $transitions.onSuccess({ to: 'D' }, (trans) => {\r\n * trans.to().name === 'D'; // true\r\n * trans.redirectedFrom().to().name === 'C'; // true\r\n * trans.originalTransition() === transitionA; // true\r\n * trans.originalTransition().to().name === 'A'; // true\r\n * });\r\n * ```\r\n *\r\n * @returns The original Transition that started a redirect chain\r\n */\r\n originalTransition(): Transition {\r\n const rf = this.redirectedFrom();\r\n return (rf && rf.originalTransition()) || this;\r\n }\r\n\r\n /**\r\n * Get the transition options\r\n *\r\n * @returns the options for this Transition.\r\n */\r\n options(): TransitionOptions {\r\n return this._options;\r\n }\r\n\r\n /**\r\n * Gets the states being entered.\r\n *\r\n * @returns an array of states that will be entered during this transition.\r\n */\r\n entering(): StateDeclaration[] {\r\n return map(this._treeChanges.entering, prop('state')).map(stateSelf);\r\n }\r\n\r\n /**\r\n * Gets the states being exited.\r\n *\r\n * @returns an array of states that will be exited during this transition.\r\n */\r\n exiting(): StateDeclaration[] {\r\n return map(this._treeChanges.exiting, prop('state')).map(stateSelf).reverse();\r\n }\r\n\r\n /**\r\n * Gets the states being retained.\r\n *\r\n * @returns an array of states that are already entered from a previous Transition, that will not be\r\n * exited during this Transition\r\n */\r\n retained(): StateDeclaration[] {\r\n return map(this._treeChanges.retained, prop('state')).map(stateSelf);\r\n }\r\n\r\n /**\r\n * Get the [[ViewConfig]]s associated with this Transition\r\n *\r\n * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.\r\n * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., \"to\" or \"entering\").\r\n *\r\n * @param pathname the name of the path to fetch views for:\r\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\r\n * @param state If provided, only returns the `ViewConfig`s for a single state in the path\r\n *\r\n * @returns a list of ViewConfig objects for the given path.\r\n */\r\n views(pathname = 'entering', state?: StateObject): ViewConfig[] {\r\n let path = this._treeChanges[pathname];\r\n path = !state ? path : path.filter(propEq('state', state));\r\n return path.map(prop('views')).filter(identity).reduce(unnestR, []);\r\n }\r\n\r\n /**\r\n * Return the transition's tree changes\r\n *\r\n * A transition goes from one state/parameters to another state/parameters.\r\n * During a transition, states are entered and/or exited.\r\n *\r\n * This function returns various branches (paths) which represent the changes to the\r\n * active state tree that are caused by the transition.\r\n *\r\n * @param pathname The name of the tree changes path to get:\r\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\r\n */\r\n treeChanges(pathname: string): PathNode[];\r\n treeChanges(): TreeChanges;\r\n treeChanges(pathname?: string) {\r\n return pathname ? this._treeChanges[pathname] : this._treeChanges;\r\n }\r\n\r\n /**\r\n * Creates a new transition that is a redirection of the current one.\r\n *\r\n * This transition can be returned from a [[TransitionService]] hook to\r\n * redirect a transition to a new state and/or set of parameters.\r\n *\r\n * @internal\r\n *\r\n * @returns Returns a new [[Transition]] instance.\r\n */\r\n redirect(targetState: TargetState): Transition {\r\n let redirects = 1,\r\n trans: Transition = this;\r\n // tslint:disable-next-line:no-conditional-assignment\r\n while ((trans = trans.redirectedFrom()) != null) {\r\n if (++redirects > 20) throw new Error(`Too many consecutive Transition redirects (20+)`);\r\n }\r\n\r\n const redirectOpts: TransitionOptions = { redirectedFrom: this, source: 'redirect' };\r\n // If the original transition was caused by URL sync, then use { location: 'replace' }\r\n // on the new transition (unless the target state explicitly specifies location: false).\r\n // This causes the original url to be replaced with the url for the redirect target\r\n // so the original url disappears from the browser history.\r\n if (this.options().source === 'url' && targetState.options().location !== false) {\r\n redirectOpts.location = 'replace';\r\n }\r\n\r\n const newOptions = extend({}, this.options(), targetState.options(), redirectOpts);\r\n targetState = targetState.withOptions(newOptions, true);\r\n\r\n const newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);\r\n const originalEnteringNodes = this._treeChanges.entering;\r\n const redirectEnteringNodes = newTransition._treeChanges.entering;\r\n\r\n // --- Re-use resolve data from original transition ---\r\n // When redirecting from a parent state to a child state where the parent parameter values haven't changed\r\n // (because of the redirect), the resolves fetched by the original transition are still valid in the\r\n // redirected transition.\r\n //\r\n // This allows you to define a redirect on a parent state which depends on an async resolve value.\r\n // You can wait for the resolve, then redirect to a child state based on the result.\r\n // The redirected transition does not have to re-fetch the resolve.\r\n // ---------------------------------------------------------\r\n\r\n const nodeIsReloading = (reloadState: StateObject) => (node: PathNode) => {\r\n return reloadState && node.state.includes[reloadState.name];\r\n };\r\n\r\n // Find any \"entering\" nodes in the redirect path that match the original path and aren't being reloaded\r\n const matchingEnteringNodes: PathNode[] = PathUtils.matching(\r\n redirectEnteringNodes,\r\n originalEnteringNodes,\r\n PathUtils.nonDynamicParams\r\n ).filter(not(nodeIsReloading(targetState.options().reloadState)));\r\n\r\n // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes.\r\n matchingEnteringNodes.forEach((node, idx) => {\r\n node.resolvables = originalEnteringNodes[idx].resolvables;\r\n });\r\n\r\n return newTransition;\r\n }\r\n\r\n /** @internal If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */\r\n private _changedParams(): Param[] {\r\n const tc = this._treeChanges;\r\n\r\n /** Return undefined if it's not a \"dynamic\" transition, for the following reasons */\r\n // If user explicitly wants a reload\r\n if (this._options.reload) return undefined;\r\n // If any states are exiting or entering\r\n if (tc.exiting.length || tc.entering.length) return undefined;\r\n // If to/from path lengths differ\r\n if (tc.to.length !== tc.from.length) return undefined;\r\n // If the to/from paths are different\r\n const pathsDiffer: boolean = arrayTuples(tc.to, tc.from)\r\n .map((tuple) => tuple[0].state !== tuple[1].state)\r\n .reduce(anyTrueR, false);\r\n if (pathsDiffer) return undefined;\r\n\r\n // Find any parameter values that differ\r\n const nodeSchemas: Param[][] = tc.to.map((node: PathNode) => node.paramSchema);\r\n const [toValues, fromValues] = [tc.to, tc.from].map((path) => path.map((x) => x.paramValues));\r\n const tuples = arrayTuples(nodeSchemas, toValues, fromValues);\r\n\r\n return tuples.map(([schema, toVals, fromVals]) => Param.changed(schema, toVals, fromVals)).reduce(unnestR, []);\r\n }\r\n\r\n /**\r\n * Returns true if the transition is dynamic.\r\n *\r\n * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.\r\n *\r\n * @returns true if the Transition is dynamic\r\n */\r\n dynamic(): boolean {\r\n const changes = this._changedParams();\r\n return !changes ? false : changes.map((x) => x.dynamic).reduce(anyTrueR, false);\r\n }\r\n\r\n /**\r\n * Returns true if the transition is ignored.\r\n *\r\n * A transition is ignored if no states are entered nor exited, and no parameter values have changed.\r\n *\r\n * @returns true if the Transition is ignored.\r\n */\r\n ignored(): boolean {\r\n return !!this._ignoredReason();\r\n }\r\n\r\n /** @internal */\r\n _ignoredReason(): 'SameAsCurrent' | 'SameAsPending' | undefined {\r\n const pending = this.router.globals.transition;\r\n const reloadState = this._options.reloadState;\r\n\r\n const same = (pathA, pathB) => {\r\n if (pathA.length !== pathB.length) return false;\r\n const matching = PathUtils.matching(pathA, pathB);\r\n return pathA.length === matching.filter((node) => !reloadState || !node.state.includes[reloadState.name]).length;\r\n };\r\n\r\n const newTC = this.treeChanges();\r\n const pendTC = pending && pending.treeChanges();\r\n\r\n if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting)) return 'SameAsPending';\r\n if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to)) return 'SameAsCurrent';\r\n }\r\n\r\n /**\r\n * Runs the transition\r\n *\r\n * This method is generally called from the [[StateService.transitionTo]]\r\n *\r\n * @internal\r\n *\r\n * @returns a promise for a successful transition.\r\n */\r\n run(): Promise<any> {\r\n const runAllHooks = TransitionHook.runAllHooks;\r\n\r\n // Gets transition hooks array for the given phase\r\n const getHooksFor = (phase: TransitionHookPhase) => this._hookBuilder.buildHooksForPhase(phase);\r\n\r\n // When the chain is complete, then resolve or reject the deferred\r\n const transitionSuccess = () => {\r\n trace.traceSuccess(this.$to(), this);\r\n this.success = true;\r\n this._deferred.resolve(this.to());\r\n runAllHooks(getHooksFor(TransitionHookPhase.SUCCESS));\r\n };\r\n\r\n const transitionError = (reason: Rejection) => {\r\n trace.traceError(reason, this);\r\n this.success = false;\r\n this._deferred.reject(reason);\r\n this._error = reason;\r\n runAllHooks(getHooksFor(TransitionHookPhase.ERROR));\r\n };\r\n\r\n const runTransition = () => {\r\n // Wait to build the RUN hook chain until the BEFORE hooks are done\r\n // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object.\r\n const allRunHooks = getHooksFor(TransitionHookPhase.RUN);\r\n const done = () => services.$q.when(undefined);\r\n return TransitionHook.invokeHooks(allRunHooks, done);\r\n };\r\n\r\n const startTransition = () => {\r\n const globals = this.router.globals;\r\n\r\n globals.lastStartedTransitionId = this.$id;\r\n globals.transition = this;\r\n globals.transitionHistory.enqueue(this);\r\n\r\n trace.traceTransitionStart(this);\r\n\r\n return services.$q.when(undefined);\r\n };\r\n\r\n const allBeforeHooks = getHooksFor(TransitionHookPhase.BEFORE);\r\n TransitionHook.invokeHooks(allBeforeHooks, startTransition)\r\n .then(runTransition)\r\n .then(transitionSuccess, transitionError);\r\n\r\n return this.promise;\r\n }\r\n\r\n /** Checks if this transition is currently active/running. */\r\n isActive = () => this.router.globals.transition === this;\r\n\r\n /**\r\n * Checks if the Transition is valid\r\n *\r\n * @returns true if the Transition is valid\r\n */\r\n valid() {\r\n return !this.error() || this.success !== undefined;\r\n }\r\n\r\n /**\r\n * Aborts this transition\r\n *\r\n * Imperative API to abort a Transition.\r\n * This only applies to Transitions that are not yet complete.\r\n */\r\n abort() {\r\n // Do not set flag if the transition is already complete\r\n if (isUndefined(this.success)) {\r\n this._aborted = true;\r\n }\r\n }\r\n\r\n /**\r\n * The Transition error reason.\r\n *\r\n * If the transition is invalid (and could not be run), returns the reason the transition is invalid.\r\n * If the transition was valid and ran, but was not successful, returns the reason the transition failed.\r\n *\r\n * @returns a transition rejection explaining why the transition is invalid, or the reason the transition failed.\r\n */\r\n error(): Rejection {\r\n const state: StateObject = this.$to();\r\n\r\n if (state.self.abstract) {\r\n return Rejection.invalid(`Cannot transition to abstract state '${state.name}'`);\r\n }\r\n\r\n const paramDefs = state.parameters();\r\n const values = this.params();\r\n const invalidParams = paramDefs.filter((param) => !param.validates(values[param.id]));\r\n\r\n if (invalidParams.length) {\r\n const invalidValues = invalidParams.map((param) => `[${param.id}:${stringify(values[param.id])}]`).join(', ');\r\n const detail = `The following parameter values are not valid for state '${state.name}': ${invalidValues}`;\r\n return Rejection.invalid(detail);\r\n }\r\n\r\n if (this.success === false) return this._error;\r\n }\r\n\r\n /**\r\n * A string representation of the Transition\r\n *\r\n * @returns A string representation of the Transition\r\n */\r\n toString() {\r\n const fromStateOrName = this.from();\r\n const toStateOrName = this.to();\r\n\r\n const avoidEmptyHash = (params: RawParams) =>\r\n params['#'] !== null && params['#'] !== undefined ? params : omit(params, ['#']);\r\n\r\n // (X) means the to state is invalid.\r\n const id = this.$id,\r\n from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName,\r\n fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))),\r\n toValid = this.valid() ? '' : '(X) ',\r\n to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName,\r\n toParams = stringify(avoidEmptyHash(this.params()));\r\n\r\n return `Transition#${id}( '${from}'${fromParams} -> ${toValid}'${to}'${toParams} )`;\r\n }\r\n}\r\n","import { TransitionHookPhase, PathType } from './interface';\r\nimport { GetErrorHandler, GetResultHandler, TransitionHook } from './transitionHook';\r\n/**\r\n * This class defines a type of hook, such as `onBefore` or `onEnter`.\r\n * Plugins can define custom hook types, such as sticky states does for `onInactive`.\r\n */\r\nexport class TransitionEventType {\r\n /* tslint:disable:no-inferrable-types */\r\n constructor(\r\n public name: string,\r\n public hookPhase: TransitionHookPhase,\r\n public hookOrder: number,\r\n public criteriaMatchPath: PathType,\r\n public reverseSort: boolean = false,\r\n public getResultHandler: GetResultHandler = TransitionHook.HANDLE_RESULT,\r\n public getErrorHandler: GetErrorHandler = TransitionHook.REJECT_ERROR,\r\n public synchronous: boolean = false\r\n ) {}\r\n}\r\n","import { TransitionHookOptions, HookResult, TransitionHookPhase } from './interface';\r\nimport { defaults, noop, silentRejection } from '../common/common';\r\nimport { fnToString, maxLength } from '../common/strings';\r\nimport { isPromise } from '../common/predicates';\r\nimport { is, parse } from '../common/hof';\r\nimport { trace } from '../common/trace';\r\nimport { services } from '../common/coreservices';\r\nimport { Rejection } from './rejectFactory';\r\nimport { TargetState } from '../state/targetState';\r\nimport { Transition } from './transition';\r\nimport { TransitionEventType } from './transitionEventType';\r\nimport { RegisteredHook } from './hookRegistry';\r\nimport { StateDeclaration } from '../state/interface';\r\n\r\nconst defaultOptions: TransitionHookOptions = {\r\n current: noop,\r\n transition: null,\r\n traceData: {},\r\n bind: null,\r\n};\r\n\r\nexport type GetResultHandler = (hook: TransitionHook) => ResultHandler;\r\nexport type GetErrorHandler = (hook: TransitionHook) => ErrorHandler;\r\n\r\nexport type ResultHandler = (result: HookResult) => Promise<HookResult>;\r\nexport type ErrorHandler = (error: any) => Promise<any>;\r\n\r\nexport class TransitionHook {\r\n type: TransitionEventType;\r\n\r\n /**\r\n * These GetResultHandler(s) are used by [[invokeHook]] below\r\n * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])\r\n */\r\n static HANDLE_RESULT: GetResultHandler = (hook: TransitionHook) => (result: HookResult) =>\r\n hook.handleHookResult(result);\r\n\r\n /**\r\n * If the result is a promise rejection, log it.\r\n * Otherwise, ignore the result.\r\n */\r\n static LOG_REJECTED_RESULT: GetResultHandler = (hook: TransitionHook) => (result: HookResult) => {\r\n isPromise(result) && result.catch((err) => hook.logError(Rejection.normalize(err)));\r\n return undefined;\r\n };\r\n\r\n /**\r\n * These GetErrorHandler(s) are used by [[invokeHook]] below\r\n * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])\r\n */\r\n static LOG_ERROR: GetErrorHandler = (hook: TransitionHook) => (error: any) => hook.logError(error);\r\n\r\n static REJECT_ERROR: GetErrorHandler = (hook: TransitionHook) => (error: any) => silentRejection(error);\r\n\r\n static THROW_ERROR: GetErrorHandler = (hook: TransitionHook) => (error: any) => {\r\n throw error;\r\n };\r\n\r\n /**\r\n * Chains together an array of TransitionHooks.\r\n *\r\n * Given a list of [[TransitionHook]] objects, chains them together.\r\n * Each hook is invoked after the previous one completes.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var hooks: TransitionHook[] = getHooks();\r\n * let promise: Promise<any> = TransitionHook.chain(hooks);\r\n *\r\n * promise.then(handleSuccess, handleError);\r\n * ```\r\n *\r\n * @param hooks the list of hooks to chain together\r\n * @param waitFor if provided, the chain is `.then()`'ed off this promise\r\n * @returns a `Promise` for sequentially invoking the hooks (in order)\r\n */\r\n static chain(hooks: TransitionHook[], waitFor?: Promise<any>): Promise<any> {\r\n // Chain the next hook off the previous\r\n const createHookChainR = (prev: Promise<any>, nextHook: TransitionHook) => prev.then(() => nextHook.invokeHook());\r\n return hooks.reduce(createHookChainR, waitFor || services.$q.when());\r\n }\r\n\r\n /**\r\n * Invokes all the provided TransitionHooks, in order.\r\n * Each hook's return value is checked.\r\n * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.\r\n * If no hook returns a promise, then all hooks are processed synchronously.\r\n *\r\n * @param hooks the list of TransitionHooks to invoke\r\n * @param doneCallback a callback that is invoked after all the hooks have successfully completed\r\n *\r\n * @returns a promise for the async result, or the result of the callback\r\n */\r\n static invokeHooks<T>(hooks: TransitionHook[], doneCallback: (result?: HookResult) => T): Promise<any> | T {\r\n for (let idx = 0; idx < hooks.length; idx++) {\r\n const hookResult = hooks[idx].invokeHook();\r\n\r\n if (isPromise(hookResult)) {\r\n const remainingHooks = hooks.slice(idx + 1);\r\n\r\n return TransitionHook.chain(remainingHooks, hookResult).then(doneCallback);\r\n }\r\n }\r\n\r\n return doneCallback();\r\n }\r\n\r\n /**\r\n * Run all TransitionHooks, ignoring their return value.\r\n */\r\n static runAllHooks(hooks: TransitionHook[]): void {\r\n hooks.forEach((hook) => hook.invokeHook());\r\n }\r\n\r\n constructor(\r\n private transition: Transition,\r\n private stateContext: StateDeclaration,\r\n private registeredHook: RegisteredHook,\r\n private options: TransitionHookOptions\r\n ) {\r\n this.options = defaults(options, defaultOptions);\r\n this.type = registeredHook.eventType;\r\n }\r\n\r\n private isSuperseded = () => this.type.hookPhase === TransitionHookPhase.RUN && !this.options.transition.isActive();\r\n\r\n logError(err): any {\r\n this.transition.router.stateService.defaultErrorHandler()(err);\r\n }\r\n\r\n invokeHook(): Promise<HookResult> | void {\r\n const hook = this.registeredHook;\r\n if (hook._deregistered) return;\r\n\r\n const notCurrent = this.getNotCurrentRejection();\r\n if (notCurrent) return notCurrent;\r\n\r\n const options = this.options;\r\n trace.traceHookInvocation(this, this.transition, options);\r\n\r\n const invokeCallback = () => hook.callback.call(options.bind, this.transition, this.stateContext);\r\n\r\n const normalizeErr = (err) => Rejection.normalize(err).toPromise();\r\n\r\n const handleError = (err) => hook.eventType.getErrorHandler(this)(err);\r\n\r\n const handleResult = (result) => hook.eventType.getResultHandler(this)(result);\r\n\r\n try {\r\n const result = invokeCallback();\r\n\r\n if (!this.type.synchronous && isPromise(result)) {\r\n return result.catch(normalizeErr).then(handleResult, handleError);\r\n } else {\r\n return handleResult(result);\r\n }\r\n } catch (err) {\r\n // If callback throws (synchronously)\r\n return handleError(Rejection.normalize(err));\r\n } finally {\r\n if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {\r\n hook.deregister();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This method handles the return value of a Transition Hook.\r\n *\r\n * A hook can return false (cancel), a TargetState (redirect),\r\n * or a promise (which may later resolve to false or a redirect)\r\n *\r\n * This also handles \"transition superseded\" -- when a new transition\r\n * was started while the hook was still running\r\n */\r\n handleHookResult(result: HookResult): Promise<HookResult> {\r\n const notCurrent = this.getNotCurrentRejection();\r\n if (notCurrent) return notCurrent;\r\n\r\n // Hook returned a promise\r\n if (isPromise(result)) {\r\n // Wait for the promise, then reprocess with the resulting value\r\n return result.then((val) => this.handleHookResult(val));\r\n }\r\n\r\n trace.traceHookResult(result, this.transition, this.options);\r\n\r\n // Hook returned false\r\n if (result === false) {\r\n // Abort this Transition\r\n return Rejection.aborted('Hook aborted transition').toPromise();\r\n }\r\n\r\n const isTargetState = is(TargetState);\r\n // hook returned a TargetState\r\n if (isTargetState(result)) {\r\n // Halt the current Transition and redirect (a new Transition) to the TargetState.\r\n return Rejection.redirected(result).toPromise();\r\n }\r\n }\r\n\r\n /**\r\n * Return a Rejection promise if the transition is no longer current due\r\n * to a stopped router (disposed), or a new transition has started and superseded this one.\r\n */\r\n private getNotCurrentRejection() {\r\n const router = this.transition.router;\r\n\r\n // The router is stopped\r\n if (router._disposed) {\r\n return Rejection.aborted(`UIRouter instance #${router.$id} has been stopped (disposed)`).toPromise();\r\n }\r\n\r\n if (this.transition._aborted) {\r\n return Rejection.aborted().toPromise();\r\n }\r\n\r\n // This transition is no longer current.\r\n // Another transition started while this hook was still running.\r\n if (this.isSuperseded()) {\r\n // Abort this transition\r\n return Rejection.superseded(this.options.current()).toPromise();\r\n }\r\n }\r\n\r\n toString() {\r\n const { options, registeredHook } = this;\r\n const event = parse('traceData.hookType')(options) || 'internal',\r\n context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown',\r\n name = fnToString(registeredHook.callback);\r\n return `${event} context: ${context}, ${maxLength(200, name)}`;\r\n }\r\n}\r\n","import { Transition } from '../transition/transition';\r\nimport { UIRouter } from '../router';\r\nimport { TransitionService } from '../transition/transitionService';\r\nimport { Resolvable } from '../resolve';\r\nimport { inArray, uniqR, unnestR, values } from '../common';\r\nimport { PathNode } from '../path';\r\n\r\nfunction addCoreResolvables(trans: Transition) {\r\n trans.addResolvable(Resolvable.fromData(UIRouter, trans.router), '');\r\n trans.addResolvable(Resolvable.fromData(Transition, trans), '');\r\n trans.addResolvable(Resolvable.fromData('$transition$', trans), '');\r\n trans.addResolvable(Resolvable.fromData('$stateParams', trans.params()), '');\r\n\r\n trans.entering().forEach((state) => {\r\n trans.addResolvable(Resolvable.fromData('$state$', state), state);\r\n });\r\n}\r\n\r\nexport const registerAddCoreResolvables = (transitionService: TransitionService) =>\r\n transitionService.onCreate({}, addCoreResolvables);\r\n\r\nconst TRANSITION_TOKENS = ['$transition$', Transition];\r\nconst isTransition = inArray(TRANSITION_TOKENS);\r\n\r\n// References to Transition in the treeChanges pathnodes makes all\r\n// previous Transitions reachable in memory, causing a memory leak\r\n// This function removes resolves for '$transition$' and `Transition` from the treeChanges.\r\n// Do not use this on current transitions, only on old ones.\r\nexport const treeChangesCleanup = (trans: Transition) => {\r\n const nodes = values(trans.treeChanges()).reduce(unnestR, []).reduce(uniqR, []);\r\n\r\n // If the resolvable is a Transition, return a new resolvable with null data\r\n const replaceTransitionWithNull = (r: Resolvable): Resolvable => {\r\n return isTransition(r.token) ? Resolvable.fromData(r.token, null) : r;\r\n };\r\n\r\n nodes.forEach((node: PathNode) => {\r\n node.resolvables = node.resolvables.map(replaceTransitionWithNull);\r\n });\r\n};\r\n","import { isString, isFunction } from '../common/predicates';\r\nimport { Transition } from '../transition/transition';\r\nimport { services } from '../common/coreservices';\r\nimport { TargetState } from '../state/targetState';\r\nimport { TransitionService } from '../transition/transitionService';\r\nimport { TransitionHookFn } from '../transition/interface';\r\n\r\n/**\r\n * A [[TransitionHookFn]] that redirects to a different state or params\r\n *\r\n * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);`\r\n *\r\n * See [[StateDeclaration.redirectTo]]\r\n */\r\nconst redirectToHook: TransitionHookFn = (trans: Transition) => {\r\n const redirect = trans.to().redirectTo;\r\n if (!redirect) return;\r\n\r\n const $state = trans.router.stateService;\r\n\r\n function handleResult(result: any) {\r\n if (!result) return;\r\n if (result instanceof TargetState) return result;\r\n if (isString(result)) return $state.target(<any>result, trans.params(), trans.options());\r\n if (result['state'] || result['params'])\r\n return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options());\r\n }\r\n\r\n if (isFunction(redirect)) {\r\n return services.$q.when(redirect(trans)).then(handleResult);\r\n }\r\n return handleResult(redirect);\r\n};\r\n\r\nexport const registerRedirectToHook = (transitionService: TransitionService) =>\r\n transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectToHook);\r\n","import { TransitionStateHookFn } from '../transition/interface';\r\nimport { Transition } from '../transition/transition';\r\nimport { TransitionService } from '../transition/transitionService';\r\nimport { StateDeclaration } from '../state/interface';\r\nimport { StateObject } from '../state/stateObject';\r\n\r\n/**\r\n * A factory which creates an onEnter, onExit or onRetain transition hook function\r\n *\r\n * The returned function invokes the (for instance) state.onEnter hook when the\r\n * state is being entered.\r\n */\r\nfunction makeEnterExitRetainHook(hookName: string): TransitionStateHookFn {\r\n return (transition: Transition, state: StateDeclaration) => {\r\n const _state: StateObject = state.$$state();\r\n const hookFn: TransitionStateHookFn = _state[hookName];\r\n return hookFn(transition, state);\r\n };\r\n}\r\n\r\n/**\r\n * The [[TransitionStateHookFn]] for onExit\r\n *\r\n * When the state is being exited, the state's .onExit function is invoked.\r\n *\r\n * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);`\r\n *\r\n * See: [[IHookRegistry.onExit]]\r\n */\r\nconst onExitHook: TransitionStateHookFn = makeEnterExitRetainHook('onExit');\r\nexport const registerOnExitHook = (transitionService: TransitionService) =>\r\n transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);\r\n\r\n/**\r\n * The [[TransitionStateHookFn]] for onRetain\r\n *\r\n * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked.\r\n *\r\n * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);`\r\n *\r\n * See: [[IHookRegistry.onRetain]]\r\n */\r\nconst onRetainHook: TransitionStateHookFn = makeEnterExitRetainHook('onRetain');\r\nexport const registerOnRetainHook = (transitionService: TransitionService) =>\r\n transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);\r\n\r\n/**\r\n * The [[TransitionStateHookFn]] for onEnter\r\n *\r\n * When the state is being entered, the state's .onEnter function is invoked.\r\n *\r\n * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);`\r\n *\r\n * See: [[IHookRegistry.onEnter]]\r\n */\r\nconst onEnterHook: TransitionStateHookFn = makeEnterExitRetainHook('onEnter');\r\nexport const registerOnEnterHook = (transitionService: TransitionService) =>\r\n transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);\r\n","import { noop } from '../common/common';\r\nimport { Transition } from '../transition/transition';\r\nimport { ResolveContext } from '../resolve/resolveContext';\r\nimport { TransitionStateHookFn, TransitionHookFn } from '../transition/interface';\r\nimport { TransitionService } from '../transition/transitionService';\r\nimport { val } from '../common/hof';\r\nimport { StateDeclaration } from '../state/interface';\r\n\r\nexport const RESOLVE_HOOK_PRIORITY = 1000;\r\n\r\n/**\r\n * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path\r\n *\r\n * Registered using `transitionService.onStart({}, eagerResolvePath, { priority: 1000 });`\r\n *\r\n * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for.\r\n *\r\n * See [[StateDeclaration.resolve]]\r\n */\r\nconst eagerResolvePath: TransitionHookFn = (trans: Transition) =>\r\n new ResolveContext(trans.treeChanges().to).resolvePath('EAGER', trans).then(noop);\r\n\r\nexport const registerEagerResolvePath = (transitionService: TransitionService) =>\r\n transitionService.onStart({}, eagerResolvePath, { priority: RESOLVE_HOOK_PRIORITY });\r\n\r\n/**\r\n * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path\r\n *\r\n * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState, { priority: 1000 });`\r\n *\r\n * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for.\r\n *\r\n * See [[StateDeclaration.resolve]]\r\n */\r\nconst lazyResolveState: TransitionStateHookFn = (trans: Transition, state: StateDeclaration) =>\r\n new ResolveContext(trans.treeChanges().to).subContext(state.$$state()).resolvePath('LAZY', trans).then(noop);\r\n\r\nexport const registerLazyResolveState = (transitionService: TransitionService) =>\r\n transitionService.onEnter({ entering: val(true) }, lazyResolveState, { priority: RESOLVE_HOOK_PRIORITY });\r\n\r\n/**\r\n * A [[TransitionHookFn]] which resolves any dynamically added (LAZY or EAGER) Resolvables.\r\n *\r\n * Registered using `transitionService.onFinish({}, eagerResolvePath, { priority: 1000 });`\r\n *\r\n * After all entering states have been entered, this hook resolves any remaining Resolvables.\r\n * These are typically dynamic resolves which were added by some Transition Hook using [[Transition.addResolvable]].\r\n *\r\n * See [[StateDeclaration.resolve]]\r\n */\r\nconst resolveRemaining: TransitionHookFn = (trans: Transition) =>\r\n new ResolveContext(trans.treeChanges().to).resolvePath('LAZY', trans).then(noop);\r\n\r\nexport const registerResolveRemaining = (transitionService: TransitionService) =>\r\n transitionService.onFinish({}, resolveRemaining, { priority: RESOLVE_HOOK_PRIORITY });\r\n","import { noop } from '../common/common';\r\nimport { services } from '../common/coreservices';\r\nimport { Transition } from '../transition/transition';\r\nimport { ViewService } from '../view/view';\r\nimport { ViewConfig } from '../view/interface';\r\nimport { TransitionHookFn } from '../transition/interface';\r\nimport { TransitionService } from '../transition/transitionService';\r\n\r\n/**\r\n * A [[TransitionHookFn]] which waits for the views to load\r\n *\r\n * Registered using `transitionService.onStart({}, loadEnteringViews);`\r\n *\r\n * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.\r\n * In angular 1, this includes loading the templates.\r\n */\r\nconst loadEnteringViews: TransitionHookFn = (transition: Transition) => {\r\n const $q = services.$q;\r\n const enteringViews = transition.views('entering');\r\n if (!enteringViews.length) return;\r\n return $q.all(enteringViews.map((view) => $q.when(view.load()))).then(noop);\r\n};\r\n\r\nexport const registerLoadEnteringViews = (transitionService: TransitionService) =>\r\n transitionService.onFinish({}, loadEnteringViews);\r\n\r\n/**\r\n * A [[TransitionHookFn]] which activates the new views when a transition is successful.\r\n *\r\n * Registered using `transitionService.onSuccess({}, activateViews);`\r\n *\r\n * After a transition is complete, this hook deactivates the old views from the previous state,\r\n * and activates the new views from the destination state.\r\n *\r\n * See [[ViewService]]\r\n */\r\nconst activateViews: TransitionHookFn = (transition: Transition) => {\r\n const enteringViews = transition.views('entering');\r\n const exitingViews = transition.views('exiting');\r\n if (!enteringViews.length && !exitingViews.length) return;\r\n\r\n const $view: ViewService = transition.router.viewService;\r\n\r\n exitingViews.forEach((vc: ViewConfig) => $view.deactivateViewConfig(vc));\r\n enteringViews.forEach((vc: ViewConfig) => $view.activateViewConfig(vc));\r\n\r\n $view.sync();\r\n};\r\n\r\nexport const registerActivateViews = (transitionService: TransitionService) =>\r\n transitionService.onSuccess({}, activateViews);\r\n","import { Transition } from '../transition/transition';\r\nimport { copy } from '../common/common';\r\nimport { TransitionService } from '../transition/transitionService';\r\n\r\n/**\r\n * A [[TransitionHookFn]] which updates global UI-Router state\r\n *\r\n * Registered using `transitionService.onBefore({}, updateGlobalState);`\r\n *\r\n * Before a [[Transition]] starts, updates the global value of \"the current transition\" ([[Globals.transition]]).\r\n * After a successful [[Transition]], updates the global values of \"the current state\"\r\n * ([[Globals.current]] and [[Globals.$current]]) and \"the current param values\" ([[Globals.params]]).\r\n *\r\n * See also the deprecated properties:\r\n * [[StateService.transition]], [[StateService.current]], [[StateService.params]]\r\n */\r\nconst updateGlobalState = (trans: Transition) => {\r\n const globals = trans.router.globals;\r\n\r\n const transitionSuccessful = () => {\r\n globals.successfulTransitions.enqueue(trans);\r\n globals.$current = trans.$to();\r\n globals.current = globals.$current.self;\r\n\r\n copy(trans.params(), globals.params);\r\n };\r\n\r\n const clearCurrentTransition = () => {\r\n // Do not clear globals.transition if a different transition has started in the meantime\r\n if (globals.transition === trans) globals.transition = null;\r\n };\r\n\r\n trans.onSuccess({}, transitionSuccessful, { priority: 10000 });\r\n trans.promise.then(clearCurrentTransition, clearCurrentTransition);\r\n};\r\n\r\nexport const registerUpdateGlobalState = (transitionService: TransitionService) =>\r\n transitionService.onCreate({}, updateGlobalState);\r\n","import { UrlRouter } from '../url/urlRouter';\r\nimport { StateService } from '../state/stateService';\r\nimport { Transition } from '../transition/transition';\r\nimport { TransitionHookFn } from '../transition/interface';\r\nimport { TransitionService } from '../transition/transitionService';\r\n\r\n/**\r\n * A [[TransitionHookFn]] which updates the URL after a successful transition\r\n *\r\n * Registered using `transitionService.onSuccess({}, updateUrl);`\r\n */\r\nconst updateUrl: TransitionHookFn = (transition: Transition) => {\r\n const options = transition.options();\r\n const $state: StateService = transition.router.stateService;\r\n const $urlRouter: UrlRouter = transition.router.urlRouter;\r\n\r\n // Dont update the url in these situations:\r\n // The transition was triggered by a URL sync (options.source === 'url')\r\n // The user doesn't want the url to update (options.location === false)\r\n // The destination state, and all parents have no navigable url\r\n if (options.source !== 'url' && options.location && $state.$current.navigable) {\r\n const urlOptions = { replace: options.location === 'replace' };\r\n $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions);\r\n }\r\n\r\n $urlRouter.update(true);\r\n};\r\n\r\nexport const registerUpdateUrl = (transitionService: TransitionService) =>\r\n transitionService.onSuccess({}, updateUrl, { priority: 9999 });\r\n","import { trace } from '../common/trace';\r\nimport { Rejection } from '../transition/rejectFactory';\r\nimport { TransitionService } from '../transition/transitionService';\r\nimport { Transition } from '../transition/transition';\r\n\r\n/**\r\n * A [[TransitionHookFn]] that skips a transition if it should be ignored\r\n *\r\n * This hook is invoked at the end of the onBefore phase.\r\n *\r\n * If the transition should be ignored (because no parameter or states changed)\r\n * then the transition is ignored and not processed.\r\n */\r\nfunction ignoredHook(trans: Transition) {\r\n const ignoredReason = trans._ignoredReason();\r\n if (!ignoredReason) return;\r\n\r\n trace.traceTransitionIgnored(trans);\r\n\r\n const pending = trans.router.globals.transition;\r\n\r\n // The user clicked a link going back to the *current state* ('A')\r\n // However, there is also a pending transition in flight (to 'B')\r\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\r\n if (ignoredReason === 'SameAsCurrent' && pending) {\r\n pending.abort();\r\n }\r\n\r\n return Rejection.ignored().toPromise();\r\n}\r\n\r\nexport const registerIgnoredTransitionHook = (transitionService: TransitionService) =>\r\n transitionService.onBefore({}, ignoredHook, { priority: -9999 });\r\n","import { TransitionService } from '../transition/transitionService';\r\nimport { Transition } from '../transition/transition';\r\n\r\n/**\r\n * A [[TransitionHookFn]] that rejects the Transition if it is invalid\r\n *\r\n * This hook is invoked at the end of the onBefore phase.\r\n * If the transition is invalid (for example, param values do not validate)\r\n * then the transition is rejected.\r\n */\r\nfunction invalidTransitionHook(trans: Transition) {\r\n if (!trans.valid()) {\r\n throw new Error(trans.error().toString());\r\n }\r\n}\r\n\r\nexport const registerInvalidTransitionHook = (transitionService: TransitionService) =>\r\n transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 });\r\n","import {\r\n IHookRegistry,\r\n TransitionOptions,\r\n TransitionHookScope,\r\n TransitionHookPhase,\r\n TransitionCreateHookFn,\r\n HookMatchCriteria,\r\n HookRegOptions,\r\n PathTypes,\r\n PathType,\r\n RegisteredHooks,\r\n TransitionHookFn,\r\n TransitionStateHookFn,\r\n} from './interface';\r\nimport { Transition } from './transition';\r\nimport { makeEvent, RegisteredHook } from './hookRegistry';\r\nimport { TargetState } from '../state/targetState';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { ViewService } from '../view/view';\r\nimport { UIRouter } from '../router';\r\nimport { registerAddCoreResolvables, treeChangesCleanup } from '../hooks/coreResolvables';\r\nimport { registerRedirectToHook } from '../hooks/redirectTo';\r\nimport { registerOnExitHook, registerOnRetainHook, registerOnEnterHook } from '../hooks/onEnterExitRetain';\r\nimport { registerEagerResolvePath, registerLazyResolveState, registerResolveRemaining } from '../hooks/resolve';\r\nimport { registerLoadEnteringViews, registerActivateViews } from '../hooks/views';\r\nimport { registerUpdateGlobalState } from '../hooks/updateGlobals';\r\nimport { registerUpdateUrl } from '../hooks/url';\r\nimport { registerLazyLoadHook } from '../hooks/lazyLoad';\r\nimport { TransitionEventType } from './transitionEventType';\r\nimport { TransitionHook, GetResultHandler, GetErrorHandler } from './transitionHook';\r\nimport { isDefined } from '../common/predicates';\r\nimport { removeFrom, values, createProxyFunctions } from '../common/common';\r\nimport { Disposable } from '../interface'; // has or is using\r\nimport { val } from '../common/hof';\r\nimport { registerIgnoredTransitionHook } from '../hooks/ignoredTransition';\r\nimport { registerInvalidTransitionHook } from '../hooks/invalidTransition';\r\n\r\n/**\r\n * The default [[Transition]] options.\r\n *\r\n * Include this object when applying custom defaults:\r\n * let reloadOpts = { reload: true, notify: true }\r\n * let options = defaults(theirOpts, customDefaults, defaultOptions);\r\n */\r\nexport let defaultTransOpts: TransitionOptions = {\r\n location: true,\r\n relative: null,\r\n inherit: false,\r\n notify: true,\r\n reload: false,\r\n supercede: true,\r\n custom: {},\r\n current: () => null,\r\n source: 'unknown',\r\n};\r\n\r\n/**\r\n * Plugin API for Transition Service\r\n */\r\nexport interface TransitionServicePluginAPI {\r\n /**\r\n * Adds a Path to be used as a criterion against a TreeChanges path\r\n *\r\n * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.\r\n * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`\r\n * Each state in the exiting path is checked against the criteria and returned as part of the match.\r\n *\r\n * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.\r\n * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`\r\n * Only the tail of the `to` path is checked against the criteria and returned as part of the match.\r\n */\r\n _definePathType(name: string, hookScope: TransitionHookScope);\r\n\r\n /**\r\n * Gets a Path definition used as a criterion against a TreeChanges path\r\n */\r\n _getPathTypes(): PathTypes;\r\n\r\n /**\r\n * Defines a transition hook type and returns a transition hook registration\r\n * function (which can then be used to register hooks of this type).\r\n */\r\n _defineEvent(\r\n name: string,\r\n hookPhase: TransitionHookPhase,\r\n hookOrder: number,\r\n criteriaMatchPath: PathType,\r\n reverseSort?: boolean,\r\n getResultHandler?: GetResultHandler,\r\n getErrorHandler?: GetErrorHandler,\r\n rejectIfSuperseded?: boolean\r\n );\r\n\r\n /**\r\n * Returns the known event types, such as `onBefore`\r\n * If a phase argument is provided, returns only events for the given phase.\r\n */\r\n _getEvents(phase?: TransitionHookPhase): TransitionEventType[];\r\n\r\n /** Returns the hooks registered for the given hook name */\r\n getHooks(hookName: string): RegisteredHook[];\r\n}\r\n\r\n/**\r\n * This class provides services related to Transitions.\r\n *\r\n * - Most importantly, it allows global Transition Hooks to be registered.\r\n * - It allows the default transition error handler to be set.\r\n * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).\r\n *\r\n * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.\r\n *\r\n * This API is located at `router.transitionService` ([[UIRouter.transitionService]])\r\n */\r\nexport class TransitionService implements IHookRegistry, Disposable {\r\n /** @internal */\r\n _transitionCount = 0;\r\n\r\n /** @internal */\r\n public $view: ViewService;\r\n\r\n /** The transition hook types, such as `onEnter`, `onStart`, etc */\r\n private _eventTypes: TransitionEventType[] = [];\r\n /** @internal The registered transition hooks */\r\n _registeredHooks = {} as RegisteredHooks;\r\n /** The paths on a criteria object */\r\n private _criteriaPaths = {} as PathTypes;\r\n private _router: UIRouter;\r\n\r\n /** @internal */\r\n _pluginapi: TransitionServicePluginAPI;\r\n\r\n /**\r\n * This object has hook de-registration functions for the built-in hooks.\r\n * This can be used by third parties libraries that wish to customize the behaviors\r\n *\r\n * @internal\r\n */\r\n _deregisterHookFns: {\r\n addCoreResolves: Function;\r\n ignored: Function;\r\n invalid: Function;\r\n redirectTo: Function;\r\n onExit: Function;\r\n onRetain: Function;\r\n onEnter: Function;\r\n eagerResolve: Function;\r\n lazyResolve: Function;\r\n resolveAll: Function;\r\n loadViews: Function;\r\n activateViews: Function;\r\n updateGlobals: Function;\r\n updateUrl: Function;\r\n lazyLoad: Function;\r\n };\r\n\r\n /** @internal */\r\n constructor(_router: UIRouter) {\r\n this._router = _router;\r\n this.$view = _router.viewService;\r\n this._deregisterHookFns = <any>{};\r\n this._pluginapi = <TransitionServicePluginAPI>(\r\n createProxyFunctions(val(this), {}, val(this), [\r\n '_definePathType',\r\n '_defineEvent',\r\n '_getPathTypes',\r\n '_getEvents',\r\n 'getHooks',\r\n ])\r\n );\r\n\r\n this._defineCorePaths();\r\n this._defineCoreEvents();\r\n this._registerCoreTransitionHooks();\r\n _router.globals.successfulTransitions.onEvict(treeChangesCleanup);\r\n }\r\n\r\n /**\r\n * Registers a [[TransitionHookFn]], called *while a transition is being constructed*.\r\n *\r\n * Registers a transition lifecycle hook, which is invoked during transition construction.\r\n *\r\n * This low level hook should only be used by plugins.\r\n * This can be a useful time for plugins to add resolves or mutate the transition as needed.\r\n * The Sticky States plugin uses this hook to modify the treechanges.\r\n *\r\n * ### Lifecycle\r\n *\r\n * `onCreate` hooks are invoked *while a transition is being constructed*.\r\n *\r\n * ### Return value\r\n *\r\n * The hook's return value is ignored\r\n *\r\n * @internal\r\n * @param criteria defines which Transitions the Hook should be invoked for.\r\n * @param callback the hook function which will be invoked.\r\n * @param options the registration options\r\n * @returns a function which deregisters the hook.\r\n */\r\n onCreate(criteria: HookMatchCriteria, callback: TransitionCreateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onBefore(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onStart(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onExit(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onRetain(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onEnter(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onFinish(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onSuccess(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n /** @inheritdoc */\r\n onError(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\r\n return;\r\n }\r\n\r\n /**\r\n * dispose\r\n * @internal\r\n */\r\n dispose(router: UIRouter) {\r\n values(this._registeredHooks).forEach((hooksArray: RegisteredHook[]) =>\r\n hooksArray.forEach((hook) => {\r\n hook._deregistered = true;\r\n removeFrom(hooksArray, hook);\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Creates a new [[Transition]] object\r\n *\r\n * This is a factory function for creating new Transition objects.\r\n * It is used internally by the [[StateService]] and should generally not be called by application code.\r\n *\r\n * @internal\r\n * @param fromPath the path to the current state (the from state)\r\n * @param targetState the target state (destination)\r\n * @returns a Transition\r\n */\r\n create(fromPath: PathNode[], targetState: TargetState): Transition {\r\n return new Transition(fromPath, targetState, this._router);\r\n }\r\n\r\n /** @internal */\r\n private _defineCoreEvents() {\r\n const Phase = TransitionHookPhase;\r\n const TH = TransitionHook;\r\n const paths = this._criteriaPaths;\r\n const NORMAL_SORT = false,\r\n REVERSE_SORT = true;\r\n const SYNCHRONOUS = true;\r\n\r\n this._defineEvent(\r\n 'onCreate',\r\n Phase.CREATE,\r\n 0,\r\n paths.to,\r\n NORMAL_SORT,\r\n TH.LOG_REJECTED_RESULT,\r\n TH.THROW_ERROR,\r\n SYNCHRONOUS\r\n );\r\n\r\n this._defineEvent('onBefore', Phase.BEFORE, 0, paths.to);\r\n\r\n this._defineEvent('onStart', Phase.RUN, 0, paths.to);\r\n this._defineEvent('onExit', Phase.RUN, 100, paths.exiting, REVERSE_SORT);\r\n this._defineEvent('onRetain', Phase.RUN, 200, paths.retained);\r\n this._defineEvent('onEnter', Phase.RUN, 300, paths.entering);\r\n this._defineEvent('onFinish', Phase.RUN, 400, paths.to);\r\n\r\n this._defineEvent(\r\n 'onSuccess',\r\n Phase.SUCCESS,\r\n 0,\r\n paths.to,\r\n NORMAL_SORT,\r\n TH.LOG_REJECTED_RESULT,\r\n TH.LOG_ERROR,\r\n SYNCHRONOUS\r\n );\r\n this._defineEvent(\r\n 'onError',\r\n Phase.ERROR,\r\n 0,\r\n paths.to,\r\n NORMAL_SORT,\r\n TH.LOG_REJECTED_RESULT,\r\n TH.LOG_ERROR,\r\n SYNCHRONOUS\r\n );\r\n }\r\n\r\n /** @internal */\r\n private _defineCorePaths() {\r\n const { STATE, TRANSITION } = TransitionHookScope;\r\n\r\n this._definePathType('to', TRANSITION);\r\n this._definePathType('from', TRANSITION);\r\n this._definePathType('exiting', STATE);\r\n this._definePathType('retained', STATE);\r\n this._definePathType('entering', STATE);\r\n }\r\n\r\n /** @internal */\r\n _defineEvent(\r\n name: string,\r\n hookPhase: TransitionHookPhase,\r\n hookOrder: number,\r\n criteriaMatchPath: PathType,\r\n reverseSort = false,\r\n getResultHandler: GetResultHandler = TransitionHook.HANDLE_RESULT,\r\n getErrorHandler: GetErrorHandler = TransitionHook.REJECT_ERROR,\r\n synchronous = false\r\n ) {\r\n const eventType = new TransitionEventType(\r\n name,\r\n hookPhase,\r\n hookOrder,\r\n criteriaMatchPath,\r\n reverseSort,\r\n getResultHandler,\r\n getErrorHandler,\r\n synchronous\r\n );\r\n\r\n this._eventTypes.push(eventType);\r\n makeEvent(this, this, eventType);\r\n }\r\n\r\n /** @internal */\r\n private _getEvents(phase?: TransitionHookPhase): TransitionEventType[] {\r\n const transitionHookTypes = isDefined(phase)\r\n ? this._eventTypes.filter((type) => type.hookPhase === phase)\r\n : this._eventTypes.slice();\r\n\r\n return transitionHookTypes.sort((l, r) => {\r\n const cmpByPhase = l.hookPhase - r.hookPhase;\r\n return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase;\r\n });\r\n }\r\n\r\n /**\r\n * Adds a Path to be used as a criterion against a TreeChanges path\r\n *\r\n * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.\r\n * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`\r\n * Each state in the exiting path is checked against the criteria and returned as part of the match.\r\n *\r\n * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.\r\n * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`\r\n * Only the tail of the `to` path is checked against the criteria and returned as part of the match.\r\n *\r\n * @internal\r\n */\r\n private _definePathType(name: string, hookScope: TransitionHookScope) {\r\n this._criteriaPaths[name] = { name, scope: hookScope };\r\n }\r\n\r\n /** @internal */\r\n // tslint:disable-next-line\r\n private _getPathTypes(): PathTypes {\r\n return this._criteriaPaths;\r\n }\r\n\r\n /** @internal */\r\n public getHooks(hookName: string): RegisteredHook[] {\r\n return this._registeredHooks[hookName];\r\n }\r\n\r\n /** @internal */\r\n private _registerCoreTransitionHooks() {\r\n const fns = this._deregisterHookFns;\r\n\r\n fns.addCoreResolves = registerAddCoreResolvables(this);\r\n fns.ignored = registerIgnoredTransitionHook(this);\r\n fns.invalid = registerInvalidTransitionHook(this);\r\n\r\n // Wire up redirectTo hook\r\n fns.redirectTo = registerRedirectToHook(this);\r\n\r\n // Wire up onExit/Retain/Enter state hooks\r\n fns.onExit = registerOnExitHook(this);\r\n fns.onRetain = registerOnRetainHook(this);\r\n fns.onEnter = registerOnEnterHook(this);\r\n\r\n // Wire up Resolve hooks\r\n fns.eagerResolve = registerEagerResolvePath(this);\r\n fns.lazyResolve = registerLazyResolveState(this);\r\n fns.resolveAll = registerResolveRemaining(this);\r\n\r\n // Wire up the View management hooks\r\n fns.loadViews = registerLoadEnteringViews(this);\r\n fns.activateViews = registerActivateViews(this);\r\n\r\n // Updates global state after a transition\r\n fns.updateGlobals = registerUpdateGlobalState(this);\r\n\r\n // After globals.current is updated at priority: 10000\r\n fns.updateUrl = registerUpdateUrl(this);\r\n\r\n // Lazy load state trees\r\n fns.lazyLoad = registerLazyLoadHook(this);\r\n }\r\n}\r\n","import { Disposable } from '../interface';\r\nimport { UIRouter } from '../router';\r\nimport { ParamTypeDefinition, ParamTypes } from '../params';\r\nimport { isDefined, isString } from '../common';\r\n\r\n/**\r\n * An API to customize the URL behavior and retrieve URL configuration\r\n *\r\n * This API is used to customize the behavior of the URL.\r\n * This includes optional trailing slashes ([[strictMode]]), case sensitivity ([[caseInsensitive]]),\r\n * and custom parameter encoding (custom [[type]]).\r\n *\r\n * It also has information about the location (url) configuration such as [[port]] and [[baseHref]].\r\n * This information can be used to build absolute URLs, such as\r\n * `https://example.com:443/basepath/state/substate?param1=a#hashvalue`;\r\n *\r\n * This API is found at `router.urlService.config` (see: [[UIRouter.urlService]], [[URLService.config]])\r\n */\r\nexport class UrlConfig implements Disposable {\r\n /** @internal */ paramTypes = new ParamTypes();\r\n /** @internal */ _decodeParams = true;\r\n /** @internal */ _isCaseInsensitive = false;\r\n /** @internal */ _isStrictMode = true;\r\n /** @internal */ _defaultSquashPolicy: boolean | string = false;\r\n\r\n /** @internal */ constructor(/** @internal */ private router: UIRouter) {}\r\n /** @internal */ public dispose = () => this.paramTypes.dispose();\r\n\r\n // Delegate these calls to the current LocationConfig implementation\r\n\r\n /**\r\n * Gets the base Href, e.g., `http://localhost/approot/`\r\n *\r\n * @return the application's base href\r\n */\r\n public baseHref = (): string => this.router.locationConfig.baseHref();\r\n\r\n /**\r\n * Gets or sets the hashPrefix\r\n *\r\n * This only applies when not running in [[html5Mode]] (pushstate mode)\r\n *\r\n * If the current url is `http://localhost/app#!/uirouter/path/#anchor`, it returns `!` which is the prefix for the \"hashbang\" portion.\r\n *\r\n * @return the hash prefix\r\n */\r\n\r\n public hashPrefix = (newprefix?: string): string => this.router.locationConfig.hashPrefix(newprefix);\r\n /**\r\n * Gets the host, e.g., `localhost`\r\n *\r\n * @return the protocol\r\n */\r\n public host = (): string => this.router.locationConfig.host();\r\n\r\n /**\r\n * Returns true when running in pushstate mode\r\n *\r\n * @return true when running in html5 mode (pushstate mode).\r\n */\r\n public html5Mode = (): boolean => this.router.locationConfig.html5Mode();\r\n\r\n /**\r\n * Gets the port, e.g., `80`\r\n *\r\n * @return the port number\r\n */\r\n public port = (): number => this.router.locationConfig.port();\r\n\r\n /**\r\n * Gets the protocol, e.g., `http`\r\n *\r\n * @return the protocol\r\n */\r\n public protocol = (): string => this.router.locationConfig.protocol();\r\n\r\n /**\r\n * Defines whether URL matching should be case sensitive (the default behavior), or not.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Allow case insensitive url matches\r\n * urlService.config.caseInsensitive(true);\r\n * ```\r\n *\r\n * @param value `false` to match URL in a case sensitive manner; otherwise `true`;\r\n * @returns the current value of caseInsensitive\r\n */\r\n public caseInsensitive(value?: boolean): boolean {\r\n return (this._isCaseInsensitive = isDefined(value) ? value : this._isCaseInsensitive);\r\n }\r\n\r\n /**\r\n * Sets the default behavior when generating or matching URLs with default parameter values.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Remove default parameter values from the url\r\n * urlService.config.defaultSquashPolicy(true);\r\n * ```\r\n *\r\n * @param value A string that defines the default parameter URL squashing behavior.\r\n * - `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\r\n * - `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\r\n * parameter is surrounded by slashes, squash (remove) one slash from the URL\r\n * - any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\r\n * the parameter value from the URL and replace it with this string.\r\n * @returns the current value of defaultSquashPolicy\r\n */\r\n public defaultSquashPolicy(value?: boolean | string) {\r\n if (isDefined(value) && value !== true && value !== false && !isString(value))\r\n throw new Error(`Invalid squash policy: ${value}. Valid policies: false, true, arbitrary-string`);\r\n return (this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy);\r\n }\r\n\r\n /**\r\n * Defines whether URLs should match trailing slashes, or not (the default behavior).\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Allow optional trailing slashes\r\n * urlService.config.strictMode(false);\r\n * ```\r\n *\r\n * @param value `false` to match trailing slashes in URLs, otherwise `true`.\r\n * @returns the current value of strictMode\r\n */\r\n public strictMode(value?: boolean): boolean {\r\n return (this._isStrictMode = isDefined(value) ? value : this._isStrictMode);\r\n }\r\n\r\n /**\r\n * Creates and registers a custom [[ParamType]] object\r\n *\r\n * A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.\r\n *\r\n * #### Note: Register custom types *before using them* in a state definition.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Encode object parameter as JSON string\r\n * urlService.config.type('myjson', {\r\n * encode: (obj) => JSON.stringify(obj),\r\n * decode: (str) => JSON.parse(str),\r\n * is: (val) => typeof(val) === 'object',\r\n * pattern: /[^/]+/,\r\n * equals: (a, b) => _.isEqual(a, b),\r\n * });\r\n * ```\r\n *\r\n * See [[ParamTypeDefinition]] for more examples\r\n *\r\n * @param name The type name.\r\n * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.\r\n * @param definitionFn A function that is injected before the app runtime starts.\r\n * The result of this function should be a [[ParamTypeDefinition]].\r\n * The result is merged into the existing `definition`.\r\n * See [[ParamType]] for information on the values accepted.\r\n *\r\n * @returns if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined\r\n */\r\n type(name: string, definition?: ParamTypeDefinition, definitionFn?: () => ParamTypeDefinition) {\r\n const type = this.paramTypes.type(name, definition, definitionFn);\r\n return !isDefined(definition) ? type : this;\r\n }\r\n}\r\n","import { map, inherit, identity, unnest, tail, find, Obj, allTrueR, unnestR, arrayTuples } from '../common/common';\r\nimport { prop, propEq } from '../common/hof';\r\nimport { isArray, isString, isDefined } from '../common/predicates';\r\nimport { Param, DefType } from '../params/param';\r\nimport { ParamTypes } from '../params/paramTypes';\r\nimport { RawParams } from '../params/interface';\r\nimport { UrlMatcherCompileConfig } from './interface';\r\nimport { joinNeighborsR, splitOnDelim } from '../common/strings';\r\nimport { ParamType } from '../params';\r\nimport { defaults } from '../common';\r\nimport { ParamFactory } from './urlMatcherFactory';\r\n\r\nfunction quoteRegExp(str: any, param?: any) {\r\n let surroundPattern = ['', ''],\r\n result = str.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, '\\\\$&');\r\n if (!param) return result;\r\n\r\n switch (param.squash) {\r\n case false:\r\n surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')];\r\n break;\r\n case true:\r\n result = result.replace(/\\/$/, '');\r\n surroundPattern = ['(?:/(', ')|/)?'];\r\n break;\r\n default:\r\n surroundPattern = [`(${param.squash}|`, ')?'];\r\n break;\r\n }\r\n return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1];\r\n}\r\n\r\nconst memoizeTo = (obj: Obj, _prop: string, fn: Function) => (obj[_prop] = obj[_prop] || fn());\r\n\r\nconst splitOnSlash = splitOnDelim('/');\r\n\r\ninterface UrlMatcherCache {\r\n segments?: any[];\r\n weights?: number[];\r\n path?: UrlMatcher[];\r\n parent?: UrlMatcher;\r\n pattern?: RegExp;\r\n}\r\n\r\ninterface MatchDetails {\r\n id: string;\r\n regexp: string;\r\n segment: string;\r\n type: ParamType;\r\n}\r\n\r\nconst defaultConfig: UrlMatcherCompileConfig = {\r\n state: { params: {} },\r\n strict: true,\r\n caseInsensitive: true,\r\n decodeParams: true,\r\n};\r\n\r\n/**\r\n * Matches URLs against patterns.\r\n *\r\n * Matches URLs against patterns and extracts named parameters from the path or the search\r\n * part of the URL.\r\n *\r\n * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)\r\n * parameters. Multiple search parameter names are separated by '&'. Search parameters\r\n * do not influence whether or not a URL is matched, but their values are passed through into\r\n * the matched parameters returned by [[UrlMatcher.exec]].\r\n *\r\n * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`)\r\n * or colon placeholders (`/somePath/:param`).\r\n *\r\n * - *A parameter RegExp* may be defined for a param after a colon\r\n * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder.\r\n * The regexp must match for the url to be matched.\r\n * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\r\n *\r\n * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]].\r\n *\r\n * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters.\r\n * See [[UrlMatcherFactory.type]] for more information.\r\n *\r\n * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`).\r\n * A catch-all * parameter value will contain the remainder of the URL.\r\n *\r\n * ---\r\n *\r\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\r\n * must be unique within the pattern (across both path and search parameters).\r\n * A path parameter matches any number of characters other than '/'. For catch-all\r\n * placeholders the path parameter matches any number of characters.\r\n *\r\n * Examples:\r\n *\r\n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\r\n * trailing slashes, and patterns have to match the entire path, not just a prefix.\r\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\r\n * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\r\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\r\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\r\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\r\n * parameter consists of 1 to 8 hex digits.\r\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\r\n * path into the parameter 'path'.\r\n * * `'/files/*path'` - ditto.\r\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\r\n * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start\r\n *\r\n */\r\nexport class UrlMatcher {\r\n /** @internal */\r\n static nameValidator: RegExp = /^\\w+([-.]+\\w+)*(?:\\[\\])?$/;\r\n\r\n /** @internal */\r\n private _cache: UrlMatcherCache = { path: [this] };\r\n /** @internal */\r\n private _children: UrlMatcher[] = [];\r\n /** @internal */\r\n private _params: Param[] = [];\r\n /** @internal */\r\n private _segments: string[] = [];\r\n /** @internal */\r\n private _compiled: string[] = [];\r\n /** @internal */\r\n private readonly config: UrlMatcherCompileConfig;\r\n\r\n /** The pattern that was passed into the constructor */\r\n public pattern: string;\r\n\r\n /** @internal */\r\n static encodeDashes(str: string) {\r\n // Replace dashes with encoded \"\\-\"\r\n return encodeURIComponent(str).replace(/-/g, (c) => `%5C%${c.charCodeAt(0).toString(16).toUpperCase()}`);\r\n }\r\n\r\n /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */\r\n static pathSegmentsAndParams(matcher: UrlMatcher) {\r\n const staticSegments = matcher._segments;\r\n const pathParams = matcher._params.filter((p) => p.location === DefType.PATH);\r\n return arrayTuples(staticSegments, pathParams.concat(undefined))\r\n .reduce(unnestR, [])\r\n .filter((x) => x !== '' && isDefined(x));\r\n }\r\n\r\n /** @internal Given a matcher, return an array with the matcher's query params */\r\n static queryParams(matcher: UrlMatcher): Param[] {\r\n return matcher._params.filter((p) => p.location === DefType.SEARCH);\r\n }\r\n\r\n /**\r\n * Compare two UrlMatchers\r\n *\r\n * This comparison function converts a UrlMatcher into static and dynamic path segments.\r\n * Each static path segment is a static string between a path separator (slash character).\r\n * Each dynamic segment is a path parameter.\r\n *\r\n * The comparison function sorts static segments before dynamic ones.\r\n */\r\n static compare(a: UrlMatcher, b: UrlMatcher): number {\r\n /**\r\n * Turn a UrlMatcher and all its parent matchers into an array\r\n * of slash literals '/', string literals, and Param objects\r\n *\r\n * This example matcher matches strings like \"/foo/:param/tail\":\r\n * var matcher = $umf.compile(\"/foo\").append($umf.compile(\"/:param\")).append($umf.compile(\"/\")).append($umf.compile(\"tail\"));\r\n * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ]\r\n *\r\n * Caches the result as `matcher._cache.segments`\r\n */\r\n const segments = (matcher: UrlMatcher) =>\r\n (matcher._cache.segments =\r\n matcher._cache.segments ||\r\n matcher._cache.path\r\n .map(UrlMatcher.pathSegmentsAndParams)\r\n .reduce(unnestR, [])\r\n .reduce(joinNeighborsR, [])\r\n .map((x) => (isString(x) ? splitOnSlash(x) : x))\r\n .reduce(unnestR, []));\r\n\r\n /**\r\n * Gets the sort weight for each segment of a UrlMatcher\r\n *\r\n * Caches the result as `matcher._cache.weights`\r\n */\r\n const weights = (matcher: UrlMatcher) =>\r\n (matcher._cache.weights =\r\n matcher._cache.weights ||\r\n segments(matcher).map((segment) => {\r\n // Sort slashes first, then static strings, the Params\r\n if (segment === '/') return 1;\r\n if (isString(segment)) return 2;\r\n if (segment instanceof Param) return 3;\r\n }));\r\n\r\n /**\r\n * Pads shorter array in-place (mutates)\r\n */\r\n const padArrays = (l: any[], r: any[], padVal: any) => {\r\n const len = Math.max(l.length, r.length);\r\n while (l.length < len) l.push(padVal);\r\n while (r.length < len) r.push(padVal);\r\n };\r\n\r\n const weightsA = weights(a),\r\n weightsB = weights(b);\r\n padArrays(weightsA, weightsB, 0);\r\n\r\n const _pairs = arrayTuples(weightsA, weightsB);\r\n let cmp, i;\r\n\r\n for (i = 0; i < _pairs.length; i++) {\r\n cmp = _pairs[i][0] - _pairs[i][1];\r\n if (cmp !== 0) return cmp;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n /**\r\n * @param pattern The pattern to compile into a matcher.\r\n * @param paramTypes The [[ParamTypes]] registry\r\n * @param paramFactory A [[ParamFactory]] object\r\n * @param config A [[UrlMatcherCompileConfig]] configuration object\r\n */\r\n constructor(pattern: string, paramTypes: ParamTypes, paramFactory: ParamFactory, config?: UrlMatcherCompileConfig) {\r\n this.config = config = defaults(config, defaultConfig);\r\n this.pattern = pattern;\r\n\r\n // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\r\n // '*' name\r\n // ':' name\r\n // '{' name '}'\r\n // '{' name ':' regexp '}'\r\n // The regular expression is somewhat complicated due to the need to allow curly braces\r\n // inside the regular expression. The placeholder regexp breaks down as follows:\r\n // ([:*])([\\w\\[\\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)\r\n // \\{([\\w\\[\\]]+)(?:\\:\\s*( ... ))?\\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\r\n // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either\r\n // [^{}\\\\]+ - anything other than curly braces or backslash\r\n // \\\\. - a backslash escape\r\n // \\{(?:[^{}\\\\]+|\\\\.)*\\} - a matched set of curly braces containing other atoms\r\n const placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\r\n const searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\r\n const patterns: any[][] = [];\r\n let last = 0;\r\n let matchArray: RegExpExecArray;\r\n\r\n const checkParamErrors = (id: string) => {\r\n if (!UrlMatcher.nameValidator.test(id)) throw new Error(`Invalid parameter name '${id}' in pattern '${pattern}'`);\r\n if (find(this._params, propEq('id', id)))\r\n throw new Error(`Duplicate parameter name '${id}' in pattern '${pattern}'`);\r\n };\r\n\r\n // Split into static segments separated by path parameter placeholders.\r\n // The number of segments is always 1 more than the number of parameters.\r\n const matchDetails = (m: RegExpExecArray, isSearch: boolean): MatchDetails => {\r\n // IE[78] returns '' for unmatched groups instead of null\r\n const id: string = m[2] || m[3];\r\n const regexp: string = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\\\s\\\\S]*' : null);\r\n\r\n const makeRegexpType = (str) =>\r\n inherit(paramTypes.type(isSearch ? 'query' : 'path'), {\r\n pattern: new RegExp(str, this.config.caseInsensitive ? 'i' : undefined),\r\n });\r\n\r\n return {\r\n id,\r\n regexp,\r\n segment: pattern.substring(last, m.index),\r\n type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp),\r\n };\r\n };\r\n\r\n let details: MatchDetails;\r\n let segment: string;\r\n\r\n // tslint:disable-next-line:no-conditional-assignment\r\n while ((matchArray = placeholder.exec(pattern))) {\r\n details = matchDetails(matchArray, false);\r\n if (details.segment.indexOf('?') >= 0) break; // we're into the search part\r\n\r\n checkParamErrors(details.id);\r\n this._params.push(paramFactory.fromPath(details.id, details.type, config.state));\r\n this._segments.push(details.segment);\r\n patterns.push([details.segment, tail(this._params)]);\r\n last = placeholder.lastIndex;\r\n }\r\n segment = pattern.substring(last);\r\n\r\n // Find any search parameter names and remove them from the last segment\r\n const i = segment.indexOf('?');\r\n\r\n if (i >= 0) {\r\n const search = segment.substring(i);\r\n segment = segment.substring(0, i);\r\n\r\n if (search.length > 0) {\r\n last = 0;\r\n\r\n // tslint:disable-next-line:no-conditional-assignment\r\n while ((matchArray = searchPlaceholder.exec(search))) {\r\n details = matchDetails(matchArray, true);\r\n checkParamErrors(details.id);\r\n this._params.push(paramFactory.fromSearch(details.id, details.type, config.state));\r\n last = placeholder.lastIndex;\r\n // check if ?&\r\n }\r\n }\r\n }\r\n\r\n this._segments.push(segment);\r\n this._compiled = patterns.map((_pattern) => quoteRegExp.apply(null, _pattern)).concat(quoteRegExp(segment));\r\n }\r\n\r\n /**\r\n * Creates a new concatenated UrlMatcher\r\n *\r\n * Builds a new UrlMatcher by appending another UrlMatcher to this one.\r\n *\r\n * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.\r\n */\r\n append(url: UrlMatcher): UrlMatcher {\r\n this._children.push(url);\r\n url._cache = {\r\n path: this._cache.path.concat(url),\r\n parent: this,\r\n pattern: null,\r\n };\r\n return url;\r\n }\r\n\r\n /** @internal */\r\n isRoot(): boolean {\r\n return this._cache.path[0] === this;\r\n }\r\n\r\n /** Returns the input pattern string */\r\n toString(): string {\r\n return this.pattern;\r\n }\r\n\r\n private _getDecodedParamValue(value: any, param: Param): any {\r\n if (isDefined(value)) {\r\n if (this.config.decodeParams && !param.type.raw) {\r\n if (isArray(value)) {\r\n value = value.map((paramValue) => decodeURIComponent(paramValue));\r\n } else {\r\n value = decodeURIComponent(value);\r\n }\r\n }\r\n\r\n value = param.type.decode(value);\r\n }\r\n\r\n return param.value(value);\r\n }\r\n\r\n /**\r\n * Tests the specified url/path against this matcher.\r\n *\r\n * Tests if the given url matches this matcher's pattern, and returns an object containing the captured\r\n * parameter values. Returns null if the path does not match.\r\n *\r\n * The returned object contains the values\r\n * of any search parameters that are mentioned in the pattern, but their value may be null if\r\n * they are not present in `search`. This means that search parameters are always treated\r\n * as optional.\r\n *\r\n * #### Example:\r\n * ```js\r\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\r\n * x: '1', q: 'hello'\r\n * });\r\n * // returns { id: 'bob', q: 'hello', r: null }\r\n * ```\r\n *\r\n * @param path The URL path to match, e.g. `$location.path()`.\r\n * @param search URL search parameters, e.g. `$location.search()`.\r\n * @param hash URL hash e.g. `$location.hash()`.\r\n * @param options\r\n *\r\n * @returns The captured parameter values.\r\n */\r\n exec(path: string, search: any = {}, hash?: string, options: any = {}): RawParams {\r\n const match = memoizeTo(this._cache, 'pattern', () => {\r\n return new RegExp(\r\n [\r\n '^',\r\n unnest(this._cache.path.map(prop('_compiled'))).join(''),\r\n this.config.strict === false ? '/?' : '',\r\n '$',\r\n ].join(''),\r\n this.config.caseInsensitive ? 'i' : undefined\r\n );\r\n }).exec(path);\r\n\r\n if (!match) return null;\r\n\r\n // options = defaults(options, { isolate: false });\r\n\r\n const allParams: Param[] = this.parameters(),\r\n pathParams: Param[] = allParams.filter((param) => !param.isSearch()),\r\n searchParams: Param[] = allParams.filter((param) => param.isSearch()),\r\n nPathSegments = this._cache.path.map((urlm) => urlm._segments.length - 1).reduce((a, x) => a + x),\r\n values: RawParams = {};\r\n\r\n if (nPathSegments !== match.length - 1) throw new Error(`Unbalanced capture group in route '${this.pattern}'`);\r\n\r\n function decodePathArray(paramVal: string) {\r\n const reverseString = (str: string) => str.split('').reverse().join('');\r\n const unquoteDashes = (str: string) => str.replace(/\\\\-/g, '-');\r\n\r\n const split = reverseString(paramVal).split(/-(?!\\\\)/);\r\n const allReversed = map(split, reverseString);\r\n return map(allReversed, unquoteDashes).reverse();\r\n }\r\n\r\n for (let i = 0; i < nPathSegments; i++) {\r\n const param: Param = pathParams[i];\r\n let value: any | any[] = match[i + 1];\r\n\r\n // if the param value matches a pre-replace pair, replace the value before decoding.\r\n for (let j = 0; j < param.replace.length; j++) {\r\n if (param.replace[j].from === value) value = param.replace[j].to;\r\n }\r\n\r\n if (value && param.array === true) value = decodePathArray(value);\r\n\r\n values[param.id] = this._getDecodedParamValue(value, param);\r\n }\r\n searchParams.forEach((param: Param) => {\r\n let value = search[param.id];\r\n\r\n for (let j = 0; j < param.replace.length; j++) {\r\n if (param.replace[j].from === value) value = param.replace[j].to;\r\n }\r\n\r\n values[param.id] = this._getDecodedParamValue(value, param);\r\n });\r\n\r\n if (hash) values['#'] = hash;\r\n\r\n return values;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.\r\n *\r\n * @returns {Array.<Param>} An array of [[Param]] objects. Must be treated as read-only. If the\r\n * pattern has no parameters, an empty array is returned.\r\n */\r\n parameters(opts: any = {}): Param[] {\r\n if (opts.inherit === false) return this._params;\r\n return unnest(this._cache.path.map((matcher) => matcher._params));\r\n }\r\n\r\n /**\r\n * @internal\r\n * Returns a single parameter from this UrlMatcher by id\r\n *\r\n * @param id\r\n * @param opts\r\n * @returns {T|Param|any|boolean|UrlMatcher|null}\r\n */\r\n parameter(id: string, opts: any = {}): Param {\r\n const findParam = () => {\r\n for (const param of this._params) {\r\n if (param.id === id) return param;\r\n }\r\n };\r\n\r\n const parent = this._cache.parent;\r\n return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null;\r\n }\r\n\r\n /**\r\n * Validates the input parameter values against this UrlMatcher\r\n *\r\n * Checks an object hash of parameters to validate their correctness according to the parameter\r\n * types of this `UrlMatcher`.\r\n *\r\n * @param params The object hash of parameters to validate.\r\n * @returns Returns `true` if `params` validates, otherwise `false`.\r\n */\r\n validates(params: RawParams): boolean {\r\n const validParamVal = (param: Param, val: any) => !param || param.validates(val);\r\n\r\n params = params || {};\r\n\r\n // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher\r\n const paramSchema = this.parameters().filter((paramDef) => params.hasOwnProperty(paramDef.id));\r\n return paramSchema.map((paramDef) => validParamVal(paramDef, params[paramDef.id])).reduce(allTrueR, true);\r\n }\r\n\r\n /**\r\n * Given a set of parameter values, creates a URL from this UrlMatcher.\r\n *\r\n * Creates a URL that matches this pattern by substituting the specified values\r\n * for the path and search parameters.\r\n *\r\n * #### Example:\r\n * ```js\r\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\r\n * // returns '/user/bob?q=yes'\r\n * ```\r\n *\r\n * @param values the values to substitute for the parameters in this pattern.\r\n * @returns the formatted URL (path and optionally search part).\r\n */\r\n format(values: RawParams = {}) {\r\n // Build the full path of UrlMatchers (including all parent UrlMatchers)\r\n const urlMatchers = this._cache.path;\r\n\r\n // Extract all the static segments and Params (processed as ParamDetails)\r\n // into an ordered array\r\n const pathSegmentsAndParams: Array<string | ParamDetails> = urlMatchers\r\n .map(UrlMatcher.pathSegmentsAndParams)\r\n .reduce(unnestR, [])\r\n .map((x) => (isString(x) ? x : getDetails(x)));\r\n\r\n // Extract the query params into a separate array\r\n const queryParams: Array<ParamDetails> = urlMatchers\r\n .map(UrlMatcher.queryParams)\r\n .reduce(unnestR, [])\r\n .map(getDetails);\r\n\r\n const isInvalid = (param: ParamDetails) => param.isValid === false;\r\n if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Given a Param, applies the parameter value, then returns detailed information about it\r\n */\r\n function getDetails(param: Param): ParamDetails {\r\n // Normalize to typed value\r\n const value = param.value(values[param.id]);\r\n const isValid = param.validates(value);\r\n const isDefaultValue = param.isDefaultValue(value);\r\n // Check if we're in squash mode for the parameter\r\n const squash = isDefaultValue ? param.squash : false;\r\n // Allow the Parameter's Type to encode the value\r\n const encoded = param.type.encode(value);\r\n\r\n return { param, value, isValid, isDefaultValue, squash, encoded };\r\n }\r\n\r\n // Build up the path-portion from the list of static segments and parameters\r\n const pathString = pathSegmentsAndParams.reduce((acc: string, x: string | ParamDetails) => {\r\n // The element is a static segment (a raw string); just append it\r\n if (isString(x)) return acc + x;\r\n\r\n // Otherwise, it's a ParamDetails.\r\n const { squash, encoded, param } = x;\r\n\r\n // If squash is === true, try to remove a slash from the path\r\n if (squash === true) return acc.match(/\\/$/) ? acc.slice(0, -1) : acc;\r\n // If squash is a string, use the string for the param value\r\n if (isString(squash)) return acc + squash;\r\n if (squash !== false) return acc; // ?\r\n if (encoded == null) return acc;\r\n // If this parameter value is an array, encode the value using encodeDashes\r\n if (isArray(encoded)) return acc + map(<string[]>encoded, UrlMatcher.encodeDashes).join('-');\r\n // If the parameter type is \"raw\", then do not encodeURIComponent\r\n if (param.raw) return acc + encoded;\r\n // Encode the value\r\n return acc + encodeURIComponent(<string>encoded);\r\n }, '');\r\n\r\n // Build the query string by applying parameter values (array or regular)\r\n // then mapping to key=value, then flattening and joining using \"&\"\r\n const queryString = queryParams\r\n .map((paramDetails: ParamDetails) => {\r\n let { param, squash, encoded, isDefaultValue } = paramDetails;\r\n if (encoded == null || (isDefaultValue && squash !== false)) return;\r\n if (!isArray(encoded)) encoded = [<string>encoded];\r\n if (encoded.length === 0) return;\r\n if (!param.raw) encoded = map(<string[]>encoded, encodeURIComponent);\r\n\r\n return (<string[]>encoded).map((val) => `${param.id}=${val}`);\r\n })\r\n .filter(identity)\r\n .reduce(unnestR, [])\r\n .join('&');\r\n\r\n // Concat the pathstring with the queryString (if exists) and the hashString (if exists)\r\n return pathString + (queryString ? `?${queryString}` : '') + (values['#'] ? '#' + values['#'] : '');\r\n }\r\n}\r\n\r\n/** @internal */\r\ninterface ParamDetails {\r\n param: Param;\r\n value: any;\r\n isValid: boolean;\r\n isDefaultValue: boolean;\r\n squash: boolean | string;\r\n encoded: string | string[];\r\n}\r\n","import { extend, forEach, isDefined, isFunction, isObject } from '../common';\r\nimport { UrlMatcher } from './urlMatcher';\r\nimport { DefType, Param, ParamType, ParamTypeDefinition } from '../params';\r\nimport { UrlMatcherCompileConfig } from './interface';\r\nimport { StateDeclaration } from '../state';\r\nimport { UIRouter } from '../router';\r\n\r\nexport class ParamFactory {\r\n fromConfig(id: string, type: ParamType, state: StateDeclaration) {\r\n return new Param(id, type, DefType.CONFIG, this.router.urlService.config, state);\r\n }\r\n\r\n fromPath(id: string, type: ParamType, state: StateDeclaration) {\r\n return new Param(id, type, DefType.PATH, this.router.urlService.config, state);\r\n }\r\n\r\n fromSearch(id: string, type: ParamType, state: StateDeclaration) {\r\n return new Param(id, type, DefType.SEARCH, this.router.urlService.config, state);\r\n }\r\n\r\n constructor(private router: UIRouter) {}\r\n}\r\n\r\n/**\r\n * Factory for [[UrlMatcher]] instances.\r\n *\r\n * The factory is available to ng1 services as\r\n * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.\r\n */\r\nexport class UrlMatcherFactory {\r\n /** Creates a new [[Param]] for a given location (DefType) */\r\n paramFactory = new ParamFactory(this.router);\r\n // TODO: Check if removal of this will break anything, then remove these\r\n UrlMatcher: typeof UrlMatcher = UrlMatcher;\r\n Param: typeof Param = Param;\r\n\r\n // TODO: move implementations to UrlConfig (urlService.config)\r\n constructor(/** @internal */ private router: UIRouter) {}\r\n\r\n /**\r\n * Creates a [[UrlMatcher]] for the specified pattern.\r\n *\r\n * @param pattern The URL pattern.\r\n * @param config The config object hash.\r\n * @returns The UrlMatcher.\r\n */\r\n compile(pattern: string, config?: UrlMatcherCompileConfig) {\r\n const urlConfig = this.router.urlService.config;\r\n // backward-compatible support for config.params -> config.state.params\r\n const params = config && !config.state && (config as any).params;\r\n config = params ? { state: { params }, ...config } : config;\r\n const globalConfig: UrlMatcherCompileConfig = {\r\n strict: urlConfig._isStrictMode,\r\n caseInsensitive: urlConfig._isCaseInsensitive,\r\n decodeParams: urlConfig._decodeParams,\r\n };\r\n return new UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, extend(globalConfig, config));\r\n }\r\n\r\n /**\r\n * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.\r\n *\r\n * @param object The object to perform the type check against.\r\n * @returns `true` if the object matches the `UrlMatcher` interface, by\r\n * implementing all the same methods.\r\n */\r\n isMatcher(object: any): boolean {\r\n // TODO: typeof?\r\n if (!isObject(object)) return false;\r\n let result = true;\r\n\r\n forEach(UrlMatcher.prototype, (val, name) => {\r\n if (isFunction(val)) result = result && isDefined(object[name]) && isFunction(object[name]);\r\n });\r\n return result;\r\n }\r\n\r\n /** @internal */\r\n $get() {\r\n const urlConfig = this.router.urlService.config;\r\n urlConfig.paramTypes.enqueue = false;\r\n urlConfig.paramTypes._flushTypeQueue();\r\n return this;\r\n }\r\n\r\n /** @deprecated use [[UrlConfig.caseInsensitive]] */\r\n caseInsensitive = (value?: boolean) => this.router.urlService.config.caseInsensitive(value);\r\n\r\n /** @deprecated use [[UrlConfig.defaultSquashPolicy]] */\r\n defaultSquashPolicy = (value?: boolean | string) => this.router.urlService.config.defaultSquashPolicy(value);\r\n\r\n /** @deprecated use [[UrlConfig.strictMode]] */\r\n strictMode = (value?: boolean) => this.router.urlService.config.strictMode(value);\r\n\r\n /** @deprecated use [[UrlConfig.type]] */\r\n type = (name: string, definition?: ParamTypeDefinition, definitionFn?: () => ParamTypeDefinition) => {\r\n return this.router.urlService.config.type(name, definition, definitionFn) || this;\r\n };\r\n}\r\n","import { stripLastPathElement } from '../common';\r\nimport { UrlMatcher } from './urlMatcher';\r\nimport { RawParams } from '../params';\r\nimport { UIRouter } from '../router';\r\nimport { UrlRuleFactory } from './urlRule';\r\nimport { MatchResult, UrlParts, UrlRule, UrlRuleHandlerFn } from './interface';\r\nimport { TargetState, TargetStateDef } from '../state';\r\n\r\nfunction appendBasePath(url: string, isHtml5: boolean, absolute: boolean, baseHref: string): string {\r\n if (baseHref === '/') return url;\r\n if (isHtml5) return stripLastPathElement(baseHref) + url;\r\n if (absolute) return baseHref.slice(1) + url;\r\n return url;\r\n}\r\n\r\n/**\r\n * Updates URL and responds to URL changes\r\n *\r\n * ### Deprecation warning:\r\n * This class is now considered to be an internal API\r\n * Use the [[UrlService]] instead.\r\n * For configuring URL rules, use the [[UrlRules]] which can be found as [[UrlService.rules]].\r\n */\r\nexport class UrlRouter {\r\n /** used to create [[UrlRule]] objects for common cases */\r\n public urlRuleFactory: UrlRuleFactory;\r\n /** @internal */ private location: string;\r\n\r\n /** @internal */\r\n constructor(/** @internal */ private router: UIRouter) {\r\n this.urlRuleFactory = new UrlRuleFactory(router);\r\n }\r\n\r\n /** Internal API. */\r\n update(read?: boolean) {\r\n const $url = this.router.locationService;\r\n if (read) {\r\n this.location = $url.url();\r\n return;\r\n }\r\n if ($url.url() === this.location) return;\r\n\r\n $url.url(this.location, true);\r\n }\r\n\r\n /**\r\n * Internal API.\r\n *\r\n * Pushes a new location to the browser history.\r\n *\r\n * @internal\r\n * @param urlMatcher\r\n * @param params\r\n * @param options\r\n */\r\n push(urlMatcher: UrlMatcher, params?: RawParams, options?: { replace?: string | boolean }) {\r\n const replace = options && !!options.replace;\r\n this.router.urlService.url(urlMatcher.format(params || {}), replace);\r\n }\r\n\r\n /**\r\n * Builds and returns a URL with interpolated parameters\r\n *\r\n * #### Example:\r\n * ```js\r\n * matcher = $umf.compile(\"/about/:person\");\r\n * params = { person: \"bob\" };\r\n * $bob = $urlRouter.href(matcher, params);\r\n * // $bob == \"/about/bob\";\r\n * ```\r\n *\r\n * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.\r\n * @param params An object of parameter values to fill the matcher's required parameters.\r\n * @param options Options object. The options are:\r\n *\r\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\r\n *\r\n * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\r\n */\r\n href(urlMatcher: UrlMatcher, params?: any, options?: { absolute: boolean }): string {\r\n let url = urlMatcher.format(params);\r\n if (url == null) return null;\r\n\r\n options = options || { absolute: false };\r\n\r\n const cfg = this.router.urlService.config;\r\n const isHtml5 = cfg.html5Mode();\r\n if (!isHtml5 && url !== null) {\r\n url = '#' + cfg.hashPrefix() + url;\r\n }\r\n url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref());\r\n\r\n if (!options.absolute || !url) {\r\n return url;\r\n }\r\n\r\n const slash = !isHtml5 && url ? '/' : '';\r\n const cfgPort = cfg.port();\r\n const port = <any>(cfgPort === 80 || cfgPort === 443 ? '' : ':' + cfgPort);\r\n\r\n return [cfg.protocol(), '://', cfg.host(), port, slash, url].join('');\r\n }\r\n\r\n // Delegate these calls to [[UrlService]]\r\n /** @deprecated use [[UrlService.sync]]*/\r\n public sync = (evt?) => this.router.urlService.sync(evt);\r\n /** @deprecated use [[UrlService.listen]]*/\r\n public listen = (enabled?: boolean): Function => this.router.urlService.listen(enabled);\r\n /** @deprecated use [[UrlService.deferIntercept]]*/\r\n public deferIntercept = (defer?: boolean) => this.router.urlService.deferIntercept(defer);\r\n /** @deprecated use [[UrlService.interceptDeferred]]*/\r\n public get interceptDeferred() {\r\n return this.router.urlService.interceptDeferred;\r\n }\r\n /** @deprecated use [[UrlService.match]]*/\r\n public match = (urlParts: UrlParts): MatchResult => this.router.urlService.match(urlParts);\r\n\r\n // Delegate these calls to [[UrlRules]]\r\n /** @deprecated use [[UrlRules.initial]]*/\r\n public initial = (handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef): void =>\r\n this.router.urlService.rules.initial(handler);\r\n /** @deprecated use [[UrlRules.otherwise]]*/\r\n public otherwise = (handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef): void =>\r\n this.router.urlService.rules.otherwise(handler);\r\n /** @deprecated use [[UrlRules.removeRule]]*/\r\n public removeRule = (rule: UrlRule): void => this.router.urlService.rules.removeRule(rule);\r\n /** @deprecated use [[UrlRules.rule]]*/\r\n public rule = (rule: UrlRule): Function => this.router.urlService.rules.rule(rule);\r\n /** @deprecated use [[UrlRules.rules]]*/\r\n public rules = (): UrlRule[] => this.router.urlService.rules.rules();\r\n /** @deprecated use [[UrlRules.sort]]*/\r\n public sort = (compareFn?: (a: UrlRule, b: UrlRule) => number) => this.router.urlService.rules.sort(compareFn);\r\n /** @deprecated use [[UrlRules.when]]*/\r\n public when = (\r\n matcher: RegExp | UrlMatcher | string,\r\n handler: string | UrlRuleHandlerFn,\r\n options?: { priority: number }\r\n ): UrlRule => this.router.urlService.rules.when(matcher, handler, options);\r\n}\r\n","import { StateDeclaration } from '../state';\r\nimport { UrlMatcher } from './urlMatcher';\r\nimport { isString, isDefined, isFunction } from '../common/predicates';\r\nimport { UIRouter } from '../router';\r\nimport { identity, extend } from '../common/common';\r\nimport { is, or, pattern } from '../common/hof';\r\nimport { StateObject } from '../state/stateObject';\r\nimport { RawParams } from '../params/interface';\r\nimport {\r\n UrlRule,\r\n UrlRuleMatchFn,\r\n UrlRuleHandlerFn,\r\n UrlRuleType,\r\n UrlParts,\r\n MatcherUrlRule,\r\n StateRule,\r\n RegExpRule,\r\n} from './interface';\r\n\r\n/**\r\n * Creates a [[UrlRule]]\r\n *\r\n * Creates a [[UrlRule]] from a:\r\n *\r\n * - `string`\r\n * - [[UrlMatcher]]\r\n * - `RegExp`\r\n * - [[StateObject]]\r\n */\r\nexport class UrlRuleFactory {\r\n static isUrlRule = (obj) => obj && ['type', 'match', 'handler'].every((key) => isDefined(obj[key]));\r\n\r\n constructor(public router: UIRouter) {}\r\n\r\n compile(str: string) {\r\n return this.router.urlMatcherFactory.compile(str);\r\n }\r\n\r\n create(\r\n what: string | UrlMatcher | StateObject | StateDeclaration | RegExp | UrlRuleMatchFn,\r\n handler?: string | UrlRuleHandlerFn\r\n ): UrlRule {\r\n const { isState, isStateDeclaration } = StateObject;\r\n const makeRule = pattern([\r\n [isString, (_what: string) => makeRule(this.compile(_what))],\r\n [is(UrlMatcher), (_what: UrlMatcher) => this.fromUrlMatcher(_what, handler)],\r\n [or(isState, isStateDeclaration), (_what: StateObject | StateDeclaration) => this.fromState(_what, this.router)],\r\n [is(RegExp), (_what: RegExp) => this.fromRegExp(_what, handler)],\r\n [isFunction, (_what: UrlRuleMatchFn) => new BaseUrlRule(_what, handler as UrlRuleHandlerFn)],\r\n ]);\r\n\r\n const rule = makeRule(what);\r\n if (!rule) throw new Error(\"invalid 'what' in when()\");\r\n return rule;\r\n }\r\n\r\n /**\r\n * A UrlRule which matches based on a UrlMatcher\r\n *\r\n * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]\r\n *\r\n * ## Handler as a function\r\n *\r\n * If `handler` is a function, the function is invoked with:\r\n *\r\n * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])\r\n * - url: the current Url ([[UrlParts]])\r\n * - router: the router object ([[UIRouter]])\r\n *\r\n * #### Example:\r\n * ```js\r\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\r\n * var rule = factory.fromUrlMatcher(urlMatcher, match => \"/home/\" + match.fooId + \"/\" + match.barId);\r\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\r\n * var result = rule.handler(match); // '/home/123/456'\r\n * ```\r\n *\r\n * ## Handler as UrlMatcher\r\n *\r\n * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.\r\n * The `handler` UrlMatcher is formatted using the matched param from the first matcher.\r\n * The url is replaced with the result.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\r\n * var handler = $umf.compile(\"/home/:fooId/:barId\");\r\n * var rule = factory.fromUrlMatcher(urlMatcher, handler);\r\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\r\n * var result = rule.handler(match); // '/home/123/456'\r\n * ```\r\n */\r\n fromUrlMatcher(urlMatcher: UrlMatcher, handler: string | UrlMatcher | UrlRuleHandlerFn): MatcherUrlRule {\r\n let _handler: UrlRuleHandlerFn = handler as any;\r\n if (isString(handler)) handler = this.router.urlMatcherFactory.compile(handler);\r\n if (is(UrlMatcher)(handler)) _handler = (match: RawParams) => (handler as UrlMatcher).format(match);\r\n\r\n function matchUrlParamters(url: UrlParts): RawParams {\r\n const params = urlMatcher.exec(url.path, url.search, url.hash);\r\n return urlMatcher.validates(params) && params;\r\n }\r\n\r\n // Prioritize URLs, lowest to highest:\r\n // - Some optional URL parameters, but none matched\r\n // - No optional parameters in URL\r\n // - Some optional parameters, some matched\r\n // - Some optional parameters, all matched\r\n function matchPriority(params: RawParams): number {\r\n const optional = urlMatcher.parameters().filter((param) => param.isOptional);\r\n if (!optional.length) return 0.000001;\r\n const matched = optional.filter((param) => params[param.id]);\r\n return matched.length / optional.length;\r\n }\r\n\r\n const details = { urlMatcher, matchPriority, type: 'URLMATCHER' };\r\n return extend(new BaseUrlRule(matchUrlParamters, _handler), details) as MatcherUrlRule;\r\n }\r\n\r\n /**\r\n * A UrlRule which matches a state by its url\r\n *\r\n * #### Example:\r\n * ```js\r\n * var rule = factory.fromState($state.get('foo'), router);\r\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\r\n * var result = rule.handler(match);\r\n * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }\r\n * ```\r\n */\r\n fromState(stateOrDecl: StateObject | StateDeclaration, router: UIRouter): StateRule {\r\n const state = StateObject.isStateDeclaration(stateOrDecl) ? stateOrDecl.$$state() : stateOrDecl;\r\n\r\n /**\r\n * Handles match by transitioning to matched state\r\n *\r\n * First checks if the router should start a new transition.\r\n * A new transition is not required if the current state's URL\r\n * and the new URL are already identical\r\n */\r\n const handler = (match: RawParams) => {\r\n const $state = router.stateService;\r\n const globals = router.globals;\r\n if ($state.href(state, match) !== $state.href(globals.current, globals.params)) {\r\n $state.transitionTo(state, match, { inherit: true, source: 'url' });\r\n }\r\n };\r\n\r\n const details = { state, type: 'STATE' };\r\n return extend(this.fromUrlMatcher(state.url, handler), details) as StateRule;\r\n }\r\n\r\n /**\r\n * A UrlRule which matches based on a regular expression\r\n *\r\n * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.\r\n *\r\n * ## Handler as a function\r\n *\r\n * If `handler` is a function, the function is invoked with:\r\n *\r\n * - regexp match array (from `regexp`)\r\n * - url: the current Url ([[UrlParts]])\r\n * - router: the router object ([[UIRouter]])\r\n *\r\n * #### Example:\r\n * ```js\r\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, match => \"/home/\" + match[1])\r\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\r\n * var result = rule.handler(match); // '/home/bar'\r\n * ```\r\n *\r\n * ## Handler as string\r\n *\r\n * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.\r\n * The string is first interpolated using `string.replace()` style pattern.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, \"/home/$1\")\r\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\r\n * var result = rule.handler(match); // '/home/bar'\r\n * ```\r\n */\r\n fromRegExp(regexp: RegExp, handler: string | UrlRuleHandlerFn): RegExpRule {\r\n if (regexp.global || regexp.sticky) throw new Error('Rule RegExp must not be global or sticky');\r\n\r\n /**\r\n * If handler is a string, the url will be replaced by the string.\r\n * If the string has any String.replace() style variables in it (like `$2`),\r\n * they will be replaced by the captures from [[match]]\r\n */\r\n const redirectUrlTo = (match: RegExpExecArray) =>\r\n // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern\r\n (handler as string).replace(/\\$(\\$|\\d{1,2})/, (m, what) => match[what === '$' ? 0 : Number(what)]);\r\n\r\n const _handler = isString(handler) ? redirectUrlTo : handler;\r\n\r\n const matchParamsFromRegexp = (url: UrlParts): RegExpExecArray => regexp.exec(url.path);\r\n\r\n const details = { regexp, type: 'REGEXP' };\r\n return extend(new BaseUrlRule(matchParamsFromRegexp, _handler), details) as RegExpRule;\r\n }\r\n}\r\n\r\n/**\r\n * A base rule which calls `match`\r\n *\r\n * The value from the `match` function is passed through to the `handler`.\r\n * @internal\r\n */\r\nexport class BaseUrlRule implements UrlRule {\r\n $id: number;\r\n priority: number;\r\n _group: number;\r\n type: UrlRuleType = 'RAW';\r\n handler: UrlRuleHandlerFn;\r\n matchPriority = (match) => 0 - this.$id;\r\n\r\n constructor(public match: UrlRuleMatchFn, handler?: UrlRuleHandlerFn) {\r\n this.handler = handler || identity;\r\n }\r\n}\r\n","import { UIRouter } from '../router';\r\nimport { Disposable } from '../interface';\r\nimport { MatcherUrlRule, UrlRule, UrlRuleHandlerFn, UrlRuleMatchFn, UrlRulesApi } from './interface';\r\nimport { TargetState, TargetStateDef } from '../state';\r\nimport { UrlMatcher } from './urlMatcher';\r\nimport { is, isDefined, isFunction, isString, removeFrom, val } from '../common';\r\nimport { UrlRuleFactory } from './urlRule';\r\n\r\nconst prioritySort = (a: UrlRule, b: UrlRule) => (b.priority || 0) - (a.priority || 0);\r\n\r\nconst typeSort = (a: UrlRule, b: UrlRule) => {\r\n const weights = { STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1 };\r\n return (weights[a.type] || 0) - (weights[b.type] || 0);\r\n};\r\n\r\nconst urlMatcherSort = (a: MatcherUrlRule, b: MatcherUrlRule) =>\r\n !a.urlMatcher || !b.urlMatcher ? 0 : UrlMatcher.compare(a.urlMatcher, b.urlMatcher);\r\n\r\nconst idSort = (a: UrlRule, b: UrlRule) => {\r\n // Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL\r\n const useMatchPriority = { STATE: true, URLMATCHER: true };\r\n const equal = useMatchPriority[a.type] && useMatchPriority[b.type];\r\n return equal ? 0 : (a.$id || 0) - (b.$id || 0);\r\n};\r\n\r\n/**\r\n * Default rule priority sorting function.\r\n *\r\n * Sorts rules by:\r\n *\r\n * - Explicit priority (set rule priority using [[UrlRules.when]])\r\n * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)\r\n * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.\r\n * - Rule registration order (for rule types other than STATE and URLMATCHER)\r\n * - Equally sorted State and UrlMatcher rules will each match the URL.\r\n * Then, the *best* match is chosen based on how many parameter values were matched.\r\n */\r\nlet defaultRuleSortFn: (a: UrlRule, b: UrlRule) => number;\r\ndefaultRuleSortFn = (a, b) => {\r\n let cmp = prioritySort(a, b);\r\n if (cmp !== 0) return cmp;\r\n\r\n cmp = typeSort(a, b);\r\n if (cmp !== 0) return cmp;\r\n\r\n cmp = urlMatcherSort(a as MatcherUrlRule, b as MatcherUrlRule);\r\n if (cmp !== 0) return cmp;\r\n\r\n return idSort(a, b);\r\n};\r\n\r\nfunction getHandlerFn(handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef): UrlRuleHandlerFn {\r\n if (!isFunction(handler) && !isString(handler) && !is(TargetState)(handler) && !TargetState.isDef(handler)) {\r\n throw new Error(\"'handler' must be a string, function, TargetState, or have a state: 'newtarget' property\");\r\n }\r\n return isFunction(handler) ? (handler as UrlRuleHandlerFn) : val(handler);\r\n}\r\n\r\n/**\r\n * API for managing URL rules\r\n *\r\n * This API is used to create and manage URL rules.\r\n * URL rules are a mechanism to respond to specific URL patterns.\r\n *\r\n * The most commonly used methods are [[otherwise]] and [[when]].\r\n *\r\n * This API is found at `router.urlService.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])\r\n */\r\nexport class UrlRules implements Disposable {\r\n /** used to create [[UrlRule]] objects for common cases */\r\n public urlRuleFactory: UrlRuleFactory;\r\n\r\n /** @internal */ private _sortFn = defaultRuleSortFn;\r\n /** @internal */ private _otherwiseFn: UrlRule;\r\n /** @internal */ private _sorted: boolean;\r\n /** @internal */ private _rules: UrlRule[] = [];\r\n /** @internal */ private _id = 0;\r\n\r\n /** @internal */\r\n constructor(/** @internal */ private router: UIRouter) {\r\n this.urlRuleFactory = new UrlRuleFactory(router);\r\n }\r\n\r\n /** @internal */\r\n public dispose(router?: UIRouter) {\r\n this._rules = [];\r\n delete this._otherwiseFn;\r\n }\r\n\r\n /**\r\n * Defines the initial state, path, or behavior to use when the app starts.\r\n *\r\n * This rule defines the initial/starting state for the application.\r\n *\r\n * This rule is triggered the first time the URL is checked (when the app initially loads).\r\n * The rule is triggered only when the url matches either `\"\"` or `\"/\"`.\r\n *\r\n * Note: The rule is intended to be used when the root of the application is directly linked to.\r\n * When the URL is *not* `\"\"` or `\"/\"` and doesn't match other rules, the [[otherwise]] rule is triggered.\r\n * This allows 404-like behavior when an unknown URL is deep-linked.\r\n *\r\n * #### Example:\r\n * Start app at `home` state.\r\n * ```js\r\n * .initial({ state: 'home' });\r\n * ```\r\n *\r\n * #### Example:\r\n * Start app at `/home` (by url)\r\n * ```js\r\n * .initial('/home');\r\n * ```\r\n *\r\n * #### Example:\r\n * When no other url rule matches, go to `home` state\r\n * ```js\r\n * .initial((matchValue, url, router) => {\r\n * console.log('initial state');\r\n * return { state: 'home' };\r\n * })\r\n * ```\r\n *\r\n * @param handler The initial state or url path, or a function which returns the state or url path (or performs custom logic).\r\n */\r\n public initial(handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef) {\r\n const handlerFn: UrlRuleHandlerFn = getHandlerFn(handler);\r\n const matchFn: UrlRuleMatchFn = (urlParts, router) =>\r\n router.globals.transitionHistory.size() === 0 && !!/^\\/?$/.exec(urlParts.path);\r\n\r\n this.rule(this.urlRuleFactory.create(matchFn, handlerFn));\r\n }\r\n\r\n /**\r\n * Defines the state, url, or behavior to use when no other rule matches the URL.\r\n *\r\n * This rule is matched when *no other rule* matches.\r\n * It is generally used to handle unknown URLs (similar to \"404\" behavior, but on the client side).\r\n *\r\n * - If `handler` a string, it is treated as a url redirect\r\n *\r\n * #### Example:\r\n * When no other url rule matches, redirect to `/index`\r\n * ```js\r\n * .otherwise('/index');\r\n * ```\r\n *\r\n * - If `handler` is an object with a `state` property, the state is activated.\r\n *\r\n * #### Example:\r\n * When no other url rule matches, redirect to `home` and provide a `dashboard` parameter value.\r\n * ```js\r\n * .otherwise({ state: 'home', params: { dashboard: 'default' } });\r\n * ```\r\n *\r\n * - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[UIRouter]] object.\r\n * The function can perform actions, and/or return a value.\r\n *\r\n * #### Example:\r\n * When no other url rule matches, manually trigger a transition to the `home` state\r\n * ```js\r\n * .otherwise((matchValue, urlParts, router) => {\r\n * router.stateService.go('home');\r\n * });\r\n * ```\r\n *\r\n * #### Example:\r\n * When no other url rule matches, go to `home` state\r\n * ```js\r\n * .otherwise((matchValue, urlParts, router) => {\r\n * return { state: 'home' };\r\n * });\r\n * ```\r\n *\r\n * @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic).\r\n */\r\n public otherwise(handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef) {\r\n const handlerFn: UrlRuleHandlerFn = getHandlerFn(handler);\r\n\r\n this._otherwiseFn = this.urlRuleFactory.create(val(true), handlerFn);\r\n this._sorted = false;\r\n }\r\n\r\n /**\r\n * Remove a rule previously registered\r\n *\r\n * @param rule the matcher rule that was previously registered using [[rule]]\r\n */\r\n public removeRule(rule): void {\r\n removeFrom(this._rules, rule);\r\n }\r\n\r\n /**\r\n * Manually adds a URL Rule.\r\n *\r\n * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]].\r\n * This api can be used directly for more control (to register a [[BaseUrlRule]], for example).\r\n * Rules can be created using [[urlRuleFactory]], or created manually as simple objects.\r\n *\r\n * A rule should have a `match` function which returns truthy if the rule matched.\r\n * It should also have a `handler` function which is invoked if the rule is the best match.\r\n *\r\n * @return a function that deregisters the rule\r\n */\r\n public rule(rule: UrlRule): Function {\r\n if (!UrlRuleFactory.isUrlRule(rule)) throw new Error('invalid rule');\r\n rule.$id = this._id++;\r\n rule.priority = rule.priority || 0;\r\n\r\n this._rules.push(rule);\r\n this._sorted = false;\r\n\r\n return () => this.removeRule(rule);\r\n }\r\n\r\n /**\r\n * Gets all registered rules\r\n *\r\n * @returns an array of all the registered rules\r\n */\r\n public rules(): UrlRule[] {\r\n this.ensureSorted();\r\n return this._rules.concat(this._otherwiseFn ? [this._otherwiseFn] : []);\r\n }\r\n\r\n /**\r\n * Defines URL Rule priorities\r\n *\r\n * More than one rule ([[UrlRule]]) might match a given URL.\r\n * This `compareFn` is used to sort the rules by priority.\r\n * Higher priority rules should sort earlier.\r\n *\r\n * The [[defaultRuleSortFn]] is used by default.\r\n *\r\n * You only need to call this function once.\r\n * The `compareFn` will be used to sort the rules as each is registered.\r\n *\r\n * If called without any parameter, it will re-sort the rules.\r\n *\r\n * ---\r\n *\r\n * Url rules may come from multiple sources: states's urls ([[StateDeclaration.url]]), [[when]], and [[rule]].\r\n * Each rule has a (user-provided) [[UrlRule.priority]], a [[UrlRule.type]], and a [[UrlRule.$id]]\r\n * The `$id` is is the order in which the rule was registered.\r\n *\r\n * The sort function should use these data, or data found on a specific type\r\n * of [[UrlRule]] (such as [[StateRule.state]]), to order the rules as desired.\r\n *\r\n * #### Example:\r\n * This compare function prioritizes rules by the order in which the rules were registered.\r\n * A rule registered earlier has higher priority.\r\n *\r\n * ```js\r\n * function compareFn(a, b) {\r\n * return a.$id - b.$id;\r\n * }\r\n * ```\r\n *\r\n * @param compareFn a function that compares to [[UrlRule]] objects.\r\n * The `compareFn` should abide by the `Array.sort` compare function rules.\r\n * Given two rules, `a` and `b`, return a negative number if `a` should be higher priority.\r\n * Return a positive number if `b` should be higher priority.\r\n * Return `0` if the rules are identical.\r\n *\r\n * See the [mozilla reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description)\r\n * for details.\r\n */\r\n sort(compareFn?: (a: UrlRule, b: UrlRule) => number) {\r\n const sorted = this.stableSort(this._rules, (this._sortFn = compareFn || this._sortFn));\r\n\r\n // precompute _sortGroup values and apply to each rule\r\n let group = 0;\r\n for (let i = 0; i < sorted.length; i++) {\r\n sorted[i]._group = group;\r\n if (i < sorted.length - 1 && this._sortFn(sorted[i], sorted[i + 1]) !== 0) {\r\n group++;\r\n }\r\n }\r\n\r\n this._rules = sorted;\r\n this._sorted = true;\r\n }\r\n\r\n /** @internal */\r\n private ensureSorted() {\r\n this._sorted || this.sort();\r\n }\r\n\r\n /** @internal */\r\n private stableSort(arr, compareFn) {\r\n const arrOfWrapper = arr.map((elem, idx) => ({ elem, idx }));\r\n\r\n arrOfWrapper.sort((wrapperA, wrapperB) => {\r\n const cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);\r\n return cmpDiff === 0 ? wrapperA.idx - wrapperB.idx : cmpDiff;\r\n });\r\n\r\n return arrOfWrapper.map((wrapper) => wrapper.elem);\r\n }\r\n\r\n /**\r\n * Registers a `matcher` and `handler` for custom URLs handling.\r\n *\r\n * The `matcher` can be:\r\n *\r\n * - a [[UrlMatcher]]: See: [[UrlMatcherFactory.compile]]\r\n * - a `string`: The string is compiled to a [[UrlMatcher]]\r\n * - a `RegExp`: The regexp is used to match the url.\r\n *\r\n * The `handler` can be:\r\n *\r\n * - a string: The url is redirected to the value of the string.\r\n * - a function: The url is redirected to the return value of the function.\r\n *\r\n * ---\r\n *\r\n * When the `handler` is a `string` and the `matcher` is a `UrlMatcher` (or string), the redirect\r\n * string is interpolated with parameter values.\r\n *\r\n * #### Example:\r\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\r\n * ```js\r\n * .when(\"/foo/:param1\", \"/bar/:param1\")\r\n * ```\r\n *\r\n * ---\r\n *\r\n * When the `handler` is a string and the `matcher` is a `RegExp`, the redirect string is\r\n * interpolated with capture groups from the RegExp.\r\n *\r\n * #### Example:\r\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\r\n * ```js\r\n * .when(new RegExp(\"^/foo/(.*)$\"), \"/bar/$1\");\r\n * ```\r\n *\r\n * ---\r\n *\r\n * When the handler is a function, it receives the matched value, the current URL, and the `UIRouter` object (See [[UrlRuleHandlerFn]]).\r\n * The \"matched value\" differs based on the `matcher`.\r\n * For [[UrlMatcher]]s, it will be the matched state params.\r\n * For `RegExp`, it will be the match array from `regexp.exec()`.\r\n *\r\n * If the handler returns a string, the URL is redirected to the string.\r\n *\r\n * #### Example:\r\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\r\n * ```js\r\n * .when(new RegExp(\"^/foo/(.*)$\"), match => \"/bar/\" + match[1]);\r\n * ```\r\n *\r\n * Note: the `handler` may also invoke arbitrary code, such as `$state.go()`\r\n *\r\n * @param matcher A pattern `string` to match, compiled as a [[UrlMatcher]], or a `RegExp`.\r\n * @param handler The path to redirect to, or a function that returns the path.\r\n * @param options `{ priority: number }`\r\n *\r\n * @return the registered [[UrlRule]]\r\n */\r\n public when(\r\n matcher: RegExp | UrlMatcher | string,\r\n handler: string | UrlRuleHandlerFn,\r\n options?: { priority: number }\r\n ): UrlRule {\r\n const rule = this.urlRuleFactory.create(matcher, handler);\r\n if (isDefined(options && options.priority)) rule.priority = options.priority;\r\n this.rule(rule);\r\n return rule;\r\n }\r\n}\r\n","import { UIRouter } from '../router';\r\nimport { extend, is, isString, LocationServices, pattern } from '../common';\r\nimport { MatchResult, UrlParts, UrlRule, UrlSyncApi } from './interface';\r\nimport { UrlRules } from './urlRules';\r\nimport { UrlConfig } from './urlConfig';\r\nimport { TargetState, TargetStateDef } from '../state';\r\n\r\n/**\r\n * API for URL management\r\n */\r\nexport class UrlService implements LocationServices, UrlSyncApi {\r\n /** @internal */ private _stopListeningFn: Function;\r\n /** @internal */ interceptDeferred = false;\r\n\r\n /**\r\n * The nested [[UrlRules]] API for managing URL rules and rewrites\r\n *\r\n * See: [[UrlRules]] for details\r\n */\r\n public rules = new UrlRules(this.router);\r\n\r\n /**\r\n * The nested [[UrlConfig]] API to configure the URL and retrieve URL information\r\n *\r\n * See: [[UrlConfig]] for details\r\n */\r\n public config = new UrlConfig(this.router);\r\n\r\n /** @internal */\r\n constructor(/** @internal */ private router: UIRouter) {}\r\n /** @internal */\r\n public dispose() {\r\n this.listen(false);\r\n (this.rules as UrlRules).dispose();\r\n }\r\n\r\n /**\r\n * Gets the current URL parts\r\n *\r\n * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.\r\n */\r\n public parts(): UrlParts {\r\n return { path: this.path(), search: this.search(), hash: this.hash() };\r\n }\r\n\r\n /**\r\n * Activates the best rule for the current URL\r\n *\r\n * Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler.\r\n * This method is called internally any time the URL has changed.\r\n *\r\n * This effectively activates the state (or redirect, etc) which matches the current URL.\r\n *\r\n * #### Example:\r\n * ```js\r\n * urlService.deferIntercept();\r\n *\r\n * fetch('/states.json').then(resp => resp.json()).then(data => {\r\n * data.forEach(state => $stateRegistry.register(state));\r\n * urlService.listen();\r\n * // Find the matching URL and invoke the handler.\r\n * urlService.sync();\r\n * });\r\n * ```\r\n */\r\n public sync(evt?) {\r\n if (evt && evt.defaultPrevented) return;\r\n const { urlService, stateService } = this.router;\r\n\r\n const url: UrlParts = { path: urlService.path(), search: urlService.search(), hash: urlService.hash() };\r\n const best = this.match(url);\r\n\r\n const applyResult = pattern([\r\n [isString, (newurl: string) => urlService.url(newurl, true)],\r\n [TargetState.isDef, (def: TargetStateDef) => stateService.go(def.state, def.params, def.options)],\r\n [is(TargetState), (target: TargetState) => stateService.go(target.state(), target.params(), target.options())],\r\n ]);\r\n\r\n applyResult(best && best.rule.handler(best.match, url, this.router));\r\n }\r\n\r\n /**\r\n * Starts or stops listening for URL changes\r\n *\r\n * Call this sometime after calling [[deferIntercept]] to start monitoring the url.\r\n * This causes UI-Router to start listening for changes to the URL, if it wasn't already listening.\r\n *\r\n * If called with `false`, UI-Router will stop listening (call listen(true) to start listening again).\r\n *\r\n * #### Example:\r\n * ```js\r\n * urlService.deferIntercept();\r\n *\r\n * fetch('/states.json').then(resp => resp.json()).then(data => {\r\n * data.forEach(state => $stateRegistry.register(state));\r\n * // Start responding to URL changes\r\n * urlService.listen();\r\n * urlService.sync();\r\n * });\r\n * ```\r\n *\r\n * @param enabled `true` or `false` to start or stop listening to URL changes\r\n */\r\n public listen(enabled?: boolean): Function {\r\n if (enabled === false) {\r\n this._stopListeningFn && this._stopListeningFn();\r\n delete this._stopListeningFn;\r\n } else {\r\n return (this._stopListeningFn =\r\n this._stopListeningFn || this.router.urlService.onChange((evt) => this.sync(evt)));\r\n }\r\n }\r\n\r\n /**\r\n * Disables monitoring of the URL.\r\n *\r\n * Call this method before UI-Router has bootstrapped.\r\n * It will stop UI-Router from performing the initial url sync.\r\n *\r\n * This can be useful to perform some asynchronous initialization before the router starts.\r\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // Prevent UI-Router from automatically intercepting URL changes when it starts;\r\n * urlService.deferIntercept();\r\n *\r\n * fetch('/states.json').then(resp => resp.json()).then(data => {\r\n * data.forEach(state => $stateRegistry.register(state));\r\n * urlService.listen();\r\n * urlService.sync();\r\n * });\r\n * ```\r\n *\r\n * @param defer Indicates whether to defer location change interception.\r\n * Passing no parameter is equivalent to `true`.\r\n */\r\n public deferIntercept(defer?: boolean) {\r\n if (defer === undefined) defer = true;\r\n this.interceptDeferred = defer;\r\n }\r\n\r\n /**\r\n * Matches a URL\r\n *\r\n * Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.\r\n * Return the result as a [[MatchResult]].\r\n */\r\n public match(url: UrlParts): MatchResult {\r\n url = extend({ path: '', search: {}, hash: '' }, url);\r\n const rules = this.rules.rules();\r\n\r\n // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined\r\n const checkRule = (rule: UrlRule): MatchResult => {\r\n const match = rule.match(url, this.router);\r\n return match && { match, rule, weight: rule.matchPriority(match) };\r\n };\r\n\r\n // The rules are pre-sorted.\r\n // - Find the first matching rule.\r\n // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`.\r\n // - Choose the rule with the highest match weight.\r\n let best: MatchResult;\r\n for (let i = 0; i < rules.length; i++) {\r\n // Stop when there is a 'best' rule and the next rule sorts differently than it.\r\n if (best && best.rule._group !== rules[i]._group) break;\r\n\r\n const current = checkRule(rules[i]);\r\n // Pick the best MatchResult\r\n best = !best || (current && current.weight > best.weight) ? current : best;\r\n }\r\n\r\n return best;\r\n }\r\n\r\n // Delegate these calls to the current LocationServices implementation\r\n /**\r\n * Gets the current url, or updates the url\r\n *\r\n * ### Getting the current URL\r\n *\r\n * When no arguments are passed, returns the current URL.\r\n * The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values.\r\n *\r\n * For example, the URL may be stored in the hash ([[HashLocationServices]]) or\r\n * have a base HREF prepended ([[PushStateLocationServices]]).\r\n *\r\n * The raw URL in the browser might be:\r\n *\r\n * ```\r\n * http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor\r\n * ```\r\n *\r\n * or\r\n *\r\n * ```\r\n * http://mysite.com/basepath/internal/path/123?param1=foo#anchor\r\n * ```\r\n *\r\n * then this method returns:\r\n *\r\n * ```\r\n * /internal/path/123?param1=foo#anchor\r\n * ```\r\n *\r\n *\r\n * #### Example:\r\n * ```js\r\n * locationServices.url(); // \"/some/path?query=value#anchor\"\r\n * ```\r\n *\r\n * ### Updating the URL\r\n *\r\n * When `newurl` arguments is provided, changes the URL to reflect `newurl`\r\n *\r\n * #### Example:\r\n * ```js\r\n * locationServices.url(\"/some/path?query=value#anchor\", true);\r\n * ```\r\n *\r\n * @param newurl The new value for the URL.\r\n * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.\r\n * It should not include the protocol, site, port, or base path of an absolute HREF.\r\n * @param replace When true, replaces the current history entry (instead of appending it) with this new url\r\n * @param state The history's state object, i.e., pushState (if the LocationServices implementation supports it)\r\n *\r\n * @return the url (after potentially being processed)\r\n */\r\n public url = (newurl?: string, replace?: boolean, state?: any): string =>\r\n this.router.locationService.url(newurl, replace, state);\r\n\r\n /**\r\n * Gets the path part of the current url\r\n *\r\n * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`\r\n *\r\n * @return the path portion of the url\r\n */\r\n public path = (): string => this.router.locationService.path();\r\n\r\n /**\r\n * Gets the search part of the current url as an object\r\n *\r\n * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`\r\n *\r\n * @return the search (query) portion of the url, as an object\r\n */\r\n public search = (): { [key: string]: any } => this.router.locationService.search();\r\n\r\n /**\r\n * Gets the hash part of the current url\r\n *\r\n * If the current URL is `/some/path?query=value#anchor`, this returns `anchor`\r\n *\r\n * @return the hash (anchor) portion of the url\r\n */\r\n public hash = (): string => this.router.locationService.hash();\r\n\r\n /**\r\n * @internal\r\n *\r\n * Registers a low level url change handler\r\n *\r\n * Note: Because this is a low level handler, it's not recommended for general use.\r\n *\r\n * #### Example:\r\n * ```js\r\n * let deregisterFn = locationServices.onChange((evt) => console.log(\"url change\", evt));\r\n * ```\r\n *\r\n * @param callback a function that will be called when the url is changing\r\n * @return a function that de-registers the callback\r\n */\r\n public onChange = (callback: EventListener): Function => this.router.locationService.onChange(callback);\r\n}\r\n","import { isArray, isObject, $QLike } from '../common/index';\r\n\r\n/**\r\n * An angular1-like promise api\r\n *\r\n * This object implements four methods similar to the\r\n * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q)\r\n *\r\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\r\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\r\n *\r\n * This API provides native ES6 promise support wrapped as a $q-like API.\r\n * Internally, UI-Router uses this $q object to perform promise operations.\r\n * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular.\r\n *\r\n * $q-like promise api\r\n */\r\nexport const $q = {\r\n /** Normalizes a value as a promise */\r\n when: (val) => new Promise((resolve, reject) => resolve(val)),\r\n\r\n /** Normalizes a value as a promise rejection */\r\n reject: (val) =>\r\n new Promise((resolve, reject) => {\r\n reject(val);\r\n }),\r\n\r\n /** @returns a deferred object, which has `resolve` and `reject` functions */\r\n defer: () => {\r\n const deferred: any = {};\r\n deferred.promise = new Promise((resolve, reject) => {\r\n deferred.resolve = resolve;\r\n deferred.reject = reject;\r\n });\r\n return deferred;\r\n },\r\n\r\n /** Like Promise.all(), but also supports object key/promise notation like $q */\r\n all: (promises: { [key: string]: Promise<any> } | Promise<any>[]) => {\r\n if (isArray(promises)) {\r\n return Promise.all(promises);\r\n }\r\n\r\n if (isObject(promises)) {\r\n // Convert promises map to promises array.\r\n // When each promise resolves, map it to a tuple { key: key, val: val }\r\n const chain = Object.keys(promises).map((key) => promises[key].then((val) => ({ key, val })));\r\n\r\n // Then wait for all promises to resolve, and convert them back to an object\r\n return $q.all(chain).then((values) =>\r\n values.reduce((acc, tuple) => {\r\n acc[tuple.key] = tuple.val;\r\n return acc;\r\n }, {})\r\n );\r\n }\r\n },\r\n} as $QLike;\r\n","import {\r\n extend,\r\n assertPredicate,\r\n isFunction,\r\n isArray,\r\n isInjectable,\r\n $InjectorLike,\r\n IInjectable,\r\n} from '../common/index';\r\n\r\n// globally available injectables\r\nconst globals = {};\r\nconst STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/gm;\r\nconst ARGUMENT_NAMES = /([^\\s,]+)/g;\r\n\r\n/**\r\n * A basic angular1-like injector api\r\n *\r\n * This object implements four methods similar to the\r\n * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector)\r\n *\r\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\r\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\r\n *\r\n * This object provides a naive implementation of a globally scoped dependency injection system.\r\n * It supports the following DI approaches:\r\n *\r\n * ### Function parameter names\r\n *\r\n * A function's `.toString()` is called, and the parameter names are parsed.\r\n * This only works when the parameter names aren't \"mangled\" by a minifier such as UglifyJS.\r\n *\r\n * ```js\r\n * function injectedFunction(FooService, BarService) {\r\n * // FooService and BarService are injected\r\n * }\r\n * ```\r\n *\r\n * ### Function annotation\r\n *\r\n * A function may be annotated with an array of dependency names as the `$inject` property.\r\n *\r\n * ```js\r\n * injectedFunction.$inject = [ 'FooService', 'BarService' ];\r\n * function injectedFunction(fs, bs) {\r\n * // FooService and BarService are injected as fs and bs parameters\r\n * }\r\n * ```\r\n *\r\n * ### Array notation\r\n *\r\n * An array provides the names of the dependencies to inject (as strings).\r\n * The function is the last element of the array.\r\n *\r\n * ```js\r\n * [ 'FooService', 'BarService', function (fs, bs) {\r\n * // FooService and BarService are injected as fs and bs parameters\r\n * }]\r\n * ```\r\n *\r\n * @type {$InjectorLike}\r\n */\r\nexport const $injector = {\r\n /** Gets an object from DI based on a string token */\r\n get: (name) => globals[name],\r\n\r\n /** Returns true if an object named `name` exists in global DI */\r\n has: (name) => $injector.get(name) != null,\r\n\r\n /**\r\n * Injects a function\r\n *\r\n * @param fn the function to inject\r\n * @param context the function's `this` binding\r\n * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }`\r\n */\r\n invoke: (fn: IInjectable, context?, locals?) => {\r\n const all = extend({}, globals, locals || {});\r\n const params = $injector.annotate(fn);\r\n const ensureExist = assertPredicate(\r\n (key: string) => all.hasOwnProperty(key),\r\n (key) => `DI can't find injectable: '${key}'`\r\n );\r\n const args = params.filter(ensureExist).map((x) => all[x]);\r\n if (isFunction(fn)) return fn.apply(context, args);\r\n else return (fn as any[]).slice(-1)[0].apply(context, args);\r\n },\r\n\r\n /**\r\n * Returns a function's dependencies\r\n *\r\n * Analyzes a function (or array) and returns an array of DI tokens that the function requires.\r\n * @return an array of `string`s\r\n */\r\n annotate: (fn: IInjectable): any[] => {\r\n if (!isInjectable(fn)) throw new Error(`Not an injectable function: ${fn}`);\r\n if (fn && (fn as any).$inject) return (fn as any).$inject;\r\n if (isArray(fn)) return fn.slice(0, -1);\r\n const fnStr = fn.toString().replace(STRIP_COMMENTS, '');\r\n const result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES);\r\n return result || [];\r\n },\r\n} as $InjectorLike;\r\n","import {\r\n LocationConfig,\r\n LocationServices,\r\n identity,\r\n unnestR,\r\n isArray,\r\n splitEqual,\r\n splitHash,\r\n splitQuery,\r\n} from '../common';\r\nimport { UIRouter } from '../router';\r\n\r\nexport const keyValsToObjectR = (accum, [key, val]) => {\r\n if (!accum.hasOwnProperty(key)) {\r\n accum[key] = val;\r\n } else if (isArray(accum[key])) {\r\n accum[key].push(val);\r\n } else {\r\n accum[key] = [accum[key], val];\r\n }\r\n return accum;\r\n};\r\n\r\nexport const getParams = (queryString: string): any =>\r\n queryString.split('&').filter(identity).map(splitEqual).reduce(keyValsToObjectR, {});\r\n\r\nexport function parseUrl(url: string) {\r\n const orEmptyString = (x) => x || '';\r\n const [beforehash, hash] = splitHash(url).map(orEmptyString);\r\n const [path, search] = splitQuery(beforehash).map(orEmptyString);\r\n\r\n return { path, search, hash, url };\r\n}\r\n\r\nexport const buildUrl = (loc: LocationServices) => {\r\n const path = loc.path();\r\n const searchObject = loc.search();\r\n const hash = loc.hash();\r\n\r\n const search = Object.keys(searchObject)\r\n .map((key) => {\r\n const param = searchObject[key];\r\n const vals = isArray(param) ? param : [param];\r\n return vals.map((val) => key + '=' + val);\r\n })\r\n .reduce(unnestR, [])\r\n .join('&');\r\n\r\n return path + (search ? '?' + search : '') + (hash ? '#' + hash : '');\r\n};\r\n\r\nexport function locationPluginFactory(\r\n name: string,\r\n isHtml5: boolean,\r\n serviceClass: { new (uiRouter?: UIRouter): LocationServices },\r\n configurationClass: { new (uiRouter?: UIRouter, isHtml5?: boolean): LocationConfig }\r\n) {\r\n return function (uiRouter: UIRouter) {\r\n const service = (uiRouter.locationService = new serviceClass(uiRouter));\r\n const configuration = (uiRouter.locationConfig = new configurationClass(uiRouter, isHtml5));\r\n\r\n function dispose(router: UIRouter) {\r\n router.dispose(service);\r\n router.dispose(configuration);\r\n }\r\n\r\n return { name, service, configuration, dispose };\r\n };\r\n}\r\n","import { deregAll, isDefined, LocationServices, removeFrom, root } from '../common';\r\nimport { Disposable } from '../interface';\r\nimport { UIRouter } from '../router';\r\nimport { HistoryLike, LocationLike } from './interface';\r\nimport { buildUrl, getParams, parseUrl } from './utils';\r\n\r\n/** A base `LocationServices` */\r\nexport abstract class BaseLocationServices implements LocationServices, Disposable {\r\n private _listeners: Function[] = [];\r\n _location: LocationLike;\r\n _history: HistoryLike;\r\n\r\n _listener = (evt) => this._listeners.forEach((cb) => cb(evt));\r\n\r\n constructor(router: UIRouter, public fireAfterUpdate: boolean) {\r\n this._location = root.location;\r\n this._history = root.history;\r\n }\r\n\r\n /**\r\n * This should return the current internal URL representation.\r\n *\r\n * The internal URL includes only the portion that UI-Router matches.\r\n * It does not include:\r\n * - protocol\r\n * - server\r\n * - port\r\n * - base href or hash\r\n */\r\n protected abstract _get(): string;\r\n\r\n /**\r\n * This should set the current URL.\r\n *\r\n * The `url` param should include only the portion that UI-Router matches on.\r\n * It should not include:\r\n * - protocol\r\n * - server\r\n * - port\r\n * - base href or hash\r\n *\r\n * However, after this function completes, the browser URL should reflect the entire (fully qualified)\r\n * HREF including those data.\r\n */\r\n protected abstract _set(state: any, title: string, url: string, replace: boolean);\r\n\r\n hash = () => parseUrl(this._get()).hash;\r\n path = () => parseUrl(this._get()).path;\r\n search = () => getParams(parseUrl(this._get()).search);\r\n\r\n url(url?: string, replace = true): string {\r\n if (isDefined(url) && url !== this._get()) {\r\n this._set(null, null, url, replace);\r\n\r\n if (this.fireAfterUpdate) {\r\n this._listeners.forEach((cb) => cb({ url }));\r\n }\r\n }\r\n\r\n return buildUrl(this);\r\n }\r\n\r\n onChange(cb: EventListener) {\r\n this._listeners.push(cb);\r\n return () => removeFrom(this._listeners, cb);\r\n }\r\n\r\n dispose(router: UIRouter) {\r\n deregAll(this._listeners);\r\n }\r\n}\r\n","import { root, trimHashVal } from '../common';\r\nimport { UIRouter } from '../router';\r\nimport { BaseLocationServices } from './baseLocationService';\r\n\r\n/** A `LocationServices` that uses the browser hash \"#\" to get/set the current location */\r\nexport class HashLocationService extends BaseLocationServices {\r\n constructor(router: UIRouter) {\r\n super(router, false);\r\n root.addEventListener('hashchange', this._listener, false);\r\n }\r\n\r\n _get() {\r\n return trimHashVal(this._location.hash);\r\n }\r\n _set(state: any, title: string, url: string, replace: boolean) {\r\n this._location.hash = url;\r\n }\r\n\r\n dispose(router: UIRouter) {\r\n super.dispose(router);\r\n root.removeEventListener('hashchange', this._listener);\r\n }\r\n}\r\n","import { BaseLocationServices } from './baseLocationService';\r\nimport { UIRouter } from '../router';\r\n\r\n/** A `LocationServices` that gets/sets the current location from an in-memory object */\r\nexport class MemoryLocationService extends BaseLocationServices {\r\n _url: string;\r\n\r\n constructor(router: UIRouter) {\r\n super(router, true);\r\n }\r\n\r\n _get() {\r\n return this._url;\r\n }\r\n\r\n _set(state: any, title: string, url: string, replace: boolean) {\r\n this._url = url;\r\n }\r\n}\r\n","import { UIRouter } from '../router';\r\nimport { BaseLocationServices } from './baseLocationService';\r\nimport { LocationConfig, root, splitHash, splitQuery, stripLastPathElement } from '../common';\r\n\r\n/**\r\n * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis\r\n *\r\n * Uses `history.pushState` and `history.replaceState`\r\n */\r\nexport class PushStateLocationService extends BaseLocationServices {\r\n _config: LocationConfig;\r\n\r\n constructor(router: UIRouter) {\r\n super(router, true);\r\n this._config = router.urlService.config;\r\n root.addEventListener('popstate', this._listener, false);\r\n }\r\n\r\n /**\r\n * Gets the base prefix without:\r\n * - trailing slash\r\n * - trailing filename\r\n * - protocol and hostname\r\n *\r\n * If <base href='/base/'>, this returns '/base'.\r\n * If <base href='/foo/base/'>, this returns '/foo/base'.\r\n * If <base href='/base/index.html'>, this returns '/base'.\r\n * If <base href='http://localhost:8080/base/index.html'>, this returns '/base'.\r\n * If <base href='/base'>, this returns ''.\r\n * If <base href='http://localhost:8080'>, this returns ''.\r\n * If <base href='http://localhost:8080/'>, this returns ''.\r\n *\r\n * See: https://html.spec.whatwg.org/dev/semantics.html#the-base-element\r\n */\r\n private _getBasePrefix() {\r\n return stripLastPathElement(this._config.baseHref());\r\n }\r\n\r\n protected _get() {\r\n let { pathname, hash, search } = this._location;\r\n search = splitQuery(search)[1]; // strip ? if found\r\n hash = splitHash(hash)[1]; // strip # if found\r\n\r\n const basePrefix = this._getBasePrefix();\r\n const exactBaseHrefMatch = pathname === this._config.baseHref();\r\n const startsWithBase = pathname.substr(0, basePrefix.length) === basePrefix;\r\n pathname = exactBaseHrefMatch ? '/' : startsWithBase ? pathname.substring(basePrefix.length) : pathname;\r\n\r\n return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : '');\r\n }\r\n\r\n protected _set(state: any, title: string, url: string, replace: boolean) {\r\n const basePrefix = this._getBasePrefix();\r\n const slash = url && url[0] !== '/' ? '/' : '';\r\n const fullUrl = url === '' || url === '/' ? this._config.baseHref() : basePrefix + slash + url;\r\n\r\n if (replace) {\r\n this._history.replaceState(state, title, fullUrl);\r\n } else {\r\n this._history.pushState(state, title, fullUrl);\r\n }\r\n }\r\n\r\n public dispose(router: UIRouter) {\r\n super.dispose(router);\r\n root.removeEventListener('popstate', this._listener);\r\n }\r\n}\r\n","import { isDefined, isUndefined } from '../common/predicates';\r\nimport { LocationConfig } from '../common/coreservices';\r\n\r\n/** A `LocationConfig` that delegates to the browser's `location` object */\r\nexport class BrowserLocationConfig implements LocationConfig {\r\n private _baseHref = undefined;\r\n private _hashPrefix = '';\r\n\r\n constructor(router?, private _isHtml5 = false) {}\r\n\r\n port(): number {\r\n if (location.port) {\r\n return Number(location.port);\r\n }\r\n\r\n return this.protocol() === 'https' ? 443 : 80;\r\n }\r\n\r\n protocol(): string {\r\n return location.protocol.replace(/:/g, '');\r\n }\r\n\r\n host(): string {\r\n return location.hostname;\r\n }\r\n\r\n html5Mode(): boolean {\r\n return this._isHtml5;\r\n }\r\n\r\n hashPrefix(): string;\r\n hashPrefix(newprefix?: string): string {\r\n return isDefined(newprefix) ? (this._hashPrefix = newprefix) : this._hashPrefix;\r\n }\r\n\r\n baseHref(href?: string): string {\r\n if (isDefined(href)) this._baseHref = href;\r\n if (isUndefined(this._baseHref)) this._baseHref = this.getBaseHref();\r\n return this._baseHref;\r\n }\r\n\r\n private getBaseHref() {\r\n const baseTag: HTMLBaseElement = document.getElementsByTagName('base')[0];\r\n if (baseTag && baseTag.href) {\r\n return baseTag.href.replace(/^([^/:]*:)?\\/\\/[^/]*/, '');\r\n }\r\n\r\n return this._isHtml5 ? '/' : location.pathname || '/';\r\n }\r\n\r\n dispose() {}\r\n}\r\n","import { BrowserLocationConfig } from './browserLocationConfig';\r\nimport { HashLocationService } from './hashLocationService';\r\nimport { locationPluginFactory } from './utils';\r\nimport { LocationPlugin, ServicesPlugin } from './interface';\r\nimport { UIRouter } from '../router';\r\nimport { PushStateLocationService } from './pushStateLocationService';\r\nimport { MemoryLocationService } from './memoryLocationService';\r\nimport { MemoryLocationConfig } from './memoryLocationConfig';\r\nimport { $injector } from './injector';\r\nimport { $q } from './q';\r\nimport { services } from '../common/coreservices';\r\n\r\nexport function servicesPlugin(router: UIRouter): ServicesPlugin {\r\n services.$injector = $injector;\r\n services.$q = $q;\r\n\r\n return { name: 'vanilla.services', $q, $injector, dispose: () => null };\r\n}\r\n\r\n/** A `UIRouterPlugin` uses the browser hash to get/set the current location */\r\nexport const hashLocationPlugin: (router: UIRouter) => LocationPlugin = locationPluginFactory(\r\n 'vanilla.hashBangLocation',\r\n false,\r\n HashLocationService,\r\n BrowserLocationConfig\r\n);\r\n\r\n/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */\r\nexport const pushStateLocationPlugin: (router: UIRouter) => LocationPlugin = locationPluginFactory(\r\n 'vanilla.pushStateLocation',\r\n true,\r\n PushStateLocationService,\r\n BrowserLocationConfig\r\n);\r\n\r\n/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */\r\nexport const memoryLocationPlugin: (router: UIRouter) => LocationPlugin = locationPluginFactory(\r\n 'vanilla.memoryLocation',\r\n false,\r\n MemoryLocationService,\r\n MemoryLocationConfig\r\n);\r\n","import { LocationConfig } from '../common/coreservices';\r\nimport { isDefined } from '../common/predicates';\r\nimport { noop } from '../common/common';\r\n\r\n/** A `LocationConfig` mock that gets/sets all config from an in-memory object */\r\nexport class MemoryLocationConfig implements LocationConfig {\r\n dispose = noop;\r\n\r\n _baseHref = '';\r\n _port = 80;\r\n _protocol = 'http';\r\n _host = 'localhost';\r\n _hashPrefix = '';\r\n\r\n port = () => this._port;\r\n protocol = () => this._protocol;\r\n host = () => this._host;\r\n baseHref = () => this._baseHref;\r\n html5Mode = () => false;\r\n hashPrefix = (newval?) => (isDefined(newval) ? (this._hashPrefix = newval) : this._hashPrefix);\r\n}\r\n","import { equals, applyPairs, removeFrom, TypedMap, inArray, find } from '../common/common';\r\nimport { curry, prop } from '../common/hof';\r\nimport { isString, isArray } from '../common/predicates';\r\nimport { trace } from '../common/trace';\r\nimport { PathNode } from '../path/pathNode';\r\nimport { ActiveUIView, ViewContext, ViewConfig } from './interface';\r\nimport { _ViewDeclaration } from '../state/interface';\r\nimport { UIRouter } from '../router';\r\n\r\nexport type ViewConfigFactory = (path: PathNode[], decl: _ViewDeclaration) => ViewConfig | ViewConfig[];\r\n\r\nexport interface ViewServicePluginAPI {\r\n _rootViewContext(context?: ViewContext): ViewContext;\r\n _viewConfigFactory(viewType: string, factory: ViewConfigFactory);\r\n /** @param id router.$id + \".\" + uiView.id */\r\n _registeredUIView(id: string): ActiveUIView;\r\n _registeredUIViews(): ActiveUIView[];\r\n _activeViewConfigs(): ViewConfig[];\r\n _onSync(listener: ViewSyncListener): Function;\r\n}\r\n\r\n// A uiView and its matching viewConfig\r\nexport interface ViewTuple {\r\n uiView: ActiveUIView;\r\n viewConfig: ViewConfig;\r\n}\r\n\r\nexport interface ViewSyncListener {\r\n (viewTuples: ViewTuple[]): void;\r\n}\r\n\r\n/**\r\n * The View service\r\n *\r\n * This service pairs existing `ui-view` components (which live in the DOM)\r\n * with view configs (from the state declaration objects: [[StateDeclaration.views]]).\r\n *\r\n * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]].\r\n * The views from exited states are deactivated via [[deactivateViewConfig]].\r\n * (See: the [[registerActivateViews]] Transition Hook)\r\n *\r\n * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]].\r\n *\r\n * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]])\r\n * are configured with the matching [[ViewConfig]](s)\r\n *\r\n */\r\nexport class ViewService {\r\n /** @internal */ private _uiViews: ActiveUIView[] = [];\r\n /** @internal */ private _viewConfigs: ViewConfig[] = [];\r\n /** @internal */ private _rootContext: ViewContext;\r\n /** @internal */ private _viewConfigFactories: { [key: string]: ViewConfigFactory } = {};\r\n /** @internal */ private _listeners: ViewSyncListener[] = [];\r\n\r\n /** @internal */\r\n public _pluginapi: ViewServicePluginAPI = {\r\n _rootViewContext: this._rootViewContext.bind(this),\r\n _viewConfigFactory: this._viewConfigFactory.bind(this),\r\n _registeredUIView: (id: string) => find(this._uiViews, (view) => `${this.router.$id}.${view.id}` === id),\r\n _registeredUIViews: () => this._uiViews,\r\n _activeViewConfigs: () => this._viewConfigs,\r\n _onSync: (listener: ViewSyncListener) => {\r\n this._listeners.push(listener);\r\n return () => removeFrom(this._listeners, listener);\r\n },\r\n };\r\n\r\n /**\r\n * Given a ui-view and a ViewConfig, determines if they \"match\".\r\n *\r\n * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in\r\n * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.\r\n *\r\n * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or\r\n * can be a segmented ui-view path, describing a portion of a ui-view fqn.\r\n *\r\n * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type\r\n *\r\n * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:\r\n * - the ui-view's name matches the ViewConfig's target name\r\n * - the ui-view's context matches the ViewConfig's anchor\r\n *\r\n * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:\r\n * - There exists a parent ui-view where:\r\n * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name\r\n * - the parent ui-view's context matches the ViewConfig's anchor\r\n * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn\r\n *\r\n * Example:\r\n *\r\n * DOM:\r\n * <ui-view> <!-- created in the root context (name: \"\") -->\r\n * <ui-view name=\"foo\"> <!-- created in the context named: \"A\" -->\r\n * <ui-view> <!-- created in the context named: \"A.B\" -->\r\n * <ui-view name=\"bar\"> <!-- created in the context named: \"A.B.C\" -->\r\n * </ui-view>\r\n * </ui-view>\r\n * </ui-view>\r\n * </ui-view>\r\n *\r\n * uiViews: [\r\n * { fqn: \"$default\", creationContext: { name: \"\" } },\r\n * { fqn: \"$default.foo\", creationContext: { name: \"A\" } },\r\n * { fqn: \"$default.foo.$default\", creationContext: { name: \"A.B\" } }\r\n * { fqn: \"$default.foo.$default.bar\", creationContext: { name: \"A.B.C\" } }\r\n * ]\r\n *\r\n * These four view configs all match the ui-view with the fqn: \"$default.foo.$default.bar\":\r\n *\r\n * - ViewConfig1: { uiViewName: \"bar\", uiViewContextAnchor: \"A.B.C\" }\r\n * - ViewConfig2: { uiViewName: \"$default.bar\", uiViewContextAnchor: \"A.B\" }\r\n * - ViewConfig3: { uiViewName: \"foo.$default.bar\", uiViewContextAnchor: \"A\" }\r\n * - ViewConfig4: { uiViewName: \"$default.foo.$default.bar\", uiViewContextAnchor: \"\" }\r\n *\r\n * Using ViewConfig3 as an example, it matches the ui-view with fqn \"$default.foo.$default.bar\" because:\r\n * - The ViewConfig's segmented target name is: [ \"foo\", \"$default\", \"bar\" ]\r\n * - There exists a parent ui-view (which has fqn: \"$default.foo\") where:\r\n * - the parent ui-view's name \"foo\" matches the first segment \"foo\" of the ViewConfig's target name\r\n * - the parent ui-view's context \"A\" matches the ViewConfig's anchor context \"A\"\r\n * - And the remaining segments [ \"$default\", \"bar\" ].join(\".\"_ of the ViewConfig's target name match\r\n * the tail of the ui-view's fqn \"default.bar\"\r\n *\r\n * @internal\r\n */\r\n static matches = (uiViewsByFqn: TypedMap<ActiveUIView>, uiView: ActiveUIView) => (viewConfig: ViewConfig) => {\r\n // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc\r\n if (uiView.$type !== viewConfig.viewDecl.$type) return false;\r\n\r\n // Split names apart from both viewConfig and uiView into segments\r\n const vc = viewConfig.viewDecl;\r\n const vcSegments = vc.$uiViewName.split('.');\r\n const uivSegments = uiView.fqn.split('.');\r\n\r\n // Check if the tails of the segment arrays match. ex, these arrays' tails match:\r\n // vc: [\"foo\", \"bar\"], uiv fqn: [\"$default\", \"foo\", \"bar\"]\r\n if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length))) return false;\r\n\r\n // Now check if the fqn ending at the first segment of the viewConfig matches the context:\r\n // [\"$default\", \"foo\"].join(\".\") == \"$default.foo\", does the ui-view $default.foo context match?\r\n const negOffset = 1 - vcSegments.length || undefined;\r\n const fqnToFirstSegment = uivSegments.slice(0, negOffset).join('.');\r\n const uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;\r\n return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);\r\n };\r\n\r\n /**\r\n * Normalizes a view's name from a state.views configuration block.\r\n *\r\n * This should be used by a framework implementation to calculate the values for\r\n * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]].\r\n *\r\n * @param context the context object (state declaration) that the view belongs to\r\n * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]]\r\n *\r\n * @returns the normalized uiViewName and uiViewContextAnchor that the view targets\r\n */\r\n static normalizeUIViewTarget(context: ViewContext, rawViewName = '') {\r\n // TODO: Validate incoming view name with a regexp to allow:\r\n // ex: \"view.name@foo.bar\" , \"^.^.view.name\" , \"view.name@^.^\" , \"\" ,\r\n // \"@\" , \"$default@^\" , \"!$default.$default\" , \"!foo.bar\"\r\n const viewAtContext: string[] = rawViewName.split('@');\r\n let uiViewName = viewAtContext[0] || '$default'; // default to unnamed view\r\n let uiViewContextAnchor = isString(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context\r\n\r\n // Handle relative view-name sugar syntax.\r\n // Matches rawViewName \"^.^.^.foo.bar\" into array: [\"^.^.^.foo.bar\", \"^.^.^\", \"foo.bar\"],\r\n const relativeViewNameSugar = /^(\\^(?:\\.\\^)*)\\.(.*$)/.exec(uiViewName);\r\n if (relativeViewNameSugar) {\r\n // Clobbers existing contextAnchor (rawViewName validation will fix this)\r\n uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to \"^.^.^\"\r\n uiViewName = relativeViewNameSugar[2]; // set view-name to \"foo.bar\"\r\n }\r\n\r\n if (uiViewName.charAt(0) === '!') {\r\n uiViewName = uiViewName.substr(1);\r\n uiViewContextAnchor = ''; // target absolutely from root\r\n }\r\n\r\n // handle parent relative targeting \"^.^.^\"\r\n const relativeMatch = /^(\\^(?:\\.\\^)*)$/;\r\n if (relativeMatch.exec(uiViewContextAnchor)) {\r\n const anchorState = uiViewContextAnchor.split('.').reduce((anchor, x) => anchor.parent, context);\r\n uiViewContextAnchor = anchorState.name;\r\n } else if (uiViewContextAnchor === '.') {\r\n uiViewContextAnchor = context.name;\r\n }\r\n\r\n return { uiViewName, uiViewContextAnchor };\r\n }\r\n\r\n /** @internal */\r\n constructor(/** @internal */ private router: UIRouter) {}\r\n\r\n /** @internal */\r\n private _rootViewContext(context?: ViewContext): ViewContext {\r\n return (this._rootContext = context || this._rootContext);\r\n }\r\n /** @internal */\r\n private _viewConfigFactory(viewType: string, factory: ViewConfigFactory) {\r\n this._viewConfigFactories[viewType] = factory;\r\n }\r\n\r\n createViewConfig(path: PathNode[], decl: _ViewDeclaration): ViewConfig[] {\r\n const cfgFactory = this._viewConfigFactories[decl.$type];\r\n if (!cfgFactory) throw new Error('ViewService: No view config factory registered for type ' + decl.$type);\r\n const cfgs = cfgFactory(path, decl);\r\n return isArray(cfgs) ? cfgs : [cfgs];\r\n }\r\n\r\n /**\r\n * Deactivates a ViewConfig.\r\n *\r\n * This function deactivates a `ViewConfig`.\r\n * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired.\r\n *\r\n * @param viewConfig The ViewConfig view to deregister.\r\n */\r\n deactivateViewConfig(viewConfig: ViewConfig) {\r\n trace.traceViewServiceEvent('<- Removing', viewConfig);\r\n removeFrom(this._viewConfigs, viewConfig);\r\n }\r\n\r\n activateViewConfig(viewConfig: ViewConfig) {\r\n trace.traceViewServiceEvent('-> Registering', <any>viewConfig);\r\n this._viewConfigs.push(viewConfig);\r\n }\r\n\r\n sync() {\r\n const uiViewsByFqn: TypedMap<ActiveUIView> = this._uiViews.map((uiv) => [uiv.fqn, uiv]).reduce(applyPairs, <any>{});\r\n\r\n // Return a weighted depth value for a uiView.\r\n // The depth is the nesting depth of ui-views (based on FQN; times 10,000)\r\n // plus the depth of the state that is populating the uiView\r\n function uiViewDepth(uiView: ActiveUIView) {\r\n const stateDepth = (context: ViewContext) => (context && context.parent ? stateDepth(context.parent) + 1 : 1);\r\n return uiView.fqn.split('.').length * 10000 + stateDepth(uiView.creationContext);\r\n }\r\n\r\n // Return the ViewConfig's context's depth in the context tree.\r\n function viewConfigDepth(config: ViewConfig) {\r\n let context: ViewContext = config.viewDecl.$context,\r\n count = 0;\r\n while (++count && context.parent) context = context.parent;\r\n return count;\r\n }\r\n\r\n // Given a depth function, returns a compare function which can return either ascending or descending order\r\n const depthCompare = curry((depthFn, posNeg, left, right) => posNeg * (depthFn(left) - depthFn(right)));\r\n\r\n const matchingConfigPair = (uiView: ActiveUIView): ViewTuple => {\r\n const matchingConfigs = this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView));\r\n if (matchingConfigs.length > 1) {\r\n // This is OK. Child states can target a ui-view that the parent state also targets (the child wins)\r\n // Sort by depth and return the match from the deepest child\r\n // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs);\r\n matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending\r\n }\r\n return { uiView, viewConfig: matchingConfigs[0] };\r\n };\r\n\r\n const configureUIView = (tuple: ViewTuple) => {\r\n // If a parent ui-view is reconfigured, it could destroy child ui-views.\r\n // Before configuring a child ui-view, make sure it's still in the active uiViews array.\r\n if (this._uiViews.indexOf(tuple.uiView) !== -1) tuple.uiView.configUpdated(tuple.viewConfig);\r\n };\r\n\r\n // Sort views by FQN and state depth. Process uiviews nearest the root first.\r\n const uiViewTuples = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);\r\n const matchedViewConfigs = uiViewTuples.map((tuple) => tuple.viewConfig);\r\n const unmatchedConfigTuples = this._viewConfigs\r\n .filter((config) => !inArray(matchedViewConfigs, config))\r\n .map((viewConfig) => ({ uiView: undefined, viewConfig }));\r\n\r\n uiViewTuples.forEach(configureUIView);\r\n\r\n const allTuples: ViewTuple[] = uiViewTuples.concat(unmatchedConfigTuples);\r\n this._listeners.forEach((cb) => cb(allTuples));\r\n trace.traceViewSync(allTuples);\r\n }\r\n\r\n /**\r\n * Registers a `ui-view` component\r\n *\r\n * When a `ui-view` component is created, it uses this method to register itself.\r\n * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]].\r\n *\r\n * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,\r\n * and what the view's state context is.\r\n *\r\n * Note: There is no corresponding `deregisterUIView`.\r\n * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself.\r\n *\r\n * @param uiView The metadata for a UIView\r\n * @return a de-registration function used when the view is destroyed.\r\n */\r\n registerUIView(uiView: ActiveUIView) {\r\n trace.traceViewServiceUIViewEvent('-> Registering', uiView);\r\n const uiViews = this._uiViews;\r\n const fqnAndTypeMatches = (uiv: ActiveUIView) => uiv.fqn === uiView.fqn && uiv.$type === uiView.$type;\r\n if (uiViews.filter(fqnAndTypeMatches).length)\r\n trace.traceViewServiceUIViewEvent('!!!! duplicate uiView named:', uiView);\r\n\r\n uiViews.push(uiView);\r\n this.sync();\r\n\r\n return () => {\r\n const idx = uiViews.indexOf(uiView);\r\n if (idx === -1) {\r\n trace.traceViewServiceUIViewEvent('Tried removing non-registered uiView', uiView);\r\n return;\r\n }\r\n trace.traceViewServiceUIViewEvent('<- Deregistering', uiView);\r\n removeFrom(uiViews)(uiView);\r\n };\r\n }\r\n\r\n /**\r\n * Returns the list of views currently available on the page, by fully-qualified name.\r\n *\r\n * @return {Array} Returns an array of fully-qualified view names.\r\n */\r\n available() {\r\n return this._uiViews.map(prop('fqn'));\r\n }\r\n\r\n /**\r\n * Returns the list of views on the page containing loaded content.\r\n *\r\n * @return {Array} Returns an array of fully-qualified view names.\r\n */\r\n active() {\r\n return this._uiViews.filter(prop('$config')).map(prop('name'));\r\n }\r\n}\r\n","//! moment.js\n//! version : 2.29.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks() {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback(callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return (\n input instanceof Array ||\n Object.prototype.toString.call(input) === '[object Array]'\n );\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return (\n input != null &&\n Object.prototype.toString.call(input) === '[object Object]'\n );\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function isObjectEmpty(obj) {\n if (Object.getOwnPropertyNames) {\n return Object.getOwnPropertyNames(obj).length === 0;\n } else {\n var k;\n for (k in obj) {\n if (hasOwnProp(obj, k)) {\n return false;\n }\n }\n return true;\n }\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return (\n typeof input === 'number' ||\n Object.prototype.toString.call(input) === '[object Number]'\n );\n }\n\n function isDate(input) {\n return (\n input instanceof Date ||\n Object.prototype.toString.call(input) === '[object Date]'\n );\n }\n\n function map(arr, fn) {\n var res = [],\n i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidEra: null,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n era: null,\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false,\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this),\n len = t.length >>> 0,\n i;\n\n for (i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m),\n parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n }),\n isNowValid =\n !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidEra &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid =\n isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid(flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n } else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = (hooks.momentProperties = []),\n updateInProgress = false;\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment(obj) {\n return (\n obj instanceof Moment || (obj != null && obj._isAMomentObject != null)\n );\n }\n\n function warn(msg) {\n if (\n hooks.suppressDeprecationWarnings === false &&\n typeof console !== 'undefined' &&\n console.warn\n ) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [],\n arg,\n i,\n key;\n for (i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (key in arguments[0]) {\n if (hasOwnProp(arguments[0], key)) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(\n msg +\n '\\nArguments: ' +\n Array.prototype.slice.call(args).join('') +\n '\\n' +\n new Error().stack\n );\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }\n\n function set(config) {\n var prop, i;\n for (i in config) {\n if (hasOwnProp(config, i)) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' +\n /\\d{1,2}/.source\n );\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig),\n prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (\n hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])\n ) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i,\n res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n };\n\n function calendar(key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (\n (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +\n absNumber\n );\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,\n localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,\n formatFunctions = {},\n formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken(token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(\n func.apply(this, arguments),\n token\n );\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens),\n i,\n length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '',\n i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i])\n ? array[i].call(mom, format)\n : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] =\n formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(\n localFormattingTokens,\n replaceLongDateFormatTokens\n );\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var defaultLongDateFormat = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A',\n };\n\n function longDateFormat(key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper\n .match(formattingTokens)\n .map(function (tok) {\n if (\n tok === 'MMMM' ||\n tok === 'MM' ||\n tok === 'DD' ||\n tok === 'dddd'\n ) {\n return tok.slice(1);\n }\n return tok;\n })\n .join('');\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate() {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d',\n defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal(number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n w: 'a week',\n ww: '%d weeks',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n };\n\n function relativeTime(number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return isFunction(output)\n ? output(number, withoutSuffix, string, isFuture)\n : output.replace(/%d/i, number);\n }\n\n function pastFuture(diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias(unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string'\n ? aliases[units] || aliases[units.toLowerCase()]\n : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [],\n u;\n for (u in unitsObj) {\n if (hasOwnProp(unitsObj, u)) {\n units.push({ unit: u, priority: priorities[u] });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n function absFloor(number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n function makeGetSet(unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get(mom, unit) {\n return mom.isValid()\n ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()\n : NaN;\n }\n\n function set$1(mom, unit, value) {\n if (mom.isValid() && !isNaN(value)) {\n if (\n unit === 'FullYear' &&\n isLeapYear(mom.year()) &&\n mom.month() === 1 &&\n mom.date() === 29\n ) {\n value = toInt(value);\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](\n value,\n mom.month(),\n daysInMonth(value, mom.month())\n );\n } else {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n }\n\n // MOMENTS\n\n function stringGet(units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n function stringSet(units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units),\n i;\n for (i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n var match1 = /\\d/, // 0 - 9\n match2 = /\\d\\d/, // 00 - 99\n match3 = /\\d{3}/, // 000 - 999\n match4 = /\\d{4}/, // 0000 - 9999\n match6 = /[+-]?\\d{6}/, // -999999 - 999999\n match1to2 = /\\d\\d?/, // 0 - 99\n match3to4 = /\\d\\d\\d\\d?/, // 999 - 9999\n match5to6 = /\\d\\d\\d\\d\\d\\d?/, // 99999 - 999999\n match1to3 = /\\d{1,3}/, // 0 - 999\n match1to4 = /\\d{1,4}/, // 0 - 9999\n match1to6 = /[+-]?\\d{1,6}/, // -999999 - 999999\n matchUnsigned = /\\d+/, // 0 - inf\n matchSigned = /[+-]?\\d+/, // -inf - inf\n matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi, // +00:00 -00:00 +0000 -0000 or Z\n matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/, // 123456789 123456789.123\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,\n regexes;\n\n regexes = {};\n\n function addRegexToken(token, regex, strictRegex) {\n regexes[token] = isFunction(regex)\n ? regex\n : function (isStrict, localeData) {\n return isStrict && strictRegex ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken(token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(\n s\n .replace('\\\\', '')\n .replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (\n matched,\n p1,\n p2,\n p3,\n p4\n ) {\n return p1 || p2 || p3 || p4;\n })\n );\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken(token, callback) {\n var i,\n func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken(token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0,\n MONTH = 1,\n DATE = 2,\n HOUR = 3,\n MINUTE = 4,\n SECOND = 5,\n MILLISECOND = 6,\n WEEK = 7,\n WEEKDAY = 8;\n\n function mod(n, x) {\n return ((n % x) + x) % x;\n }\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n var modMonth = mod(month, 12);\n year += (month - modMonth) / 12;\n return modMonth === 1\n ? isLeapYear(year)\n ? 29\n : 28\n : 31 - ((modMonth % 7) % 2);\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PRIORITY\n\n addUnitPriority('month', 8);\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(\n '_'\n ),\n MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,\n defaultMonthsShortRegex = matchWord,\n defaultMonthsRegex = matchWord;\n\n function localeMonths(m, format) {\n if (!m) {\n return isArray(this._months)\n ? this._months\n : this._months['standalone'];\n }\n return isArray(this._months)\n ? this._months[m.month()]\n : this._months[\n (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n ? 'format'\n : 'standalone'\n ][m.month()];\n }\n\n function localeMonthsShort(m, format) {\n if (!m) {\n return isArray(this._monthsShort)\n ? this._monthsShort\n : this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort)\n ? this._monthsShort[m.month()]\n : this._monthsShort[\n MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'\n ][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i,\n ii,\n mom,\n llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse(monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp(\n '^' + this.months(mom, '').replace('.', '') + '$',\n 'i'\n );\n this._shortMonthsParse[i] = new RegExp(\n '^' + this.monthsShort(mom, '').replace('.', '') + '$',\n 'i'\n );\n }\n if (!strict && !this._monthsParse[i]) {\n regex =\n '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'MMMM' &&\n this._longMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'MMM' &&\n this._shortMonthsParse[i].test(monthName)\n ) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth(mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth(value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth() {\n return daysInMonth(this.year(), this.month());\n }\n\n function monthsShortRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict\n ? this._monthsShortStrictRegex\n : this._monthsShortRegex;\n }\n }\n\n function monthsRegex(isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict\n ? this._monthsStrictRegex\n : this._monthsRegex;\n }\n }\n\n function computeMonthsParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._monthsShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? zeroFill(y, 4) : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PRIORITIES\n\n addUnitPriority('year', 1);\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] =\n input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n // HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear() {\n return isLeapYear(this.year());\n }\n\n function createDate(y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date;\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n date = new Date(y + 400, m, d, h, M, s, ms);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n } else {\n date = new Date(y, m, d, h, M, s, ms);\n }\n\n return date;\n }\n\n function createUTCDate(y) {\n var date, args;\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n args = Array.prototype.slice.call(arguments);\n // preserve leap years using a full 400 year cycle, then reset\n args[0] = y + 400;\n date = new Date(Date.UTC.apply(null, args));\n if (isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n } else {\n date = new Date(Date.UTC.apply(null, arguments));\n }\n\n return date;\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear,\n resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear,\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek,\n resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear,\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (\n input,\n week,\n config,\n token\n ) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek(mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n };\n\n function localeFirstDayOfWeek() {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear() {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek(input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek(input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n // LOCALES\n function shiftWeekdays(ws, n) {\n return ws.slice(n, 7).concat(ws.slice(0, n));\n }\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n defaultWeekdaysRegex = matchWord,\n defaultWeekdaysShortRegex = matchWord,\n defaultWeekdaysMinRegex = matchWord;\n\n function localeWeekdays(m, format) {\n var weekdays = isArray(this._weekdays)\n ? this._weekdays\n : this._weekdays[\n m && m !== true && this._weekdays.isFormat.test(format)\n ? 'format'\n : 'standalone'\n ];\n return m === true\n ? shiftWeekdays(weekdays, this._week.dow)\n : m\n ? weekdays[m.day()]\n : weekdays;\n }\n\n function localeWeekdaysShort(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysShort, this._week.dow)\n : m\n ? this._weekdaysShort[m.day()]\n : this._weekdaysShort;\n }\n\n function localeWeekdaysMin(m) {\n return m === true\n ? shiftWeekdays(this._weekdaysMin, this._week.dow)\n : m\n ? this._weekdaysMin[m.day()]\n : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i,\n ii,\n mom,\n llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(\n mom,\n ''\n ).toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(\n mom,\n ''\n ).toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse(weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp(\n '^' + this.weekdays(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._shortWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysShort(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n this._minWeekdaysParse[i] = new RegExp(\n '^' + this.weekdaysMin(mom, '').replace('.', '\\\\.?') + '$',\n 'i'\n );\n }\n if (!this._weekdaysParse[i]) {\n regex =\n '^' +\n this.weekdays(mom, '') +\n '|^' +\n this.weekdaysShort(mom, '') +\n '|^' +\n this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (\n strict &&\n format === 'dddd' &&\n this._fullWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'ddd' &&\n this._shortWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (\n strict &&\n format === 'dd' &&\n this._minWeekdaysParse[i].test(weekdayName)\n ) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek(input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n function weekdaysRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict\n ? this._weekdaysStrictRegex\n : this._weekdaysRegex;\n }\n }\n\n function weekdaysShortRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict\n ? this._weekdaysShortStrictRegex\n : this._weekdaysShortRegex;\n }\n }\n\n function weekdaysMinRegex(isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict\n ? this._weekdaysMinStrictRegex\n : this._weekdaysMinRegex;\n }\n }\n\n function computeWeekdaysParse() {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [],\n shortPieces = [],\n longPieces = [],\n mixedPieces = [],\n i,\n mom,\n minp,\n shortp,\n longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = regexEscape(this.weekdaysMin(mom, ''));\n shortp = regexEscape(this.weekdaysShort(mom, ''));\n longp = regexEscape(this.weekdays(mom, ''));\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp(\n '^(' + longPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysShortStrictRegex = new RegExp(\n '^(' + shortPieces.join('|') + ')',\n 'i'\n );\n this._weekdaysMinStrictRegex = new RegExp(\n '^(' + minPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return (\n '' +\n hFormat.apply(this) +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return (\n '' +\n this.hours() +\n zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2)\n );\n });\n\n function meridiem(token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(\n this.hours(),\n this.minutes(),\n lowercase\n );\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PRIORITY\n addUnitPriority('hour', 13);\n\n // PARSING\n\n function matchMeridiem(isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4,\n pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM(input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return (input + '').toLowerCase().charAt(0) === 'p';\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i,\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour they want. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n getSetHour = makeGetSet('Hours', true);\n\n function localeMeridiem(hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse,\n };\n\n // internal storage for locale config files\n var locales = {},\n localeFamilies = {},\n globalLocale;\n\n function commonPrefix(arr1, arr2) {\n var i,\n minl = Math.min(arr1.length, arr2.length);\n for (i = 0; i < minl; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return i;\n }\n }\n return minl;\n }\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (\n next &&\n next.length >= j &&\n commonPrefix(split, next) >= j - 1\n ) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }\n\n function loadLocale(name) {\n var oldLocale = null,\n aliasedRequire;\n // TODO: Find a better way to register and load all the locales in Node\n if (\n locales[name] === undefined &&\n typeof module !== 'undefined' &&\n module &&\n module.exports\n ) {\n try {\n oldLocale = globalLocale._abbr;\n aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {\n // mark as not found to avoid repeating expensive file require call causing high CPU\n // when trying to find en-US, en_US, en-us for every format call\n locales[name] = null; // null means not found\n }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale(name, config) {\n if (config !== null) {\n var locale,\n parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple(\n 'defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'\n );\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n locale = loadLocale(config.parentLocale);\n if (locale != null) {\n parentConfig = locale._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config,\n });\n return null;\n }\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale,\n tmpLocale,\n parentConfig = baseConfig;\n\n if (locales[name] != null && locales[name].parentLocale != null) {\n // Update existing child locale in-place to avoid memory-leaks\n locales[name].set(mergeConfigs(locales[name]._config, config));\n } else {\n // MERGE\n tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n config = mergeConfigs(parentConfig, config);\n if (tmpLocale == null) {\n // updateLocale is called for creating a new locale\n // Set abbr so it will have a name (getters return\n // undefined otherwise).\n config.abbr = name;\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n }\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n if (name === getSetGlobalLocale()) {\n getSetGlobalLocale(name);\n }\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function getLocale(key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys(locales);\n }\n\n function checkOverflow(m) {\n var overflow,\n a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11\n ? MONTH\n : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])\n ? DATE\n : a[HOUR] < 0 ||\n a[HOUR] > 24 ||\n (a[HOUR] === 24 &&\n (a[MINUTE] !== 0 ||\n a[SECOND] !== 0 ||\n a[MILLISECOND] !== 0))\n ? HOUR\n : a[MINUTE] < 0 || a[MINUTE] > 59\n ? MINUTE\n : a[SECOND] < 0 || a[SECOND] > 59\n ? SECOND\n : a[MILLISECOND] < 0 || a[MILLISECOND] > 999\n ? MILLISECOND\n : -1;\n\n if (\n getParsingFlags(m)._overflowDayOfYear &&\n (overflow < YEAR || overflow > DATE)\n ) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,\n tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/,\n isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/],\n ['YYYYMM', /\\d{6}/, false],\n ['YYYY', /\\d{4}/, false],\n ],\n // iso time formats and regexes\n isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/],\n ],\n aspNetJsonRegex = /^\\/?Date\\((-?\\d+)/i,\n // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,\n obsOffsets = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n };\n\n // date from iso format\n function configFromISO(config) {\n var i,\n l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime,\n dateFormat,\n timeFormat,\n tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n function extractFromRFC2822Strings(\n yearStr,\n monthStr,\n dayStr,\n hourStr,\n minuteStr,\n secondStr\n ) {\n var result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10),\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n }\n\n function untruncateYear(yearStr) {\n var year = parseInt(yearStr, 10);\n if (year <= 49) {\n return 2000 + year;\n } else if (year <= 999) {\n return 1900 + year;\n }\n return year;\n }\n\n function preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^)]*\\)|[\\n\\t]/g, ' ')\n .replace(/(\\s\\s+)/g, ' ')\n .replace(/^\\s\\s*/, '')\n .replace(/\\s\\s*$/, '');\n }\n\n function checkWeekday(weekdayStr, parsedInput, config) {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an independent day-of-week check.\n var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),\n weekdayActual = new Date(\n parsedInput[0],\n parsedInput[1],\n parsedInput[2]\n ).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return false;\n }\n }\n return true;\n }\n\n function calculateOffset(obsOffset, militaryOffset, numOffset) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n var hm = parseInt(numOffset, 10),\n m = hm % 100,\n h = (hm - m) / 100;\n return h * 60 + m;\n }\n }\n\n // date and time from ref 2822 format\n function configFromRFC2822(config) {\n var match = rfc2822.exec(preprocessRFC2822(config._i)),\n parsedArray;\n if (match) {\n parsedArray = extractFromRFC2822Strings(\n match[4],\n match[3],\n match[2],\n match[5],\n match[6],\n match[7]\n );\n if (!checkWeekday(match[1], parsedArray, config)) {\n return;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n if (config._strict) {\n config._isValid = false;\n } else {\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [\n nowValue.getUTCFullYear(),\n nowValue.getUTCMonth(),\n nowValue.getUTCDate(),\n ];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n expectedWeekday,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (\n config._dayOfYear > daysInYear(yearToUse) ||\n config._dayOfYear === 0\n ) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] =\n config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (\n config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0\n ) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(\n null,\n input\n );\n expectedWeekday = config._useUTC\n ? config._d.getUTCDay()\n : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (\n config._w &&\n typeof config._w.d !== 'undefined' &&\n config._w.d !== expectedWeekday\n ) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(\n w.GG,\n config._a[YEAR],\n weekOfYear(createLocal(), 1, 4).year\n );\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n // constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0,\n era;\n\n tokens =\n expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) ||\n [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(\n string.indexOf(parsedInput) + parsedInput.length\n );\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver =\n stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (\n config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0\n ) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(\n config._locale,\n config._a[HOUR],\n config._meridiem\n );\n\n // handle era\n era = getParsingFlags(config).era;\n if (era !== null) {\n config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);\n }\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n function meridiemFixWrap(locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n scoreToBeat,\n i,\n currentScore,\n validFormatFound,\n bestFormatIsValid = false;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n validFormatFound = false;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (isValid(tempConfig)) {\n validFormatFound = true;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (!bestFormatIsValid) {\n if (\n scoreToBeat == null ||\n currentScore < scoreToBeat ||\n validFormatFound\n ) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n if (validFormatFound) {\n bestFormatIsValid = true;\n }\n }\n } else {\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i),\n dayOrDate = i.day === undefined ? i.date : i.day;\n config._a = map(\n [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],\n function (obj) {\n return obj && parseInt(obj, 10);\n }\n );\n\n configFromArray(config);\n }\n\n function createFromConfig(config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig(config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({ nullInput: true });\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC(input, format, locale, strict, isUTC) {\n var c = {};\n\n if (format === true || format === false) {\n strict = format;\n format = undefined;\n }\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if (\n (isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)\n ) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal(input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n ),\n prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max() {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +new Date();\n };\n\n var ordering = [\n 'year',\n 'quarter',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'millisecond',\n ];\n\n function isDurationValid(m) {\n var key,\n unitHasDecimal = false,\n i;\n for (key in m) {\n if (\n hasOwnProp(m, key) &&\n !(\n indexOf.call(ordering, key) !== -1 &&\n (m[key] == null || !isNaN(m[key]))\n )\n ) {\n return false;\n }\n }\n\n for (i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration(duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || normalizedInput.isoWeek || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds =\n +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days + weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months + quarters * 3 + years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration(obj) {\n return obj instanceof Duration;\n }\n\n function absRound(number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n // FORMATTING\n\n function offset(token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset(),\n sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return (\n sign +\n zeroFill(~~(offset / 60), 2) +\n separator +\n zeroFill(~~offset % 60, 2)\n );\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher),\n chunk,\n parts,\n minutes;\n\n if (matches === null) {\n return null;\n }\n\n chunk = matches[matches.length - 1] || [];\n parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff =\n (isMoment(input) || isDate(input)\n ? input.valueOf()\n : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset(m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset());\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset(input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(\n this,\n createDuration(input - offset, 'm'),\n 1,\n false\n );\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC(keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal(keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset() {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n } else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset(input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime() {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {},\n other;\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted =\n this.isValid() && compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n isoRegex = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\n function createDuration(input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms: input._milliseconds,\n d: input._days,\n M: input._months,\n };\n } else if (isNumber(input) || !isNaN(+input)) {\n duration = {};\n if (key) {\n duration[key] = +input;\n } else {\n duration.milliseconds = +input;\n }\n } else if ((match = aspNetRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: 0,\n d: toInt(match[DATE]) * sign,\n h: toInt(match[HOUR]) * sign,\n m: toInt(match[MINUTE]) * sign,\n s: toInt(match[SECOND]) * sign,\n ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match\n };\n } else if ((match = isoRegex.exec(input))) {\n sign = match[1] === '-' ? -1 : 1;\n duration = {\n y: parseIso(match[2], sign),\n M: parseIso(match[3], sign),\n w: parseIso(match[4], sign),\n d: parseIso(match[5], sign),\n h: parseIso(match[6], sign),\n m: parseIso(match[7], sign),\n s: parseIso(match[8], sign),\n };\n } else if (duration == null) {\n // checks for null or undefined\n duration = {};\n } else if (\n typeof duration === 'object' &&\n ('from' in duration || 'to' in duration)\n ) {\n diffRes = momentsDifference(\n createLocal(duration.from),\n createLocal(duration.to)\n );\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n if (isDuration(input) && hasOwnProp(input, '_isValid')) {\n ret._isValid = input._isValid;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso(inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {};\n\n res.months =\n other.month() - base.month() + (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +base.clone().add(res.months, 'M');\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return { milliseconds: 0, months: 0 };\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(\n name,\n 'moment().' +\n name +\n '(period, number) is deprecated. Please use moment().' +\n name +\n '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'\n );\n tmp = val;\n val = period;\n period = tmp;\n }\n\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract(mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add'),\n subtract = createAdder(-1, 'subtract');\n\n function isString(input) {\n return typeof input === 'string' || input instanceof String;\n }\n\n // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined\n function isMomentInput(input) {\n return (\n isMoment(input) ||\n isDate(input) ||\n isString(input) ||\n isNumber(input) ||\n isNumberOrStringArray(input) ||\n isMomentInputObject(input) ||\n input === null ||\n input === undefined\n );\n }\n\n function isMomentInputObject(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'years',\n 'year',\n 'y',\n 'months',\n 'month',\n 'M',\n 'days',\n 'day',\n 'd',\n 'dates',\n 'date',\n 'D',\n 'hours',\n 'hour',\n 'h',\n 'minutes',\n 'minute',\n 'm',\n 'seconds',\n 'second',\n 's',\n 'milliseconds',\n 'millisecond',\n 'ms',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function isNumberOrStringArray(input) {\n var arrayTest = isArray(input),\n dataTypeTest = false;\n if (arrayTest) {\n dataTypeTest =\n input.filter(function (item) {\n return !isNumber(item) && isString(input);\n }).length === 0;\n }\n return arrayTest && dataTypeTest;\n }\n\n function isCalendarSpec(input) {\n var objectTest = isObject(input) && !isObjectEmpty(input),\n propertyTest = false,\n properties = [\n 'sameDay',\n 'nextDay',\n 'lastDay',\n 'nextWeek',\n 'lastWeek',\n 'sameElse',\n ],\n i,\n property;\n\n for (i = 0; i < properties.length; i += 1) {\n property = properties[i];\n propertyTest = propertyTest || hasOwnProp(input, property);\n }\n\n return objectTest && propertyTest;\n }\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6\n ? 'sameElse'\n : diff < -1\n ? 'lastWeek'\n : diff < 0\n ? 'lastDay'\n : diff < 1\n ? 'sameDay'\n : diff < 2\n ? 'nextDay'\n : diff < 7\n ? 'nextWeek'\n : 'sameElse';\n }\n\n function calendar$1(time, formats) {\n // Support for single parameter, formats only overload to the calendar function\n if (arguments.length === 1) {\n if (!arguments[0]) {\n time = undefined;\n formats = undefined;\n } else if (isMomentInput(arguments[0])) {\n time = arguments[0];\n formats = undefined;\n } else if (isCalendarSpec(arguments[0])) {\n formats = arguments[0];\n time = undefined;\n }\n }\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse',\n output =\n formats &&\n (isFunction(formats[format])\n ? formats[format].call(this, now)\n : formats[format]);\n\n return this.format(\n output || this.localeData().calendar(format, this, createLocal(now))\n );\n }\n\n function clone() {\n return new Moment(this);\n }\n\n function isAfter(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween(from, to, units, inclusivity) {\n var localFrom = isMoment(from) ? from : createLocal(from),\n localTo = isMoment(to) ? to : createLocal(to);\n if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {\n return false;\n }\n inclusivity = inclusivity || '()';\n return (\n (inclusivity[0] === '('\n ? this.isAfter(localFrom, units)\n : !this.isBefore(localFrom, units)) &&\n (inclusivity[1] === ')'\n ? this.isBefore(localTo, units)\n : !this.isAfter(localTo, units))\n );\n }\n\n function isSame(input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units) || 'millisecond';\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return (\n this.clone().startOf(units).valueOf() <= inputMs &&\n inputMs <= this.clone().endOf(units).valueOf()\n );\n }\n }\n\n function isSameOrAfter(input, units) {\n return this.isSame(input, units) || this.isAfter(input, units);\n }\n\n function isSameOrBefore(input, units) {\n return this.isSame(input, units) || this.isBefore(input, units);\n }\n\n function diff(input, units, asFloat) {\n var that, zoneDelta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n switch (units) {\n case 'year':\n output = monthDiff(this, that) / 12;\n break;\n case 'month':\n output = monthDiff(this, that);\n break;\n case 'quarter':\n output = monthDiff(this, that) / 3;\n break;\n case 'second':\n output = (this - that) / 1e3;\n break; // 1000\n case 'minute':\n output = (this - that) / 6e4;\n break; // 1000 * 60\n case 'hour':\n output = (this - that) / 36e5;\n break; // 1000 * 60 * 60\n case 'day':\n output = (this - that - zoneDelta) / 864e5;\n break; // 1000 * 60 * 60 * 24, negate dst\n case 'week':\n output = (this - that - zoneDelta) / 6048e5;\n break; // 1000 * 60 * 60 * 24 * 7, negate dst\n default:\n output = this - that;\n }\n\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff(a, b) {\n if (a.date() < b.date()) {\n // end-of-month calculations work correct when the start month has more\n // days than the end month.\n return -monthDiff(b, a);\n }\n // difference in months\n var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2,\n adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString() {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString(keepOffset) {\n if (!this.isValid()) {\n return null;\n }\n var utc = keepOffset !== true,\n m = utc ? this.clone().utc() : this;\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(\n m,\n utc\n ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'\n : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n if (utc) {\n return this.toDate().toISOString();\n } else {\n return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)\n .toISOString()\n .replace('Z', formatMoment(m, 'Z'));\n }\n }\n return formatMoment(\n m,\n utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'\n );\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect() {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment',\n zone = '',\n prefix,\n year,\n datetime,\n suffix;\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n prefix = '[' + func + '(\"]';\n year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';\n datetime = '-MM-DD[T]HH:mm:ss.SSS';\n suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format(inputString) {\n if (!inputString) {\n inputString = this.isUtc()\n ? hooks.defaultFormatUtc\n : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ to: this, from: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow(withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to(time, withoutSuffix) {\n if (\n this.isValid() &&\n ((isMoment(time) && time.isValid()) || createLocal(time).isValid())\n ) {\n return createDuration({ from: this, to: time })\n .locale(this.locale())\n .humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow(withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale(key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData() {\n return this._locale;\n }\n\n var MS_PER_SECOND = 1000,\n MS_PER_MINUTE = 60 * MS_PER_SECOND,\n MS_PER_HOUR = 60 * MS_PER_MINUTE,\n MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;\n\n // actual modulo - handles negative numbers (for dates before 1970):\n function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }\n\n function localStartOfDate(y, m, d) {\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return new Date(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return new Date(y, m, d).valueOf();\n }\n }\n\n function utcStartOfDate(y, m, d) {\n // Date.UTC remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0) {\n // preserve leap years using a full 400 year cycle, then reset\n return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;\n } else {\n return Date.UTC(y, m, d);\n }\n }\n\n function startOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year(), 0, 1);\n break;\n case 'quarter':\n time = startOfDate(\n this.year(),\n this.month() - (this.month() % 3),\n 1\n );\n break;\n case 'month':\n time = startOfDate(this.year(), this.month(), 1);\n break;\n case 'week':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday()\n );\n break;\n case 'isoWeek':\n time = startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1)\n );\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date());\n break;\n case 'hour':\n time = this._d.valueOf();\n time -= mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n );\n break;\n case 'minute':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_MINUTE);\n break;\n case 'second':\n time = this._d.valueOf();\n time -= mod$1(time, MS_PER_SECOND);\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function endOf(units) {\n var time, startOfDate;\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond' || !this.isValid()) {\n return this;\n }\n\n startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;\n\n switch (units) {\n case 'year':\n time = startOfDate(this.year() + 1, 0, 1) - 1;\n break;\n case 'quarter':\n time =\n startOfDate(\n this.year(),\n this.month() - (this.month() % 3) + 3,\n 1\n ) - 1;\n break;\n case 'month':\n time = startOfDate(this.year(), this.month() + 1, 1) - 1;\n break;\n case 'week':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - this.weekday() + 7\n ) - 1;\n break;\n case 'isoWeek':\n time =\n startOfDate(\n this.year(),\n this.month(),\n this.date() - (this.isoWeekday() - 1) + 7\n ) - 1;\n break;\n case 'day':\n case 'date':\n time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;\n break;\n case 'hour':\n time = this._d.valueOf();\n time +=\n MS_PER_HOUR -\n mod$1(\n time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),\n MS_PER_HOUR\n ) -\n 1;\n break;\n case 'minute':\n time = this._d.valueOf();\n time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;\n break;\n case 'second':\n time = this._d.valueOf();\n time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;\n break;\n }\n\n this._d.setTime(time);\n hooks.updateOffset(this, true);\n return this;\n }\n\n function valueOf() {\n return this._d.valueOf() - (this._offset || 0) * 60000;\n }\n\n function unix() {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate() {\n return new Date(this.valueOf());\n }\n\n function toArray() {\n var m = this;\n return [\n m.year(),\n m.month(),\n m.date(),\n m.hour(),\n m.minute(),\n m.second(),\n m.millisecond(),\n ];\n }\n\n function toObject() {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds(),\n };\n }\n\n function toJSON() {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2() {\n return isValid(this);\n }\n\n function parsingFlags() {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt() {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict,\n };\n }\n\n addFormatToken('N', 0, 0, 'eraAbbr');\n addFormatToken('NN', 0, 0, 'eraAbbr');\n addFormatToken('NNN', 0, 0, 'eraAbbr');\n addFormatToken('NNNN', 0, 0, 'eraName');\n addFormatToken('NNNNN', 0, 0, 'eraNarrow');\n\n addFormatToken('y', ['y', 1], 'yo', 'eraYear');\n addFormatToken('y', ['yy', 2], 0, 'eraYear');\n addFormatToken('y', ['yyy', 3], 0, 'eraYear');\n addFormatToken('y', ['yyyy', 4], 0, 'eraYear');\n\n addRegexToken('N', matchEraAbbr);\n addRegexToken('NN', matchEraAbbr);\n addRegexToken('NNN', matchEraAbbr);\n addRegexToken('NNNN', matchEraName);\n addRegexToken('NNNNN', matchEraNarrow);\n\n addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (\n input,\n array,\n config,\n token\n ) {\n var era = config._locale.erasParse(input, token, config._strict);\n if (era) {\n getParsingFlags(config).era = era;\n } else {\n getParsingFlags(config).invalidEra = input;\n }\n });\n\n addRegexToken('y', matchUnsigned);\n addRegexToken('yy', matchUnsigned);\n addRegexToken('yyy', matchUnsigned);\n addRegexToken('yyyy', matchUnsigned);\n addRegexToken('yo', matchEraYearOrdinal);\n\n addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);\n addParseToken(['yo'], function (input, array, config, token) {\n var match;\n if (config._locale._eraYearOrdinalRegex) {\n match = input.match(config._locale._eraYearOrdinalRegex);\n }\n\n if (config._locale.eraYearOrdinalParse) {\n array[YEAR] = config._locale.eraYearOrdinalParse(input, match);\n } else {\n array[YEAR] = parseInt(input, 10);\n }\n });\n\n function localeEras(m, format) {\n var i,\n l,\n date,\n eras = this._eras || getLocale('en')._eras;\n for (i = 0, l = eras.length; i < l; ++i) {\n switch (typeof eras[i].since) {\n case 'string':\n // truncate time\n date = hooks(eras[i].since).startOf('day');\n eras[i].since = date.valueOf();\n break;\n }\n\n switch (typeof eras[i].until) {\n case 'undefined':\n eras[i].until = +Infinity;\n break;\n case 'string':\n // truncate time\n date = hooks(eras[i].until).startOf('day').valueOf();\n eras[i].until = date.valueOf();\n break;\n }\n }\n return eras;\n }\n\n function localeErasParse(eraName, format, strict) {\n var i,\n l,\n eras = this.eras(),\n name,\n abbr,\n narrow;\n eraName = eraName.toUpperCase();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n name = eras[i].name.toUpperCase();\n abbr = eras[i].abbr.toUpperCase();\n narrow = eras[i].narrow.toUpperCase();\n\n if (strict) {\n switch (format) {\n case 'N':\n case 'NN':\n case 'NNN':\n if (abbr === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNN':\n if (name === eraName) {\n return eras[i];\n }\n break;\n\n case 'NNNNN':\n if (narrow === eraName) {\n return eras[i];\n }\n break;\n }\n } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {\n return eras[i];\n }\n }\n }\n\n function localeErasConvertYear(era, year) {\n var dir = era.since <= era.until ? +1 : -1;\n if (year === undefined) {\n return hooks(era.since).year();\n } else {\n return hooks(era.since).year() + (year - era.offset) * dir;\n }\n }\n\n function getEraName() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].name;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].name;\n }\n }\n\n return '';\n }\n\n function getEraNarrow() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].narrow;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].narrow;\n }\n }\n\n return '';\n }\n\n function getEraAbbr() {\n var i,\n l,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (eras[i].since <= val && val <= eras[i].until) {\n return eras[i].abbr;\n }\n if (eras[i].until <= val && val <= eras[i].since) {\n return eras[i].abbr;\n }\n }\n\n return '';\n }\n\n function getEraYear() {\n var i,\n l,\n dir,\n val,\n eras = this.localeData().eras();\n for (i = 0, l = eras.length; i < l; ++i) {\n dir = eras[i].since <= eras[i].until ? +1 : -1;\n\n // truncate time\n val = this.clone().startOf('day').valueOf();\n\n if (\n (eras[i].since <= val && val <= eras[i].until) ||\n (eras[i].until <= val && val <= eras[i].since)\n ) {\n return (\n (this.year() - hooks(eras[i].since).year()) * dir +\n eras[i].offset\n );\n }\n }\n\n return this.year();\n }\n\n function erasNameRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNameRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNameRegex : this._erasRegex;\n }\n\n function erasAbbrRegex(isStrict) {\n if (!hasOwnProp(this, '_erasAbbrRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasAbbrRegex : this._erasRegex;\n }\n\n function erasNarrowRegex(isStrict) {\n if (!hasOwnProp(this, '_erasNarrowRegex')) {\n computeErasParse.call(this);\n }\n return isStrict ? this._erasNarrowRegex : this._erasRegex;\n }\n\n function matchEraAbbr(isStrict, locale) {\n return locale.erasAbbrRegex(isStrict);\n }\n\n function matchEraName(isStrict, locale) {\n return locale.erasNameRegex(isStrict);\n }\n\n function matchEraNarrow(isStrict, locale) {\n return locale.erasNarrowRegex(isStrict);\n }\n\n function matchEraYearOrdinal(isStrict, locale) {\n return locale._eraYearOrdinalRegex || matchUnsigned;\n }\n\n function computeErasParse() {\n var abbrPieces = [],\n namePieces = [],\n narrowPieces = [],\n mixedPieces = [],\n i,\n l,\n eras = this.eras();\n\n for (i = 0, l = eras.length; i < l; ++i) {\n namePieces.push(regexEscape(eras[i].name));\n abbrPieces.push(regexEscape(eras[i].abbr));\n narrowPieces.push(regexEscape(eras[i].narrow));\n\n mixedPieces.push(regexEscape(eras[i].name));\n mixedPieces.push(regexEscape(eras[i].abbr));\n mixedPieces.push(regexEscape(eras[i].narrow));\n }\n\n this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');\n this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');\n this._erasNarrowRegex = new RegExp(\n '^(' + narrowPieces.join('|') + ')',\n 'i'\n );\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken(token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (\n input,\n week,\n config,\n token\n ) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy\n );\n }\n\n function getSetISOWeekYear(input) {\n return getSetWeekYearHelper.call(\n this,\n input,\n this.isoWeek(),\n this.isoWeekday(),\n 1,\n 4\n );\n }\n\n function getISOWeeksInYear() {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getISOWeeksInISOWeekYear() {\n return weeksInYear(this.isoWeekYear(), 1, 4);\n }\n\n function getWeeksInYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getWeeksInWeekYear() {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PRIORITY\n\n addUnitPriority('quarter', 7);\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter(input) {\n return input == null\n ? Math.ceil((this.month() + 1) / 3)\n : this.month((input - 1) * 3 + (this.month() % 3));\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PRIORITY\n addUnitPriority('date', 9);\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict\n ? locale._dayOfMonthOrdinalParse || locale._ordinalParse\n : locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0]);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear(input) {\n var dayOfYear =\n Math.round(\n (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5\n ) + 1;\n return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PRIORITY\n\n addUnitPriority('minute', 14);\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PRIORITY\n\n addUnitPriority('second', 15);\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token, getSetMillisecond;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n\n getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr() {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName() {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n if (typeof Symbol !== 'undefined' && Symbol.for != null) {\n proto[Symbol.for('nodejs.util.inspect.custom')] = function () {\n return 'Moment<' + this.format() + '>';\n };\n }\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n proto.eraName = getEraName;\n proto.eraNarrow = getEraNarrow;\n proto.eraAbbr = getEraAbbr;\n proto.eraYear = getEraYear;\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n proto.quarter = proto.quarters = getSetQuarter;\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.weeksInWeekYear = getWeeksInWeekYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n proto.hour = proto.hours = getSetHour;\n proto.minute = proto.minutes = getSetMinute;\n proto.second = proto.seconds = getSetSecond;\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n proto.dates = deprecate(\n 'dates accessor is deprecated. Use date instead.',\n getSetDayOfMonth\n );\n proto.months = deprecate(\n 'months accessor is deprecated. Use month instead',\n getSetMonth\n );\n proto.years = deprecate(\n 'years accessor is deprecated. Use year instead',\n getSetYear\n );\n proto.zone = deprecate(\n 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',\n getSetZone\n );\n proto.isDSTShifted = deprecate(\n 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',\n isDaylightSavingTimeShifted\n );\n\n function createUnix(input) {\n return createLocal(input * 1000);\n }\n\n function createInZone() {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat(string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n proto$1.eras = localeEras;\n proto$1.erasParse = localeErasParse;\n proto$1.erasConvertYear = localeErasConvertYear;\n proto$1.erasAbbrRegex = erasAbbrRegex;\n proto$1.erasNameRegex = erasNameRegex;\n proto$1.erasNarrowRegex = erasNarrowRegex;\n\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1(format, index, field, setter) {\n var locale = getLocale(),\n utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl(format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i,\n out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl(localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0,\n i,\n out = [];\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths(format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort(format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin(localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n eras: [\n {\n since: '0001-01-01',\n until: +Infinity,\n offset: 1,\n name: 'Anno Domini',\n narrow: 'AD',\n abbr: 'AD',\n },\n {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: 'Before Christ',\n narrow: 'BC',\n abbr: 'BC',\n },\n ],\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n toInt((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n // Side effect imports\n\n hooks.lang = deprecate(\n 'moment.lang is deprecated. Use moment.locale instead.',\n getSetGlobalLocale\n );\n hooks.langData = deprecate(\n 'moment.langData is deprecated. Use moment.localeData instead.',\n getLocale\n );\n\n var mathAbs = Math.abs;\n\n function abs() {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1(duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function add$1(input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1(input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil(number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble() {\n var milliseconds = this._milliseconds,\n days = this._days,\n months = this._months,\n data = this._data,\n seconds,\n minutes,\n hours,\n years,\n monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (\n !(\n (milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0)\n )\n ) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths(days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return (days * 4800) / 146097;\n }\n\n function monthsToDays(months) {\n // the reverse of daysToMonths\n return (months * 146097) / 4800;\n }\n\n function as(units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days,\n months,\n milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'quarter' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n switch (units) {\n case 'month':\n return months;\n case 'quarter':\n return months / 3;\n case 'year':\n return months / 12;\n }\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week':\n return days / 7 + milliseconds / 6048e5;\n case 'day':\n return days + milliseconds / 864e5;\n case 'hour':\n return days * 24 + milliseconds / 36e5;\n case 'minute':\n return days * 1440 + milliseconds / 6e4;\n case 'second':\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function valueOf$1() {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs(alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms'),\n asSeconds = makeAs('s'),\n asMinutes = makeAs('m'),\n asHours = makeAs('h'),\n asDays = makeAs('d'),\n asWeeks = makeAs('w'),\n asMonths = makeAs('M'),\n asQuarters = makeAs('Q'),\n asYears = makeAs('y');\n\n function clone$1() {\n return createDuration(this);\n }\n\n function get$2(units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds'),\n seconds = makeGetter('seconds'),\n minutes = makeGetter('minutes'),\n hours = makeGetter('hours'),\n days = makeGetter('days'),\n months = makeGetter('months'),\n years = makeGetter('years');\n\n function weeks() {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round,\n thresholds = {\n ss: 44, // a few seconds to seconds\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month/week\n w: null, // weeks to month\n M: 11, // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {\n var duration = createDuration(posNegDuration).abs(),\n seconds = round(duration.as('s')),\n minutes = round(duration.as('m')),\n hours = round(duration.as('h')),\n days = round(duration.as('d')),\n months = round(duration.as('M')),\n weeks = round(duration.as('w')),\n years = round(duration.as('y')),\n a =\n (seconds <= thresholds.ss && ['s', seconds]) ||\n (seconds < thresholds.s && ['ss', seconds]) ||\n (minutes <= 1 && ['m']) ||\n (minutes < thresholds.m && ['mm', minutes]) ||\n (hours <= 1 && ['h']) ||\n (hours < thresholds.h && ['hh', hours]) ||\n (days <= 1 && ['d']) ||\n (days < thresholds.d && ['dd', days]);\n\n if (thresholds.w != null) {\n a =\n a ||\n (weeks <= 1 && ['w']) ||\n (weeks < thresholds.w && ['ww', weeks]);\n }\n a = a ||\n (months <= 1 && ['M']) ||\n (months < thresholds.M && ['MM', months]) ||\n (years <= 1 && ['y']) || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n // This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold(threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize(argWithSuffix, argThresholds) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var withSuffix = false,\n th = thresholds,\n locale,\n output;\n\n if (typeof argWithSuffix === 'object') {\n argThresholds = argWithSuffix;\n argWithSuffix = false;\n }\n if (typeof argWithSuffix === 'boolean') {\n withSuffix = argWithSuffix;\n }\n if (typeof argThresholds === 'object') {\n th = Object.assign({}, thresholds, argThresholds);\n if (argThresholds.s != null && argThresholds.ss == null) {\n th.ss = argThresholds.s - 1;\n }\n }\n\n locale = this.localeData();\n output = relativeTime$1(this, !withSuffix, th, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function sign(x) {\n return (x > 0) - (x < 0) || +x;\n }\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000,\n days = abs$1(this._days),\n months = abs$1(this._months),\n minutes,\n hours,\n years,\n s,\n total = this.asSeconds(),\n totalSign,\n ymSign,\n daysSign,\n hmsSign;\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n s = seconds ? seconds.toFixed(3).replace(/\\.?0+$/, '') : '';\n\n totalSign = total < 0 ? '-' : '';\n ymSign = sign(this._months) !== sign(total) ? '-' : '';\n daysSign = sign(this._days) !== sign(total) ? '-' : '';\n hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';\n\n return (\n totalSign +\n 'P' +\n (years ? ymSign + years + 'Y' : '') +\n (months ? ymSign + months + 'M' : '') +\n (days ? daysSign + days + 'D' : '') +\n (hours || minutes || seconds ? 'T' : '') +\n (hours ? hmsSign + hours + 'H' : '') +\n (minutes ? hmsSign + minutes + 'M' : '') +\n (seconds ? hmsSign + s + 'S' : '')\n );\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asQuarters = asQuarters;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.clone = clone$1;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n proto$2.toIsoString = deprecate(\n 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',\n toISOString$1\n );\n proto$2.lang = lang;\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n //! moment.js\n\n hooks.version = '2.29.1';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n // currently HTML5 input type only supports 24-hour formats\n hooks.HTML5_FMT = {\n DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type=\"datetime-local\" />\n DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type=\"datetime-local\" step=\"1\" />\n DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type=\"datetime-local\" step=\"0.001\" />\n DATE: 'YYYY-MM-DD', // <input type=\"date\" />\n TIME: 'HH:mm', // <input type=\"time\" />\n TIME_SECONDS: 'HH:mm:ss', // <input type=\"time\" step=\"1\" />\n TIME_MS: 'HH:mm:ss.SSS', // <input type=\"time\" step=\"0.001\" />\n WEEK: 'GGGG-[W]WW', // <input type=\"week\" />\n MONTH: 'YYYY-MM', // <input type=\"month\" />\n };\n\n return hooks;\n\n})));\n","// The point of this package is to be a noop output for 'angular' package so that @uirouter/angularjs doesn't include the whole angular library\r\n// in the build output, and instead just uses the global already on the page (from a <script>).\r\n// The version is just set to be the last stable version of angular.js, since it's now EOL.\r\nif (!window.hasOwnProperty('angular')) {\r\n throw new Error('angular is not available, so angular-noop is not being used correctly, or is unnecessary');\r\n}\r\nconsole.log('loading angular-noop, because angular is already loaded elsewhere');\r\nmodule.exports = undefined;\r\n","export function isFunction(x: any): x is Function {\n return typeof x === 'function';\n}\n","let _enable_super_gross_mode_that_will_cause_bad_things = false;\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like what Promise contructor should used to create Promises\n */\nexport const config = {\n /**\n * The promise constructor used by default for methods such as\n * {@link toPromise} and {@link forEach}\n */\n Promise: undefined as PromiseConstructorLike,\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BY TIME\n * FOR MIGRATION REASONS.\n */\n set useDeprecatedSynchronousErrorHandling(value: boolean) {\n if (value) {\n const 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\n get useDeprecatedSynchronousErrorHandling() {\n return _enable_super_gross_mode_that_will_cause_bad_things;\n },\n};\n","/**\n * Throws an error on another job so that it's picked up by the runtime's\n * uncaught error handling mechanism.\n * @param err the error to throw\n */\nexport function hostReportError(err: any) {\n setTimeout(() => { throw err; }, 0);\n}","import { Observer } from './types';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\n\nexport const empty: Observer<any> = {\n closed: true,\n next(value: any): void { /* noop */},\n error(err: any): void {\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n } else {\n hostReportError(err);\n }\n },\n complete(): void { /*noop*/ }\n};\n","export const isArray = (() => Array.isArray || (<T>(x: any): x is T[] => x && typeof x.length === 'number'))();\n","export function isObject(x: any): x is Object {\n return x !== null && typeof x === 'object';\n}\n","export interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n new(errors: any[]): UnsubscriptionError;\n}\n\nconst UnsubscriptionErrorImpl = (() => {\n function UnsubscriptionErrorImpl(this: any, errors: any[]) {\n Error.call(this);\n this.message = errors ?\n `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}` : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n\n UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);\n\n return UnsubscriptionErrorImpl;\n})();\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = UnsubscriptionErrorImpl as any;","import { isArray } from './util/isArray';\nimport { isObject } from './util/isObject';\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic } from './types';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY: Subscription = (function(empty: any) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n * @type {boolean}\n */\n public closed: boolean = false;\n\n /** @internal */\n protected _parentOrParents: Subscription | Subscription[] = null;\n /** @internal */\n private _subscriptions: SubscriptionLike[] = null;\n\n /**\n * @param {function(): void} [unsubscribe] A function describing how to\n * perform the disposal of resources when the `unsubscribe` method is called.\n */\n constructor(unsubscribe?: () => void) {\n if (unsubscribe) {\n (this as any)._ctorUnsubscribe = true;\n (this as any)._unsubscribe = unsubscribe;\n }\n }\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let errors: any[];\n\n if (this.closed) {\n return;\n }\n\n let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = (this as any);\n\n this.closed = true;\n this._parentOrParents = null;\n // null out _subscriptions first so any child subscriptions that attempt\n // to remove themselves from this subscription will noop\n this._subscriptions = null;\n\n if (_parentOrParents instanceof Subscription) {\n _parentOrParents.remove(this);\n } else if (_parentOrParents !== null) {\n for (let index = 0; index < _parentOrParents.length; ++index) {\n const parent = _parentOrParents[index];\n parent.remove(this);\n }\n }\n\n if (isFunction(_unsubscribe)) {\n // It's only possible to null _unsubscribe - to release the reference to\n // any teardown function passed in the constructor - if the property was\n // actually assigned in the constructor, as there are some classes that\n // are derived from Subscriber (which derives from Subscription) that\n // implement an _unsubscribe method as a mechanism for obtaining\n // unsubscription notifications and some of those subscribers are\n // recycled. Also, in some of those subscribers, _unsubscribe switches\n // from a prototype method to an instance property - see notifyNext in\n // RetryWhenSubscriber.\n if (_ctorUnsubscribe) {\n (this as any)._unsubscribe = undefined;\n }\n try {\n _unsubscribe.call(this);\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];\n }\n }\n\n if (isArray(_subscriptions)) {\n let index = -1;\n let len = _subscriptions.length;\n\n while (++index < len) {\n const sub = _subscriptions[index];\n if (isObject(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\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n\n /**\n * Adds a tear down to be called during the unsubscribe() of this\n * Subscription. Can also be used to add a child subscription.\n *\n * If the tear down being added is a subscription that is already\n * unsubscribed, is the same reference `add` is being called on, or is\n * `Subscription.EMPTY`, it will not be added.\n *\n * If this subscription is already in an `closed` state, the passed\n * tear down logic will be executed immediately.\n *\n * When a parent subscription is unsubscribed, any child subscriptions that were added to it are also unsubscribed.\n *\n * @param {TeardownLogic} teardown The additional logic to execute on\n * teardown.\n * @return {Subscription} Returns the Subscription used or created to be\n * added to the inner subscriptions list. This Subscription can be used with\n * `remove()` to remove the passed teardown logic from the inner subscriptions\n * list.\n */\n add(teardown: TeardownLogic): Subscription {\n let subscription = (<Subscription>teardown);\n\n if (!teardown) {\n return Subscription.EMPTY;\n }\n\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(<(() => void)>teardown);\n case 'object':\n if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {\n // This also covers the case where `subscription` is `Subscription.EMPTY`, which is always in `closed` state.\n return subscription;\n } else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n } else if (!(subscription instanceof Subscription)) {\n const tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default: {\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n }\n\n // Add `this` as parent of `subscription` if that's not already the case.\n let { _parentOrParents } = subscription;\n if (_parentOrParents === null) {\n // If we don't have a parent, then set `subscription._parents` to\n // the `this`, which is the common case that we optimize for.\n subscription._parentOrParents = this;\n } else if (_parentOrParents instanceof Subscription) {\n if (_parentOrParents === this) {\n // The `subscription` already has `this` as a parent.\n return subscription;\n }\n // If there's already one parent, but not multiple, allocate an\n // Array to store the rest of the parent Subscriptions.\n subscription._parentOrParents = [_parentOrParents, this];\n } else if (_parentOrParents.indexOf(this) === -1) {\n // Only add `this` to the _parentOrParents list if it's not already there.\n _parentOrParents.push(this);\n } else {\n // The `subscription` already has `this` as a parent.\n return subscription;\n }\n\n // Optimize for the common case when adding the first subscription.\n const subscriptions = this._subscriptions;\n if (subscriptions === null) {\n this._subscriptions = [subscription];\n } else {\n subscriptions.push(subscription);\n }\n\n return subscription;\n }\n\n /**\n * Removes a Subscription from the internal list of subscriptions that will\n * unsubscribe during the unsubscribe process of this Subscription.\n * @param {Subscription} subscription The subscription to remove.\n * @return {void}\n */\n remove(subscription: Subscription): void {\n const subscriptions = this._subscriptions;\n if (subscriptions) {\n const subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n }\n}\n\nfunction flattenUnsubscriptionErrors(errors: any[]) {\n return errors.reduce((errs, err) => errs.concat((err instanceof UnsubscriptionError) ? err.errors : err), []);\n}\n","/** @deprecated do not use, this is no longer checked by RxJS internals */\nexport const rxSubscriber = (() =>\n typeof Symbol === 'function'\n ? Symbol('rxSubscriber')\n : '@@rxSubscriber_' + Math.random())();\n\n/**\n * @deprecated use rxSubscriber instead\n */\nexport const $$rxSubscriber = rxSubscriber;\n","import { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Observer, PartialObserver, TeardownLogic } from './types';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber<T>\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n\n [rxSubscriberSymbol]() { return this; }\n\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param {function(x: ?T): void} [next] The `next` callback of an Observer.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n */\n static create<T>(next?: (x?: T) => void,\n error?: (e?: any) => void,\n complete?: () => void): Subscriber<T> {\n const subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n }\n\n /** @internal */ syncErrorValue: any = null;\n /** @internal */ syncErrorThrown: boolean = false;\n /** @internal */ syncErrorThrowable: boolean = false;\n\n protected isStopped: boolean = false;\n protected destination: PartialObserver<any> | Subscriber<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @param {Observer|function(value: T): void} [destinationOrNext] A partially\n * defined Observer or a `next` callback function.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n */\n constructor(destinationOrNext?: PartialObserver<any> | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super();\n\n switch (arguments.length) {\n case 0:\n this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n this.destination = emptyObserver;\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<T>(this, <PartialObserver<any>> destinationOrNext);\n }\n break;\n }\n default:\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber<T>(this, <((value: T) => void)> destinationOrNext, error, complete);\n break;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (!this.isStopped) {\n this._next(value);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n super.unsubscribe();\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n this.destination.error(err);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.destination.complete();\n this.unsubscribe();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribeAndRecycle(): Subscriber<T> {\n const { _parentOrParents } = this;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SafeSubscriber<T> extends Subscriber<T> {\n\n private _context: any;\n\n constructor(private _parentSubscriber: Subscriber<T>,\n observerOrNext?: PartialObserver<T> | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super();\n\n let next: ((value: T) => void);\n let context: any = this;\n\n if (isFunction(observerOrNext)) {\n next = (<((value: T) => void)> observerOrNext);\n } else if (observerOrNext) {\n next = (<PartialObserver<T>> observerOrNext).next;\n error = (<PartialObserver<T>> observerOrNext).error;\n complete = (<PartialObserver<T>> observerOrNext).complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n this.add(<() => void> context.unsubscribe.bind(context));\n }\n context.unsubscribe = this.unsubscribe.bind(this);\n }\n }\n\n this._context = context;\n this._next = next;\n this._error = error;\n this._complete = complete;\n }\n\n next(value?: T): void {\n if (!this.isStopped && this._next) {\n const { _parentSubscriber } = this;\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\n error(err?: any): void {\n if (!this.isStopped) {\n const { _parentSubscriber } = this;\n const { useDeprecatedSynchronousErrorHandling } = config;\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\n complete(): void {\n if (!this.isStopped) {\n const { _parentSubscriber } = this;\n if (this._complete) {\n const wrappedComplete = () => 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\n private __tryOrUnsub(fn: Function, value?: any): void {\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\n private __tryOrSetError(parent: Subscriber<T>, fn: Function, value?: any): boolean {\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\n /** @internal This is an internal implementation detail, do not use. */\n _unsubscribe(): void {\n const { _parentSubscriber } = this;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n }\n}\n","/** Symbol.observable or a string \"@@observable\". Used for interop */\nexport const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\n","export function identity<T>(x: T): T {\n return x;\n}\n","import { Operator } from './Operator';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, PartialObserver, Subscribable } from './types';\nimport { canReportError } from './util/canReportError';\nimport { toSubscriber } from './util/toSubscriber';\nimport { iif } from './observable/iif';\nimport { throwError } from './observable/throwError';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable<T>\n */\nexport class Observable<T> implements Subscribable<T> {\n\n /** Internal implementation detail, do not use directly. */\n public _isScalar: boolean = false;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n source: Observable<any>;\n\n /** @deprecated This is an internal implementation detail, do not use. */\n operator: Operator<any, T>;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new cold Observable by calling the Observable constructor\n * @static true\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new cold observable\n * @nocollapse\n * @deprecated use new Observable() instead\n */\n static create: Function = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n }\n\n /**\n * Creates a new Observable, with this Observable as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param {Operator} operator the operator defining the operation to take on the observable\n * @return {Observable} a new observable with the Operator applied\n */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observer?: PartialObserver<T>): Subscription;\n /** @deprecated Use an observer instead of a complete callback */\n subscribe(next: null | undefined, error: null | undefined, complete: () => void): Subscription;\n /** @deprecated Use an observer instead of an error callback */\n subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscription;\n /** @deprecated Use an observer instead of a complete callback */\n subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Subscription;\n subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided, all errors will\n * be left uncaught.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of Observer,\n * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * ## Example\n * ### Subscribe with an Observer\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n * ```\n *\n * ### Subscribe with functions\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n * ```\n *\n * ### Cancel a subscription\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe(\n * num => console.log(num),\n * undefined,\n * () => {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * );\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // \"unsubscribed!\" after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {ISubscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void): Subscription {\n\n const { operator } = this;\n const sink = toSubscriber(observerOrNext, error, complete);\n\n if (operator) {\n sink.add(operator.call(sink, this.source));\n } else {\n sink.add(\n this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?\n this._subscribe(sink) :\n this._trySubscribe(sink)\n );\n }\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\n return sink;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _trySubscribe(sink: Subscriber<T>): TeardownLogic {\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\n /**\n * @method forEach\n * @param {Function} next a handler for each value emitted by the observable\n * @param {PromiseConstructor} [promiseCtor] a constructor function used to instantiate the Promise\n * @return {Promise} a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n // Must be declared in a separate statement to avoid a ReferenceError when\n // accessing subscription below in the closure due to Temporal Dead Zone.\n let subscription: Subscription;\n subscription = this.subscribe((value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n if (subscription) {\n subscription.unsubscribe();\n }\n }\n }, reject, resolve);\n }) as Promise<void>;\n }\n\n /** @internal This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n const { source } = this;\n return source && source.subscribe(subscriber);\n }\n\n // `if` and `throw` are special snow flakes, the compiler sees them as reserved words. Deprecated in\n // favor of iif and throwError functions.\n /**\n * @nocollapse\n * @deprecated In favor of iif creation function: import { iif } from 'rxjs';\n */\n static if: typeof iif;\n /**\n * @nocollapse\n * @deprecated In favor of throwError creation function: import { throwError } from 'rxjs';\n */\n static throw: typeof throwError;\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;\n pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;\n pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;\n pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<{}>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ### Example\n * ```ts\n * import { interval } from 'rxjs';\n * import { map, filter, scan } from 'rxjs/operators';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x))\n * ```\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n if (operations.length === 0) {\n return this as any;\n }\n\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n toPromise<T>(this: Observable<T>): Promise<T>;\n toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;\n toPromise<T>(this: Observable<T>, PromiseCtor: PromiseConstructorLike): Promise<T>;\n /* tslint:enable:max-line-length */\n\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: any;\n this.subscribe((x: T) => value = x, (err: any) => reject(err), () => resolve(value));\n }) as Promise<T>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n if (!promiseCtor) {\n promiseCtor = config.Promise || Promise;\n }\n\n if (!promiseCtor) {\n throw new Error('no Promise impl found');\n }\n\n return promiseCtor;\n}\n","import { Subscriber } from '../Subscriber';\nimport { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';\nimport { empty as emptyObserver } from '../Observer';\nimport { PartialObserver } from '../types';\n\nexport function toSubscriber<T>(\n nextOrObserver?: PartialObserver<T> | ((value: T) => void),\n error?: (error: any) => void,\n complete?: () => void): Subscriber<T> {\n\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber) {\n return (<Subscriber<T>> nextOrObserver);\n }\n\n if (nextOrObserver[rxSubscriberSymbol]) {\n return nextOrObserver[rxSubscriberSymbol]();\n }\n }\n\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber(emptyObserver);\n }\n\n return new Subscriber(nextOrObserver, error, complete);\n}\n","import { Subscriber } from '../Subscriber';\nimport { Subject } from '../Subject';\n\n/**\n * Determines whether the ErrorObserver is closed or stopped or has a\n * destination that is closed or stopped - in which case errors will\n * need to be reported via a different mechanism.\n * @param observer the observer\n */\nexport function canReportError(observer: Subscriber<any> | Subject<any>): boolean {\n while (observer) {\n const { closed, destination, isStopped } = observer as any;\n if (closed || 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","import { noop } from './noop';\nimport { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function pipe<T>(): UnaryFunction<T, T>;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>, ...fns: UnaryFunction<any, any>[]): UnaryFunction<T, {}>;\n/* tslint:enable:max-line-length */\n\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (fns.length === 0) {\n return identity as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n","export interface ObjectUnsubscribedError extends Error {\n}\n\nexport interface ObjectUnsubscribedErrorCtor {\n new(): ObjectUnsubscribedError;\n}\n\nconst ObjectUnsubscribedErrorImpl = (() => {\n function ObjectUnsubscribedErrorImpl(this: any) {\n Error.call(this);\n this.message = 'object unsubscribed';\n this.name = 'ObjectUnsubscribedError';\n return this;\n }\n\n ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);\n\n return ObjectUnsubscribedErrorImpl;\n})();\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = ObjectUnsubscribedErrorImpl as any;","import { Subject } from './Subject';\nimport { Observer } from './types';\nimport { Subscription } from './Subscription';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class SubjectSubscription<T> extends Subscription {\n closed: boolean = false;\n\n constructor(public subject: Subject<T>, public subscriber: Observer<T>) {\n super();\n }\n\n unsubscribe() {\n if (this.closed) {\n return;\n }\n\n this.closed = true;\n\n const subject = this.subject;\n const observers = subject.observers;\n\n this.subject = null;\n\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n\n const subscriberIndex = observers.indexOf(this.subscriber);\n\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n }\n}\n","import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\n\n/**\n * @class SubjectSubscriber<T>\n */\nexport class SubjectSubscriber<T> extends Subscriber<T> {\n constructor(protected destination: Subject<T>) {\n super(destination);\n }\n}\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n *\n * @class Subject<T>\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n\n [rxSubscriberSymbol]() {\n return new SubjectSubscriber(this);\n }\n\n observers: Observer<T>[] = [];\n\n closed = false;\n\n isStopped = false;\n\n hasError = false;\n\n thrownError: any = null;\n\n constructor() {\n super();\n }\n\n /**@nocollapse\n * @deprecated use new Subject() instead\n */\n static create: Function = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n }\n\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = <any>operator;\n return <any>subject;\n }\n\n next(value?: T) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n }\n\n error(err: any) {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n }\n\n complete() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n this.isStopped = true;\n const { observers } = this;\n const len = observers.length;\n const copy = observers.slice();\n for (let i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n }\n\n unsubscribe() {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return super._trySubscribe(subscriber);\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\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\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create customize Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable<T> {\n const observable = new Observable<T>();\n (<any>observable).source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject<T>\n */\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(protected destination?: Observer<T>, source?: Observable<T>) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n const { destination } = this;\n if (destination && destination.next) {\n destination.next(value);\n }\n }\n\n error(err: any) {\n const { destination } = this;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n }\n\n complete() {\n const { destination } = this;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n const { source } = this;\n if (source) {\n return this.source.subscribe(subscriber);\n } else {\n return Subscription.EMPTY;\n }\n }\n}\n","import { SchedulerLike } from '../types';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && typeof (<any>value).schedule === 'function';\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * \n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * ## Example\n * Map every click to the clientX position of that click\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const positions = clicks.pipe(map(ev => ev.clientX));\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable<R>} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nexport function map<T, R>(project: (value: T, index: number) => R, thisArg?: any): OperatorFunction<T, R> {\n return function mapOperation(source: Observable<T>): Observable<R> {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\n\nexport class MapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => R, private thisArg: any) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MapSubscriber<T, R> extends Subscriber<T> {\n count: number = 0;\n private thisArg: any;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => R,\n thisArg: any) {\n super(destination);\n this.thisArg = thisArg || this;\n }\n\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n protected _next(value: T) {\n let result: R;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n }\n}\n","import { Subscriber } from '../Subscriber';\n\n/**\n * Subscribes to an ArrayLike with a subscriber\n * @param array The array or array-like to subscribe to\n */\nexport const subscribeToArray = <T>(array: ArrayLike<T>) => (subscriber: Subscriber<T>) => {\n for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n};\n","export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n\n/**\n * @deprecated use {@link iterator} instead\n */\nexport const $$iterator = iterator;\n","export const isArrayLike = (<T>(x: any): x is ArrayLike<T> => x && typeof x.length === 'number' && typeof x !== 'function');","/**\n * Tests to see if the object is an ES2015 (ES6) Promise\n * @see {@link https://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects}\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike<any> {\n return !!value && typeof (<any>value).subscribe !== 'function' && typeof (value as any).then === 'function';\n}\n","import { ObservableInput } from '../types';\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { Subscription } from '../Subscription';\nimport { Subscriber } from '../Subscriber';\n\nexport const subscribeTo = <T>(result: ObservableInput<T>): (subscriber: Subscriber<T>) => Subscription | void => {\n if (!!result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result as any);\n } else if (isArrayLike(result)) {\n return subscribeToArray(result);\n } else if (isPromise(result)) {\n return subscribeToPromise(result as Promise<any>);\n } else if (!!result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result as any);\n } else {\n const value = isObject(result) ? 'an invalid object' : `'${result}'`;\n const msg = `You provided ${value} where a stream was expected.`\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n","import { Subscriber } from '../Subscriber';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\n/**\n * Subscribes to an object that implements Symbol.observable with the given\n * Subscriber.\n * @param obj An object that implements Symbol.observable\n */\nexport const subscribeToObservable = <T>(obj: any) => (subscriber: Subscriber<T>) => {\n const obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n // Should be caught by observable subscribe function error handling.\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n } else {\n return obs.subscribe(subscriber);\n }\n};\n","import { Subscriber } from '../Subscriber';\nimport { hostReportError } from './hostReportError';\n\nexport const subscribeToPromise = <T>(promise: PromiseLike<T>) => (subscriber: Subscriber<T>) => {\n promise.then(\n (value) => {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n },\n (err: any) => subscriber.error(err)\n )\n .then(null, hostReportError);\n return subscriber;\n};\n","import { Subscriber } from '../Subscriber';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\n\nexport const subscribeToIterable = <T>(iterable: Iterable<T>) => (subscriber: Subscriber<T>) => {\n const iterator = (iterable as any)[Symbol_iterator]();\n\n do {\n let item: IteratorResult<T>;\n try {\n item = iterator.next();\n } catch (err) {\n subscriber.error(err);\n return subscriber;\n }\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n\n // Finalize the iterator if it happens to be a Generator\n if (typeof iterator.return === 'function') {\n subscriber.add(() => {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n\n return subscriber;\n};\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport function scheduleArray<T>(input: ArrayLike<T>, scheduler: SchedulerLike) {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n let 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","import { Observable } from '../Observable';\nimport { subscribeTo } from '../util/subscribeTo';\nimport { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';\nimport { scheduled } from '../scheduled/scheduled';\n\nexport function from<O extends ObservableInput<any>>(input: O): Observable<ObservedValueOf<O>>;\n/** @deprecated use {@link scheduled} instead. */\nexport function from<O extends ObservableInput<any>>(input: O, scheduler: SchedulerLike): Observable<ObservedValueOf<O>>;\n\n/**\n * Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.\n *\n * <span class=\"informal\">Converts almost anything to an Observable.</span>\n *\n * \n *\n * `from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an\n * <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable\" target=\"_blank\">iterable</a>\n * object into an Observable that emits the items in that promise, array, or iterable. A String, in this context, is treated\n * as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be\n * converted through this operator.\n *\n * ## Examples\n *\n * ### Converts an array to an Observable\n *\n * ```ts\n * import { from } from 'rxjs';\n *\n * const array = [10, 20, 30];\n * const result = from(array);\n *\n * result.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 10\n * // 20\n * // 30\n * ```\n *\n * ---\n *\n * ### Convert an infinite iterable (from a generator) to an Observable\n *\n * ```ts\n * import { from } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * function* generateDoubles(seed) {\n * let i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * const iterator = generateDoubles(3);\n * const result = from(iterator).pipe(take(10));\n *\n * result.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 3\n * // 6\n * // 12\n * // 24\n * // 48\n * // 96\n * // 192\n * // 384\n * // 768\n * // 1536\n * ```\n *\n * ---\n *\n * ### With async scheduler\n *\n * ```ts\n * import { from, asyncScheduler } from 'rxjs';\n *\n * console.log('start');\n *\n * const array = [10, 20, 30];\n * const result = from(array, asyncScheduler);\n *\n * result.subscribe(x => console.log(x));\n *\n * console.log('end');\n *\n * // Logs:\n * // start\n * // end\n * // 10\n * // 20\n * // 30\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n *\n * @param {ObservableInput<T>} A subscription object, a Promise, an Observable-like,\n * an Array, an iterable, or an array-like object to be converted.\n * @param {SchedulerLike} An optional {@link SchedulerLike} on which to schedule the emission of values.\n * @return {Observable<T>}\n * @name from\n * @owner Observable\n */\nexport function from<T>(input: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T> {\n if (!scheduler) {\n if (input instanceof Observable) {\n return input;\n }\n return new Observable<T>(subscribeTo(input));\n } else {\n return scheduled(input, scheduler);\n }\n}\n","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { ObservableInput, SchedulerLike, Observable } from 'rxjs';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\n\n/**\n * Converts from a common {@link ObservableInput} type to an observable where subscription and emissions\n * are scheduled on the provided scheduler.\n *\n * @see from\n * @see of\n *\n * @param input The observable, array, promise, iterable, etc you would like to schedule\n * @param scheduler The scheduler to use to schedule the subscription and emissions from\n * the returned observable.\n */\nexport function scheduled<T>(input: ObservableInput<T>, scheduler: SchedulerLike): Observable<T> {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n } else if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n } else if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n } else if (isIterable(input) || typeof input === 'string') {\n return scheduleIterable(input, scheduler);\n }\n }\n\n throw new TypeError((input !== null && typeof input || input) + ' is not observable');\n}\n","import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable<any> {\n return input && typeof input[Symbol_observable] === 'function';\n}\n","import { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { InteropObservable, SchedulerLike, Subscribable } from '../types';\n\nexport function scheduleObservable<T>(input: InteropObservable<T>, scheduler: SchedulerLike) {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n sub.add(scheduler.schedule(() => {\n const observable: Subscribable<T> = input[Symbol_observable]();\n sub.add(observable.subscribe({\n next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); },\n error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); },\n complete() { sub.add(scheduler.schedule(() => subscriber.complete())); },\n }));\n }));\n return sub;\n });\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport function schedulePromise<T>(input: PromiseLike<T>, scheduler: SchedulerLike) {\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n sub.add(scheduler.schedule(() => input.then(\n value => {\n sub.add(scheduler.schedule(() => {\n subscriber.next(value);\n sub.add(scheduler.schedule(() => subscriber.complete()));\n }));\n },\n err => {\n sub.add(scheduler.schedule(() => subscriber.error(err)));\n }\n )));\n return sub;\n });\n}\n","import { iterator as Symbol_iterator } from '../symbol/iterator';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable<any> {\n return input && typeof input[Symbol_iterator] === 'function';\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscription } from '../Subscription';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\n\nexport function scheduleIterable<T>(input: Iterable<T>, scheduler: SchedulerLike) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable<T>(subscriber => {\n const sub = new Subscription();\n let iterator: Iterator<T>;\n sub.add(() => {\n // Finalize generators\n if (iterator && typeof iterator.return === 'function') {\n iterator.return();\n }\n });\n sub.add(scheduler.schedule(() => {\n iterator = input[Symbol_iterator]();\n sub.add(scheduler.schedule(function () {\n if (subscriber.closed) {\n return;\n }\n let value: T;\n let done: boolean;\n try {\n const result = iterator.next();\n value = result.value;\n done = result.done;\n } catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n } else {\n subscriber.next(value);\n this.schedule();\n }\n }));\n }));\n return sub;\n });\n}\n","/** @prettier */\nimport { Subscription } from './Subscription';\nimport { Subscriber } from './Subscriber';\nimport { Observable } from './Observable';\nimport { subscribeTo } from './util/subscribeTo';\n\ninterface SimpleOuterSubscriberLike<T> {\n /**\n * A handler for inner next notifications from the inner subscription\n * @param innerValue the value nexted by the inner producer\n */\n notifyNext(innerValue: T): void;\n /**\n * A handler for inner error notifications from the inner subscription\n * @param err the error from the inner producer\n */\n notifyError(err: any): void;\n /**\n * A handler for inner complete notifications from the inner subscription.\n */\n notifyComplete(): void;\n}\n\nexport class SimpleInnerSubscriber<T> extends Subscriber<T> {\n constructor(private parent: SimpleOuterSubscriberLike<any>) {\n super();\n }\n\n protected _next(value: T): void {\n this.parent.notifyNext(value);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete();\n this.unsubscribe();\n }\n}\n\nexport class ComplexInnerSubscriber<T, R> extends Subscriber<R> {\n constructor(private parent: ComplexOuterSubscriber<T, R>, public outerValue: T, public outerIndex: number) {\n super();\n }\n\n protected _next(value: R): void {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n }\n}\n\nexport class SimpleOuterSubscriber<T, R> extends Subscriber<T> implements SimpleOuterSubscriberLike<R> {\n notifyNext(innerValue: R): void {\n this.destination.next(innerValue);\n }\n\n notifyError(err: any): void {\n this.destination.error(err);\n }\n\n notifyComplete(): void {\n this.destination.complete();\n }\n}\n\n/**\n * DO NOT USE (formerly \"OuterSubscriber\")\n * TODO: We want to refactor this and remove it. It is retaining values it shouldn't for long\n * periods of time.\n */\nexport class ComplexOuterSubscriber<T, R> extends Subscriber<T> {\n /**\n * @param _outerValue Used by: bufferToggle, delayWhen, windowToggle\n * @param innerValue Used by: subclass default, combineLatest, race, bufferToggle, windowToggle, withLatestFrom\n * @param _outerIndex Used by: combineLatest, race, withLatestFrom\n * @param _innerSub Used by: delayWhen\n */\n notifyNext(_outerValue: T, innerValue: R, _outerIndex: number, _innerSub: ComplexInnerSubscriber<T, R>): void {\n this.destination.next(innerValue);\n }\n\n notifyError(error: any): void {\n this.destination.error(error);\n }\n\n /**\n * @param _innerSub Used by: race, bufferToggle, delayWhen, windowToggle, windowWhen\n */\n notifyComplete(_innerSub: ComplexInnerSubscriber<T, R>): void {\n this.destination.complete();\n }\n}\n\nexport function innerSubscribe(result: any, innerSubscriber: Subscriber<any>): Subscription | undefined {\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(innerSubscriber);\n }\n let subscription: Subscription;\n try {\n subscription = subscribeTo(result)(innerSubscriber) as Subscription;\n } catch (error) {\n innerSubscriber.error(error);\n }\n return subscription;\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function mergeMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, concurrent?: number): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function mergeMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: undefined, concurrent?: number): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function mergeMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R, concurrent?: number): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link mergeAll}.</span>\n *\n * \n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger.\n *\n * ## Example\n * Map and flatten each letter to an Observable ticking every 1 second\n * ```ts\n * import { of, interval } from 'rxjs';\n * import { mergeMap, map } from 'rxjs/operators';\n *\n * const letters = of('a', 'b', 'c');\n * const result = letters.pipe(\n * mergeMap(x => interval(1000).pipe(map(i => x+i))),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // a0\n * // b0\n * // c0\n * // a1\n * // b1\n * // c1\n * // continues to list a,b,c with respective ascending integers\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item\n * emitted by the source Observable and merging the results of the Observables\n * obtained from this transformation.\n */\nexport function mergeMap<T, R, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n resultSelector?: ((outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R) | number,\n concurrent: number = Number.POSITIVE_INFINITY\n): OperatorFunction<T, ObservedValueOf<O>|R> {\n if (typeof resultSelector === 'function') {\n // DEPRECATED PATH\n return (source: Observable<T>) => source.pipe(\n mergeMap((a, i) => from(project(a, i)).pipe(\n map((b: any, ii: number) => resultSelector(a, b, i, ii)),\n ), concurrent)\n );\n } else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return (source: Observable<T>) => source.lift(new MergeMapOperator(project, concurrent));\n}\n\nexport class MergeMapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => ObservableInput<R>,\n private concurrent: number = Number.POSITIVE_INFINITY) {\n }\n\n call(observer: Subscriber<R>, source: any): any {\n return source.subscribe(new MergeMapSubscriber(\n observer, this.project, this.concurrent\n ));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class MergeMapSubscriber<T, R> extends SimpleOuterSubscriber<T, R> {\n private hasCompleted: boolean = false;\n private buffer: T[] = [];\n private active: number = 0;\n protected index: number = 0;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => ObservableInput<R>,\n private concurrent: number = Number.POSITIVE_INFINITY) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n } else {\n this.buffer.push(value);\n }\n }\n\n protected _tryNext(value: T) {\n let result: ObservableInput<R>;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.active++;\n this._innerSub(result);\n }\n\n private _innerSub(ish: ObservableInput<R>): void {\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n const innerSubscription = innerSubscribe(ish, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (innerSubscription !== innerSubscriber) {\n destination.add(innerSubscription);\n }\n }\n\n protected _complete(): void {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete!();\n }\n this.unsubscribe();\n }\n\n notifyNext(innerValue: R): void {\n this.destination.next!(innerValue);\n }\n\n notifyComplete(): void {\n const buffer = this.buffer;\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift()!);\n } else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete!();\n }\n }\n}\n\n/**\n * @deprecated renamed. Use {@link mergeMap}\n */\nexport const flatMap = mergeMap;","\nimport { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nimport { OperatorFunction, ObservableInput } from '../types';\n\n/**\n * Converts a higher-order Observable into a first-order Observable which\n * concurrently delivers all values that are emitted on the inner Observables.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables.</span>\n *\n * \n *\n * `mergeAll` subscribes to an Observable that emits Observables, also known as\n * a higher-order Observable. Each time it observes one of these emitted inner\n * Observables, it subscribes to that and delivers all the values from the\n * inner Observable on the output Observable. The output Observable only\n * completes once all inner Observables have completed. Any error delivered by\n * a inner Observable will be immediately emitted on the output Observable.\n *\n * ## Examples\n * Spawn a new interval Observable for each click event, and blend their outputs as one Observable\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { map, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(map((ev) => interval(1000)));\n * const firstOrder = higherOrder.pipe(mergeAll());\n * firstOrder.subscribe(x => console.log(x));\n * ```\n *\n * Count from 0 to 9 every second for each click, but only allow 2 concurrent timers\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { take, map, mergeAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map((ev) => interval(1000).pipe(take(10))),\n * );\n * const firstOrder = higherOrder.pipe(mergeAll(2));\n * firstOrder.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link exhaust}\n * @see {@link merge}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link zipAll}\n *\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits values coming from all the\n * inner Observables emitted by the source Observable.\n * @method mergeAll\n * @owner Observable\n */\nexport function mergeAll<T>(concurrent: number = Number.POSITIVE_INFINITY): OperatorFunction<ObservableInput<T>, T> {\n return mergeMap(identity, concurrent);\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { subscribeToArray } from '../util/subscribeToArray';\nimport { scheduleArray } from '../scheduled/scheduleArray';\n\nexport function fromArray<T>(input: ArrayLike<T>, scheduler?: SchedulerLike) {\n if (!scheduler) {\n return new Observable<T>(subscribeToArray(input));\n } else {\n return scheduleArray(input, scheduler);\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike} from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { mergeAll } from '../operators/mergeAll';\nimport { fromArray } from './fromArray';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T>(v1: ObservableInput<T>, scheduler: SchedulerLike): Observable<T>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T>(v1: ObservableInput<T>, concurrent: number, scheduler: SchedulerLike): Observable<T>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, scheduler: SchedulerLike): Observable<T | T2>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler: SchedulerLike): Observable<T | T2 | T3>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\n\nexport function merge<T>(v1: ObservableInput<T>): Observable<T>;\nexport function merge<T>(v1: ObservableInput<T>, concurrent?: number): Observable<T>;\nexport function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<T | T2>;\nexport function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent?: number): Observable<T | T2>;\nexport function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<T | T2 | T3>;\nexport function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent?: number): Observable<T | T2 | T3>;\nexport function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<T | T2 | T3 | T4>;\nexport function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent?: number): Observable<T | T2 | T3 | T4>;\nexport function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<T | T2 | T3 | T4 | T5>;\nexport function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent?: number): Observable<T | T2 | T3 | T4 | T5>;\nexport function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent?: number): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function merge<T>(...observables: (ObservableInput<T> | number)[]): Observable<T>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T>(...observables: (ObservableInput<T> | SchedulerLike | number)[]): Observable<T>;\nexport function merge<T, R>(...observables: (ObservableInput<any> | number)[]): Observable<R>;\n/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/\nexport function merge<T, R>(...observables: (ObservableInput<any> | SchedulerLike | number)[]): Observable<R>;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * <span class=\"informal\">Flattens multiple Observables together by blending\n * their values into one Observable.</span>\n *\n * \n *\n * `merge` subscribes to each given input Observable (as arguments), and simply\n * forwards (without doing any transformation) all the values from all the input\n * Observables to the output Observable. The output Observable only completes\n * once all input Observables have completed. Any error delivered by an input\n * Observable will be immediately emitted on the output Observable.\n *\n * ## Examples\n * ### Merge together two Observables: 1s interval and clicks\n * ```ts\n * import { merge, fromEvent, interval } from 'rxjs';\n *\n * const clicks = fromEvent(document, 'click');\n * const timer = interval(1000);\n * const clicksOrTimer = merge(clicks, timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // timer will emit ascending values, one every second(1000ms) to console\n * // clicks logs MouseEvents to console everytime the \"document\" is clicked\n * // Since the two streams are merged you see these happening\n * // as they occur.\n * ```\n *\n * ### Merge together 3 Observables, but only 2 run concurrently\n * ```ts\n * import { merge, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer1 = interval(1000).pipe(take(10));\n * const timer2 = interval(2000).pipe(take(6));\n * const timer3 = interval(500).pipe(take(10));\n * const concurrent = 2; // the argument\n * const merged = merge(timer1, timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - First timer1 and timer2 will run concurrently\n * // - timer1 will emit a value every 1000ms for 10 iterations\n * // - timer2 will emit a value every 2000ms for 6 iterations\n * // - after timer1 hits its max iteration, timer2 will\n * // continue, and timer3 will start to run concurrently with timer2\n * // - when timer2 hits its max iteration it terminates, and\n * // timer3 will continue to emit a value every 500ms until it is complete\n * ```\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {...ObservableInput} observables Input Observables to merge together.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for managing\n * concurrency of input Observables.\n * @return {Observable} an Observable that emits items that are the result of\n * every input Observable.\n * @static true\n * @name merge\n * @owner Observable\n */\nexport function merge<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike | number>): Observable<R> {\n let concurrent = Number.POSITIVE_INFINITY;\n let scheduler: SchedulerLike = null;\n let last: any = observables[observables.length - 1];\n if (isScheduler(last)) {\n scheduler = <SchedulerLike>observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = <number>observables.pop();\n }\n } else if (typeof last === 'number') {\n concurrent = <number>observables.pop();\n }\n\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable) {\n return <Observable<R>>observables[0];\n }\n\n return mergeAll<R>(concurrent)(fromArray<any>(observables, scheduler));\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { ConnectableObservable } from '../observable/ConnectableObservable';\nimport { Observable } from '../Observable';\n\n/**\n * Make a {@link ConnectableObservable} behave like a ordinary observable and automates the way\n * you can connect to it.\n *\n * Internally it counts the subscriptions to the observable and subscribes (only once) to the source if\n * the number of subscriptions is larger than 0. If the number of subscriptions is smaller than 1, it\n * unsubscribes from the source. This way you can make sure that everything before the *published*\n * refCount has only a single subscription independently of the number of subscribers to the target\n * observable.\n *\n * Note that using the {@link share} operator is exactly the same as using the *publish* operator\n * (making the observable hot) and the *refCount* operator in a sequence.\n *\n * \n *\n * ## Example\n *\n * In the following example there are two intervals turned into connectable observables\n * by using the *publish* operator. The first one uses the *refCount* operator, the\n * second one does not use it. You will notice that a connectable observable does nothing\n * until you call its connect function.\n *\n * ```ts\n * import { interval } from 'rxjs';\n * import { tap, publish, refCount } from 'rxjs/operators';\n *\n * // Turn the interval observable into a ConnectableObservable (hot)\n * const refCountInterval = interval(400).pipe(\n * tap((num) => console.log(`refCount ${num}`)),\n * publish(),\n * refCount()\n * );\n *\n * const publishedInterval = interval(400).pipe(\n * tap((num) => console.log(`publish ${num}`)),\n * publish()\n * );\n *\n * refCountInterval.subscribe();\n * refCountInterval.subscribe();\n * // 'refCount 0' -----> 'refCount 1' -----> etc\n * // All subscriptions will receive the same value and the tap (and\n * // every other operator) before the publish operator will be executed\n * // only once per event independently of the number of subscriptions.\n *\n * publishedInterval.subscribe();\n * // Nothing happens until you call .connect() on the observable.\n * ```\n *\n * @see {@link ConnectableObservable}\n * @see {@link share}\n * @see {@link publish}\n */\nexport function refCount<T>(): MonoTypeOperatorFunction<T> {\n return function refCountOperatorFunction(source: ConnectableObservable<T>): Observable<T> {\n return source.lift(new RefCountOperator(source));\n } as MonoTypeOperatorFunction<T>;\n}\n\nclass RefCountOperator<T> implements Operator<T, T> {\n constructor(private connectable: ConnectableObservable<T>) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n\n const { connectable } = this;\n (<any> connectable)._refCount++;\n\n const refCounter = new RefCountSubscriber(subscriber, connectable);\n const subscription = source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n (<any> refCounter).connection = connectable.connect();\n }\n\n return subscription;\n }\n}\n\nclass RefCountSubscriber<T> extends Subscriber<T> {\n\n private connection: Subscription;\n\n constructor(destination: Subscriber<T>,\n private connectable: ConnectableObservable<T>) {\n super(destination);\n }\n\n protected _unsubscribe() {\n\n const { connectable } = this;\n if (!connectable) {\n this.connection = null;\n return;\n }\n\n this.connectable = null;\n const refCount = (<any> connectable)._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n\n (<any> connectable)._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n\n ///\n // Compare the local RefCountSubscriber's connection Subscription to the\n // connection Subscription on the shared ConnectableObservable. In cases\n // where the ConnectableObservable source synchronously emits values, and\n // the RefCountSubscriber's downstream Observers synchronously unsubscribe,\n // execution continues to here before the RefCountOperator has a chance to\n // supply the RefCountSubscriber with the shared connection Subscription.\n // For example:\n // ```\n // range(0, 10).pipe(\n // publish(),\n // refCount(),\n // take(5),\n // )\n // .subscribe();\n // ```\n // In order to account for this case, RefCountSubscriber should only dispose\n // the ConnectableObservable's shared connection Subscription if the\n // connection Subscription exists, *and* either:\n // a. RefCountSubscriber doesn't have a reference to the shared connection\n // Subscription yet, or,\n // b. RefCountSubscriber's connection Subscription reference is identical\n // to the shared connection Subscription\n ///\n const { connection } = this;\n const sharedConnection = (<any> connectable)._connection;\n this.connection = null;\n\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n }\n}\n","import { Subject, SubjectSubscriber } from '../Subject';\nimport { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { TeardownLogic } from '../types';\nimport { refCount as higherOrderRefCount } from '../operators/refCount';\n\n/**\n * @class ConnectableObservable<T>\n */\nexport class ConnectableObservable<T> extends Observable<T> {\n\n protected _subject: Subject<T>;\n protected _refCount: number = 0;\n protected _connection: Subscription;\n /** @internal */\n _isComplete = false;\n\n constructor(public source: Observable<T>,\n protected subjectFactory: () => Subject<T>) {\n super();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>) {\n return this.getSubject().subscribe(subscriber);\n }\n\n protected getSubject(): Subject<T> {\n const subject = this._subject;\n if (!subject || subject.isStopped) {\n this._subject = this.subjectFactory();\n }\n return this._subject;\n }\n\n connect(): Subscription {\n let connection = this._connection;\n if (!connection) {\n this._isComplete = false;\n connection = this._connection = new Subscription();\n connection.add(this.source\n .subscribe(new ConnectableSubscriber(this.getSubject(), this)));\n if (connection.closed) {\n this._connection = null;\n connection = Subscription.EMPTY;\n }\n }\n return connection;\n }\n\n refCount(): Observable<T> {\n return higherOrderRefCount()(this) as Observable<T>;\n }\n}\n\nexport const connectableObservableDescriptor: PropertyDescriptorMap = (() => {\n const connectableProto = <any>ConnectableObservable.prototype;\n return {\n operator: { value: null as null },\n _refCount: { value: 0, writable: true },\n _subject: { value: null as null, writable: true },\n _connection: { value: null as null, writable: true },\n _subscribe: { value: connectableProto._subscribe },\n _isComplete: { value: connectableProto._isComplete, writable: true },\n getSubject: { value: connectableProto.getSubject },\n connect: { value: connectableProto.connect },\n refCount: { value: connectableProto.refCount }\n };\n})();\n\nclass ConnectableSubscriber<T> extends SubjectSubscriber<T> {\n constructor(destination: Subject<T>,\n private connectable: ConnectableObservable<T>) {\n super(destination);\n }\n protected _error(err: any): void {\n this._unsubscribe();\n super._error(err);\n }\n protected _complete(): void {\n this.connectable._isComplete = true;\n this._unsubscribe();\n super._complete();\n }\n protected _unsubscribe() {\n const connectable = <any>this.connectable;\n if (connectable) {\n this.connectable = null;\n const connection = connectable._connection;\n connectable._refCount = 0;\n connectable._subject = null;\n connectable._connection = null;\n if (connection) {\n connection.unsubscribe();\n }\n }\n }\n}\n\nclass RefCountOperator<T> implements Operator<T, T> {\n constructor(private connectable: ConnectableObservable<T>) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n\n const { connectable } = this;\n (<any> connectable)._refCount++;\n\n const refCounter = new RefCountSubscriber(subscriber, connectable);\n const subscription = source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n (<any> refCounter).connection = connectable.connect();\n }\n\n return subscription;\n }\n}\n\nclass RefCountSubscriber<T> extends Subscriber<T> {\n\n private connection: Subscription;\n\n constructor(destination: Subscriber<T>,\n private connectable: ConnectableObservable<T>) {\n super(destination);\n }\n\n protected _unsubscribe() {\n\n const { connectable } = this;\n if (!connectable) {\n this.connection = null;\n return;\n }\n\n this.connectable = null;\n const refCount = (<any> connectable)._refCount;\n if (refCount <= 0) {\n this.connection = null;\n return;\n }\n\n (<any> connectable)._refCount = refCount - 1;\n if (refCount > 1) {\n this.connection = null;\n return;\n }\n\n ///\n // Compare the local RefCountSubscriber's connection Subscription to the\n // connection Subscription on the shared ConnectableObservable. In cases\n // where the ConnectableObservable source synchronously emits values, and\n // the RefCountSubscriber's downstream Observers synchronously unsubscribe,\n // execution continues to here before the RefCountOperator has a chance to\n // supply the RefCountSubscriber with the shared connection Subscription.\n // For example:\n // ```\n // range(0, 10).pipe(\n // publish(),\n // refCount(),\n // take(5),\n // ).subscribe();\n // ```\n // In order to account for this case, RefCountSubscriber should only dispose\n // the ConnectableObservable's shared connection Subscription if the\n // connection Subscription exists, *and* either:\n // a. RefCountSubscriber doesn't have a reference to the shared connection\n // Subscription yet, or,\n // b. RefCountSubscriber's connection Subscription reference is identical\n // to the shared connection Subscription\n ///\n const { connection } = this;\n const sharedConnection = (<any> connectable)._connection;\n this.connection = null;\n\n if (sharedConnection && (!connection || sharedConnection === connection)) {\n sharedConnection.unsubscribe();\n }\n }\n}\n","import { Subject } from '../Subject';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { ConnectableObservable, connectableObservableDescriptor } from '../observable/ConnectableObservable';\nimport { MonoTypeOperatorFunction, OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function multicast<T>(subject: Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;\nexport function multicast<T, O extends ObservableInput<any>>(subject: Subject<T>, selector: (shared: Observable<T>) => O): UnaryFunction<Observable<T>, ConnectableObservable<ObservedValueOf<O>>>;\nexport function multicast<T>(subjectFactory: (this: Observable<T>) => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;\nexport function multicast<T, O extends ObservableInput<any>>(SubjectFactory: (this: Observable<T>) => Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the results of invoking a specified selector on items\n * emitted by a ConnectableObservable that shares a single subscription to the underlying stream.\n *\n * \n *\n * @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through\n * which the source sequence's elements will be multicast to the selector function\n * or Subject to push source elements into.\n * @param {Function} [selector] - Optional selector function that can use the multicasted source stream\n * as many times as needed, without causing multiple subscriptions to the source stream.\n * Subscribers to the given source will receive all notifications of the source from the\n * time of the subscription forward.\n * @return {Observable} An Observable that emits the results of invoking the selector\n * on the items emitted by a `ConnectableObservable` that shares a single subscription to\n * the underlying stream.\n * @method multicast\n * @owner Observable\n */\nexport function multicast<T, R>(subjectOrSubjectFactory: Subject<T> | (() => Subject<T>),\n selector?: (source: Observable<T>) => Observable<R>): OperatorFunction<T, R> {\n return function multicastOperatorFunction(source: Observable<T>): Observable<R> {\n let subjectFactory: () => Subject<T>;\n if (typeof subjectOrSubjectFactory === 'function') {\n subjectFactory = <() => Subject<T>>subjectOrSubjectFactory;\n } else {\n subjectFactory = function subjectFactory() {\n return <Subject<T>>subjectOrSubjectFactory;\n };\n }\n\n if (typeof selector === 'function') {\n return source.lift(new MulticastOperator(subjectFactory, selector));\n }\n\n const connectable: any = Object.create(source, connectableObservableDescriptor);\n connectable.source = source;\n connectable.subjectFactory = subjectFactory;\n\n return <ConnectableObservable<R>> connectable;\n };\n}\n\nexport class MulticastOperator<T, R> implements Operator<T, R> {\n constructor(private subjectFactory: () => Subject<T>,\n private selector: (source: Observable<T>) => Observable<R>) {\n }\n call(subscriber: Subscriber<R>, source: any): any {\n const { selector } = this;\n const subject = this.subjectFactory();\n const subscription = selector(subject).subscribe(subscriber);\n subscription.add(source.subscribe(subject));\n return subscription;\n }\n}\n","import { Observable } from '../Observable';\nimport { multicast } from './multicast';\nimport { refCount } from './refCount';\nimport { Subject } from '../Subject';\n\nimport { MonoTypeOperatorFunction } from '../types';\n\nfunction shareSubjectFactory() {\n return new Subject();\n}\n\n/**\n * Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one\n * Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will\n * unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`.\n * This is an alias for `multicast(() => new Subject()), refCount()`.\n *\n * \n *\n * @return {Observable<T>} An Observable that upon connection causes the source Observable to emit items to its Observers.\n * @method share\n * @owner Observable\n */\nexport function share<T>(): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => refCount()(multicast(shareSubjectFactory)(source)) as Observable<T>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function getClosureSafeProperty<T>(objWithPropertyToExtract: T): string {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty as any) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nexport function fillProperties(target: {[key: string]: string}, source: {[key: string]: string}) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function stringify(token: any): string {\n if (typeof token === 'string') {\n return token;\n }\n\n if (Array.isArray(token)) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n\n if (token == null) {\n return '' + token;\n }\n\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n\n if (token.name) {\n return `${token.name}`;\n }\n\n const res = token.toString();\n\n if (res == null) {\n return '' + res;\n }\n\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n\n/**\n * Concatenates two strings with separator, allocating new strings only when necessary.\n *\n * @param before before string.\n * @param separator separator string.\n * @param after after string.\n * @returns concatenated string.\n */\nexport function concatStringsWithSpace(before: string|null, after: string|null): string {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\nimport {getClosureSafeProperty} from '../util/property';\nimport {stringify} from '../util/stringify';\n\n\n\n/**\n * An interface that a function passed into {@link forwardRef} has to implement.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}\n * @publicApi\n */\nexport interface ForwardRefFn {\n (): any;\n}\n\nconst __forward_ref__ = getClosureSafeProperty({__forward_ref__: getClosureSafeProperty});\n\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * @usageNotes\n * ### Example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n * @publicApi\n */\nexport function forwardRef(forwardRefFn: ForwardRefFn): Type<any> {\n (<any>forwardRefFn).__forward_ref__ = forwardRef;\n (<any>forwardRefFn).toString = function() {\n return stringify(this());\n };\n return (<Type<any>><any>forwardRefFn);\n}\n\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see `forwardRef`\n * @publicApi\n */\nexport function resolveForwardRef<T>(type: T): T {\n return isForwardRef(type) ? type() : type;\n}\n\n/** Checks whether a function is wrapped by a `forwardRef`. */\nexport function isForwardRef(fn: any): fn is() => any {\n return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) &&\n fn.__forward_ref__ === forwardRef;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../../interface/type';\n\n/**\n * Configures the `Injector` to return a value for a token.\n * Base for `ValueProvider` decorator.\n *\n * @publicApi\n */\nexport interface ValueSansProvider {\n /**\n * The value to inject.\n */\n useValue: any;\n}\n\n/**\n * Configures the `Injector` to return a value for a token.\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example core/di/ts/provider_spec.ts region='ValueProvider'}\n *\n * ### Multi-value example\n *\n * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}\n *\n * @publicApi\n */\nexport interface ValueProvider extends ValueSansProvider {\n /**\n * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.\n */\n provide: any;\n\n /**\n * When true, injector returns an array of instances. This is useful to allow multiple\n * providers spread across many files to provide configuration information to a common token.\n */\n multi?: boolean;\n}\n\n/**\n * Configures the `Injector` to return an instance of `useClass` for a token.\n * Base for `StaticClassProvider` decorator.\n *\n * @publicApi\n */\nexport interface StaticClassSansProvider {\n /**\n * An optional class to instantiate for the `token`. By default, the `provide`\n * class is instantiated.\n */\n useClass: Type<any>;\n\n /**\n * A list of `token`s to be resolved by the injector. The list of values is then\n * used as arguments to the `useClass` constructor.\n */\n deps: any[];\n}\n\n/**\n * Configures the `Injector` to return an instance of `useClass` for a token.\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * {@example core/di/ts/provider_spec.ts region='StaticClassProvider'}\n *\n * Note that following two providers are not equal:\n *\n * {@example core/di/ts/provider_spec.ts region='StaticClassProviderDifference'}\n *\n * ### Multi-value example\n *\n * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}\n *\n * @publicApi\n */\nexport interface StaticClassProvider extends StaticClassSansProvider {\n /**\n * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.\n */\n provide: any;\n\n /**\n * When true, injector returns an array of instances. This is useful to allow multiple\n * providers spread across many files to provide configuration information to a common token.\n */\n multi?: boolean;\n}\n\n/**\n * Configures the `Injector` to return an instance of a token.\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * ```ts\n * @Injectable(SomeModule, {deps: []})\n * class MyService {}\n * ```\n *\n * @publicApi\n */\nexport interface ConstructorSansProvider {\n /**\n * A list of `token`s to be resolved by the injector.\n */\n deps?: any[];\n}\n\n/**\n * Configures the `Injector` to return an instance of a token.\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n *\n * ### Multi-value example\n *\n * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}\n *\n * @publicApi\n */\nexport interface ConstructorProvider extends ConstructorSansProvider {\n /**\n * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.\n */\n provide: Type<any>;\n\n /**\n * When true, injector returns an array of instances. This is useful to allow multiple\n * providers spread across many files to provide configuration information to a common token.\n */\n multi?: boolean;\n}\n\n/**\n * Configures the `Injector` to return a value of another `useExisting` token.\n *\n * @see `ExistingProvider`\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @publicApi\n */\nexport interface ExistingSansProvider {\n /**\n * Existing `token` to return. (Equivalent to `injector.get(useExisting)`)\n */\n useExisting: any;\n}\n\n/**\n * Configures the `Injector` to return a value of another `useExisting` token.\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * {@example core/di/ts/provider_spec.ts region='ExistingProvider'}\n *\n * ### Multi-value example\n *\n * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}\n *\n * @publicApi\n */\nexport interface ExistingProvider extends ExistingSansProvider {\n /**\n * An injection token. Typically an instance of `Type` or `InjectionToken`, but can be `any`.\n */\n provide: any;\n\n /**\n * When true, injector returns an array of instances. This is useful to allow multiple\n * providers spread across many files to provide configuration information to a common token.\n */\n multi?: boolean;\n}\n\n/**\n * Configures the `Injector` to return a value by invoking a `useFactory` function.\n *\n * @see `FactoryProvider`\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @publicApi\n */\nexport interface FactorySansProvider {\n /**\n * A function to invoke to create a value for this `token`. The function is invoked with\n * resolved values of `token`s in the `deps` field.\n */\n useFactory: Function;\n\n /**\n * A list of `token`s to be resolved by the injector. The list of values is then\n * used as arguments to the `useFactory` function.\n */\n deps?: any[];\n}\n\n/**\n * Configures the `Injector` to return a value by invoking a `useFactory` function.\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * {@example core/di/ts/provider_spec.ts region='FactoryProvider'}\n *\n * Dependencies can also be marked as optional:\n *\n * {@example core/di/ts/provider_spec.ts region='FactoryProviderOptionalDeps'}\n *\n * ### Multi-value example\n *\n * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}\n *\n * @publicApi\n */\nexport interface FactoryProvider extends FactorySansProvider {\n /**\n * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).\n */\n provide: any;\n\n /**\n * When true, injector returns an array of instances. This is useful to allow multiple\n * providers spread across many files to provide configuration information to a common token.\n */\n multi?: boolean;\n}\n\n/**\n * Describes how an `Injector` should be configured as static (that is, without reflection).\n * A static provider provides tokens to an injector for various types of dependencies.\n *\n * @see `Injector.create()`.\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection-providers).\n *\n * @publicApi\n */\nexport type StaticProvider =\n ValueProvider|ExistingProvider|StaticClassProvider|ConstructorProvider|FactoryProvider|any[];\n\n\n/**\n * Configures the `Injector` to return an instance of `Type` when `Type' is used as the token.\n *\n * Create an instance by invoking the `new` operator and supplying additional arguments.\n * This form is a short form of `TypeProvider`;\n *\n * For more details, see the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * {@example core/di/ts/provider_spec.ts region='TypeProvider'}\n *\n * @publicApi\n */\nexport interface TypeProvider extends Type<any> {}\n\n/**\n * Configures the `Injector` to return a value by invoking a `useClass` function.\n * Base for `ClassProvider` decorator.\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @publicApi\n */\nexport interface ClassSansProvider {\n /**\n * Class to instantiate for the `token`.\n */\n useClass: Type<any>;\n}\n\n/**\n * Configures the `Injector` to return an instance of `useClass` for a token.\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * {@example core/di/ts/provider_spec.ts region='ClassProvider'}\n *\n * Note that following two providers are not equal:\n *\n * {@example core/di/ts/provider_spec.ts region='ClassProviderDifference'}\n *\n * ### Multi-value example\n *\n * {@example core/di/ts/provider_spec.ts region='MultiProviderAspect'}\n *\n * @publicApi\n */\nexport interface ClassProvider extends ClassSansProvider {\n /**\n * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).\n */\n provide: any;\n\n /**\n * When true, injector returns an array of instances. This is useful to allow multiple\n * providers spread across many files to provide configuration information to a common token.\n */\n multi?: boolean;\n}\n\n/**\n * Describes how the `Injector` should be configured.\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @see `StaticProvider`\n *\n * @publicApi\n */\nexport type Provider = TypeProvider|ValueProvider|ClassProvider|ConstructorProvider|\n ExistingProvider|FactoryProvider|any[];\n\n/**\n * Encapsulated `Provider`s that are only accepted during creation of an `EnvironmentInjector` (e.g.\n * in an `NgModule`).\n *\n * Using this wrapper type prevents providers which are only designed to work in\n * application/environment injectors from being accidentally included in\n * `@Component.providers` and ending up in a component injector.\n *\n * This wrapper type prevents access to the `Provider`s inside.\n *\n * @see `makeEnvironmentProviders`\n * @see `importProvidersFrom`\n *\n * @publicApi\n */\nexport type EnvironmentProviders = {\n ɵbrand: 'EnvironmentProviders';\n};\n\nexport interface InternalEnvironmentProviders extends EnvironmentProviders {\n ɵproviders: (Provider|EnvironmentProviders)[];\n\n /**\n * If present, indicates that the `EnvironmentProviders` were derived from NgModule providers.\n *\n * This is used to produce clearer error messages.\n */\n ɵfromNgModule?: true;\n}\n\nexport function isEnvironmentProviders(\n value: Provider|EnvironmentProviders|\n InternalEnvironmentProviders): value is InternalEnvironmentProviders {\n return value && !!(value as InternalEnvironmentProviders).ɵproviders;\n}\n\n/**\n * Describes a function that is used to process provider lists (such as provider\n * overrides).\n */\nexport type ProcessProvidersFunction = (providers: Provider[]) => Provider[];\n\n\n/**\n * A wrapper around an NgModule that associates it with [providers](guide/glossary#provider\n * \"Definition\"). Usage without a generic type is deprecated.\n *\n * @see [Deprecations](guide/deprecations#modulewithproviders-type-without-a-generic)\n *\n * @publicApi\n */\nexport interface ModuleWithProviders<T> {\n ngModule: Type<T>;\n providers?: Array<Provider|EnvironmentProviders>;\n}\n\n/**\n * Providers that were imported from NgModules via the `importProvidersFrom` function.\n *\n * These providers are meant for use in an application injector (or other environment injectors) and\n * should not be used in component injectors.\n *\n * This type cannot be directly implemented. It's returned from the `importProvidersFrom` function\n * and serves to prevent the extracted NgModule providers from being used in the wrong contexts.\n *\n * @see `importProvidersFrom`\n *\n * @publicApi\n * @deprecated replaced by `EnvironmentProviders`\n */\nexport type ImportedNgModuleProviders = EnvironmentProviders;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Base URL for the error details page.\n *\n * Keep this constant in sync across:\n * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts\n * - packages/core/src/error_details_base_url.ts\n */\nexport const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';\n\n/**\n * URL for the XSS security documentation.\n */\nexport const XSS_SECURITY_URL = 'https://g.co/ng/security#xss';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_DETAILS_PAGE_BASE_URL} from './error_details_base_url';\n\n/**\n * The list of error codes used in runtime code of the `core` package.\n * Reserved error code range: 100-999.\n *\n * Note: the minus sign denotes the fact that a particular code has a detailed guide on\n * angular.io. This extra annotation is needed to avoid introducing a separate set to store\n * error codes which have guides, which might leak into runtime code.\n *\n * Full list of available error guides can be found at https://angular.io/errors.\n */\nexport const enum RuntimeErrorCode {\n // Change Detection Errors\n EXPRESSION_CHANGED_AFTER_CHECKED = -100,\n RECURSIVE_APPLICATION_REF_TICK = 101,\n\n // Dependency Injection Errors\n CYCLIC_DI_DEPENDENCY = -200,\n PROVIDER_NOT_FOUND = -201,\n INVALID_FACTORY_DEPENDENCY = 202,\n MISSING_INJECTION_CONTEXT = -203,\n INVALID_INJECTION_TOKEN = 204,\n INJECTOR_ALREADY_DESTROYED = 205,\n PROVIDER_IN_WRONG_CONTEXT = 207,\n MISSING_INJECTION_TOKEN = 208,\n INVALID_MULTI_PROVIDER = -209,\n\n // Template Errors\n MULTIPLE_COMPONENTS_MATCH = -300,\n EXPORT_NOT_FOUND = -301,\n PIPE_NOT_FOUND = -302,\n UNKNOWN_BINDING = 303,\n UNKNOWN_ELEMENT = 304,\n TEMPLATE_STRUCTURE_ERROR = 305,\n INVALID_EVENT_BINDING = 306,\n HOST_DIRECTIVE_UNRESOLVABLE = 307,\n HOST_DIRECTIVE_NOT_STANDALONE = 308,\n DUPLICATE_DIRECTITVE = 309,\n HOST_DIRECTIVE_COMPONENT = 310,\n HOST_DIRECTIVE_UNDEFINED_BINDING = 311,\n HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,\n\n // Bootstrap Errors\n MULTIPLE_PLATFORMS = 400,\n PLATFORM_NOT_FOUND = 401,\n ERROR_HANDLER_NOT_FOUND = 402,\n BOOTSTRAP_COMPONENTS_NOT_FOUND = -403,\n PLATFORM_ALREADY_DESTROYED = 404,\n ASYNC_INITIALIZERS_STILL_RUNNING = 405,\n APPLICATION_REF_ALREADY_DESTROYED = 406,\n RENDERER_NOT_FOUND = 407,\n\n // Styling Errors\n\n // Declarations Errors\n\n // i18n Errors\n INVALID_I18N_STRUCTURE = 700,\n MISSING_LOCALE_DATA = 701,\n\n // standalone errors\n IMPORT_PROVIDERS_FROM_STANDALONE = 800,\n\n // JIT Compilation Errors\n // Other\n INVALID_DIFFER_INPUT = 900,\n NO_SUPPORTING_DIFFER_FACTORY = 901,\n VIEW_ALREADY_ATTACHED = 902,\n INVALID_INHERITANCE = 903,\n UNSAFE_VALUE_IN_RESOURCE_URL = 904,\n UNSAFE_VALUE_IN_SCRIPT = 905,\n MISSING_GENERATED_DEF = 906,\n TYPE_IS_NOT_STANDALONE = 907,\n MISSING_ZONEJS = 908,\n UNEXPECTED_ZONE_STATE = 909,\n UNSAFE_IFRAME_ATTRS = -910,\n}\n\n/**\n * Class that represents a runtime error.\n * Formats and outputs the error message in a consistent way.\n *\n * Example:\n * ```\n * throw new RuntimeError(\n * RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,\n * ngDevMode && 'Injector has already been destroyed.');\n * ```\n *\n * Note: the `message` argument contains a descriptive error message as a string in development\n * mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the\n * `message` argument becomes `false`, thus we account for it in the typings and the runtime logic.\n */\nexport class RuntimeError<T extends number = RuntimeErrorCode> extends Error {\n constructor(public code: T, message: null|false|string) {\n super(formatRuntimeError<T>(code, message));\n }\n}\n\n/**\n * Called to format a runtime error.\n * See additional info on the `message` argument type in the `RuntimeError` class description.\n */\nexport function formatRuntimeError<T extends number = RuntimeErrorCode>(\n code: T, message: null|false|string): string {\n // Error code might be a negative number, which is a special marker that instructs the logic to\n // generate a link to the error details page on angular.io.\n // We also prepend `0` to non-compile-time errors.\n const fullCode = `NG0${Math.abs(code)}`;\n\n let errorMessage = `${fullCode}${message ? ': ' + message.trim() : ''}`;\n\n if (ngDevMode && code < 0) {\n const addPeriodSeparator = !errorMessage.match(/[.,;!?]$/);\n const separator = addPeriodSeparator ? '.' : '';\n errorMessage =\n `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;\n }\n return errorMessage;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Used for stringify render output in Ivy.\n * Important! This function is very performance-sensitive and we should\n * be extra careful not to introduce megamorphic reads in it.\n * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.\n */\nexport function renderStringify(value: any): string {\n if (typeof value === 'string') return value;\n if (value == null) return '';\n // Use `String` so that it invokes the `toString` method of the value. Note that this\n // appears to be faster than calling `value.toString` (see `render_stringify` benchmark).\n return String(value);\n}\n\n\n/**\n * Used to stringify a value so that it can be displayed in an error message.\n * Important! This function contains a megamorphic read and should only be\n * used for error messages.\n */\nexport function stringifyForError(value: any): string {\n if (typeof value === 'function') return value.name || value.toString();\n if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n return value.type.name || value.type.toString();\n }\n\n return renderStringify(value);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isEnvironmentProviders} from '../di/interface/provider';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {Type} from '../interface/type';\nimport {stringify} from '../util/stringify';\n\nimport {stringifyForError} from './util/stringify_utils';\n\n\n/** Called when directives inject each other (creating a circular dependency) */\nexport function throwCyclicDependencyError(token: string, path?: string[]): never {\n const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';\n throw new RuntimeError(\n RuntimeErrorCode.CYCLIC_DI_DEPENDENCY,\n `Circular dependency in DI detected for ${token}${depPath}`);\n}\n\nexport function throwMixedMultiProviderError() {\n throw new Error(`Cannot mix multi providers and regular providers`);\n}\n\nexport function throwInvalidProviderError(\n ngModuleType?: Type<unknown>, providers?: any[], provider?: any): never {\n if (ngModuleType && providers) {\n const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');\n throw new Error(`Invalid provider for the NgModule '${\n stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${\n providerDetail.join(', ')}]`);\n } else if (isEnvironmentProviders(provider)) {\n if (provider.ɵfromNgModule) {\n throw new RuntimeError(\n RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT,\n `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);\n } else {\n throw new RuntimeError(\n RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT,\n `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);\n }\n } else {\n throw new Error('Invalid provider');\n }\n}\n\n\n/** Throws an error when a token is not found in DI. */\nexport function throwProviderNotFoundError(token: any, injectorName?: string): never {\n const injectorDetails = injectorName ? ` in ${injectorName}` : '';\n throw new RuntimeError(\n RuntimeErrorCode.PROVIDER_NOT_FOUND,\n ngDevMode && `No provider for ${stringifyForError(token)} found${injectorDetails}`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// The functions in this file verify that the assumptions we are making\n// about state in an instruction are correct before implementing any logic.\n// They are meant only to be called in dev mode as sanity checks.\n\nimport {stringify} from './stringify';\n\nexport function assertNumber(actual: any, msg: string): asserts actual is number {\n if (!(typeof actual === 'number')) {\n throwError(msg, typeof actual, 'number', '===');\n }\n}\n\nexport function assertNumberInRange(\n actual: any, minInclusive: number, maxInclusive: number): asserts actual is number {\n assertNumber(actual, 'Expected a number');\n assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');\n assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');\n}\n\nexport function assertString(actual: any, msg: string): asserts actual is string {\n if (!(typeof actual === 'string')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');\n }\n}\n\nexport function assertFunction(actual: any, msg: string): asserts actual is Function {\n if (!(typeof actual === 'function')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');\n }\n}\n\nexport function assertEqual<T>(actual: T, expected: T, msg: string) {\n if (!(actual == expected)) {\n throwError(msg, actual, expected, '==');\n }\n}\n\nexport function assertNotEqual<T>(actual: T, expected: T, msg: string): asserts actual is T {\n if (!(actual != expected)) {\n throwError(msg, actual, expected, '!=');\n }\n}\n\nexport function assertSame<T>(actual: T, expected: T, msg: string): asserts actual is T {\n if (!(actual === expected)) {\n throwError(msg, actual, expected, '===');\n }\n}\n\nexport function assertNotSame<T>(actual: T, expected: T, msg: string) {\n if (!(actual !== expected)) {\n throwError(msg, actual, expected, '!==');\n }\n}\n\nexport function assertLessThan<T>(actual: T, expected: T, msg: string): asserts actual is T {\n if (!(actual < expected)) {\n throwError(msg, actual, expected, '<');\n }\n}\n\nexport function assertLessThanOrEqual<T>(actual: T, expected: T, msg: string): asserts actual is T {\n if (!(actual <= expected)) {\n throwError(msg, actual, expected, '<=');\n }\n}\n\nexport function assertGreaterThan<T>(actual: T, expected: T, msg: string): asserts actual is T {\n if (!(actual > expected)) {\n throwError(msg, actual, expected, '>');\n }\n}\n\nexport function assertGreaterThanOrEqual<T>(\n actual: T, expected: T, msg: string): asserts actual is T {\n if (!(actual >= expected)) {\n throwError(msg, actual, expected, '>=');\n }\n}\n\nexport function assertNotDefined<T>(actual: T, msg: string) {\n if (actual != null) {\n throwError(msg, actual, null, '==');\n }\n}\n\nexport function assertDefined<T>(actual: T|null|undefined, msg: string): asserts actual is T {\n if (actual == null) {\n throwError(msg, actual, null, '!=');\n }\n}\n\nexport function throwError(msg: string): never;\nexport function throwError(msg: string, actual: any, expected: any, comparison: string): never;\nexport function throwError(msg: string, actual?: any, expected?: any, comparison?: string): never {\n throw new Error(\n `ASSERTION ERROR: ${msg}` +\n (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));\n}\n\nexport function assertDomNode(node: any): asserts node is Node {\n // If we're in a worker, `Node` will not be defined.\n if (!(typeof Node !== 'undefined' && node instanceof Node) &&\n !(typeof node === 'object' && node != null &&\n node.constructor.name === 'WebWorkerRenderNode')) {\n throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);\n }\n}\n\n\nexport function assertIndexInRange(arr: any[], index: number) {\n assertDefined(arr, 'Array must be defined.');\n const maxLen = arr.length;\n if (index < 0 || index >= maxLen) {\n throwError(`Index expected to be less than ${maxLen} but got ${index}`);\n }\n}\n\n\nexport function assertOneOf(value: any, ...validValues: any[]) {\n if (validValues.indexOf(value) !== -1) return true;\n throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${\n JSON.stringify(value)}.`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../../interface/type';\nimport {getClosureSafeProperty} from '../../util/property';\n\nimport {ClassProvider, ConstructorProvider, EnvironmentProviders, ExistingProvider, FactoryProvider, StaticClassProvider, ValueProvider} from './provider';\n\n\n\n/**\n * Information about how a type or `InjectionToken` interfaces with the DI system.\n *\n * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly\n * requesting injection of other types if necessary.\n *\n * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular\n * `Injector`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates\n * that the injectable does not belong to any scope.\n *\n * @codeGenApi\n * @publicApi The ViewEngine compiler emits code with this type for injectables. This code is\n * deployed to npm, and should be treated as public api.\n\n */\nexport interface ɵɵInjectableDeclaration<T> {\n /**\n * Specifies that the given type belongs to a particular injector:\n * - `InjectorType` such as `NgModule`,\n * - `'root'` the root injector\n * - `'any'` all injectors.\n * - `null`, does not belong to any injector. Must be explicitly listed in the injector\n * `providers`.\n */\n providedIn: InjectorType<any>|'root'|'platform'|'any'|'environment'|null;\n\n /**\n * The token to which this definition belongs.\n *\n * Note that this may not be the same as the type that the `factory` will create.\n */\n token: unknown;\n\n /**\n * Factory method to execute to create an instance of the injectable.\n */\n factory: (t?: Type<any>) => T;\n\n /**\n * In a case of no explicit injector, a location where the instance of the injectable is stored.\n */\n value: T|undefined;\n}\n\n/**\n * Information about the providers to be included in an `Injector` as well as how the given type\n * which carries the information should be created by the DI system.\n *\n * An `InjectorDef` can import other types which have `InjectorDefs`, forming a deep nested\n * structure of providers with a defined priority (identically to how `NgModule`s also have\n * an import/dependency structure).\n *\n * NOTE: This is a private type and should not be exported\n *\n * @codeGenApi\n */\nexport interface ɵɵInjectorDef<T> {\n // TODO(alxhub): Narrow down the type here once decorators properly change the return type of the\n // class they are decorating (to add the ɵprov property for example).\n providers: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|EnvironmentProviders|any[])[];\n\n imports: (InjectorType<any>|InjectorTypeWithProviders<any>)[];\n}\n\n/**\n * A `Type` which has a `ɵprov: ɵɵInjectableDeclaration` static field.\n *\n * `InjectableType`s contain their own Dependency Injection metadata and are usable in an\n * `InjectorDef`-based `StaticInjector`.\n *\n * @publicApi\n */\nexport interface InjectableType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ɵprov: unknown;\n}\n\n/**\n * A type which has an `InjectorDef` static field.\n *\n * `InjectorTypes` can be used to configure a `StaticInjector`.\n *\n * This is an opaque type whose structure is highly version dependent. Do not rely on any\n * properties.\n *\n * @publicApi\n */\nexport interface InjectorType<T> extends Type<T> {\n ɵfac?: unknown;\n ɵinj: unknown;\n}\n\n/**\n * Describes the `InjectorDef` equivalent of a `ModuleWithProviders`, an `InjectorType` with an\n * associated array of providers.\n *\n * Objects of this type can be listed in the imports section of an `InjectorDef`.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorTypeWithProviders<T> {\n ngModule: InjectorType<T>;\n providers?: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|EnvironmentProviders|any[])[];\n}\n\n\n/**\n * Construct an injectable definition which defines how a token will be constructed by the DI\n * system, and in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ɵprov` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call `inject` to access the `Injector` and request injection of dependencies.\n *\n * @codeGenApi\n * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.\n */\nexport function ɵɵdefineInjectable<T>(opts: {\n token: unknown,\n providedIn?: Type<any>|'root'|'platform'|'any'|'environment'|null, factory: () => T,\n}): unknown {\n return {\n token: opts.token,\n providedIn: opts.providedIn as any || null,\n factory: opts.factory,\n value: undefined,\n } as ɵɵInjectableDeclaration<T>;\n}\n\n/**\n * @deprecated in v8, delete after v10. This API should be used only by generated code, and that\n * code should now use ɵɵdefineInjectable instead.\n * @publicApi\n */\nexport const defineInjectable = ɵɵdefineInjectable;\n\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has a `ɵprov` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @codeGenApi\n */\nexport function ɵɵdefineInjector(options: {providers?: any[], imports?: any[]}): unknown {\n return {providers: options.providers || [], imports: options.imports || []};\n}\n\n/**\n * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading\n * inherited value.\n *\n * @param type A type which may have its own (non-inherited) `ɵprov`.\n */\nexport function getInjectableDef<T>(type: any): ɵɵInjectableDeclaration<T>|null {\n return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);\n}\n\nexport function isInjectable(type: any): boolean {\n return getInjectableDef(type) !== null;\n}\n\n/**\n * Return definition only if it is defined directly on `type` and is not inherited from a base\n * class of `type`.\n */\nfunction getOwnDefinition<T>(type: any, field: string): ɵɵInjectableDeclaration<T>|null {\n return type.hasOwnProperty(field) ? type[field] : null;\n}\n\n/**\n * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.\n *\n * @param type A type which may have `ɵprov`, via inheritance.\n *\n * @deprecated Will be removed in a future version of Angular, where an error will occur in the\n * scenario if we find the `ɵprov` on an ancestor only.\n */\nexport function getInheritedInjectableDef<T>(type: any): ɵɵInjectableDeclaration<T>|null {\n const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);\n\n if (def) {\n const typeName = getTypeName(type);\n ngDevMode &&\n console.warn(\n `DEPRECATED: DI is instantiating a token \"${\n typeName}\" that inherits its @Injectable decorator but does not provide one itself.\\n` +\n `This will become an error in a future version of Angular. Please add @Injectable() to the \"${\n typeName}\" class.`);\n return def;\n } else {\n return null;\n }\n}\n\n/** Gets the name of a type, accounting for some cross-browser differences. */\nfunction getTypeName(type: any): string {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}\n\n/**\n * Read the injector def type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have an injector def (`ɵinj`)\n */\nexport function getInjectorDef<T>(type: any): ɵɵInjectorDef<T>|null {\n return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ?\n (type as any)[NG_INJ_DEF] :\n null;\n}\n\nexport const NG_PROV_DEF = getClosureSafeProperty({ɵprov: getClosureSafeProperty});\nexport const NG_INJ_DEF = getClosureSafeProperty({ɵinj: getClosureSafeProperty});\n\n// We need to keep these around so we can read off old defs if new defs are unavailable\nexport const NG_INJECTABLE_DEF = getClosureSafeProperty({ngInjectableDef: getClosureSafeProperty});\nexport const NG_INJECTOR_DEF = getClosureSafeProperty({ngInjectorDef: getClosureSafeProperty});\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * Special flag indicating that a decorator is of type `Inject`. It's used to make `Inject`\n * decorator tree-shakable (so we don't have to rely on the `instanceof` checks).\n * Note: this flag is not included into the `InjectFlags` since it's an internal-only API.\n */\nexport const enum DecoratorFlags {\n Inject = -1\n}\n\n/**\n * Injection flags for DI.\n *\n * @publicApi\n * @deprecated use an options object for `inject` instead.\n */\nexport enum InjectFlags {\n // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer\n // writes exports of it into ngfactory files.\n\n /** Check self and check parent injector if needed */\n Default = 0b0000,\n\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n Host = 0b0001,\n\n /** Don't ascend to ancestors of the node requesting injection. */\n Self = 0b0010,\n\n /** Skip the node that is requesting injection. */\n SkipSelf = 0b0100,\n\n /** Inject `defaultValue` instead if token not found. */\n Optional = 0b1000,\n}\n\n/**\n * This enum is an exact copy of the `InjectFlags` enum above, but the difference is that this is a\n * const enum, so actual enum values would be inlined in generated code. The `InjectFlags` enum can\n * be turned into a const enum when ViewEngine is removed (see TODO at the `InjectFlags` enum\n * above). The benefit of inlining is that we can use these flags at the top level without affecting\n * tree-shaking (see \"no-toplevel-property-access\" tslint rule for more info).\n * Keep this enum in sync with `InjectFlags` enum above.\n */\nexport const enum InternalInjectFlags {\n /** Check self and check parent injector if needed */\n Default = 0b0000,\n\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n Host = 0b0001,\n\n /** Don't ascend to ancestors of the node requesting injection. */\n Self = 0b0010,\n\n /** Skip the node that is requesting injection. */\n SkipSelf = 0b0100,\n\n /** Inject `defaultValue` instead if token not found. */\n Optional = 0b1000,\n\n /**\n * This token is being injected into a pipe.\n *\n * This flag is intentionally not in the public facing `InjectFlags` because it is only added by\n * the compiler and is not a developer applicable flag.\n */\n ForPipe = 0b10000,\n}\n\n/**\n * Type of the options argument to `inject`.\n *\n * @publicApi\n */\nexport interface InjectOptions {\n /**\n * Use optional injection, and return `null` if the requested token is not found.\n */\n optional?: boolean;\n\n /**\n * Start injection at the parent of the current injector.\n */\n skipSelf?: boolean;\n\n /**\n * Only query the current injector for the token, and don't fall back to the parent injector if\n * it's not found.\n */\n self?: boolean;\n\n /**\n * Stop injection at the host component's injector. Only relevant when injecting from an element\n * injector, and a no-op for environment injectors.\n */\n host?: boolean;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {throwProviderNotFoundError} from '../render3/errors_di';\nimport {assertNotEqual} from '../util/assert';\nimport {stringify} from '../util/stringify';\n\nimport {getInjectableDef, ɵɵInjectableDeclaration} from './interface/defs';\nimport {InjectFlags} from './interface/injector';\nimport {ProviderToken} from './provider_token';\n\n\n/**\n * Current implementation of inject.\n *\n * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n * way for two reasons:\n * 1. `Injector` should not depend on ivy logic.\n * 2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n */\nlet _injectImplementation: (<T>(token: ProviderToken<T>, flags?: InjectFlags) => T | null)|\n undefined;\nexport function getInjectImplementation() {\n return _injectImplementation;\n}\n\n\n/**\n * Sets the current inject implementation.\n */\nexport function setInjectImplementation(\n impl: (<T>(token: ProviderToken<T>, flags?: InjectFlags) => T | null)|\n undefined): (<T>(token: ProviderToken<T>, flags?: InjectFlags) => T | null)|undefined {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\n\n\n/**\n * Injects `root` tokens in limp mode.\n *\n * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n * injectable definition.\n */\nexport function injectRootLimpMode<T>(\n token: ProviderToken<T>, notFoundValue: T|undefined, flags: InjectFlags): T|null {\n const injectableDef: ɵɵInjectableDeclaration<T>|null = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :\n injectableDef.value;\n }\n if (flags & InjectFlags.Optional) return null;\n if (notFoundValue !== undefined) return notFoundValue;\n throwProviderNotFoundError(stringify(token), 'Injector');\n}\n\n\n/**\n * Assert that `_injectImplementation` is not `fn`.\n *\n * This is useful, to prevent infinite recursion.\n *\n * @param fn Function which it should not equal to\n */\nexport function assertInjectImplementationNotEqual(\n fn: (<T>(token: ProviderToken<T>, flags?: InjectFlags) => T | null)) {\n ngDevMode &&\n assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492\ndeclare var WorkerGlobalScope: any;\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\ndeclare var global: any;\n\n// Always use __globalThis if available, which is the spec-defined global variable across all\n// environments, then fallback to __global first, because in Node tests both __global and\n// __window may be defined and _global should be __global in that case. Note: Typeof/Instanceof\n// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:\n// https://github.com/terser/terser/issues/250.\nconst _global: any = (/* @__PURE__ */ (\n () => (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||\n (typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self))());\n\n/**\n * Attention: whenever providing a new value, be sure to add an\n * entry into the corresponding `....externs.js` file,\n * so that closure won't use that global for its purposes.\n */\nexport {_global as global};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport '../util/ng_dev_mode';\n\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {Type} from '../interface/type';\nimport {stringify} from '../util/stringify';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {getInjectImplementation, injectRootLimpMode} from './inject_switch';\nimport {Injector} from './injector';\nimport {DecoratorFlags, InjectFlags, InjectOptions, InternalInjectFlags} from './interface/injector';\nimport {ProviderToken} from './provider_token';\n\n\nconst _THROW_IF_NOT_FOUND = {};\nexport const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n\n/*\n * Name of a property (that we patch onto DI decorator), which is used as an annotation of which\n * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators\n * in the code, thus making them tree-shakable.\n */\nconst DI_DECORATOR_FLAG = '__NG_DI_FLAG__';\n\nexport const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\nexport const SOURCE = '__source';\n\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector: Injector|undefined|null = undefined;\n\nexport function setCurrentInjector(injector: Injector|null|undefined): Injector|undefined|null {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\n\nexport function injectInjectorOnly<T>(token: ProviderToken<T>): T;\nexport function injectInjectorOnly<T>(token: ProviderToken<T>, flags?: InjectFlags): T|null;\nexport function injectInjectorOnly<T>(token: ProviderToken<T>, flags = InjectFlags.Default): T|\n null {\n if (_currentInjector === undefined) {\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_INJECTION_CONTEXT,\n ngDevMode &&\n `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \\`EnvironmentInjector#runInContext\\`.`);\n } else if (_currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n } else {\n return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n }\n}\n\n/**\n * Generated instruction: injects a token from the currently active injector.\n *\n * (Additional documentation moved to `inject`, as it is the public API, and an alias for this\n * instruction)\n *\n * @see inject\n * @codeGenApi\n * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to npm.\n */\nexport function ɵɵinject<T>(token: ProviderToken<T>): T;\nexport function ɵɵinject<T>(token: ProviderToken<T>, flags?: InjectFlags): T|null;\nexport function ɵɵinject<T>(token: ProviderToken<T>, flags = InjectFlags.Default): T|null {\n return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);\n}\n\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nexport function ɵɵinvalidFactoryDep(index: number): never {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY,\n ngDevMode &&\n `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${\n index} of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease check that 1) the type for the parameter at index ${\n index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);\n}\n\n/**\n * @param token A token that represents a dependency that should be injected.\n * @returns the injected value if operation is successful, `null` otherwise.\n * @throws if called outside of a supported context.\n *\n * @publicApi\n */\nexport function inject<T>(token: ProviderToken<T>): T;\n/**\n * @param token A token that represents a dependency that should be injected.\n * @param flags Control how injection is executed. The flags correspond to injection strategies that\n * can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.\n * @returns the injected value if operation is successful, `null` otherwise.\n * @throws if called outside of a supported context.\n *\n * @publicApi\n * @deprecated prefer an options object instead of `InjectFlags`\n */\nexport function inject<T>(token: ProviderToken<T>, flags?: InjectFlags): T|null;\n/**\n * @param token A token that represents a dependency that should be injected.\n * @param options Control how injection is executed. Options correspond to injection strategies\n * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and\n * `@Optional`.\n * @returns the injected value if operation is successful.\n * @throws if called outside of a supported context, or if the token is not found.\n *\n * @publicApi\n */\nexport function inject<T>(token: ProviderToken<T>, options: InjectOptions&{optional?: false}): T;\n/**\n * @param token A token that represents a dependency that should be injected.\n * @param options Control how injection is executed. Options correspond to injection strategies\n * that can be specified with parameter decorators `@Host`, `@Self`, `@SkipSelf`, and\n * `@Optional`.\n * @returns the injected value if operation is successful, `null` if the token is not\n * found and optional injection has been requested.\n * @throws if called outside of a supported context, or if the token is not found and optional\n * injection was not requested.\n *\n * @publicApi\n */\nexport function inject<T>(token: ProviderToken<T>, options: InjectOptions): T|null;\n/**\n * Injects a token from the currently active injector.\n * `inject` is only supported during instantiation of a dependency by the DI system. It can be used\n * during:\n * - Construction (via the `constructor`) of a class being instantiated by the DI system, such\n * as an `@Injectable` or `@Component`.\n * - In the initializer for fields of such classes.\n * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.\n * - In the `factory` function specified for an `InjectionToken`.\n *\n * @param token A token that represents a dependency that should be injected.\n * @param flags Optional flags that control how injection is executed.\n * The flags correspond to injection strategies that can be specified with\n * parameter decorators `@Host`, `@Self`, `@SkipSelf`, and `@Optional`.\n * @returns the injected value if operation is successful, `null` otherwise.\n * @throws if called outside of a supported context.\n *\n * @usageNotes\n * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a\n * field initializer:\n *\n * ```typescript\n * @Injectable({providedIn: 'root'})\n * export class Car {\n * radio: Radio|undefined;\n * // OK: field initializer\n * spareTyre = inject(Tyre);\n *\n * constructor() {\n * // OK: constructor body\n * this.radio = inject(Radio);\n * }\n * }\n * ```\n *\n * It is also legal to call `inject` from a provider's factory:\n *\n * ```typescript\n * providers: [\n * {provide: Car, useFactory: () => {\n * // OK: a class factory\n * const engine = inject(Engine);\n * return new Car(engine);\n * }}\n * ]\n * ```\n *\n * Calls to the `inject()` function outside of the class creation context will result in error. Most\n * notably, calls to `inject()` are disallowed after a class instance was created, in methods\n * (including lifecycle hooks):\n *\n * ```typescript\n * @Component({ ... })\n * export class CarComponent {\n * ngOnInit() {\n * // ERROR: too late, the component instance was already created\n * const engine = inject(Engine);\n * engine.start();\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport function inject<T>(\n token: ProviderToken<T>, flags: InjectFlags|InjectOptions = InjectFlags.Default): T|null {\n return ɵɵinject(token, convertToBitFlags(flags));\n}\n\n// Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`).\nexport function convertToBitFlags(flags: InjectOptions|InjectFlags|undefined): InjectFlags|\n undefined {\n if (typeof flags === 'undefined' || typeof flags === 'number') {\n return flags;\n }\n\n // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in\n // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from\n // `InjectOptions` to `InjectFlags`.\n return (InternalInjectFlags.Default | // comment to force a line break in the formatter\n ((flags.optional && InternalInjectFlags.Optional) as number) |\n ((flags.host && InternalInjectFlags.Host) as number) |\n ((flags.self && InternalInjectFlags.Self) as number) |\n ((flags.skipSelf && InternalInjectFlags.SkipSelf) as number)) as InjectFlags;\n}\n\nexport function injectArgs(types: (ProviderToken<any>|any[])[]): any[] {\n const args: any[] = [];\n for (let i = 0; i < types.length; i++) {\n const arg = resolveForwardRef(types[i]);\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_DIFFER_INPUT,\n ngDevMode && 'Arguments array must have arguments.');\n }\n let type: Type<any>|undefined = undefined;\n let flags: InjectFlags = InjectFlags.Default;\n\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n const flag = getInjectFlag(meta);\n if (typeof flag === 'number') {\n // Special case when we handle @Inject decorator.\n if (flag === DecoratorFlags.Inject) {\n type = meta.token;\n } else {\n flags |= flag;\n }\n } else {\n type = meta;\n }\n }\n\n args.push(ɵɵinject(type!, flags));\n } else {\n args.push(ɵɵinject(arg));\n }\n }\n return args;\n}\n\n/**\n * Attaches a given InjectFlag to a given decorator using monkey-patching.\n * Since DI decorators can be used in providers `deps` array (when provider is configured using\n * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we\n * attach the flag to make it available both as a static property and as a field on decorator\n * instance.\n *\n * @param decorator Provided DI decorator.\n * @param flag InjectFlag that should be applied.\n */\nexport function attachInjectFlag(decorator: any, flag: InternalInjectFlags|DecoratorFlags): any {\n decorator[DI_DECORATOR_FLAG] = flag;\n decorator.prototype[DI_DECORATOR_FLAG] = flag;\n return decorator;\n}\n\n/**\n * Reads monkey-patched property that contains InjectFlag attached to a decorator.\n *\n * @param token Token that may contain monkey-patched DI flags property.\n */\nexport function getInjectFlag(token: any): number|undefined {\n return token[DI_DECORATOR_FLAG];\n}\n\nexport function catchInjectorError(\n e: any, token: any, injectorErrorName: string, source: string|null): never {\n const tokenPath: any[] = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, injectorErrorName, source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n}\n\nexport function formatError(\n text: string, obj: any, injectorErrorName: string, source: string|null = null): string {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;\n let context = stringify(obj);\n if (Array.isArray(obj)) {\n context = obj.map(stringify).join(' -> ');\n } else if (typeof obj === 'object') {\n let parts = <string[]>[];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(\n key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${\n text.replace(NEW_LINE, '\\n ')}`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nexport function noSideEffects<T>(fn: () => T): T {\n return {toString: fn}.toString() as unknown as T;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see {@link ChangeDetectorRef#usage-notes Change detection usage}\n *\n * @publicApi\n */\nexport enum ChangeDetectionStrategy {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n OnPush = 0,\n\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n Default = 1,\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Defines the CSS styles encapsulation policies for the {@link Component} decorator's\n * `encapsulation` option.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nexport enum ViewEncapsulation {\n // TODO: consider making `ViewEncapsulation` a `const enum` instead. See\n // https://github.com/angular/angular/issues/44119 for additional information.\n\n /**\n * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the\n * component's host element and applying the same attribute to all the CSS selectors provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.\n *\n * This is the default option.\n */\n Emulated = 0,\n\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n\n /**\n * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable\n * to any HTML element of the application regardless of their host Component.\n */\n None = 2,\n\n /**\n * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates\n * a ShadowRoot for the component's host element which is then used to encapsulate\n * all the Component's styling.\n */\n ShadowDom = 3\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {initNgDevMode} from './ng_dev_mode';\n\n/**\n * This file contains reuseable \"empty\" symbols that can be used as default return values\n * in different parts of the rendering code. Because the same symbols are returned, this\n * allows for identity checks against these values to be consistently used by the framework\n * code.\n */\n\nexport const EMPTY_OBJ: {} = {};\nexport const EMPTY_ARRAY: any[] = [];\n\n// freezing the values prevents any code from accidentally inserting new values in\nif ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {\n // These property accesses can be ignored because ngDevMode will be set to false\n // when optimizing code and the whole if statement will be dropped.\n // tslint:disable-next-line:no-toplevel-property-access\n Object.freeze(EMPTY_OBJ);\n // tslint:disable-next-line:no-toplevel-property-access\n Object.freeze(EMPTY_ARRAY);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getClosureSafeProperty} from '../util/property';\n\nexport const NG_COMP_DEF = getClosureSafeProperty({ɵcmp: getClosureSafeProperty});\nexport const NG_DIR_DEF = getClosureSafeProperty({ɵdir: getClosureSafeProperty});\nexport const NG_PIPE_DEF = getClosureSafeProperty({ɵpipe: getClosureSafeProperty});\nexport const NG_MOD_DEF = getClosureSafeProperty({ɵmod: getClosureSafeProperty});\nexport const NG_FACTORY_DEF = getClosureSafeProperty({ɵfac: getClosureSafeProperty});\n\n/**\n * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\n// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.\nexport const NG_ELEMENT_ID = getClosureSafeProperty({__NG_ELEMENT_ID__: getClosureSafeProperty});\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {Mutable, Type} from '../interface/type';\nimport {NgModuleDef} from '../metadata/ng_module_def';\nimport {SchemaMetadata} from '../metadata/schema';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {noSideEffects} from '../util/closure';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../util/empty';\nimport {initNgDevMode} from '../util/ng_dev_mode';\nimport {stringify} from '../util/stringify';\n\nimport {NG_COMP_DEF, NG_DIR_DEF, NG_MOD_DEF, NG_PIPE_DEF} from './fields';\nimport {ComponentDef, ComponentDefFeature, ComponentTemplate, ComponentType, ContentQueriesFunction, DependencyTypeList, DirectiveDef, DirectiveDefFeature, DirectiveDefList, HostBindingsFunction, PipeDef, PipeDefList, TypeOrFactory, ViewQueriesFunction} from './interfaces/definition';\nimport {TAttributes, TConstantsOrFactory} from './interfaces/node';\nimport {CssSelectorList} from './interfaces/projection';\n\n\n/** Counter used to generate unique IDs for component definitions. */\nlet componentDefCount = 0;\n\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵcmp = defineComponent({\n * ...\n * });\n * }\n * ```\n * @codeGenApi\n */\nexport function ɵɵdefineComponent<T>(componentDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this component. */\n selectors?: CssSelectorList;\n\n /**\n * The number of nodes, local refs, and pipes in this component template.\n *\n * Used to calculate the length of this component's LView array, so we\n * can pre-fill the array and set the binding start index.\n */\n // TODO(kara): remove queries from this count\n decls: number;\n\n /**\n * The number of bindings in this component template (including pure fn bindings).\n *\n * Used to calculate the length of this component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n vars: number;\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: ['publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['public', 'declared']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: HostBindingsFunction<T>;\n\n /**\n * The number of bindings in this directive `hostBindings` (including pure fn bindings).\n *\n * Used to calculate the length of the component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n hostVars?: number;\n\n /**\n * Assign static attribute values to a host element.\n *\n * This property will assign static attribute values as well as class and style\n * values to a host element. Since attribute values can consist of different types of values, the\n * `hostAttrs` array must include the values in the following format:\n *\n * attrs = [\n * // static attributes (like `title`, `name`, `id`...)\n * attr1, value1, attr2, value,\n *\n * // a single namespace value (like `x:id`)\n * NAMESPACE_MARKER, namespaceUri1, name1, value1,\n *\n * // another single namespace value (like `x:name`)\n * NAMESPACE_MARKER, namespaceUri2, name2, value2,\n *\n * // a series of CSS classes that will be applied to the element (no spaces)\n * CLASSES_MARKER, class1, class2, class3,\n *\n * // a series of CSS styles (property + value) that will be applied to the element\n * STYLES_MARKER, prop1, value1, prop2, value2\n * ]\n *\n * All non-class and non-style attributes must be defined at the start of the list\n * first before all class and style values are set. When there is a change in value\n * type (like when classes and styles are introduced) a marker must be used to separate\n * the entries. The marker values themselves are set via entries found in the\n * [AttributeMarker] enum.\n */\n hostAttrs?: TAttributes;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: ContentQueriesFunction<T>;\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string[];\n\n /**\n * Template function use for rendering DOM.\n *\n * This function has following structure.\n *\n * ```\n * function Template<T>(ctx:T, creationMode: boolean) {\n * if (creationMode) {\n * // Contains creation mode instructions.\n * }\n * // Contains binding update instructions\n * }\n * ```\n *\n * Common instructions are:\n * Creation mode instructions:\n * - `elementStart`, `elementEnd`\n * - `text`\n * - `container`\n * - `listener`\n *\n * Binding update instructions:\n * - `bind`\n * - `elementAttribute`\n * - `elementProperty`\n * - `elementClass`\n * - `elementStyle`\n *\n */\n template: ComponentTemplate<T>;\n\n /**\n * Constants for the nodes in the component's view.\n * Includes attribute arrays, local definition arrays etc.\n */\n consts?: TConstantsOrFactory;\n\n /**\n * An array of `ngContent[selector]` values that were found in the template.\n */\n ngContentSelectors?: string[];\n\n /**\n * Additional set of instructions specific to view query processing. This could be seen as a\n * set of instruction to be inserted into the template function.\n *\n * Query-related instructions need to be pulled out to a specific function as a timing of\n * execution is different as compared to all other instructions (after change detection hooks but\n * before view hooks).\n */\n viewQuery?: ViewQueriesFunction<T>| null;\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}\n */\n features?: ComponentDefFeature[];\n\n /**\n * Defines template and style encapsulation options available for Component's {@link Component}.\n */\n encapsulation?: ViewEncapsulation;\n\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n *\n * see: animation\n */\n data?: {[kind: string]: any};\n\n /**\n * A set of styles that the component needs to be present for component to render correctly.\n */\n styles?: string[];\n\n /**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n */\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Registry of directives, components, and pipes that may be found in this component's view.\n *\n * This property is either an array of types or a function that returns the array of types. This\n * function may be necessary to support forward declarations.\n */\n dependencies?: TypeOrFactory<DependencyTypeList>;\n\n /**\n * The set of schemas that declare elements to be allowed in the component's template.\n */\n schemas?: SchemaMetadata[] | null;\n\n /**\n * Whether this directive/component is standalone.\n */\n standalone?: boolean;\n}): unknown {\n return noSideEffects(() => {\n // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n\n const type = componentDefinition.type;\n const standalone = componentDefinition.standalone === true;\n const declaredInputs: {[key: string]: string} = {} as any;\n const def: Mutable<ComponentDef<any>, keyof ComponentDef<any>> = {\n type: type,\n providersResolver: null,\n decls: componentDefinition.decls,\n vars: componentDefinition.vars,\n factory: null,\n template: componentDefinition.template || null!,\n consts: componentDefinition.consts || null,\n ngContentSelectors: componentDefinition.ngContentSelectors,\n hostBindings: componentDefinition.hostBindings || null,\n hostVars: componentDefinition.hostVars || 0,\n hostAttrs: componentDefinition.hostAttrs || null,\n contentQueries: componentDefinition.contentQueries || null,\n declaredInputs: declaredInputs,\n inputs: null!, // assigned in noSideEffects\n outputs: null!, // assigned in noSideEffects\n exportAs: componentDefinition.exportAs || null,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null!, // assigned in noSideEffects\n pipeDefs: null!, // assigned in noSideEffects\n standalone,\n dependencies: standalone && componentDefinition.dependencies || null,\n getStandaloneInjector: null,\n selectors: componentDefinition.selectors || EMPTY_ARRAY,\n viewQuery: componentDefinition.viewQuery || null,\n features: componentDefinition.features as DirectiveDefFeature[] || null,\n data: componentDefinition.data || {},\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,\n id: `c${componentDefCount++}`,\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null,\n setInput: null,\n schemas: componentDefinition.schemas || null,\n tView: null,\n findHostDirectiveDefs: null,\n hostDirectives: null,\n };\n const dependencies = componentDefinition.dependencies;\n const feature = componentDefinition.features;\n def.inputs = invertObject(componentDefinition.inputs, declaredInputs),\n def.outputs = invertObject(componentDefinition.outputs),\n feature && feature.forEach((fn) => fn(def));\n def.directiveDefs = dependencies ?\n (() => (typeof dependencies === 'function' ? dependencies() : dependencies)\n .map(extractDirectiveDef)\n .filter(nonNull)) :\n null;\n def.pipeDefs = dependencies ?\n (() => (typeof dependencies === 'function' ? dependencies() : dependencies)\n .map(getPipeDef)\n .filter(nonNull)) :\n null;\n\n return def;\n });\n}\n\n/**\n * Generated next to NgModules to monkey-patch directive and pipe references onto a component's\n * definition, when generating a direct reference in the component file would otherwise create an\n * import cycle.\n *\n * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.\n *\n * @codeGenApi\n */\nexport function ɵɵsetComponentScope(\n type: ComponentType<any>, directives: Type<any>[]|(() => Type<any>[]),\n pipes: Type<any>[]|(() => Type<any>[])): void {\n const def = (type.ɵcmp as ComponentDef<any>);\n def.directiveDefs = () =>\n (typeof directives === 'function' ? directives() : directives).map(extractDirectiveDef) as\n DirectiveDefList;\n def.pipeDefs = () =>\n (typeof pipes === 'function' ? pipes() : pipes).map(getPipeDef) as PipeDefList;\n}\n\nexport function extractDirectiveDef(type: Type<any>): DirectiveDef<any>|ComponentDef<any>|null {\n return getComponentDef(type) || getDirectiveDef(type);\n}\n\nfunction nonNull<T>(value: T|null): value is T {\n return value !== null;\n}\n\n/**\n * @codeGenApi\n */\nexport function ɵɵdefineNgModule<T>(def: {\n /** Token representing the module. Used by DI. */\n type: T;\n\n /** List of components to bootstrap. */\n bootstrap?: Type<any>[] | (() => Type<any>[]);\n\n /** List of components, directives, and pipes declared by this module. */\n declarations?: Type<any>[] | (() => Type<any>[]);\n\n /** List of modules or `ModuleWithProviders` imported by this module. */\n imports?: Type<any>[] | (() => Type<any>[]);\n\n /**\n * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this\n * module.\n */\n exports?: Type<any>[] | (() => Type<any>[]);\n\n /** The set of schemas that declare elements to be allowed in the NgModule. */\n schemas?: SchemaMetadata[] | null;\n\n /** Unique ID for the module that is used with `getModuleFactory`. */\n id?: string | null;\n}): unknown {\n return noSideEffects(() => {\n const res: NgModuleDef<T> = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n schemas: def.schemas || null,\n id: def.id || null,\n };\n return res;\n });\n}\n\n/**\n * Adds the module metadata that is necessary to compute the module's transitive scope to an\n * existing module definition.\n *\n * Scope metadata of modules is not used in production builds, so calls to this function can be\n * marked pure to tree-shake it from the bundle, allowing for all referenced declarations\n * to become eligible for tree-shaking as well.\n *\n * @codeGenApi\n */\nexport function ɵɵsetNgModuleScope(type: any, scope: {\n /** List of components, directives, and pipes declared by this module. */\n declarations?: Type<any>[]|(() => Type<any>[]);\n\n /** List of modules or `ModuleWithProviders` imported by this module. */\n imports?: Type<any>[] | (() => Type<any>[]);\n\n /**\n * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this\n * module.\n */\n exports?: Type<any>[] | (() => Type<any>[]);\n}): unknown {\n return noSideEffects(() => {\n const ngModuleDef = getNgModuleDef(type, true);\n ngModuleDef.declarations = scope.declarations || EMPTY_ARRAY;\n ngModuleDef.imports = scope.imports || EMPTY_ARRAY;\n ngModuleDef.exports = scope.exports || EMPTY_ARRAY;\n });\n}\n\n/**\n * Inverts an inputs or outputs lookup such that the keys, which were the\n * minified keys, are part of the values, and the values are parsed so that\n * the publicName of the property is the new key\n *\n * e.g. for\n *\n * ```\n * class Comp {\n * @Input()\n * propName1: string;\n *\n * @Input('publicName2')\n * declaredPropName2: number;\n * }\n * ```\n *\n * will be serialized as\n *\n * ```\n * {\n * propName1: 'propName1',\n * declaredPropName2: ['publicName2', 'declaredPropName2'],\n * }\n * ```\n *\n * which is than translated by the minifier as:\n *\n * ```\n * {\n * minifiedPropName1: 'propName1',\n * minifiedPropName2: ['publicName2', 'declaredPropName2'],\n * }\n * ```\n *\n * becomes: (public name => minifiedName)\n *\n * ```\n * {\n * 'propName1': 'minifiedPropName1',\n * 'publicName2': 'minifiedPropName2',\n * }\n * ```\n *\n * Optionally the function can take `secondary` which will result in: (public name => declared name)\n *\n * ```\n * {\n * 'propName1': 'propName1',\n * 'publicName2': 'declaredPropName2',\n * }\n * ```\n *\n\n */\nfunction invertObject<T>(\n obj?: {[P in keyof T]?: string|[string, string]},\n secondary?: {[key: string]: string}): {[P in keyof T]: string} {\n if (obj == null) return EMPTY_OBJ as any;\n const newLookup: any = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n let publicName: string|[string, string] = obj[minifiedKey]!;\n let declaredName = publicName;\n if (Array.isArray(publicName)) {\n declaredName = publicName[1];\n publicName = publicName[0];\n }\n newLookup[publicName] = minifiedKey;\n if (secondary) {\n (secondary[publicName] = declaredName as string);\n }\n }\n }\n return newLookup;\n}\n\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```ts\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵdir = ɵɵdefineDirective({\n * ...\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nexport const ɵɵdefineDirective =\n ɵɵdefineComponent as any as<T>(directiveDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this directive. */\n selectors?: CssSelectorList;\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}\n */\n features?: DirectiveDefFeature[];\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: HostBindingsFunction<T>;\n\n /**\n * The number of bindings in this directive `hostBindings` (including pure fn bindings).\n *\n * Used to calculate the length of the component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n hostVars?: number;\n\n /**\n * Assign static attribute values to a host element.\n *\n * This property will assign static attribute values as well as class and style\n * values to a host element. Since attribute values can consist of different types of values,\n * the `hostAttrs` array must include the values in the following format:\n *\n * attrs = [\n * // static attributes (like `title`, `name`, `id`...)\n * attr1, value1, attr2, value,\n *\n * // a single namespace value (like `x:id`)\n * NAMESPACE_MARKER, namespaceUri1, name1, value1,\n *\n * // another single namespace value (like `x:name`)\n * NAMESPACE_MARKER, namespaceUri2, name2, value2,\n *\n * // a series of CSS classes that will be applied to the element (no spaces)\n * CLASSES_MARKER, class1, class2, class3,\n *\n * // a series of CSS styles (property + value) that will be applied to the element\n * STYLES_MARKER, prop1, value1, prop2, value2\n * ]\n *\n * All non-class and non-style attributes must be defined at the start of the list\n * first before all class and style values are set. When there is a change in value\n * type (like when classes and styles are introduced) a marker must be used to separate\n * the entries. The marker values themselves are set via entries found in the\n * [AttributeMarker] enum.\n */\n hostAttrs?: TAttributes;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: ContentQueriesFunction<T>;\n\n /**\n * Additional set of instructions specific to view query processing. This could be seen as a\n * set of instructions to be inserted into the template function.\n */\n viewQuery?: ViewQueriesFunction<T>| null;\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string[];\n }) => never;\n\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ɵpipe = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n *\n * @codeGenApi\n */\nexport function ɵɵdefinePipe<T>(pipeDef: {\n /** Name of the pipe. Used for matching pipes in template to pipe defs. */\n name: string,\n\n /** Pipe class reference. Needed to extract pipe lifecycle hooks. */\n type: Type<T>,\n\n /** Whether the pipe is pure. */\n pure?: boolean,\n\n /**\n * Whether the pipe is standalone.\n */\n standalone?: boolean,\n}): unknown {\n return (<PipeDef<T>>{\n type: pipeDef.type,\n name: pipeDef.name,\n factory: null,\n pure: pipeDef.pure !== false,\n standalone: pipeDef.standalone === true,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n });\n}\n\n/**\n * The following getter methods retrieve the definition from the type. Currently the retrieval\n * honors inheritance, but in the future we may change the rule to require that definitions are\n * explicit. This would require some sort of migration strategy.\n */\n\nexport function getComponentDef<T>(type: any): ComponentDef<T>|null {\n return type[NG_COMP_DEF] || null;\n}\n\nexport function getDirectiveDef<T>(type: any): DirectiveDef<T>|null {\n return type[NG_DIR_DEF] || null;\n}\n\nexport function getPipeDef<T>(type: any): PipeDef<T>|null {\n return type[NG_PIPE_DEF] || null;\n}\n\n/**\n * Checks whether a given Component, Directive or Pipe is marked as standalone.\n * This will return false if passed anything other than a Component, Directive, or Pipe class\n * See this guide for additional information: https://angular.io/guide/standalone-components\n *\n * @param type A reference to a Component, Directive or Pipe.\n * @publicApi\n */\nexport function isStandalone(type: Type<unknown>): boolean {\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);\n return def !== null ? def.standalone : false;\n}\n\nexport function getNgModuleDef<T>(type: any, throwNotFound: true): NgModuleDef<T>;\nexport function getNgModuleDef<T>(type: any): NgModuleDef<T>|null;\nexport function getNgModuleDef<T>(type: any, throwNotFound?: boolean): NgModuleDef<T>|null {\n const ngModuleDef = type[NG_MOD_DEF] || null;\n if (!ngModuleDef && throwNotFound === true) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`);\n }\n return ngModuleDef;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../../di/injector';\nimport {ProviderToken} from '../../di/provider_token';\nimport {SchemaMetadata} from '../../metadata/schema';\nimport {Sanitizer} from '../../sanitization/sanitizer';\n\nimport {LContainer} from './container';\nimport {ComponentDef, ComponentTemplate, DirectiveDef, DirectiveDefList, HostBindingsFunction, PipeDef, PipeDefList, ViewQueriesFunction} from './definition';\nimport {I18nUpdateOpCodes, TI18n, TIcu} from './i18n';\nimport {TConstants, TNode} from './node';\nimport {LQueries, TQueries} from './query';\nimport {Renderer, RendererFactory} from './renderer';\nimport {RElement} from './renderer_dom';\nimport {TStylingKey, TStylingRange} from './styling';\n\n\n\n// Below are constants for LView indices to help us look up LView members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nexport const HOST = 0;\nexport const TVIEW = 1;\nexport const FLAGS = 2;\nexport const PARENT = 3;\nexport const NEXT = 4;\nexport const TRANSPLANTED_VIEWS_TO_REFRESH = 5;\nexport const T_HOST = 6;\nexport const CLEANUP = 7;\nexport const CONTEXT = 8;\nexport const INJECTOR = 9;\nexport const RENDERER_FACTORY = 10;\nexport const RENDERER = 11;\nexport const SANITIZER = 12;\nexport const CHILD_HEAD = 13;\nexport const CHILD_TAIL = 14;\n// FIXME(misko): Investigate if the three declarations aren't all same thing.\nexport const DECLARATION_VIEW = 15;\nexport const DECLARATION_COMPONENT_VIEW = 16;\nexport const DECLARATION_LCONTAINER = 17;\nexport const PREORDER_HOOK_FLAGS = 18;\nexport const QUERIES = 19;\nexport const ID = 20;\nexport const EMBEDDED_VIEW_INJECTOR = 21;\n/**\n * Size of LView's header. Necessary to adjust for it when setting slots.\n *\n * IMPORTANT: `HEADER_OFFSET` should only be referred to the in the `ɵɵ*` instructions to translate\n * instruction index into `LView` index. All other indexes should be in the `LView` index space and\n * there should be no need to refer to `HEADER_OFFSET` anywhere else.\n */\nexport const HEADER_OFFSET = 22;\n\n\n// This interface replaces the real LView interface if it is an arg or a\n// return value of a public instruction. This ensures we don't need to expose\n// the actual interface, which should be kept private.\nexport interface OpaqueViewState {\n '__brand__': 'Brand for OpaqueViewState that nothing will match';\n}\n\n\n/**\n * `LView` stores all of the information needed to process the instructions as\n * they are invoked from the template. Each embedded view and component view has its\n * own `LView`. When processing a particular view, we set the `viewData` to that\n * `LView`. When that view is done processing, the `viewData` is set back to\n * whatever the original `viewData` was before (the parent `LView`).\n *\n * Keeping separate state for each view facilities view insertion / deletion, so we\n * don't have to edit the data array based on which views are present.\n */\nexport interface LView<T = unknown> extends Array<any> {\n /**\n * The node into which this `LView` is inserted.\n */\n [HOST]: RElement|null;\n\n /**\n * The static data for this view. We need a reference to this so we can easily walk up the\n * node tree in DI and get the TView.data array associated with a node (where the\n * directive defs are stored).\n */\n readonly[TVIEW]: TView;\n\n /** Flags for this view. See LViewFlags for more info. */\n [FLAGS]: LViewFlags;\n\n /**\n * This may store an {@link LView} or {@link LContainer}.\n *\n * `LView` - The parent view. This is needed when we exit the view and must restore the previous\n * LView. Without this, the render method would have to keep a stack of\n * views as it is recursively rendering templates.\n *\n * `LContainer` - The current view is part of a container, and is an embedded view.\n */\n [PARENT]: LView|LContainer|null;\n\n /**\n *\n * The next sibling LView or LContainer.\n *\n * Allows us to propagate between sibling view states that aren't in the same\n * container. Embedded views already have a node.next, but it is only set for\n * views in the same container. We need a way to link component views and views\n * across containers as well.\n */\n [NEXT]: LView|LContainer|null;\n\n /** Queries active for this view - nodes from a view are reported to those queries. */\n [QUERIES]: LQueries|null;\n\n /**\n * Store the `TNode` of the location where the current `LView` is inserted into.\n *\n * Given:\n * ```\n * <div>\n * <ng-template><span></span></ng-template>\n * </div>\n * ```\n *\n * We end up with two `TView`s.\n * - `parent` `TView` which contains `<div><!-- anchor --></div>`\n * - `child` `TView` which contains `<span></span>`\n *\n * Typically the `child` is inserted into the declaration location of the `parent`, but it can be\n * inserted anywhere. Because it can be inserted anywhere it is not possible to store the\n * insertion information in the `TView` and instead we must store it in the `LView[T_HOST]`.\n *\n * So to determine where is our insertion parent we would execute:\n * ```\n * const parentLView = lView[PARENT];\n * const parentTNode = lView[T_HOST];\n * const insertionParent = parentLView[parentTNode.index];\n * ```\n *\n *\n * If `null`, this is the root view of an application (root component is in this view) and it has\n * no parents.\n */\n [T_HOST]: TNode|null;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This context array stores both listener functions wrapped with\n * their context and output subscription instances for a particular view.\n *\n * These change per LView instance, so they cannot be stored on TView. Instead,\n * TView.cleanup saves an index to the necessary context in this array.\n *\n * After `LView` is created it is possible to attach additional instance specific functions at the\n * end of the `lView[CLEANUP]` because we know that no more `T` level cleanup functions will be\n * added here.\n */\n [CLEANUP]: any[]|null;\n\n /**\n * - For dynamic views, this is the context with which to render the template (e.g.\n * `NgForContext`), or `{}` if not defined explicitly.\n * - For root view of the root component it's a reference to the component instance itself.\n * - For components, the context is a reference to the component instance itself.\n * - For inline views, the context is null.\n */\n [CONTEXT]: T;\n\n /** An optional Module Injector to be used as fall back after Element Injectors are consulted. */\n readonly[INJECTOR]: Injector|null;\n\n /** Factory to be used for creating Renderer. */\n [RENDERER_FACTORY]: RendererFactory;\n\n /** Renderer to be used for this view. */\n [RENDERER]: Renderer;\n\n /** An optional custom sanitizer. */\n [SANITIZER]: Sanitizer|null;\n\n /**\n * Reference to the first LView or LContainer beneath this LView in\n * the hierarchy.\n *\n * Necessary to store this so views can traverse through their nested views\n * to remove listeners and call onDestroy callbacks.\n */\n [CHILD_HEAD]: LView|LContainer|null;\n\n /**\n * The last LView or LContainer beneath this LView in the hierarchy.\n *\n * The tail allows us to quickly add a new state to the end of the view list\n * without having to propagate starting from the first child.\n */\n [CHILD_TAIL]: LView|LContainer|null;\n\n /**\n * View where this view's template was declared.\n *\n * The template for a dynamically created view may be declared in a different view than\n * it is inserted. We already track the \"insertion view\" (view where the template was\n * inserted) in LView[PARENT], but we also need access to the \"declaration view\"\n * (view where the template was declared). Otherwise, we wouldn't be able to call the\n * view's template function with the proper contexts. Context should be inherited from\n * the declaration view tree, not the insertion view tree.\n *\n * Example (AppComponent template):\n *\n * <ng-template #foo></ng-template> <-- declared here -->\n * <some-comp [tpl]=\"foo\"></some-comp> <-- inserted inside this component -->\n *\n * The <ng-template> above is declared in the AppComponent template, but it will be passed into\n * SomeComp and inserted there. In this case, the declaration view would be the AppComponent,\n * but the insertion view would be SomeComp. When we are removing views, we would want to\n * traverse through the insertion view to clean up listeners. When we are calling the\n * template function during change detection, we need the declaration view to get inherited\n * context.\n */\n [DECLARATION_VIEW]: LView|null;\n\n\n /**\n * Points to the declaration component view, used to track transplanted `LView`s.\n *\n * See: `DECLARATION_VIEW` which points to the actual `LView` where it was declared, whereas\n * `DECLARATION_COMPONENT_VIEW` points to the component which may not be same as\n * `DECLARATION_VIEW`.\n *\n * Example:\n * ```\n * <#VIEW #myComp>\n * <div *ngIf=\"true\">\n * <ng-template #myTmpl>...</ng-template>\n * </div>\n * </#VIEW>\n * ```\n * In the above case `DECLARATION_VIEW` for `myTmpl` points to the `LView` of `ngIf` whereas\n * `DECLARATION_COMPONENT_VIEW` points to `LView` of the `myComp` which owns the template.\n *\n * The reason for this is that all embedded views are always check-always whereas the component\n * view can be check-always or on-push. When we have a transplanted view it is important to\n * determine if we have transplanted a view from check-always declaration to on-push insertion\n * point. In such a case the transplanted view needs to be added to the `LContainer` in the\n * declared `LView` and CD during the declared view CD (in addition to the CD at the insertion\n * point.) (Any transplanted views which are intra Component are of no interest because the CD\n * strategy of declaration and insertion will always be the same, because it is the same\n * component.)\n *\n * Queries already track moved views in `LView[DECLARATION_LCONTAINER]` and\n * `LContainer[MOVED_VIEWS]`. However the queries also track `LView`s which moved within the same\n * component `LView`. Transplanted views are a subset of moved views, and we use\n * `DECLARATION_COMPONENT_VIEW` to differentiate them. As in this example.\n *\n * Example showing intra component `LView` movement.\n * ```\n * <#VIEW #myComp>\n * <div *ngIf=\"condition; then thenBlock else elseBlock\"></div>\n * <ng-template #thenBlock>Content to render when condition is true.</ng-template>\n * <ng-template #elseBlock>Content to render when condition is false.</ng-template>\n * </#VIEW>\n * ```\n * The `thenBlock` and `elseBlock` is moved but not transplanted.\n *\n * Example showing inter component `LView` movement (transplanted view).\n * ```\n * <#VIEW #myComp>\n * <ng-template #myTmpl>...</ng-template>\n * <insertion-component [template]=\"myTmpl\"></insertion-component>\n * </#VIEW>\n * ```\n * In the above example `myTmpl` is passed into a different component. If `insertion-component`\n * instantiates `myTmpl` and `insertion-component` is on-push then the `LContainer` needs to be\n * marked as containing transplanted views and those views need to be CD as part of the\n * declaration CD.\n *\n *\n * When change detection runs, it iterates over `[MOVED_VIEWS]` and CDs any child `LView`s where\n * the `DECLARATION_COMPONENT_VIEW` of the current component and the child `LView` does not match\n * (it has been transplanted across components.)\n *\n * Note: `[DECLARATION_COMPONENT_VIEW]` points to itself if the LView is a component view (the\n * simplest / most common case).\n *\n * see also:\n * - https://hackmd.io/@mhevery/rJUJsvv9H write up of the problem\n * - `LContainer[HAS_TRANSPLANTED_VIEWS]` which marks which `LContainer` has transplanted views.\n * - `LContainer[TRANSPLANT_HEAD]` and `LContainer[TRANSPLANT_TAIL]` storage for transplanted\n * - `LView[DECLARATION_LCONTAINER]` similar problem for queries\n * - `LContainer[MOVED_VIEWS]` similar problem for queries\n */\n [DECLARATION_COMPONENT_VIEW]: LView;\n\n /**\n * A declaration point of embedded views (ones instantiated based on the content of a\n * <ng-template>), null for other types of views.\n *\n * We need to track all embedded views created from a given declaration point so we can prepare\n * query matches in a proper order (query matches are ordered based on their declaration point and\n * _not_ the insertion point).\n */\n [DECLARATION_LCONTAINER]: LContainer|null;\n\n /**\n * More flags for this view. See PreOrderHookFlags for more info.\n */\n [PREORDER_HOOK_FLAGS]: PreOrderHookFlags;\n\n /**\n * The number of direct transplanted views which need a refresh or have descendants themselves\n * that need a refresh but have not marked their ancestors as Dirty. This tells us that during\n * change detection we should still descend to find those children to refresh, even if the parents\n * are not `Dirty`/`CheckAlways`.\n */\n [TRANSPLANTED_VIEWS_TO_REFRESH]: number;\n\n /** Unique ID of the view. Used for `__ngContext__` lookups in the `LView` registry. */\n [ID]: number;\n\n /**\n * Optional injector assigned to embedded views that takes\n * precedence over the element and module injectors.\n */\n readonly[EMBEDDED_VIEW_INJECTOR]: Injector|null;\n}\n\n/** Flags associated with an LView (saved in LView[FLAGS]) */\nexport const enum LViewFlags {\n /** The state of the init phase on the first 2 bits */\n InitPhaseStateIncrementer = 0b00000000001,\n InitPhaseStateMask = 0b00000000011,\n\n /**\n * Whether or not the view is in creationMode.\n *\n * This must be stored in the view rather than using `data` as a marker so that\n * we can properly support embedded views. Otherwise, when exiting a child view\n * back into the parent view, `data` will be defined and `creationMode` will be\n * improperly reported as false.\n */\n CreationMode = 0b00000000100,\n\n /**\n * Whether or not this LView instance is on its first processing pass.\n *\n * An LView instance is considered to be on its \"first pass\" until it\n * has completed one creation mode run and one update mode run. At this\n * time, the flag is turned off.\n */\n FirstLViewPass = 0b00000001000,\n\n /** Whether this view has default change detection strategy (checks always) or onPush */\n CheckAlways = 0b00000010000,\n\n /** Whether or not this view is currently dirty (needing check) */\n Dirty = 0b00000100000,\n\n /** Whether or not this view is currently attached to change detection tree. */\n Attached = 0b000001000000,\n\n /** Whether or not this view is destroyed. */\n Destroyed = 0b000010000000,\n\n /** Whether or not this view is the root view */\n IsRoot = 0b000100000000,\n\n /**\n * Whether this moved LView was needs to be refreshed at the insertion location because the\n * declaration was dirty.\n */\n RefreshTransplantedView = 0b001000000000,\n\n /** Indicates that the view **or any of its ancestors** have an embedded view injector. */\n HasEmbeddedViewInjector = 0b0010000000000,\n\n /**\n * Index of the current init phase on last 21 bits\n */\n IndexWithinInitPhaseIncrementer = 0b0100000000000,\n IndexWithinInitPhaseShift = 11,\n IndexWithinInitPhaseReset = 0b0011111111111,\n}\n\n/**\n * Possible states of the init phase:\n * - 00: OnInit hooks to be run.\n * - 01: AfterContentInit hooks to be run\n * - 10: AfterViewInit hooks to be run\n * - 11: All init hooks have been run\n */\nexport const enum InitPhaseState {\n OnInitHooksToBeRun = 0b00,\n AfterContentInitHooksToBeRun = 0b01,\n AfterViewInitHooksToBeRun = 0b10,\n InitPhaseCompleted = 0b11,\n}\n\n/** More flags associated with an LView (saved in LView[PREORDER_HOOK_FLAGS]) */\nexport const enum PreOrderHookFlags {\n /**\n The index of the next pre-order hook to be called in the hooks array, on the first 16\n bits\n */\n IndexOfTheNextPreOrderHookMaskMask = 0b01111111111111111,\n\n /**\n * The number of init hooks that have already been called, on the last 16 bits\n */\n NumberOfInitHooksCalledIncrementer = 0b010000000000000000,\n NumberOfInitHooksCalledShift = 16,\n NumberOfInitHooksCalledMask = 0b11111111111111110000000000000000,\n}\n\n/**\n * Stores a set of OpCodes to process `HostBindingsFunction` associated with a current view.\n *\n * In order to invoke `HostBindingsFunction` we need:\n * 1. 'elementIdx`: Index to the element associated with the `HostBindingsFunction`.\n * 2. 'directiveIdx`: Index to the directive associated with the `HostBindingsFunction`. (This will\n * become the context for the `HostBindingsFunction` invocation.)\n * 3. `bindingRootIdx`: Location where the bindings for the `HostBindingsFunction` start. Internally\n * `HostBindingsFunction` binding indexes start from `0` so we need to add `bindingRootIdx` to\n * it.\n * 4. `HostBindingsFunction`: A host binding function to execute.\n *\n * The above information needs to be encoded into the `HostBindingOpCodes` in an efficient manner.\n *\n * 1. `elementIdx` is encoded into the `HostBindingOpCodes` as `~elementIdx` (so a negative number);\n * 2. `directiveIdx`\n * 3. `bindingRootIdx`\n * 4. `HostBindingsFunction` is passed in as is.\n *\n * The `HostBindingOpCodes` array contains:\n * - negative number to select the element index.\n * - followed by 1 or more of:\n * - a number to select the directive index\n * - a number to select the bindingRoot index\n * - and a function to invoke.\n *\n * ## Example\n *\n * ```\n * const hostBindingOpCodes = [\n * ~30, // Select element 30\n * 40, 45, MyDir.ɵdir.hostBindings // Invoke host bindings on MyDir on element 30;\n * // directiveIdx = 40; bindingRootIdx = 45;\n * 50, 55, OtherDir.ɵdir.hostBindings // Invoke host bindings on OtherDire on element 30\n * // directiveIdx = 50; bindingRootIdx = 55;\n * ]\n * ```\n *\n * ## Pseudocode\n * ```\n * const hostBindingOpCodes = tView.hostBindingOpCodes;\n * if (hostBindingOpCodes === null) return;\n * for (let i = 0; i < hostBindingOpCodes.length; i++) {\n * const opCode = hostBindingOpCodes[i] as number;\n * if (opCode < 0) {\n * // Negative numbers are element indexes.\n * setSelectedIndex(~opCode);\n * } else {\n * // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n * const directiveIdx = opCode;\n * const bindingRootIndx = hostBindingOpCodes[++i] as number;\n * const hostBindingFn = hostBindingOpCodes[++i] as HostBindingsFunction<any>;\n * setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n * const context = lView[directiveIdx];\n * hostBindingFn(RenderFlags.Update, context);\n * }\n * }\n * ```\n *\n */\nexport interface HostBindingOpCodes extends Array<number|HostBindingsFunction<any>> {\n __brand__: 'HostBindingOpCodes';\n debug?: string[];\n}\n\n/**\n * Explicitly marks `TView` as a specific type in `ngDevMode`\n *\n * It is useful to know conceptually what time of `TView` we are dealing with when\n * debugging an application (even if the runtime does not need it.) For this reason\n * we store this information in the `ngDevMode` `TView` and than use it for\n * better debugging experience.\n */\nexport const enum TViewType {\n /**\n * Root `TView` is the used to bootstrap components into. It is used in conjunction with\n * `LView` which takes an existing DOM node not owned by Angular and wraps it in `TView`/`LView`\n * so that other components can be loaded into it.\n */\n Root = 0,\n\n /**\n * `TView` associated with a Component. This would be the `TView` directly associated with the\n * component view (as opposed an `Embedded` `TView` which would be a child of `Component` `TView`)\n */\n Component = 1,\n\n /**\n * `TView` associated with a template. Such as `*ngIf`, `<ng-template>` etc... A `Component`\n * can have zero or more `Embedded` `TView`s.\n */\n Embedded = 2,\n}\n\n/**\n * The static data for an LView (shared between all templates of a\n * given type).\n *\n * Stored on the `ComponentDef.tView`.\n */\nexport interface TView {\n /**\n * Type of `TView` (`Root`|`Component`|`Embedded`).\n */\n type: TViewType;\n\n /**\n * This is a blueprint used to generate LView instances for this TView. Copying this\n * blueprint is faster than creating a new LView from scratch.\n */\n blueprint: LView;\n\n /**\n * The template function used to refresh the view of dynamically created views\n * and components. Will be null for inline views.\n */\n template: ComponentTemplate<{}>|null;\n\n /**\n * A function containing query-related instructions.\n */\n viewQuery: ViewQueriesFunction<{}>|null;\n\n /**\n * A `TNode` representing the declaration location of this `TView` (not part of this TView).\n */\n declTNode: TNode|null;\n\n // FIXME(misko): Why does `TView` not have `declarationTView` property?\n\n /** Whether or not this template has been processed in creation mode. */\n firstCreatePass: boolean;\n\n /**\n * Whether or not this template has been processed in update mode (e.g. change detected)\n *\n * `firstUpdatePass` is used by styling to set up `TData` to contain metadata about the styling\n * instructions. (Mainly to build up a linked list of styling priority order.)\n *\n * Typically this function gets cleared after first execution. If exception is thrown then this\n * flag can remain turned un until there is first successful (no exception) pass. This means that\n * individual styling instructions keep track of if they have already been added to the linked\n * list to prevent double adding.\n */\n firstUpdatePass: boolean;\n\n /** Static data equivalent of LView.data[]. Contains TNodes, PipeDefInternal or TI18n. */\n data: TData;\n\n /**\n * The binding start index is the index at which the data array\n * starts to store bindings only. Saving this value ensures that we\n * will begin reading bindings at the correct point in the array when\n * we are in update mode.\n *\n * -1 means that it has not been initialized.\n */\n bindingStartIndex: number;\n\n /**\n * The index where the \"expando\" section of `LView` begins. The expando\n * section contains injectors, directive instances, and host binding values.\n * Unlike the \"decls\" and \"vars\" sections of `LView`, the length of this\n * section cannot be calculated at compile-time because directives are matched\n * at runtime to preserve locality.\n *\n * We store this start index so we know where to start checking host bindings\n * in `setHostBindings`.\n */\n expandoStartIndex: number;\n\n /**\n * Whether or not there are any static view queries tracked on this view.\n *\n * We store this so we know whether or not we should do a view query\n * refresh after creation mode to collect static query results.\n */\n staticViewQueries: boolean;\n\n /**\n * Whether or not there are any static content queries tracked on this view.\n *\n * We store this so we know whether or not we should do a content query\n * refresh after creation mode to collect static query results.\n */\n staticContentQueries: boolean;\n\n /**\n * A reference to the first child node located in the view.\n */\n firstChild: TNode|null;\n\n /**\n * Stores the OpCodes to be replayed during change-detection to process the `HostBindings`\n *\n * See `HostBindingOpCodes` for encoding details.\n */\n hostBindingOpCodes: HostBindingOpCodes|null;\n\n /**\n * Full registry of directives and components that may be found in this view.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n directiveRegistry: DirectiveDefList|null;\n\n /**\n * Full registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n pipeRegistry: PipeDefList|null;\n\n /**\n * Array of ngOnInit, ngOnChanges and ngDoCheck hooks that should be executed for this view in\n * creation mode.\n *\n * This array has a flat structure and contains TNode indices, directive indices (where an\n * instance can be found in `LView`) and hook functions. TNode index is followed by the directive\n * index and a hook function. If there are multiple hooks for a given TNode, the TNode index is\n * not repeated and the next lifecycle hook information is stored right after the previous hook\n * function. This is done so that at runtime the system can efficiently iterate over all of the\n * functions to invoke without having to make any decisions/lookups.\n */\n preOrderHooks: HookData|null;\n\n /**\n * Array of ngOnChanges and ngDoCheck hooks that should be executed for this view in update mode.\n *\n * This array has the same structure as the `preOrderHooks` one.\n */\n preOrderCheckHooks: HookData|null;\n\n /**\n * Array of ngAfterContentInit and ngAfterContentChecked hooks that should be executed\n * for this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentHooks: HookData|null;\n\n /**\n * Array of ngAfterContentChecked hooks that should be executed for this view in update\n * mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentCheckHooks: HookData|null;\n\n /**\n * Array of ngAfterViewInit and ngAfterViewChecked hooks that should be executed for\n * this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewHooks: HookData|null;\n\n /**\n * Array of ngAfterViewChecked hooks that should be executed for this view in\n * update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewCheckHooks: HookData|null;\n\n /**\n * Array of ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n destroyHooks: DestroyHookData|null;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This cleanup array stores both listener data (in chunks of 4)\n * and output data (in chunks of 2) for a particular view. Combining the arrays\n * saves on memory (70 bytes per array) and on a few bytes of code size (for two\n * separate for loops).\n *\n * If it's a native DOM listener or output subscription being stored:\n * 1st index is: event name `name = tView.cleanup[i+0]`\n * 2nd index is: index of native element or a function that retrieves global target (window,\n * document or body) reference based on the native element:\n * `typeof idxOrTargetGetter === 'function'`: global target getter function\n * `typeof idxOrTargetGetter === 'number'`: index of native element\n *\n * 3rd index is: index of listener function `listener = lView[CLEANUP][tView.cleanup[i+2]]`\n * 4th index is: `useCaptureOrIndx = tView.cleanup[i+3]`\n * `typeof useCaptureOrIndx == 'boolean' : useCapture boolean\n * `typeof useCaptureOrIndx == 'number':\n * `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`\n * `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`\n *\n * If it's an output subscription or query list destroy hook:\n * 1st index is: output unsubscribe function / query list destroy function\n * 2nd index is: index of function context in LView.cleanupInstances[]\n * `tView.cleanup[i+0].call(lView[CLEANUP][tView.cleanup[i+1]])`\n */\n cleanup: any[]|null;\n\n /**\n * A list of element indices for child components that will need to be\n * refreshed when the current view has finished its check. These indices have\n * already been adjusted for the HEADER_OFFSET.\n *\n */\n components: number[]|null;\n\n /**\n * A collection of queries tracked in a given view.\n */\n queries: TQueries|null;\n\n /**\n * An array of indices pointing to directives with content queries alongside with the\n * corresponding query index. Each entry in this array is a tuple of:\n * - index of the first content query index declared by a given directive;\n * - index of a directive.\n *\n * We are storing those indexes so we can refresh content queries as part of a view refresh\n * process.\n */\n contentQueries: number[]|null;\n\n /**\n * Set of schemas that declare elements to be allowed inside the view.\n */\n schemas: SchemaMetadata[]|null;\n\n /**\n * Array of constants for the view. Includes attribute arrays, local definition arrays etc.\n * Used for directive matching, attribute bindings, local definitions and more.\n */\n consts: TConstants|null;\n\n /**\n * Indicates that there was an error before we managed to complete the first create pass of the\n * view. This means that the view is likely corrupted and we should try to recover it.\n */\n incompleteFirstPass: boolean;\n}\n\n/** Single hook callback function. */\nexport type HookFn = () => void;\n\n/**\n * Information necessary to call a hook. E.g. the callback that\n * needs to invoked and the index at which to find its context.\n */\nexport type HookEntry = number|HookFn;\n\n/**\n * Array of hooks that should be executed for a view and their directive indices.\n *\n * For each node of the view, the following data is stored:\n * 1) Node index (optional)\n * 2) A series of number/function pairs where:\n * - even indices are directive indices\n * - odd indices are hook functions\n *\n * Special cases:\n * - a negative directive index flags an init hook (ngOnInit, ngAfterContentInit, ngAfterViewInit)\n */\nexport type HookData = HookEntry[];\n\n/**\n * Array of destroy hooks that should be executed for a view and their directive indices.\n *\n * The array is set up as a series of number/function or number/(number|function)[]:\n * - Even indices represent the context with which hooks should be called.\n * - Odd indices are the hook functions themselves. If a value at an odd index is an array,\n * it represents the destroy hooks of a `multi` provider where:\n * - Even indices represent the index of the provider for which we've registered a destroy hook,\n * inside of the `multi` provider array.\n * - Odd indices are the destroy hook functions.\n * For example:\n * LView: `[0, 1, 2, AService, 4, [BService, CService, DService]]`\n * destroyHooks: `[3, AService.ngOnDestroy, 5, [0, BService.ngOnDestroy, 2, DService.ngOnDestroy]]`\n *\n * In the example above `AService` is a type provider with an `ngOnDestroy`, whereas `BService`,\n * `CService` and `DService` are part of a `multi` provider where only `BService` and `DService`\n * have an `ngOnDestroy` hook.\n */\nexport type DestroyHookData = (HookEntry|HookData)[];\n\n/**\n * Static data that corresponds to the instance-specific data array on an LView.\n *\n * Each node's static data is stored in tData at the same index that it's stored\n * in the data array. Any nodes that do not have static data store a null value in\n * tData to avoid a sparse array.\n *\n * Each pipe's definition is stored here at the same index as its pipe instance in\n * the data array.\n *\n * Each host property's name is stored here at the same index as its value in the\n * data array.\n *\n * Each property binding name is stored here at the same index as its value in\n * the data array. If the binding is an interpolation, the static string values\n * are stored parallel to the dynamic values. Example:\n *\n * id=\"prefix {{ v0 }} a {{ v1 }} b {{ v2 }} suffix\"\n *\n * LView | TView.data\n *------------------------\n * v0 value | 'a'\n * v1 value | 'b'\n * v2 value | id � prefix � suffix\n *\n * Injector bloom filters are also stored here.\n */\nexport type TData = (TNode|PipeDef<any>|DirectiveDef<any>|ComponentDef<any>|number|TStylingRange|\n TStylingKey|ProviderToken<any>|TI18n|I18nUpdateOpCodes|TIcu|null|string)[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {TNode} from './node';\nimport {RComment, RElement} from './renderer_dom';\nimport {HOST, LView, NEXT, PARENT, T_HOST, TRANSPLANTED_VIEWS_TO_REFRESH} from './view';\n\n\n\n/**\n * Special location which allows easy identification of type. If we have an array which was\n * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is\n * `LContainer`.\n */\nexport const TYPE = 1;\n\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\n\n/**\n * Flag to signify that this `LContainer` may have transplanted views which need to be change\n * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.\n *\n * This flag, once set, is never unset for the `LContainer`. This means that when unset we can skip\n * a lot of work in `refreshEmbeddedViews`. But when set we still need to verify\n * that the `MOVED_VIEWS` are transplanted and on-push.\n */\nexport const HAS_TRANSPLANTED_VIEWS = 2;\n\n// PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5\n// As we already have these constants in LView, we don't need to re-create them.\n\n// T_HOST is index 6\n// We already have this constants in LView, we don't need to re-create it.\n\nexport const NATIVE = 7;\nexport const VIEW_REFS = 8;\nexport const MOVED_VIEWS = 9;\n\n\n/**\n * Size of LContainer's header. Represents the index after which all views in the\n * container will be inserted. We need to keep a record of current views so we know\n * which views are already in the DOM (and don't need to be re-added) and so we can\n * remove views from the DOM when they are no longer required.\n */\nexport const CONTAINER_HEADER_OFFSET = 10;\n\n/**\n * The state associated with a container.\n *\n * This is an array so that its structure is closer to LView. This helps\n * when traversing the view tree (which is a mix of containers and component\n * views), so we can jump to viewOrContainer[NEXT] in the same way regardless\n * of type.\n */\nexport interface LContainer extends Array<any> {\n /**\n * The host element of this LContainer.\n *\n * The host could be an LView if this container is on a component node.\n * In that case, the component LView is its HOST.\n */\n readonly[HOST]: RElement|RComment|LView;\n\n /**\n * This is a type field which allows us to differentiate `LContainer` from `StylingContext` in an\n * efficient way. The value is always set to `true`\n */\n [TYPE]: true;\n\n /**\n * Flag to signify that this `LContainer` may have transplanted views which need to be change\n * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.\n *\n * This flag, once set, is never unset for the `LContainer`.\n */\n [HAS_TRANSPLANTED_VIEWS]: boolean;\n\n /**\n * Access to the parent view is necessary so we can propagate back\n * up from inside a container to parent[NEXT].\n */\n [PARENT]: LView;\n\n /**\n * This allows us to jump from a container to a sibling container or component\n * view with the same parent, so we can remove listeners efficiently.\n */\n [NEXT]: LView|LContainer|null;\n\n /**\n * The number of direct transplanted views which need a refresh or have descendants themselves\n * that need a refresh but have not marked their ancestors as Dirty. This tells us that during\n * change detection we should still descend to find those children to refresh, even if the parents\n * are not `Dirty`/`CheckAlways`.\n */\n [TRANSPLANTED_VIEWS_TO_REFRESH]: number;\n\n /**\n * A collection of views created based on the underlying `<ng-template>` element but inserted into\n * a different `LContainer`. We need to track views created from a given declaration point since\n * queries collect matches from the embedded view declaration point and _not_ the insertion point.\n */\n [MOVED_VIEWS]: LView[]|null;\n\n /**\n * Pointer to the `TNode` which represents the host of the container.\n */\n [T_HOST]: TNode;\n\n /** The comment element that serves as an anchor for this LContainer. */\n readonly[NATIVE]:\n RComment; // TODO(misko): remove as this value can be gotten by unwrapping `[HOST]`\n\n /**\n * Array of `ViewRef`s used by any `ViewContainerRef`s that point to this container.\n *\n * This is lazily initialized by `ViewContainerRef` when the first view is inserted.\n *\n * NOTE: This is stored as `any[]` because render3 should really not be aware of `ViewRef` and\n * doing so creates circular dependency.\n */\n [VIEW_REFS]: unknown[]|null;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {LContainer, TYPE} from './container';\nimport {ComponentDef, DirectiveDef} from './definition';\nimport {TNode, TNodeFlags} from './node';\nimport {RNode} from './renderer_dom';\nimport {FLAGS, LView, LViewFlags} from './view';\n\n\n/**\n * True if `value` is `LView`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nexport function isLView(value: RNode|LView|LContainer|{}|null): value is LView {\n return Array.isArray(value) && typeof value[TYPE] === 'object';\n}\n\n/**\n * True if `value` is `LContainer`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nexport function isLContainer(value: RNode|LView|LContainer|{}|null): value is LContainer {\n return Array.isArray(value) && value[TYPE] === true;\n}\n\nexport function isContentQueryHost(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.hasContentQuery) !== 0;\n}\n\nexport function isComponentHost(tNode: TNode): boolean {\n return tNode.componentOffset > -1;\n}\n\nexport function isDirectiveHost(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.isDirectiveHost) === TNodeFlags.isDirectiveHost;\n}\n\nexport function isComponentDef<T>(def: DirectiveDef<T>): def is ComponentDef<T> {\n return (def as ComponentDef<T>).template !== null;\n}\n\nexport function isRootView(target: LView): boolean {\n return (target[FLAGS] & LViewFlags.IsRoot) !== 0;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\nimport {stringify} from '../util/stringify';\nimport {NG_FACTORY_DEF} from './fields';\n\n\n/**\n * Definition of what a factory function should look like.\n */\nexport type FactoryFn<T> = {\n /**\n * Subclasses without an explicit constructor call through to the factory of their base\n * definition, providing it with their own constructor to instantiate.\n */\n <U extends T>(t?: Type<U>): U;\n\n /**\n * If no constructor to instantiate is provided, an instance of type T itself is created.\n */\n (t?: undefined): T;\n};\n\n\nexport function getFactoryDef<T>(type: any, throwNotFound: true): FactoryFn<T>;\nexport function getFactoryDef<T>(type: any): FactoryFn<T>|null;\nexport function getFactoryDef<T>(type: any, throwNotFound?: boolean): FactoryFn<T>|null {\n const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);\n if (!hasFactoryDef && throwNotFound === true && ngDevMode) {\n throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);\n }\n return hasFactoryDef ? type[NG_FACTORY_DEF] : null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see `OnChanges`\n *\n * @publicApi\n */\nexport class SimpleChange {\n constructor(public previousValue: any, public currentValue: any, public firstChange: boolean) {}\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange(): boolean {\n return this.firstChange;\n }\n}\n\n/**\n * A hashtable of changes represented by {@link SimpleChange} objects stored\n * at the declared property name they belong to on a Directive or Component. This is\n * the type passed to the `ngOnChanges` hook.\n *\n * @see `OnChanges`\n *\n * @publicApi\n */\nexport interface SimpleChanges {\n [propName: string]: SimpleChange;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OnChanges} from '../../interface/lifecycle_hooks';\nimport {SimpleChange, SimpleChanges} from '../../interface/simple_change';\nimport {assertString} from '../../util/assert';\nimport {EMPTY_OBJ} from '../../util/empty';\nimport {DirectiveDef, DirectiveDefFeature} from '../interfaces/definition';\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nexport function ɵɵNgOnChangesFeature<T>(): DirectiveDefFeature {\n return NgOnChangesFeatureImpl;\n}\n\nexport function NgOnChangesFeatureImpl<T>(definition: DirectiveDef<T>) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n\n// This option ensures that the ngOnChanges lifecycle hook will be inherited\n// from superclasses (in InheritDefinitionFeature).\n/** @nocollapse */\n// tslint:disable-next-line:no-toplevel-property-access\n(ɵɵNgOnChangesFeature as DirectiveDefFeature).ngInherit = true;\n\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook(this: OnChanges) {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n\n if (current) {\n const previous = simpleChangesStore!.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore!.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore!.current = null;\n this.ngOnChanges(current);\n }\n}\n\n\nfunction ngOnChangesSetInput<T>(\n this: DirectiveDef<T>, instance: T, value: any, publicName: string, privateName: string): void {\n const declaredName = (this.declaredInputs as {[key: string]: string})[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) ||\n setSimpleChangesStore(instance, {previous: EMPTY_OBJ, current: null});\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(\n previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n\n (instance as any)[privateName] = value;\n}\n\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\n\nfunction getSimpleChangesStore(instance: any): null|NgSimpleChangesStore {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\n\nfunction setSimpleChangesStore(instance: any, store: NgSimpleChangesStore): NgSimpleChangesStore {\n return instance[SIMPLE_CHANGES_STORE] = store;\n}\n\n/**\n * Data structure which is monkey-patched on the component instance and used by `ngOnChanges`\n * life-cycle hook to track previous input values.\n */\ninterface NgSimpleChangesStore {\n previous: SimpleChanges;\n current: SimpleChanges|null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Profiler events is an enum used by the profiler to distinguish between different calls of user\n * code invoked throughout the application lifecycle.\n */\nexport const enum ProfilerEvent {\n /**\n * Corresponds to the point in time before the runtime has called the template function of a\n * component with `RenderFlags.Create`.\n */\n TemplateCreateStart,\n\n /**\n * Corresponds to the point in time after the runtime has called the template function of a\n * component with `RenderFlags.Create`.\n */\n TemplateCreateEnd,\n\n /**\n * Corresponds to the point in time before the runtime has called the template function of a\n * component with `RenderFlags.Update`.\n */\n TemplateUpdateStart,\n\n /**\n * Corresponds to the point in time after the runtime has called the template function of a\n * component with `RenderFlags.Update`.\n */\n TemplateUpdateEnd,\n\n /**\n * Corresponds to the point in time before the runtime has called a lifecycle hook of a component\n * or directive.\n */\n LifecycleHookStart,\n\n /**\n * Corresponds to the point in time after the runtime has called a lifecycle hook of a component\n * or directive.\n */\n LifecycleHookEnd,\n\n /**\n * Corresponds to the point in time before the runtime has evaluated an expression associated with\n * an event or an output.\n */\n OutputStart,\n\n /**\n * Corresponds to the point in time after the runtime has evaluated an expression associated with\n * an event or an output.\n */\n OutputEnd,\n}\n\n/**\n * Profiler function which the runtime will invoke before and after user code.\n */\nexport interface Profiler {\n (event: ProfilerEvent, instance: {}|null, hookOrListener?: (e?: any) => any): void;\n}\n\n\nlet profilerCallback: Profiler|null = null;\n\n/**\n * Sets the callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection).\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable profiling.\n */\nexport const setProfiler = (profiler: Profiler|null) => {\n profilerCallback = profiler;\n};\n\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param hookOrListener lifecycle hook function or output listener. The value depends on the\n * execution context\n * @returns\n */\nexport const profiler: Profiler = function(\n event: ProfilerEvent, instance: {}|null, hookOrListener?: (e?: any) => any) {\n if (profilerCallback != null /* both `null` and `undefined` */) {\n profilerCallback(event, instance, hookOrListener);\n }\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const SVG_NAMESPACE = 'svg';\nexport const MATH_ML_NAMESPACE = 'math';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertGreaterThan, assertGreaterThanOrEqual, assertIndexInRange, assertLessThan} from '../../util/assert';\nimport {assertTNode, assertTNodeForLView} from '../assert';\nimport {LContainer, TYPE} from '../interfaces/container';\nimport {TConstants, TNode} from '../interfaces/node';\nimport {RNode} from '../interfaces/renderer_dom';\nimport {isLContainer, isLView} from '../interfaces/type_checks';\nimport {FLAGS, HEADER_OFFSET, HOST, LView, LViewFlags, PARENT, PREORDER_HOOK_FLAGS, TData, TRANSPLANTED_VIEWS_TO_REFRESH, TView} from '../interfaces/view';\n\n\n\n/**\n * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)\n * in same location in `LView`. This is because we don't want to pre-allocate space for it\n * because the storage is sparse. This file contains utilities for dealing with such data types.\n *\n * How do we know what is stored at a given location in `LView`.\n * - `Array.isArray(value) === false` => `RNode` (The normal storage value)\n * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.\n * - `typeof value[TYPE] === 'object'` => `LView`\n * - This happens when we have a component at a given location\n * - `typeof value[TYPE] === true` => `LContainer`\n * - This happens when we have `LContainer` binding at a given location.\n *\n *\n * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.\n */\n\n/**\n * Returns `RNode`.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nexport function unwrapRNode(value: RNode|LView|LContainer): RNode {\n while (Array.isArray(value)) {\n value = value[HOST] as any;\n }\n return value as RNode;\n}\n\n/**\n * Returns `LView` or `null` if not found.\n * @param value wrapped value of `RNode`, `LView`, `LContainer`\n */\nexport function unwrapLView(value: RNode|LView|LContainer): LView|null {\n while (Array.isArray(value)) {\n // This check is same as `isLView()` but we don't call at as we don't want to call\n // `Array.isArray()` twice and give JITer more work for inlining.\n if (typeof value[TYPE] === 'object') return value as LView;\n value = value[HOST] as any;\n }\n return null;\n}\n\n/**\n * Retrieves an element value from the provided `viewData`, by unwrapping\n * from any containers, component views, or style contexts.\n */\nexport function getNativeByIndex(index: number, lView: LView): RNode {\n ngDevMode && assertIndexInRange(lView, index);\n ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');\n return unwrapRNode(lView[index]);\n}\n\n/**\n * Retrieve an `RNode` for a given `TNode` and `LView`.\n *\n * This function guarantees in dev mode to retrieve a non-null `RNode`.\n *\n * @param tNode\n * @param lView\n */\nexport function getNativeByTNode(tNode: TNode, lView: LView): RNode {\n ngDevMode && assertTNodeForLView(tNode, lView);\n ngDevMode && assertIndexInRange(lView, tNode.index);\n const node: RNode = unwrapRNode(lView[tNode.index]);\n return node;\n}\n\n/**\n * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.\n *\n * Some `TNode`s don't have associated `RNode`s. For example `Projection`\n *\n * @param tNode\n * @param lView\n */\nexport function getNativeByTNodeOrNull(tNode: TNode|null, lView: LView): RNode|null {\n const index = tNode === null ? -1 : tNode.index;\n if (index !== -1) {\n ngDevMode && assertTNodeForLView(tNode!, lView);\n const node: RNode|null = unwrapRNode(lView[index]);\n return node;\n }\n return null;\n}\n\n\n// fixme(misko): The return Type should be `TNode|null`\nexport function getTNode(tView: TView, index: number): TNode {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');\n const tNode = tView.data[index] as TNode;\n ngDevMode && tNode !== null && assertTNode(tNode);\n return tNode;\n}\n\n/** Retrieves a value from any `LView` or `TData`. */\nexport function load<T>(view: LView|TData, index: number): T {\n ngDevMode && assertIndexInRange(view, index);\n return view[index];\n}\n\nexport function getComponentLViewByIndex(nodeIndex: number, hostView: LView): LView {\n // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n ngDevMode && assertIndexInRange(hostView, nodeIndex);\n const slotValue = hostView[nodeIndex];\n const lView = isLView(slotValue) ? slotValue : slotValue[HOST];\n return lView;\n}\n\n/** Checks whether a given view is in creation mode */\nexport function isCreationMode(view: LView): boolean {\n return (view[FLAGS] & LViewFlags.CreationMode) === LViewFlags.CreationMode;\n}\n\n/**\n * Returns a boolean for whether the view is attached to the change detection tree.\n *\n * Note: This determines whether a view should be checked, not whether it's inserted\n * into a container. For that, you'll want `viewAttachedToContainer` below.\n */\nexport function viewAttachedToChangeDetector(view: LView): boolean {\n return (view[FLAGS] & LViewFlags.Attached) === LViewFlags.Attached;\n}\n\n/** Returns a boolean for whether the view is attached to a container. */\nexport function viewAttachedToContainer(view: LView): boolean {\n return isLContainer(view[PARENT]);\n}\n\n/** Returns a constant from `TConstants` instance. */\nexport function getConstant<T>(consts: TConstants|null, index: null|undefined): null;\nexport function getConstant<T>(consts: TConstants, index: number): T|null;\nexport function getConstant<T>(consts: TConstants|null, index: number|null|undefined): T|null;\nexport function getConstant<T>(consts: TConstants|null, index: number|null|undefined): T|null {\n if (index === null || index === undefined) return null;\n ngDevMode && assertIndexInRange(consts!, index);\n return consts![index] as unknown as T;\n}\n\n/**\n * Resets the pre-order hook flags of the view.\n * @param lView the LView on which the flags are reset\n */\nexport function resetPreOrderHookFlags(lView: LView) {\n lView[PREORDER_HOOK_FLAGS] = 0;\n}\n\n/**\n * Updates the `TRANSPLANTED_VIEWS_TO_REFRESH` counter on the `LContainer` as well as the parents\n * whose\n * 1. counter goes from 0 to 1, indicating that there is a new child that has a view to refresh\n * or\n * 2. counter goes from 1 to 0, indicating there are no more descendant views to refresh\n */\nexport function updateTransplantedViewCount(lContainer: LContainer, amount: 1|- 1) {\n lContainer[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;\n let viewOrContainer: LView|LContainer = lContainer;\n let parent: LView|LContainer|null = lContainer[PARENT];\n while (parent !== null &&\n ((amount === 1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 1) ||\n (amount === -1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 0))) {\n parent[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;\n viewOrContainer = parent;\n parent = parent[PARENT];\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectFlags} from '../di/interface/injector';\nimport {assertDefined, assertEqual, assertGreaterThanOrEqual, assertLessThan, assertNotEqual, throwError} from '../util/assert';\n\nimport {assertLViewOrUndefined, assertTNodeForLView, assertTNodeForTView} from './assert';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TNode, TNodeType} from './interfaces/node';\nimport {CONTEXT, DECLARATION_VIEW, HEADER_OFFSET, LView, OpaqueViewState, T_HOST, TData, TVIEW, TView, TViewType} from './interfaces/view';\nimport {MATH_ML_NAMESPACE, SVG_NAMESPACE} from './namespaces';\nimport {getTNode} from './util/view_utils';\n\n\n/**\n *\n */\ninterface LFrame {\n /**\n * Parent LFrame.\n *\n * This is needed when `leaveView` is called to restore the previous state.\n */\n parent: LFrame;\n\n /**\n * Child LFrame.\n *\n * This is used to cache existing LFrames to relieve the memory pressure.\n */\n child: LFrame|null;\n\n /**\n * State of the current view being processed.\n *\n * An array of nodes (text, element, container, etc), pipes, their bindings, and\n * any local variables that need to be stored between invocations.\n */\n lView: LView;\n\n /**\n * Current `TView` associated with the `LFrame.lView`.\n *\n * One can get `TView` from `lFrame[TVIEW]` however because it is so common it makes sense to\n * store it in `LFrame` for perf reasons.\n */\n tView: TView;\n\n /**\n * Used to set the parent property when nodes are created and track query results.\n *\n * This is used in conjunction with `isParent`.\n */\n currentTNode: TNode|null;\n\n /**\n * If `isParent` is:\n * - `true`: then `currentTNode` points to a parent node.\n * - `false`: then `currentTNode` points to previous node (sibling).\n */\n isParent: boolean;\n\n /**\n * Index of currently selected element in LView.\n *\n * Used by binding instructions. Updated as part of advance instruction.\n */\n selectedIndex: number;\n\n /**\n * Current pointer to the binding index.\n */\n bindingIndex: number;\n\n /**\n * The last viewData retrieved by nextContext().\n * Allows building nextContext() and reference() calls.\n *\n * e.g. const inner = x().$implicit; const outer = x().$implicit;\n */\n contextLView: LView|null;\n\n /**\n * Store the element depth count. This is used to identify the root elements of the template\n * so that we can then attach patch data `LView` to only those elements. We know that those\n * are the only places where the patch data could change, this way we will save on number\n * of places where tha patching occurs.\n */\n elementDepthCount: number;\n\n /**\n * Current namespace to be used when creating elements\n */\n currentNamespace: string|null;\n\n\n /**\n * The root index from which pure function instructions should calculate their binding\n * indices. In component views, this is TView.bindingStartIndex. In a host binding\n * context, this is the TView.expandoStartIndex + any dirs/hostVars before the given dir.\n */\n bindingRootIndex: number;\n\n /**\n * Current index of a View or Content Query which needs to be processed next.\n * We iterate over the list of Queries and increment current query index at every step.\n */\n currentQueryIndex: number;\n\n /**\n * When host binding is executing this points to the directive index.\n * `TView.data[currentDirectiveIndex]` is `DirectiveDef`\n * `LView[currentDirectiveIndex]` is directive instance.\n */\n currentDirectiveIndex: number;\n\n /**\n * Are we currently in i18n block as denoted by `ɵɵelementStart` and `ɵɵelementEnd`.\n *\n * This information is needed because while we are in i18n block all elements must be pre-declared\n * in the translation. (i.e. `Hello �#2�World�/#2�!` pre-declares element at `�#2�` location.)\n * This allocates `TNodeType.Placeholder` element at location `2`. If translator removes `�#2�`\n * from translation than the runtime must also ensure tha element at `2` does not get inserted\n * into the DOM. The translation does not carry information about deleted elements. Therefor the\n * only way to know that an element is deleted is that it was not pre-declared in the translation.\n *\n * This flag works by ensuring that elements which are created without pre-declaration\n * (`TNodeType.Placeholder`) are not inserted into the DOM render tree. (It does mean that the\n * element still gets instantiated along with all of its behavior [directives])\n */\n inI18n: boolean;\n}\n\n/**\n * All implicit instruction state is stored here.\n *\n * It is useful to have a single object where all of the state is stored as a mental model\n * (rather it being spread across many different variables.)\n *\n * PERF NOTE: Turns out that writing to a true global variable is slower than\n * having an intermediate object with properties.\n */\ninterface InstructionState {\n /**\n * Current `LFrame`\n *\n * `null` if we have not called `enterView`\n */\n lFrame: LFrame;\n\n /**\n * Stores whether directives should be matched to elements.\n *\n * When template contains `ngNonBindable` then we need to prevent the runtime from matching\n * directives on children of that element.\n *\n * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * </div>\n * ```\n */\n bindingsEnabled: boolean;\n}\n\nconst instructionState: InstructionState = {\n lFrame: createLFrame(null),\n bindingsEnabled: true,\n};\n\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n *\n * The `checkNoChanges` function is invoked only in ngDevMode=true and verifies that no unintended\n * changes exist in the change detector or its children.\n */\nlet _isInCheckNoChangesMode = false;\n\n/**\n * Returns true if the instruction state stack is empty.\n *\n * Intended to be called from tests only (tree shaken otherwise).\n */\nexport function specOnlyIsInstructionStateEmpty(): boolean {\n return instructionState.lFrame.parent === null;\n}\n\n\nexport function getElementDepthCount() {\n return instructionState.lFrame.elementDepthCount;\n}\n\nexport function increaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount++;\n}\n\nexport function decreaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount--;\n}\n\nexport function getBindingsEnabled(): boolean {\n return instructionState.bindingsEnabled;\n}\n\n\n/**\n * Enables directive matching on elements.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- ɵɵdisableBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- ɵɵenableBindings() -->\n * </div>\n * ```\n *\n * @codeGenApi\n */\nexport function ɵɵenableBindings(): void {\n instructionState.bindingsEnabled = true;\n}\n\n/**\n * Disables directive matching on element.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- ɵɵdisableBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- ɵɵenableBindings() -->\n * </div>\n * ```\n *\n * @codeGenApi\n */\nexport function ɵɵdisableBindings(): void {\n instructionState.bindingsEnabled = false;\n}\n\n/**\n * Return the current `LView`.\n */\nexport function getLView<T>(): LView<T> {\n return instructionState.lFrame.lView as LView<T>;\n}\n\n/**\n * Return the current `TView`.\n */\nexport function getTView(): TView {\n return instructionState.lFrame.tView;\n}\n\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n * @returns Context of the restored OpaqueViewState instance.\n *\n * @codeGenApi\n */\nexport function ɵɵrestoreView<T = any>(viewToRestore: OpaqueViewState): T {\n instructionState.lFrame.contextLView = viewToRestore as any as LView;\n return (viewToRestore as any as LView)[CONTEXT] as unknown as T;\n}\n\n\n/**\n * Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in\n * value so that it can be used as a return value of an instruction.\n *\n * @codeGenApi\n */\nexport function ɵɵresetView<T>(value?: T): T|undefined {\n instructionState.lFrame.contextLView = null;\n return value;\n}\n\n\nexport function getCurrentTNode(): TNode|null {\n let currentTNode = getCurrentTNodePlaceholderOk();\n while (currentTNode !== null && currentTNode.type === TNodeType.Placeholder) {\n currentTNode = currentTNode.parent;\n }\n return currentTNode;\n}\n\nexport function getCurrentTNodePlaceholderOk(): TNode|null {\n return instructionState.lFrame.currentTNode;\n}\n\nexport function getCurrentParentTNode(): TNode|null {\n const lFrame = instructionState.lFrame;\n const currentTNode = lFrame.currentTNode;\n return lFrame.isParent ? currentTNode : currentTNode!.parent;\n}\n\nexport function setCurrentTNode(tNode: TNode|null, isParent: boolean) {\n ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);\n const lFrame = instructionState.lFrame;\n lFrame.currentTNode = tNode;\n lFrame.isParent = isParent;\n}\n\nexport function isCurrentTNodeParent(): boolean {\n return instructionState.lFrame.isParent;\n}\n\nexport function setCurrentTNodeAsNotParent(): void {\n instructionState.lFrame.isParent = false;\n}\n\nexport function getContextLView(): LView {\n const contextLView = instructionState.lFrame.contextLView;\n ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');\n return contextLView!;\n}\n\nexport function isInCheckNoChangesMode(): boolean {\n !ngDevMode && throwError('Must never be called in production mode');\n return _isInCheckNoChangesMode;\n}\n\nexport function setIsInCheckNoChangesMode(mode: boolean): void {\n !ngDevMode && throwError('Must never be called in production mode');\n _isInCheckNoChangesMode = mode;\n}\n\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nexport function getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}\n\nexport function getBindingIndex(): number {\n return instructionState.lFrame.bindingIndex;\n}\n\nexport function setBindingIndex(value: number): number {\n return instructionState.lFrame.bindingIndex = value;\n}\n\nexport function nextBindingIndex(): number {\n return instructionState.lFrame.bindingIndex++;\n}\n\nexport function incrementBindingIndex(count: number): number {\n const lFrame = instructionState.lFrame;\n const index = lFrame.bindingIndex;\n lFrame.bindingIndex = lFrame.bindingIndex + count;\n return index;\n}\n\nexport function isInI18nBlock() {\n return instructionState.lFrame.inI18n;\n}\n\nexport function setInI18nBlock(isInI18nBlock: boolean): void {\n instructionState.lFrame.inI18n = isInI18nBlock;\n}\n\n/**\n * Set a new binding root index so that host template functions can execute.\n *\n * Bindings inside the host template are 0 index. But because we don't know ahead of time\n * how many host bindings we have we can't pre-compute them. For this reason they are all\n * 0 index and we just shift the root so that they match next available location in the LView.\n *\n * @param bindingRootIndex Root index for `hostBindings`\n * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive\n * whose `hostBindings` are being processed.\n */\nexport function setBindingRootForHostBindings(\n bindingRootIndex: number, currentDirectiveIndex: number) {\n const lFrame = instructionState.lFrame;\n lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;\n setCurrentDirectiveIndex(currentDirectiveIndex);\n}\n\n/**\n * When host binding is executing this points to the directive index.\n * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`\n * `LView[getCurrentDirectiveIndex()]` is directive instance.\n */\nexport function getCurrentDirectiveIndex(): number {\n return instructionState.lFrame.currentDirectiveIndex;\n}\n\n/**\n * Sets an index of a directive whose `hostBindings` are being processed.\n *\n * @param currentDirectiveIndex `TData` index where current directive instance can be found.\n */\nexport function setCurrentDirectiveIndex(currentDirectiveIndex: number): void {\n instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;\n}\n\n/**\n * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being\n * executed.\n *\n * @param tData Current `TData` where the `DirectiveDef` will be looked up at.\n */\nexport function getCurrentDirectiveDef(tData: TData): DirectiveDef<any>|null {\n const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex] as DirectiveDef<any>;\n}\n\nexport function getCurrentQueryIndex(): number {\n return instructionState.lFrame.currentQueryIndex;\n}\n\nexport function setCurrentQueryIndex(value: number): void {\n instructionState.lFrame.currentQueryIndex = value;\n}\n\n/**\n * Returns a `TNode` of the location where the current `LView` is declared at.\n *\n * @param lView an `LView` that we want to find parent `TNode` for.\n */\nfunction getDeclarationTNode(lView: LView): TNode|null {\n const tView = lView[TVIEW];\n\n // Return the declaration parent for embedded views\n if (tView.type === TViewType.Embedded) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n // Falling back to `T_HOST` in case we cross component boundary.\n if (tView.type === TViewType.Component) {\n return lView[T_HOST];\n }\n\n // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n return null;\n}\n\n/**\n * This is a light weight version of the `enterView` which is needed by the DI system.\n *\n * @param lView `LView` location of the DI context.\n * @param tNode `TNode` for DI context\n * @param flags DI context flags. if `SkipSelf` flag is set than we walk up the declaration\n * tree from `tNode` until we find parent declared `TElementNode`.\n * @returns `true` if we have successfully entered DI associated with `tNode` (or with declared\n * `TNode` if `flags` has `SkipSelf`). Failing to enter DI implies that no associated\n * `NodeInjector` can be found and we should instead use `ModuleInjector`.\n * - If `true` than this call must be fallowed by `leaveDI`\n * - If `false` than this call failed and we should NOT call `leaveDI`\n */\nexport function enterDI(lView: LView, tNode: TNode, flags: InjectFlags) {\n ngDevMode && assertLViewOrUndefined(lView);\n\n if (flags & InjectFlags.SkipSelf) {\n ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);\n\n let parentTNode = tNode as TNode | null;\n let parentLView = lView;\n\n while (true) {\n ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');\n parentTNode = parentTNode!.parent as TNode | null;\n if (parentTNode === null && !(flags & InjectFlags.Host)) {\n parentTNode = getDeclarationTNode(parentLView);\n if (parentTNode === null) break;\n\n // In this case, a parent exists and is definitely an element. So it will definitely\n // have an existing lView as the declaration view, which is why we can assume it's defined.\n ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');\n parentLView = parentLView[DECLARATION_VIEW]!;\n\n // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives\n // We want to skip those and look only at Elements and ElementContainers to ensure\n // we're looking at true parent nodes, and not content or other types.\n if (parentTNode.type & (TNodeType.Element | TNodeType.ElementContainer)) {\n break;\n }\n } else {\n break;\n }\n }\n if (parentTNode === null) {\n // If we failed to find a parent TNode this means that we should use module injector.\n return false;\n } else {\n tNode = parentTNode;\n lView = parentLView;\n }\n }\n\n ngDevMode && assertTNodeForLView(tNode, lView);\n const lFrame = instructionState.lFrame = allocLFrame();\n lFrame.currentTNode = tNode;\n lFrame.lView = lView;\n\n return true;\n}\n\n/**\n * Swap the current lView with a new lView.\n *\n * For performance reasons we store the lView in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the lView for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New lView to become active\n * @returns the previously active lView;\n */\nexport function enterView(newView: LView): void {\n ngDevMode && assertNotEqual(newView[0], newView[1] as any, '????');\n ngDevMode && assertLViewOrUndefined(newView);\n const newLFrame = allocLFrame();\n if (ngDevMode) {\n assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');\n assertEqual(newLFrame.lView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.tView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');\n assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');\n assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');\n }\n const tView = newView[TVIEW];\n instructionState.lFrame = newLFrame;\n ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);\n newLFrame.currentTNode = tView.firstChild!;\n newLFrame.lView = newView;\n newLFrame.tView = tView;\n newLFrame.contextLView = newView;\n newLFrame.bindingIndex = tView.bindingStartIndex;\n newLFrame.inI18n = false;\n}\n\n/**\n * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.\n */\nfunction allocLFrame() {\n const currentLFrame = instructionState.lFrame;\n const childLFrame = currentLFrame === null ? null : currentLFrame.child;\n const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;\n return newLFrame;\n}\n\nfunction createLFrame(parent: LFrame|null): LFrame {\n const lFrame: LFrame = {\n currentTNode: null,\n isParent: true,\n lView: null!,\n tView: null!,\n selectedIndex: -1,\n contextLView: null,\n elementDepthCount: 0,\n currentNamespace: null,\n currentDirectiveIndex: -1,\n bindingRootIndex: -1,\n bindingIndex: -1,\n currentQueryIndex: 0,\n parent: parent!,\n child: null,\n inI18n: false,\n };\n parent !== null && (parent.child = lFrame); // link the new LFrame for reuse.\n return lFrame;\n}\n\n/**\n * A lightweight version of leave which is used with DI.\n *\n * This function only resets `currentTNode` and `LView` as those are the only properties\n * used with DI (`enterDI()`).\n *\n * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where\n * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`.\n */\nfunction leaveViewLight(): LFrame {\n const oldLFrame = instructionState.lFrame;\n instructionState.lFrame = oldLFrame.parent;\n oldLFrame.currentTNode = null!;\n oldLFrame.lView = null!;\n return oldLFrame;\n}\n\n/**\n * This is a lightweight version of the `leaveView` which is needed by the DI system.\n *\n * NOTE: this function is an alias so that we can change the type of the function to have `void`\n * return type.\n */\nexport const leaveDI: () => void = leaveViewLight;\n\n/**\n * Leave the current `LView`\n *\n * This pops the `LFrame` with the associated `LView` from the stack.\n *\n * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is\n * because for performance reasons we don't release `LFrame` but rather keep it for next use.\n */\nexport function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null!;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}\n\nexport function nextContextImpl<T = any>(level: number): T {\n const contextLView = instructionState.lFrame.contextLView =\n walkUpViews(level, instructionState.lFrame.contextLView!);\n return contextLView[CONTEXT] as unknown as T;\n}\n\nfunction walkUpViews(nestingLevel: number, currentView: LView): LView {\n while (nestingLevel > 0) {\n ngDevMode &&\n assertDefined(\n currentView[DECLARATION_VIEW],\n 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW]!;\n nestingLevel--;\n }\n return currentView;\n}\n\n/**\n * Gets the currently selected element index.\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n */\nexport function getSelectedIndex() {\n return instructionState.lFrame.selectedIndex;\n}\n\n/**\n * Sets the most recent index passed to {@link select}\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n *\n * (Note that if an \"exit function\" was set earlier (via `setElementExitFn()`) then that will be\n * run if and when the provided `index` value is different from the current selected index value.)\n */\nexport function setSelectedIndex(index: number) {\n ngDevMode && index !== -1 &&\n assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');\n ngDevMode &&\n assertLessThan(\n index, instructionState.lFrame.lView.length, 'Can\\'t set index passed end of LView');\n instructionState.lFrame.selectedIndex = index;\n}\n\n/**\n * Gets the `tNode` that represents currently selected element.\n */\nexport function getSelectedTNode() {\n const lFrame = instructionState.lFrame;\n return getTNode(lFrame.tView, lFrame.selectedIndex);\n}\n\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.\n *\n * @codeGenApi\n */\nexport function ɵɵnamespaceSVG() {\n instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n}\n\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.\n *\n * @codeGenApi\n */\nexport function ɵɵnamespaceMathML() {\n instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;\n}\n\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n *\n * @codeGenApi\n */\nexport function ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}\n\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n */\nexport function namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}\n\nexport function getNamespace(): string|null {\n return instructionState.lFrame.currentNamespace;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit} from '../interface/lifecycle_hooks';\nimport {assertDefined, assertEqual, assertNotEqual} from '../util/assert';\nimport {assertFirstCreatePass} from './assert';\nimport {NgOnChangesFeatureImpl} from './features/ng_onchanges_feature';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TNode} from './interfaces/node';\nimport {FLAGS, HookData, InitPhaseState, LView, LViewFlags, PREORDER_HOOK_FLAGS, PreOrderHookFlags, TView} from './interfaces/view';\nimport {profiler, ProfilerEvent} from './profiler';\nimport {isInCheckNoChangesMode} from './state';\n\n\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nexport function registerPreOrderHooks(\n directiveIndex: number, directiveDef: DirectiveDef<any>, tView: TView): void {\n ngDevMode && assertFirstCreatePass(tView);\n const {ngOnChanges, ngOnInit, ngDoCheck} =\n directiveDef.type.prototype as OnChanges & OnInit & DoCheck;\n\n if (ngOnChanges as Function | undefined) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = []))\n .push(directiveIndex, wrappedOnChanges);\n }\n\n if (ngOnInit) {\n (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);\n }\n\n if (ngDoCheck) {\n (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);\n }\n}\n\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nexport function registerPostOrderHooks(tView: TView, tNode: TNode): void {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i] as DirectiveDef<any>;\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks: AfterContentInit&AfterContentChecked&AfterViewInit&AfterViewChecked&\n OnDestroy = directiveDef.type.prototype;\n const {\n ngAfterContentInit,\n ngAfterContentChecked,\n ngAfterViewInit,\n ngAfterViewChecked,\n ngOnDestroy\n } = lifecycleHooks;\n\n if (ngAfterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit);\n }\n\n if (ngAfterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);\n }\n\n if (ngAfterViewInit) {\n (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit);\n }\n\n if (ngAfterViewChecked) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);\n }\n\n if (ngOnDestroy != null) {\n (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy);\n }\n }\n}\n\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n\n\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nexport function executeCheckHooks(lView: LView, hooks: HookData, nodeIndex?: number|null) {\n callHooks(lView, hooks, InitPhaseState.InitPhaseCompleted, nodeIndex);\n}\n\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nexport function executeInitAndCheckHooks(\n lView: LView, hooks: HookData, initPhase: InitPhaseState, nodeIndex?: number|null) {\n ngDevMode &&\n assertNotEqual(\n initPhase, InitPhaseState.InitPhaseCompleted,\n 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & LViewFlags.InitPhaseStateMask) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\n\nexport function incrementInitPhaseFlags(lView: LView, initPhase: InitPhaseState): void {\n ngDevMode &&\n assertNotEqual(\n initPhase, InitPhaseState.InitPhaseCompleted,\n 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & LViewFlags.InitPhaseStateMask) === initPhase) {\n flags &= LViewFlags.IndexWithinInitPhaseReset;\n flags += LViewFlags.InitPhaseStateIncrementer;\n lView[FLAGS] = flags;\n }\n}\n\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(\n currentView: LView, arr: HookData, initPhase: InitPhaseState,\n currentNodeIndex: number|null|undefined): void {\n ngDevMode &&\n assertEqual(\n isInCheckNoChangesMode(), false,\n 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined ?\n (currentView[PREORDER_HOOK_FLAGS] & PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask) :\n 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1] as number | (() => void);\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i] as number;\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n } else {\n const isInitHook = arr[i] < 0;\n if (isInitHook)\n currentView[PREORDER_HOOK_FLAGS] += PreOrderHookFlags.NumberOfInitHooksCalledIncrementer;\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] =\n (currentView[PREORDER_HOOK_FLAGS] & PreOrderHookFlags.NumberOfInitHooksCalledMask) + i +\n 2;\n }\n i++;\n }\n }\n}\n\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView: LView, initPhase: InitPhaseState, arr: HookData, i: number) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1] as () => void;\n const directiveIndex = isInitHook ? -arr[i] : arr[i] as number;\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> LViewFlags.IndexWithinInitPhaseShift;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (indexWithintInitPhase <\n (currentView[PREORDER_HOOK_FLAGS] >> PreOrderHookFlags.NumberOfInitHooksCalledShift) &&\n (currentView[FLAGS] & LViewFlags.InitPhaseStateMask) === initPhase) {\n currentView[FLAGS] += LViewFlags.IndexWithinInitPhaseIncrementer;\n profiler(ProfilerEvent.LifecycleHookStart, directive, hook);\n try {\n hook.call(directive);\n } finally {\n profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);\n }\n }\n } else {\n profiler(ProfilerEvent.LifecycleHookStart, directive, hook);\n try {\n hook.call(directive);\n } finally {\n profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectFlags} from '../../di/interface/injector';\nimport {ProviderToken} from '../../di/provider_token';\nimport {assertDefined, assertEqual} from '../../util/assert';\n\nimport {TDirectiveHostNode} from './node';\nimport {LView, TData} from './view';\n\n/**\n * Offsets of the `NodeInjector` data structure in the expando.\n *\n * `NodeInjector` is stored in both `LView` as well as `TView.data`. All storage requires 9 words.\n * First 8 are reserved for bloom filter and the 9th is reserved for the associated `TNode` as well\n * as parent `NodeInjector` pointer. All indexes are starting with `index` and have an offset as\n * shown.\n *\n * `LView` layout:\n * ```\n * index + 0: cumulative bloom filter\n * index + 1: cumulative bloom filter\n * index + 2: cumulative bloom filter\n * index + 3: cumulative bloom filter\n * index + 4: cumulative bloom filter\n * index + 5: cumulative bloom filter\n * index + 6: cumulative bloom filter\n * index + 7: cumulative bloom filter\n * index + 8: cumulative bloom filter\n * index + PARENT: Index to the parent injector. See `RelativeInjectorLocation`\n * `const parent = lView[index + NodeInjectorOffset.PARENT]`\n * ```\n *\n * `TViewData` layout:\n * ```\n * index + 0: cumulative bloom filter\n * index + 1: cumulative bloom filter\n * index + 2: cumulative bloom filter\n * index + 3: cumulative bloom filter\n * index + 4: cumulative bloom filter\n * index + 5: cumulative bloom filter\n * index + 6: cumulative bloom filter\n * index + 7: cumulative bloom filter\n * index + 8: cumulative bloom filter\n * index + TNODE: TNode associated with this `NodeInjector`\n * `const tNode = tView.data[index + NodeInjectorOffset.TNODE]`\n * ```\n */\nexport const enum NodeInjectorOffset {\n TNODE = 8,\n PARENT = 8,\n BLOOM_SIZE = 8,\n SIZE = 9,\n}\n\n/**\n * Represents a relative location of parent injector.\n *\n * The interfaces encodes number of parents `LView`s to traverse and index in the `LView`\n * pointing to the parent injector.\n */\nexport interface RelativeInjectorLocation {\n __brand__: 'RelativeInjectorLocationFlags';\n}\n\nexport const enum RelativeInjectorLocationFlags {\n InjectorIndexMask = 0b111111111111111,\n ViewOffsetShift = 16,\n NO_PARENT = -1,\n}\n\nexport const NO_PARENT_INJECTOR: RelativeInjectorLocation = -1 as any;\n\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nexport class NodeInjectorFactory {\n /**\n * The inject implementation to be activated when using the factory.\n */\n injectImpl: null|(<T>(token: ProviderToken<T>, flags?: InjectFlags) => T);\n\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n resolving = false;\n\n /**\n * Marks that the token can see other Tokens declared in `viewProviders` on the same node.\n */\n canSeeViewProviders: boolean;\n\n /**\n * An array of factories to use in case of `multi` provider.\n */\n multi?: Array<() => any>;\n\n /**\n * Number of `multi`-providers which belong to the component.\n *\n * This is needed because when multiple components and directives declare the `multi` provider\n * they have to be concatenated in the correct order.\n *\n * Example:\n *\n * If we have a component and directive active an a single element as declared here\n * ```\n * component:\n * providers: [ {provide: String, useValue: 'component', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'componentView', multi: true} ],\n *\n * directive:\n * providers: [ {provide: String, useValue: 'directive', multi: true} ],\n * ```\n *\n * Then the expected results are:\n *\n * ```\n * providers: ['component', 'directive']\n * viewProviders: ['component', 'componentView', 'directive']\n * ```\n *\n * The way to think about it is that the `viewProviders` have been inserted after the component\n * but before the directives, which is why we need to know how many `multi`s have been declared by\n * the component.\n */\n componentProviders?: number;\n\n /**\n * Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.\n * See `providerFactory`.\n */\n index?: number;\n\n /**\n * Because the same `multi` provider can be declared in `providers` and `viewProviders` it is\n * possible for `viewProviders` to shadow the `providers`. For this reason we store the\n * `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.\n *\n * Example:\n *\n * Given:\n * ```\n * providers: [ {provide: String, useValue: 'all', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'viewOnly', multi: true} ],\n * ```\n *\n * We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case\n * of view injection. We further have to make sure that the shared instances (in our case\n * `all`) are the exact same instance in both the content as well as the view injection. (We\n * have to make sure that we don't double instantiate.) For this reason the `viewProviders`\n * `Factory` has a pointer to the shadowed `providers` factory so that it can instantiate the\n * `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =\n * ['all', 'viewOnly']`).\n */\n providerFactory?: NodeInjectorFactory|null;\n\n\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n public factory:\n (this: NodeInjectorFactory, _: undefined,\n /**\n * array where injectables tokens are stored. This is used in\n * case of an error reporting to produce friendlier errors.\n */\n tData: TData,\n /**\n * array where existing instances of injectables are stored. This is used in case\n * of multi shadow is needed. See `multi` field documentation.\n */\n lView: LView,\n /**\n * The TNode of the same element injector.\n */\n tNode: TDirectiveHostNode) => any,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider: boolean,\n injectImplementation: null|(<T>(token: ProviderToken<T>, flags?: InjectFlags) => T)) {\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n\nexport function isFactory(obj: any): obj is NodeInjectorFactory {\n return obj instanceof NodeInjectorFactory;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {CharCode} from '../../util/char_code';\nimport {AttributeMarker, TAttributes} from '../interfaces/node';\nimport {CssSelector} from '../interfaces/projection';\nimport {Renderer} from '../interfaces/renderer';\nimport {RElement} from '../interfaces/renderer_dom';\n\n\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nexport function setUpAttributes(renderer: Renderer, native: RElement, attrs: TAttributes): number {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== AttributeMarker.NamespaceURI) {\n break;\n }\n\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n\n const namespaceURI = attrs[i++] as string;\n const attrName = attrs[i++] as string;\n const attrVal = attrs[i++] as string;\n ngDevMode && ngDevMode.rendererSetAttribute++;\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n } else {\n // attrName is string;\n const attrName = value as string;\n const attrVal = attrs[++i];\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n } else {\n renderer.setAttribute(native, attrName, attrVal as string);\n }\n i++;\n }\n }\n\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nexport function isNameOnlyAttributeMarker(marker: string|AttributeMarker|CssSelector) {\n return marker === AttributeMarker.Bindings || marker === AttributeMarker.Template ||\n marker === AttributeMarker.I18n;\n}\n\nexport function isAnimationProp(name: string): boolean {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === CharCode.AT_SIGN;\n}\n\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nexport function mergeHostAttrs(dst: TAttributes|null, src: TAttributes|null): TAttributes|null {\n if (src === null || src.length === 0) {\n // do nothing\n } else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n } else {\n let srcMarker: AttributeMarker = AttributeMarker.ImplicitAttributes;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n } else {\n if (srcMarker === AttributeMarker.NamespaceURI) {\n // Case where we need to consume `key1`, `key2`, `value` items.\n } else if (\n srcMarker === AttributeMarker.ImplicitAttributes ||\n srcMarker === AttributeMarker.Styles) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item as string, null, src[++i] as string);\n } else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item as string, null, null);\n }\n }\n }\n }\n return dst;\n}\n\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nexport function mergeHostAttribute(\n dst: TAttributes, marker: AttributeMarker, key1: string, key2: string|null,\n value: string|null): void {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === AttributeMarker.ImplicitAttributes) {\n markerInsertPosition = -1;\n } else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n } else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n } else if (item === key1) {\n // We already have same token\n if (key2 === null) {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n } else if (key2 === dst[i + 1]) {\n dst[i + 2] = value!;\n return;\n }\n }\n // Increment counter.\n i++;\n if (key2 !== null) i++;\n if (value !== null) i++;\n }\n\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (key2 !== null) {\n dst.splice(i++, 0, key2);\n }\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertGreaterThan, assertNotEqual, assertNumber} from '../../util/assert';\nimport {NO_PARENT_INJECTOR, RelativeInjectorLocation, RelativeInjectorLocationFlags} from '../interfaces/injector';\nimport {DECLARATION_VIEW, HEADER_OFFSET, LView} from '../interfaces/view';\n\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nexport function hasParentInjector(parentLocation: RelativeInjectorLocation): boolean {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\n\nexport function getParentInjectorIndex(parentLocation: RelativeInjectorLocation): number {\n ngDevMode && assertNumber(parentLocation, 'Number expected');\n ngDevMode && assertNotEqual(parentLocation as any, -1, 'Not a valid state.');\n const parentInjectorIndex =\n (parentLocation as any as number) & RelativeInjectorLocationFlags.InjectorIndexMask;\n ngDevMode &&\n assertGreaterThan(\n parentInjectorIndex, HEADER_OFFSET,\n 'Parent injector must be pointing past HEADER_OFFSET.');\n return (parentLocation as any as number) & RelativeInjectorLocationFlags.InjectorIndexMask;\n}\n\nexport function getParentInjectorViewOffset(parentLocation: RelativeInjectorLocation): number {\n return (parentLocation as any as number) >> RelativeInjectorLocationFlags.ViewOffsetShift;\n}\n\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nexport function getParentInjectorView(location: RelativeInjectorLocation, startView: LView): LView {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW]!;\n viewOffset--;\n }\n return parentView;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isForwardRef, resolveForwardRef} from '../di/forward_ref';\nimport {injectRootLimpMode, setInjectImplementation} from '../di/inject_switch';\nimport {Injector} from '../di/injector';\nimport {convertToBitFlags} from '../di/injector_compatibility';\nimport {InjectorMarkers} from '../di/injector_marker';\nimport {InjectFlags, InjectOptions} from '../di/interface/injector';\nimport {ProviderToken} from '../di/provider_token';\nimport {Type} from '../interface/type';\nimport {assertDefined, assertEqual, assertIndexInRange} from '../util/assert';\nimport {noSideEffects} from '../util/closure';\n\nimport {assertDirectiveDef, assertNodeInjector, assertTNodeForLView} from './assert';\nimport {FactoryFn, getFactoryDef} from './definition_factory';\nimport {throwCyclicDependencyError, throwProviderNotFoundError} from './errors_di';\nimport {NG_ELEMENT_ID, NG_FACTORY_DEF} from './fields';\nimport {registerPreOrderHooks} from './hooks';\nimport {DirectiveDef} from './interfaces/definition';\nimport {isFactory, NO_PARENT_INJECTOR, NodeInjectorFactory, NodeInjectorOffset, RelativeInjectorLocation, RelativeInjectorLocationFlags} from './interfaces/injector';\nimport {AttributeMarker, TContainerNode, TDirectiveHostNode, TElementContainerNode, TElementNode, TNode, TNodeProviderIndexes, TNodeType} from './interfaces/node';\nimport {isComponentDef, isComponentHost} from './interfaces/type_checks';\nimport {DECLARATION_COMPONENT_VIEW, DECLARATION_VIEW, EMBEDDED_VIEW_INJECTOR, FLAGS, INJECTOR, LView, LViewFlags, T_HOST, TData, TVIEW, TView, TViewType} from './interfaces/view';\nimport {assertTNodeType} from './node_assert';\nimport {enterDI, getCurrentTNode, getLView, leaveDI} from './state';\nimport {isNameOnlyAttributeMarker} from './util/attrs_utils';\nimport {getParentInjectorIndex, getParentInjectorView, hasParentInjector} from './util/injector_utils';\nimport {stringifyForError} from './util/stringify_utils';\n\n\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\n\nexport function setIncludeViewProviders(v: boolean): boolean {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nexport function bloomAdd(\n injectorIndex: number, tView: TView, type: ProviderToken<any>|string): void {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id: number|undefined;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n } else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = (type as any)[NG_ELEMENT_ID];\n }\n\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = (type as any)[NG_ELEMENT_ID] = nextNgElementId++;\n }\n\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n (tView.data as number[])[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nexport function getOrCreateNodeInjectorForNode(\n tNode: TElementNode|TContainerNode|TElementContainerNode, lView: LView): number {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data as any;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < NodeInjectorOffset.BLOOM_SIZE; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n\n lView[injectorIndex + NodeInjectorOffset.PARENT] = parentLoc;\n return injectorIndex;\n}\n\nfunction insertBloom(arr: any[], footer: TNode|null): void {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\n\n\nexport function getInjectorIndex(tNode: TNode, lView: LView): number {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + NodeInjectorOffset.PARENT] === null) {\n return -1;\n } else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nexport function getParentInjectorLocation(tNode: TNode, lView: LView): RelativeInjectorLocation {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex as any; // ViewOffset is 0\n }\n\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode: TNode|null = null;\n let lViewCursor: LView|null = lView;\n\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode!, lViewCursor[DECLARATION_VIEW]!);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return (parentTNode.injectorIndex |\n (declarationViewOffset << RelativeInjectorLocationFlags.ViewOffsetShift)) as any;\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nexport function diPublicInInjector(\n injectorIndex: number, tView: TView, token: ProviderToken<any>): void {\n bloomAdd(injectorIndex, tView, token);\n}\n\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nexport function injectAttributeImpl(tNode: TNode, attrNameToInject: string): string|null {\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyContainer | TNodeType.AnyRNode);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value)) break;\n\n // Skip namespaced attributes\n if (value === AttributeMarker.NamespaceURI) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n } else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n } else if (value === attrNameToInject) {\n return attrs[i + 1] as string;\n } else {\n i = i + 2;\n }\n }\n }\n return null;\n}\n\n\nfunction notFoundValueOrThrow<T>(\n notFoundValue: T|null, token: ProviderToken<T>, flags: InjectFlags): T|null {\n if ((flags & InjectFlags.Optional) || notFoundValue !== undefined) {\n return notFoundValue;\n } else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector<T>(\n lView: LView, token: ProviderToken<T>, flags: InjectFlags, notFoundValue?: any): T|null {\n if ((flags & InjectFlags.Optional) && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow<T>(notFoundValue, token, flags);\n}\n\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nexport function getOrCreateInjectable<T>(\n tNode: TDirectiveHostNode|null, lView: LView, token: ProviderToken<T>,\n flags: InjectFlags = InjectFlags.Default, notFoundValue?: any): T|null {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (lView[FLAGS] & LViewFlags.HasEmbeddedViewInjector) {\n const embeddedInjectorValue =\n lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector<T>(lView, token, flags, notFoundValue);\n}\n\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector<T>(\n tNode: TDirectiveHostNode, lView: LView, token: ProviderToken<T>, flags: InjectFlags,\n notFoundValue?: any) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return (flags & InjectFlags.Host) ?\n notFoundValueOrThrow<T>(notFoundValue, token, flags) :\n lookupTokenUsingModuleInjector<T>(lView, token, flags, notFoundValue);\n }\n try {\n const value = bloomHash(flags);\n if (value == null && !(flags & InjectFlags.Optional)) {\n throwProviderNotFoundError(token);\n } else {\n return value;\n }\n } finally {\n leaveDI();\n }\n } else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView: TView|null = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation: RelativeInjectorLocation = NO_PARENT_INJECTOR;\n let hostTElementNode: TNode|null =\n flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :\n lView[injectorIndex + NodeInjectorOffset.PARENT];\n\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode &&\n assertTNodeForLView(tView.data[injectorIndex + NodeInjectorOffset.TNODE] as TNode, lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance: T|{}|null = searchTokensOnInjector<T>(\n injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + NodeInjectorOffset.PARENT];\n if (parentLocation !== NO_PARENT_INJECTOR &&\n shouldSearchParent(\n flags,\n lView[TVIEW].data[injectorIndex + NodeInjectorOffset.TNODE] === hostTElementNode) &&\n bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n\n return notFoundValue;\n}\n\nfunction searchTokensOnInjector<T>(\n injectorIndex: number, lView: LView, token: ProviderToken<T>, previousTView: TView|null,\n flags: InjectFlags, hostTElementNode: TNode|null) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + NodeInjectorOffset.TNODE] as TNode;\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n (isComponentHost(tNode) && includeViewProviders) :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n (previousTView != currentTView && ((tNode.type & TNodeType.AnyRNode) !== 0));\n\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode;\n\n const injectableIdx = locateDirectiveOrProvider(\n tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode as TElementNode);\n } else {\n return NOT_FOUND;\n }\n}\n\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nexport function locateDirectiveOrProvider<T>(\n tNode: TNode, tView: TView, token: ProviderToken<T>|string, canAccessViewProviders: boolean,\n isHostSpecialCase: boolean|number): number|null {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n\n const injectablesStart = nodeProviderIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount =\n nodeProviderIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n const startingIndex =\n canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i] as ProviderToken<any>| DirectiveDef<any>| string;\n if (i < directivesStart && token === providerTokenOrDef ||\n i >= directivesStart && (providerTokenOrDef as DirectiveDef<any>).type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart] as DirectiveDef<any>;\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nexport function getNodeInjectable(\n lView: LView, tView: TView, index: number, tNode: TDirectiveHostNode): any {\n let value = lView[index];\n const tData = tView.data;\n if (isFactory(value)) {\n const factory: NodeInjectorFactory = value;\n if (factory.resolving) {\n throwCyclicDependencyError(stringifyForError(tData[index]));\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n const previousInjectImplementation =\n factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;\n const success = enterDI(lView, tNode, InjectFlags.Default);\n ngDevMode &&\n assertEqual(\n success, true,\n 'Because flags do not contain \\`SkipSelf\\' we expect this to always succeed.');\n try {\n value = lView[index] = factory.factory(undefined, tData, lView, tNode);\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index] as DirectiveDef<any>, tView);\n }\n } finally {\n previousInjectImplementation !== null &&\n setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n }\n }\n return value;\n}\n\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nexport function bloomHashBitOrFactory(token: ProviderToken<any>|string): number|Function|undefined {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId: number|undefined =\n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? (token as any)[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n } else {\n ngDevMode &&\n assertEqual(tokenId, InjectorMarkers.Injector, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n } else {\n return tokenId;\n }\n}\n\nexport function bloomHasToken(bloomHash: number, injectorIndex: number, injectorView: LView|TData) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags: InjectFlags, isFirstHostTNode: boolean): boolean|number {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\n\nexport class NodeInjector implements Injector {\n constructor(\n private _tNode: TElementNode|TContainerNode|TElementContainerNode|null,\n private _lView: LView) {}\n\n get(token: any, notFoundValue?: any, flags?: InjectFlags|InjectOptions): any {\n return getOrCreateInjectable(\n this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\n\n/** Creates a `NodeInjector` for the current node. */\nexport function createNodeInjector(): Injector {\n return new NodeInjector(getCurrentTNode()! as TDirectiveHostNode, getLView()) as any;\n}\n\n/**\n * @codeGenApi\n */\nexport function ɵɵgetInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n\n parent = Object.getPrototypeOf(parent);\n }\n\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return t => new t();\n });\n}\n\nfunction getFactoryOf<T>(type: Type<any>): ((type?: Type<T>) => T | null)|null {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf<T>(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef<T>(type);\n}\n\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector<T>(\n tNode: TDirectiveHostNode, lView: LView, token: ProviderToken<T>, flags: InjectFlags,\n notFoundValue?: any) {\n let currentTNode: TDirectiveHostNode|null = tNode;\n let currentLView: LView|null = lView;\n\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (currentTNode !== null && currentLView !== null &&\n (currentLView[FLAGS] & LViewFlags.HasEmbeddedViewInjector) &&\n !(currentLView[FLAGS] & LViewFlags.IsRoot)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(\n currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode: TElementNode|TContainerNode|null = currentTNode.parent;\n\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue =\n embeddedViewInjector.get(token, NOT_FOUND as T | {}, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n\n currentTNode = parentTNode;\n }\n\n return notFoundValue;\n}\n\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView: LView): TElementNode|TElementContainerNode|null {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n\n // The parent pointer differs based on `TView.type`.\n if (tViewType === TViewType.Embedded) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode as TElementContainerNode;\n } else if (tViewType === TViewType.Component) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST] as TElementNode;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\n\nimport {noSideEffects} from './closure';\n\n\n\n/**\n * An interface implemented by all Angular type decorators, which allows them to be used as\n * decorators as well as Angular syntax.\n *\n * ```\n * @ng.Component({...})\n * class MyClass {...}\n * ```\n *\n * @publicApi\n */\nexport interface TypeDecorator {\n /**\n * Invoke as decorator.\n */\n <T extends Type<any>>(type: T): T;\n\n // Make TypeDecorator assignable to built-in ParameterDecorator type.\n // ParameterDecorator is declared in lib.d.ts as a `declare type`\n // so we cannot declare this interface as a subtype.\n // see https://github.com/angular/angular/issues/3379#issuecomment-126169417\n (target: Object, propertyKey?: string|symbol, parameterIndex?: number): void;\n}\n\nexport const ANNOTATIONS = '__annotations__';\nexport const PARAMETERS = '__parameters__';\nexport const PROP_METADATA = '__prop__metadata__';\n\n/**\n * @suppress {globalThis}\n */\nexport function makeDecorator<T>(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n additionalProcessing?: (type: Type<T>) => void,\n typeFn?: (type: Type<T>, ...args: any[]) => void):\n {new (...args: any[]): any; (...args: any[]): any; (...args: any[]): (cls: any) => any;} {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n\n function DecoratorFactory(\n this: unknown|typeof DecoratorFactory, ...args: any[]): (cls: Type<T>) => any {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this as typeof DecoratorFactory;\n }\n\n const annotationInstance = new (DecoratorFactory as any)(...args);\n return function TypeDecorator(cls: Type<T>) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ?\n (cls as any)[ANNOTATIONS] :\n (Object.defineProperty(cls, ANNOTATIONS, {value: []}) as any)[ANNOTATIONS];\n annotations.push(annotationInstance);\n\n\n if (additionalProcessing) additionalProcessing(cls);\n\n return cls;\n };\n }\n\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n DecoratorFactory.prototype.ngMetadataName = name;\n (DecoratorFactory as any).annotationCls = DecoratorFactory;\n return DecoratorFactory as any;\n });\n}\n\nfunction makeMetadataCtor(props?: (...args: any[]) => any): any {\n return function ctor(this: any, ...args: any[]) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\n\nexport function makeParamDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any): any {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(\n this: unknown|typeof ParamDecoratorFactory, ...args: any[]): any {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new (<any>ParamDecoratorFactory)(...args);\n\n (<any>ParamDecorator).annotation = annotationInstance;\n return ParamDecorator;\n\n function ParamDecorator(cls: any, unusedKey: any, index: number): any {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ?\n (cls as any)[PARAMETERS] :\n Object.defineProperty(cls, PARAMETERS, {value: []})[PARAMETERS];\n\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n (<any>ParamDecoratorFactory).annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\n\nexport function makePropDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n additionalProcessing?: (target: any, name: string, ...args: any[]) => void): any {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n\n function PropDecoratorFactory(this: unknown|typeof PropDecoratorFactory, ...args: any[]): any {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n\n const decoratorInstance = new (<any>PropDecoratorFactory)(...args);\n\n function PropDecorator(target: any, name: string) {\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ?\n (constructor as any)[PROP_METADATA] :\n Object.defineProperty(constructor, PROP_METADATA, {value: {}})[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n\n if (additionalProcessing) additionalProcessing(target, name, ...args);\n }\n\n return PropDecorator;\n }\n\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n PropDecoratorFactory.prototype.ngMetadataName = name;\n (<any>PropDecoratorFactory).annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\nimport {assertLessThan} from '../util/assert';\n\nimport {ɵɵdefineInjectable} from './interface/defs';\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parameterized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides an additional level of type safety.\n *\n * ```\n * interface MyInterface {...}\n * const myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));\n * // myInterface is inferred to be MyInterface.\n * ```\n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the `inject` function.\n * As you can see in the Tree-shakable InjectionToken example below.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:\n * this option is now deprecated). As mentioned above, `'root'` is the default value for\n * `providedIn`.\n *\n * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.\n *\n * @usageNotes\n * ### Basic Examples\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n *\n * @publicApi\n */\nexport class InjectionToken<T> {\n /** @internal */\n readonly ngMetadataName = 'InjectionToken';\n\n readonly ɵprov: unknown;\n\n /**\n * @param _desc Description for the token,\n * used only for debugging purposes,\n * it should but does not need to be unique\n * @param options Options for the token's usage, as described above\n */\n constructor(protected _desc: string, options?: {\n providedIn?: Type<any>|'root'|'platform'|'any'|null, factory: () => T\n }) {\n this.ɵprov = undefined;\n if (typeof options == 'number') {\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n assertLessThan(options, 0, 'Only negative numbers are supported here');\n // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.\n // See `InjectorMarkers`\n (this as any).__NG_ELEMENT_ID__ = options;\n } else if (options !== undefined) {\n this.ɵprov = ɵɵdefineInjectable({\n token: this,\n providedIn: options.providedIn || 'root',\n factory: options.factory,\n });\n }\n }\n\n /**\n * @internal\n */\n get multi(): InjectionToken<Array<T>> {\n return this as InjectionToken<Array<T>>;\n }\n\n toString(): string {\n return `InjectionToken ${this._desc}`;\n }\n}\n\nexport interface InjectableDefToken<T> extends InjectionToken<T> {\n ɵprov: unknown;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {ProviderToken} from '../di/provider_token';\nimport {makePropDecorator} from '../util/decorators';\n\n/**\n * A DI token that you can use to create a virtual [provider](guide/glossary#provider)\n * that will populate the `entryComponents` field of components and NgModules\n * based on its `useValue` property value.\n * All components that are referenced in the `useValue` value (either directly\n * or in a nested array or map) are added to the `entryComponents` property.\n *\n * @usageNotes\n *\n * The following example shows how the router can populate the `entryComponents`\n * field of an NgModule based on a router configuration that refers\n * to components.\n *\n * ```typescript\n * // helper function inside the router\n * function provideRoutes(routes) {\n * return [\n * {provide: ROUTES, useValue: routes},\n * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}\n * ];\n * }\n *\n * // user code\n * let routes = [\n * {path: '/root', component: RootComp},\n * {path: '/teams', component: TeamsComp}\n * ];\n *\n * @NgModule({\n * providers: [provideRoutes(routes)]\n * })\n * class ModuleWithRoutes {}\n * ```\n *\n * @publicApi\n * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.\n */\nexport const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken<any>('AnalyzeForEntryComponents');\n\n/**\n * Type of the `Attribute` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface AttributeDecorator {\n /**\n * Specifies that a constant attribute value should be injected.\n *\n * The directive can inject constant string literals of host element attributes.\n *\n * @usageNotes\n *\n * Suppose we have an `<input>` element and want to know its `type`.\n *\n * ```html\n * <input type=\"text\">\n * ```\n *\n * A decorator can inject string literal `text` as in the following example.\n *\n * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}\n *\n * @publicApi\n */\n (name: string): any;\n new(name: string): Attribute;\n}\n\n\n/**\n * Type of the Attribute metadata.\n *\n * @publicApi\n */\nexport interface Attribute {\n /**\n * The name of the attribute to be injected into the constructor.\n */\n attributeName?: string;\n}\n\n/**\n * Type of the Query metadata.\n *\n * @publicApi\n */\nexport interface Query {\n descendants: boolean;\n emitDistinctChangesOnly: boolean;\n first: boolean;\n read: any;\n isViewQuery: boolean;\n selector: any;\n static?: boolean;\n}\n\n// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n// explicitly set.\nexport const emitDistinctChangesOnlyDefaultValue = true;\n\n\n/**\n * Base class for query metadata.\n *\n * @see `ContentChildren`.\n * @see `ContentChild`.\n * @see `ViewChildren`.\n * @see `ViewChild`.\n *\n * @publicApi\n */\nexport abstract class Query {}\n\n/**\n * Type of the ContentChildren decorator / constructor function.\n *\n * @see `ContentChildren`.\n * @publicApi\n */\nexport interface ContentChildrenDecorator {\n /**\n * @description\n * Property decorator that configures a content query.\n *\n * Use to get the `QueryList` of elements or directives from the content DOM.\n * Any time a child element is added, removed, or moved, the query list will be\n * updated, and the changes observable of the query list will emit a new value.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * Does not retrieve elements or directives that are in other components' templates,\n * since a component's template is always a black box to its ancestors.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **descendants** - If `true` include all descendants of the element. If `false` then only\n * query direct children of the element.\n * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only\n * if the QueryList result has changed. When `false` the `changes` observable might emit even\n * if the QueryList has not changed.\n * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and\n * removed in future versions of Angular.\n * * **read** - Used to read a different token from the queried elements.\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`\n * with `@ContentChildren('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ContentChildren(SomeService) someService: SomeService`)\n * * Any provider defined through a string token (e.g. `@ContentChildren('someToken')\n * someTokenVal: any`)\n * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with\n * `@ContentChildren(TemplateRef) template;`)\n *\n * In addition, multiple string selectors can be separated with a comma (e.g.\n * `@ContentChildren('cmp1,cmp2')`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * @usageNotes\n *\n * Here is a simple demonstration of how the `ContentChildren` decorator can be used.\n *\n * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}\n *\n * ### Tab-pane example\n *\n * Here is a slightly more realistic example that shows how `ContentChildren` decorators\n * can be used to implement a tab pane component.\n *\n * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: ProviderToken<unknown>|Function|string, opts?: {\n descendants?: boolean,\n emitDistinctChangesOnly?: boolean,\n read?: any,\n }): any;\n new(selector: ProviderToken<unknown>|Function|string,\n opts?: {descendants?: boolean, emitDistinctChangesOnly?: boolean, read?: any}): Query;\n}\n\n/**\n * Type of the ContentChildren metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport type ContentChildren = Query;\n\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport const ContentChildren: ContentChildrenDecorator = makePropDecorator(\n 'ContentChildren', (selector?: any, data: any = {}) => ({\n selector,\n first: false,\n isViewQuery: false,\n descendants: false,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...data\n }),\n Query);\n\n/**\n * Type of the ContentChild decorator / constructor function.\n *\n * @publicApi\n */\nexport interface ContentChildDecorator {\n /**\n * @description\n * Property decorator that configures a content query.\n *\n * Use to get the first element or the directive matching the selector from the content DOM.\n * If the content DOM changes, and a new child matches the selector,\n * the property will be updated.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * Does not retrieve elements or directives that are in other components' templates,\n * since a component's template is always a black box to its ancestors.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **descendants** - If `true` (default) include all descendants of the element. If `false` then\n * only query direct children of the element.\n * * **read** - Used to read a different token from the queried element.\n * * **static** - True to resolve query results before change detection runs,\n * false to resolve after change detection. Defaults to false.\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`\n * with `@ContentChild('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ContentChild(SomeService) someService: SomeService`)\n * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal:\n * any`)\n * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ContentChild(TemplateRef)\n * template;`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * @usageNotes\n *\n * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: ProviderToken<unknown>|Function|string,\n opts?: {descendants?: boolean, read?: any, static?: boolean}): any;\n new(selector: ProviderToken<unknown>|Function|string,\n opts?: {descendants?: boolean, read?: any, static?: boolean}): ContentChild;\n}\n\n/**\n * Type of the ContentChild metadata.\n *\n * @publicApi\n */\nexport type ContentChild = Query;\n\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n *\n * @publicApi\n */\nexport const ContentChild: ContentChildDecorator = makePropDecorator(\n 'ContentChild',\n (selector?: any, data: any = {}) =>\n ({selector, first: true, isViewQuery: false, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChildren decorator / constructor function.\n *\n * @see `ViewChildren`.\n *\n * @publicApi\n */\nexport interface ViewChildrenDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n *\n * Use to get the `QueryList` of elements or directives from the view DOM.\n * Any time a child element is added, removed, or moved, the query list will be updated,\n * and the changes observable of the query list will emit a new value.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **read** - Used to read a different token from the queried elements.\n * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only\n * if the QueryList result has changed. When `false` the `changes` observable might emit even\n * if the QueryList has not changed.\n * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and\n * removed in future versions of Angular.\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`\n * with `@ViewChildren('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ViewChildren(SomeService) someService!: SomeService`)\n * * Any provider defined through a string token (e.g. `@ViewChildren('someToken')\n * someTokenVal!: any`)\n * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChildren(TemplateRef)\n * template;`)\n *\n * In addition, multiple string selectors can be separated with a comma (e.g.\n * `@ViewChildren('cmp1,cmp2')`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * @usageNotes\n *\n * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}\n *\n * ### Another example\n *\n * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: ProviderToken<unknown>|Function|string,\n opts?: {read?: any, emitDistinctChangesOnly?: boolean}): any;\n new(selector: ProviderToken<unknown>|Function|string,\n opts?: {read?: any, emitDistinctChangesOnly?: boolean}): ViewChildren;\n}\n\n/**\n * Type of the ViewChildren metadata.\n *\n * @publicApi\n */\nexport type ViewChildren = Query;\n\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChildren: ViewChildrenDecorator = makePropDecorator(\n 'ViewChildren', (selector?: any, data: any = {}) => ({\n selector,\n first: false,\n isViewQuery: true,\n descendants: true,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...data\n }),\n Query);\n\n/**\n * Type of the ViewChild decorator / constructor function.\n *\n * @see `ViewChild`.\n * @publicApi\n */\nexport interface ViewChildDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n * The change detector looks for the first element or the directive matching the selector\n * in the view DOM. If the view DOM changes, and a new child matches the selector,\n * the property is updated.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **read** - Used to read a different token from the queried elements.\n * * **static** - True to resolve query results before change detection runs,\n * false to resolve after change detection. Defaults to false.\n *\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query `<my-component #cmp></my-component>`\n * with `@ViewChild('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ViewChild(SomeService) someService: SomeService`)\n * * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:\n * any`)\n * * A `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)\n * template;`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * @usageNotes\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * ### Example 2\n *\n * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}\n *\n * @Annotation\n */\n (selector: ProviderToken<unknown>|Function|string, opts?: {read?: any, static?: boolean}): any;\n new(selector: ProviderToken<unknown>|Function|string,\n opts?: {read?: any, static?: boolean}): ViewChild;\n}\n\n/**\n * Type of the ViewChild metadata.\n *\n * @publicApi\n */\nexport type ViewChild = Query;\n\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChild: ViewChildDecorator = makePropDecorator(\n 'ViewChild',\n (selector: any, data: any) =>\n ({selector, first: true, isViewQuery: true, descendants: true, ...data}),\n Query);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nexport const Type = Function;\n\nexport function isType(v: any): v is Type<any> {\n return typeof v === 'function';\n}\n\n/**\n * @description\n *\n * Represents an abstract class `T`, if applied to a concrete class it would stop being\n * instantiable.\n *\n * @publicApi\n */\nexport interface AbstractType<T> extends Function {\n prototype: T;\n}\n\nexport interface Type<T> extends Function {\n new(...args: any[]): T;\n}\n\nexport type Mutable<T extends {[x: string]: any}, K extends string> = {\n [P in K]: T[P];\n};\n\n/**\n * Returns a writable type version of type.\n *\n * USAGE:\n * Given:\n * ```\n * interface Person {readonly name: string}\n * ```\n *\n * We would like to get a read/write version of `Person`.\n * ```\n * const WritablePerson = Writable<Person>;\n * ```\n *\n * The result is that you can do:\n *\n * ```\n * const readonlyPerson: Person = {name: 'Marry'};\n * readonlyPerson.name = 'John'; // TypeError\n * (readonlyPerson as WritablePerson).name = 'John'; // OK\n *\n * // Error: Correctly detects that `Person` did not have `age` property.\n * (readonlyPerson as WritablePerson).age = 30;\n * ```\n */\nexport type Writable<T> = {\n -readonly[K in keyof T]: T[K];\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual, assertLessThanOrEqual} from './assert';\n\n/**\n * Determines if the contents of two arrays is identical\n *\n * @param a first array\n * @param b second array\n * @param identityAccessor Optional function for extracting stable object identity from a value in\n * the array.\n */\nexport function arrayEquals<T>(a: T[], b: T[], identityAccessor?: (value: T) => unknown): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA) as any;\n valueB = identityAccessor(valueB) as any;\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Flattens an array.\n */\nexport function flatten(list: any[]): any[] {\n return list.flat(Number.POSITIVE_INFINITY);\n}\n\nexport function deepForEach<T>(input: (T|any[])[], fn: (value: T) => void): void {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\n\nexport function addToArray(arr: any[], index: number, value: any): void {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\n\nexport function removeFromArray(arr: any[], index: number): any {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n return arr.pop();\n } else {\n return arr.splice(index, 1)[0];\n }\n}\n\nexport function newArray<T = any>(size: number): T[];\nexport function newArray<T>(size: number, value: T): T[];\nexport function newArray<T>(size: number, value?: T): T[] {\n const list: T[] = [];\n for (let i = 0; i < size; i++) {\n list.push(value!);\n }\n return list;\n}\n\n/**\n * Remove item from array (Same as `Array.splice()` but faster.)\n *\n * `Array.splice()` is not as fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * https://jsperf.com/fast-array-splice (About 20x faster)\n *\n * @param array Array to splice\n * @param index Index of element in array to remove.\n * @param count Number of items to remove.\n */\nexport function arraySplice(array: any[], index: number, count: number): void {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop(); // shrink the array\n }\n}\n\n/**\n * Same as `Array.splice(index, 0, value)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value Value to add to array.\n */\nexport function arrayInsert(array: any[], index: number, value: any): void {\n ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\\'t insert past array end.');\n let end = array.length;\n while (end > index) {\n const previousEnd = end - 1;\n array[end] = array[previousEnd];\n end = previousEnd;\n }\n array[index] = value;\n}\n\n/**\n * Same as `Array.splice2(index, 0, value1, value2)` but faster.\n *\n * `Array.splice()` is not fast because it has to allocate an array for the elements which were\n * removed. This causes memory pressure and slows down code when most of the time we don't\n * care about the deleted items array.\n *\n * @param array Array to splice.\n * @param index Index in array where the `value` should be added.\n * @param value1 Value to add to array.\n * @param value2 Value to add to array.\n */\nexport function arrayInsert2(array: any[], index: number, value1: any, value2: any): void {\n ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\\'t insert past array end.');\n let end = array.length;\n if (end == index) {\n // inserting at the end.\n array.push(value1, value2);\n } else if (end === 1) {\n // corner case when we have less items in array than we have items to insert.\n array.push(value2, array[0]);\n array[0] = value1;\n } else {\n end--;\n array.push(array[end - 1], array[end]);\n while (end > index) {\n const previousEnd = end - 2;\n array[end] = array[previousEnd];\n end--;\n }\n array[index] = value1;\n array[index + 1] = value2;\n }\n}\n\n\n/**\n * Get an index of an `value` in a sorted `array`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * located)\n */\nexport function arrayIndexOfSorted(array: string[], value: string): number {\n return _arrayIndexOfSorted(array, value, 0);\n}\n\n\n/**\n * `KeyValueArray` is an array where even positions contain keys and odd positions contain values.\n *\n * `KeyValueArray` provides a very efficient way of iterating over its contents. For small\n * sets (~10) the cost of binary searching an `KeyValueArray` has about the same performance\n * characteristics that of a `Map` with significantly better memory footprint.\n *\n * If used as a `Map` the keys are stored in alphabetical order so that they can be binary searched\n * for retrieval.\n *\n * See: `keyValueArraySet`, `keyValueArrayGet`, `keyValueArrayIndexOf`, `keyValueArrayDelete`.\n */\nexport interface KeyValueArray<VALUE> extends Array<VALUE|string> {\n __brand__: 'array-map';\n}\n\n/**\n * Set a `value` for a `key`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or create.\n * @param value The value to set for a `key`.\n * @returns index (always even) of where the value vas set.\n */\nexport function keyValueArraySet<V>(\n keyValueArray: KeyValueArray<V>, key: string, value: V): number {\n let index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it set it.\n keyValueArray[index | 1] = value;\n } else {\n index = ~index;\n arrayInsert2(keyValueArray, index, key, value);\n }\n return index;\n}\n\n/**\n * Retrieve a `value` for a `key` (on `undefined` if not found.)\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @return The `value` stored at the `key` location or `undefined if not found.\n */\nexport function keyValueArrayGet<V>(keyValueArray: KeyValueArray<V>, key: string): V|undefined {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it retrieve it.\n return keyValueArray[index | 1] as V;\n }\n return undefined;\n}\n\n/**\n * Retrieve a `key` index value in the array or `-1` if not found.\n *\n * @param keyValueArray to search.\n * @param key The key to locate.\n * @returns index of where the key is (or should have been.)\n * - positive (even) index if key found.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been inserted.)\n */\nexport function keyValueArrayIndexOf<V>(keyValueArray: KeyValueArray<V>, key: string): number {\n return _arrayIndexOfSorted(keyValueArray as string[], key, 1);\n}\n\n/**\n * Delete a `key` (and `value`) from the `KeyValueArray`.\n *\n * @param keyValueArray to modify.\n * @param key The key to locate or delete (if exist).\n * @returns index of where the key was (or should have been.)\n * - positive (even) index if key found and deleted.\n * - negative index if key not found. (`~index` (even) to get the index where it should have\n * been.)\n */\nexport function keyValueArrayDelete<V>(keyValueArray: KeyValueArray<V>, key: string): number {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n // if we found it remove it.\n arraySplice(keyValueArray, index, 2);\n }\n return index;\n}\n\n\n/**\n * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`.\n *\n * NOTE:\n * - This uses binary search algorithm for fast removals.\n *\n * @param array A sorted array to binary search.\n * @param value The value to look for.\n * @param shift grouping shift.\n * - `0` means look at every location\n * - `1` means only look at every other (even) location (the odd locations are to be ignored as\n * they are values.)\n * @returns index of the value.\n * - positive index if value found.\n * - negative index if value not found. (`~index` to get the value where it should have been\n * inserted)\n */\nfunction _arrayIndexOfSorted(array: string[], value: string, shift: number): number {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n let start = 0;\n let end = array.length >> shift;\n while (end !== start) {\n const middle = start + ((end - start) >> 1); // find the middle.\n const current = array[middle << shift];\n if (value === current) {\n return (middle << shift);\n } else if (current > value) {\n end = middle;\n } else {\n start = middle + 1; // We already searched middle so make it non-inclusive by adding 1\n }\n }\n return ~(end << shift);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isType, Type} from '../interface/type';\nimport {newArray} from '../util/array_utils';\nimport {ANNOTATIONS, PARAMETERS, PROP_METADATA} from '../util/decorators';\nimport {global} from '../util/global';\n\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\n\n\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nexport const ES5_DELEGATE_CTOR =\n /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nexport const ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nexport const ES2015_INHERITED_CLASS_WITH_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nexport const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nexport function isDelegateCtor(typeStr: string): boolean {\n return ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));\n}\n\nexport class ReflectionCapabilities implements PlatformReflectionCapabilities {\n private _reflect: any;\n\n constructor(reflect?: any) {\n this._reflect = reflect || global['Reflect'];\n }\n\n factory<T>(t: Type<T>): (args: any[]) => T {\n return (...args: any[]) => new t(...args);\n }\n\n /** @internal */\n _zipTypesAndAnnotations(paramTypes: any[], paramAnnotations: any[]): any[][] {\n let result: any[][];\n\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n } else {\n result = newArray(paramTypes.length);\n }\n\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n\n private _ownParameters(type: Type<any>, parentCtor: any): any[][]|null {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n\n // Prefer the direct API.\n if ((<any>type).parameters && (<any>type).parameters !== parentCtor.parameters) {\n return (<any>type).parameters;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = (<any>type).ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters =\n typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam: any) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(\n (ctorParam: any) =>\n ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && (type as any)[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray<any[]>(type.length);\n }\n\n parameters(type: Type<any>): any[][] {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n\n private _ownAnnotations(typeOrFunc: Type<any>, parentCtor: any): any[]|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).annotations && (<any>typeOrFunc).annotations !== parentCtor.annotations) {\n let annotations = (<any>typeOrFunc).annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).decorators && (<any>typeOrFunc).decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata((<any>typeOrFunc).decorators);\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return (typeOrFunc as any)[ANNOTATIONS];\n }\n return null;\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n\n private _ownPropMetadata(typeOrFunc: any, parentCtor: any): {[key: string]: any[]}|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).propMetadata &&\n (<any>typeOrFunc).propMetadata !== parentCtor.propMetadata) {\n let propMetadata = (<any>typeOrFunc).propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).propDecorators &&\n (<any>typeOrFunc).propDecorators !== parentCtor.propDecorators) {\n const propDecorators = (<any>typeOrFunc).propDecorators;\n const propMetadata = <{[key: string]: any[]}>{};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return (typeOrFunc as any)[PROP_METADATA];\n }\n return null;\n }\n\n propMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata: {[key: string]: any[]} = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators: any[] = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n\n ownPropMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\n\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[] {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\n\nfunction getParentCtor(ctor: Function): Type<any> {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {makeParamDecorator} from '../util/decorators';\n\nimport {attachInjectFlag} from './injector_compatibility';\nimport {DecoratorFlags, InternalInjectFlags} from './interface/injector';\n\n\n/**\n * Type of the Inject decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectDecorator {\n /**\n * Parameter decorator on a dependency parameter of a class constructor\n * that specifies a custom provider of the dependency.\n *\n * @usageNotes\n * The following example shows a class constructor that specifies a\n * custom provider of a dependency using the parameter decorator.\n *\n * When `@Inject()` is not present, the injector uses the type annotation of the\n * parameter as the provider.\n *\n * <code-example path=\"core/di/ts/metadata_spec.ts\" region=\"InjectWithoutDecorator\">\n * </code-example>\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection)\n *\n */\n (token: any): any;\n new(token: any): Inject;\n}\n\n/**\n * Type of the Inject metadata.\n *\n * @publicApi\n */\nexport interface Inject {\n /**\n * A [DI token](guide/glossary#di-token) that maps to the dependency to be injected.\n */\n token: any;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Inject: InjectDecorator = attachInjectFlag(\n // Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n makeParamDecorator('Inject', (token: any) => ({token})), DecoratorFlags.Inject);\n\n/**\n * Type of the Optional decorator / constructor function.\n *\n * @publicApi\n */\nexport interface OptionalDecorator {\n /**\n * Parameter decorator to be used on constructor parameters,\n * which marks the parameter as being an optional dependency.\n * The DI framework provides `null` if the dependency is not found.\n *\n * Can be used together with other parameter decorators\n * that modify how dependency injection operates.\n *\n * @usageNotes\n *\n * The following code allows the possibility of a `null` result:\n *\n * <code-example path=\"core/di/ts/metadata_spec.ts\" region=\"Optional\">\n * </code-example>\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n */\n (): any;\n new(): Optional;\n}\n\n/**\n * Type of the Optional metadata.\n *\n * @publicApi\n */\nexport interface Optional {}\n\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Optional: OptionalDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('Optional'), InternalInjectFlags.Optional);\n\n/**\n * Type of the Self decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SelfDecorator {\n /**\n * Parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the local injector.\n *\n * Resolution works upward through the injector hierarchy, so the children\n * of this class must configure their own providers or be prepared for a `null` result.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved\n * by the local injector when instantiating the class itself, but not\n * when instantiating a child.\n *\n * <code-example path=\"core/di/ts/metadata_spec.ts\" region=\"Self\">\n * </code-example>\n *\n * @see `SkipSelf`\n * @see `Optional`\n *\n */\n (): any;\n new(): Self;\n}\n\n/**\n * Type of the Self metadata.\n *\n * @publicApi\n */\nexport interface Self {}\n\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Self: SelfDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('Self'), InternalInjectFlags.Self);\n\n\n/**\n * Type of the `SkipSelf` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SkipSelfDecorator {\n /**\n * Parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the parent injector.\n * Resolution works upward through the injector hierarchy, so the local injector\n * is not checked for a provider.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved when\n * instantiating a child, but not when instantiating the class itself.\n *\n * <code-example path=\"core/di/ts/metadata_spec.ts\" region=\"SkipSelf\">\n * </code-example>\n *\n * @see [Dependency Injection guide](guide/dependency-injection-in-action#skip).\n * @see `Self`\n * @see `Optional`\n *\n */\n (): any;\n new(): SkipSelf;\n}\n\n/**\n * Type of the `SkipSelf` metadata.\n *\n * @publicApi\n */\nexport interface SkipSelf {}\n\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const SkipSelf: SkipSelfDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('SkipSelf'), InternalInjectFlags.SkipSelf);\n\n/**\n * Type of the `Host` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostDecorator {\n /**\n * Parameter decorator on a view-provider parameter of a class constructor\n * that tells the DI framework to resolve the view by checking injectors of child\n * elements, and stop when reaching the host element of the current component.\n *\n * @usageNotes\n *\n * The following shows use with the `@Optional` decorator, and allows for a `null` result.\n *\n * <code-example path=\"core/di/ts/metadata_spec.ts\" region=\"Host\">\n * </code-example>\n *\n * For an extended example, see [\"Dependency Injection\n * Guide\"](guide/dependency-injection-in-action#optional).\n */\n (): any;\n new(): Host;\n}\n\n/**\n * Type of the Host metadata.\n *\n * @publicApi\n */\nexport interface Host {}\n\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Host: HostDecorator =\n // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n // tslint:disable-next-line: no-toplevel-property-access\n attachInjectFlag(makeParamDecorator('Host'), InternalInjectFlags.Host);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {R3DependencyMetadataFacade} from '../../compiler/compiler_facade';\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {Type} from '../../interface/type';\nimport {ReflectionCapabilities} from '../../reflection/reflection_capabilities';\nimport {Host, Inject, Optional, Self, SkipSelf} from '../metadata';\nimport {Attribute} from '../metadata_attr';\n\nlet _reflect: ReflectionCapabilities|null = null;\n\nexport function getReflect(): ReflectionCapabilities {\n return (_reflect = _reflect || new ReflectionCapabilities());\n}\n\nexport function reflectDependencies(type: Type<any>): R3DependencyMetadataFacade[] {\n return convertDependencies(getReflect().parameters(type));\n}\n\nexport function convertDependencies(deps: any[]): R3DependencyMetadataFacade[] {\n return deps.map(dep => reflectDependency(dep));\n}\n\nfunction reflectDependency(dep: any|any[]): R3DependencyMetadataFacade {\n const meta: R3DependencyMetadataFacade = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false,\n };\n\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n\n const proto = Object.getPrototypeOf(param);\n\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INJECTION_TOKEN,\n ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n } else {\n meta.token = param;\n }\n }\n } else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) {\n meta.token = null;\n } else {\n meta.token = dep;\n }\n return meta;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewEncapsulation} from '../metadata/view';\n\n\n/**\n * Used by `RendererFactory2` to associate custom rendering data and styles\n * with a rendering implementation.\n * @publicApi\n */\nexport interface RendererType2 {\n /**\n * A unique identifying string for the new renderer, used when creating\n * unique styles for encapsulation.\n */\n id: string;\n /**\n * The view encapsulation type, which determines how styles are applied to\n * DOM elements. One of\n * - `Emulated` (default): Emulate native scoping of styles.\n * - `Native`: Use the native encapsulation mechanism of the renderer.\n * - `ShadowDom`: Use modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * create a ShadowRoot for component's host element.\n * - `None`: Do not provide any template or style encapsulation.\n */\n encapsulation: ViewEncapsulation;\n /**\n * Defines CSS styles to be stored on a renderer instance.\n */\n styles: (string|any[])[];\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n */\n data: {[kind: string]: any};\n}\n\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nexport enum RendererStyleFlags2 {\n // TODO(misko): This needs to be refactored into a separate file so that it can be imported from\n // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails\n // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.\n /**\n * Marks a style as important.\n */\n Important = 1 << 0,\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n DashCase = 1 << 1\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertNumber} from '../../util/assert';\n\nimport {ID, LView} from './view';\n\n// Keeps track of the currently-active LViews.\nconst TRACKED_LVIEWS = new Map<number, LView>();\n\n// Used for generating unique IDs for LViews.\nlet uniqueIdCounter = 0;\n\n/** Gets a unique ID that can be assigned to an LView. */\nexport function getUniqueLViewId(): number {\n return uniqueIdCounter++;\n}\n\n/** Starts tracking an LView. */\nexport function registerLView(lView: LView): void {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\n\n/** Gets an LView by its unique ID. */\nexport function getLViewById(id: number): LView|null {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\n\n/** Stops tracking an LView. */\nexport function unregisterLView(lView: LView): void {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport '../util/ng_dev_mode';\n\nimport {assertDefined, assertDomNode} from '../util/assert';\nimport {EMPTY_ARRAY} from '../util/empty';\n\nimport {assertLView} from './assert';\nimport {LContext} from './interfaces/context';\nimport {getLViewById, registerLView} from './interfaces/lview_tracking';\nimport {TNode, TNodeFlags} from './interfaces/node';\nimport {RElement, RNode} from './interfaces/renderer_dom';\nimport {isLView} from './interfaces/type_checks';\nimport {CONTEXT, HEADER_OFFSET, HOST, ID, LView, TVIEW} from './interfaces/view';\nimport {getComponentLViewByIndex, unwrapRNode} from './util/view_utils';\n\n\n\n/**\n * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nexport function getLContext(target: any): LContext|null {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (isLView(mpValue)) {\n const lView: LView = mpValue!;\n let nodeIndex: number;\n let component: any = undefined;\n let directives: any[]|null|undefined = undefined;\n\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n } else {\n nodeIndex = findViaNativeElement(lView, target as RElement);\n if (nodeIndex == -1) {\n return null;\n }\n }\n\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context: LContext = (existingCtx && !Array.isArray(existingCtx)) ?\n existingCtx :\n createLContext(lView, nodeIndex, native);\n\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target as RElement;\n ngDevMode && assertDomNode(rElement);\n\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement as any;\n while (parent = parent.parentNode) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? parentContext as LView : parentContext.lView;\n\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return (mpValue as LContext) || null;\n}\n\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView: LView, nodeIndex: number, native: RNode): LContext {\n return new LContext(lView[ID], nodeIndex, native);\n}\n\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nexport function getComponentViewByInstance(componentInstance: {}): LView {\n let patchedData = readPatchedData(componentInstance);\n let lView: LView;\n\n if (isLView(patchedData)) {\n const contextLView: LView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST] as RElement);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = patchedData as unknown as LContext;\n const contextLView = context.lView!;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\n\n/**\n * This property will be monkey-patched on elements, components and directives.\n */\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\n\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nexport function attachPatchData(target: any, data: LView|LContext) {\n ngDevMode && assertDefined(target, 'Target expected');\n // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this\n // for `LView`, because we have control over when an `LView` is created and destroyed, whereas\n // we can't know when to remove an `LContext`.\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n } else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\n\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nexport function readPatchedData(target: any): LView|LContext|null {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return (typeof data === 'number') ? getLViewById(data) : data || null;\n}\n\nexport function readPatchedLView<T>(target: any): LView<T>|null {\n const value = readPatchedData(target);\n if (value) {\n return (isLView(value) ? value : value.lView) as LView<T>;\n }\n return null;\n}\n\nexport function isComponentInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ɵcmp;\n}\n\nexport function isDirectiveInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ɵdir;\n}\n\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView: LView, target: RElement): number {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode: TNode): TNode|null {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView: LView, componentInstance: {}): number {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView: LView, directiveInstance: {}): number {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n\n/**\n * Returns a list of directives applied to a node at a specific index. The list includes\n * directives matched by selector and any host directives, but it excludes components.\n * Use `getComponentAtNodeIndex` to find the component applied to a node.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n */\nexport function getDirectivesAtNodeIndex(nodeIndex: number, lView: LView): any[]|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n if (tNode.directiveStart === 0) return EMPTY_ARRAY;\n const results: any[] = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\n\nexport function getComponentAtNodeIndex(nodeIndex: number, lView: LView): {}|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n const {directiveStart, componentOffset} = tNode;\n return componentOffset > -1 ? lView[directiveStart + componentOffset] : null;\n}\n\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nexport function discoverLocalRefs(lView: LView, nodeIndex: number): {[key: string]: any}|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n if (tNode && tNode.localNames) {\n const result: {[key: string]: any} = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview\n *\n * This file provides mechanism by which code relevant to the `TIcuContainerNode` is only loaded if\n * ICU is present in the template.\n */\n\nimport {TIcuContainerNode} from '../interfaces/node';\nimport {RNode} from '../interfaces/renderer_dom';\nimport {LView} from '../interfaces/view';\n\n\nlet _icuContainerIterate: (tIcuContainerNode: TIcuContainerNode, lView: LView) =>\n (() => RNode | null);\n\n/**\n * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.\n */\nexport function icuContainerIterate(tIcuContainerNode: TIcuContainerNode, lView: LView): () =>\n RNode | null {\n return _icuContainerIterate(tIcuContainerNode, lView);\n}\n\n/**\n * Ensures that `IcuContainerVisitor`'s implementation is present.\n *\n * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the\n * bundler to tree shake ICU logic and only load it if ICU instruction is executed.\n */\nexport function ensureIcuContainerVisitorLoaded(\n loader: () => ((tIcuContainerNode: TIcuContainerNode, lView: LView) => (() => RNode | null))) {\n if (_icuContainerIterate === undefined) {\n // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it\n // can be inlined into call-site.\n _icuContainerIterate = loader();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined} from '../../util/assert';\nimport {assertLView} from '../assert';\nimport {readPatchedLView} from '../context_discovery';\nimport {LContainer} from '../interfaces/container';\nimport {isLContainer, isLView} from '../interfaces/type_checks';\nimport {CHILD_HEAD, CONTEXT, FLAGS, LView, LViewFlags, NEXT, PARENT} from '../interfaces/view';\n\n\n/**\n * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of\n * that LContainer, which is an LView\n * @param lView the lView whose parent to get\n */\nexport function getLViewParent(lView: LView): LView|null {\n ngDevMode && assertLView(lView);\n const parent = lView[PARENT];\n return isLContainer(parent) ? parent[PARENT]! : parent;\n}\n\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nexport function getRootView<T>(componentOrLView: LView|{}): LView<T> {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView)!;\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView = getLViewParent(lView)!;\n }\n ngDevMode && assertLView(lView);\n return lView as LView<T>;\n}\n\n/**\n * Returns the context information associated with the application where the target is situated. It\n * does this by walking the parent views until it gets to the root view, then getting the context\n * off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nexport function getRootContext<T>(viewOrComponent: LView<T>|{}): T {\n const rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT] as T;\n}\n\n\n/**\n * Gets the first `LContainer` in the LView or `null` if none exists.\n */\nexport function getFirstLContainer(lView: LView): LContainer|null {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\n\n/**\n * Gets the next `LContainer` that is a sibling of the given container.\n */\nexport function getNextLContainer(container: LContainer): LContainer|null {\n return getNearestLContainer(container[NEXT]);\n}\n\nfunction getNearestLContainer(viewOrContainer: LContainer|LView|null) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer as LContainer | null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererStyleFlags2} from '../render/api_flags';\nimport {addToArray, removeFromArray} from '../util/array_utils';\nimport {assertDefined, assertEqual, assertFunction, assertNumber, assertString} from '../util/assert';\nimport {escapeCommentText} from '../util/dom';\n\nimport {assertLContainer, assertLView, assertParentView, assertProjectionSlots, assertTNodeForLView} from './assert';\nimport {attachPatchData} from './context_discovery';\nimport {icuContainerIterate} from './i18n/i18n_tree_shaking';\nimport {CONTAINER_HEADER_OFFSET, HAS_TRANSPLANTED_VIEWS, LContainer, MOVED_VIEWS, NATIVE} from './interfaces/container';\nimport {ComponentDef} from './interfaces/definition';\nimport {NodeInjectorFactory} from './interfaces/injector';\nimport {unregisterLView} from './interfaces/lview_tracking';\nimport {TElementNode, TIcuContainerNode, TNode, TNodeFlags, TNodeType, TProjectionNode} from './interfaces/node';\nimport {Renderer} from './interfaces/renderer';\nimport {RComment, RElement, RNode, RTemplate, RText} from './interfaces/renderer_dom';\nimport {isLContainer, isLView} from './interfaces/type_checks';\nimport {CHILD_HEAD, CLEANUP, DECLARATION_COMPONENT_VIEW, DECLARATION_LCONTAINER, DestroyHookData, FLAGS, HookData, HookFn, HOST, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, T_HOST, TVIEW, TView, TViewType} from './interfaces/view';\nimport {assertTNodeType} from './node_assert';\nimport {profiler, ProfilerEvent} from './profiler';\nimport {setUpAttributes} from './util/attrs_utils';\nimport {getLViewParent} from './util/view_traversal_utils';\nimport {getNativeByTNode, unwrapRNode, updateTransplantedViewCount} from './util/view_utils';\n\nconst enum WalkTNodeTreeAction {\n /** node create in the native environment. Run on initial creation. */\n Create = 0,\n\n /**\n * node insert in the native environment.\n * Run when existing node has been detached and needs to be re-attached.\n */\n Insert = 1,\n\n /** node detach from the native environment */\n Detach = 2,\n\n /** node destruction using the renderer's API */\n Destroy = 3,\n}\n\n\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction applyToElementOrContainer(\n action: WalkTNodeTreeAction, renderer: Renderer, parent: RElement|null,\n lNodeToHandle: RNode|LContainer|LView, beforeNode?: RNode|null) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer: LContainer|undefined;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n } else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST]!;\n }\n const rNode: RNode = unwrapRNode(lNodeToHandle);\n\n if (action === WalkTNodeTreeAction.Create && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n } else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n } else if (action === WalkTNodeTreeAction.Insert && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n } else if (action === WalkTNodeTreeAction.Detach) {\n nativeRemoveNode(renderer, rNode, isComponent);\n } else if (action === WalkTNodeTreeAction.Destroy) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n renderer.destroyNode!(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}\n\nexport function createTextNode(renderer: Renderer, value: string): RText {\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n ngDevMode && ngDevMode.rendererSetText++;\n return renderer.createText(value);\n}\n\nexport function updateTextNode(renderer: Renderer, rNode: RText, value: string): void {\n ngDevMode && ngDevMode.rendererSetText++;\n renderer.setValue(rNode, value);\n}\n\nexport function createCommentNode(renderer: Renderer, value: string): RComment {\n ngDevMode && ngDevMode.rendererCreateComment++;\n return renderer.createComment(escapeCommentText(value));\n}\n\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param renderer A renderer to use\n * @param name the tag name\n * @param namespace Optional namespace for element.\n * @returns the element created\n */\nexport function createElementNode(\n renderer: Renderer, name: string, namespace: string|null): RElement {\n ngDevMode && ngDevMode.rendererCreateElement++;\n return renderer.createElement(name, namespace);\n}\n\n\n/**\n * Removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param lView The view from which elements should be added or removed\n */\nexport function removeViewFromContainer(tView: TView, lView: LView): void {\n const renderer = lView[RENDERER];\n applyView(tView, lView, renderer, WalkTNodeTreeAction.Detach, null, null);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}\n\n/**\n * Adds all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to add all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param parentTNode The `TNode` where the `LView` should be attached to.\n * @param renderer Current renderer to use for DOM manipulations.\n * @param lView The view from which elements should be added or removed\n * @param parentNativeNode The parent `RElement` where it should be inserted into.\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nexport function addViewToContainer(\n tView: TView, parentTNode: TNode, renderer: Renderer, lView: LView, parentNativeNode: RElement,\n beforeNode: RNode|null): void {\n lView[HOST] = parentNativeNode;\n lView[T_HOST] = parentTNode;\n applyView(tView, lView, renderer, WalkTNodeTreeAction.Insert, parentNativeNode, beforeNode);\n}\n\n\n/**\n * Detach a `LView` from the DOM by detaching its nodes.\n *\n * @param tView The `TView' of the `LView` to be detached\n * @param lView the `LView` to be detached.\n */\nexport function renderDetachView(tView: TView, lView: LView) {\n applyView(tView, lView, lView[RENDERER], WalkTNodeTreeAction.Detach, null, null);\n}\n\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nexport function destroyViewTree(rootView: LView): void {\n // If the view has no children, we can clean it up and return early.\n let lViewOrLContainer = rootView[CHILD_HEAD];\n if (!lViewOrLContainer) {\n return cleanUpView(rootView[TVIEW], rootView);\n }\n\n while (lViewOrLContainer) {\n let next: LView|LContainer|null = null;\n\n if (isLView(lViewOrLContainer)) {\n // If LView, traverse down to child.\n next = lViewOrLContainer[CHILD_HEAD];\n } else {\n ngDevMode && assertLContainer(lViewOrLContainer);\n // If container, traverse down to its first LView.\n const firstView: LView|undefined = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n if (firstView) next = firstView;\n }\n\n if (!next) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (lViewOrLContainer && !lViewOrLContainer![NEXT] && lViewOrLContainer !== rootView) {\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n lViewOrLContainer = lViewOrLContainer[PARENT];\n }\n if (lViewOrLContainer === null) lViewOrLContainer = rootView;\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n next = lViewOrLContainer && lViewOrLContainer![NEXT];\n }\n lViewOrLContainer = next;\n }\n}\n\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param tView The `TView' of the `LView` to insert\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param index Which index in the container to insert the child view into\n */\nexport function insertView(tView: TView, lView: LView, lContainer: LContainer, index: number) {\n ngDevMode && assertLView(lView);\n ngDevMode && assertLContainer(lContainer);\n const indexInContainer = CONTAINER_HEADER_OFFSET + index;\n const containerLength = lContainer.length;\n\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n lContainer[indexInContainer - 1][NEXT] = lView;\n }\n if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n lView[NEXT] = lContainer[indexInContainer];\n addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n } else {\n lContainer.push(lView);\n lView[NEXT] = null;\n }\n\n lView[PARENT] = lContainer;\n\n // track views where declaration and insertion points are different\n const declarationLContainer = lView[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n trackMovedView(declarationLContainer, lView);\n }\n\n // notify query that a new view has been added\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.insertView(tView);\n }\n\n // Sets the attached flag\n lView[FLAGS] |= LViewFlags.Attached;\n}\n\n/**\n * Track views created from the declaration container (TemplateRef) and inserted into a\n * different LContainer.\n */\nfunction trackMovedView(declarationContainer: LContainer, lView: LView) {\n ngDevMode && assertDefined(lView, 'LView required');\n ngDevMode && assertLContainer(declarationContainer);\n const movedViews = declarationContainer[MOVED_VIEWS];\n const insertedLContainer = lView[PARENT] as LContainer;\n ngDevMode && assertLContainer(insertedLContainer);\n const insertedComponentLView = insertedLContainer[PARENT]![DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n if (declaredComponentLView !== insertedComponentLView) {\n // At this point the declaration-component is not same as insertion-component; this means that\n // this is a transplanted view. Mark the declared lView as having transplanted views so that\n // those views can participate in CD.\n declarationContainer[HAS_TRANSPLANTED_VIEWS] = true;\n }\n if (movedViews === null) {\n declarationContainer[MOVED_VIEWS] = [lView];\n } else {\n movedViews.push(lView);\n }\n}\n\nfunction detachMovedView(declarationContainer: LContainer, lView: LView) {\n ngDevMode && assertLContainer(declarationContainer);\n ngDevMode &&\n assertDefined(\n declarationContainer[MOVED_VIEWS],\n 'A projected view should belong to a non-empty projected views collection');\n const movedViews = declarationContainer[MOVED_VIEWS]!;\n const declarationViewIndex = movedViews.indexOf(lView);\n const insertionLContainer = lView[PARENT] as LContainer;\n ngDevMode && assertLContainer(insertionLContainer);\n\n // If the view was marked for refresh but then detached before it was checked (where the flag\n // would be cleared and the counter decremented), we need to decrement the view counter here\n // instead.\n if (lView[FLAGS] & LViewFlags.RefreshTransplantedView) {\n lView[FLAGS] &= ~LViewFlags.RefreshTransplantedView;\n updateTransplantedViewCount(insertionLContainer, -1);\n }\n\n movedViews.splice(declarationViewIndex, 1);\n}\n\n/**\n * Detaches a view from a container.\n *\n * This method removes the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @returns Detached LView instance.\n */\nexport function detachView(lContainer: LContainer, removeIndex: number): LView|undefined {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET) return;\n\n const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n const viewToDetach = lContainer[indexInContainer];\n\n if (viewToDetach) {\n const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n\n\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT] as LView;\n }\n const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromContainer(viewToDetach[TVIEW], viewToDetach);\n\n // notify query that a view has been removed\n const lQueries = removedLView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~LViewFlags.Attached;\n }\n return viewToDetach;\n}\n\n/**\n * A standalone function which destroys an LView,\n * conducting clean up (e.g. removing listeners, calling onDestroys).\n *\n * @param tView The `TView' of the `LView` to be destroyed\n * @param lView The view to be destroyed.\n */\nexport function destroyLView(tView: TView, lView: LView) {\n if (!(lView[FLAGS] & LViewFlags.Destroyed)) {\n const renderer = lView[RENDERER];\n if (renderer.destroyNode) {\n applyView(tView, lView, renderer, WalkTNodeTreeAction.Destroy, null, null);\n }\n\n destroyViewTree(lView);\n }\n}\n\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param tView `TView` for the `LView` to clean up.\n * @param lView The LView to clean up\n */\nfunction cleanUpView(tView: TView, lView: LView): void {\n if (!(lView[FLAGS] & LViewFlags.Destroyed)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~LViewFlags.Attached;\n\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= LViewFlags.Destroyed;\n\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === TViewType.Component) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n\n // Unregister the view once everything else has been cleaned up.\n unregisterLView(lView);\n }\n}\n\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction processCleanups(tView: TView, lView: LView): void {\n const tCleanup = tView.cleanup;\n const lCleanup = lView[CLEANUP]!;\n // `LCleanup` contains both share information with `TCleanup` as well as instance specific\n // information appended at the end. We need to know where the end of the `TCleanup` information\n // is, and we track this with `lastLCleanupIndex`.\n let lastLCleanupIndex = -1;\n if (tCleanup !== null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=\n // 2 at the end of this block).\n const targetIdx = tCleanup[i + 3];\n ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');\n if (targetIdx >= 0) {\n // unregister\n lCleanup[lastLCleanupIndex = targetIdx]();\n } else {\n // Subscription\n lCleanup[lastLCleanupIndex = -targetIdx].unsubscribe();\n }\n i += 2;\n } else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[lastLCleanupIndex = tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n }\n if (lCleanup !== null) {\n for (let i = lastLCleanupIndex + 1; i < lCleanup.length; i++) {\n const instanceCleanupFn = lCleanup[i];\n ngDevMode && assertFunction(instanceCleanupFn, 'Expecting instance cleanup function.');\n instanceCleanupFn();\n }\n lView[CLEANUP] = null;\n }\n}\n\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(tView: TView, lView: LView): void {\n let destroyHooks: DestroyHookData|null;\n\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (let i = 0; i < destroyHooks.length; i += 2) {\n const context = lView[destroyHooks[i] as number];\n\n // Only call the destroy hook if the context has been requested.\n if (!(context instanceof NodeInjectorFactory)) {\n const toCall = destroyHooks[i + 1] as HookFn | HookData;\n\n if (Array.isArray(toCall)) {\n for (let j = 0; j < toCall.length; j += 2) {\n const callContext = context[toCall[j] as number];\n const hook = toCall[j + 1] as HookFn;\n profiler(ProfilerEvent.LifecycleHookStart, callContext, hook);\n try {\n hook.call(callContext);\n } finally {\n profiler(ProfilerEvent.LifecycleHookEnd, callContext, hook);\n }\n }\n } else {\n profiler(ProfilerEvent.LifecycleHookStart, context, toCall);\n try {\n toCall.call(context);\n } finally {\n profiler(ProfilerEvent.LifecycleHookEnd, context, toCall);\n }\n }\n }\n }\n }\n}\n\n/**\n * Returns a native element if a node can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is made for projection but has not been inserted\n * into destination.\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve render parent.\n * @param lView: Current `LView`.\n */\nexport function getParentRElement(tView: TView, tNode: TNode, lView: LView): RElement|null {\n return getClosestRElement(tView, tNode.parent, lView);\n}\n\n/**\n * Get closest `RElement` or `null` if it can't be found.\n *\n * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.\n * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).\n * If `TNode` is `null` then return host `RElement`:\n * - return `null` if projection\n * - return `null` if parent container is disconnected (we have no parent.)\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is\n * needed).\n * @param lView: Current `LView`.\n * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)\n */\nexport function getClosestRElement(tView: TView, tNode: TNode|null, lView: LView): RElement|null {\n let parentTNode: TNode|null = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent.\n while (parentTNode !== null &&\n (parentTNode.type & (TNodeType.ElementContainer | TNodeType.Icu))) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n } else {\n ngDevMode && assertTNodeType(parentTNode, TNodeType.AnyRNode | TNodeType.Container);\n const {componentOffset} = parentTNode;\n if (componentOffset > -1) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const {encapsulation} =\n (tView.data[parentTNode.directiveStart + componentOffset] as ComponentDef<unknown>);\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n\n return getNativeByTNode(parentTNode, lView) as RElement;\n }\n}\n\n/**\n * Inserts a native node before another native node for a given parent.\n * This is a utility function that can be used when native nodes were determined.\n */\nexport function nativeInsertBefore(\n renderer: Renderer, parent: RElement, child: RNode, beforeNode: RNode|null,\n isMove: boolean): void {\n ngDevMode && ngDevMode.rendererInsertBefore++;\n renderer.insertBefore(parent, child, beforeNode, isMove);\n}\n\nfunction nativeAppendChild(renderer: Renderer, parent: RElement, child: RNode): void {\n ngDevMode && ngDevMode.rendererAppendChild++;\n ngDevMode && assertDefined(parent, 'parent node must be defined');\n renderer.appendChild(parent, child);\n}\n\nfunction nativeAppendOrInsertBefore(\n renderer: Renderer, parent: RElement, child: RNode, beforeNode: RNode|null, isMove: boolean) {\n if (beforeNode !== null) {\n nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n } else {\n nativeAppendChild(renderer, parent, child);\n }\n}\n\n/** Removes a node from the DOM given its native parent. */\nfunction nativeRemoveChild(\n renderer: Renderer, parent: RElement, child: RNode, isHostElement?: boolean): void {\n renderer.removeChild(parent, child, isHostElement);\n}\n\n/** Checks if an element is a `<template>` node. */\nfunction isTemplateNode(node: RElement): node is RTemplate {\n return node.tagName === 'TEMPLATE' && (node as RTemplate).content !== undefined;\n}\n\n/**\n * Returns a native parent of a given native node.\n */\nexport function nativeParentNode(renderer: Renderer, node: RNode): RElement|null {\n return renderer.parentNode(node);\n}\n\n/**\n * Returns a native sibling of a given native node.\n */\nexport function nativeNextSibling(renderer: Renderer, node: RNode): RNode|null {\n return renderer.nextSibling(node);\n}\n\n/**\n * Find a node in front of which `currentTNode` should be inserted.\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNode(parentTNode: TNode, currentTNode: TNode, lView: LView): RNode|\n null {\n return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n}\n\n\n/**\n * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into\n * account)\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * does not take `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nexport function getInsertInFrontOfRNodeWithNoI18n(\n parentTNode: TNode, currentTNode: TNode, lView: LView): RNode|null {\n if (parentTNode.type & (TNodeType.ElementContainer | TNodeType.Icu)) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}\n\n/**\n * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _getInsertInFrontOfRNodeWithI18n: (parentTNode: TNode, currentTNode: TNode, lView: LView) =>\n RNode | null = getInsertInFrontOfRNodeWithNoI18n;\n\n/**\n * Tree shakable boundary for `processI18nInsertBefore` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _processI18nInsertBefore: (\n renderer: Renderer, childTNode: TNode, lView: LView, childRNode: RNode|RNode[],\n parentRElement: RElement|null) => void;\n\nexport function setI18nHandling(\n getInsertInFrontOfRNodeWithI18n: (parentTNode: TNode, currentTNode: TNode, lView: LView) =>\n RNode | null,\n processI18nInsertBefore: (\n renderer: Renderer, childTNode: TNode, lView: LView, childRNode: RNode|RNode[],\n parentRElement: RElement|null) => void) {\n _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n _processI18nInsertBefore = processI18nInsertBefore;\n}\n\n/**\n * Appends the `child` native node (or a collection of nodes) to the `parent`.\n *\n * @param tView The `TView' to be appended\n * @param lView The current LView\n * @param childRNode The native child (or children) that should be appended\n * @param childTNode The TNode of the child element\n */\nexport function appendChild(\n tView: TView, lView: LView, childRNode: RNode|RNode[], childTNode: TNode): void {\n const parentRNode = getParentRElement(tView, childTNode, lView);\n const renderer = lView[RENDERER];\n const parentTNode: TNode = childTNode.parent || lView[T_HOST]!;\n const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n if (parentRNode != null) {\n if (Array.isArray(childRNode)) {\n for (let i = 0; i < childRNode.length; i++) {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n }\n } else {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n }\n }\n\n _processI18nInsertBefore !== undefined &&\n _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n}\n\n/**\n * Returns the first native node for a given LView, starting from the provided TNode.\n *\n * Native nodes are returned in the order in which those appear in the native tree (DOM).\n */\nfunction getFirstNativeNode(lView: LView, tNode: TNode|null): RNode|null {\n if (tNode !== null) {\n ngDevMode &&\n assertTNodeType(\n tNode,\n TNodeType.AnyRNode | TNodeType.AnyContainer | TNodeType.Icu | TNodeType.Projection);\n\n const tNodeType = tNode.type;\n if (tNodeType & TNodeType.AnyRNode) {\n return getNativeByTNode(tNode, lView);\n } else if (tNodeType & TNodeType.Container) {\n return getBeforeNodeForView(-1, lView[tNode.index]);\n } else if (tNodeType & TNodeType.ElementContainer) {\n const elIcuContainerChild = tNode.child;\n if (elIcuContainerChild !== null) {\n return getFirstNativeNode(lView, elIcuContainerChild);\n } else {\n const rNodeOrLContainer = lView[tNode.index];\n if (isLContainer(rNodeOrLContainer)) {\n return getBeforeNodeForView(-1, rNodeOrLContainer);\n } else {\n return unwrapRNode(rNodeOrLContainer);\n }\n }\n } else if (tNodeType & TNodeType.Icu) {\n let nextRNode = icuContainerIterate(tNode as TIcuContainerNode, lView);\n let rNode: RNode|null = nextRNode();\n // If the ICU container has no nodes, than we use the ICU anchor as the node.\n return rNode || unwrapRNode(lView[tNode.index]);\n } else {\n const projectionNodes = getProjectionNodes(lView, tNode);\n if (projectionNodes !== null) {\n if (Array.isArray(projectionNodes)) {\n return projectionNodes[0];\n }\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n return getFirstNativeNode(parentView!, projectionNodes);\n } else {\n return getFirstNativeNode(lView, tNode.next);\n }\n }\n }\n\n return null;\n}\n\nexport function getProjectionNodes(lView: LView, tNode: TNode|null): TNode|RNode[]|null {\n if (tNode !== null) {\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST] as TElementNode;\n const slotIdx = tNode.projection as number;\n ngDevMode && assertProjectionSlots(lView);\n return componentHost.projection![slotIdx];\n }\n return null;\n}\n\nexport function getBeforeNodeForView(viewIndexInContainer: number, lContainer: LContainer): RNode|\n null {\n const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n if (nextViewIndex < lContainer.length) {\n const lView = lContainer[nextViewIndex] as LView;\n const firstTNodeOfView = lView[TVIEW].firstChild;\n if (firstTNodeOfView !== null) {\n return getFirstNativeNode(lView, firstTNodeOfView);\n }\n }\n\n return lContainer[NATIVE];\n}\n\n/**\n * Removes a native node itself using a given renderer. To remove the node we are looking up its\n * parent from the native tree as not all platforms / browsers support the equivalent of\n * node.remove().\n *\n * @param renderer A renderer to be used\n * @param rNode The native node that should be removed\n * @param isHostElement A flag indicating if a node to be removed is a host of a component.\n */\nexport function nativeRemoveNode(renderer: Renderer, rNode: RNode, isHostElement?: boolean): void {\n ngDevMode && ngDevMode.rendererRemoveNode++;\n const nativeParent = nativeParentNode(renderer, rNode);\n if (nativeParent) {\n nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);\n }\n}\n\n\n/**\n * Performs the operation of `action` on the node. Typically this involves inserting or removing\n * nodes on the LView or projection boundary.\n */\nfunction applyNodes(\n renderer: Renderer, action: WalkTNodeTreeAction, tNode: TNode|null, lView: LView,\n parentRElement: RElement|null, beforeNode: RNode|null, isProjection: boolean) {\n while (tNode != null) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n ngDevMode &&\n assertTNodeType(\n tNode,\n TNodeType.AnyRNode | TNodeType.AnyContainer | TNodeType.Projection | TNodeType.Icu);\n const rawSlotValue = lView[tNode.index];\n const tNodeType = tNode.type;\n if (isProjection) {\n if (action === WalkTNodeTreeAction.Create) {\n rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n tNode.flags |= TNodeFlags.isProjected;\n }\n }\n if ((tNode.flags & TNodeFlags.isDetached) !== TNodeFlags.isDetached) {\n if (tNodeType & TNodeType.ElementContainer) {\n applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n } else if (tNodeType & TNodeType.Icu) {\n const nextRNode = icuContainerIterate(tNode as TIcuContainerNode, lView);\n let rNode: RNode|null;\n while (rNode = nextRNode()) {\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n } else if (tNodeType & TNodeType.Projection) {\n applyProjectionRecursive(\n renderer, action, lView, tNode as TProjectionNode, parentRElement, beforeNode);\n } else {\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyRNode | TNodeType.Container);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n}\n\n\n/**\n * `applyView` performs operation on the view as specified in `action` (insert, detach, destroy)\n *\n * Inserting a view without projection or containers at top level is simple. Just iterate over the\n * root nodes of the View, and for each node perform the `action`.\n *\n * Things get more complicated with containers and projections. That is because coming across:\n * - Container: implies that we have to insert/remove/destroy the views of that container as well\n * which in turn can have their own Containers at the View roots.\n * - Projection: implies that we have to insert/remove/destroy the nodes of the projection. The\n * complication is that the nodes we are projecting can themselves have Containers\n * or other Projections.\n *\n * As you can see this is a very recursive problem. Yes recursion is not most efficient but the\n * code is complicated enough that trying to implemented with recursion becomes unmaintainable.\n *\n * @param tView The `TView' which needs to be inserted, detached, destroyed\n * @param lView The LView which needs to be inserted, detached, destroyed.\n * @param renderer Renderer to use\n * @param action action to perform (insert, detach, destroy)\n * @param parentRElement parent DOM element for insertion (Removal does not need it).\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyView(\n tView: TView, lView: LView, renderer: Renderer, action: WalkTNodeTreeAction.Destroy,\n parentRElement: null, beforeNode: null): void;\nfunction applyView(\n tView: TView, lView: LView, renderer: Renderer, action: WalkTNodeTreeAction,\n parentRElement: RElement|null, beforeNode: RNode|null): void;\nfunction applyView(\n tView: TView, lView: LView, renderer: Renderer, action: WalkTNodeTreeAction,\n parentRElement: RElement|null, beforeNode: RNode|null): void {\n applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n}\n\n/**\n * `applyProjection` performs operation on the projection.\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed\n * @param lView The `LView` which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n */\nexport function applyProjection(tView: TView, lView: LView, tProjectionNode: TProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST]!;\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(\n renderer, WalkTNodeTreeAction.Create, lView, tProjectionNode, parentRNode, beforeNode);\n}\n\n/**\n * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,\n * detach, destroy)\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param renderer Render to use\n * @param action action to perform (insert, detach, destroy)\n * @param lView The LView which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyProjectionRecursive(\n renderer: Renderer, action: WalkTNodeTreeAction, lView: LView, tProjectionNode: TProjectionNode,\n parentRElement: RElement|null, beforeNode: RNode|null) {\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n const componentNode = componentLView[T_HOST] as TElementNode;\n ngDevMode &&\n assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n const nodeToProjectOrRNodes = componentNode.projection![tProjectionNode.projection]!;\n if (Array.isArray(nodeToProjectOrRNodes)) {\n // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we\n // need to support passing projectable nodes, so we cheat and put them in the TNode\n // of the Host TView. (Yes we put instance info at the T Level). We can get away with it\n // because we know that that TView is not shared and therefore it will not be a problem.\n // This should be refactored and cleaned up.\n for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {\n const rNode = nodeToProjectOrRNodes[i];\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n } else {\n let nodeToProject: TNode|null = nodeToProjectOrRNodes;\n const projectedComponentLView = componentLView[PARENT] as LView;\n applyNodes(\n renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n }\n}\n\n\n/**\n * `applyContainer` performs an operation on the container and its views as specified by\n * `action` (insert, detach, destroy)\n *\n * Inserting a Container is complicated by the fact that the container may have Views which\n * themselves have containers or projections.\n *\n * @param renderer Renderer to use\n * @param action action to perform (insert, detach, destroy)\n * @param lContainer The LContainer which needs to be inserted, detached, destroyed.\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyContainer(\n renderer: Renderer, action: WalkTNodeTreeAction, lContainer: LContainer,\n parentRElement: RElement|null, beforeNode: RNode|null|undefined) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i] as LView;\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}\n\n/**\n * Writes class/style to element.\n *\n * @param renderer Renderer to use.\n * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)\n * @param rNode The Node to write to.\n * @param prop Property to write to. This would be the class/style name.\n * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add\n * otherwise).\n */\nexport function applyStyling(\n renderer: Renderer, isClassBased: boolean, rNode: RElement, prop: string, value: any) {\n if (isClassBased) {\n // We actually want JS true/false here because any truthy value should add the class\n if (!value) {\n ngDevMode && ngDevMode.rendererRemoveClass++;\n renderer.removeClass(rNode, prop);\n } else {\n ngDevMode && ngDevMode.rendererAddClass++;\n renderer.addClass(rNode, prop);\n }\n } else {\n let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase as number;\n if (value == null /** || value === undefined */) {\n ngDevMode && ngDevMode.rendererRemoveStyle++;\n renderer.removeStyle(rNode, prop, flags);\n } else {\n // A value is important if it ends with `!important`. The style\n // parser strips any semicolons at the end of the value.\n const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n\n if (isImportant) {\n // !important has to be stripped from the value for it to be valid.\n value = value.slice(0, -10);\n flags! |= RendererStyleFlags2.Important;\n }\n\n ngDevMode && ngDevMode.rendererSetStyle++;\n renderer.setStyle(rNode, prop, value, flags);\n }\n }\n}\n\n\n/**\n * Write `cssText` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nexport function writeDirectStyle(renderer: Renderer, element: RElement, newValue: string) {\n ngDevMode && assertString(newValue, '\\'newValue\\' should be a string');\n renderer.setAttribute(element, 'style', newValue);\n ngDevMode && ngDevMode.rendererSetStyle++;\n}\n\n/**\n * Write `className` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nexport function writeDirectClass(renderer: Renderer, element: RElement, newValue: string) {\n ngDevMode && assertString(newValue, '\\'newValue\\' should be a string');\n if (newValue === '') {\n // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.\n renderer.removeAttribute(element, 'class');\n } else {\n renderer.setAttribute(element, 'class', newValue);\n }\n ngDevMode && ngDevMode.rendererSetClassName++;\n}\n\n/** Sets up the static DOM attributes on an `RNode`. */\nexport function setupStaticAttributes(renderer: Renderer, element: RElement, tNode: TNode) {\n const {mergedAttrs, classes, styles} = tNode;\n\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, element, mergedAttrs);\n }\n\n if (classes !== null) {\n writeDirectClass(renderer, element, classes);\n }\n\n if (styles !== null) {\n writeDirectStyle(renderer, element, styles);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular. It lazily constructs the Trusted Types policy, providing helper\n * utilities for promoting strings to Trusted Types. When Trusted Types are not\n * available, strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n\nimport {global} from '../global';\nimport {TrustedHTML, TrustedScript, TrustedScriptURL, TrustedTypePolicy, TrustedTypePolicyFactory} from './trusted_type_defs';\n\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy|null|undefined;\n\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy(): TrustedTypePolicy|null {\n if (policy === undefined) {\n policy = null;\n if (global.trustedTypes) {\n try {\n policy = (global.trustedTypes as TrustedTypePolicyFactory).createPolicy('angular', {\n createHTML: (s: string) => s,\n createScript: (s: string) => s,\n createScriptURL: (s: string) => s,\n });\n } catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy;\n}\n\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will be interpreted as HTML by a browser, e.g. when assigning to\n * element.innerHTML.\n */\nexport function trustedHTMLFromString(html: string): TrustedHTML|string {\n return getPolicy()?.createHTML(html) || html;\n}\n\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security In particular, it must be assured that the provided string will\n * never cause an XSS vulnerability if used in a context that will be\n * interpreted and executed as a script by a browser, e.g. when calling eval.\n */\nexport function trustedScriptFromString(script: string): TrustedScript|string {\n return getPolicy()?.createScript(script) || script;\n}\n\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will cause a browser to load and execute a resource, e.g. when\n * assigning to script.src.\n */\nexport function trustedScriptURLFromString(url: string): TrustedScriptURL|string {\n return getPolicy()?.createScriptURL(url) || url;\n}\n\n/**\n * Unsafely call the Function constructor with the given string arguments. It\n * is only available in development mode, and should be stripped out of\n * production code.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only called from development code, as use in production code can lead to\n * XSS vulnerabilities.\n */\nexport function newTrustedFunctionForDev(...args: string[]): Function {\n if (typeof ngDevMode === 'undefined') {\n throw new Error('newTrustedFunctionForDev should never be called in production');\n }\n if (!global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args[args.length - 1];\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = global['eval'](trustedScriptFromString(body) as string) as Function;\n if (fn.bind === undefined) {\n // Workaround for a browser bug that only exists in Chrome 83, where passing\n // a TrustedScript to eval just returns the TrustedScript back without\n // evaluating it. In that case, fall back to the most straightforward\n // implementation:\n return new Function(...args);\n }\n\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(global);\n\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n * inject the `DOCUMENT` token and are done.\n *\n * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n * way.\n *\n * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n * Wherever ivy needs the global document, it calls `getDocument()` instead.\n *\n * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n * tell ivy what the global `document` is.\n *\n * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)\n * by calling `setDocument()` when providing the `DOCUMENT` token.\n */\nlet DOCUMENT: Document|undefined = undefined;\n\n/**\n * Tell ivy what the `document` is for this platform.\n *\n * It is only necessary to call this if the current platform is not a browser.\n *\n * @param document The object representing the global `document` in this environment.\n */\nexport function setDocument(document: Document|undefined): void {\n DOCUMENT = document;\n}\n\n/**\n * Access the object that represents the `document` for this platform.\n *\n * Ivy calls this whenever it needs to access the `document` object.\n * For example to create the renderer or to do sanitization.\n */\nexport function getDocument(): Document {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n } else if (typeof document !== 'undefined') {\n return document;\n }\n // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n // the current platform is not a browser. Since this is not a supported scenario at the moment\n // this should not happen in Angular apps.\n // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n // public API. Meanwhile we just return `undefined` and let the application fail.\n return undefined!;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular specifically for bypassSecurityTrust* and custom sanitizers. It\n * lazily constructs the Trusted Types policy, providing helper utilities for\n * promoting strings to Trusted Types. When Trusted Types are not available,\n * strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n\nimport {global} from '../global';\nimport {TrustedHTML, TrustedScript, TrustedScriptURL, TrustedTypePolicy, TrustedTypePolicyFactory} from './trusted_type_defs';\n\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy|null|undefined;\n\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy(): TrustedTypePolicy|null {\n if (policy === undefined) {\n policy = null;\n if (global.trustedTypes) {\n try {\n policy = (global.trustedTypes as TrustedTypePolicyFactory)\n .createPolicy('angular#unsafe-bypass', {\n createHTML: (s: string) => s,\n createScript: (s: string) => s,\n createScriptURL: (s: string) => s,\n });\n } catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy;\n}\n\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nexport function trustedHTMLFromStringBypass(html: string): TrustedHTML|string {\n return getPolicy()?.createHTML(html) || html;\n}\n\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nexport function trustedScriptFromStringBypass(script: string): TrustedScript|string {\n return getPolicy()?.createScript(script) || script;\n}\n\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nexport function trustedScriptURLFromStringBypass(url: string): TrustedScriptURL|string {\n return getPolicy()?.createScriptURL(url) || url;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {XSS_SECURITY_URL} from '../error_details_base_url';\n\nexport const enum BypassType {\n Url = 'URL',\n Html = 'HTML',\n ResourceUrl = 'ResourceURL',\n Script = 'Script',\n Style = 'Style',\n}\n\n/**\n * Marker interface for a value that's safe to use in a particular context.\n *\n * @publicApi\n */\nexport interface SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as HTML.\n *\n * @publicApi\n */\nexport interface SafeHtml extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as style (CSS).\n *\n * @publicApi\n */\nexport interface SafeStyle extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as JavaScript.\n *\n * @publicApi\n */\nexport interface SafeScript extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as a URL linking to a document.\n *\n * @publicApi\n */\nexport interface SafeUrl extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as a URL to load executable code from.\n *\n * @publicApi\n */\nexport interface SafeResourceUrl extends SafeValue {}\n\n\nabstract class SafeValueImpl implements SafeValue {\n constructor(public changingThisBreaksApplicationSecurity: string) {}\n\n abstract getTypeName(): string;\n\n toString() {\n return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +\n ` (see ${XSS_SECURITY_URL})`;\n }\n}\n\nclass SafeHtmlImpl extends SafeValueImpl implements SafeHtml {\n override getTypeName() {\n return BypassType.Html;\n }\n}\nclass SafeStyleImpl extends SafeValueImpl implements SafeStyle {\n override getTypeName() {\n return BypassType.Style;\n }\n}\nclass SafeScriptImpl extends SafeValueImpl implements SafeScript {\n override getTypeName() {\n return BypassType.Script;\n }\n}\nclass SafeUrlImpl extends SafeValueImpl implements SafeUrl {\n override getTypeName() {\n return BypassType.Url;\n }\n}\nclass SafeResourceUrlImpl extends SafeValueImpl implements SafeResourceUrl {\n override getTypeName() {\n return BypassType.ResourceUrl;\n }\n}\n\nexport function unwrapSafeValue(value: SafeValue): string;\nexport function unwrapSafeValue<T>(value: T): T;\nexport function unwrapSafeValue<T>(value: T|SafeValue): T {\n return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity as any as T :\n value as any as T;\n}\n\n\nexport function allowSanitizationBypassAndThrow(\n value: any, type: BypassType.Html): value is SafeHtml;\nexport function allowSanitizationBypassAndThrow(\n value: any, type: BypassType.ResourceUrl): value is SafeResourceUrl;\nexport function allowSanitizationBypassAndThrow(\n value: any, type: BypassType.Script): value is SafeScript;\nexport function allowSanitizationBypassAndThrow(\n value: any, type: BypassType.Style): value is SafeStyle;\nexport function allowSanitizationBypassAndThrow(value: any, type: BypassType.Url): value is SafeUrl;\nexport function allowSanitizationBypassAndThrow(value: any, type: BypassType): boolean;\nexport function allowSanitizationBypassAndThrow(value: any, type: BypassType): boolean {\n const actualType = getSanitizationBypassType(value);\n if (actualType != null && actualType !== type) {\n // Allow ResourceURLs in URL contexts, they are strictly more trusted.\n if (actualType === BypassType.ResourceUrl && type === BypassType.Url) return true;\n throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);\n }\n return actualType === type;\n}\n\nexport function getSanitizationBypassType(value: any): BypassType|null {\n return value instanceof SafeValueImpl && value.getTypeName() as BypassType || null;\n}\n\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustHtml(trustedHtml: string): SafeHtml {\n return new SafeHtmlImpl(trustedHtml);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` hich has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustStyle(trustedStyle: string): SafeStyle {\n return new SafeStyleImpl(trustedStyle);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustScript(trustedScript: string): SafeScript {\n return new SafeScriptImpl(trustedScript);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustUrl(trustedUrl: string): SafeUrl {\n return new SafeUrlImpl(trustedUrl);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string): SafeResourceUrl {\n return new SafeResourceUrlImpl(trustedResourceUrl);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {trustedHTMLFromString} from '../util/security/trusted_types';\n\n/**\n * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we use one of two strategies for doing this.\n * Default: DOMParser strategy\n * Fallback: InertDocument strategy\n */\nexport function getInertBodyHelper(defaultDoc: Document): InertBodyHelper {\n const inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n}\n\nexport interface InertBodyHelper {\n /**\n * Get an inert DOM element containing DOM created from the dirty HTML string provided.\n */\n getInertBodyElement: (html: string) => HTMLElement | null;\n}\n\n/**\n * Uses DOMParser to create and fill an inert body element.\n * This is the default strategy used in browsers that support it.\n */\nclass DOMParserHelper implements InertBodyHelper {\n constructor(private inertDocumentHelper: InertBodyHelper) {}\n\n getInertBodyElement(html: string): HTMLElement|null {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags\n // in `html` from consuming the otherwise explicit `</body>` tag.\n html = '<body><remove></remove>' + html;\n try {\n const body = new window.DOMParser()\n .parseFromString(trustedHTMLFromString(html) as string, 'text/html')\n .body as HTMLBodyElement;\n if (body === null) {\n // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only\n // becomes available in the following tick of the JS engine. In that case we fall back to\n // the `inertDocumentHelper` instead.\n return this.inertDocumentHelper.getInertBodyElement(html);\n }\n body.removeChild(body.firstChild!);\n return body;\n } catch {\n return null;\n }\n }\n}\n\n/**\n * Use an HTML5 `template` element to create and fill an inert DOM element.\n * This is the fallback strategy if the browser does not support DOMParser.\n */\nclass InertDocumentHelper implements InertBodyHelper {\n private inertDocument: Document;\n\n constructor(private defaultDoc: Document) {\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n }\n\n getInertBodyElement(html: string): HTMLElement|null {\n const templateEl = this.inertDocument.createElement('template');\n templateEl.innerHTML = trustedHTMLFromString(html) as string;\n return templateEl;\n }\n}\n\n/**\n * We need to determine whether the DOMParser exists in the global context and\n * supports parsing HTML; HTML parsing support is not as wide as other formats, see\n * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.\n *\n * @suppress {uselessCode}\n */\nexport function isDOMParserAvailable() {\n try {\n return !!new window.DOMParser().parseFromString(\n trustedHTMLFromString('') as string, 'text/html');\n } catch {\n return false;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {XSS_SECURITY_URL} from '../error_details_base_url';\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either an allowed protocol (http, https, mailto or ftp).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"http\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo<bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript:...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|data|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;\n\nexport function _sanitizeUrl(url: string): string {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN)) return url;\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);\n }\n\n return 'unsafe:' + url;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {XSS_SECURITY_URL} from '../error_details_base_url';\nimport {TrustedHTML} from '../util/security/trusted_type_defs';\nimport {trustedHTMLFromString} from '../util/security/trusted_types';\n\nimport {getInertBodyHelper, InertBodyHelper} from './inert_body';\nimport {_sanitizeUrl} from './url_sanitizer';\n\nfunction tagSet(tags: string): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\n\nfunction merge(...sets: {[k: string]: boolean}[]): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v)) res[v] = true;\n }\n }\n return res;\n}\n\n// Good source of info about elements and attributes\n// https://html.spec.whatwg.org/#semantics\n// https://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// https://html.spec.whatwg.org/#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// https://html.spec.whatwg.org/#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS =\n merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(\n OPTIONAL_END_TAG_BLOCK_ELEMENTS,\n tagSet(\n 'address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(\n OPTIONAL_END_TAG_INLINE_ELEMENTS,\n tagSet(\n 'a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\n\nexport const VALID_ELEMENTS =\n merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n\n// Attributes that have href and hence need to be sanitized\nexport const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n\nconst HTML_ATTRS = tagSet(\n 'abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n\n// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)\nconst ARIA_ATTRS = tagSet(\n 'aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +\n 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +\n 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +\n 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +\n 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +\n 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +\n 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');\n\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\n\nexport const VALID_ATTRS = merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);\n\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n public sanitizedSomething = false;\n private buf: string[] = [];\n\n sanitizeChildren(el: Element): string {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current: Node = el.firstChild!;\n let traverseContent = true;\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current as Element);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue!);\n } else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n current = current.firstChild!;\n continue;\n }\n while (current) {\n // Leaving the element. Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current as Element);\n }\n\n let next = this.checkClobberedElement(current, current.nextSibling!);\n\n if (next) {\n current = next;\n break;\n }\n\n current = this.checkClobberedElement(current, current.parentNode!);\n }\n }\n return this.buf.join('');\n }\n\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n private startElement(element: Element): boolean {\n const tagName = element.nodeName.toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr!.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr!.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n\n private endElement(current: Element) {\n const tagName = current.nodeName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n\n private chars(chars: string) {\n this.buf.push(encodeEntities(chars));\n }\n\n checkClobberedElement(node: Node, nextNode: Node): Node {\n if (nextNode &&\n (node.compareDocumentPosition(nextNode) &\n Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {\n throw new Error(`Failed to sanitize html because the element is clobbered: ${\n (node as Element).outerHTML}`);\n }\n return nextNode;\n }\n}\n\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value: string) {\n return value.replace(/&/g, '&')\n .replace(\n SURROGATE_PAIR_REGEXP,\n function(match: string) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n })\n .replace(\n NON_ALPHANUMERIC_REGEXP,\n function(match: string) {\n return '&#' + match.charCodeAt(0) + ';';\n })\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n\nlet inertBodyHelper: InertBodyHelper;\n\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nexport function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): TrustedHTML|string {\n let inertBodyElement: HTMLElement|null = null;\n try {\n inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement!.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(\n getTemplateContent(inertBodyElement!) as Element || inertBodyElement);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);\n }\n\n return trustedHTMLFromString(safeHtml);\n } finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }\n }\n}\n\nexport function getTemplateContent(el: Node): Node|null {\n return 'content' in (el as any /** Microsoft/TypeScript#21517 */) && isTemplateElement(el) ?\n el.content :\n null;\n}\nfunction isTemplateElement(el: Node): el is HTMLTemplateElement {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {XSS_SECURITY_URL} from '../error_details_base_url';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {getDocument} from '../render3/interfaces/document';\nimport {SANITIZER} from '../render3/interfaces/view';\nimport {getLView} from '../render3/state';\nimport {renderStringify} from '../render3/util/stringify_utils';\nimport {TrustedHTML, TrustedScript, TrustedScriptURL} from '../util/security/trusted_type_defs';\nimport {trustedHTMLFromString, trustedScriptURLFromString} from '../util/security/trusted_types';\nimport {trustedHTMLFromStringBypass, trustedScriptFromStringBypass, trustedScriptURLFromStringBypass} from '../util/security/trusted_types_bypass';\n\nimport {allowSanitizationBypassAndThrow, BypassType, unwrapSafeValue} from './bypass';\nimport {_sanitizeHtml as _sanitizeHtml} from './html_sanitizer';\nimport {Sanitizer} from './sanitizer';\nimport {SecurityContext} from './security';\nimport {_sanitizeUrl as _sanitizeUrl} from './url_sanitizer';\n\n\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n *\n * @codeGenApi\n */\nexport function ɵɵsanitizeHtml(unsafeHtml: any): TrustedHTML|string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeHtml, BypassType.Html)) {\n return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n }\n return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n}\n\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties.\n *\n * @codeGenApi\n */\nexport function ɵɵsanitizeStyle(unsafeStyle: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeStyle, BypassType.Style)) {\n return unwrapSafeValue(unsafeStyle);\n }\n return renderStringify(unsafeStyle);\n}\n\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n *\n * @codeGenApi\n */\nexport function ɵɵsanitizeUrl(unsafeUrl: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeUrl, BypassType.Url)) {\n return unwrapSafeValue(unsafeUrl);\n }\n return _sanitizeUrl(renderStringify(unsafeUrl));\n}\n\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n *\n * @codeGenApi\n */\nexport function ɵɵsanitizeResourceUrl(unsafeResourceUrl: any): TrustedScriptURL|string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptURLFromStringBypass(\n sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeResourceUrl, BypassType.ResourceUrl)) {\n return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n }\n throw new RuntimeError(\n RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL,\n ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n}\n\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n *\n * @codeGenApi\n */\nexport function ɵɵsanitizeScript(unsafeScript: any): TrustedScript|string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptFromStringBypass(\n sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeScript, BypassType.Script)) {\n return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n }\n throw new RuntimeError(\n RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT,\n ngDevMode && 'unsafe value used in a script context');\n}\n\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedHTML. Interpolation is explicitly not allowed.\n *\n * @param html constant template literal containing trusted HTML.\n * @returns TrustedHTML wrapping `html`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedHTML.\n *\n * @codeGenApi\n */\nexport function ɵɵtrustConstantHtml(html: TemplateStringsArray): TrustedHTML|string {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation\n // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray\n // is an array with a `raw` property that is also an array. The associated\n // template literal has no interpolation if and only if the length of the\n // TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);\n }\n return trustedHTMLFromString(html[0]);\n}\n\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedScriptURL. Interpolation is explicitly not allowed.\n *\n * @param url constant template literal containing a trusted script URL.\n * @returns TrustedScriptURL wrapping `url`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedScriptURL.\n *\n * @codeGenApi\n */\nexport function ɵɵtrustConstantResourceUrl(url: TemplateStringsArray): TrustedScriptURL|string {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any\n // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A\n // TemplateStringsArray is an array with a `raw` property that is also an\n // array. The associated template literal has no interpolation if and only if\n // the length of the TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);\n }\n return trustedScriptURLFromString(url[0]);\n}\n\n/**\n * Detects which sanitizer to use for URL property, based on tag name and prop name.\n *\n * The rules are based on the RESOURCE_URL context config from\n * `packages/compiler/src/schema/dom_security_schema.ts`.\n * If tag and prop names don't match Resource URL schema, use URL sanitizer.\n */\nexport function getUrlSanitizer(tag: string, prop: string) {\n if ((prop === 'src' &&\n (tag === 'embed' || tag === 'frame' || tag === 'iframe' || tag === 'media' ||\n tag === 'script')) ||\n (prop === 'href' && (tag === 'base' || tag === 'link'))) {\n return ɵɵsanitizeResourceUrl;\n }\n return ɵɵsanitizeUrl;\n}\n\n/**\n * Sanitizes URL, selecting sanitizer function based on tag and property names.\n *\n * This function is used in case we can't define security context at compile time, when only prop\n * name is available. This happens when we generate host bindings for Directives/Components. The\n * host element is unknown at compile time, so we defer calculation of specific sanitizer to\n * runtime.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @param tag target element tag name.\n * @param prop name of the property that contains the value.\n * @returns `url` string which is safe to bind.\n *\n * @codeGenApi\n */\nexport function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any {\n return getUrlSanitizer(tag, prop)(unsafeUrl);\n}\n\nexport function validateAgainstEventProperties(name: string) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage =\n `Binding to event property '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...` +\n `\\nIf '${name}' is a directive input, make sure the directive is imported by the` +\n ` current module.`;\n throw new RuntimeError(RuntimeErrorCode.INVALID_EVENT_BINDING, errorMessage);\n }\n}\n\nexport function validateAgainstEventAttributes(name: string) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage =\n `Binding to event attribute '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...`;\n throw new RuntimeError(RuntimeErrorCode.INVALID_EVENT_BINDING, errorMessage);\n }\n}\n\nfunction getSanitizer(): Sanitizer|null {\n const lView = getLView();\n return lView && lView[SANITIZER];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './injection_token';\n\n/**\n * A multi-provider token for initialization functions that will run upon construction of an\n * environment injector.\n *\n * @publicApi\n */\nexport const ENVIRONMENT_INITIALIZER = new InjectionToken<() => void>('ENVIRONMENT_INITIALIZER');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './injection_token';\nimport {Injector} from './injector';\nimport {InjectorMarkers} from './injector_marker';\n\n\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @publicApi\n */\nexport const INJECTOR = new InjectionToken<Injector>(\n 'INJECTOR',\n // Disable tslint because this is const enum which gets inlined not top level prop access.\n // tslint:disable-next-line: no-toplevel-property-access\n InjectorMarkers.Injector as any, // Special value used by Ivy to identify `Injector`.\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\n\nimport {InjectionToken} from './injection_token';\n\nexport const INJECTOR_DEF_TYPES = new InjectionToken<Type<unknown>>('INJECTOR_DEF_TYPES');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {stringify} from '../util/stringify';\nimport {Injector} from './injector';\nimport {THROW_IF_NOT_FOUND} from './injector_compatibility';\n\nexport class NullInjector implements Injector {\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n if (notFoundValue === THROW_IF_NOT_FOUND) {\n const error = new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n error.name = 'NullInjectorError';\n throw error;\n }\n return notFoundValue;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {Type} from '../interface/type';\nimport {getComponentDef} from '../render3/definition';\nimport {getFactoryDef} from '../render3/definition_factory';\nimport {throwCyclicDependencyError, throwInvalidProviderError} from '../render3/errors_di';\nimport {stringifyForError} from '../render3/util/stringify_utils';\nimport {deepForEach} from '../util/array_utils';\nimport {EMPTY_ARRAY} from '../util/empty';\nimport {getClosureSafeProperty} from '../util/property';\nimport {stringify} from '../util/stringify';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {ENVIRONMENT_INITIALIZER} from './initializer_token';\nimport {ɵɵinject as inject} from './injector_compatibility';\nimport {getInjectorDef, InjectorType, InjectorTypeWithProviders} from './interface/defs';\nimport {ClassProvider, ConstructorProvider, EnvironmentProviders, ExistingProvider, FactoryProvider, ImportedNgModuleProviders, InternalEnvironmentProviders, isEnvironmentProviders, ModuleWithProviders, Provider, StaticClassProvider, TypeProvider, ValueProvider} from './interface/provider';\nimport {INJECTOR_DEF_TYPES} from './internal_tokens';\n\n/**\n * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally\n * referenced in `@Component in a component injector.\n */\nexport function makeEnvironmentProviders(providers: (Provider|EnvironmentProviders)[]):\n EnvironmentProviders {\n return {\n ɵproviders: providers,\n } as unknown as EnvironmentProviders;\n}\n\n/**\n * A source of providers for the `importProvidersFrom` function.\n *\n * @publicApi\n */\nexport type ImportProvidersSource =\n Type<unknown>|ModuleWithProviders<unknown>|Array<ImportProvidersSource>;\n\n/**\n * Collects providers from all NgModules and standalone components, including transitively imported\n * ones.\n *\n * Providers extracted via `importProvidersFrom` are only usable in an application injector or\n * another environment injector (such as a route injector). They should not be used in component\n * providers.\n *\n * More information about standalone components can be found in [this\n * guide](guide/standalone-components).\n *\n * @usageNotes\n * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:\n *\n * ```typescript\n * await bootstrapApplication(RootComponent, {\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ]\n * });\n * ```\n *\n * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a\n * standalone component is used:\n *\n * ```typescript\n * export const ROUTES: Route[] = [\n * {\n * path: 'foo',\n * providers: [\n * importProvidersFrom(NgModuleOne, NgModuleTwo)\n * ],\n * component: YourStandaloneComponent\n * }\n * ];\n * ```\n *\n * @returns Collected providers from the specified list of types.\n * @publicApi\n */\nexport function importProvidersFrom(...sources: ImportProvidersSource[]): EnvironmentProviders {\n return {\n ɵproviders: internalImportProvidersFrom(true, sources),\n ɵfromNgModule: true,\n } as InternalEnvironmentProviders;\n}\n\nexport function internalImportProvidersFrom(\n checkForStandaloneCmp: boolean, ...sources: ImportProvidersSource[]): Provider[] {\n const providersOut: SingleProvider[] = [];\n const dedup = new Set<Type<unknown>>(); // already seen types\n let injectorTypesWithProviders: InjectorTypeWithProviders<unknown>[]|undefined;\n deepForEach(sources, source => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && checkForStandaloneCmp) {\n const cmpDef = getComponentDef(source);\n if (cmpDef?.standalone) {\n throw new RuntimeError(\n RuntimeErrorCode.IMPORT_PROVIDERS_FROM_STANDALONE,\n `Importing providers supports NgModule or ModuleWithProviders but got a standalone component \"${\n stringifyForError(source)}\"`);\n }\n }\n\n // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.\n const internalSource = source as Type<unknown>| InjectorTypeWithProviders<unknown>;\n if (walkProviderTree(internalSource, providersOut, [], dedup)) {\n injectorTypesWithProviders ||= [];\n injectorTypesWithProviders.push(internalSource);\n }\n });\n // Collect all providers from `ModuleWithProviders` types.\n if (injectorTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(injectorTypesWithProviders, providersOut);\n }\n\n return providersOut;\n}\n\n/**\n * Collects all providers from the list of `ModuleWithProviders` and appends them to the provided\n * array.\n */\nfunction processInjectorTypesWithProviders(\n typesWithProviders: InjectorTypeWithProviders<unknown>[], providersOut: Provider[]): void {\n for (let i = 0; i < typesWithProviders.length; i++) {\n const {ngModule, providers} = typesWithProviders[i];\n deepForEachProvider(providers! as Array<Provider|InternalEnvironmentProviders>, provider => {\n ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);\n providersOut.push(provider);\n });\n }\n}\n\n/**\n * Internal type for a single provider in a deep provider array.\n */\nexport type SingleProvider = TypeProvider|ValueProvider|ClassProvider|ConstructorProvider|\n ExistingProvider|FactoryProvider|StaticClassProvider;\n\n/**\n * The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone\n * `ComponentType`, and all of its transitive providers and collects providers.\n *\n * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,\n * the function will return \"true\" to indicate that the providers of the type definition need\n * to be processed. This allows us to process providers of injector types after all imports of\n * an injector definition are processed. (following View Engine semantics: see FW-1349)\n */\nexport function walkProviderTree(\n container: Type<unknown>|InjectorTypeWithProviders<unknown>, providersOut: SingleProvider[],\n parents: Type<unknown>[],\n dedup: Set<Type<unknown>>): container is InjectorTypeWithProviders<unknown> {\n container = resolveForwardRef(container);\n if (!container) return false;\n\n // The actual type which had the definition. Usually `container`, but may be an unwrapped type\n // from `InjectorTypeWithProviders`.\n let defType: Type<unknown>|null = null;\n\n let injDef = getInjectorDef(container);\n const cmpDef = !injDef && getComponentDef(container);\n if (!injDef && !cmpDef) {\n // `container` is not an injector type or a component type. It might be:\n // * An `InjectorTypeWithProviders` that wraps an injector type.\n // * A standalone directive or pipe that got pulled in from a standalone component's\n // dependencies.\n // Try to unwrap it as an `InjectorTypeWithProviders` first.\n const ngModule: Type<unknown>|undefined =\n (container as InjectorTypeWithProviders<any>).ngModule as Type<unknown>| undefined;\n injDef = getInjectorDef(ngModule);\n if (injDef) {\n defType = ngModule!;\n } else {\n // Not a component or injector type, so ignore it.\n return false;\n }\n } else if (cmpDef && !cmpDef.standalone) {\n return false;\n } else {\n defType = container as Type<unknown>;\n }\n\n // Check for circular dependencies.\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n const path = parents.map(stringify);\n throwCyclicDependencyError(defName, path);\n }\n\n // Check for multiple imports of the same module\n const isDuplicate = dedup.has(defType);\n\n if (cmpDef) {\n if (isDuplicate) {\n // This component definition has already been processed.\n return false;\n }\n dedup.add(defType);\n\n if (cmpDef.dependencies) {\n const deps =\n typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;\n for (const dep of deps) {\n walkProviderTree(dep, providersOut, parents, dedup);\n }\n }\n } else if (injDef) {\n // First, include providers from any imports.\n if (injDef.imports != null && !isDuplicate) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n ngDevMode && parents.push(defType);\n // Add it to the set of dedups. This way we can detect multiple imports of the same module\n dedup.add(defType);\n\n let importTypesWithProviders: (InjectorTypeWithProviders<any>[])|undefined;\n try {\n deepForEach(injDef.imports, imported => {\n if (walkProviderTree(imported, providersOut, parents, dedup)) {\n importTypesWithProviders ||= [];\n // If the processed import is an injector type with providers, we store it in the\n // list of import types with providers, so that we can process those afterwards.\n importTypesWithProviders.push(imported);\n }\n });\n } finally {\n // Remove it from the parents set when finished.\n ngDevMode && parents.pop();\n }\n\n // Imports which are declared with providers (TypeWithProviders) need to be processed\n // after all imported modules are processed. This is similar to how View Engine\n // processes/merges module imports in the metadata resolver. See: FW-1349.\n if (importTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(importTypesWithProviders, providersOut);\n }\n }\n\n if (!isDuplicate) {\n // Track the InjectorType and add a provider for it.\n // It's important that this is done after the def's imports.\n const factory = getFactoryDef(defType) || (() => new defType!());\n\n // Append extra providers to make more info available for consumers (to retrieve an injector\n // type), as well as internally (to calculate an injection scope correctly and eagerly\n // instantiate a `defType` when an injector is created).\n providersOut.push(\n // Provider to create `defType` using its factory.\n {provide: defType, useFactory: factory, deps: EMPTY_ARRAY},\n\n // Make this `defType` available to an internal logic that calculates injector scope.\n {provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true},\n\n // Provider to eagerly instantiate `defType` via `ENVIRONMENT_INITIALIZER`.\n {provide: ENVIRONMENT_INITIALIZER, useValue: () => inject(defType!), multi: true} //\n );\n }\n\n // Next, include providers listed on the definition itself.\n const defProviders = injDef.providers as Array<SingleProvider|InternalEnvironmentProviders>;\n if (defProviders != null && !isDuplicate) {\n const injectorType = container as InjectorType<any>;\n deepForEachProvider(defProviders, provider => {\n ngDevMode && validateProvider(provider as SingleProvider, defProviders, injectorType);\n providersOut.push(provider as SingleProvider);\n });\n }\n } else {\n // Should not happen, but just in case.\n return false;\n }\n\n return (\n defType !== container &&\n (container as InjectorTypeWithProviders<any>).providers !== undefined);\n}\n\nfunction validateProvider(\n provider: SingleProvider, providers: Array<SingleProvider|InternalEnvironmentProviders>,\n containerType: Type<unknown>): void {\n if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) ||\n isExistingProvider(provider)) {\n return;\n }\n\n // Here we expect the provider to be a `useClass` provider (by elimination).\n const classRef = resolveForwardRef(\n provider && ((provider as StaticClassProvider | ClassProvider).useClass || provider.provide));\n if (!classRef) {\n throwInvalidProviderError(containerType, providers, provider);\n }\n}\n\nfunction deepForEachProvider(\n providers: Array<Provider|InternalEnvironmentProviders>,\n fn: (provider: SingleProvider) => void): void {\n for (let provider of providers) {\n if (isEnvironmentProviders(provider)) {\n provider = provider.ɵproviders;\n }\n if (Array.isArray(provider)) {\n deepForEachProvider(provider, fn);\n } else {\n fn(provider);\n }\n }\n}\n\nexport const USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\n\nexport function isValueProvider(value: SingleProvider): value is ValueProvider {\n return value !== null && typeof value == 'object' && USE_VALUE in value;\n}\n\nexport function isExistingProvider(value: SingleProvider): value is ExistingProvider {\n return !!(value && (value as ExistingProvider).useExisting);\n}\n\nexport function isFactoryProvider(value: SingleProvider): value is FactoryProvider {\n return !!(value && (value as FactoryProvider).useFactory);\n}\n\nexport function isTypeProvider(value: SingleProvider): value is TypeProvider {\n return typeof value === 'function';\n}\n\nexport function isClassProvider(value: SingleProvider): value is ClassProvider {\n return !!(value as StaticClassProvider | ClassProvider).useClass;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './injection_token';\n\n\nexport type InjectorScope = 'root'|'platform'|'environment';\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nexport const INJECTOR_SCOPE = new InjectionToken<InjectorScope|null>('Set Injector scope.');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport '../util/ng_dev_mode';\n\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {OnDestroy} from '../interface/lifecycle_hooks';\nimport {Type} from '../interface/type';\nimport {getComponentDef} from '../render3/definition';\nimport {FactoryFn, getFactoryDef} from '../render3/definition_factory';\nimport {throwCyclicDependencyError, throwInvalidProviderError, throwMixedMultiProviderError} from '../render3/errors_di';\nimport {newArray} from '../util/array_utils';\nimport {EMPTY_ARRAY} from '../util/empty';\nimport {stringify} from '../util/stringify';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {ENVIRONMENT_INITIALIZER} from './initializer_token';\nimport {setInjectImplementation} from './inject_switch';\nimport {InjectionToken} from './injection_token';\nimport {Injector} from './injector';\nimport {catchInjectorError, convertToBitFlags, injectArgs, NG_TEMP_TOKEN_PATH, setCurrentInjector, THROW_IF_NOT_FOUND, ɵɵinject} from './injector_compatibility';\nimport {INJECTOR} from './injector_token';\nimport {getInheritedInjectableDef, getInjectableDef, InjectorType, ɵɵInjectableDeclaration} from './interface/defs';\nimport {InjectFlags, InjectOptions} from './interface/injector';\nimport {ClassProvider, ConstructorProvider, EnvironmentProviders, InternalEnvironmentProviders, isEnvironmentProviders, Provider, StaticClassProvider} from './interface/provider';\nimport {INJECTOR_DEF_TYPES} from './internal_tokens';\nimport {NullInjector} from './null_injector';\nimport {isExistingProvider, isFactoryProvider, isTypeProvider, isValueProvider, SingleProvider} from './provider_collection';\nimport {ProviderToken} from './provider_token';\nimport {INJECTOR_SCOPE, InjectorScope} from './scope';\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR: Injector|undefined = undefined;\n\nexport function getNullInjector(): Injector {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n\n/**\n * An entry in the injector which tracks information about the given token, including a possible\n * current value.\n */\ninterface Record<T> {\n factory: (() => T)|undefined;\n value: T|{};\n multi: any[]|undefined;\n}\n\n/**\n * An `Injector` that's part of the environment injector hierarchy, which exists outside of the\n * component tree.\n */\nexport abstract class EnvironmentInjector implements Injector {\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions&{\n optional?: false;\n }): T;\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue: null|undefined, options: InjectOptions): T\n |null;\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions): T;\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n * @deprecated use object-based flags (`InjectOptions`) instead.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n /**\n * @deprecated from v4.0.0 use ProviderToken<T>\n * @suppress {duplicate}\n */\n abstract get(token: any, notFoundValue?: any): any;\n\n /**\n * Runs the given function in the context of this `EnvironmentInjector`.\n *\n * Within the function's stack frame, `inject` can be used to inject dependencies from this\n * injector. Note that `inject` is only usable synchronously, and cannot be used in any\n * asynchronous callbacks or after any `await` points.\n *\n * @param fn the closure to be run in the context of this injector\n * @returns the return value of the function, if any\n */\n abstract runInContext<ReturnT>(fn: () => ReturnT): ReturnT;\n\n abstract destroy(): void;\n\n /**\n * @internal\n */\n abstract onDestroy(callback: () => void): void;\n}\n\nexport class R3Injector extends EnvironmentInjector {\n /**\n * Map of tokens to records which contain the instances of those tokens.\n * - `null` value implies that we don't have the record. Used by tree-shakable injectors\n * to prevent further searches.\n */\n private records = new Map<ProviderToken<any>, Record<any>|null>();\n\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n private _ngOnDestroyHooks = new Set<OnDestroy>();\n\n private _onDestroyHooks: Array<() => void> = [];\n\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n get destroyed(): boolean {\n return this._destroyed;\n }\n private _destroyed = false;\n\n private injectorDefTypes: Set<Type<unknown>>;\n\n constructor(\n providers: Array<Provider|EnvironmentProviders>, readonly parent: Injector,\n readonly source: string|null, readonly scopes: Set<InjectorScope>) {\n super();\n // Start off by creating Records for every provider.\n forEachSingleProvider(\n providers as Array<Provider|InternalEnvironmentProviders>,\n provider => this.processProvider(provider));\n\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR, makeRecord(undefined, this));\n\n // And `EnvironmentInjector` if the current injector is supposed to be env-scoped.\n if (scopes.has('environment')) {\n this.records.set(EnvironmentInjector, makeRecord(undefined, this));\n }\n\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n const record = this.records.get(INJECTOR_SCOPE) as Record<InjectorScope|null>;\n if (record != null && typeof record.value === 'string') {\n this.scopes.add(record.value as InjectorScope);\n }\n\n this.injectorDefTypes =\n new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, InjectFlags.Self));\n }\n\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n override destroy(): void {\n this.assertNotDestroyed();\n\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n for (const service of this._ngOnDestroyHooks) {\n service.ngOnDestroy();\n }\n for (const hook of this._onDestroyHooks) {\n hook();\n }\n } finally {\n // Release all references.\n this.records.clear();\n this._ngOnDestroyHooks.clear();\n this.injectorDefTypes.clear();\n this._onDestroyHooks.length = 0;\n }\n }\n\n override onDestroy(callback: () => void): void {\n this._onDestroyHooks.push(callback);\n }\n\n override runInContext<ReturnT>(fn: () => ReturnT): ReturnT {\n this.assertNotDestroyed();\n\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n return fn();\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n }\n }\n\n override get<T>(\n token: ProviderToken<T>, notFoundValue: any = THROW_IF_NOT_FOUND,\n flags: InjectFlags|InjectOptions = InjectFlags.Default): T {\n this.assertNotDestroyed();\n flags = convertToBitFlags(flags) as InjectFlags;\n\n // Set the injection context.\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record: Record<T>|undefined|null = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an injectable\n // def with a scope matching this injector.\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n // Found an injectable def and it's scoped to this injector. Pretend as if it was here\n // all along.\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n } else {\n record = null;\n }\n this.records.set(token, record);\n }\n // If a record was found, get the instance for it and return it.\n if (record != null /* NOT null || undefined */) {\n return this.hydrate(token, record);\n }\n }\n\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue\n // is undefined, the value is null, otherwise it's the notFoundValue.\n notFoundValue = (flags & InjectFlags.Optional) && notFoundValue === THROW_IF_NOT_FOUND ?\n null :\n notFoundValue;\n return nextInjector.get(token, notFoundValue);\n } catch (e: any) {\n if (e.name === 'NullInjectorError') {\n const path: any[] = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n path.unshift(stringify(token));\n if (previousInjector) {\n // We still have a parent injector, keep throwing\n throw e;\n } else {\n // Format & throw the final error message when we don't have any previous injector\n return catchInjectorError(e, token, 'R3InjectorError', this.source);\n }\n } else {\n throw e;\n }\n } finally {\n // Lastly, restore the previous injection context.\n setInjectImplementation(previousInjectImplementation);\n setCurrentInjector(previousInjector);\n }\n }\n\n /** @internal */\n resolveInjectorInitializers() {\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n const initializers = this.get(ENVIRONMENT_INITIALIZER.multi, EMPTY_ARRAY, InjectFlags.Self);\n if (ngDevMode && !Array.isArray(initializers)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_MULTI_PROVIDER,\n 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' +\n `(expected an array, but got ${typeof initializers}). ` +\n 'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' +\n '`multi: true` provider.');\n }\n for (const initializer of initializers) {\n initializer();\n }\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n }\n }\n\n override toString() {\n const tokens: string[] = [];\n const records = this.records;\n for (const token of records.keys()) {\n tokens.push(stringify(token));\n }\n return `R3Injector[${tokens.join(', ')}]`;\n }\n\n private assertNotDestroyed(): void {\n if (this._destroyed) {\n throw new RuntimeError(\n RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,\n ngDevMode && 'Injector has already been destroyed.');\n }\n }\n\n /**\n * Process a `SingleProvider` and add it.\n */\n private processProvider(provider: SingleProvider): void {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token: any =\n isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider);\n\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord!.multi!);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi!.push(provider);\n } else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }\n\n private hydrate<T>(token: ProviderToken<T>, record: Record<T>): T {\n if (ngDevMode && record.value === CIRCULAR) {\n throwCyclicDependencyError(stringify(token));\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n record.value = record.factory!();\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this._ngOnDestroyHooks.add(record.value);\n }\n return record.value as T;\n }\n\n private injectableDefInScope(def: ɵɵInjectableDeclaration<any>): boolean {\n if (!def.providedIn) {\n return false;\n }\n const providedIn = resolveForwardRef(def.providedIn);\n if (typeof providedIn === 'string') {\n return providedIn === 'any' || (this.scopes.has(providedIn));\n } else {\n return this.injectorDefTypes.has(providedIn);\n }\n }\n}\n\nfunction injectableDefOrInjectorDefFactory(token: ProviderToken<any>): FactoryFn<any> {\n // Most tokens will have an injectable def directly on them, which specifies a factory directly.\n const injectableDef = getInjectableDef(token);\n const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);\n\n if (factory !== null) {\n return factory;\n }\n\n // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.\n // If it's missing that, it's an error.\n if (token instanceof InjectionToken) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INJECTION_TOKEN,\n ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);\n }\n\n // Undecorated types can sometimes be created if they have no constructor arguments.\n if (token instanceof Function) {\n return getUndecoratedInjectableFactory(token);\n }\n\n // There was no way to resolve a factory for this token.\n throw new RuntimeError(RuntimeErrorCode.INVALID_INJECTION_TOKEN, ngDevMode && 'unreachable');\n}\n\nfunction getUndecoratedInjectableFactory(token: Function) {\n // If the token has parameters then it has dependencies that we cannot resolve implicitly.\n const paramLength = token.length;\n if (paramLength > 0) {\n const args: string[] = newArray(paramLength, '?');\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INJECTION_TOKEN,\n ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);\n }\n\n // The constructor function appears to have no parameters.\n // This might be because it inherits from a super-class. In which case, use an injectable\n // def from an ancestor if there is one.\n // Otherwise this really is a simple class with no dependencies, so return a factory that\n // just instantiates the zero-arg constructor.\n const inheritedInjectableDef = getInheritedInjectableDef(token);\n if (inheritedInjectableDef !== null) {\n return () => inheritedInjectableDef.factory(token as Type<any>);\n } else {\n return () => new (token as Type<any>)();\n }\n}\n\nfunction providerToRecord(provider: SingleProvider): Record<any> {\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n } else {\n const factory: (() => any)|undefined = providerToFactory(provider);\n return makeRecord(factory, NOT_YET);\n }\n}\n\n/**\n * Converts a `SingleProvider` into a factory function.\n *\n * @param provider provider to convert to factory\n */\nexport function providerToFactory(\n provider: SingleProvider, ngModuleType?: InjectorType<any>, providers?: any[]): () => any {\n let factory: (() => any)|undefined = undefined;\n if (ngDevMode && isEnvironmentProviders(provider)) {\n throwInvalidProviderError(undefined, providers, provider);\n }\n\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n } else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n } else {\n const classRef = resolveForwardRef(\n provider &&\n ((provider as StaticClassProvider | ClassProvider).useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n } else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\n\nfunction makeRecord<T>(\n factory: (() => T)|undefined, value: T|{}, multi: boolean = false): Record<T> {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined,\n };\n}\n\nfunction hasDeps(value: ClassProvider|ConstructorProvider|\n StaticClassProvider): value is ClassProvider&{deps: any[]} {\n return !!(value as any).deps;\n}\n\nfunction hasOnDestroy(value: any): value is OnDestroy {\n return value !== null && typeof value === 'object' &&\n typeof (value as OnDestroy).ngOnDestroy === 'function';\n}\n\nfunction couldBeInjectableType(value: any): value is ProviderToken<any> {\n return (typeof value === 'function') ||\n (typeof value === 'object' && value instanceof InjectionToken);\n}\n\nfunction forEachSingleProvider(\n providers: Array<Provider|EnvironmentProviders>, fn: (provider: SingleProvider) => void): void {\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n forEachSingleProvider(provider, fn);\n } else if (provider && isEnvironmentProviders(provider)) {\n forEachSingleProvider(provider.ɵproviders, fn);\n } else {\n fn(provider as SingleProvider);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {EnvironmentInjector} from '../di/r3_injector';\nimport {Type} from '../interface/type';\n\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {ViewRef} from './view_ref';\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nexport abstract class ComponentRef<C> {\n /**\n * Updates a specified input name to a new value. Using this method will properly mark for check\n * component using the `OnPush` change detection strategy. It will also assure that the\n * `OnChanges` lifecycle hook runs when a dynamically created component is change-detected.\n *\n * @param name The name of an input.\n * @param value The new value of an input.\n */\n abstract setInput(name: string, value: unknown): void;\n\n /**\n * The host or anchor [element](guide/glossary#element) for this component instance.\n */\n abstract get location(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this component instance.\n */\n abstract get injector(): Injector;\n\n /**\n * This component instance.\n */\n abstract get instance(): C;\n\n /**\n * The [host view](guide/glossary#view-tree) defined by the template\n * for this component instance.\n */\n abstract get hostView(): ViewRef;\n\n /**\n * The change detector for this component instance.\n */\n abstract get changeDetectorRef(): ChangeDetectorRef;\n\n /**\n * The type of this component (as created by a `ComponentFactory` class).\n */\n abstract get componentType(): Type<any>;\n\n /**\n * Destroys the component instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for the component.\n * @param callback A handler function that cleans up developer-defined data\n * associated with this component. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): void;\n}\n\n/**\n * Base class for a factory that can create a component dynamically.\n * Instantiate a factory for a given type of component with `resolveComponentFactory()`.\n * Use the resulting `ComponentFactory.create()` method to create a component of that type.\n *\n * @see [Dynamic Components](guide/dynamic-component-loader)\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nexport abstract class ComponentFactory<C> {\n /**\n * The component's HTML selector.\n */\n abstract get selector(): string;\n /**\n * The type of component the factory will create.\n */\n abstract get componentType(): Type<any>;\n /**\n * Selector for all <ng-content> elements in the component.\n */\n abstract get ngContentSelectors(): string[];\n /**\n * The inputs of the component.\n */\n abstract get inputs(): {propName: string, templateName: string}[];\n /**\n * The outputs of the component.\n */\n abstract get outputs(): {propName: string, templateName: string}[];\n /**\n * Creates a new component.\n */\n abstract create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n environmentInjector?: EnvironmentInjector|NgModuleRef<any>): ComponentRef<C>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\nimport {stringify} from '../util/stringify';\n\nimport {ComponentFactory} from './component_factory';\n\nexport function noComponentFactoryError(component: Function) {\n const error = Error(`No component factory found for ${\n stringify(component)}. Did you add it to @NgModule.entryComponents?`);\n (error as any)[ERROR_COMPONENT] = component;\n return error;\n}\n\nconst ERROR_COMPONENT = 'ngComponent';\n\nexport function getComponent(error: Error): Type<any> {\n return (error as any)[ERROR_COMPONENT];\n}\n\n\nclass _NullComponentFactoryResolver implements ComponentFactoryResolver {\n resolveComponentFactory<T>(component: {new(...args: any[]): T}): ComponentFactory<T> {\n throw noComponentFactoryError(component);\n }\n}\n\n/**\n * A simple registry that maps `Components` to generated `ComponentFactory` classes\n * that can be used to create instances of components.\n * Use to obtain the factory for a given component type,\n * then use the factory's `create()` method to create a component of that type.\n *\n * Note: since v13, dynamic component creation via\n * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)\n * does **not** require resolving component factory: component class can be used directly.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nexport abstract class ComponentFactoryResolver {\n static NULL: ComponentFactoryResolver = (/* @__PURE__ */ new _NullComponentFactoryResolver());\n /**\n * Retrieves the factory object that creates a component of the given type.\n * @param component The component type.\n */\n abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {TNode} from '../render3/interfaces/node';\nimport {RElement} from '../render3/interfaces/renderer_dom';\nimport {LView} from '../render3/interfaces/view';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {getNativeByTNode} from '../render3/util/view_utils';\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nexport function injectElementRef(): ElementRef {\n return createElementRef(getCurrentTNode()!, getLView());\n}\n\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nexport function createElementRef(tNode: TNode, lView: LView): ElementRef {\n return new ElementRef(getNativeByTNode(tNode, lView) as RElement);\n}\n\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nexport class ElementRef<T = any> {\n /**\n * The underlying native element or `null` if direct access to native elements is not supported\n * (e.g. when the application runs in a web worker).\n *\n * <div class=\"callout is-critical\">\n * <header>Use with caution</header>\n * <p>\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. Alternatively you can take a look at {@link\n * Renderer2}\n * which provides API that can safely be used even when direct access to native elements is not\n * supported.\n * </p>\n * <p>\n * Relying on direct DOM access creates tight coupling between your application and rendering\n * layers which will make it impossible to separate the two and deploy your application into a\n * web worker.\n * </p>\n * </div>\n *\n */\n public nativeElement: T;\n\n constructor(nativeElement: T) {\n this.nativeElement = nativeElement;\n }\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: () => ElementRef = injectElementRef;\n}\n\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nexport function unwrapElementRef<T, R>(value: T|ElementRef<R>): T|R {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isLView} from '../render3/interfaces/type_checks';\nimport {RENDERER} from '../render3/interfaces/view';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {getComponentLViewByIndex} from '../render3/util/view_utils';\n\nimport {RendererStyleFlags2, RendererType2} from './api_flags';\n\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nexport abstract class RendererFactory2 {\n /**\n * Creates and initializes a custom renderer for a host DOM element.\n * @param hostElement The element to render.\n * @param type The base class to implement.\n * @returns The new custom renderer instance.\n */\n abstract createRenderer(hostElement: any, type: RendererType2|null): Renderer2;\n /**\n * A callback invoked when rendering has begun.\n */\n abstract begin?(): void;\n /**\n * A callback invoked when rendering has completed.\n */\n abstract end?(): void;\n /**\n * Use with animations test-only mode. Notifies the test when rendering has completed.\n * @returns The asynchronous result of the developer-defined function.\n */\n abstract whenRenderingDone?(): Promise<any>;\n}\n\n\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nexport abstract class Renderer2 {\n /**\n * Use to store arbitrary developer-defined data on a renderer instance,\n * as an object containing key-value pairs.\n * This is useful for renderers that delegate to other renderers.\n */\n abstract get data(): {[key: string]: any};\n\n /**\n * Implement this callback to destroy the renderer or the host element.\n */\n abstract destroy(): void;\n /**\n * Implement this callback to create an instance of the host element.\n * @param name An identifying name for the new element, unique within the namespace.\n * @param namespace The namespace for the new element.\n * @returns The new element.\n */\n abstract createElement(name: string, namespace?: string|null): any;\n /**\n * Implement this callback to add a comment to the DOM of the host element.\n * @param value The comment text.\n * @returns The modified element.\n */\n abstract createComment(value: string): any;\n\n /**\n * Implement this callback to add text to the DOM of the host element.\n * @param value The text string.\n * @returns The modified element.\n */\n abstract createText(value: string): any;\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n // TODO(issue/24571): remove '!'.\n destroyNode!: ((node: any) => void)|null;\n /**\n * Appends a child to a given parent node in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child node.\n */\n abstract appendChild(parent: any, newChild: any): void;\n /**\n * Implement this callback to insert a child node at a given position in a parent node\n * in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child nodes.\n * @param refChild The existing child node before which `newChild` is inserted.\n * @param isMove Optional argument which signifies if the current `insertBefore` is a result of a\n * move. Animation uses this information to trigger move animations. In the past the Animation\n * would always assume that any `insertBefore` is a move. This is not strictly true because\n * with runtime i18n it is possible to invoke `insertBefore` as a result of i18n and it should\n * not trigger an animation move.\n */\n abstract insertBefore(parent: any, newChild: any, refChild: any, isMove?: boolean): void;\n /**\n * Implement this callback to remove a child node from the host element's DOM.\n * @param parent The parent node.\n * @param oldChild The child node to remove.\n * @param isHostElement Optionally signal to the renderer whether this element is a host element\n * or not\n */\n abstract removeChild(parent: any, oldChild: any, isHostElement?: boolean): void;\n /**\n * Implement this callback to prepare an element to be bootstrapped\n * as a root element, and return the element instance.\n * @param selectorOrNode The DOM element.\n * @param preserveContent Whether the contents of the root element\n * should be preserved, or cleared upon bootstrap (default behavior).\n * Use with `ViewEncapsulation.ShadowDom` to allow simple native\n * content projection via `<slot>` elements.\n * @returns The root element.\n */\n abstract selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any;\n /**\n * Implement this callback to get the parent of a given node\n * in the host element's DOM.\n * @param node The child node to query.\n * @returns The parent node, or null if there is no parent.\n * For WebWorkers, always returns true.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract parentNode(node: any): any;\n /**\n * Implement this callback to get the next sibling node of a given node\n * in the host element's DOM.\n * @returns The sibling node, or null if there is no sibling.\n * For WebWorkers, always returns a value.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract nextSibling(node: any): any;\n /**\n * Implement this callback to set an attribute value for an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param value The new value.\n * @param namespace The namespace.\n */\n abstract setAttribute(el: any, name: string, value: string, namespace?: string|null): void;\n\n /**\n * Implement this callback to remove an attribute from an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param namespace The namespace.\n */\n abstract removeAttribute(el: any, name: string, namespace?: string|null): void;\n /**\n * Implement this callback to add a class to an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract addClass(el: any, name: string): void;\n\n /**\n * Implement this callback to remove a class from an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract removeClass(el: any, name: string): void;\n\n /**\n * Implement this callback to set a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param value The new value.\n * @param flags Flags for style variations. No flags are set by default.\n */\n abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to remove the value from a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param flags Flags for style variations to remove, if set. ???\n */\n abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to set the value of a property of an element in the DOM.\n * @param el The element.\n * @param name The property name.\n * @param value The new value.\n */\n abstract setProperty(el: any, name: string, value: any): void;\n\n /**\n * Implement this callback to set the value of a node in the host element.\n * @param node The node.\n * @param value The new value.\n */\n abstract setValue(node: any, value: string): void;\n\n /**\n * Implement this callback to start an event listener.\n * @param target The context in which to listen for events. Can be\n * the entire window or document, the body of the document, or a specific\n * DOM element.\n * @param eventName The event to listen for.\n * @param callback A handler function to invoke when the event occurs.\n * @returns An \"unlisten\" function for disposing of this handler.\n */\n abstract listen(\n target: 'window'|'document'|'body'|any, eventName: string,\n callback: (event: any) => boolean | void): () => void;\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: () => Renderer2 = () => injectRenderer2();\n}\n\n/** Injects a Renderer2 for the current component. */\nexport function injectRenderer2(): Renderer2 {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode()!;\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER] as Renderer2;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵɵdefineInjectable} from '../di/interface/defs';\nimport {SecurityContext} from './security';\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nexport abstract class Sanitizer {\n abstract sanitize(context: SecurityContext, value: {}|string|null): string|null;\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({\n token: Sanitizer,\n providedIn: 'root',\n factory: () => null,\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description Represents the version of Angular\n *\n * @publicApi\n */\nexport class Version {\n public readonly major: string;\n public readonly minor: string;\n public readonly patch: string;\n\n constructor(public full: string) {\n this.major = full.split('.')[0];\n this.minor = full.split('.')[1];\n this.patch = full.split('.').slice(2).join('.');\n }\n}\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('15.2.2');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nexport const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const ERROR_ORIGINAL_ERROR = 'ngOriginalError';\n\nexport function wrappedError(message: string, originalError: any): Error {\n const msg = `${message} caused by: ${\n originalError instanceof Error ? originalError.message : originalError}`;\n const error = Error(msg);\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n\nexport function getOriginalError(error: Error): Error {\n return (error as any)[ERROR_ORIGINAL_ERROR];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getOriginalError} from './util/errors';\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nexport class ErrorHandler {\n /**\n * @internal\n */\n _console: Console = console;\n\n handleError(error: any): void {\n const originalError = this._findOriginalError(error);\n\n this._console.error('ERROR', error);\n if (originalError) {\n this._console.error('ORIGINAL ERROR', originalError);\n }\n }\n\n /** @internal */\n _findOriginalError(error: any): Error|null {\n let e = error && getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n\n return e || null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RElement} from '../interfaces/renderer_dom';\n\n\n/**\n *\n * @codeGenApi\n */\nexport function ɵɵresolveWindow(element: RElement&{ownerDocument: Document}) {\n return element.ownerDocument.defaultView;\n}\n\n/**\n *\n * @codeGenApi\n */\nexport function ɵɵresolveDocument(element: RElement&{ownerDocument: Document}) {\n return element.ownerDocument;\n}\n\n/**\n *\n * @codeGenApi\n */\nexport function ɵɵresolveBody(element: RElement&{ownerDocument: Document}) {\n return element.ownerDocument.body;\n}\n\n/**\n * The special delimiter we use to separate property names, prefixes, and suffixes\n * in property binding metadata. See storeBindingMetadata().\n *\n * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n * because it is a very uncommon character that is unlikely to be part of a user's\n * property names or interpolation strings. If it is in fact used in a property\n * binding, DebugElement.properties will not return the correct value for that\n * binding. However, there should be no runtime effect for real applications.\n *\n * This character is typically rendered as a question mark inside of a diamond.\n * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n *\n */\nexport const INTERPOLATION_DELIMITER = `�`;\n\n/**\n * Unwrap a value which might be behind a closure (for forward declaration reasons).\n */\nexport function maybeUnwrapFn<T>(value: T|(() => T)): T {\n if (value instanceof Function) {\n return value();\n } else {\n return value;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertNotEqual} from '../../util/assert';\nimport {CharCode} from '../../util/char_code';\n\n\n/**\n * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n *\n * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n *\n * @param className A string containing classes (whitespace separated)\n * @param classToSearch A class name to locate\n * @param startingIndex Starting location of search\n * @returns an index of the located class (or -1 if not found)\n */\nexport function classIndexOf(\n className: string, classToSearch: string, startingIndex: number): number {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1) return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= CharCode.SPACE) {\n // Ensure that it has leading whitespace\n const length = classToSearch.length;\n if (foundIndex + length === end ||\n className.charCodeAt(foundIndex + length) <= CharCode.SPACE) {\n // Ensure that it has trailing whitespace\n return foundIndex;\n }\n }\n // False positive, keep searching from where we left off.\n startingIndex = foundIndex + 1;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport '../util/ng_dev_mode';\n\nimport {assertDefined, assertEqual, assertNotEqual} from '../util/assert';\n\nimport {AttributeMarker, TAttributes, TNode, TNodeType} from './interfaces/node';\nimport {CssSelector, CssSelectorList, SelectorFlags} from './interfaces/projection';\nimport {classIndexOf} from './styling/class_differ';\nimport {isNameOnlyAttributeMarker} from './util/attrs_utils';\n\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n\n/**\n * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n *\n * @param attrs `TAttributes` to search through.\n * @param cssClassToMatch class to match (lowercase)\n * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n * addition to the `AttributeMarker.Classes`.\n */\nfunction isCssClassMatching(\n attrs: TAttributes, cssClassToMatch: string, isProjectionMode: boolean): boolean {\n // TODO(misko): The fact that this function needs to know about `isProjectionMode` seems suspect.\n // It is strange to me that sometimes the class information comes in form of `class` attribute\n // and sometimes in form of `AttributeMarker.Classes`. Some investigation is needed to determine\n // if that is the right behavior.\n ngDevMode &&\n assertEqual(\n cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n while (i < attrs.length) {\n let item = attrs[i++];\n if (isProjectionMode && item === 'class') {\n item = attrs[i] as string;\n if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n } else if (item === AttributeMarker.Classes) {\n // We found the classes section. Start searching for the class.\n while (i < attrs.length && typeof (item = attrs[i++]) == 'string') {\n // while we have strings\n if (item.toLowerCase() === cssClassToMatch) return true;\n }\n return false;\n }\n }\n return false;\n}\n\n/**\n * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n *\n * @param tNode current TNode\n */\nexport function isInlineTemplate(tNode: TNode): boolean {\n return tNode.type === TNodeType.Container && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\n\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode:\n * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n * tag name was extracted from * syntax so we would match the same directive twice);\n * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n * (applicable to TNodeType.Container only).\n */\nfunction hasTagAndTypeMatch(\n tNode: TNode, currentSelector: string, isProjectionMode: boolean): boolean {\n const tagNameToCompare =\n tNode.type === TNodeType.Container && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\n\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param node static data of the node to match\n * @param selector The selector to try matching against the node.\n * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n * directive matching.\n * @returns true if node matches the selector.\n */\nexport function isNodeMatchingSelector(\n tNode: TNode, selector: CssSelector, isProjectionMode: boolean): boolean {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode: SelectorFlags = SelectorFlags.ELEMENT;\n const nodeAttrs = tNode.attrs || [];\n\n // Find the index of first attribute that has no value, only a name.\n const nameOnlyMarkerIdx = getNameOnlyMarkerIndex(nodeAttrs);\n\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = (current as number) | (mode & SelectorFlags.NOT);\n continue;\n }\n\n if (skipToNextSelector) continue;\n\n if (mode & SelectorFlags.ELEMENT) {\n mode = SelectorFlags.ATTRIBUTE | mode & SelectorFlags.NOT;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) ||\n current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const selectorAttrValue = mode & SelectorFlags.CLASS ? current : selector[++i];\n\n // special case for matching against classes when a tNode has been instantiated with\n // class and style values as separate attribute values (e.g. ['title', CLASS, 'foo'])\n if ((mode & SelectorFlags.CLASS) && tNode.attrs !== null) {\n if (!isCssClassMatching(tNode.attrs, selectorAttrValue as string, isProjectionMode)) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n continue;\n }\n\n const attrName = (mode & SelectorFlags.CLASS) ? 'class' : current;\n const attrIndexInNode =\n findAttrIndexInNode(attrName, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n\n if (selectorAttrValue !== '') {\n let nodeAttrValue: string;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode &&\n assertNotEqual(\n nodeAttrs[attrIndexInNode], AttributeMarker.NamespaceURI,\n 'We do not match directives on namespaced attributes');\n // we lowercase the attribute value to be able to match\n // selectors without case-sensitivity\n // (selectors are already in lowercase when generated)\n nodeAttrValue = (nodeAttrs[attrIndexInNode + 1] as string).toLowerCase();\n }\n\n const compareAgainstClassName = mode & SelectorFlags.CLASS ? nodeAttrValue : null;\n if (compareAgainstClassName &&\n classIndexOf(compareAgainstClassName, selectorAttrValue as string, 0) !== -1 ||\n mode & SelectorFlags.ATTRIBUTE && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n\n return isPositive(mode) || skipToNextSelector;\n}\n\nfunction isPositive(mode: SelectorFlags): boolean {\n return (mode & SelectorFlags.NOT) === 0;\n}\n\n/**\n * Examines the attribute's definition array for a node to find the index of the\n * attribute that matches the given `name`.\n *\n * NOTE: This will not match namespaced attributes.\n *\n * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n * The following table summarizes which types of attributes we attempt to match:\n *\n * ===========================================================================================================\n * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n * Attributes\n * ===========================================================================================================\n * Inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Inline + Directive | NO | NO | YES | NO\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Directive | YES | YES | NO | YES\n * ===========================================================================================================\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n * rather than a manually expanded template node (e.g `<ng-template>`).\n * @param isProjectionMode true if we are matching against content projection otherwise we are\n * matching against directives.\n */\nfunction findAttrIndexInNode(\n name: string, attrs: TAttributes|null, isInlineTemplate: boolean,\n isProjectionMode: boolean): number {\n if (attrs === null) return -1;\n\n let i = 0;\n\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (\n maybeAttrName === AttributeMarker.Bindings || maybeAttrName === AttributeMarker.I18n) {\n bindingsMode = true;\n } else if (\n maybeAttrName === AttributeMarker.Classes || maybeAttrName === AttributeMarker.Styles) {\n let value = attrs[++i];\n // We should skip classes here because we have a separate mechanism for\n // matching classes in projection mode.\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n } else if (maybeAttrName === AttributeMarker.Template) {\n // We do not care about Template attributes in this scenario.\n break;\n } else if (maybeAttrName === AttributeMarker.NamespaceURI) {\n // Skip the whole namespaced attribute and value. This is by design.\n i += 4;\n continue;\n }\n // In binding mode there are only names, rather than name-value pairs.\n i += bindingsMode ? 1 : 2;\n }\n // We did not match the attribute\n return -1;\n } else {\n return matchTemplateAttribute(attrs, name);\n }\n}\n\nexport function isNodeMatchingSelectorList(\n tNode: TNode, selector: CssSelectorList, isProjectionMode: boolean = false): boolean {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getProjectAsAttrValue(tNode: TNode): CssSelector|null {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(AttributeMarker.ProjectAs);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1] as CssSelector;\n }\n }\n return null;\n}\n\nfunction getNameOnlyMarkerIndex(nodeAttrs: TAttributes) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\n\nfunction matchTemplateAttribute(attrs: TAttributes, name: string): number {\n let i = attrs.indexOf(AttributeMarker.Template);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n // Return in case we checked all template attrs and are switching to the next section in the\n // attrs array (that starts with a number that represents an attribute marker).\n if (typeof attr === 'number') return -1;\n if (attr === name) return i;\n i++;\n }\n }\n return -1;\n}\n\n/**\n * Checks whether a selector is inside a CssSelectorList\n * @param selector Selector to be checked.\n * @param list List in which to look for the selector.\n */\nexport function isSelectorInSelectorList(selector: CssSelector, list: CssSelectorList): boolean {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\n\nfunction maybeWrapInNotSelector(isNegativeMode: boolean, chunk: string): string {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\n\nfunction stringifyCSSSelector(selector: CssSelector): string {\n let result = selector[0] as string;\n let i = 1;\n let mode = SelectorFlags.ATTRIBUTE;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & SelectorFlags.ATTRIBUTE) {\n const attrValue = selector[++i] as string;\n currentChunk +=\n '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n } else if (mode & SelectorFlags.CLASS) {\n currentChunk += '.' + valueOrMarker;\n } else if (mode & SelectorFlags.ELEMENT) {\n currentChunk += ' ' + valueOrMarker;\n }\n } else {\n //\n // Append current chunk to the final result in case we come across SelectorFlag, which\n // indicates that the previous section of a selector is over. We need to accumulate content\n // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n // ```\n // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n // ```\n // should be transformed to `.classA :not(.classB .classC)`.\n //\n // Note: for negative selector part, we accumulate content between flags until we find the\n // next negative flag. This is needed to support a case where `:not()` rule contains more than\n // one chunk, e.g. the following selector:\n // ```\n // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n // ```\n // should be stringified to `:not(p.foo) :not(.bar)`\n //\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector.\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\n\n/**\n * Generates string representation of CSS selector in parsed form.\n *\n * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n * additional parsing at runtime (for example, for directive matching). However in some cases (for\n * example, while bootstrapping a component), a string version of the selector is required to query\n * for the host element on the page. This function takes the parsed form of a selector and returns\n * its string representation.\n *\n * @param selectorList selector in parsed form\n * @returns string representation of a given selector\n */\nexport function stringifyCSSSelectorList(selectorList: CssSelectorList): string {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\n\n/**\n * Extracts attributes and classes information from a given CSS selector.\n *\n * This function is used while creating a component dynamically. In this case, the host element\n * (that is created dynamically) should contain attributes and classes specified in component's CSS\n * selector.\n *\n * @param selector CSS selector in parsed form (in a form of array)\n * @returns object with `attrs` and `classes` fields that contain extracted information\n */\nexport function extractAttrsAndClassesFromSelector(selector: CssSelector):\n {attrs: string[], classes: string[]} {\n const attrs: string[] = [];\n const classes: string[] = [];\n let i = 1;\n let mode = SelectorFlags.ATTRIBUTE;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === SelectorFlags.ATTRIBUTE) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i] as string);\n }\n } else if (mode === SelectorFlags.CLASS) {\n classes.push(valueOrMarker);\n }\n } else {\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n // extracted only for \"positive\" part of the selector, we can stop here.\n if (!isPositive(mode)) break;\n mode = valueOrMarker;\n }\n i++;\n }\n return {attrs, classes};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport interface NO_CHANGE {\n // This is a brand that ensures that this type can never match anything else\n __brand__: 'NO_CHANGE';\n}\n\n/** A special value which designates that a value has not changed. */\nexport const NO_CHANGE: NO_CHANGE =\n (typeof ngDevMode === 'undefined' || ngDevMode) ? {__brand__: 'NO_CHANGE'} : ({} as NO_CHANGE);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {assertGreaterThan} from '../../util/assert';\nimport {assertIndexInDeclRange} from '../assert';\nimport {executeCheckHooks, executeInitAndCheckHooks} from '../hooks';\nimport {FLAGS, InitPhaseState, LView, LViewFlags, TView} from '../interfaces/view';\nimport {getLView, getSelectedIndex, getTView, isInCheckNoChangesMode, setSelectedIndex} from '../state';\n\n\n/**\n * Advances to an element for later binding instructions.\n *\n * Used in conjunction with instructions like {@link property} to act on elements with specified\n * indices, for example those created with {@link element} or {@link elementStart}.\n *\n * ```ts\n * (rf: RenderFlags, ctx: any) => {\n * if (rf & 1) {\n * text(0, 'Hello');\n * text(1, 'Goodbye')\n * element(2, 'div');\n * }\n * if (rf & 2) {\n * advance(2); // Advance twice to the <div>.\n * property('title', 'test');\n * }\n * }\n * ```\n * @param delta Number of elements to advance forwards by.\n *\n * @codeGenApi\n */\nexport function ɵɵadvance(delta: number): void {\n ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n selectIndexInternal(\n getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());\n}\n\nexport function selectIndexInternal(\n tView: TView, lView: LView, index: number, checkNoChangesMode: boolean) {\n ngDevMode && assertIndexInDeclRange(lView, index);\n\n // Flush the initial hooks for elements in the view that have been added up to this point.\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!checkNoChangesMode) {\n const hooksInitPhaseCompleted =\n (lView[FLAGS] & LViewFlags.InitPhaseStateMask) === InitPhaseState.InitPhaseCompleted;\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, index);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, InitPhaseState.OnInitHooksToBeRun, index);\n }\n }\n }\n\n // We must set the selected index *after* running the hooks, because hooks may have side-effects\n // that cause other template functions to run, thus updating the selected index, which is global\n // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index\n // will be altered by the time we leave the `ɵɵadvance` instruction.\n setSelectedIndex(index);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EMPTY_ARRAY} from '../util/empty';\nimport {stringify} from '../util/stringify';\n\nimport {Injector} from './injector';\nimport {StaticProvider} from './interface/provider';\nimport {importProvidersFrom} from './provider_collection';\nimport {getNullInjector, R3Injector} from './r3_injector';\nimport {InjectorScope} from './scope';\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n *\n * @publicApi\n */\nexport function createInjector(\n defType: /* InjectorType<any> */ any, parent: Injector|null = null,\n additionalProviders: StaticProvider[]|null = null, name?: string): Injector {\n const injector =\n createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);\n injector.resolveInjectorInitializers();\n return injector;\n}\n\n/**\n * Creates a new injector without eagerly resolving its injector types. Can be used in places\n * where resolving the injector types immediately can lead to an infinite loop. The injector types\n * should be resolved at a later point by calling `_resolveInjectorDefTypes`.\n */\nexport function createInjectorWithoutInjectorInstances(\n defType: /* InjectorType<any> */ any, parent: Injector|null = null,\n additionalProviders: StaticProvider[]|null = null, name?: string,\n scopes = new Set<InjectorScope>()): R3Injector {\n const providers = [\n additionalProviders || EMPTY_ARRAY,\n importProvidersFrom(defType),\n ];\n name = name || (typeof defType === 'object' ? undefined : stringify(defType));\n\n return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {createInjector} from './create_injector';\nimport {THROW_IF_NOT_FOUND, ɵɵinject} from './injector_compatibility';\nimport {InjectorMarkers} from './injector_marker';\nimport {INJECTOR} from './injector_token';\nimport {ɵɵdefineInjectable} from './interface/defs';\nimport {InjectFlags, InjectOptions} from './interface/injector';\nimport {StaticProvider} from './interface/provider';\nimport {NullInjector} from './null_injector';\nimport {ProviderToken} from './provider_token';\n\n/**\n * Concrete injectors implement this interface. Injectors are configured\n * with [providers](guide/glossary#provider) that associate\n * dependencies of various types with [injection tokens](guide/glossary#di-token).\n *\n * @see [\"DI Providers\"](guide/dependency-injection-providers).\n * @see `StaticProvider`\n *\n * @usageNotes\n *\n * The following example creates a service injector instance.\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n *\n * ### Usage example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * @publicApi\n */\nexport abstract class Injector {\n static THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;\n static NULL: Injector = (/* @__PURE__ */ new NullInjector());\n\n /**\n * Internal note on the `options?: InjectOptions|InjectFlags` override of the `get`\n * method: consider dropping the `InjectFlags` part in one of the major versions.\n * It can **not** be done in minor/patch, since it's breaking for custom injectors\n * that only implement the old `InjectorFlags` interface.\n */\n\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions&{\n optional?: false;\n }): T;\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue: null|undefined, options: InjectOptions): T\n |null;\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions|InjectFlags):\n T;\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n * @deprecated use object-based flags (`InjectOptions`) instead.\n */\n abstract get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n /**\n * @deprecated from v4.0.0 use ProviderToken<T>\n * @suppress {duplicate}\n */\n abstract get(token: any, notFoundValue?: any): any;\n\n /**\n * @deprecated from v5 use the new signature Injector.create(options)\n */\n static create(providers: StaticProvider[], parent?: Injector): Injector;\n\n /**\n * Creates a new injector instance that provides one or more dependencies,\n * according to a given type or types of `StaticProvider`.\n *\n * @param options An object with the following properties:\n * * `providers`: An array of providers of the [StaticProvider type](api/core/StaticProvider).\n * * `parent`: (optional) A parent injector.\n * * `name`: (optional) A developer-defined identifying name for the new injector.\n *\n * @returns The new injector instance.\n *\n */\n static create(options: {providers: StaticProvider[], parent?: Injector, name?: string}): Injector;\n\n\n static create(\n options: StaticProvider[]|{providers: StaticProvider[], parent?: Injector, name?: string},\n parent?: Injector): Injector {\n if (Array.isArray(options)) {\n return createInjector({name: ''}, parent, options, '');\n } else {\n const name = options.name ?? '';\n return createInjector({name}, options.parent, options.providers, name);\n }\n }\n\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({\n token: Injector,\n providedIn: 'any',\n factory: () => ɵɵinject(INJECTOR),\n });\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = InjectorMarkers.Injector;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\nimport {ERROR_ORIGINAL_ERROR, wrappedError} from '../util/errors';\nimport {stringify} from '../util/stringify';\n\nimport {ReflectiveInjector} from './reflective_injector';\nimport {ReflectiveKey} from './reflective_key';\n\nfunction findFirstClosedCycle(keys: any[]): any[] {\n const res: any[] = [];\n for (let i = 0; i < keys.length; ++i) {\n if (res.indexOf(keys[i]) > -1) {\n res.push(keys[i]);\n return res;\n }\n res.push(keys[i]);\n }\n return res;\n}\n\nfunction constructResolvingPath(keys: any[]): string {\n if (keys.length > 1) {\n const reversed = findFirstClosedCycle(keys.slice().reverse());\n const tokenStrs = reversed.map(k => stringify(k.token));\n return ' (' + tokenStrs.join(' -> ') + ')';\n }\n\n return '';\n}\n\nexport interface InjectionError extends Error {\n keys: ReflectiveKey[];\n injectors: ReflectiveInjector[];\n constructResolvingMessage: (keys: ReflectiveKey[]) => string;\n addKey(injector: ReflectiveInjector, key: ReflectiveKey): void;\n}\n\nfunction injectionError(\n injector: ReflectiveInjector, key: ReflectiveKey,\n constructResolvingMessage: (keys: ReflectiveKey[]) => string,\n originalError?: Error): InjectionError {\n const keys = [key];\n const errMsg = constructResolvingMessage(keys);\n const error =\n (originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;\n error.addKey = addKey;\n error.keys = keys;\n error.injectors = [injector];\n error.constructResolvingMessage = constructResolvingMessage;\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n\nfunction addKey(this: InjectionError, injector: ReflectiveInjector, key: ReflectiveKey): void {\n this.injectors.push(injector);\n this.keys.push(key);\n // Note: This updated message won't be reflected in the `.stack` property\n this.message = this.constructResolvingMessage(this.keys);\n}\n\n/**\n * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the\n * {@link Injector} does not have a {@link Provider} for the given key.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b:B) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n */\nexport function noProviderError(injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `No provider for ${first}!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when dependencies form a cycle.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * var injector = Injector.resolveAndCreate([\n * {provide: \"one\", useFactory: (two) => \"two\", deps: [[new Inject(\"two\")]]},\n * {provide: \"two\", useFactory: (one) => \"one\", deps: [[new Inject(\"one\")]]}\n * ]);\n *\n * expect(() => injector.get(\"one\")).toThrowError();\n * ```\n *\n * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.\n */\nexport function cyclicDependencyError(\n injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when a constructing type returns with an Error.\n *\n * The `InstantiationError` class contains the original error plus the dependency graph which caused\n * this object to be instantiated.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor() {\n * throw new Error('message');\n * }\n * }\n *\n * var injector = Injector.resolveAndCreate([A]);\n\n * try {\n * injector.get(A);\n * } catch (e) {\n * expect(e instanceof InstantiationError).toBe(true);\n * expect(e.originalException.message).toEqual(\"message\");\n * expect(e.originalStack).toBeDefined();\n * }\n * ```\n */\nexport function instantiationError(\n injector: ReflectiveInjector, originalException: any, originalStack: any,\n key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `${originalException.message}: Error during instantiation of ${first}!${\n constructResolvingPath(keys)}.`;\n }, originalException);\n}\n\n/**\n * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}\n * creation.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\"not a type\"])).toThrowError();\n * ```\n */\nexport function invalidProviderError(provider: any) {\n return Error(\n `Invalid provider - only instances of Provider and Type are allowed, got: ${provider}`);\n}\n\n/**\n * Thrown when the class has no annotation information.\n *\n * Lack of annotation information prevents the {@link Injector} from determining which dependencies\n * need to be injected into the constructor.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n *\n * This error is also thrown when the class not marked with {@link Injectable} has parameter types.\n *\n * ```typescript\n * class B {}\n *\n * class A {\n * constructor(b:B) {} // no information about the parameter types of A is available at runtime.\n * }\n *\n * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();\n * ```\n *\n */\nexport function noAnnotationError(typeOrFunc: Type<any>|Function, params: any[][]): Error {\n const signature: string[] = [];\n for (let i = 0, ii = params.length; i < ii; i++) {\n const parameter = params[i];\n if (!parameter || parameter.length == 0) {\n signature.push('?');\n } else {\n signature.push(parameter.map(stringify).join(' '));\n }\n }\n return Error(\n 'Cannot resolve all parameters for \\'' + stringify(typeOrFunc) + '\\'(' +\n signature.join(', ') + '). ' +\n 'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \\'' +\n stringify(typeOrFunc) + '\\' is decorated with Injectable.');\n}\n\n/**\n * Thrown when getting an object by index.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {}\n *\n * var injector = Injector.resolveAndCreate([A]);\n *\n * expect(() => injector.getAt(100)).toThrowError();\n * ```\n *\n */\nexport function outOfBoundsError(index: number) {\n return Error(`Index ${index} is out-of-bounds.`);\n}\n\n// TODO: add a working example after alpha38 is released\n/**\n * Thrown when a multi provider and a regular provider are bound to the same token.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\n * { provide: \"Strings\", useValue: \"string1\", multi: true},\n * { provide: \"Strings\", useValue: \"string2\", multi: false}\n * ])).toThrowError();\n * ```\n */\nexport function mixingMultiProvidersWithRegularProvidersError(\n provider1: any, provider2: any): Error {\n return Error(`Cannot mix multi providers and regular providers, got: ${provider1} ${provider2}`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {stringify} from '../util/stringify';\n\nimport {resolveForwardRef} from './forward_ref';\n\n\n/**\n * A unique object used for retrieving items from the {@link ReflectiveInjector}.\n *\n * Keys have:\n * - a system-wide unique `id`.\n * - a `token`.\n *\n * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows\n * the\n * injector to store created objects in a more efficient way.\n *\n * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when\n * resolving\n * providers.\n *\n * @deprecated No replacement\n * @publicApi\n */\nexport class ReflectiveKey {\n public readonly displayName: string;\n /**\n * Private\n */\n constructor(public token: Object, public id: number) {\n if (!token) {\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_INJECTION_TOKEN, ngDevMode && 'Token must be defined!');\n }\n this.displayName = stringify(this.token);\n }\n\n /**\n * Retrieves a `Key` for a token.\n */\n static get(token: Object): ReflectiveKey {\n return _globalKeyRegistry.get(resolveForwardRef(token));\n }\n\n /**\n * @returns the number of keys registered in the system.\n */\n static get numberOfKeys(): number {\n return _globalKeyRegistry.numberOfKeys;\n }\n}\n\nexport class KeyRegistry {\n private _allKeys = new Map<Object, ReflectiveKey>();\n\n get(token: Object): ReflectiveKey {\n if (token instanceof ReflectiveKey) return token;\n\n if (this._allKeys.has(token)) {\n return this._allKeys.get(token)!;\n }\n\n const newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);\n this._allKeys.set(token, newKey);\n return newKey;\n }\n\n get numberOfKeys(): number {\n return this._allKeys.size;\n }\n}\n\nconst _globalKeyRegistry = new KeyRegistry();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../interface/type';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from './interface/provider';\nimport {getReflect} from './jit/util';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {invalidProviderError, mixingMultiProvidersWithRegularProvidersError, noAnnotationError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\n\n\ninterface NormalizedProvider extends TypeProvider, ValueProvider, ClassProvider, ExistingProvider,\n FactoryProvider {}\n\n/**\n * `Dependency` is used by the framework to extend DI.\n * This is internal to Angular and should not be used directly.\n */\nexport class ReflectiveDependency {\n constructor(\n public key: ReflectiveKey, public optional: boolean, public visibility: Self|SkipSelf|null) {}\n\n static fromKey(key: ReflectiveKey): ReflectiveDependency {\n return new ReflectiveDependency(key, false, null);\n }\n}\n\nconst _EMPTY_LIST: any[] = [];\n\n/**\n * An internal resolved representation of a `Provider` used by the `Injector`.\n *\n * @usageNotes\n * This is usually created automatically by `Injector.resolveAndCreate`.\n *\n * It can be created manually, as follows:\n *\n * ### Example\n *\n * ```typescript\n * var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]);\n * var injector = Injector.fromResolvedProviders(resolvedProviders);\n *\n * expect(injector.get('message')).toEqual('Hello');\n * ```\n *\n * @publicApi\n */\nexport interface ResolvedReflectiveProvider {\n /**\n * A key, usually a `Type<any>`.\n */\n key: ReflectiveKey;\n\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n resolvedFactories: ResolvedReflectiveFactory[];\n\n /**\n * Indicates if the provider is a multi-provider or a regular provider.\n */\n multiProvider: boolean;\n}\n\nexport class ResolvedReflectiveProvider_ implements ResolvedReflectiveProvider {\n readonly resolvedFactory: ResolvedReflectiveFactory;\n\n constructor(\n public key: ReflectiveKey, public resolvedFactories: ResolvedReflectiveFactory[],\n public multiProvider: boolean) {\n this.resolvedFactory = this.resolvedFactories[0];\n }\n}\n\n/**\n * An internal resolved representation of a factory function created by resolving `Provider`.\n * @publicApi\n */\nexport class ResolvedReflectiveFactory {\n constructor(\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n public factory: Function,\n\n /**\n * Arguments (dependencies) to the `factory` function.\n */\n public dependencies: ReflectiveDependency[]) {}\n}\n\n\n/**\n * Resolve a single provider.\n */\nfunction resolveReflectiveFactory(provider: NormalizedProvider): ResolvedReflectiveFactory {\n let factoryFn: Function;\n let resolvedDeps: ReflectiveDependency[];\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = getReflect().factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n } else if (provider.useExisting) {\n factoryFn = (aliasInstance: any) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n } else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n } else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}\n\n/**\n * Converts the `Provider` into `ResolvedProvider`.\n *\n * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider\n * syntax.\n */\nfunction resolveReflectiveProvider(provider: NormalizedProvider): ResolvedReflectiveProvider {\n return new ResolvedReflectiveProvider_(\n ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)],\n provider.multi || false);\n}\n\n/**\n * Resolve a list of Providers.\n */\nexport function resolveReflectiveProviders(providers: Provider[]): ResolvedReflectiveProvider[] {\n const normalized = _normalizeProviders(providers, []);\n const resolved = normalized.map(resolveReflectiveProvider);\n const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}\n\n/**\n * Merges a list of ResolvedProviders into a list where each key is contained exactly once and\n * multi providers have been merged.\n */\nexport function mergeResolvedReflectiveProviders(\n providers: ResolvedReflectiveProvider[],\n normalizedProvidersMap: Map<number, ResolvedReflectiveProvider>):\n Map<number, ResolvedReflectiveProvider> {\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n const existing = normalizedProvidersMap.get(provider.key.id);\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n }\n if (provider.multiProvider) {\n for (let j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n } else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n } else {\n let resolvedProvider: ResolvedReflectiveProvider;\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(\n provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n } else {\n resolvedProvider = provider;\n }\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n return normalizedProvidersMap;\n}\n\nfunction _normalizeProviders(\n providers: Provider[], res: NormalizedProvider[]): NormalizedProvider[] {\n providers.forEach(b => {\n if (b instanceof Type) {\n res.push({provide: b, useClass: b} as NormalizedProvider);\n\n } else if (b && typeof b == 'object' && (b as any).provide !== undefined) {\n res.push(b as NormalizedProvider);\n\n } else if (Array.isArray(b)) {\n _normalizeProviders(b, res);\n\n } else {\n throw invalidProviderError(b);\n }\n });\n\n return res;\n}\n\nexport function constructDependencies(\n typeOrFunc: any, dependencies?: any[]): ReflectiveDependency[] {\n if (!dependencies) {\n return _dependenciesFor(typeOrFunc);\n } else {\n const params: any[][] = dependencies.map(t => [t]);\n return dependencies.map(t => _extractToken(typeOrFunc, t, params));\n }\n}\n\nfunction _dependenciesFor(typeOrFunc: any): ReflectiveDependency[] {\n const params = getReflect().parameters(typeOrFunc);\n\n if (!params) return [];\n if (params.some(p => p == null)) {\n throw noAnnotationError(typeOrFunc, params);\n }\n return params.map(p => _extractToken(typeOrFunc, p, params));\n}\n\nfunction _extractToken(\n typeOrFunc: any, metadata: any[]|any, params: any[][]): ReflectiveDependency {\n let token: any = null;\n let optional = false;\n\n if (!Array.isArray(metadata)) {\n if (metadata instanceof Inject) {\n return _createDependency(metadata.token, optional, null);\n } else {\n return _createDependency(metadata, optional, null);\n }\n }\n\n let visibility: Self|SkipSelf|null = null;\n\n for (let i = 0; i < metadata.length; ++i) {\n const paramMetadata = metadata[i];\n\n if (paramMetadata instanceof Type) {\n token = paramMetadata;\n\n } else if (paramMetadata instanceof Inject) {\n token = paramMetadata.token;\n\n } else if (paramMetadata instanceof Optional) {\n optional = true;\n\n } else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {\n visibility = paramMetadata;\n } else if (paramMetadata instanceof InjectionToken) {\n token = paramMetadata;\n }\n }\n\n token = resolveForwardRef(token);\n\n if (token != null) {\n return _createDependency(token, optional, visibility);\n } else {\n throw noAnnotationError(typeOrFunc, params);\n }\n}\n\nfunction _createDependency(\n token: any, optional: boolean, visibility: Self|SkipSelf|null): ReflectiveDependency {\n return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from './injector';\nimport {THROW_IF_NOT_FOUND} from './injector_compatibility';\nimport {Provider} from './interface/provider';\nimport {Self, SkipSelf} from './metadata';\nimport {cyclicDependencyError, instantiationError, noProviderError, outOfBoundsError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\nimport {ReflectiveDependency, ResolvedReflectiveFactory, ResolvedReflectiveProvider, resolveReflectiveProviders} from './reflective_provider';\n\n\n// Threshold for the dynamic version\nconst UNDEFINED = {};\n\n/**\n * A ReflectiveDependency injection container used for instantiating objects and resolving\n * dependencies.\n *\n * An `Injector` is a replacement for a `new` operator, which can automatically resolve the\n * constructor dependencies.\n *\n * In typical use, application code asks for the dependencies in the constructor and they are\n * resolved by the `Injector`.\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates an `Injector` configured to create `Engine` and `Car`.\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * var car = injector.get(Car);\n * expect(car instanceof Car).toBe(true);\n * expect(car.engine instanceof Engine).toBe(true);\n * ```\n *\n * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`\n * resolve all of the object's dependencies automatically.\n *\n * TODO: delete in v14.\n *\n * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.\n * @publicApi\n */\nexport abstract class ReflectiveInjector implements Injector {\n /**\n * Turns an array of provider definitions into an array of resolved providers.\n *\n * A resolution is a process of flattening multiple nested arrays and converting individual\n * providers into an array of `ResolvedReflectiveProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);\n *\n * expect(providers.length).toEqual(2);\n *\n * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);\n * expect(providers[0].key.displayName).toBe(\"Car\");\n * expect(providers[0].dependencies.length).toEqual(1);\n * expect(providers[0].factory).toBeDefined();\n *\n * expect(providers[1].key.displayName).toBe(\"Engine\");\n * });\n * ```\n *\n */\n static resolve(providers: Provider[]): ResolvedReflectiveProvider[] {\n return resolveReflectiveProviders(providers);\n }\n\n /**\n * Resolves an array of providers and creates an injector from those providers.\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);\n }\n\n /**\n * Creates an injector from previously resolved providers.\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, Engine]);\n * var injector = ReflectiveInjector.fromResolvedProviders(providers);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector):\n ReflectiveInjector {\n return new ReflectiveInjector_(providers, parent);\n }\n\n\n /**\n * Parent of this injector.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n */\n abstract get parent(): Injector|null;\n\n /**\n * Resolves an array of providers and creates a child injector from those providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parent = ReflectiveInjector.resolveAndCreate([ParentProvider]);\n * var child = parent.resolveAndCreateChild([ChildProvider]);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;\n\n /**\n * Creates a child injector from previously resolved providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parentProviders = ReflectiveInjector.resolve([ParentProvider]);\n * var childProviders = ReflectiveInjector.resolve([ChildProvider]);\n *\n * var parent = ReflectiveInjector.fromResolvedProviders(parentProviders);\n * var child = parent.createChildFromResolved(childProviders);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;\n\n /**\n * Resolves a provider and instantiates an object in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n *\n * var car = injector.resolveAndInstantiate(Car);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.resolveAndInstantiate(Car));\n * ```\n */\n abstract resolveAndInstantiate(provider: Provider): any;\n\n /**\n * Instantiates an object using a resolved provider in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n * var carProvider = ReflectiveInjector.resolve([Car])[0];\n * var car = injector.instantiateResolved(carProvider);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.instantiateResolved(carProvider));\n * ```\n */\n abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;\n\n abstract get(token: any, notFoundValue?: any): any;\n}\n\nexport class ReflectiveInjector_ implements ReflectiveInjector {\n private static INJECTOR_KEY = (/* @__PURE__ */ ReflectiveKey.get(Injector));\n /** @internal */\n _constructionCounter: number = 0;\n /** @internal */\n public _providers: ResolvedReflectiveProvider[];\n public readonly parent: Injector|null;\n\n keyIds: number[];\n objs: any[];\n /**\n * Private\n */\n constructor(_providers: ResolvedReflectiveProvider[], _parent?: Injector) {\n this._providers = _providers;\n this.parent = _parent || null;\n\n const len = _providers.length;\n\n this.keyIds = [];\n this.objs = [];\n\n for (let i = 0; i < len; i++) {\n this.keyIds[i] = _providers[i].key.id;\n this.objs[i] = UNDEFINED;\n }\n }\n\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);\n }\n\n resolveAndCreateChild(providers: Provider[]): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return this.createChildFromResolved(ResolvedReflectiveProviders);\n }\n\n createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector {\n const inj = new ReflectiveInjector_(providers);\n (inj as {parent: Injector | null}).parent = this;\n return inj;\n }\n\n resolveAndInstantiate(provider: Provider): any {\n return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);\n }\n\n instantiateResolved(provider: ResolvedReflectiveProvider): any {\n return this._instantiateProvider(provider);\n }\n\n getProviderAtIndex(index: number): ResolvedReflectiveProvider {\n if (index < 0 || index >= this._providers.length) {\n throw outOfBoundsError(index);\n }\n return this._providers[index];\n }\n\n /** @internal */\n _new(provider: ResolvedReflectiveProvider): any {\n if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {\n throw cyclicDependencyError(this, provider.key);\n }\n return this._instantiateProvider(provider);\n }\n\n private _getMaxNumberOfObjects(): number {\n return this.objs.length;\n }\n\n private _instantiateProvider(provider: ResolvedReflectiveProvider): any {\n if (provider.multiProvider) {\n const res = [];\n for (let i = 0; i < provider.resolvedFactories.length; ++i) {\n res[i] = this._instantiate(provider, provider.resolvedFactories[i]);\n }\n return res;\n } else {\n return this._instantiate(provider, provider.resolvedFactories[0]);\n }\n }\n\n private _instantiate(\n provider: ResolvedReflectiveProvider,\n ResolvedReflectiveFactory: ResolvedReflectiveFactory): any {\n const factory = ResolvedReflectiveFactory.factory;\n\n let deps: any[];\n try {\n deps =\n ResolvedReflectiveFactory.dependencies.map(dep => this._getByReflectiveDependency(dep));\n } catch (e: any) {\n if (e.addKey) {\n e.addKey(this, provider.key);\n }\n throw e;\n }\n\n let obj: any;\n try {\n obj = factory(...deps);\n } catch (e) {\n throw instantiationError(this, e, (e as Error).stack, provider.key);\n }\n\n return obj;\n }\n\n private _getByReflectiveDependency(dep: ReflectiveDependency): any {\n return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);\n }\n\n private _getByKey(key: ReflectiveKey, visibility: Self|SkipSelf|null, notFoundValue: any): any {\n if (key === ReflectiveInjector_.INJECTOR_KEY) {\n return this;\n }\n\n if (visibility instanceof Self) {\n return this._getByKeySelf(key, notFoundValue);\n\n } else {\n return this._getByKeyDefault(key, notFoundValue, visibility);\n }\n }\n\n private _getObjByKeyId(keyId: number): any {\n for (let i = 0; i < this.keyIds.length; i++) {\n if (this.keyIds[i] === keyId) {\n if (this.objs[i] === UNDEFINED) {\n this.objs[i] = this._new(this._providers[i]);\n }\n\n return this.objs[i];\n }\n }\n\n return UNDEFINED;\n }\n\n /** @internal */\n _throwOrNull(key: ReflectiveKey, notFoundValue: any): any {\n if (notFoundValue !== THROW_IF_NOT_FOUND) {\n return notFoundValue;\n } else {\n throw noProviderError(this, key);\n }\n }\n\n /** @internal */\n _getByKeySelf(key: ReflectiveKey, notFoundValue: any): any {\n const obj = this._getObjByKeyId(key.id);\n return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);\n }\n\n /** @internal */\n _getByKeyDefault(key: ReflectiveKey, notFoundValue: any, visibility: Self|SkipSelf|null): any {\n let inj: Injector|null;\n\n if (visibility instanceof SkipSelf) {\n inj = this.parent;\n } else {\n inj = this;\n }\n\n while (inj instanceof ReflectiveInjector_) {\n const inj_ = <ReflectiveInjector_>inj;\n const obj = inj_._getObjByKeyId(key.id);\n if (obj !== UNDEFINED) return obj;\n inj = inj_.parent;\n }\n if (inj !== null) {\n return inj.get(key.token, notFoundValue);\n } else {\n return this._throwOrNull(key, notFoundValue);\n }\n }\n\n get displayName(): string {\n const providers =\n _mapProviders(this, (b: ResolvedReflectiveProvider) => ' \"' + b.key.displayName + '\" ')\n .join(', ');\n return `ReflectiveInjector(providers: [${providers}])`;\n }\n\n toString(): string {\n return this.displayName;\n }\n}\n\nfunction _mapProviders(injector: ReflectiveInjector_, fn: Function): any[] {\n const res: any[] = [];\n for (let i = 0; i < injector._providers.length; ++i) {\n res[i] = fn(injector.getProviderAtIndex(i));\n }\n return res;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {InjectFlags, resolveForwardRef} from '../../di';\nimport {assertInjectImplementationNotEqual} from '../../di/inject_switch';\nimport {ɵɵinject} from '../../di/injector_compatibility';\nimport {ProviderToken} from '../../di/provider_token';\nimport {getOrCreateInjectable} from '../di';\nimport {TDirectiveHostNode} from '../interfaces/node';\nimport {getCurrentTNode, getLView} from '../state';\n\n/**\n * Returns the value associated to the given token from the injectors.\n *\n * `directiveInject` is intended to be used for directive, component and pipe factories.\n * All other injection use `inject` which does not walk the node injector tree.\n *\n * Usage example (in factory function):\n *\n * ```ts\n * class SomeDirective {\n * constructor(directive: DirectiveA) {}\n *\n * static ɵdir = ɵɵdefineDirective({\n * type: SomeDirective,\n * factory: () => new SomeDirective(ɵɵdirectiveInject(DirectiveA))\n * });\n * }\n * ```\n * @param token the type or token to inject\n * @param flags Injection flags\n * @returns the value from the injector or `null` when not found\n *\n * @codeGenApi\n */\nexport function ɵɵdirectiveInject<T>(token: ProviderToken<T>): T;\nexport function ɵɵdirectiveInject<T>(token: ProviderToken<T>, flags: InjectFlags): T;\nexport function ɵɵdirectiveInject<T>(token: ProviderToken<T>, flags = InjectFlags.Default): T|null {\n const lView = getLView();\n // Fall back to inject() if view hasn't been created. This situation can happen in tests\n // if inject utilities are used before bootstrapping.\n if (lView === null) {\n // Verify that we will not get into infinite loop.\n ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);\n return ɵɵinject(token, flags);\n }\n const tNode = getCurrentTNode();\n return getOrCreateInjectable<T>(\n tNode as TDirectiveHostNode, lView, resolveForwardRef(token), flags);\n}\n\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n * off, saving bytes of generated code while still providing a good experience in dev mode.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nexport function ɵɵinvalidFactory(): never {\n const msg =\n ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';\n throw new Error(msg);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../../di/injector';\nimport {ErrorHandler} from '../../error_handler';\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {DoCheck, OnChanges, OnInit} from '../../interface/lifecycle_hooks';\nimport {SchemaMetadata} from '../../metadata/schema';\nimport {ViewEncapsulation} from '../../metadata/view';\nimport {validateAgainstEventAttributes, validateAgainstEventProperties} from '../../sanitization/sanitization';\nimport {Sanitizer} from '../../sanitization/sanitizer';\nimport {assertDefined, assertEqual, assertGreaterThan, assertGreaterThanOrEqual, assertIndexInRange, assertNotEqual, assertNotSame, assertSame, assertString} from '../../util/assert';\nimport {escapeCommentText} from '../../util/dom';\nimport {normalizeDebugBindingName, normalizeDebugBindingValue} from '../../util/ng_reflect';\nimport {stringify} from '../../util/stringify';\nimport {assertFirstCreatePass, assertFirstUpdatePass, assertLContainer, assertLView, assertTNodeForLView, assertTNodeForTView} from '../assert';\nimport {attachPatchData} from '../context_discovery';\nimport {getFactoryDef} from '../definition_factory';\nimport {diPublicInInjector, getNodeInjectable, getOrCreateNodeInjectorForNode} from '../di';\nimport {throwMultipleComponentError} from '../errors';\nimport {executeCheckHooks, executeInitAndCheckHooks, incrementInitPhaseFlags} from '../hooks';\nimport {CONTAINER_HEADER_OFFSET, HAS_TRANSPLANTED_VIEWS, LContainer, MOVED_VIEWS} from '../interfaces/container';\nimport {ComponentDef, ComponentTemplate, DirectiveDef, DirectiveDefListOrFactory, HostBindingsFunction, HostDirectiveBindingMap, HostDirectiveDefs, PipeDefListOrFactory, RenderFlags, ViewQueriesFunction} from '../interfaces/definition';\nimport {NodeInjectorFactory} from '../interfaces/injector';\nimport {getUniqueLViewId} from '../interfaces/lview_tracking';\nimport {AttributeMarker, InitialInputData, InitialInputs, LocalRefExtractor, PropertyAliases, PropertyAliasValue, TAttributes, TConstantsOrFactory, TContainerNode, TDirectiveHostNode, TElementContainerNode, TElementNode, TIcuContainerNode, TNode, TNodeFlags, TNodeType, TProjectionNode} from '../interfaces/node';\nimport {Renderer, RendererFactory} from '../interfaces/renderer';\nimport {RComment, RElement, RNode, RText} from '../interfaces/renderer_dom';\nimport {SanitizerFn} from '../interfaces/sanitization';\nimport {isComponentDef, isComponentHost, isContentQueryHost, isRootView} from '../interfaces/type_checks';\nimport {CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTEXT, DECLARATION_COMPONENT_VIEW, DECLARATION_VIEW, EMBEDDED_VIEW_INJECTOR, FLAGS, HEADER_OFFSET, HOST, HostBindingOpCodes, ID, InitPhaseState, INJECTOR, LView, LViewFlags, NEXT, PARENT, RENDERER, RENDERER_FACTORY, SANITIZER, T_HOST, TData, TRANSPLANTED_VIEWS_TO_REFRESH, TVIEW, TView, TViewType} from '../interfaces/view';\nimport {assertPureTNodeType, assertTNodeType} from '../node_assert';\nimport {updateTextNode} from '../node_manipulation';\nimport {isInlineTemplate, isNodeMatchingSelectorList} from '../node_selector_matcher';\nimport {profiler, ProfilerEvent} from '../profiler';\nimport {enterView, getBindingsEnabled, getCurrentDirectiveIndex, getCurrentParentTNode, getCurrentTNode, getCurrentTNodePlaceholderOk, getSelectedIndex, isCurrentTNodeParent, isInCheckNoChangesMode, isInI18nBlock, leaveView, setBindingIndex, setBindingRootForHostBindings, setCurrentDirectiveIndex, setCurrentQueryIndex, setCurrentTNode, setIsInCheckNoChangesMode, setSelectedIndex} from '../state';\nimport {NO_CHANGE} from '../tokens';\nimport {mergeHostAttrs} from '../util/attrs_utils';\nimport {INTERPOLATION_DELIMITER} from '../util/misc_utils';\nimport {renderStringify, stringifyForError} from '../util/stringify_utils';\nimport {getFirstLContainer, getLViewParent, getNextLContainer} from '../util/view_traversal_utils';\nimport {getComponentLViewByIndex, getNativeByIndex, getNativeByTNode, isCreationMode, resetPreOrderHookFlags, unwrapLView, updateTransplantedViewCount, viewAttachedToChangeDetector} from '../util/view_utils';\n\nimport {selectIndexInternal} from './advance';\nimport {ɵɵdirectiveInject} from './di';\nimport {handleUnknownPropertyError, isPropertyValid, matchingSchemas} from './element_validation';\n\n/**\n * Invoke `HostBindingsFunction`s for view.\n *\n * This methods executes `TView.hostBindingOpCodes`. It is used to execute the\n * `HostBindingsFunction`s associated with the current `LView`.\n *\n * @param tView Current `TView`.\n * @param lView Current `LView`.\n */\nexport function processHostBindingOpCodes(tView: TView, lView: LView): void {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i] as number;\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n } else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i] as number;\n const hostBindingFn = hostBindingOpCodes[++i] as HostBindingsFunction<any>;\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n hostBindingFn(RenderFlags.Update, context);\n }\n }\n } finally {\n setSelectedIndex(-1);\n }\n}\n\n\n/** Refreshes all content queries declared by directives in a given view */\nfunction refreshContentQueries(tView: TView, lView: LView): void {\n const contentQueries = tView.contentQueries;\n if (contentQueries !== null) {\n for (let i = 0; i < contentQueries.length; i += 2) {\n const queryStartIdx = contentQueries[i];\n const directiveDefIdx = contentQueries[i + 1];\n if (directiveDefIdx !== -1) {\n const directiveDef = tView.data[directiveDefIdx] as DirectiveDef<any>;\n ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n ngDevMode &&\n assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n setCurrentQueryIndex(queryStartIdx);\n directiveDef.contentQueries!(RenderFlags.Update, lView[directiveDefIdx], directiveDefIdx);\n }\n }\n }\n}\n\n/** Refreshes child components in the current view (update mode). */\nfunction refreshChildComponents(hostLView: LView, components: number[]): void {\n for (let i = 0; i < components.length; i++) {\n refreshComponent(hostLView, components[i]);\n }\n}\n\n/** Renders child components in the current view (creation mode). */\nfunction renderChildComponents(hostLView: LView, components: number[]): void {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}\n\nexport function createLView<T>(\n parentLView: LView|null, tView: TView, context: T|null, flags: LViewFlags, host: RElement|null,\n tHostNode: TNode|null, rendererFactory: RendererFactory|null, renderer: Renderer|null,\n sanitizer: Sanitizer|null, injector: Injector|null,\n embeddedViewInjector: Injector|null): LView {\n const lView = tView.blueprint.slice() as LView;\n lView[HOST] = host;\n lView[FLAGS] = flags | LViewFlags.CreationMode | LViewFlags.Attached | LViewFlags.FirstLViewPass;\n if (embeddedViewInjector !== null ||\n (parentLView && (parentLView[FLAGS] & LViewFlags.HasEmbeddedViewInjector))) {\n lView[FLAGS] |= LViewFlags.HasEmbeddedViewInjector;\n }\n resetPreOrderHookFlags(lView);\n ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY])!;\n ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required');\n lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER])!;\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null!;\n lView[INJECTOR as any] = injector || parentLView && parentLView[INJECTOR] || null;\n lView[T_HOST] = tHostNode;\n lView[ID] = getUniqueLViewId();\n lView[EMBEDDED_VIEW_INJECTOR as any] = embeddedViewInjector;\n ngDevMode &&\n assertEqual(\n tView.type == TViewType.Embedded ? parentLView !== null : true, true,\n 'Embedded views must have parentLView');\n lView[DECLARATION_COMPONENT_VIEW] =\n tView.type == TViewType.Embedded ? parentLView![DECLARATION_COMPONENT_VIEW] : lView;\n return lView;\n}\n\n/**\n * Create and stores the TNode, and hooks it up to the tree.\n *\n * @param tView The current `TView`.\n * @param index The index at which the TNode should be saved (null if view, since they are not\n * saved).\n * @param type The type of TNode to create\n * @param native The native element for this node, if applicable\n * @param name The tag name of the associated native element, if applicable\n * @param attrs Any attrs for the native element, if applicable\n */\nexport function getOrCreateTNode(\n tView: TView, index: number, type: TNodeType.Element|TNodeType.Text, name: string|null,\n attrs: TAttributes|null): TElementNode;\nexport function getOrCreateTNode(\n tView: TView, index: number, type: TNodeType.Container, name: string|null,\n attrs: TAttributes|null): TContainerNode;\nexport function getOrCreateTNode(\n tView: TView, index: number, type: TNodeType.Projection, name: null,\n attrs: TAttributes|null): TProjectionNode;\nexport function getOrCreateTNode(\n tView: TView, index: number, type: TNodeType.ElementContainer, name: string|null,\n attrs: TAttributes|null): TElementContainerNode;\nexport function getOrCreateTNode(\n tView: TView, index: number, type: TNodeType.Icu, name: null,\n attrs: TAttributes|null): TElementContainerNode;\nexport function getOrCreateTNode(\n tView: TView, index: number, type: TNodeType, name: string|null, attrs: TAttributes|null):\n TElementNode&TContainerNode&TElementContainerNode&TProjectionNode&TIcuContainerNode {\n ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, 'TNodes can\\'t be in the LView header.');\n // Keep this function short, so that the VM will inline it.\n ngDevMode && assertPureTNodeType(type);\n let tNode = tView.data[index] as TNode;\n if (tNode === null) {\n tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n if (isInI18nBlock()) {\n // If we are in i18n block then all elements should be pre declared through `Placeholder`\n // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n // If the `TNode` was not pre-declared than it means it was not mentioned which means it was\n // removed, so we mark it as detached.\n tNode.flags |= TNodeFlags.isDetached;\n }\n } else if (tNode.type & TNodeType.Placeholder) {\n tNode.type = type;\n tNode.value = name;\n tNode.attrs = attrs;\n const parent = getCurrentParentTNode();\n tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n ngDevMode && assertTNodeForTView(tNode, tView);\n ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n }\n setCurrentTNode(tNode, true);\n return tNode as TElementNode & TContainerNode & TElementContainerNode & TProjectionNode &\n TIcuContainerNode;\n}\n\nexport function createTNodeAtIndex(\n tView: TView, index: number, type: TNodeType, name: string|null, attrs: TAttributes|null) {\n const currentTNode = getCurrentTNodePlaceholderOk();\n const isParent = isCurrentTNodeParent();\n const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n // Parents cannot cross component boundaries because components will be used in multiple places.\n const tNode = tView.data[index] =\n createTNode(tView, parent as TElementNode | TContainerNode, type, index, name, attrs);\n // Assign a pointer to the first child node of a given view. The first node is not always the one\n // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has\n // the index 1 or more, so we can't just check node index.\n if (tView.firstChild === null) {\n tView.firstChild = tNode;\n }\n if (currentTNode !== null) {\n if (isParent) {\n // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?\n if (currentTNode.child == null && tNode.parent !== null) {\n // We are in the same view, which means we are adding content node to the parent view.\n currentTNode.child = tNode;\n }\n } else {\n if (currentTNode.next === null) {\n // In the case of i18n the `currentTNode` may already be linked, in which case we don't want\n // to break the links which i18n created.\n currentTNode.next = tNode;\n tNode.prev = currentTNode;\n }\n }\n }\n return tNode;\n}\n\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply()), we need to adjust the blueprint for future\n * template passes.\n *\n * @param tView `TView` associated with `LView`\n * @param lView The `LView` containing the blueprint to adjust\n * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0\n * @param initialValue Initial value to store in blueprint\n */\nexport function allocExpando(\n tView: TView, lView: LView, numSlotsToAlloc: number, initialValue: any): number {\n if (numSlotsToAlloc === 0) return -1;\n if (ngDevMode) {\n assertFirstCreatePass(tView);\n assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');\n assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n assertEqual(\n tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n assertFirstUpdatePass(tView);\n }\n const allocIdx = lView.length;\n for (let i = 0; i < numSlotsToAlloc; i++) {\n lView.push(initialValue);\n tView.blueprint.push(initialValue);\n tView.data.push(null);\n }\n return allocIdx;\n}\n\n\n//////////////////////////\n//// Render\n//////////////////////////\n\n/**\n * Processes a view in the creation mode. This includes a number of steps in a specific order:\n * - creating view query functions (if any);\n * - executing a template function in the creation mode;\n * - updating static queries (if any);\n * - creating child components defined in a given view.\n */\nexport function renderView<T>(tView: TView, lView: LView<T>, context: T): void {\n ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n enterView(lView);\n try {\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn<T>(RenderFlags.Create, viewQuery, context);\n }\n\n // Execute a template associated with this view, if it exists. A template function might not be\n // defined for the root component views.\n const templateFn = tView.template;\n if (templateFn !== null) {\n executeTemplate<T>(tView, lView, templateFn, RenderFlags.Create, context);\n }\n\n // This needs to be set before children are processed to support recursive components.\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstCreatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n if (tView.firstCreatePass) {\n tView.firstCreatePass = false;\n }\n\n // We resolve content queries specifically marked as `static` in creation mode. Dynamic\n // content queries are resolved during change detection (i.e. update mode), after embedded\n // views are refreshed (see block above).\n if (tView.staticContentQueries) {\n refreshContentQueries(tView, lView);\n }\n\n // We must materialize query results before child components are processed\n // in case a child component has projected a container. The LContainer needs\n // to exist so the embedded views are properly attached by the container.\n if (tView.staticViewQueries) {\n executeViewQueryFn<T>(RenderFlags.Update, tView.viewQuery!, context);\n }\n\n // Render child component views.\n const components = tView.components;\n if (components !== null) {\n renderChildComponents(lView, components);\n }\n\n } catch (error) {\n // If we didn't manage to get past the first template pass due to\n // an error, mark the view as corrupted so we can try to recover.\n if (tView.firstCreatePass) {\n tView.incompleteFirstPass = true;\n tView.firstCreatePass = false;\n }\n\n throw error;\n } finally {\n lView[FLAGS] &= ~LViewFlags.CreationMode;\n leaveView();\n }\n}\n\n/**\n * Processes a view in update mode. This includes a number of steps in a specific order:\n * - executing a template function in update mode;\n * - executing hooks;\n * - refreshing queries;\n * - setting host bindings;\n * - refreshing child (embedded and component) views.\n */\nexport function refreshView<T>(\n tView: TView, lView: LView, templateFn: ComponentTemplate<{}>|null, context: T) {\n ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n const flags = lView[FLAGS];\n if ((flags & LViewFlags.Destroyed) === LViewFlags.Destroyed) return;\n enterView(lView);\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to execute lifecycle hooks in that mode.\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n try {\n resetPreOrderHookFlags(lView);\n\n setBindingIndex(tView.bindingStartIndex);\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, RenderFlags.Update, context);\n }\n\n const hooksInitPhaseCompleted =\n (flags & LViewFlags.InitPhaseStateMask) === InitPhaseState.InitPhaseCompleted;\n\n // execute pre-order hooks (OnInit, OnChanges, DoCheck)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, null);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, InitPhaseState.OnInitHooksToBeRun, null);\n }\n incrementInitPhaseFlags(lView, InitPhaseState.OnInitHooksToBeRun);\n }\n }\n\n // First mark transplanted views that are declared in this lView as needing a refresh at their\n // insertion points. This is needed to avoid the situation where the template is defined in this\n // `LView` but its declaration appears after the insertion component.\n markTransplantedViewsForRefresh(lView);\n refreshEmbeddedViews(lView);\n\n // Content query results must be refreshed before content hooks are called.\n if (tView.contentQueries !== null) {\n refreshContentQueries(tView, lView);\n }\n\n // execute content hooks (AfterContentInit, AfterContentChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const contentCheckHooks = tView.contentCheckHooks;\n if (contentCheckHooks !== null) {\n executeCheckHooks(lView, contentCheckHooks);\n }\n } else {\n const contentHooks = tView.contentHooks;\n if (contentHooks !== null) {\n executeInitAndCheckHooks(\n lView, contentHooks, InitPhaseState.AfterContentInitHooksToBeRun);\n }\n incrementInitPhaseFlags(lView, InitPhaseState.AfterContentInitHooksToBeRun);\n }\n }\n\n processHostBindingOpCodes(tView, lView);\n\n // Refresh child component views.\n const components = tView.components;\n if (components !== null) {\n refreshChildComponents(lView, components);\n }\n\n // View queries must execute after refreshing child components because a template in this view\n // could be inserted in a child component. If the view query executes before child component\n // refresh, the template might not yet be inserted.\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn<T>(RenderFlags.Update, viewQuery, context);\n }\n\n // execute view hooks (AfterViewInit, AfterViewChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const viewCheckHooks = tView.viewCheckHooks;\n if (viewCheckHooks !== null) {\n executeCheckHooks(lView, viewCheckHooks);\n }\n } else {\n const viewHooks = tView.viewHooks;\n if (viewHooks !== null) {\n executeInitAndCheckHooks(lView, viewHooks, InitPhaseState.AfterViewInitHooksToBeRun);\n }\n incrementInitPhaseFlags(lView, InitPhaseState.AfterViewInitHooksToBeRun);\n }\n }\n if (tView.firstUpdatePass === true) {\n // We need to make sure that we only flip the flag on successful `refreshView` only\n // Don't do this in `finally` block.\n // If we did this in `finally` block then an exception could block the execution of styling\n // instructions which in turn would be unable to insert themselves into the styling linked\n // list. The result of this would be that if the exception would not be throw on subsequent CD\n // the styling would be unable to process it data and reflect to the DOM.\n tView.firstUpdatePass = false;\n }\n\n // Do not reset the dirty state when running in check no changes mode. We don't want components\n // to behave differently depending on whether check no changes is enabled or not. For example:\n // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to\n // refresh a `NgClass` binding should work. If we would reset the dirty state in the check\n // no changes cycle, the component would be not be dirty for the next update pass. This would\n // be different in production mode where the component dirty state is not reset.\n if (!isInCheckNoChangesPass) {\n lView[FLAGS] &= ~(LViewFlags.Dirty | LViewFlags.FirstLViewPass);\n }\n if (lView[FLAGS] & LViewFlags.RefreshTransplantedView) {\n lView[FLAGS] &= ~LViewFlags.RefreshTransplantedView;\n updateTransplantedViewCount(lView[PARENT] as LContainer, -1);\n }\n } finally {\n leaveView();\n }\n}\n\nfunction executeTemplate<T>(\n tView: TView, lView: LView<T>, templateFn: ComponentTemplate<T>, rf: RenderFlags, context: T) {\n const prevSelectedIndex = getSelectedIndex();\n const isUpdatePhase = rf & RenderFlags.Update;\n try {\n setSelectedIndex(-1);\n if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n // When we're updating, inherently select 0 so we don't\n // have to generate that instruction for most update blocks.\n selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());\n }\n\n const preHookType =\n isUpdatePhase ? ProfilerEvent.TemplateUpdateStart : ProfilerEvent.TemplateCreateStart;\n profiler(preHookType, context as unknown as {});\n templateFn(rf, context);\n } finally {\n setSelectedIndex(prevSelectedIndex);\n\n const postHookType =\n isUpdatePhase ? ProfilerEvent.TemplateUpdateEnd : ProfilerEvent.TemplateCreateEnd;\n profiler(postHookType, context as unknown as {});\n }\n}\n\n//////////////////////////\n//// Element\n//////////////////////////\n\nexport function executeContentQueries(tView: TView, tNode: TNode, lView: LView) {\n if (isContentQueryHost(tNode)) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const def = tView.data[directiveIndex] as DirectiveDef<any>;\n if (def.contentQueries) {\n def.contentQueries(RenderFlags.Create, lView[directiveIndex], directiveIndex);\n }\n }\n }\n}\n\n\n/**\n * Creates directive instances.\n */\nexport function createDirectivesInstances(tView: TView, lView: LView, tNode: TDirectiveHostNode) {\n if (!getBindingsEnabled()) return;\n instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));\n if ((tNode.flags & TNodeFlags.hasHostBindings) === TNodeFlags.hasHostBindings) {\n invokeDirectivesHostBindings(tView, lView, tNode);\n }\n}\n\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nexport function saveResolvedLocalsInData(\n viewData: LView, tNode: TDirectiveHostNode,\n localRefExtractor: LocalRefExtractor = getNativeByTNode): void {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1] as number;\n const value = index === -1 ?\n localRefExtractor(\n tNode as TElementNode | TContainerNode | TElementContainerNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param def ComponentDef\n * @returns TView\n */\nexport function getOrCreateComponentTView(def: ComponentDef<any>): TView {\n const tView = def.tView;\n\n // Create a TView if there isn't one, or recreate it if the first create pass didn't\n // complete successfully since we can't know for sure whether it's in a usable shape.\n if (tView === null || tView.incompleteFirstPass) {\n // Declaration node here is null since this function is called when we dynamically create a\n // component and hence there is no declaration.\n const declTNode = null;\n return def.tView = createTView(\n TViewType.Component, declTNode, def.template, def.decls, def.vars, def.directiveDefs,\n def.pipeDefs, def.viewQuery, def.schemas, def.consts);\n }\n\n return tView;\n}\n\n\n/**\n * Creates a TView instance\n *\n * @param type Type of `TView`.\n * @param declTNode Declaration location of this `TView`.\n * @param templateFn Template function\n * @param decls The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n * @param viewQuery View queries for this view\n * @param schemas Schemas for this view\n * @param consts Constants for this view\n */\nexport function createTView(\n type: TViewType, declTNode: TNode|null, templateFn: ComponentTemplate<any>|null, decls: number,\n vars: number, directives: DirectiveDefListOrFactory|null, pipes: PipeDefListOrFactory|null,\n viewQuery: ViewQueriesFunction<any>|null, schemas: SchemaMetadata[]|null,\n constsOrFactory: TConstantsOrFactory|null): TView {\n ngDevMode && ngDevMode.tView++;\n const bindingStartIndex = HEADER_OFFSET + decls;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n const tView = blueprint[TVIEW as any] = {\n type: type,\n blueprint: blueprint,\n template: templateFn,\n queries: null,\n viewQuery: viewQuery,\n declTNode: declTNode,\n data: blueprint.slice().fill(null, bindingStartIndex),\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n hostBindingOpCodes: null,\n firstCreatePass: true,\n firstUpdatePass: true,\n staticViewQueries: false,\n staticContentQueries: false,\n preOrderHooks: null,\n preOrderCheckHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n schemas: schemas,\n consts: consts,\n incompleteFirstPass: false\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tView retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tView);\n }\n return tView;\n}\n\nfunction createViewBlueprint(bindingStartIndex: number, initialViewLength: number): LView {\n const blueprint = [];\n\n for (let i = 0; i < initialViewLength; i++) {\n blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n }\n\n return blueprint as LView;\n}\n\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param rendererFactory Factory function to create renderer instance.\n * @param elementOrSelector Render element or CSS selector to locate the element.\n * @param encapsulation View Encapsulation defined for component that requests host element.\n */\nexport function locateHostElement(\n renderer: Renderer, elementOrSelector: RElement|string,\n encapsulation: ViewEncapsulation): RElement {\n // When using native Shadow DOM, do not clear host element to allow native slot projection\n const preserveContent = encapsulation === ViewEncapsulation.ShadowDom;\n return renderer.selectRootElement(elementOrSelector, preserveContent);\n}\n\n/**\n * Saves context for this cleanup function in LView.cleanupInstances.\n *\n * On the first template pass, saves in TView:\n * - Cleanup function\n * - Index of context we just saved in LView.cleanupInstances\n *\n * This function can also be used to store instance specific cleanup fns. In that case the `context`\n * is `null` and the function is store in `LView` (rather than it `TView`).\n */\nexport function storeCleanupWithContext(\n tView: TView, lView: LView, context: any, cleanupFn: Function): void {\n const lCleanup = getOrCreateLViewCleanup(lView);\n if (context === null) {\n // If context is null that this is instance specific callback. These callbacks can only be\n // inserted after template shared instances. For this reason in ngDevMode we freeze the TView.\n if (ngDevMode) {\n Object.freeze(getOrCreateTViewCleanup(tView));\n }\n lCleanup.push(cleanupFn);\n } else {\n lCleanup.push(context);\n\n if (tView.firstCreatePass) {\n getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);\n }\n }\n}\n\n/**\n * Constructs a TNode object from the arguments.\n *\n * @param tView `TView` to which this `TNode` belongs\n * @param tParent Parent `TNode`\n * @param type The type of the node\n * @param index The index of the TNode in TView.data, adjusted for HEADER_OFFSET\n * @param tagName The tag name of the node\n * @param attrs The attributes defined on this node\n * @returns the TNode object\n */\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType.Container,\n index: number, tagName: string|null, attrs: TAttributes|null): TContainerNode;\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType.Element|TNodeType.Text,\n index: number, tagName: string|null, attrs: TAttributes|null): TElementNode;\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType.ElementContainer,\n index: number, tagName: string|null, attrs: TAttributes|null): TElementContainerNode;\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType.Icu, index: number,\n tagName: string|null, attrs: TAttributes|null): TIcuContainerNode;\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType.Projection,\n index: number, tagName: string|null, attrs: TAttributes|null): TProjectionNode;\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType, index: number,\n tagName: string|null, attrs: TAttributes|null): TNode;\nexport function createTNode(\n tView: TView, tParent: TElementNode|TContainerNode|null, type: TNodeType, index: number,\n value: string|null, attrs: TAttributes|null): TNode {\n ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, 'TNodes can\\'t be in the LView header.');\n ngDevMode && assertNotSame(attrs, undefined, '\\'undefined\\' is not valid value for \\'attrs\\'');\n ngDevMode && ngDevMode.tNode++;\n ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n let injectorIndex = tParent ? tParent.injectorIndex : -1;\n const tNode = {\n type,\n index,\n insertBeforeIndex: null,\n injectorIndex,\n directiveStart: -1,\n directiveEnd: -1,\n directiveStylingLast: -1,\n componentOffset: -1,\n propertyBindings: null,\n flags: 0,\n providerIndexes: 0,\n value: value,\n attrs: attrs,\n mergedAttrs: null,\n localNames: null,\n initialInputs: undefined,\n inputs: null,\n outputs: null,\n tView: null,\n next: null,\n prev: null,\n projectionNext: null,\n child: null,\n parent: tParent,\n projection: null,\n styles: null,\n stylesWithoutHost: null,\n residualStyles: undefined,\n classes: null,\n classesWithoutHost: null,\n residualClasses: undefined,\n classBindings: 0 as any,\n styleBindings: 0 as any,\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tNode retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tNode);\n }\n return tNode;\n}\n\n/**\n * Generates the `PropertyAliases` data structure from the provided input/output mapping.\n * @param aliasMap Input/output mapping from the directive definition.\n * @param directiveIndex Index of the directive.\n * @param propertyAliases Object in which to store the results.\n * @param hostDirectiveAliasMap Object used to alias or filter out properties for host directives.\n * If the mapping is provided, it'll act as an allowlist, as well as a mapping of what public\n * name inputs/outputs should be exposed under.\n */\nfunction generatePropertyAliases(\n aliasMap: {[publicName: string]: string}, directiveIndex: number,\n propertyAliases: PropertyAliases|null,\n hostDirectiveAliasMap: HostDirectiveBindingMap|null): PropertyAliases|null {\n for (let publicName in aliasMap) {\n if (aliasMap.hasOwnProperty(publicName)) {\n propertyAliases = propertyAliases === null ? {} : propertyAliases;\n const internalName = aliasMap[publicName];\n\n // If there are no host directive mappings, we want to remap using the alias map from the\n // definition itself. If there is an alias map, it has two functions:\n // 1. It serves as an allowlist of bindings that are exposed by the host directives. Only the\n // ones inside the host directive map will be exposed on the host.\n // 2. The public name of the property is aliased using the host directive alias map, rather\n // than the alias map from the definition.\n if (hostDirectiveAliasMap === null) {\n addPropertyAlias(propertyAliases, directiveIndex, publicName, internalName);\n } else if (hostDirectiveAliasMap.hasOwnProperty(publicName)) {\n addPropertyAlias(\n propertyAliases, directiveIndex, hostDirectiveAliasMap[publicName], internalName);\n }\n }\n }\n return propertyAliases;\n}\n\nfunction addPropertyAlias(\n propertyAliases: PropertyAliases, directiveIndex: number, publicName: string,\n internalName: string) {\n if (propertyAliases.hasOwnProperty(publicName)) {\n propertyAliases[publicName].push(directiveIndex, internalName);\n } else {\n propertyAliases[publicName] = [directiveIndex, internalName];\n }\n}\n\n/**\n * Initializes data structures required to work with directive inputs and outputs.\n * Initialization is done for all directives matched on a given TNode.\n */\nfunction initializeInputAndOutputAliases(\n tView: TView, tNode: TNode, hostDirectiveDefinitionMap: HostDirectiveDefs|null): void {\n ngDevMode && assertFirstCreatePass(tView);\n\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const tViewData = tView.data;\n\n const tNodeAttrs = tNode.attrs;\n const inputsFromAttrs: InitialInputData = [];\n let inputsStore: PropertyAliases|null = null;\n let outputsStore: PropertyAliases|null = null;\n\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const directiveDef = tViewData[directiveIndex] as DirectiveDef<any>;\n const aliasData =\n hostDirectiveDefinitionMap ? hostDirectiveDefinitionMap.get(directiveDef) : null;\n const aliasedInputs = aliasData ? aliasData.inputs : null;\n const aliasedOutputs = aliasData ? aliasData.outputs : null;\n\n inputsStore =\n generatePropertyAliases(directiveDef.inputs, directiveIndex, inputsStore, aliasedInputs);\n outputsStore =\n generatePropertyAliases(directiveDef.outputs, directiveIndex, outputsStore, aliasedOutputs);\n // Do not use unbound attributes as inputs to structural directives, since structural\n // directive inputs can only be set using microsyntax (e.g. `<div *dir=\"exp\">`).\n // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which\n // should be set for inline templates.\n const initialInputs =\n (inputsStore !== null && tNodeAttrs !== null && !isInlineTemplate(tNode)) ?\n generateInitialInputs(inputsStore, directiveIndex, tNodeAttrs) :\n null;\n inputsFromAttrs.push(initialInputs);\n }\n\n if (inputsStore !== null) {\n if (inputsStore.hasOwnProperty('class')) {\n tNode.flags |= TNodeFlags.hasClassInput;\n }\n if (inputsStore.hasOwnProperty('style')) {\n tNode.flags |= TNodeFlags.hasStyleInput;\n }\n }\n\n tNode.initialInputs = inputsFromAttrs;\n tNode.inputs = inputsStore;\n tNode.outputs = outputsStore;\n}\n\n/**\n * Mapping between attributes names that don't correspond to their element property names.\n *\n * Performance note: this function is written as a series of if checks (instead of, say, a property\n * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of\n * mapping property names. Do NOT change without benchmarking.\n *\n * Note: this mapping has to be kept in sync with the equally named mapping in the template\n * type-checking machinery of ngtsc.\n */\nfunction mapPropName(name: string): string {\n if (name === 'class') return 'className';\n if (name === 'for') return 'htmlFor';\n if (name === 'formaction') return 'formAction';\n if (name === 'innerHtml') return 'innerHTML';\n if (name === 'readonly') return 'readOnly';\n if (name === 'tabindex') return 'tabIndex';\n return name;\n}\n\nexport function elementPropertyInternal<T>(\n tView: TView, tNode: TNode, lView: LView, propName: string, value: T, renderer: Renderer,\n sanitizer: SanitizerFn|null|undefined, nativeOnly: boolean): void {\n ngDevMode && assertNotSame(value, NO_CHANGE as any, 'Incoming value should never be NO_CHANGE.');\n const element = getNativeByTNode(tNode, lView) as RElement | RComment;\n let inputData = tNode.inputs;\n let dataValue: PropertyAliasValue|undefined;\n if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {\n setInputsForProperty(tView, lView, dataValue, propName, value);\n if (isComponentHost(tNode)) markDirtyIfOnPush(lView, tNode.index);\n if (ngDevMode) {\n setNgReflectProperties(lView, element, tNode.type, dataValue, value);\n }\n } else if (tNode.type & TNodeType.AnyRNode) {\n propName = mapPropName(propName);\n\n if (ngDevMode) {\n validateAgainstEventProperties(propName);\n if (!isPropertyValid(element, propName, tNode.value, tView.schemas)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n ngDevMode.rendererSetProperty++;\n }\n\n // It is assumed that the sanitizer is only added when the compiler determines that the\n // property is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? (sanitizer(value, tNode.value || '', propName) as any) : value;\n renderer.setProperty(element as RElement, propName, value);\n } else if (tNode.type & TNodeType.AnyContainer) {\n // If the node is a container and the property didn't\n // match any of the inputs or schemas we should throw.\n if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n}\n\n/** If node is an OnPush component, marks its LView dirty. */\nexport function markDirtyIfOnPush(lView: LView, viewIndex: number): void {\n ngDevMode && assertLView(lView);\n const childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & LViewFlags.CheckAlways)) {\n childComponentLView[FLAGS] |= LViewFlags.Dirty;\n }\n}\n\nfunction setNgReflectProperty(\n lView: LView, element: RElement|RComment, type: TNodeType, attrName: string, value: any) {\n const renderer = lView[RENDERER];\n attrName = normalizeDebugBindingName(attrName);\n const debugValue = normalizeDebugBindingValue(value);\n if (type & TNodeType.AnyRNode) {\n if (value == null) {\n renderer.removeAttribute((element as RElement), attrName);\n } else {\n renderer.setAttribute((element as RElement), attrName, debugValue);\n }\n } else {\n const textContent =\n escapeCommentText(`bindings=${JSON.stringify({[attrName]: debugValue}, null, 2)}`);\n renderer.setValue((element as RComment), textContent);\n }\n}\n\nexport function setNgReflectProperties(\n lView: LView, element: RElement|RComment, type: TNodeType, dataValue: PropertyAliasValue,\n value: any) {\n if (type & (TNodeType.AnyRNode | TNodeType.Container)) {\n /**\n * dataValue is an array containing runtime input or output names for the directives:\n * i+0: directive instance index\n * i+1: privateName\n *\n * e.g. [0, 'change', 'change-minified']\n * we want to set the reflected property with the privateName: dataValue[i+1]\n */\n for (let i = 0; i < dataValue.length; i += 2) {\n setNgReflectProperty(lView, element, type, dataValue[i + 1] as string, value);\n }\n }\n}\n\n/**\n * Resolve the matched directives on a node.\n */\nexport function resolveDirectives(\n tView: TView, lView: LView, tNode: TElementNode|TContainerNode|TElementContainerNode,\n localRefs: string[]|null): void {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in\n // tsickle.\n ngDevMode && assertFirstCreatePass(tView);\n\n if (getBindingsEnabled()) {\n const exportsMap: ({[key: string]: number}|null) = localRefs === null ? null : {'': -1};\n const matchResult = findDirectiveDefMatches(tView, tNode);\n let directiveDefs: DirectiveDef<unknown>[]|null;\n let hostDirectiveDefs: HostDirectiveDefs|null;\n\n if (matchResult === null) {\n directiveDefs = hostDirectiveDefs = null;\n } else {\n [directiveDefs, hostDirectiveDefs] = matchResult;\n }\n\n if (directiveDefs !== null) {\n initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);\n }\n if (exportsMap) cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n}\n\n/** Initializes the data structures necessary for a list of directives to be instantiated. */\nexport function initializeDirectives(\n tView: TView, lView: LView<unknown>, tNode: TElementNode|TContainerNode|TElementContainerNode,\n directives: DirectiveDef<unknown>[], exportsMap: {[key: string]: number;}|null,\n hostDirectiveDefs: HostDirectiveDefs|null) {\n ngDevMode && assertFirstCreatePass(tView);\n\n // Publishes the directive types to DI so they can be injected. Needs to\n // happen in a separate pass before the TNode flags have been initialized.\n for (let i = 0; i < directives.length; i++) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, directives[i].type);\n }\n\n initTNodeFlags(tNode, tView.data.length, directives.length);\n\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i];\n if (def.providersResolver) def.providersResolver(def);\n }\n let preOrderHooksFound = false;\n let preOrderCheckHooksFound = false;\n let directiveIdx = allocExpando(tView, lView, directives.length, null);\n ngDevMode &&\n assertSame(\n directiveIdx, tNode.directiveStart,\n 'TNode.directiveStart should point to just allocated space');\n\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i];\n // Merge the attrs in the order of matches. This assumes that the first directive is the\n // component itself, so that the component has the least priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n\n configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n saveNameToExportMap(directiveIdx, def, exportsMap);\n\n if (def.contentQueries !== null) tNode.flags |= TNodeFlags.hasContentQuery;\n if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)\n tNode.flags |= TNodeFlags.hasHostBindings;\n\n const lifeCycleHooks: OnChanges&OnInit&DoCheck = def.type.prototype;\n // Only push a node index into the preOrderHooks array if this is the first\n // pre-order hook found on this node.\n if (!preOrderHooksFound &&\n (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n // We will push the actual hook function into this array later during dir instantiation.\n // We cannot do it now because we must ensure hooks are registered in the same\n // order that directives are created (i.e. injection order).\n (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);\n preOrderHooksFound = true;\n }\n\n if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);\n preOrderCheckHooksFound = true;\n }\n\n directiveIdx++;\n }\n\n initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);\n}\n\n/**\n * Add `hostBindings` to the `TView.hostBindingOpCodes`.\n *\n * @param tView `TView` to which the `hostBindings` should be added.\n * @param tNode `TNode` the element which contains the directive\n * @param directiveIdx Directive index in view.\n * @param directiveVarsIdx Where will the directive's vars be stored\n * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.\n */\nexport function registerHostBindingOpCodes(\n tView: TView, tNode: TNode, directiveIdx: number, directiveVarsIdx: number,\n def: ComponentDef<any>|DirectiveDef<any>): void {\n ngDevMode && assertFirstCreatePass(tView);\n\n const hostBindings = def.hostBindings;\n if (hostBindings) {\n let hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) {\n hostBindingOpCodes = tView.hostBindingOpCodes = [] as any as HostBindingOpCodes;\n }\n const elementIndx = ~tNode.index;\n if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n // Conditionally add select element so that we are more efficient in execution.\n // NOTE: this is strictly not necessary and it trades code size for runtime perf.\n // (We could just always add it.)\n hostBindingOpCodes.push(elementIndx);\n }\n hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n }\n}\n\n/**\n * Returns the last selected element index in the `HostBindingOpCodes`\n *\n * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only\n * if it changes. This method returns the last index (or '0' if not found.)\n *\n * Selected element index are only the ones which are negative.\n */\nfunction lastSelectedElementIdx(hostBindingOpCodes: HostBindingOpCodes): number {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}\n\n\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(\n tView: TView, lView: LView, tNode: TDirectiveHostNode, native: RNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n\n // The component view needs to be created before creating the node injector\n // since it is used to inject some special symbols like `ChangeDetectorRef`.\n if (isComponentHost(tNode)) {\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyRNode);\n addComponentLogic(\n lView, tNode as TElementNode,\n tView.data[start + tNode.componentOffset] as ComponentDef<unknown>);\n }\n\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n\n attachPatchData(native, lView);\n\n const initialInputs = tNode.initialInputs;\n for (let i = start; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n const directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs!);\n }\n\n if (isComponentDef(def)) {\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);\n }\n }\n}\n\nexport function invokeDirectivesHostBindings(tView: TView, lView: LView, tNode: TNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const elementIndex = tNode.index;\n const currentDirectiveIndex = getCurrentDirectiveIndex();\n try {\n setSelectedIndex(elementIndex);\n for (let dirIndex = start; dirIndex < end; dirIndex++) {\n const def = tView.data[dirIndex] as DirectiveDef<unknown>;\n const directive = lView[dirIndex];\n setCurrentDirectiveIndex(dirIndex);\n if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n invokeHostBindingsInCreationMode(def, directive);\n }\n }\n } finally {\n setSelectedIndex(-1);\n setCurrentDirectiveIndex(currentDirectiveIndex);\n }\n}\n\n/**\n * Invoke the host bindings in creation mode.\n *\n * @param def `DirectiveDef` which may contain the `hostBindings` function.\n * @param directive Instance of directive.\n */\nexport function invokeHostBindingsInCreationMode(def: DirectiveDef<any>, directive: any) {\n if (def.hostBindings !== null) {\n def.hostBindings!(RenderFlags.Create, directive);\n }\n}\n\n/**\n * Matches the current node against all available selectors.\n * If a component is matched (at most one), it is returned in first position in the array.\n */\nfunction findDirectiveDefMatches(\n tView: TView, tNode: TElementNode|TContainerNode|TElementContainerNode):\n [matches: DirectiveDef<unknown>[], hostDirectiveDefs: HostDirectiveDefs|null]|null {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyRNode | TNodeType.AnyContainer);\n\n const registry = tView.directiveRegistry;\n let matches: DirectiveDef<unknown>[]|null = null;\n let hostDirectiveDefs: HostDirectiveDefs|null = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i] as ComponentDef<any>| DirectiveDef<any>;\n if (isNodeMatchingSelectorList(tNode, def.selectors!, /* isProjectionMode */ false)) {\n matches || (matches = []);\n\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(\n tNode, TNodeType.Element,\n `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n\n if (isComponentHost(tNode)) {\n throwMultipleComponentError(tNode, matches.find(isComponentDef)!.type, def.type);\n }\n }\n\n // Components are inserted at the front of the matches array so that their lifecycle\n // hooks run before any directive lifecycle hooks. This appears to be for ViewEngine\n // compatibility. This logic doesn't make sense with host directives, because it\n // would allow the host directives to undo any overrides the host may have made.\n // To handle this case, the host directives of components are inserted at the beginning\n // of the array, followed by the component. As such, the insertion order is as follows:\n // 1. Host directives belonging to the selector-matched component.\n // 2. Selector-matched component.\n // 3. Host directives belonging to selector-matched directives.\n // 4. Selector-matched directives.\n if (def.findHostDirectiveDefs !== null) {\n const hostDirectiveMatches: DirectiveDef<unknown>[] = [];\n hostDirectiveDefs = hostDirectiveDefs || new Map();\n def.findHostDirectiveDefs(def, hostDirectiveMatches, hostDirectiveDefs);\n // Add all host directives declared on this component, followed by the component itself.\n // Host directives should execute first so the host has a chance to override changes\n // to the DOM made by them.\n matches.unshift(...hostDirectiveMatches, def);\n // Component is offset starting from the beginning of the host directives array.\n const componentOffset = hostDirectiveMatches.length;\n markAsComponentHost(tView, tNode, componentOffset);\n } else {\n // No host directives on this component, just add the\n // component def to the beginning of the matches.\n matches.unshift(def);\n markAsComponentHost(tView, tNode, 0);\n }\n } else {\n // Append any host directives to the matches first.\n hostDirectiveDefs = hostDirectiveDefs || new Map();\n def.findHostDirectiveDefs?.(def, matches, hostDirectiveDefs);\n matches.push(def);\n }\n }\n }\n }\n return matches === null ? null : [matches, hostDirectiveDefs];\n}\n\n/**\n * Marks a given TNode as a component's host. This consists of:\n * - setting the component offset on the TNode.\n * - storing index of component's host element so it will be queued for view refresh during CD.\n */\nexport function markAsComponentHost(tView: TView, hostTNode: TNode, componentOffset: number): void {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');\n hostTNode.componentOffset = componentOffset;\n (tView.components || (tView.components = [])).push(hostTNode.index);\n}\n\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(\n tNode: TNode, localRefs: string[]|null, exportsMap: {[key: string]: number}): void {\n if (localRefs) {\n const localNames: (string|number)[] = tNode.localNames = [];\n\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new RuntimeError(\n RuntimeErrorCode.EXPORT_NOT_FOUND,\n ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}\n\n/**\n * Builds up an export map as directives are created, so local refs can be quickly mapped\n * to their directive instances.\n */\nfunction saveNameToExportMap(\n directiveIdx: number, def: DirectiveDef<any>|ComponentDef<any>,\n exportsMap: {[key: string]: number}|null) {\n if (exportsMap) {\n if (def.exportAs) {\n for (let i = 0; i < def.exportAs.length; i++) {\n exportsMap[def.exportAs[i]] = directiveIdx;\n }\n }\n if (isComponentDef(def)) exportsMap[''] = directiveIdx;\n }\n}\n\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nexport function initTNodeFlags(tNode: TNode, index: number, numberOfDirectives: number) {\n ngDevMode &&\n assertNotEqual(\n numberOfDirectives, tNode.directiveEnd - tNode.directiveStart,\n 'Reached the max number of directives');\n tNode.flags |= TNodeFlags.isDirectiveHost;\n // When the first directive is created on a node, save the index\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\n\n/**\n * Setup directive for instantiation.\n *\n * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well\n * as `LView`. `TView` gets the `DirectiveDef`.\n *\n * @param tView `TView`\n * @param tNode `TNode`\n * @param lView `LView`\n * @param directiveIndex Index where the directive will be stored in the Expando.\n * @param def `DirectiveDef`\n */\nexport function configureViewWithDirective<T>(\n tView: TView, tNode: TNode, lView: LView, directiveIndex: number, def: DirectiveDef<T>): void {\n ngDevMode &&\n assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n tView.data[directiveIndex] = def;\n const directiveFactory =\n def.factory || ((def as {factory: Function}).factory = getFactoryDef(def.type, true));\n // Even though `directiveFactory` will already be using `ɵɵdirectiveInject` in its generated code,\n // we also want to support `inject()` directly from the directive constructor context so we set\n // `ɵɵdirectiveInject` as the inject implementation here too.\n const nodeInjectorFactory =\n new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject);\n tView.blueprint[directiveIndex] = nodeInjectorFactory;\n lView[directiveIndex] = nodeInjectorFactory;\n\n registerHostBindingOpCodes(\n tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n}\n\nfunction addComponentLogic<T>(lView: LView, hostTNode: TElementNode, def: ComponentDef<T>): void {\n const native = getNativeByTNode(hostTNode, lView) as RElement;\n const tView = getOrCreateComponentTView(def);\n\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[RENDERER_FACTORY];\n const componentView = addToViewTree(\n lView,\n createLView(\n lView, tView, null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, native,\n hostTNode as TElementNode, rendererFactory, rendererFactory.createRenderer(native, def),\n null, null, null));\n\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n lView[hostTNode.index] = componentView;\n}\n\nexport function elementAttributeInternal(\n tNode: TNode, lView: LView, name: string, value: any, sanitizer: SanitizerFn|null|undefined,\n namespace: string|null|undefined) {\n if (ngDevMode) {\n assertNotSame(value, NO_CHANGE as any, 'Incoming value should never be NO_CHANGE.');\n validateAgainstEventAttributes(name);\n assertTNodeType(\n tNode, TNodeType.Element,\n `Attempted to set attribute \\`${name}\\` on a container node. ` +\n `Host bindings are not valid on ng-container or ng-template.`);\n }\n const element = getNativeByTNode(tNode, lView) as RElement;\n setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n}\n\nexport function setElementAttribute(\n renderer: Renderer, element: RElement, namespace: string|null|undefined, tagName: string|null,\n name: string, value: any, sanitizer: SanitizerFn|null|undefined) {\n if (value == null) {\n ngDevMode && ngDevMode.rendererRemoveAttribute++;\n renderer.removeAttribute(element, name, namespace);\n } else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n const strValue =\n sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n\n\n renderer.setAttribute(element, name, strValue as string, namespace);\n }\n}\n\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param lView Current LView that is being processed.\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param def The directive def that contains the list of inputs\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs<T>(\n lView: LView, directiveIndex: number, instance: T, def: DirectiveDef<T>, tNode: TNode,\n initialInputData: InitialInputData): void {\n const initialInputs: InitialInputs|null = initialInputData![directiveIndex];\n if (initialInputs !== null) {\n const setInput = def.setInput;\n for (let i = 0; i < initialInputs.length;) {\n const publicName = initialInputs[i++];\n const privateName = initialInputs[i++];\n const value = initialInputs[i++];\n if (setInput !== null) {\n def.setInput!(instance, value, publicName, privateName);\n } else {\n (instance as any)[privateName] = value;\n }\n if (ngDevMode) {\n const nativeElement = getNativeByTNode(tNode, lView) as RElement;\n setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);\n }\n }\n }\n}\n\n/**\n * Generates initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param inputs Input alias map that was generated from the directive def inputs.\n * @param directiveIndex Index of the directive that is currently being processed.\n * @param attrs Static attrs on this node.\n */\nfunction generateInitialInputs(\n inputs: PropertyAliases, directiveIndex: number, attrs: TAttributes): InitialInputs|null {\n let inputsToStore: InitialInputs|null = null;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.NamespaceURI) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n } else if (attrName === AttributeMarker.ProjectAs) {\n // Skip over the `ngProjectAs` value.\n i += 2;\n continue;\n }\n\n // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.\n if (typeof attrName === 'number') break;\n\n if (inputs.hasOwnProperty(attrName as string)) {\n if (inputsToStore === null) inputsToStore = [];\n\n // Find the input's public name from the input store. Note that we can be found easier\n // through the directive def, but we want to do it using the inputs store so that it can\n // account for host directive aliases.\n const inputConfig = inputs[attrName as string];\n for (let j = 0; j < inputConfig.length; j += 2) {\n if (inputConfig[j] === directiveIndex) {\n inputsToStore.push(\n attrName as string, inputConfig[j + 1] as string, attrs[i + 1] as string);\n // A directive can't have multiple inputs with the same name so we can break here.\n break;\n }\n }\n }\n\n i += 2;\n }\n return inputsToStore;\n}\n\n//////////////////////////\n//// ViewContainer & View\n//////////////////////////\n\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nexport function createLContainer(\n hostNative: RElement|RComment|LView, currentView: LView, native: RComment,\n tNode: TNode): LContainer {\n ngDevMode && assertLView(currentView);\n const lContainer: LContainer = [\n hostNative, // host native\n true, // Boolean `true` in this position signifies that this is an `LContainer`\n false, // has transplanted views\n currentView, // parent\n null, // next\n 0, // transplanted views to refresh count\n tNode, // t_host\n native, // native,\n null, // view refs\n null, // moved views\n ];\n ngDevMode &&\n assertEqual(\n lContainer.length, CONTAINER_HEADER_OFFSET,\n 'Should allocate correct number of slots for LContainer header.');\n return lContainer;\n}\n\n/**\n * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes\n * them by executing an associated template function.\n */\nfunction refreshEmbeddedViews(lView: LView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null;\n lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n const embeddedTView = embeddedLView[TVIEW];\n ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');\n if (viewAttachedToChangeDetector(embeddedLView)) {\n refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]!);\n }\n }\n }\n}\n\n/**\n * Mark transplanted views as needing to be refreshed at their insertion points.\n *\n * @param lView The `LView` that may have transplanted views.\n */\nfunction markTransplantedViewsForRefresh(lView: LView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null;\n lContainer = getNextLContainer(lContainer)) {\n if (!lContainer[HAS_TRANSPLANTED_VIEWS]) continue;\n\n const movedViews = lContainer[MOVED_VIEWS]!;\n ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n for (let i = 0; i < movedViews.length; i++) {\n const movedLView = movedViews[i]!;\n const insertionLContainer = movedLView[PARENT] as LContainer;\n ngDevMode && assertLContainer(insertionLContainer);\n // We don't want to increment the counter if the moved LView was already marked for\n // refresh.\n if ((movedLView[FLAGS] & LViewFlags.RefreshTransplantedView) === 0) {\n updateTransplantedViewCount(insertionLContainer, 1);\n }\n // Note, it is possible that the `movedViews` is tracking views that are transplanted *and*\n // those that aren't (declaration component === insertion component). In the latter case,\n // it's fine to add the flag, as we will clear it immediately in\n // `refreshEmbeddedViews` for the view currently being refreshed.\n movedLView[FLAGS] |= LViewFlags.RefreshTransplantedView;\n }\n }\n}\n\n/////////////\n\n/**\n * Refreshes components by entering the component view and processing its bindings, queries, etc.\n *\n * @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nfunction refreshComponent(hostLView: LView, componentHostIdx: number): void {\n ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n if (viewAttachedToChangeDetector(componentView)) {\n const tView = componentView[TVIEW];\n if (componentView[FLAGS] & (LViewFlags.CheckAlways | LViewFlags.Dirty)) {\n refreshView(tView, componentView, tView.template, componentView[CONTEXT]);\n } else if (componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n refreshContainsDirtyView(componentView);\n }\n }\n}\n\n/**\n * Refreshes all transplanted views marked with `LViewFlags.RefreshTransplantedView` that are\n * children or descendants of the given lView.\n *\n * @param lView The lView which contains descendant transplanted views that need to be refreshed.\n */\nfunction refreshContainsDirtyView(lView: LView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null;\n lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n if (viewAttachedToChangeDetector(embeddedLView)) {\n if (embeddedLView[FLAGS] & LViewFlags.RefreshTransplantedView) {\n const embeddedTView = embeddedLView[TVIEW];\n ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');\n refreshView(\n embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]!);\n\n } else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n refreshContainsDirtyView(embeddedLView);\n }\n }\n }\n }\n\n const tView = lView[TVIEW];\n // Refresh child component views.\n const components = tView.components;\n if (components !== null) {\n for (let i = 0; i < components.length; i++) {\n const componentView = getComponentLViewByIndex(components[i], lView);\n // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n if (viewAttachedToChangeDetector(componentView) &&\n componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n refreshContainsDirtyView(componentView);\n }\n }\n }\n}\n\nfunction renderComponent(hostLView: LView, componentHostIdx: number) {\n ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n const componentTView = componentView[TVIEW];\n syncViewWithBlueprint(componentTView, componentView);\n renderView(componentTView, componentView, componentView[CONTEXT]);\n}\n\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param tView The `TView` that contains the blueprint for syncing\n * @param lView The view to sync\n */\nfunction syncViewWithBlueprint(tView: TView, lView: LView) {\n for (let i = lView.length; i < tView.blueprint.length; i++) {\n lView.push(tView.blueprint[i]);\n }\n}\n\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param lViewOrLContainer The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nexport function addToViewTree<T extends LView|LContainer>(lView: LView, lViewOrLContainer: T): T {\n // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer\n // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out\n // of order, the change detection will run out of order, as the act of retrieving the the\n // LContainer from the RNode is what adds it to the queue.\n if (lView[CHILD_HEAD]) {\n lView[CHILD_TAIL]![NEXT] = lViewOrLContainer;\n } else {\n lView[CHILD_HEAD] = lViewOrLContainer;\n }\n lView[CHILD_TAIL] = lViewOrLContainer;\n return lViewOrLContainer;\n}\n\n///////////////////////////////\n//// Change detection\n///////////////////////////////\n\n\n/**\n * Marks current view and all ancestors dirty.\n *\n * Returns the root view because it is found as a byproduct of marking the view tree\n * dirty, and can be used by methods that consume markViewDirty() to easily schedule\n * change detection. Otherwise, such methods would need to traverse up the view tree\n * an additional time to get the root view and schedule a tick on it.\n *\n * @param lView The starting LView to mark dirty\n * @returns the root LView\n */\nexport function markViewDirty(lView: LView): LView|null {\n while (lView) {\n lView[FLAGS] |= LViewFlags.Dirty;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent!;\n }\n return null;\n}\n\nexport function detectChangesInternal<T>(\n tView: TView, lView: LView, context: T, notifyErrorHandler = true) {\n const rendererFactory = lView[RENDERER_FACTORY];\n\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to invoke renderer factory functions in that mode\n // to avoid any possible side-effects.\n const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();\n\n if (!checkNoChangesMode && rendererFactory.begin) rendererFactory.begin();\n try {\n refreshView(tView, lView, tView.template, context);\n } catch (error) {\n if (notifyErrorHandler) {\n handleError(lView, error);\n }\n throw error;\n } finally {\n if (!checkNoChangesMode && rendererFactory.end) rendererFactory.end();\n }\n}\n\nexport function checkNoChangesInternal<T>(\n tView: TView, lView: LView, context: T, notifyErrorHandler = true) {\n setIsInCheckNoChangesMode(true);\n try {\n detectChangesInternal(tView, lView, context, notifyErrorHandler);\n } finally {\n setIsInCheckNoChangesMode(false);\n }\n}\n\nfunction executeViewQueryFn<T>(\n flags: RenderFlags, viewQueryFn: ViewQueriesFunction<T>, component: T): void {\n ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n setCurrentQueryIndex(0);\n viewQueryFn(flags, component);\n}\n\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n\n/**\n * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.\n *\n * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:\n * - a bound property name;\n * - a static parts of interpolated strings;\n *\n * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a\n * property binding metadata will be stored in `TView.data` at the same index as a bound value in\n * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the\n * following format:\n * - `propertyName` for bound properties;\n * - `propertyName�prefix�interpolation_static_part1�..interpolation_static_partN�suffix` for\n * interpolated properties.\n *\n * @param tData `TData` where meta-data will be saved;\n * @param tNode `TNode` that is a target of the binding;\n * @param propertyName bound property name;\n * @param bindingIndex binding index in `LView`\n * @param interpolationParts static interpolation parts (for property interpolations)\n */\nexport function storePropertyBindingMetadata(\n tData: TData, tNode: TNode, propertyName: string, bindingIndex: number,\n ...interpolationParts: string[]) {\n // Binding meta-data are stored only the first time a given property instruction is processed.\n // Since we don't have a concept of the \"first update pass\" we need to check for presence of the\n // binding meta-data to decide if one should be stored (or if was stored already).\n if (tData[bindingIndex] === null) {\n if (tNode.inputs == null || !tNode.inputs[propertyName]) {\n const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n propBindingIdxs.push(bindingIndex);\n let bindingMetadata = propertyName;\n if (interpolationParts.length > 0) {\n bindingMetadata +=\n INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n }\n tData[bindingIndex] = bindingMetadata;\n }\n }\n}\n\nexport function getOrCreateLViewCleanup(view: LView): any[] {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return view[CLEANUP] || (view[CLEANUP] = []);\n}\n\nexport function getOrCreateTViewCleanup(tView: TView): any[] {\n return tView.cleanup || (tView.cleanup = []);\n}\n\n/**\n * There are cases where the sub component's renderer needs to be included\n * instead of the current renderer (see the componentSyntheticHost* instructions).\n */\nexport function loadComponentRenderer(\n currentDef: DirectiveDef<any>|null, tNode: TNode, lView: LView): Renderer {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index])!;\n }\n return lView[RENDERER];\n}\n\n/** Handles an error thrown in an LView. */\nexport function handleError(lView: LView, error: any): void {\n const injector = lView[INJECTOR];\n const errorHandler = injector ? injector.get(ErrorHandler, null) : null;\n errorHandler && errorHandler.handleError(error);\n}\n\n/**\n * Set the inputs of directives at the current node to corresponding value.\n *\n * @param tView The current TView\n * @param lView the `LView` which contains the directives.\n * @param inputs mapping between the public \"input\" name and privately-known,\n * possibly minified, property names to write to.\n * @param value Value to set.\n */\nexport function setInputsForProperty(\n tView: TView, lView: LView, inputs: PropertyAliasValue, publicName: string, value: any): void {\n for (let i = 0; i < inputs.length;) {\n const index = inputs[i++] as number;\n const privateName = inputs[i++] as string;\n const instance = lView[index];\n ngDevMode && assertIndexInRange(lView, index);\n const def = tView.data[index] as DirectiveDef<any>;\n if (def.setInput !== null) {\n def.setInput!(instance, value, publicName, privateName);\n } else {\n instance[privateName] = value;\n }\n }\n}\n\n/**\n * Updates a text binding at a given index in a given LView.\n */\nexport function textBindingInternal(lView: LView, index: number, value: string): void {\n ngDevMode && assertString(value, 'Value should be a string');\n ngDevMode && assertNotSame(value, NO_CHANGE as any, 'value should not be NO_CHANGE');\n ngDevMode && assertIndexInRange(lView, index);\n const element = getNativeByIndex(index, lView) as any as RText;\n ngDevMode && assertDefined(element, 'native element should exist');\n updateTextNode(lView[RENDERER], element, value);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {concatStringsWithSpace} from '../../util/stringify';\nimport {assertFirstCreatePass} from '../assert';\nimport {AttributeMarker, TAttributes, TNode} from '../interfaces/node';\nimport {getTView} from '../state';\n\n/**\n * Compute the static styling (class/style) from `TAttributes`.\n *\n * This function should be called during `firstCreatePass` only.\n *\n * @param tNode The `TNode` into which the styling information should be loaded.\n * @param attrs `TAttributes` containing the styling information.\n * @param writeToHost Where should the resulting static styles be written?\n * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`\n * - `true` Write to `TNode.styles` / `TNode.classes`\n */\nexport function computeStaticStyling(\n tNode: TNode, attrs: TAttributes|null, writeToHost: boolean): void {\n ngDevMode &&\n assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n let styles: string|null = writeToHost ? tNode.styles : null;\n let classes: string|null = writeToHost ? tNode.classes : null;\n let mode: AttributeMarker|0 = 0;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const value = attrs[i];\n if (typeof value === 'number') {\n mode = value;\n } else if (mode == AttributeMarker.Classes) {\n classes = concatStringsWithSpace(classes, value as string);\n } else if (mode == AttributeMarker.Styles) {\n const style = value as string;\n const styleValue = attrs[++i] as string;\n styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n }\n }\n }\n writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;\n writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertParentView} from './assert';\nimport {icuContainerIterate} from './i18n/i18n_tree_shaking';\nimport {CONTAINER_HEADER_OFFSET} from './interfaces/container';\nimport {TIcuContainerNode, TNode, TNodeType} from './interfaces/node';\nimport {RNode} from './interfaces/renderer_dom';\nimport {isLContainer} from './interfaces/type_checks';\nimport {DECLARATION_COMPONENT_VIEW, LView, T_HOST, TVIEW, TView} from './interfaces/view';\nimport {assertTNodeType} from './node_assert';\nimport {getProjectionNodes} from './node_manipulation';\nimport {getLViewParent} from './util/view_traversal_utils';\nimport {unwrapRNode} from './util/view_utils';\n\n\n\nexport function collectNativeNodes(\n tView: TView, lView: LView, tNode: TNode|null, result: any[],\n isProjection: boolean = false): any[] {\n while (tNode !== null) {\n ngDevMode &&\n assertTNodeType(\n tNode,\n TNodeType.AnyRNode | TNodeType.AnyContainer | TNodeType.Projection | TNodeType.Icu);\n\n const lNode = lView[tNode.index];\n if (lNode !== null) {\n result.push(unwrapRNode(lNode));\n }\n\n // A given lNode can represent either a native node or a LContainer (when it is a host of a\n // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes\n // from the views in this container.\n if (isLContainer(lNode)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lNode.length; i++) {\n const lViewInAContainer = lNode[i];\n const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;\n if (lViewFirstChildTNode !== null) {\n collectNativeNodes(\n lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);\n }\n }\n }\n\n const tNodeType = tNode.type;\n if (tNodeType & TNodeType.ElementContainer) {\n collectNativeNodes(tView, lView, tNode.child, result);\n } else if (tNodeType & TNodeType.Icu) {\n const nextRNode = icuContainerIterate(tNode as TIcuContainerNode, lView);\n let rNode: RNode|null;\n while (rNode = nextRNode()) {\n result.push(rNode);\n }\n } else if (tNodeType & TNodeType.Projection) {\n const nodesInSlot = getProjectionNodes(lView, tNode);\n if (Array.isArray(nodesInSlot)) {\n result.push(...nodesInSlot);\n } else {\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW])!;\n ngDevMode && assertParentView(parentView);\n collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n\n return result;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef as viewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, InternalViewRef as viewEngine_InternalViewRef, ViewRefTracker} from '../linker/view_ref';\nimport {removeFromArray} from '../util/array_utils';\nimport {assertEqual} from '../util/assert';\n\nimport {collectNativeNodes} from './collect_native_nodes';\nimport {checkNoChangesInternal, detectChangesInternal, markViewDirty, storeCleanupWithContext} from './instructions/shared';\nimport {CONTAINER_HEADER_OFFSET, VIEW_REFS} from './interfaces/container';\nimport {isLContainer} from './interfaces/type_checks';\nimport {CONTEXT, FLAGS, LView, LViewFlags, PARENT, TVIEW} from './interfaces/view';\nimport {destroyLView, detachView, renderDetachView} from './node_manipulation';\n\n\n\n// Needed due to tsickle downleveling where multiple `implements` with classes creates\n// multiple @extends in Closure annotations, which is illegal. This workaround fixes\n// the multiple @extends by making the annotation @implements instead\nexport interface viewEngine_ChangeDetectorRef_interface extends viewEngine_ChangeDetectorRef {}\n\nexport class ViewRef<T> implements viewEngine_EmbeddedViewRef<T>, viewEngine_InternalViewRef,\n viewEngine_ChangeDetectorRef_interface {\n private _appRef: ViewRefTracker|null = null;\n private _attachedToViewContainer = false;\n\n get rootNodes(): any[] {\n const lView = this._lView;\n const tView = lView[TVIEW];\n return collectNativeNodes(tView, lView, tView.firstChild, []);\n }\n\n constructor(\n /**\n * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.\n *\n * When ViewRef is created for a dynamic component, this also represents the `LView` for the\n * component.\n *\n * For a \"regular\" ViewRef created for an embedded view, this is the `LView` for the embedded\n * view.\n *\n * @internal\n */\n public _lView: LView,\n\n /**\n * This represents the `LView` associated with the point where `ChangeDetectorRef` was\n * requested.\n *\n * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.\n */\n private _cdRefInjectingView?: LView) {}\n\n get context(): T {\n return this._lView[CONTEXT] as unknown as T;\n }\n\n set context(value: T) {\n this._lView[CONTEXT] = value as unknown as {};\n }\n\n get destroyed(): boolean {\n return (this._lView[FLAGS] & LViewFlags.Destroyed) === LViewFlags.Destroyed;\n }\n\n destroy(): void {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._attachedToViewContainer) {\n const parent = this._lView[PARENT];\n if (isLContainer(parent)) {\n const viewRefs = parent[VIEW_REFS] as ViewRef<unknown>[] | null;\n const index = viewRefs ? viewRefs.indexOf(this) : -1;\n if (index > -1) {\n ngDevMode &&\n assertEqual(\n index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET,\n 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n detachView(parent, index);\n removeFromArray(viewRefs!, index);\n }\n }\n this._attachedToViewContainer = false;\n }\n destroyLView(this._lView[TVIEW], this._lView);\n }\n\n onDestroy(callback: Function) {\n storeCleanupWithContext(this._lView[TVIEW], this._lView, null, callback);\n }\n\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Component({\n * selector: 'app-root',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck(): void {\n markViewDirty(this._cdRefInjectingView || this._lView);\n }\n\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```typescript\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach(): void {\n this._lView[FLAGS] &= ~LViewFlags.Attached;\n }\n\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```typescript\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'app-root',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach(): void {\n this._lView[FLAGS] |= LViewFlags.Attached;\n }\n\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach detach} for more information.\n */\n detectChanges(): void {\n detectChangesInternal(this._lView[TVIEW], this._lView, this.context as unknown as {});\n }\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges(): void {\n if (ngDevMode) {\n checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context as unknown as {});\n }\n }\n\n attachToViewContainerRef() {\n if (this._appRef) {\n throw new RuntimeError(\n RuntimeErrorCode.VIEW_ALREADY_ATTACHED,\n ngDevMode && 'This view is already attached directly to the ApplicationRef!');\n }\n this._attachedToViewContainer = true;\n }\n\n detachFromAppRef() {\n this._appRef = null;\n renderDetachView(this._lView[TVIEW], this._lView);\n }\n\n attachToAppRef(appRef: ViewRefTracker) {\n if (this._attachedToViewContainer) {\n throw new RuntimeError(\n RuntimeErrorCode.VIEW_ALREADY_ATTACHED,\n ngDevMode && 'This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n }\n}\n\n/** @internal */\nexport class RootViewRef<T> extends ViewRef<T> {\n constructor(public _view: LView) {\n super(_view);\n }\n\n override detectChanges(): void {\n const lView = this._view;\n const tView = lView[TVIEW];\n const context = lView[CONTEXT];\n detectChangesInternal(tView, lView, context, false);\n }\n\n override checkNoChanges(): void {\n if (ngDevMode) {\n const lView = this._view;\n const tView = lView[TVIEW];\n const context = lView[CONTEXT];\n checkNoChangesInternal(tView, lView, context, false);\n }\n }\n\n override get context(): T {\n return null!;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {Injector} from '../di/injector';\nimport {convertToBitFlags} from '../di/injector_compatibility';\nimport {InjectFlags, InjectOptions} from '../di/interface/injector';\nimport {ProviderToken} from '../di/provider_token';\nimport {EnvironmentInjector} from '../di/r3_injector';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {Type} from '../interface/type';\nimport {ComponentFactory as AbstractComponentFactory, ComponentRef as AbstractComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryResolver as AbstractComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {createElementRef, ElementRef} from '../linker/element_ref';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {Renderer2, RendererFactory2} from '../render/api';\nimport {Sanitizer} from '../sanitization/sanitizer';\nimport {assertDefined, assertGreaterThan, assertIndexInRange} from '../util/assert';\nimport {VERSION} from '../version';\nimport {NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from '../view/provider_flags';\n\nimport {assertComponentType} from './assert';\nimport {attachPatchData} from './context_discovery';\nimport {getComponentDef} from './definition';\nimport {getNodeInjectable, NodeInjector} from './di';\nimport {throwProviderNotFoundError} from './errors_di';\nimport {registerPostOrderHooks} from './hooks';\nimport {reportUnknownPropertyError} from './instructions/element_validation';\nimport {addToViewTree, createLView, createTView, executeContentQueries, getOrCreateComponentTView, getOrCreateTNode, initializeDirectives, invokeDirectivesHostBindings, locateHostElement, markAsComponentHost, markDirtyIfOnPush, renderView, setInputsForProperty} from './instructions/shared';\nimport {ComponentDef, DirectiveDef, HostDirectiveDefs} from './interfaces/definition';\nimport {PropertyAliasValue, TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType} from './interfaces/node';\nimport {Renderer, RendererFactory} from './interfaces/renderer';\nimport {RElement, RNode} from './interfaces/renderer_dom';\nimport {CONTEXT, HEADER_OFFSET, LView, LViewFlags, TVIEW, TViewType} from './interfaces/view';\nimport {MATH_ML_NAMESPACE, SVG_NAMESPACE} from './namespaces';\nimport {createElementNode, setupStaticAttributes, writeDirectClass} from './node_manipulation';\nimport {extractAttrsAndClassesFromSelector, stringifyCSSSelectorList} from './node_selector_matcher';\nimport {enterView, getCurrentTNode, getLView, leaveView} from './state';\nimport {computeStaticStyling} from './styling/static_styling';\nimport {mergeHostAttrs, setUpAttributes} from './util/attrs_utils';\nimport {stringifyForError} from './util/stringify_utils';\nimport {getNativeByTNode, getTNode} from './util/view_utils';\nimport {RootViewRef, ViewRef} from './view_ref';\n\nexport class ComponentFactoryResolver extends AbstractComponentFactoryResolver {\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(private ngModule?: NgModuleRef<any>) {\n super();\n }\n\n override resolveComponentFactory<T>(component: Type<T>): AbstractComponentFactory<T> {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component)!;\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\n\nfunction toRefArray(map: {[key: string]: string}): {propName: string; templateName: string;}[] {\n const array: {propName: string; templateName: string;}[] = [];\n for (let nonMinified in map) {\n if (map.hasOwnProperty(nonMinified)) {\n const minified = map[nonMinified];\n array.push({propName: minified, templateName: nonMinified});\n }\n }\n return array;\n}\n\nfunction getNamespace(elementName: string): string|null {\n const name = elementName.toLowerCase();\n return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);\n}\n\n/**\n * Injector that looks up a value using a specific injector, before falling back to the module\n * injector. Used primarily when creating components or embedded views dynamically.\n */\nclass ChainedInjector implements Injector {\n constructor(private injector: Injector, private parentInjector: Injector) {}\n\n get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags|InjectOptions): T {\n flags = convertToBitFlags(flags);\n const value = this.injector.get<T|typeof NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR>(\n token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);\n\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === (NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as unknown as T)) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value as T;\n }\n\n return this.parentInjector.get(token, notFoundValue, flags);\n }\n}\n\n/**\n * ComponentFactory interface implementation.\n */\nexport class ComponentFactory<T> extends AbstractComponentFactory<T> {\n override selector: string;\n override componentType: Type<any>;\n override ngContentSelectors: string[];\n isBoundToModule: boolean;\n\n override get inputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.inputs);\n }\n\n override get outputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.outputs);\n }\n\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(private componentDef: ComponentDef<any>, private ngModule?: NgModuleRef<any>) {\n super();\n this.componentType = componentDef.type;\n this.selector = stringifyCSSSelectorList(componentDef.selectors);\n this.ngContentSelectors =\n componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];\n this.isBoundToModule = !!ngModule;\n }\n\n override create(\n injector: Injector, projectableNodes?: any[][]|undefined, rootSelectorOrNode?: any,\n environmentInjector?: NgModuleRef<any>|EnvironmentInjector|\n undefined): AbstractComponentRef<T> {\n environmentInjector = environmentInjector || this.ngModule;\n\n let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?\n environmentInjector :\n environmentInjector?.injector;\n\n if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {\n realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||\n realEnvironmentInjector;\n }\n\n const rootViewInjector =\n realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;\n\n const rendererFactory = rootViewInjector.get(RendererFactory2, null);\n if (rendererFactory === null) {\n throw new RuntimeError(\n RuntimeErrorCode.RENDERER_NOT_FOUND,\n ngDevMode &&\n 'Angular was not able to inject a renderer (RendererFactory2). ' +\n 'Likely this is due to a broken DI hierarchy. ' +\n 'Make sure that any injector used to create this component has a correct parent.');\n }\n const sanitizer = rootViewInjector.get(Sanitizer, null);\n\n const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);\n // Determine a tag name used for creating host elements when this component is created\n // dynamically. Default to 'div' if this component did not specify any tag name in its selector.\n const elementName = this.componentDef.selectors[0][0] as string || 'div';\n const hostRNode = rootSelectorOrNode ?\n locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :\n createElementNode(hostRenderer, elementName, getNamespace(elementName));\n\n const rootFlags = this.componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :\n LViewFlags.CheckAlways | LViewFlags.IsRoot;\n\n // Create the root view. Uses empty TView and ContentTemplate.\n const rootTView = createTView(TViewType.Root, null, null, 1, 0, null, null, null, null, null);\n const rootLView = createLView(\n null, rootTView, null, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer,\n rootViewInjector, null);\n\n // rootView is the parent when bootstrapping\n // TODO(misko): it looks like we are entering view here but we don't really need to as\n // `renderView` does that. However as the code is written it is needed because\n // `createRootComponentView` and `createRootComponent` both read global state. Fixing those\n // issues would allow us to drop this.\n enterView(rootLView);\n\n let component: T;\n let tElementNode: TElementNode;\n\n try {\n const rootComponentDef = this.componentDef;\n let rootDirectives: DirectiveDef<unknown>[];\n let hostDirectiveDefs: HostDirectiveDefs|null = null;\n\n if (rootComponentDef.findHostDirectiveDefs) {\n rootDirectives = [];\n hostDirectiveDefs = new Map();\n rootComponentDef.findHostDirectiveDefs(rootComponentDef, rootDirectives, hostDirectiveDefs);\n rootDirectives.push(rootComponentDef);\n } else {\n rootDirectives = [rootComponentDef];\n }\n\n const hostTNode = createRootComponentTNode(rootLView, hostRNode);\n const componentView = createRootComponentView(\n hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, rendererFactory,\n hostRenderer);\n\n tElementNode = getTNode(rootTView, HEADER_OFFSET) as TElementNode;\n\n // TODO(crisbeto): in practice `hostRNode` should always be defined, but there are some tests\n // where the renderer is mocked out and `undefined` is returned. We should update the tests so\n // that this check can be removed.\n if (hostRNode) {\n setRootNodeAttributes(hostRenderer, rootComponentDef, hostRNode, rootSelectorOrNode);\n }\n\n if (projectableNodes !== undefined) {\n projectNodes(tElementNode, this.ngContentSelectors, projectableNodes);\n }\n\n // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and\n // executed here?\n // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n component = createRootComponent(\n componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView,\n [LifecycleHooksFeature]);\n renderView(rootTView, rootLView, null);\n } finally {\n leaveView();\n }\n\n return new ComponentRef(\n this.componentType, component, createElementRef(tElementNode, rootLView), rootLView,\n tElementNode);\n }\n}\n\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nexport class ComponentRef<T> extends AbstractComponentRef<T> {\n override instance: T;\n override hostView: ViewRef<T>;\n override changeDetectorRef: ChangeDetectorRef;\n override componentType: Type<T>;\n\n constructor(\n componentType: Type<T>, instance: T, public location: ElementRef, private _rootLView: LView,\n private _tNode: TElementNode|TContainerNode|TElementContainerNode) {\n super();\n this.instance = instance;\n this.hostView = this.changeDetectorRef = new RootViewRef<T>(_rootLView);\n this.componentType = componentType;\n }\n\n override setInput(name: string, value: unknown): void {\n const inputData = this._tNode.inputs;\n let dataValue: PropertyAliasValue|undefined;\n if (inputData !== null && (dataValue = inputData[name])) {\n const lView = this._rootLView;\n setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);\n markDirtyIfOnPush(lView, this._tNode.index);\n } else {\n if (ngDevMode) {\n const cmpNameForError = stringifyForError(this.componentType);\n let message =\n `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;\n message += `Make sure that the '${\n name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;\n reportUnknownPropertyError(message);\n }\n }\n }\n\n override get injector(): Injector {\n return new NodeInjector(this._tNode, this._rootLView);\n }\n\n override destroy(): void {\n this.hostView.destroy();\n }\n\n override onDestroy(callback: () => void): void {\n this.hostView.onDestroy(callback);\n }\n}\n\n/** Represents a HostFeature function. */\ntype HostFeature = (<T>(component: T, componentDef: ComponentDef<T>) => void);\n\n// TODO: A hack to not pull in the NullInjector from @angular/core.\nexport const NULL_INJECTOR: Injector = {\n get: (token: any, notFoundValue?: any) => {\n throwProviderNotFoundError(token, 'NullInjector');\n }\n};\n\n/** Creates a TNode that can be used to instantiate a root component. */\nfunction createRootComponentTNode(lView: LView, rNode: RNode): TElementNode {\n const tView = lView[TVIEW];\n const index = HEADER_OFFSET;\n ngDevMode && assertIndexInRange(lView, index);\n lView[index] = rNode;\n\n // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at\n // the same time we want to communicate the debug `TNode` that this is a special `TNode`\n // representing a host element.\n return getOrCreateTNode(tView, index, TNodeType.Element, '#host', null);\n}\n\n/**\n * Creates the root component view and the root component node.\n *\n * @param rNode Render host element.\n * @param rootComponentDef ComponentDef\n * @param rootView The parent view where the host node is stored\n * @param rendererFactory Factory to be used for creating child renderers.\n * @param hostRenderer The current renderer\n * @param sanitizer The sanitizer, if provided\n *\n * @returns Component view created\n */\nfunction createRootComponentView(\n tNode: TElementNode, rNode: RElement|null, rootComponentDef: ComponentDef<any>,\n rootDirectives: DirectiveDef<any>[], rootView: LView, rendererFactory: RendererFactory,\n hostRenderer: Renderer, sanitizer?: Sanitizer|null): LView {\n const tView = rootView[TVIEW];\n applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer);\n\n const viewRenderer = rendererFactory.createRenderer(rNode, rootComponentDef);\n const componentView = createLView(\n rootView, getOrCreateComponentTView(rootComponentDef), null,\n rootComponentDef.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, rootView[tNode.index],\n tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);\n\n if (tView.firstCreatePass) {\n markAsComponentHost(tView, tNode, rootDirectives.length - 1);\n }\n\n addToViewTree(rootView, componentView);\n\n // Store component view at node index, with node as the HOST\n return rootView[tNode.index] = componentView;\n}\n\n/** Sets up the styling information on a root component. */\nfunction applyRootComponentStyling(\n rootDirectives: DirectiveDef<any>[], tNode: TElementNode, rNode: RElement|null,\n hostRenderer: Renderer): void {\n for (const def of rootDirectives) {\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n }\n\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n\n if (rNode !== null) {\n setupStaticAttributes(hostRenderer, rNode, tNode);\n }\n }\n}\n\n/**\n * Creates a root component and sets it up with features and host bindings.Shared by\n * renderComponent() and ViewContainerRef.createComponent().\n */\nfunction createRootComponent<T>(\n componentView: LView, rootComponentDef: ComponentDef<T>, rootDirectives: DirectiveDef<any>[],\n hostDirectiveDefs: HostDirectiveDefs|null, rootLView: LView,\n hostFeatures: HostFeature[]|null): any {\n const rootTNode = getCurrentTNode() as TElementNode;\n ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');\n const tView = rootLView[TVIEW];\n const native = getNativeByTNode(rootTNode, rootLView);\n\n initializeDirectives(tView, rootLView, rootTNode, rootDirectives, null, hostDirectiveDefs);\n\n for (let i = 0; i < rootDirectives.length; i++) {\n const directiveIndex = rootTNode.directiveStart + i;\n const directiveInstance = getNodeInjectable(rootLView, tView, directiveIndex, rootTNode);\n attachPatchData(directiveInstance, rootLView);\n }\n\n invokeDirectivesHostBindings(tView, rootLView, rootTNode);\n\n if (native) {\n attachPatchData(native, rootLView);\n }\n\n // We're guaranteed for the `componentOffset` to be positive here\n // since a root component always matches a component def.\n ngDevMode &&\n assertGreaterThan(rootTNode.componentOffset, -1, 'componentOffset must be great than -1');\n const component = getNodeInjectable(\n rootLView, tView, rootTNode.directiveStart + rootTNode.componentOffset, rootTNode);\n componentView[CONTEXT] = rootLView[CONTEXT] = component;\n\n if (hostFeatures !== null) {\n for (const feature of hostFeatures) {\n feature(component, rootComponentDef);\n }\n }\n\n // We want to generate an empty QueryList for root content queries for backwards\n // compatibility with ViewEngine.\n executeContentQueries(tView, rootTNode, componentView);\n\n return component;\n}\n\n/** Sets the static attributes on a root component. */\nfunction setRootNodeAttributes(\n hostRenderer: Renderer2, componentDef: ComponentDef<unknown>, hostRNode: RElement,\n rootSelectorOrNode: any) {\n if (rootSelectorOrNode) {\n setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);\n } else {\n // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`\n // is not defined), also apply attributes and classes extracted from component selector.\n // Extract attributes and classes from the first selector only to match VE behavior.\n const {attrs, classes} = extractAttrsAndClassesFromSelector(componentDef.selectors[0]);\n if (attrs) {\n setUpAttributes(hostRenderer, hostRNode, attrs);\n }\n if (classes && classes.length > 0) {\n writeDirectClass(hostRenderer, hostRNode, classes.join(' '));\n }\n }\n}\n\n/** Projects the `projectableNodes` that were specified when creating a root component. */\nfunction projectNodes(\n tNode: TElementNode, ngContentSelectors: string[], projectableNodes: any[][]) {\n const projection: (TNode|RNode[]|null)[] = tNode.projection = [];\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const nodesforSlot = projectableNodes[i];\n // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade\n // case). Here we do normalize passed data structure to be an array of arrays to avoid\n // complex checks down the line.\n // We also normalize the length of the passed in projectable nodes (to match the number of\n // <ng-container> slots defined by a component).\n projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);\n }\n}\n\n/**\n * Used to enable lifecycle hooks on the root component.\n *\n * Include this feature when calling `renderComponent` if the root component\n * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n * be called properly.\n *\n * Example:\n *\n * ```\n * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});\n * ```\n */\nexport function LifecycleHooksFeature(): void {\n const tNode = getCurrentTNode()!;\n ngDevMode && assertDefined(tNode, 'TNode is required');\n registerPostOrderHooks(getLView()[TVIEW], tNode);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {Type, Writable} from '../../interface/type';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../../util/empty';\nimport {fillProperties} from '../../util/property';\nimport {ComponentDef, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature, HostBindingsFunction, RenderFlags, ViewQueriesFunction} from '../interfaces/definition';\nimport {TAttributes} from '../interfaces/node';\nimport {isComponentDef} from '../interfaces/type_checks';\nimport {mergeHostAttrs} from '../util/attrs_utils';\nimport {stringifyForError} from '../util/stringify_utils';\n\nexport function getSuperType(type: Type<any>): Type<any>&\n {ɵcmp?: ComponentDef<any>, ɵdir?: DirectiveDef<any>} {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n\ntype WritableDef = Writable<DirectiveDef<any>|ComponentDef<any>>;\n\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n *\n * @codeGenApi\n */\nexport function ɵɵInheritDefinitionFeature(definition: DirectiveDef<any>|ComponentDef<any>): void {\n let superType = getSuperType(definition.type);\n let shouldInheritFields = true;\n const inheritanceChain: WritableDef[] = [definition];\n\n while (superType) {\n let superDef: DirectiveDef<any>|ComponentDef<any>|undefined = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp || superType.ɵdir;\n } else {\n if (superType.ɵcmp) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INHERITANCE,\n ngDevMode &&\n `Directives cannot inherit Components. Directive ${\n stringifyForError(definition.type)} is attempting to extend component ${\n stringifyForError(superType)}`);\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n\n if (superDef) {\n if (shouldInheritFields) {\n inheritanceChain.push(superDef);\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n const writeableDef = definition as WritableDef;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n\n // Merge hostBindings\n const superHostBindings = superDef.hostBindings;\n superHostBindings && inheritHostBindings(definition, superHostBindings);\n\n // Merge queries\n const superViewQuery = superDef.viewQuery;\n const superContentQueries = superDef.contentQueries;\n superViewQuery && inheritViewQuery(definition, superViewQuery);\n superContentQueries && inheritContentQueries(definition, superContentQueries);\n\n // Merge inputs and outputs\n fillProperties(definition.inputs, superDef.inputs);\n fillProperties(definition.declaredInputs, superDef.declaredInputs);\n fillProperties(definition.outputs, superDef.outputs);\n\n // Merge animations metadata.\n // If `superDef` is a Component, the `data` field is present (defaults to an empty object).\n if (isComponentDef(superDef) && superDef.data.animation) {\n // If super def is a Component, the `definition` is also a Component, since Directives can\n // not inherit Components (we throw an error above and cannot reach this code).\n const defData = (definition as ComponentDef<any>).data;\n defData.animation = (defData.animation || []).concat(superDef.data.animation);\n }\n }\n\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n if (feature && feature.ngInherit) {\n (feature as DirectiveDefFeature)(definition);\n }\n // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this\n // def already has all the necessary information inherited from its super class(es), so we\n // can stop merging fields from super classes. However we need to iterate through the\n // prototype chain to look for classes that might contain other \"features\" (like\n // NgOnChanges), which we should invoke for the original `definition`. We set the\n // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance\n // logic and only invoking functions from the \"features\" list.\n if (feature === ɵɵInheritDefinitionFeature) {\n shouldInheritFields = false;\n }\n }\n }\n }\n\n superType = Object.getPrototypeOf(superType);\n }\n mergeHostAttrsAcrossInheritance(inheritanceChain);\n}\n\n/**\n * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.\n *\n * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing\n * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child\n * type.\n */\nfunction mergeHostAttrsAcrossInheritance(inheritanceChain: WritableDef[]) {\n let hostVars: number = 0;\n let hostAttrs: TAttributes|null = null;\n // We process the inheritance order from the base to the leaves here.\n for (let i = inheritanceChain.length - 1; i >= 0; i--) {\n const def = inheritanceChain[i];\n // For each `hostVars`, we need to add the superclass amount.\n def.hostVars = (hostVars += def.hostVars);\n // for each `hostAttrs` we need to merge it with superclass.\n def.hostAttrs =\n mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));\n }\n}\n\nfunction maybeUnwrapEmpty<T>(value: T[]): T[];\nfunction maybeUnwrapEmpty<T>(value: T): T;\nfunction maybeUnwrapEmpty(value: any): any {\n if (value === EMPTY_OBJ) {\n return {};\n } else if (value === EMPTY_ARRAY) {\n return [];\n } else {\n return value;\n }\n}\n\nfunction inheritViewQuery(definition: WritableDef, superViewQuery: ViewQueriesFunction<any>) {\n const prevViewQuery = definition.viewQuery;\n if (prevViewQuery) {\n definition.viewQuery = (rf, ctx) => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n } else {\n definition.viewQuery = superViewQuery;\n }\n}\n\nfunction inheritContentQueries(\n definition: WritableDef, superContentQueries: ContentQueriesFunction<any>) {\n const prevContentQueries = definition.contentQueries;\n if (prevContentQueries) {\n definition.contentQueries = (rf, ctx, directiveIndex) => {\n superContentQueries(rf, ctx, directiveIndex);\n prevContentQueries(rf, ctx, directiveIndex);\n };\n } else {\n definition.contentQueries = superContentQueries;\n }\n}\n\nfunction inheritHostBindings(\n definition: WritableDef, superHostBindings: HostBindingsFunction<any>) {\n const prevHostBindings = definition.hostBindings;\n if (prevHostBindings) {\n definition.hostBindings = (rf: RenderFlags, ctx: any) => {\n superHostBindings(rf, ctx);\n prevHostBindings(rf, ctx);\n };\n } else {\n definition.hostBindings = superHostBindings;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function isIterable(obj: any): obj is Iterable<any> {\n return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;\n}\n\nexport function isListLikeIterable(obj: any): boolean {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) ||\n (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n Symbol.iterator in obj); // JS Iterable have a Symbol.iterator prop\n}\n\nexport function areIterablesEqual<T>(\n a: Iterable<T>, b: Iterable<T>, comparator: (a: T, b: T) => boolean): boolean {\n const iterator1 = a[Symbol.iterator]();\n const iterator2 = b[Symbol.iterator]();\n\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\n\nexport function iterateListLike<T>(obj: Iterable<T>, fn: (p: T) => void) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[Symbol.iterator]();\n let item: IteratorResult<T, any>;\n while (!((item = iterator.next()).done)) {\n fn(item.value);\n }\n }\n}\n\nexport function isJsObject(o: any): boolean {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertIndexInRange, assertLessThan, assertNotSame} from '../util/assert';\nimport {devModeEqual} from '../util/comparison';\n\nimport {getExpressionChangedErrorDetails, throwErrorIfNoChangesMode} from './errors';\nimport {LView} from './interfaces/view';\nimport {isInCheckNoChangesMode} from './state';\nimport {NO_CHANGE} from './tokens';\n\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nexport function updateBinding(lView: LView, bindingIndex: number, value: any): any {\n return lView[bindingIndex] = value;\n}\n\n\n/** Gets the current binding value. */\nexport function getBinding(lView: LView, bindingIndex: number): any {\n ngDevMode && assertIndexInRange(lView, bindingIndex);\n ngDevMode &&\n assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n\n/**\n * Updates binding if changed, then returns whether it was updated.\n *\n * This function also checks the `CheckNoChangesMode` and throws if changes are made.\n * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE\n * behavior.\n *\n * @param lView current `LView`\n * @param bindingIndex The binding in the `LView` to check\n * @param value New value to check against `lView[bindingIndex]`\n * @returns `true` if the bindings has changed. (Throws if binding has changed during\n * `CheckNoChangesMode`)\n */\nexport function bindingUpdated(lView: LView, bindingIndex: number, value: any): boolean {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n const oldValue = lView[bindingIndex];\n\n if (Object.is(oldValue, value)) {\n return false;\n } else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details =\n getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(\n oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}\n\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nexport function bindingUpdated2(lView: LView, bindingIndex: number, exp1: any, exp2: any): boolean {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated3(\n lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any): boolean {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated4(\n lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any, exp4: any): boolean {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {bindingUpdated} from '../bindings';\nimport {SanitizerFn} from '../interfaces/sanitization';\nimport {getLView, getSelectedTNode, getTView, nextBindingIndex} from '../state';\nimport {elementAttributeInternal, storePropertyBindingMetadata} from './shared';\n\n\n\n/**\n * Updates the value of or removes a bound attribute on an Element.\n *\n * Used in the case of `[attr.title]=\"value\"`\n *\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n * @param namespace Optional namespace to use when setting the attribute.\n *\n * @codeGenApi\n */\nexport function ɵɵattribute(\n name: string, value: any, sanitizer?: SanitizerFn|null,\n namespace?: string): typeof ɵɵattribute {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);\n }\n return ɵɵattribute;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual, assertLessThan} from '../../util/assert';\nimport {bindingUpdated, bindingUpdated2, bindingUpdated3, bindingUpdated4} from '../bindings';\nimport {LView} from '../interfaces/view';\nimport {getBindingIndex, incrementBindingIndex, nextBindingIndex, setBindingIndex} from '../state';\nimport {NO_CHANGE} from '../tokens';\nimport {renderStringify} from '../util/stringify_utils';\n\n\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function interpolationV(lView: LView, values: any[]): string|NO_CHANGE {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n let isBindingUpdated = false;\n let bindingIndex = getBindingIndex();\n\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;\n }\n setBindingIndex(bindingIndex);\n\n if (!isBindingUpdated) {\n return NO_CHANGE;\n }\n\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n content += renderStringify(values[i]) + values[i + 1];\n }\n\n return content;\n}\n\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nexport function interpolation1(lView: LView, prefix: string, v0: any, suffix: string): string|\n NO_CHANGE {\n const different = bindingUpdated(lView, nextBindingIndex(), v0);\n return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;\n}\n\n/**\n * Creates an interpolation binding with 2 expressions.\n */\nexport function interpolation2(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, suffix: string): string|NO_CHANGE {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated2(lView, bindingIndex, v0, v1);\n incrementBindingIndex(2);\n\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;\n}\n\n/**\n * Creates an interpolation binding with 3 expressions.\n */\nexport function interpolation3(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any,\n suffix: string): string|NO_CHANGE {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n incrementBindingIndex(3);\n\n return different ?\n prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :\n NO_CHANGE;\n}\n\n/**\n * Create an interpolation binding with 4 expressions.\n */\nexport function interpolation4(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, suffix: string): string|NO_CHANGE {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n incrementBindingIndex(4);\n\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n renderStringify(v2) + i2 + renderStringify(v3) + suffix :\n NO_CHANGE;\n}\n\n/**\n * Creates an interpolation binding with 5 expressions.\n */\nexport function interpolation5(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, suffix: string): string|NO_CHANGE {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n incrementBindingIndex(5);\n\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :\n NO_CHANGE;\n}\n\n/**\n * Creates an interpolation binding with 6 expressions.\n */\nexport function interpolation6(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): string|NO_CHANGE {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n incrementBindingIndex(6);\n\n return different ?\n prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +\n renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :\n NO_CHANGE;\n}\n\n/**\n * Creates an interpolation binding with 7 expressions.\n */\nexport function interpolation7(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string|\n NO_CHANGE {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n incrementBindingIndex(7);\n\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +\n renderStringify(v5) + i5 + renderStringify(v6) + suffix :\n NO_CHANGE;\n}\n\n/**\n * Creates an interpolation binding with 8 expressions.\n */\nexport function interpolation8(\n lView: LView, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,\n suffix: string): string|NO_CHANGE {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n incrementBindingIndex(8);\n\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +\n renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +\n renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :\n NO_CHANGE;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {assertFirstCreatePass} from '../assert';\nimport {attachPatchData} from '../context_discovery';\nimport {registerPostOrderHooks} from '../hooks';\nimport {ComponentTemplate} from '../interfaces/definition';\nimport {LocalRefExtractor, TAttributes, TContainerNode, TNodeType} from '../interfaces/node';\nimport {isDirectiveHost} from '../interfaces/type_checks';\nimport {HEADER_OFFSET, LView, RENDERER, TView, TViewType} from '../interfaces/view';\nimport {appendChild} from '../node_manipulation';\nimport {getLView, getTView, setCurrentTNode} from '../state';\nimport {getConstant} from '../util/view_utils';\n\nimport {addToViewTree, createDirectivesInstances, createLContainer, createTView, getOrCreateTNode, resolveDirectives, saveResolvedLocalsInData} from './shared';\n\n\n\nfunction templateFirstCreatePass(\n index: number, tView: TView, lView: LView, templateFn: ComponentTemplate<any>|null,\n decls: number, vars: number, tagName?: string|null, attrsIndex?: number|null,\n localRefsIndex?: number|null): TContainerNode {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && ngDevMode.firstCreatePass++;\n const tViewConsts = tView.consts;\n // TODO(pk): refactor getOrCreateTNode to have the \"create\" only version\n const tNode = getOrCreateTNode(\n tView, index, TNodeType.Container, tagName || null,\n getConstant<TAttributes>(tViewConsts, attrsIndex));\n\n resolveDirectives(tView, lView, tNode, getConstant<string[]>(tViewConsts, localRefsIndex));\n registerPostOrderHooks(tView, tNode);\n\n const embeddedTView = tNode.tView = createTView(\n TViewType.Embedded, tNode, templateFn, decls, vars, tView.directiveRegistry,\n tView.pipeRegistry, null, tView.schemas, tViewConsts);\n\n if (tView.queries !== null) {\n tView.queries.template(tView, tNode);\n embeddedTView.queries = tView.queries.embeddedTView(tNode);\n }\n\n return tNode;\n}\n\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nexport function ɵɵtemplate(\n index: number, templateFn: ComponentTemplate<any>|null, decls: number, vars: number,\n tagName?: string|null, attrsIndex?: number|null, localRefsIndex?: number|null,\n localRefExtractor?: LocalRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(\n adjustedIndex, tView, lView, templateFn, decls, vars,\n tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex] as TContainerNode;\n setCurrentTNode(tNode, false);\n\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {HEADER_OFFSET, LView, TView} from '../interfaces/view';\nimport {getContextLView} from '../state';\nimport {load} from '../util/view_utils';\n\n\n/** Store a value in the `data` at a given `index`. */\nexport function store<T>(tView: TView, lView: LView, index: number, value: T): void {\n // We don't store any static data for local variables, so the first time\n // we see the template, we should store as null to avoid a sparse array\n if (index >= tView.data.length) {\n tView.data[index] = null;\n tView.blueprint[index] = null;\n }\n lView[index] = value;\n}\n\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n *\n * @codeGenApi\n */\nexport function ɵɵreference<T>(index: number) {\n const contextLView = getContextLView();\n return load<T>(contextLView, HEADER_OFFSET + index);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {bindingUpdated} from '../bindings';\nimport {TNode} from '../interfaces/node';\nimport {SanitizerFn} from '../interfaces/sanitization';\nimport {LView, RENDERER, TView} from '../interfaces/view';\nimport {getLView, getSelectedTNode, getTView, nextBindingIndex} from '../state';\n\nimport {elementPropertyInternal, setInputsForProperty, storePropertyBindingMetadata} from './shared';\n\n\n/**\n * Update a property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nexport function ɵɵproperty<T>(\n propName: string, value: T, sanitizer?: SanitizerFn|null): typeof ɵɵproperty {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵproperty;\n}\n\n/**\n * Given `<div style=\"...\" my-dir>` and `MyDir` with `@Input('style')` we need to write to\n * directive input.\n */\nexport function setDirectiveInputsWhichShadowsStyling(\n tView: TView, tNode: TNode, lView: LView, value: any, isClassBased: boolean) {\n const inputs = tNode.inputs!;\n const property = isClassBased ? 'class' : 'style';\n // We support both 'class' and `className` hence the fallback.\n setInputsForProperty(tView, lView, inputs[property], property, value);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined, assertEqual, assertIndexInRange} from '../../util/assert';\nimport {assertFirstCreatePass, assertHasParent} from '../assert';\nimport {attachPatchData} from '../context_discovery';\nimport {registerPostOrderHooks} from '../hooks';\nimport {hasClassInput, hasStyleInput, TAttributes, TElementNode, TNodeFlags, TNodeType} from '../interfaces/node';\nimport {RElement} from '../interfaces/renderer_dom';\nimport {isContentQueryHost, isDirectiveHost} from '../interfaces/type_checks';\nimport {HEADER_OFFSET, LView, RENDERER, TView} from '../interfaces/view';\nimport {assertTNodeType} from '../node_assert';\nimport {appendChild, createElementNode, setupStaticAttributes} from '../node_manipulation';\nimport {decreaseElementDepthCount, getBindingIndex, getCurrentTNode, getElementDepthCount, getLView, getNamespace, getTView, increaseElementDepthCount, isCurrentTNodeParent, setCurrentTNode, setCurrentTNodeAsNotParent} from '../state';\nimport {computeStaticStyling} from '../styling/static_styling';\nimport {getConstant} from '../util/view_utils';\n\nimport {validateElementIsKnown} from './element_validation';\nimport {setDirectiveInputsWhichShadowsStyling} from './property';\nimport {createDirectivesInstances, executeContentQueries, getOrCreateTNode, resolveDirectives, saveResolvedLocalsInData} from './shared';\n\n\nfunction elementStartFirstCreatePass(\n index: number, tView: TView, lView: LView, name: string, attrsIndex?: number|null,\n localRefsIndex?: number): TElementNode {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && ngDevMode.firstCreatePass++;\n\n const tViewConsts = tView.consts;\n const attrs = getConstant<TAttributes>(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, TNodeType.Element, name, attrs);\n\n resolveDirectives(tView, lView, tNode, getConstant<string[]>(tViewConsts, localRefsIndex));\n\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n\n return tNode;\n}\n\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n *\n * @codeGenApi\n */\nexport function ɵɵelementStart(\n index: number, name: string, attrsIndex?: number|null,\n localRefsIndex?: number): typeof ɵɵelementStart {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = HEADER_OFFSET + index;\n\n ngDevMode &&\n assertEqual(\n getBindingIndex(), tView.bindingStartIndex,\n 'elements should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n\n const renderer = lView[RENDERER];\n const tNode = tView.firstCreatePass ?\n elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex] as TElementNode;\n const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace());\n const hasDirectives = isDirectiveHost(tNode);\n\n if (ngDevMode && tView.firstCreatePass) {\n validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);\n }\n\n setCurrentTNode(tNode, true);\n setupStaticAttributes(renderer, native, tNode);\n\n if ((tNode.flags & TNodeFlags.isDetached) !== TNodeFlags.isDetached) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n\n if (hasDirectives) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex !== null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementStart;\n}\n\n/**\n * Mark the end of the element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nexport function ɵɵelementEnd(): typeof ɵɵelementEnd {\n let currentTNode = getCurrentTNode()!;\n ngDevMode && assertDefined(currentTNode, 'No parent node to close.');\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n } else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent!;\n setCurrentTNode(currentTNode, false);\n }\n\n const tNode = currentTNode;\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyRNode);\n\n\n decreaseElementDepthCount();\n\n const tView = getTView();\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries!.elementEnd(currentTNode);\n }\n }\n\n if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);\n }\n\n if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);\n }\n return ɵɵelementEnd;\n}\n\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nexport function ɵɵelement(\n index: number, name: string, attrsIndex?: number|null,\n localRefsIndex?: number): typeof ɵɵelement {\n ɵɵelementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵelementEnd();\n return ɵɵelement;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {KeyValueArray} from '../../util/array_utils';\nimport {TStylingRange} from '../interfaces/styling';\n\nimport {TIcu} from './i18n';\nimport {CssSelector} from './projection';\nimport {RNode} from './renderer_dom';\nimport {LView, TView} from './view';\n\n\n/**\n * TNodeType corresponds to the {@link TNode} `type` property.\n *\n * NOTE: type IDs are such that we use each bit to denote a type. This is done so that we can easily\n * check if the `TNode` is of more than one type.\n *\n * `if (tNode.type === TNodeType.Text || tNode.type === TNode.Element)`\n * can be written as:\n * `if (tNode.type & (TNodeType.Text | TNodeType.Element))`\n *\n * However any given `TNode` can only be of one type.\n */\nexport const enum TNodeType {\n /**\n * The TNode contains information about a DOM element aka {@link RText}.\n */\n Text = 0b1,\n\n /**\n * The TNode contains information about a DOM element aka {@link RElement}.\n */\n Element = 0b10,\n\n /**\n * The TNode contains information about an {@link LContainer} for embedded views.\n */\n Container = 0b100,\n\n /**\n * The TNode contains information about an `<ng-container>` element {@link RNode}.\n */\n ElementContainer = 0b1000,\n\n /**\n * The TNode contains information about an `<ng-content>` projection\n */\n Projection = 0b10000,\n\n /**\n * The TNode contains information about an ICU comment used in `i18n`.\n */\n Icu = 0b100000,\n\n /**\n * Special node type representing a placeholder for future `TNode` at this location.\n *\n * I18n translation blocks are created before the element nodes which they contain. (I18n blocks\n * can span over many elements.) Because i18n `TNode`s (representing text) are created first they\n * often may need to point to element `TNode`s which are not yet created. In such a case we create\n * a `Placeholder` `TNode`. This allows the i18n to structurally link the `TNode`s together\n * without knowing any information about the future nodes which will be at that location.\n *\n * On `firstCreatePass` When element instruction executes it will try to create a `TNode` at that\n * location. Seeing a `Placeholder` `TNode` already there tells the system that it should reuse\n * existing `TNode` (rather than create a new one) and just update the missing information.\n */\n Placeholder = 0b1000000,\n\n // Combined Types These should never be used for `TNode.type` only as a useful way to check\n // if `TNode.type` is one of several choices.\n\n // See: https://github.com/microsoft/TypeScript/issues/35875 why we can't refer to existing enum.\n AnyRNode = 0b11, // Text | Element,\n AnyContainer = 0b1100, // Container | ElementContainer, // See:\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nexport function toTNodeTypeAsString(tNodeType: TNodeType): string {\n let text = '';\n (tNodeType & TNodeType.Text) && (text += '|Text');\n (tNodeType & TNodeType.Element) && (text += '|Element');\n (tNodeType & TNodeType.Container) && (text += '|Container');\n (tNodeType & TNodeType.ElementContainer) && (text += '|ElementContainer');\n (tNodeType & TNodeType.Projection) && (text += '|Projection');\n (tNodeType & TNodeType.Icu) && (text += '|IcuContainer');\n (tNodeType & TNodeType.Placeholder) && (text += '|Placeholder');\n return text.length > 0 ? text.substring(1) : text;\n}\n\n/**\n * Corresponds to the TNode.flags property.\n */\nexport const enum TNodeFlags {\n /** Bit #1 - This bit is set if the node is a host for any directive (including a component) */\n isDirectiveHost = 0x1,\n\n /** Bit #2 - This bit is set if the node has been projected */\n isProjected = 0x2,\n\n /** Bit #3 - This bit is set if any directive on this node has content queries */\n hasContentQuery = 0x4,\n\n /** Bit #4 - This bit is set if the node has any \"class\" inputs */\n hasClassInput = 0x8,\n\n /** Bit #5 - This bit is set if the node has any \"style\" inputs */\n hasStyleInput = 0x10,\n\n /** Bit #6 This bit is set if the node has been detached by i18n */\n isDetached = 0x20,\n\n /**\n * Bit #7 - This bit is set if the node has directives with host bindings.\n *\n * This flags allows us to guard host-binding logic and invoke it only on nodes\n * that actually have directives with host bindings.\n */\n hasHostBindings = 0x40,\n}\n\n/**\n * Corresponds to the TNode.providerIndexes property.\n */\nexport const enum TNodeProviderIndexes {\n /** The index of the first provider on this node is encoded on the least significant bits. */\n ProvidersStartIndexMask = 0b00000000000011111111111111111111,\n\n /**\n * The count of view providers from the component on this node is\n * encoded on the 20 most significant bits.\n */\n CptViewProvidersCountShift = 20,\n CptViewProvidersCountShifter = 0b00000000000100000000000000000000,\n}\n\n/**\n * A set of marker values to be used in the attributes arrays. These markers indicate that some\n * items are not regular attributes and the processing should be adapted accordingly.\n */\nexport const enum AttributeMarker {\n /**\n * An implicit marker which indicates that the value in the array are of `attributeKey`,\n * `attributeValue` format.\n *\n * NOTE: This is implicit as it is the type when no marker is present in array. We indicate that\n * it should not be present at runtime by the negative number.\n */\n ImplicitAttributes = -1,\n\n /**\n * Marker indicates that the following 3 values in the attributes array are:\n * namespaceUri, attributeName, attributeValue\n * in that order.\n */\n NamespaceURI = 0,\n\n /**\n * Signals class declaration.\n *\n * Each value following `Classes` designates a class name to include on the element.\n * ## Example:\n *\n * Given:\n * ```\n * <div class=\"foo bar baz\">...<d/vi>\n * ```\n *\n * the generated code is:\n * ```\n * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];\n * ```\n */\n Classes = 1,\n\n /**\n * Signals style declaration.\n *\n * Each pair of values following `Styles` designates a style name and value to include on the\n * element.\n * ## Example:\n *\n * Given:\n * ```\n * <div style=\"width:100px; height:200px; color:red\">...</div>\n * ```\n *\n * the generated code is:\n * ```\n * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];\n * ```\n */\n Styles = 2,\n\n /**\n * Signals that the following attribute names were extracted from input or output bindings.\n *\n * For example, given the following HTML:\n *\n * ```\n * <div moo=\"car\" [foo]=\"exp\" (bar)=\"doSth()\">\n * ```\n *\n * the generated code is:\n *\n * ```\n * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar'];\n * ```\n */\n Bindings = 3,\n\n /**\n * Signals that the following attribute names were hoisted from an inline-template declaration.\n *\n * For example, given the following HTML:\n *\n * ```\n * <div *ngFor=\"let value of values; trackBy:trackBy\" dirA [dirB]=\"value\">\n * ```\n *\n * the generated code for the `template()` instruction would include:\n *\n * ```\n * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf',\n * 'ngForTrackBy', 'let-value']\n * ```\n *\n * while the generated code for the `element()` instruction inside the template function would\n * include:\n *\n * ```\n * ['dirA', '', AttributeMarker.Bindings, 'dirB']\n * ```\n */\n Template = 4,\n\n /**\n * Signals that the following attribute is `ngProjectAs` and its value is a parsed\n * `CssSelector`.\n *\n * For example, given the following HTML:\n *\n * ```\n * <h1 attr=\"value\" ngProjectAs=\"[title]\">\n * ```\n *\n * the generated code for the `element()` instruction would include:\n *\n * ```\n * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']]\n * ```\n */\n ProjectAs = 5,\n\n /**\n * Signals that the following attribute will be translated by runtime i18n\n *\n * For example, given the following HTML:\n *\n * ```\n * <div moo=\"car\" foo=\"value\" i18n-foo [bar]=\"binding\" i18n-bar>\n * ```\n *\n * the generated code is:\n *\n * ```\n * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar'];\n */\n I18n = 6,\n}\n\n/**\n * A combination of:\n * - Attribute names and values.\n * - Special markers acting as flags to alter attributes processing.\n * - Parsed ngProjectAs selectors.\n */\nexport type TAttributes = (string|AttributeMarker|CssSelector)[];\n\n/**\n * Constants that are associated with a view. Includes:\n * - Attribute arrays.\n * - Local definition arrays.\n * - Translated messages (i18n).\n */\nexport type TConstants = (TAttributes|string)[];\n\n/**\n * Factory function that returns an array of consts. Consts can be represented as a function in\n * case any additional statements are required to define consts in the list. An example is i18n\n * where additional i18n calls are generated, which should be executed when consts are requested\n * for the first time.\n */\nexport type TConstantsFactory = () => TConstants;\n\n/**\n * TConstants type that describes how the `consts` field is generated on ComponentDef: it can be\n * either an array or a factory function that returns that array.\n */\nexport type TConstantsOrFactory = TConstants|TConstantsFactory;\n\n/**\n * Binding data (flyweight) for a particular node that is shared between all templates\n * of a specific type.\n *\n * If a property is:\n * - PropertyAliases: that property's data was generated and this is it\n * - Null: that property's data was already generated and nothing was found.\n * - Undefined: that property's data has not yet been generated\n *\n * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern\n */\nexport interface TNode {\n /** The type of the TNode. See TNodeType. */\n type: TNodeType;\n\n /**\n * Index of the TNode in TView.data and corresponding native element in LView.\n *\n * This is necessary to get from any TNode to its corresponding native element when\n * traversing the node tree.\n *\n * If index is -1, this is a dynamically created container node or embedded view node.\n */\n index: number;\n\n /**\n * Insert before existing DOM node index.\n *\n * When DOM nodes are being inserted, normally they are being appended as they are created.\n * Under i18n case, the translated text nodes are created ahead of time as part of the\n * `ɵɵi18nStart` instruction which means that this `TNode` can't just be appended and instead\n * needs to be inserted using `insertBeforeIndex` semantics.\n *\n * Additionally sometimes it is necessary to insert new text nodes as a child of this `TNode`. In\n * such a case the value stores an array of text nodes to insert.\n *\n * Example:\n * ```\n * <div i18n>\n * Hello <span>World</span>!\n * </div>\n * ```\n * In the above example the `ɵɵi18nStart` instruction can create `Hello `, `World` and `!` text\n * nodes. It can also insert `Hello ` and `!` text node as a child of `<div>`, but it can't\n * insert `World` because the `<span>` node has not yet been created. In such a case the\n * `<span>` `TNode` will have an array which will direct the `<span>` to not only insert\n * itself in front of `!` but also to insert the `World` (created by `ɵɵi18nStart`) into\n * `<span>` itself.\n *\n * Pseudo code:\n * ```\n * if (insertBeforeIndex === null) {\n * // append as normal\n * } else if (Array.isArray(insertBeforeIndex)) {\n * // First insert current `TNode` at correct location\n * const currentNode = lView[this.index];\n * parentNode.insertBefore(currentNode, lView[this.insertBeforeIndex[0]]);\n * // Now append all of the children\n * for(let i=1; i<this.insertBeforeIndex; i++) {\n * currentNode.appendChild(lView[this.insertBeforeIndex[i]]);\n * }\n * } else {\n * parentNode.insertBefore(lView[this.index], lView[this.insertBeforeIndex])\n * }\n * ```\n * - null: Append as normal using `parentNode.appendChild`\n * - `number`: Append using\n * `parentNode.insertBefore(lView[this.index], lView[this.insertBeforeIndex])`\n *\n * *Initialization*\n *\n * Because `ɵɵi18nStart` executes before nodes are created, on `TView.firstCreatePass` it is not\n * possible for `ɵɵi18nStart` to set the `insertBeforeIndex` value as the corresponding `TNode`\n * has not yet been created. For this reason the `ɵɵi18nStart` creates a `TNodeType.Placeholder`\n * `TNode` at that location. See `TNodeType.Placeholder` for more information.\n */\n insertBeforeIndex: InsertBeforeIndex;\n\n /**\n * The index of the closest injector in this node's LView.\n *\n * If the index === -1, there is no injector on this node or any ancestor node in this view.\n *\n * If the index !== -1, it is the index of this node's injector OR the index of a parent\n * injector in the same view. We pass the parent injector index down the node tree of a view so\n * it's possible to find the parent injector without walking a potentially deep node tree.\n * Injector indices are not set across view boundaries because there could be multiple component\n * hosts.\n *\n * If tNode.injectorIndex === tNode.parent.injectorIndex, then the index belongs to a parent\n * injector.\n */\n injectorIndex: number;\n\n /** Stores starting index of the directives. */\n directiveStart: number;\n\n /**\n * Stores final exclusive index of the directives.\n *\n * The area right behind the `directiveStart-directiveEnd` range is used to allocate the\n * `HostBindingFunction` `vars` (or null if no bindings.) Therefore `directiveEnd` is used to set\n * `LFrame.bindingRootIndex` before `HostBindingFunction` is executed.\n */\n directiveEnd: number;\n\n /**\n * Offset from the `directiveStart` at which the component (one at most) of the node is stored.\n * Set to -1 if no components have been applied to the node. Component index can be found using\n * `directiveStart + componentOffset`.\n */\n componentOffset: number;\n\n /**\n * Stores the last directive which had a styling instruction.\n *\n * Initial value of this is `-1` which means that no `hostBindings` styling instruction has\n * executed. As `hostBindings` instructions execute they set the value to the index of the\n * `DirectiveDef` which contained the last `hostBindings` styling instruction.\n *\n * Valid values are:\n * - `-1` No `hostBindings` instruction has executed.\n * - `directiveStart <= directiveStylingLast < directiveEnd`: Points to the `DirectiveDef` of\n * the last styling instruction which executed in the `hostBindings`.\n *\n * This data is needed so that styling instructions know which static styling data needs to be\n * collected from the `DirectiveDef.hostAttrs`. A styling instruction needs to collect all data\n * since last styling instruction.\n */\n directiveStylingLast: number;\n\n /**\n * Stores indexes of property bindings. This field is only set in the ngDevMode and holds\n * indexes of property bindings so TestBed can get bound property metadata for a given node.\n */\n propertyBindings: number[]|null;\n\n /**\n * Stores if Node isComponent, isProjected, hasContentQuery, hasClassInput and hasStyleInput\n * etc.\n */\n flags: TNodeFlags;\n\n /**\n * This number stores two values using its bits:\n *\n * - the index of the first provider on that node (first 16 bits)\n * - the count of view providers from the component on this node (last 16 bits)\n */\n // TODO(misko): break this into actual vars.\n providerIndexes: TNodeProviderIndexes;\n\n /**\n * The value name associated with this node.\n * if type:\n * `TNodeType.Text`: text value\n * `TNodeType.Element`: tag name\n * `TNodeType.ICUContainer`: `TIcu`\n */\n value: any;\n\n /**\n * Attributes associated with an element. We need to store attributes to support various\n * use-cases (attribute injection, content projection with selectors, directives matching).\n * Attributes are stored statically because reading them from the DOM would be way too slow for\n * content projection and queries.\n *\n * Since attrs will always be calculated first, they will never need to be marked undefined by\n * other instructions.\n *\n * For regular attributes a name of an attribute and its value alternate in the array.\n * e.g. ['role', 'checkbox']\n * This array can contain flags that will indicate \"special attributes\" (attributes with\n * namespaces, attributes extracted from bindings and outputs).\n */\n attrs: TAttributes|null;\n\n /**\n * Same as `TNode.attrs` but contains merged data across all directive host bindings.\n *\n * We need to keep `attrs` as unmerged so that it can be used for attribute selectors.\n * We merge attrs here so that it can be used in a performant way for initial rendering.\n *\n * The `attrs` are merged in first pass in following order:\n * - Component's `hostAttrs`\n * - Directives' `hostAttrs`\n * - Template `TNode.attrs` associated with the current `TNode`.\n */\n mergedAttrs: TAttributes|null;\n\n /**\n * A set of local names under which a given element is exported in a template and\n * visible to queries. An entry in this array can be created for different reasons:\n * - an element itself is referenced, ex.: `<div #foo>`\n * - a component is referenced, ex.: `<my-cmpt #foo>`\n * - a directive is referenced, ex.: `<my-cmpt #foo=\"directiveExportAs\">`.\n *\n * A given element might have different local names and those names can be associated\n * with a directive. We store local names at even indexes while odd indexes are reserved\n * for directive index in a view (or `-1` if there is no associated directive).\n *\n * Some examples:\n * - `<div #foo>` => `[\"foo\", -1]`\n * - `<my-cmpt #foo>` => `[\"foo\", myCmptIdx]`\n * - `<my-cmpt #foo #bar=\"directiveExportAs\">` => `[\"foo\", myCmptIdx, \"bar\", directiveIdx]`\n * - `<div #foo #bar=\"directiveExportAs\">` => `[\"foo\", -1, \"bar\", directiveIdx]`\n */\n localNames: (string|number)[]|null;\n\n /** Information about input properties that need to be set once from attribute data. */\n initialInputs: InitialInputData|null|undefined;\n\n /**\n * Input data for all directives on this node. `null` means that there are no directives with\n * inputs on this node.\n */\n inputs: PropertyAliases|null;\n\n /**\n * Output data for all directives on this node. `null` means that there are no directives with\n * outputs on this node.\n */\n outputs: PropertyAliases|null;\n\n /**\n * The TView attached to this node.\n *\n * If this TNode corresponds to an LContainer with a template (e.g. structural\n * directive), the template's TView will be stored here.\n *\n * If this TNode corresponds to an element, tView will be `null`.\n */\n tView: TView|null;\n\n /**\n * The next sibling node. Necessary so we can propagate through the root nodes of a view\n * to insert them or remove them from the DOM.\n */\n next: TNode|null;\n\n /**\n * The previous sibling node.\n * This simplifies operations when we need a pointer to the previous node.\n */\n prev: TNode|null;\n\n /**\n * The next projected sibling. Since in Angular content projection works on the node-by-node\n * basis the act of projecting nodes might change nodes relationship at the insertion point\n * (target view). At the same time we need to keep initial relationship between nodes as\n * expressed in content view.\n */\n projectionNext: TNode|null;\n\n /**\n * First child of the current node.\n *\n * For component nodes, the child will always be a ContentChild (in same view).\n * For embedded view nodes, the child will be in their child view.\n */\n child: TNode|null;\n\n /**\n * Parent node (in the same view only).\n *\n * We need a reference to a node's parent so we can append the node to its parent's native\n * element at the appropriate time.\n *\n * If the parent would be in a different view (e.g. component host), this property will be null.\n * It's important that we don't try to cross component boundaries when retrieving the parent\n * because the parent will change (e.g. index, attrs) depending on where the component was\n * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through\n * LView.node instead (which will be instance-specific).\n *\n * If this is an inline view node (V), the parent will be its container.\n */\n parent: TElementNode|TContainerNode|null;\n\n /**\n * List of projected TNodes for a given component host element OR index into the said nodes.\n *\n * For easier discussion assume this example:\n * `<parent>`'s view definition:\n * ```\n * <child id=\"c1\">content1</child>\n * <child id=\"c2\"><span>content2</span></child>\n * ```\n * `<child>`'s view definition:\n * ```\n * <ng-content id=\"cont1\"></ng-content>\n * ```\n *\n * If `Array.isArray(projection)` then `TNode` is a host element:\n * - `projection` stores the content nodes which are to be projected.\n * - The nodes represent categories defined by the selector: For example:\n * `<ng-content/><ng-content select=\"abc\"/>` would represent the heads for `<ng-content/>`\n * and `<ng-content select=\"abc\"/>` respectively.\n * - The nodes we store in `projection` are heads only, we used `.next` to get their\n * siblings.\n * - The nodes `.next` is sorted/rewritten as part of the projection setup.\n * - `projection` size is equal to the number of projections `<ng-content>`. The size of\n * `c1` will be `1` because `<child>` has only one `<ng-content>`.\n * - we store `projection` with the host (`c1`, `c2`) rather than the `<ng-content>` (`cont1`)\n * because the same component (`<child>`) can be used in multiple locations (`c1`, `c2`) and\n * as a result have different set of nodes to project.\n * - without `projection` it would be difficult to efficiently traverse nodes to be projected.\n *\n * If `typeof projection == 'number'` then `TNode` is a `<ng-content>` element:\n * - `projection` is an index of the host's `projection`Nodes.\n * - This would return the first head node to project:\n * `getHost(currentTNode).projection[currentTNode.projection]`.\n * - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case\n * the process is recursive in nature.\n *\n * If `projection` is of type `RNode[][]` than we have a collection of native nodes passed as\n * projectable nodes during dynamic component creation.\n */\n projection: (TNode|RNode[])[]|number|null;\n\n /**\n * A collection of all `style` static values for an element (including from host).\n *\n * This field will be populated if and when:\n *\n * - There are one or more initial `style`s on an element (e.g. `<div style=\"width:200px;\">`)\n * - There are one or more initial `style`s on a directive/component host\n * (e.g. `@Directive({host: {style: \"width:200px;\" } }`)\n */\n styles: string|null;\n\n\n /**\n * A collection of all `style` static values for an element excluding host sources.\n *\n * Populated when there are one or more initial `style`s on an element\n * (e.g. `<div style=\"width:200px;\">`)\n * Must be stored separately from `tNode.styles` to facilitate setting directive\n * inputs that shadow the `style` property. If we used `tNode.styles` as is for shadowed inputs,\n * we would feed host styles back into directives as \"inputs\". If we used `tNode.attrs`, we\n * would have to concatenate the attributes on every template pass. Instead, we process once on\n * first create pass and store here.\n */\n stylesWithoutHost: string|null;\n\n /**\n * A `KeyValueArray` version of residual `styles`.\n *\n * When there are styling instructions than each instruction stores the static styling\n * which is of lower priority than itself. This means that there may be a higher priority\n * styling than the instruction.\n *\n * Imagine:\n * ```\n * <div style=\"color: highest;\" my-dir>\n *\n * @Directive({\n * host: {\n * style: 'color: lowest; ',\n * '[styles.color]': 'exp' // ɵɵstyleProp('color', ctx.exp);\n * }\n * })\n * ```\n *\n * In the above case:\n * - `color: lowest` is stored with `ɵɵstyleProp('color', ctx.exp);` instruction\n * - `color: highest` is the residual and is stored here.\n *\n * - `undefined': not initialized.\n * - `null`: initialized but `styles` is `null`\n * - `KeyValueArray`: parsed version of `styles`.\n */\n residualStyles: KeyValueArray<any>|undefined|null;\n\n /**\n * A collection of all class static values for an element (including from host).\n *\n * This field will be populated if and when:\n *\n * - There are one or more initial classes on an element (e.g. `<div class=\"one two three\">`)\n * - There are one or more initial classes on an directive/component host\n * (e.g. `@Directive({host: {class: \"SOME_CLASS\" } }`)\n */\n classes: string|null;\n\n /**\n * A collection of all class static values for an element excluding host sources.\n *\n * Populated when there are one or more initial classes on an element\n * (e.g. `<div class=\"SOME_CLASS\">`)\n * Must be stored separately from `tNode.classes` to facilitate setting directive\n * inputs that shadow the `class` property. If we used `tNode.classes` as is for shadowed\n * inputs, we would feed host classes back into directives as \"inputs\". If we used\n * `tNode.attrs`, we would have to concatenate the attributes on every template pass. Instead,\n * we process once on first create pass and store here.\n */\n classesWithoutHost: string|null;\n\n /**\n * A `KeyValueArray` version of residual `classes`.\n *\n * Same as `TNode.residualStyles` but for classes.\n *\n * - `undefined': not initialized.\n * - `null`: initialized but `classes` is `null`\n * - `KeyValueArray`: parsed version of `classes`.\n */\n residualClasses: KeyValueArray<any>|undefined|null;\n\n /**\n * Stores the head/tail index of the class bindings.\n *\n * - If no bindings, the head and tail will both be 0.\n * - If there are template bindings, stores the head/tail of the class bindings in the template.\n * - If no template bindings but there are host bindings, the head value will point to the last\n * host binding for \"class\" (not the head of the linked list), tail will be 0.\n *\n * See: `style_binding_list.ts` for details.\n *\n * This is used by `insertTStylingBinding` to know where the next styling binding should be\n * inserted so that they can be sorted in priority order.\n */\n classBindings: TStylingRange;\n\n /**\n * Stores the head/tail index of the class bindings.\n *\n * - If no bindings, the head and tail will both be 0.\n * - If there are template bindings, stores the head/tail of the style bindings in the template.\n * - If no template bindings but there are host bindings, the head value will point to the last\n * host binding for \"style\" (not the head of the linked list), tail will be 0.\n *\n * See: `style_binding_list.ts` for details.\n *\n * This is used by `insertTStylingBinding` to know where the next styling binding should be\n * inserted so that they can be sorted in priority order.\n */\n styleBindings: TStylingRange;\n}\n\n/**\n * See `TNode.insertBeforeIndex`\n */\nexport type InsertBeforeIndex = null|number|number[];\n\n/** Static data for an element */\nexport interface TElementNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: TElementNode|TTextNode|TElementContainerNode|TContainerNode|TProjectionNode|null;\n /**\n * Element nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using viewData[HOST_NODE]).\n */\n parent: TElementNode|TElementContainerNode|null;\n tView: null;\n\n /**\n * If this is a component TNode with projection, this will be an array of projected\n * TNodes or native nodes (see TNode.projection for more info). If it's a regular element node\n * or a component without projection, it will be null.\n */\n projection: (TNode|RNode[])[]|null;\n\n /**\n * Stores TagName\n */\n value: string;\n}\n\n/** Static data for a text node */\nexport interface TTextNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: null;\n /**\n * Text nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|TElementContainerNode|null;\n tView: null;\n projection: null;\n}\n\n/** Static data for an LContainer */\nexport interface TContainerNode extends TNode {\n /**\n * Index in the data[] array.\n *\n * If it's -1, this is a dynamically created container node that isn't stored in\n * data[] (e.g. when you inject ViewContainerRef) .\n */\n index: number;\n child: null;\n\n /**\n * Container nodes will have parents unless:\n *\n * - They are the first node of a component or embedded view\n * - They are dynamically created\n */\n parent: TElementNode|TElementContainerNode|null;\n tView: TView|null;\n projection: null;\n value: null;\n}\n\n/** Static data for an <ng-container> */\nexport interface TElementContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: TElementNode|TTextNode|TContainerNode|TElementContainerNode|TProjectionNode|null;\n parent: TElementNode|TElementContainerNode|null;\n tView: null;\n projection: null;\n}\n\n/** Static data for an ICU expression */\nexport interface TIcuContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: null;\n parent: TElementNode|TElementContainerNode|null;\n tView: null;\n projection: null;\n value: TIcu;\n}\n\n/** Static data for an LProjectionNode */\nexport interface TProjectionNode extends TNode {\n /** Index in the data[] array */\n child: null;\n /**\n * Projection nodes will have parents unless they are the first node of a component\n * or embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|TElementContainerNode|null;\n tView: null;\n\n /** Index of the projection node. (See TNode.projection for more info.) */\n projection: number;\n value: null;\n}\n\n/**\n * A union type representing all TNode types that can host a directive.\n */\nexport type TDirectiveHostNode = TElementNode|TContainerNode|TElementContainerNode;\n\n/**\n * This mapping is necessary so we can set input properties and output listeners\n * properly at runtime when property names are minified or aliased.\n *\n * Key: unminified / public input or output name\n * Value: array containing minified / internal name and related directive index\n *\n * The value must be an array to support inputs and outputs with the same name\n * on the same node.\n */\nexport type PropertyAliases = {\n // This uses an object map because using the Map type would be too slow\n [key: string]: PropertyAliasValue\n};\n\n/**\n * Store the runtime input or output names for all the directives.\n *\n * i+0: directive instance index\n * i+1: privateName\n *\n * e.g. [0, 'change-minified']\n */\nexport type PropertyAliasValue = (number|string)[];\n\n/**\n * This array contains information about input properties that\n * need to be set once from attribute data. It's ordered by\n * directive index (relative to element) so it's simple to\n * look up a specific directive's initial input data.\n *\n * Within each sub-array:\n *\n * i+0: attribute name\n * i+1: minified/internal input name\n * i+2: initial value\n *\n * If a directive on a node does not have any input properties\n * that should be set from attributes, its index is set to null\n * to avoid a sparse array.\n *\n * e.g. [null, ['role-min', 'minified-input', 'button']]\n */\nexport type InitialInputData = (InitialInputs|null)[];\n\n/**\n * Used by InitialInputData to store input properties\n * that should be set once from attributes.\n *\n * i+0: attribute name\n * i+1: minified/internal input name\n * i+2: initial value\n *\n * e.g. ['role-min', 'minified-input', 'button']\n */\nexport type InitialInputs = string[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n\n/**\n * Type representing a set of TNodes that can have local refs (`#foo`) placed on them.\n */\nexport type TNodeWithLocalRefs = TContainerNode|TElementNode|TElementContainerNode;\n\n/**\n * Type for a function that extracts a value for a local refs.\n * Example:\n * - `<div #nativeDivEl>` - `nativeDivEl` should point to the native `<div>` element;\n * - `<ng-template #tplRef>` - `tplRef` should point to the `TemplateRef` instance;\n */\nexport type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LView) => any;\n\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```\n * <div my-dir [class]=\"exp\"></div>\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nexport function hasClassInput(tNode: TNode) {\n return (tNode.flags & TNodeFlags.hasClassInput) !== 0;\n}\n\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```\n * <div my-dir [style]=\"exp\"></div>\n * ```\n * and\n * ```\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nexport function hasStyleInput(tNode: TNode) {\n return (tNode.flags & TNodeFlags.hasStyleInput) !== 0;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {assertEqual, assertIndexInRange} from '../../util/assert';\nimport {assertHasParent} from '../assert';\nimport {attachPatchData} from '../context_discovery';\nimport {registerPostOrderHooks} from '../hooks';\nimport {TAttributes, TElementContainerNode, TNodeType} from '../interfaces/node';\nimport {isContentQueryHost, isDirectiveHost} from '../interfaces/type_checks';\nimport {HEADER_OFFSET, LView, RENDERER, TView} from '../interfaces/view';\nimport {assertTNodeType} from '../node_assert';\nimport {appendChild} from '../node_manipulation';\nimport {getBindingIndex, getCurrentTNode, getLView, getTView, isCurrentTNodeParent, setCurrentTNode, setCurrentTNodeAsNotParent} from '../state';\nimport {computeStaticStyling} from '../styling/static_styling';\nimport {getConstant} from '../util/view_utils';\n\nimport {createDirectivesInstances, executeContentQueries, getOrCreateTNode, resolveDirectives, saveResolvedLocalsInData} from './shared';\n\nfunction elementContainerStartFirstCreatePass(\n index: number, tView: TView, lView: LView, attrsIndex?: number|null,\n localRefsIndex?: number): TElementContainerNode {\n ngDevMode && ngDevMode.firstCreatePass++;\n\n const tViewConsts = tView.consts;\n const attrs = getConstant<TAttributes>(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, TNodeType.ElementContainer, 'ng-container', attrs);\n\n // While ng-container doesn't necessarily support styling, we use the style context to identify\n // and execute directives on the ng-container.\n if (attrs !== null) {\n computeStaticStyling(tNode, attrs, true);\n }\n\n const localRefs = getConstant<string[]>(tViewConsts, localRefsIndex);\n resolveDirectives(tView, lView, tNode, localRefs);\n\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n\n return tNode;\n}\n\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n *\n * @codeGenApi\n */\nexport function ɵɵelementContainerStart(\n index: number, attrsIndex?: number|null,\n localRefsIndex?: number): typeof ɵɵelementContainerStart {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n ngDevMode &&\n assertEqual(\n getBindingIndex(), tView.bindingStartIndex,\n 'element containers should be created before any bindings');\n\n const tNode = tView.firstCreatePass ?\n elementContainerStartFirstCreatePass(\n adjustedIndex, tView, lView, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex] as TElementContainerNode;\n setCurrentTNode(tNode, true);\n\n ngDevMode && ngDevMode.rendererCreateComment++;\n const native = lView[adjustedIndex] =\n lView[RENDERER].createComment(ngDevMode ? 'ng-container' : '');\n appendChild(tView, lView, native, tNode);\n attachPatchData(native, lView);\n\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n\n return ɵɵelementContainerStart;\n}\n\n/**\n * Mark the end of the <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nexport function ɵɵelementContainerEnd(): typeof ɵɵelementContainerEnd {\n let currentTNode = getCurrentTNode()!;\n const tView = getTView();\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n } else {\n ngDevMode && assertHasParent(currentTNode);\n currentTNode = currentTNode.parent!;\n setCurrentTNode(currentTNode, false);\n }\n\n ngDevMode && assertTNodeType(currentTNode, TNodeType.ElementContainer);\n\n if (tView.firstCreatePass) {\n registerPostOrderHooks(tView, currentTNode);\n if (isContentQueryHost(currentTNode)) {\n tView.queries!.elementEnd(currentTNode);\n }\n }\n return ɵɵelementContainerEnd;\n}\n\n/**\n * Creates an empty logical container using {@link elementContainerStart}\n * and {@link elementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nexport function ɵɵelementContainer(\n index: number, attrsIndex?: number|null, localRefsIndex?: number): typeof ɵɵelementContainer {\n ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵelementContainerEnd();\n return ɵɵelementContainer;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {OpaqueViewState} from '../interfaces/view';\nimport {getLView} from '../state';\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @codeGenApi\n */\nexport function ɵɵgetCurrentView(): OpaqueViewState {\n return getLView() as any as OpaqueViewState;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nexport function isPromise<T = any>(obj: any): obj is Promise<T> {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n\n/**\n * Determine if the argument is a Subscribable\n */\nexport function isSubscribable(obj: any|Subscribable<any>): obj is Subscribable<any> {\n return !!obj && typeof obj.subscribe === 'function';\n}\n\n/**\n * Determine if the argument is an Observable\n *\n * Strictly this tests that the `obj` is `Subscribable`, since `Observable`\n * types need additional methods, such as `lift()`. But it is adequate for our\n * needs since within the Angular framework code we only ever need to use the\n * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects\n * into `Observable` as needed.\n */\nexport const isObservable =\n isSubscribable as ((obj: any|Observable<any>) => obj is Observable<any>);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {assertIndexInRange} from '../../util/assert';\nimport {isObservable} from '../../util/lang';\nimport {PropertyAliasValue, TNode, TNodeType} from '../interfaces/node';\nimport {GlobalTargetResolver, Renderer} from '../interfaces/renderer';\nimport {RElement} from '../interfaces/renderer_dom';\nimport {isDirectiveHost} from '../interfaces/type_checks';\nimport {CLEANUP, CONTEXT, LView, RENDERER, TView} from '../interfaces/view';\nimport {assertTNodeType} from '../node_assert';\nimport {profiler, ProfilerEvent} from '../profiler';\nimport {getCurrentDirectiveDef, getCurrentTNode, getLView, getTView} from '../state';\nimport {getComponentLViewByIndex, getNativeByTNode, unwrapRNode} from '../util/view_utils';\n\nimport {getOrCreateLViewCleanup, getOrCreateTViewCleanup, handleError, loadComponentRenderer, markViewDirty} from './shared';\n\n\n\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener - this argument is a reminder\n * from the Renderer3 infrastructure and should be removed from the instruction arguments\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nexport function ɵɵlistener(\n eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean,\n eventTargetResolver?: GlobalTargetResolver): typeof ɵɵlistener {\n const lView = getLView<{}|null>();\n const tView = getTView();\n const tNode = getCurrentTNode()!;\n listenerInternal(\n tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);\n return ɵɵlistener;\n}\n\n/**\n * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered\n * in the component's renderer. Normally all host listeners are evaluated with the\n * parent component's renderer, but, in the case of animation @triggers, they need\n * to be evaluated with the sub component's renderer (because that's where the\n * animation triggers are defined).\n *\n * Do not use this instruction as a replacement for `listener`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nexport function ɵɵsyntheticHostListener(\n eventName: string, listenerFn: (e?: any) => any): typeof ɵɵsyntheticHostListener {\n const tNode = getCurrentTNode()!;\n const lView = getLView<{}|null>();\n const tView = getTView();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);\n return ɵɵsyntheticHostListener;\n}\n\n/**\n * A utility function that checks if a given element has already an event handler registered for an\n * event with a specified name. The TView.cleanup data structure is used to find out which events\n * are registered for a given element.\n */\nfunction findExistingListener(\n tView: TView, lView: LView, eventName: string, tNodeIdx: number): ((e?: any) => any)|null {\n const tCleanup = tView.cleanup;\n if (tCleanup != null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n const cleanupEventName = tCleanup[i];\n if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) {\n // We have found a matching event name on the same node but it might not have been\n // registered yet, so we must explicitly verify entries in the LView cleanup data\n // structures.\n const lCleanup = lView[CLEANUP]!;\n const listenerIdxInLCleanup = tCleanup[i + 2];\n return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;\n }\n // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or\n // 2-element entries (for directive and queries destroy hooks). As such we can encounter\n // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements\n // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check\n // documentation of TView.cleanup for more details of this data structure layout.\n if (typeof cleanupEventName === 'string') {\n i += 2;\n }\n }\n }\n return null;\n}\n\nfunction listenerInternal(\n tView: TView, lView: LView<{}|null>, renderer: Renderer, tNode: TNode, eventName: string,\n listenerFn: (e?: any) => any, eventTargetResolver?: GlobalTargetResolver): void {\n const isTNodeDirectiveHost = isDirectiveHost(tNode);\n const firstCreatePass = tView.firstCreatePass;\n const tCleanup: false|any[] = firstCreatePass && getOrCreateTViewCleanup(tView);\n const context = lView[CONTEXT];\n\n // When the ɵɵlistener instruction was generated and is executed we know that there is either a\n // native listener or a directive output on this element. As such we we know that we will have to\n // register a listener and store its cleanup function on LView.\n const lCleanup = getOrCreateLViewCleanup(lView);\n\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyRNode | TNodeType.AnyContainer);\n\n let processOutputs = true;\n\n // Adding a native event listener is applicable when:\n // - The corresponding TNode represents a DOM element.\n // - The event target has a resolver (usually resulting in a global object,\n // such as `window` or `document`).\n if ((tNode.type & TNodeType.AnyRNode) || eventTargetResolver) {\n const native = getNativeByTNode(tNode, lView) as RElement;\n const target = eventTargetResolver ? eventTargetResolver(native) : native;\n const lCleanupIndex = lCleanup.length;\n const idxOrTargetGetter = eventTargetResolver ?\n (_lView: LView) => eventTargetResolver(unwrapRNode(_lView[tNode.index])) :\n tNode.index;\n\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n\n // There might be cases where multiple directives on the same element try to register an event\n // handler function for the same event. In this situation we want to avoid registration of\n // several native listeners as each registration would be intercepted by NgZone and\n // trigger change detection. This would mean that a single user action would result in several\n // change detections being invoked. To avoid this situation we want to have only one call to\n // native handler registration (for the same element and same type of event).\n //\n // In order to have just one native event handler in presence of multiple handler functions,\n // we just register a first handler function as a native event listener and then chain\n // (coalesce) other handler functions on top of the first native handler function.\n let existingListener = null;\n // Please note that the coalescing described here doesn't happen for events specifying an\n // alternative target (ex. (document:click)) - this is to keep backward compatibility with the\n // view engine.\n // Also, we don't have to search for existing listeners is there are no directives\n // matching on a given node as we can't register multiple event handlers for the same event in\n // a template (this would mean having duplicate attributes).\n if (!eventTargetResolver && isTNodeDirectiveHost) {\n existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n }\n if (existingListener !== null) {\n // Attach a new listener to coalesced listeners list, maintaining the order in which\n // listeners are registered. For performance reasons, we keep a reference to the last\n // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through\n // the entire set each time we need to add a new listener.\n const lastListenerFn = (<any>existingListener).__ngLastListenerFn__ || existingListener;\n lastListenerFn.__ngNextListenerFn__ = listenerFn;\n (<any>existingListener).__ngLastListenerFn__ = listenerFn;\n processOutputs = false;\n } else {\n listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);\n const cleanupFn = renderer.listen(target as RElement, eventName, listenerFn);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n\n lCleanup.push(listenerFn, cleanupFn);\n tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);\n }\n\n } else {\n // Even if there is no native listener to add, we still need to wrap the listener so that OnPush\n // ancestors are marked dirty when an event occurs.\n listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);\n }\n\n // subscribe to directive outputs\n const outputs = tNode.outputs;\n let props: PropertyAliasValue|undefined;\n if (processOutputs && outputs !== null && (props = outputs[eventName])) {\n const propsLength = props.length;\n if (propsLength) {\n for (let i = 0; i < propsLength; i += 2) {\n const index = props[i] as number;\n ngDevMode && assertIndexInRange(lView, index);\n const minifiedName = props[i + 1];\n const directiveInstance = lView[index];\n const output = directiveInstance[minifiedName];\n\n if (ngDevMode && !isObservable(output)) {\n throw new Error(`@Output ${minifiedName} not initialized in '${\n directiveInstance.constructor.name}'.`);\n }\n\n const subscription = output.subscribe(listenerFn);\n const idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}\n\nfunction executeListenerWithErrorHandling(\n lView: LView, context: {}|null, listenerFn: (e?: any) => any, e: any): boolean {\n try {\n profiler(ProfilerEvent.OutputStart, context, listenerFn);\n // Only explicitly returning false from a listener should preventDefault\n return listenerFn(e) !== false;\n } catch (error) {\n handleError(lView, error);\n return false;\n } finally {\n profiler(ProfilerEvent.OutputEnd, context, listenerFn);\n }\n}\n\n/**\n * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,\n * if applicable.\n *\n * @param tNode The TNode associated with this listener\n * @param lView The LView that contains this listener\n * @param listenerFn The listener function to call\n * @param wrapWithPreventDefault Whether or not to prevent default behavior\n * (the procedural renderer does this already, so in those cases, we should skip)\n */\nfunction wrapListener(\n tNode: TNode, lView: LView<{}|null>, context: {}|null, listenerFn: (e?: any) => any,\n wrapWithPreventDefault: boolean): EventListener {\n // Note: we are performing most of the work in the listener function itself\n // to optimize listener registration.\n return function wrapListenerIn_markDirtyAndPreventDefault(e: any) {\n // Ivy uses `Function` as a special token that allows us to unwrap the function\n // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`.\n if (e === Function) {\n return listenerFn;\n }\n\n // In order to be backwards compatible with View Engine, events on component host nodes\n // must also mark the component view itself dirty (i.e. the view that it owns).\n const startView =\n tNode.componentOffset > -1 ? getComponentLViewByIndex(tNode.index, lView) : lView;\n markViewDirty(startView);\n\n let result = executeListenerWithErrorHandling(lView, context, listenerFn, e);\n // A just-invoked listener function might have coalesced listeners so we need to check for\n // their presence and invoke as needed.\n let nextListenerFn = (<any>wrapListenerIn_markDirtyAndPreventDefault).__ngNextListenerFn__;\n while (nextListenerFn) {\n // We should prevent default if any of the listeners explicitly return false\n result = executeListenerWithErrorHandling(lView, context, nextListenerFn, e) && result;\n nextListenerFn = (<any>nextListenerFn).__ngNextListenerFn__;\n }\n\n if (wrapWithPreventDefault && result === false) {\n e.preventDefault();\n // Necessary for legacy browsers that don't support preventDefault (e.g. IE)\n e.returnValue = false;\n }\n\n return result;\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {nextContextImpl} from '../state';\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n *\n * @codeGenApi\n */\nexport function ɵɵnextContext<T = any>(level: number = 1): T {\n return nextContextImpl(level);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {newArray} from '../../util/array_utils';\nimport {TAttributes, TElementNode, TNode, TNodeFlags, TNodeType} from '../interfaces/node';\nimport {ProjectionSlots} from '../interfaces/projection';\nimport {DECLARATION_COMPONENT_VIEW, HEADER_OFFSET, T_HOST} from '../interfaces/view';\nimport {applyProjection} from '../node_manipulation';\nimport {getProjectAsAttrValue, isNodeMatchingSelectorList, isSelectorInSelectorList} from '../node_selector_matcher';\nimport {getLView, getTView, setCurrentTNodeAsNotParent} from '../state';\nimport {getOrCreateTNode} from './shared';\n\n\n\n/**\n * Checks a given node against matching projection slots and returns the\n * determined slot index. Returns \"null\" if no slot matched the given node.\n *\n * This function takes into account the parsed ngProjectAs selector from the\n * node's attributes. If present, it will check whether the ngProjectAs selector\n * matches any of the projection slot selectors.\n */\nexport function matchingProjectionSlotIndex(tNode: TNode, projectionSlots: ProjectionSlots): number|\n null {\n let wildcardNgContentIndex = null;\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < projectionSlots.length; i++) {\n const slotValue = projectionSlots[i];\n // The last wildcard projection slot should match all nodes which aren't matching\n // any selector. This is necessary to be backwards compatible with view engine.\n if (slotValue === '*') {\n wildcardNgContentIndex = i;\n continue;\n }\n // If we ran into an `ngProjectAs` attribute, we should match its parsed selector\n // to the list of selectors, otherwise we fall back to matching against the node.\n if (ngProjectAsAttrVal === null ?\n isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */ true) :\n isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {\n return i; // first matching selector \"captures\" a given node\n }\n }\n return wildcardNgContentIndex;\n}\n\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param projectionSlots? A collection of projection slots. A projection slot can be based\n * on a parsed CSS selectors or set to the wildcard selector (\"*\") in order to match\n * all nodes which do not match any selector. If not specified, a single wildcard\n * selector projection slot will be defined.\n *\n * @codeGenApi\n */\nexport function ɵɵprojectionDef(projectionSlots?: ProjectionSlots): void {\n const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST] as TElementNode;\n\n if (!componentNode.projection) {\n // If no explicit projection slots are defined, fall back to a single\n // projection slot with the wildcard selector.\n const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;\n const projectionHeads: (TNode|null)[] = componentNode.projection =\n newArray(numProjectionSlots, null! as TNode);\n const tails: (TNode|null)[] = projectionHeads.slice();\n\n let componentChild: TNode|null = componentNode.child;\n\n while (componentChild !== null) {\n const slotIndex =\n projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;\n\n if (slotIndex !== null) {\n if (tails[slotIndex]) {\n tails[slotIndex]!.projectionNext = componentChild;\n } else {\n projectionHeads[slotIndex] = componentChild;\n }\n tails[slotIndex] = componentChild;\n }\n\n componentChild = componentChild.next;\n }\n }\n}\n\n\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex\n * @param selectorIndex:\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n *\n * @codeGenApi\n */\nexport function ɵɵprojection(\n nodeIndex: number, selectorIndex: number = 0, attrs?: TAttributes): void {\n const lView = getLView();\n const tView = getTView();\n const tProjectionNode =\n getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, TNodeType.Projection, null, attrs || null);\n\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) tProjectionNode.projection = selectorIndex;\n\n // `<ng-content>` has no content\n setCurrentTNodeAsNotParent();\n\n if ((tProjectionNode.flags & TNodeFlags.isDetached) !== TNodeFlags.isDetached) {\n // re-distribution of projectable nodes is stored on a component's view level\n applyProjection(tView, lView, tProjectionNode);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {SanitizerFn} from '../interfaces/sanitization';\nimport {RENDERER} from '../interfaces/view';\nimport {getBindingIndex, getLView, getSelectedTNode, getTView} from '../state';\nimport {NO_CHANGE} from '../tokens';\n\nimport {interpolation1, interpolation2, interpolation3, interpolation4, interpolation5, interpolation6, interpolation7, interpolation8, interpolationV} from './interpolation';\nimport {elementPropertyInternal, storePropertyBindingMetadata} from './shared';\n\n\n/**\n *\n * Update an interpolated property on an element with a lone bound value\n *\n * Used when the value passed to a property has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div title=\"{{v0}}\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate('title', v0);\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate(\n propName: string, v0: any, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate {\n ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer);\n return ɵɵpropertyInterpolate;\n}\n\n\n/**\n *\n * Update an interpolated property on an element with single bound value surrounded by text.\n *\n * Used when the value passed to a property has 1 interpolated value in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate1(\n propName: string, prefix: string, v0: any, suffix: string,\n sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate1 {\n const lView = getLView();\n const interpolatedValue = interpolation1(lView, prefix, v0, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);\n }\n return ɵɵpropertyInterpolate1;\n}\n\n/**\n *\n * Update an interpolated property on an element with 2 bound values surrounded by text.\n *\n * Used when the value passed to a property has 2 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate2(\n propName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string,\n sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate2 {\n const lView = getLView();\n const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);\n }\n return ɵɵpropertyInterpolate2;\n}\n\n/**\n *\n * Update an interpolated property on an element with 3 bound values surrounded by text.\n *\n * Used when the value passed to a property has 3 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate3(\n * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate3(\n propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any,\n suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate3 {\n const lView = getLView();\n const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);\n }\n return ɵɵpropertyInterpolate3;\n}\n\n/**\n *\n * Update an interpolated property on an element with 4 bound values surrounded by text.\n *\n * Used when the value passed to a property has 4 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate4(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate4(\n propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate4 {\n const lView = getLView();\n const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);\n }\n return ɵɵpropertyInterpolate4;\n}\n\n/**\n *\n * Update an interpolated property on an element with 5 bound values surrounded by text.\n *\n * Used when the value passed to a property has 5 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate5(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate5(\n propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, suffix: string,\n sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate5 {\n const lView = getLView();\n const interpolatedValue =\n interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);\n }\n return ɵɵpropertyInterpolate5;\n}\n\n/**\n *\n * Update an interpolated property on an element with 6 bound values surrounded by text.\n *\n * Used when the value passed to a property has 6 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate6(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate6(\n propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string,\n sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate6 {\n const lView = getLView();\n const interpolatedValue =\n interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);\n }\n return ɵɵpropertyInterpolate6;\n}\n\n/**\n *\n * Update an interpolated property on an element with 7 bound values surrounded by text.\n *\n * Used when the value passed to a property has 7 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate7(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate7(\n propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string,\n sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate7 {\n const lView = getLView();\n const interpolatedValue =\n interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5,\n suffix);\n }\n return ɵɵpropertyInterpolate7;\n}\n\n/**\n *\n * Update an interpolated property on an element with 8 bound values surrounded by text.\n *\n * Used when the value passed to a property has 8 interpolated values in it:\n *\n * ```html\n * <div title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolate8(\n * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolate8(\n propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,\n v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,\n suffix: string, sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolate8 {\n const lView = getLView();\n const interpolatedValue = interpolation8(\n lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n ngDevMode &&\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6,\n suffix);\n }\n return ɵɵpropertyInterpolate8;\n}\n\n/**\n * Update an interpolated property on an element with 9 or more bound values surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div\n * title=\"prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix\"></div>\n * ```\n *\n * Its compiled representation is::\n *\n * ```ts\n * ɵɵpropertyInterpolateV(\n * 'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.\n *\n * @param propName The name of the property to update.\n * @param values The collection of values and the strings in between those values, beginning with a\n * string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @param sanitizer An optional sanitizer function\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵpropertyInterpolateV(\n propName: string, values: any[], sanitizer?: SanitizerFn): typeof ɵɵpropertyInterpolateV {\n const lView = getLView();\n const interpolatedValue = interpolationV(lView, values);\n if (interpolatedValue !== NO_CHANGE) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementPropertyInternal(\n tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);\n if (ngDevMode) {\n const interpolationInBetween = [values[0]]; // prefix\n for (let i = 2; i < values.length; i += 2) {\n interpolationInBetween.push(values[i]);\n }\n storePropertyBindingMetadata(\n tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1,\n ...interpolationInBetween);\n }\n }\n return ɵɵpropertyInterpolateV;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {KeyValueArray} from '../../util/array_utils';\nimport {assertNumber, assertNumberInRange} from '../../util/assert';\n\n/**\n * Value stored in the `TData` which is needed to re-concatenate the styling.\n *\n * See: `TStylingKeyPrimitive` and `TStylingStatic`\n */\nexport type TStylingKey = TStylingKeyPrimitive|TStylingStatic;\n\n\n/**\n * The primitive portion (`TStylingStatic` removed) of the value stored in the `TData` which is\n * needed to re-concatenate the styling.\n *\n * - `string`: Stores the property name. Used with `ɵɵstyleProp`/`ɵɵclassProp` instruction.\n * - `null`: Represents map, so there is no name. Used with `ɵɵstyleMap`/`ɵɵclassMap`.\n * - `false`: Represents an ignore case. This happens when `ɵɵstyleProp`/`ɵɵclassProp` instruction\n * is combined with directive which shadows its input `@Input('class')`. That way the binding\n * should not participate in the styling resolution.\n */\nexport type TStylingKeyPrimitive = string|null|false;\n\n/**\n * Store the static values for the styling binding.\n *\n * The `TStylingStatic` is just `KeyValueArray` where key `\"\"` (stored at location 0) contains the\n * `TStylingKey` (stored at location 1). In other words this wraps the `TStylingKey` such that the\n * `\"\"` contains the wrapped value.\n *\n * When instructions are resolving styling they may need to look forward or backwards in the linked\n * list to resolve the value. For this reason we have to make sure that he linked list also contains\n * the static values. However the list only has space for one item per styling instruction. For this\n * reason we store the static values here as part of the `TStylingKey`. This means that the\n * resolution function when looking for a value needs to first look at the binding value, and than\n * at `TStylingKey` (if it exists).\n *\n * Imagine we have:\n *\n * ```\n * <div class=\"TEMPLATE\" my-dir>\n *\n * @Directive({\n * host: {\n * class: 'DIR',\n * '[class.dynamic]': 'exp' // ɵɵclassProp('dynamic', ctx.exp);\n * }\n * })\n * ```\n *\n * In the above case the linked list will contain one item:\n *\n * ```\n * // assume binding location: 10 for `ɵɵclassProp('dynamic', ctx.exp);`\n * tData[10] = <TStylingStatic>[\n * '': 'dynamic', // This is the wrapped value of `TStylingKey`\n * 'DIR': true, // This is the default static value of directive binding.\n * ];\n * tData[10 + 1] = 0; // We don't have prev/next.\n *\n * lView[10] = undefined; // assume `ctx.exp` is `undefined`\n * lView[10 + 1] = undefined; // Just normalized `lView[10]`\n * ```\n *\n * So when the function is resolving styling value, it first needs to look into the linked list\n * (there is none) and than into the static `TStylingStatic` too see if there is a default value for\n * `dynamic` (there is not). Therefore it is safe to remove it.\n *\n * If setting `true` case:\n * ```\n * lView[10] = true; // assume `ctx.exp` is `true`\n * lView[10 + 1] = true; // Just normalized `lView[10]`\n * ```\n * So when the function is resolving styling value, it first needs to look into the linked list\n * (there is none) and than into `TNode.residualClass` (TNode.residualStyle) which contains\n * ```\n * tNode.residualClass = [\n * 'TEMPLATE': true,\n * ];\n * ```\n *\n * This means that it is safe to add class.\n */\nexport interface TStylingStatic extends KeyValueArray<any> {}\n\n/**\n * This is a branded number which contains previous and next index.\n *\n * When we come across styling instructions we need to store the `TStylingKey` in the correct\n * order so that we can re-concatenate the styling value in the desired priority.\n *\n * The insertion can happen either at the:\n * - end of template as in the case of coming across additional styling instruction in the template\n * - in front of the template in the case of coming across additional instruction in the\n * `hostBindings`.\n *\n * We use `TStylingRange` to store the previous and next index into the `TData` where the template\n * bindings can be found.\n *\n * - bit 0 is used to mark that the previous index has a duplicate for current value.\n * - bit 1 is used to mark that the next index has a duplicate for the current value.\n * - bits 2-16 are used to encode the next/tail of the template.\n * - bits 17-32 are used to encode the previous/head of template.\n *\n * NODE: *duplicate* false implies that it is statically known that this binding will not collide\n * with other bindings and therefore there is no need to check other bindings. For example the\n * bindings in `<div [style.color]=\"exp\" [style.width]=\"exp\">` will never collide and will have\n * their bits set accordingly. Previous duplicate means that we may need to check previous if the\n * current binding is `null`. Next duplicate means that we may need to check next bindings if the\n * current binding is not `null`.\n *\n * NOTE: `0` has special significance and represents `null` as in no additional pointer.\n */\nexport interface TStylingRange {\n __brand__: 'TStylingRange';\n}\n\n/**\n * Shift and masks constants for encoding two numbers into and duplicate info into a single number.\n */\nexport const enum StylingRange {\n /// Number of bits to shift for the previous pointer\n PREV_SHIFT = 17,\n /// Previous pointer mask.\n PREV_MASK = 0xFFFE0000,\n\n /// Number of bits to shift for the next pointer\n NEXT_SHIFT = 2,\n /// Next pointer mask.\n NEXT_MASK = 0x001FFFC,\n\n // Mask to remove negative bit. (interpret number as positive)\n UNSIGNED_MASK = 0x7FFF,\n\n /**\n * This bit is set if the previous bindings contains a binding which could possibly cause a\n * duplicate. For example: `<div [style]=\"map\" [style.width]=\"width\">`, the `width` binding will\n * have previous duplicate set. The implication is that if `width` binding becomes `null`, it is\n * necessary to defer the value to `map.width`. (Because `width` overwrites `map.width`.)\n */\n PREV_DUPLICATE = 0x02,\n\n /**\n * This bit is set to if the next binding contains a binding which could possibly cause a\n * duplicate. For example: `<div [style]=\"map\" [style.width]=\"width\">`, the `map` binding will\n * have next duplicate set. The implication is that if `map.width` binding becomes not `null`, it\n * is necessary to defer the value to `width`. (Because `width` overwrites `map.width`.)\n */\n NEXT_DUPLICATE = 0x01,\n}\n\n\nexport function toTStylingRange(prev: number, next: number): TStylingRange {\n ngDevMode && assertNumberInRange(prev, 0, StylingRange.UNSIGNED_MASK);\n ngDevMode && assertNumberInRange(next, 0, StylingRange.UNSIGNED_MASK);\n return (prev << StylingRange.PREV_SHIFT | next << StylingRange.NEXT_SHIFT) as any;\n}\n\nexport function getTStylingRangePrev(tStylingRange: TStylingRange): number {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return ((tStylingRange as any as number) >> StylingRange.PREV_SHIFT) & StylingRange.UNSIGNED_MASK;\n}\n\nexport function getTStylingRangePrevDuplicate(tStylingRange: TStylingRange): boolean {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return ((tStylingRange as any as number) & StylingRange.PREV_DUPLICATE) ==\n StylingRange.PREV_DUPLICATE;\n}\n\nexport function setTStylingRangePrev(\n tStylingRange: TStylingRange, previous: number): TStylingRange {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(previous, 0, StylingRange.UNSIGNED_MASK);\n return (((tStylingRange as any as number) & ~StylingRange.PREV_MASK) |\n (previous << StylingRange.PREV_SHIFT)) as any;\n}\n\nexport function setTStylingRangePrevDuplicate(tStylingRange: TStylingRange): TStylingRange {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return ((tStylingRange as any as number) | StylingRange.PREV_DUPLICATE) as any;\n}\n\nexport function getTStylingRangeNext(tStylingRange: TStylingRange): number {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return ((tStylingRange as any as number) & StylingRange.NEXT_MASK) >> StylingRange.NEXT_SHIFT;\n}\n\nexport function setTStylingRangeNext(tStylingRange: TStylingRange, next: number): TStylingRange {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(next, 0, StylingRange.UNSIGNED_MASK);\n return (((tStylingRange as any as number) & ~StylingRange.NEXT_MASK) | //\n next << StylingRange.NEXT_SHIFT) as any;\n}\n\nexport function getTStylingRangeNextDuplicate(tStylingRange: TStylingRange): boolean {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return ((tStylingRange as any as number) & StylingRange.NEXT_DUPLICATE) ===\n StylingRange.NEXT_DUPLICATE;\n}\n\nexport function setTStylingRangeNextDuplicate(tStylingRange: TStylingRange): TStylingRange {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return ((tStylingRange as any as number) | StylingRange.NEXT_DUPLICATE) as any;\n}\n\nexport function getTStylingRangeTail(tStylingRange: TStylingRange): number {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n const next = getTStylingRangeNext(tStylingRange);\n return next === 0 ? getTStylingRangePrev(tStylingRange) : next;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {KeyValueArray, keyValueArrayIndexOf} from '../../util/array_utils';\nimport {assertEqual, assertIndexInRange, assertNotEqual} from '../../util/assert';\nimport {assertFirstUpdatePass} from '../assert';\nimport {TNode} from '../interfaces/node';\nimport {getTStylingRangeNext, getTStylingRangePrev, setTStylingRangeNext, setTStylingRangeNextDuplicate, setTStylingRangePrev, setTStylingRangePrevDuplicate, toTStylingRange, TStylingKey, TStylingKeyPrimitive, TStylingRange} from '../interfaces/styling';\nimport {TData} from '../interfaces/view';\nimport {getTView} from '../state';\n\n\n/**\n * NOTE: The word `styling` is used interchangeably as style or class styling.\n *\n * This file contains code to link styling instructions together so that they can be replayed in\n * priority order. The file exists because Ivy styling instruction execution order does not match\n * that of the priority order. The purpose of this code is to create a linked list so that the\n * instructions can be traversed in priority order when computing the styles.\n *\n * Assume we are dealing with the following code:\n * ```\n * @Component({\n * template: `\n * <my-cmp [style]=\" {color: '#001'} \"\n * [style.color]=\" #002 \"\n * dir-style-color-1\n * dir-style-color-2> `\n * })\n * class ExampleComponent {\n * static ngComp = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#001'});\n * ɵɵstyleProp('color', '#002');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `[dir-style-color-1]',\n * })\n * class Style1Directive {\n * @HostBinding('style') style = {color: '#005'};\n * @HostBinding('style.color') color = '#006';\n *\n * static ngDir = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#005'});\n * ɵɵstyleProp('color', '#006');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `[dir-style-color-2]',\n * })\n * class Style2Directive {\n * @HostBinding('style') style = {color: '#007'};\n * @HostBinding('style.color') color = '#008';\n *\n * static ngDir = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#007'});\n * ɵɵstyleProp('color', '#008');\n * ...\n * }\n * }\n *\n * @Directive({\n * selector: `my-cmp',\n * })\n * class MyComponent {\n * @HostBinding('style') style = {color: '#003'};\n * @HostBinding('style.color') color = '#004';\n *\n * static ngComp = ... {\n * ...\n * // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`\n * ɵɵstyleMap({color: '#003'});\n * ɵɵstyleProp('color', '#004');\n * ...\n * }\n * }\n * ```\n *\n * The Order of instruction execution is:\n *\n * NOTE: the comment binding location is for illustrative purposes only.\n *\n * ```\n * // Template: (ExampleComponent)\n * ɵɵstyleMap({color: '#001'}); // Binding index: 10\n * ɵɵstyleProp('color', '#002'); // Binding index: 12\n * // MyComponent\n * ɵɵstyleMap({color: '#003'}); // Binding index: 20\n * ɵɵstyleProp('color', '#004'); // Binding index: 22\n * // Style1Directive\n * ɵɵstyleMap({color: '#005'}); // Binding index: 24\n * ɵɵstyleProp('color', '#006'); // Binding index: 26\n * // Style2Directive\n * ɵɵstyleMap({color: '#007'}); // Binding index: 28\n * ɵɵstyleProp('color', '#008'); // Binding index: 30\n * ```\n *\n * The correct priority order of concatenation is:\n *\n * ```\n * // MyComponent\n * ɵɵstyleMap({color: '#003'}); // Binding index: 20\n * ɵɵstyleProp('color', '#004'); // Binding index: 22\n * // Style1Directive\n * ɵɵstyleMap({color: '#005'}); // Binding index: 24\n * ɵɵstyleProp('color', '#006'); // Binding index: 26\n * // Style2Directive\n * ɵɵstyleMap({color: '#007'}); // Binding index: 28\n * ɵɵstyleProp('color', '#008'); // Binding index: 30\n * // Template: (ExampleComponent)\n * ɵɵstyleMap({color: '#001'}); // Binding index: 10\n * ɵɵstyleProp('color', '#002'); // Binding index: 12\n * ```\n *\n * What color should be rendered?\n *\n * Once the items are correctly sorted in the list, the answer is simply the last item in the\n * concatenation list which is `#002`.\n *\n * To do so we keep a linked list of all of the bindings which pertain to this element.\n * Notice that the bindings are inserted in the order of execution, but the `TView.data` allows\n * us to traverse them in the order of priority.\n *\n * |Idx|`TView.data`|`LView` | Notes\n * |---|------------|-----------------|--------------\n * |...| | |\n * |10 |`null` |`{color: '#001'}`| `ɵɵstyleMap('color', {color: '#001'})`\n * |11 |`30 | 12` | ... |\n * |12 |`color` |`'#002'` | `ɵɵstyleProp('color', '#002')`\n * |13 |`10 | 0` | ... |\n * |...| | |\n * |20 |`null` |`{color: '#003'}`| `ɵɵstyleMap('color', {color: '#003'})`\n * |21 |`0 | 22` | ... |\n * |22 |`color` |`'#004'` | `ɵɵstyleProp('color', '#004')`\n * |23 |`20 | 24` | ... |\n * |24 |`null` |`{color: '#005'}`| `ɵɵstyleMap('color', {color: '#005'})`\n * |25 |`22 | 26` | ... |\n * |26 |`color` |`'#006'` | `ɵɵstyleProp('color', '#006')`\n * |27 |`24 | 28` | ... |\n * |28 |`null` |`{color: '#007'}`| `ɵɵstyleMap('color', {color: '#007'})`\n * |29 |`26 | 30` | ... |\n * |30 |`color` |`'#008'` | `ɵɵstyleProp('color', '#008')`\n * |31 |`28 | 10` | ... |\n *\n * The above data structure allows us to re-concatenate the styling no matter which data binding\n * changes.\n *\n * NOTE: in addition to keeping track of next/previous index the `TView.data` also stores prev/next\n * duplicate bit. The duplicate bit if true says there either is a binding with the same name or\n * there is a map (which may contain the name). This information is useful in knowing if other\n * styles with higher priority need to be searched for overwrites.\n *\n * NOTE: See `should support example in 'tnode_linked_list.ts' documentation` in\n * `tnode_linked_list_spec.ts` for working example.\n */\nlet __unused_const_as_closure_does_not_like_standalone_comment_blocks__: undefined;\n\n/**\n * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked\n * list of styles and compute the duplicate flag.\n *\n * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.\n *\n * The function works by keeping track of `tStylingRange` which contains two pointers pointing to\n * the head/tail of the template portion of the styles.\n * - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`\n * - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`\n *\n * @param tData The `TData` to insert into.\n * @param tNode `TNode` associated with the styling element.\n * @param tStylingKey See `TStylingKey`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of\n * template.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nexport function insertTStylingBinding(\n tData: TData, tNode: TNode, tStylingKeyWithStatic: TStylingKey, index: number,\n isHostBinding: boolean, isClassBinding: boolean): void {\n ngDevMode && assertFirstUpdatePass(getTView());\n let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;\n let tmplHead = getTStylingRangePrev(tBindings);\n let tmplTail = getTStylingRangeNext(tBindings);\n\n tData[index] = tStylingKeyWithStatic;\n let isKeyDuplicateOfStatic = false;\n let tStylingKey: TStylingKeyPrimitive;\n if (Array.isArray(tStylingKeyWithStatic)) {\n // We are case when the `TStylingKey` contains static fields as well.\n const staticKeyValueArray = tStylingKeyWithStatic as KeyValueArray<any>;\n tStylingKey = staticKeyValueArray[1]; // unwrap.\n // We need to check if our key is present in the static so that we can mark it as duplicate.\n if (tStylingKey === null ||\n keyValueArrayIndexOf(staticKeyValueArray, tStylingKey as string) > 0) {\n // tStylingKey is present in the statics, need to mark it as duplicate.\n isKeyDuplicateOfStatic = true;\n }\n } else {\n tStylingKey = tStylingKeyWithStatic;\n }\n if (isHostBinding) {\n // We are inserting host bindings\n\n // If we don't have template bindings then `tail` is 0.\n const hasTemplateBindings = tmplTail !== 0;\n // This is important to know because that means that the `head` can't point to the first\n // template bindings (there are none.) Instead the head points to the tail of the template.\n if (hasTemplateBindings) {\n // template head's \"prev\" will point to last host binding or to 0 if no host bindings yet\n const previousNode = getTStylingRangePrev(tData[tmplHead + 1] as TStylingRange);\n tData[index + 1] = toTStylingRange(previousNode, tmplHead);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (previousNode !== 0) {\n // We need to update the template-tail value to point to us.\n tData[previousNode + 1] =\n setTStylingRangeNext(tData[previousNode + 1] as TStylingRange, index);\n }\n // The \"previous\" of the template binding head should point to this host binding\n tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1] as TStylingRange, index);\n } else {\n tData[index + 1] = toTStylingRange(tmplHead, 0);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (tmplHead !== 0) {\n // We need to update the template-tail value to point to us.\n tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1] as TStylingRange, index);\n }\n // if we don't have template, the head points to template-tail, and needs to be advanced.\n tmplHead = index;\n }\n } else {\n // We are inserting in template section.\n // We need to set this binding's \"previous\" to the current template tail\n tData[index + 1] = toTStylingRange(tmplTail, 0);\n ngDevMode &&\n assertEqual(\n tmplHead !== 0 && tmplTail === 0, false,\n 'Adding template bindings after hostBindings is not allowed.');\n if (tmplHead === 0) {\n tmplHead = index;\n } else {\n // We need to update the previous value \"next\" to point to this binding\n tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1] as TStylingRange, index);\n }\n tmplTail = index;\n }\n\n // Now we need to update / compute the duplicates.\n // Starting with our location search towards head (least priority)\n if (isKeyDuplicateOfStatic) {\n tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1] as TStylingRange);\n }\n markDuplicates(tData, tStylingKey, index, true, isClassBinding);\n markDuplicates(tData, tStylingKey, index, false, isClassBinding);\n markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);\n\n tBindings = toTStylingRange(tmplHead, tmplTail);\n if (isClassBinding) {\n tNode.classBindings = tBindings;\n } else {\n tNode.styleBindings = tBindings;\n }\n}\n\n/**\n * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.\n *\n * @param tNode `TNode` where the residual is stored.\n * @param tStylingKey `TStylingKey` to store.\n * @param tData `TData` associated with the current `LView`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction markDuplicateOfResidualStyling(\n tNode: TNode, tStylingKey: TStylingKey, tData: TData, index: number, isClassBinding: boolean) {\n const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /* or undefined */ && typeof tStylingKey == 'string' &&\n keyValueArrayIndexOf(residual, tStylingKey) >= 0) {\n // We have duplicate in the residual so mark ourselves as duplicate.\n tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1] as TStylingRange);\n }\n}\n\n\n/**\n * Marks `TStyleValue`s as duplicates if another style binding in the list has the same\n * `TStyleValue`.\n *\n * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once\n * with it set to `false` to search both the previous as well as next items in the list.\n *\n * No duplicate case\n * ```\n * [style.color]\n * [style.width.px] <<- index\n * [style.height.px]\n * ```\n *\n * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no\n * duplicates because `width` is not found in any other part of the linked list.\n *\n * Duplicate case\n * ```\n * [style.color]\n * [style.width.em]\n * [style.width.px] <<- index\n * ```\n * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`\n * because `width` is found in the chain.\n *\n * Map case 1\n * ```\n * [style.width.px]\n * [style.color]\n * [style] <<- index\n * ```\n * In the above case adding `[style]` will produce a duplicate with any other bindings because\n * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.\n *\n * Map case 2\n * ```\n * [style]\n * [style.width.px]\n * [style.color] <<- index\n * ```\n * In the above case adding `[style.color]` will produce a duplicate because there is already a\n * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or\n * `width`.\n *\n * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.\n * NOTE: We use `style` as example, but same logic is applied to `class`es as well.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in\n * the linked list.\n * @param index Starting location in the linked list to search from\n * @param isPrevDir Direction.\n * - `true` for previous (lower priority);\n * - `false` for next (higher priority).\n */\nfunction markDuplicates(\n tData: TData, tStylingKey: TStylingKeyPrimitive, index: number, isPrevDir: boolean,\n isClassBinding: boolean) {\n const tStylingAtIndex = tData[index + 1] as TStylingRange;\n const isMap = tStylingKey === null;\n let cursor =\n isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);\n let foundDuplicate = false;\n // We keep iterating as long as we have a cursor\n // AND either:\n // - we found what we are looking for, OR\n // - we are a map in which case we have to continue searching even after we find what we were\n // looking for since we are a wild card and everything needs to be flipped to duplicate.\n while (cursor !== 0 && (foundDuplicate === false || isMap)) {\n ngDevMode && assertIndexInRange(tData, cursor);\n const tStylingValueAtCursor = tData[cursor] as TStylingKey;\n const tStyleRangeAtCursor = tData[cursor + 1] as TStylingRange;\n if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {\n foundDuplicate = true;\n tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) :\n setTStylingRangePrevDuplicate(tStyleRangeAtCursor);\n }\n cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) :\n getTStylingRangeNext(tStyleRangeAtCursor);\n }\n if (foundDuplicate) {\n // if we found a duplicate, than mark ourselves.\n tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) :\n setTStylingRangeNextDuplicate(tStylingAtIndex);\n }\n}\n\n/**\n * Determines if two `TStylingKey`s are a match.\n *\n * When computing whether a binding contains a duplicate, we need to compare if the instruction\n * `TStylingKey` has a match.\n *\n * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:\n * - `color`\n * - `color` // Match another color\n * - `null` // That means that `tStylingKey` is a `classMap`/`styleMap` instruction\n * - `['', 'color', 'other', true]` // wrapped `color` so match\n * - `['', null, 'other', true]` // wrapped `null` so match\n * - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`\n * - `null` // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction\n *\n * @param tStylingKeyCursor\n * @param tStylingKey\n */\nfunction isStylingMatch(tStylingKeyCursor: TStylingKey, tStylingKey: TStylingKeyPrimitive) {\n ngDevMode &&\n assertNotEqual(\n Array.isArray(tStylingKey), true, 'Expected that \\'tStylingKey\\' has been unwrapped');\n if (\n tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that\n // location so we must assume that we have a match.\n tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it\n // contains a match.\n (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) ===\n tStylingKey // If the keys match explicitly than we are a match.\n ) {\n return true;\n } else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {\n // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has\n // statics and we need to check those as well.\n return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >=\n 0; // see if we are matching the key\n }\n return false;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual, throwError} from '../../util/assert';\nimport {CharCode} from '../../util/char_code';\n\n/**\n * Stores the locations of key/value indexes while parsing styling.\n *\n * In case of `cssText` parsing the indexes are like so:\n * ```\n * \"key1: value1; key2: value2; key3: value3\"\n * ^ ^ ^ ^ ^\n * | | | | +-- textEnd\n * | | | +---------------- valueEnd\n * | | +---------------------- value\n * | +------------------------ keyEnd\n * +---------------------------- key\n * ```\n *\n * In case of `className` parsing the indexes are like so:\n * ```\n * \"key1 key2 key3\"\n * ^ ^ ^\n * | | +-- textEnd\n * | +------------------------ keyEnd\n * +---------------------------- key\n * ```\n * NOTE: `value` and `valueEnd` are used only for styles, not classes.\n */\ninterface ParserState {\n textEnd: number;\n key: number;\n keyEnd: number;\n value: number;\n valueEnd: number;\n}\n// Global state of the parser. (This makes parser non-reentrant, but that is not an issue)\nconst parserState: ParserState = {\n textEnd: 0,\n key: 0,\n keyEnd: 0,\n value: 0,\n valueEnd: 0,\n};\n\n/**\n * Retrieves the last parsed `key` of style.\n * @param text the text to substring the key from.\n */\nexport function getLastParsedKey(text: string): string {\n return text.substring(parserState.key, parserState.keyEnd);\n}\n\n/**\n * Retrieves the last parsed `value` of style.\n * @param text the text to substring the key from.\n */\nexport function getLastParsedValue(text: string): string {\n return text.substring(parserState.value, parserState.valueEnd);\n}\n\n/**\n * Initializes `className` string for parsing and parses the first token.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n * @param text `className` to parse\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nexport function parseClassName(text: string): number {\n resetParserState(text);\n return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n\n/**\n * Parses next `className` token.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n *\n * @param text `className` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nexport function parseClassNameNext(text: string, index: number): number {\n const end = parserState.textEnd;\n if (end === index) {\n return -1;\n }\n index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);\n return consumeWhitespace(text, index, end);\n}\n\n/**\n * Initializes `cssText` string for parsing and parses the first key/values.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n * ```\n * @param text `cssText` to parse\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nexport function parseStyle(text: string): number {\n resetParserState(text);\n return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n\n/**\n * Parses the next `cssText` key/values.\n *\n * This function is intended to be used in this format:\n * ```\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n *\n * @param text `cssText` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nexport function parseStyleNext(text: string, startIndex: number): number {\n const end = parserState.textEnd;\n let index = parserState.key = consumeWhitespace(text, startIndex, end);\n if (end === index) {\n // we reached an end so just quit\n return -1;\n }\n index = parserState.keyEnd = consumeStyleKey(text, index, end);\n index = consumeSeparator(text, index, end, CharCode.COLON);\n index = parserState.value = consumeWhitespace(text, index, end);\n index = parserState.valueEnd = consumeStyleValue(text, index, end);\n return consumeSeparator(text, index, end, CharCode.SEMI_COLON);\n}\n\n/**\n * Reset the global state of the styling parser.\n * @param text The styling text to parse.\n */\nexport function resetParserState(text: string): void {\n parserState.key = 0;\n parserState.keyEnd = 0;\n parserState.value = 0;\n parserState.valueEnd = 0;\n parserState.textEnd = text.length;\n}\n\n/**\n * Returns index of next non-whitespace character.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at\n * that location.)\n */\nexport function consumeWhitespace(text: string, startIndex: number, endIndex: number): number {\n while (startIndex < endIndex && text.charCodeAt(startIndex) <= CharCode.SPACE) {\n startIndex++;\n }\n return startIndex;\n}\n\n/**\n * Returns index of last char in class token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last char in class token.\n */\nexport function consumeClassToken(text: string, startIndex: number, endIndex: number): number {\n while (startIndex < endIndex && text.charCodeAt(startIndex) > CharCode.SPACE) {\n startIndex++;\n }\n return startIndex;\n}\n\n/**\n * Consumes all of the characters belonging to style key and token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style key character.\n */\nexport function consumeStyleKey(text: string, startIndex: number, endIndex: number): number {\n let ch: number;\n while (startIndex < endIndex &&\n ((ch = text.charCodeAt(startIndex)) === CharCode.DASH || ch === CharCode.UNDERSCORE ||\n ((ch & CharCode.UPPER_CASE) >= CharCode.A && (ch & CharCode.UPPER_CASE) <= CharCode.Z) ||\n (ch >= CharCode.ZERO && ch <= CharCode.NINE))) {\n startIndex++;\n }\n return startIndex;\n}\n\n/**\n * Consumes all whitespace and the separator `:` after the style key.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after separator and surrounding whitespace.\n */\nexport function consumeSeparator(\n text: string, startIndex: number, endIndex: number, separator: number): number {\n startIndex = consumeWhitespace(text, startIndex, endIndex);\n if (startIndex < endIndex) {\n if (ngDevMode && text.charCodeAt(startIndex) !== separator) {\n malformedStyleError(text, String.fromCharCode(separator), startIndex);\n }\n startIndex++;\n }\n return startIndex;\n}\n\n\n/**\n * Consumes style value honoring `url()` and `\"\"` text.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style value character.\n */\nexport function consumeStyleValue(text: string, startIndex: number, endIndex: number): number {\n let ch1 = -1; // 1st previous character\n let ch2 = -1; // 2nd previous character\n let ch3 = -1; // 3rd previous character\n let i = startIndex;\n let lastChIndex = i;\n while (i < endIndex) {\n const ch: number = text.charCodeAt(i++);\n if (ch === CharCode.SEMI_COLON) {\n return lastChIndex;\n } else if (ch === CharCode.DOUBLE_QUOTE || ch === CharCode.SINGLE_QUOTE) {\n lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);\n } else if (\n startIndex ===\n i - 4 && // We have seen only 4 characters so far \"URL(\" (Ignore \"foo_URL()\")\n ch3 === CharCode.U &&\n ch2 === CharCode.R && ch1 === CharCode.L && ch === CharCode.OPEN_PAREN) {\n lastChIndex = i = consumeQuotedText(text, CharCode.CLOSE_PAREN, i, endIndex);\n } else if (ch > CharCode.SPACE) {\n // if we have a non-whitespace character then capture its location\n lastChIndex = i;\n }\n ch3 = ch2;\n ch2 = ch1;\n ch1 = ch & CharCode.UPPER_CASE;\n }\n return lastChIndex;\n}\n\n/**\n * Consumes all of the quoted characters.\n *\n * @param text Text to scan\n * @param quoteCharCode CharCode of either `\"` or `'` quote or `)` for `url(...)`.\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after quoted characters.\n */\nexport function consumeQuotedText(\n text: string, quoteCharCode: number, startIndex: number, endIndex: number): number {\n let ch1 = -1; // 1st previous character\n let index = startIndex;\n while (index < endIndex) {\n const ch = text.charCodeAt(index++);\n if (ch == quoteCharCode && ch1 !== CharCode.BACK_SLASH) {\n return index;\n }\n if (ch == CharCode.BACK_SLASH && ch1 === CharCode.BACK_SLASH) {\n // two back slashes cancel each other out. For example `\"\\\\\"` should properly end the\n // quotation. (It should not assume that the last `\"` is escaped.)\n ch1 = 0;\n } else {\n ch1 = ch;\n }\n }\n throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) :\n new Error();\n}\n\nfunction malformedStyleError(text: string, expecting: string, index: number): never {\n ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');\n throw throwError(\n `Malformed style at location ${index} in string '` + text.substring(0, index) + '[>>' +\n text.substring(index, index + 1) + '<<]' + text.slice(index + 1) +\n `'. Expecting '${expecting}'.`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SafeValue, unwrapSafeValue} from '../../sanitization/bypass';\nimport {KeyValueArray, keyValueArrayGet, keyValueArraySet} from '../../util/array_utils';\nimport {assertDefined, assertEqual, assertLessThan, assertNotEqual, throwError} from '../../util/assert';\nimport {EMPTY_ARRAY} from '../../util/empty';\nimport {concatStringsWithSpace, stringify} from '../../util/stringify';\nimport {assertFirstUpdatePass} from '../assert';\nimport {bindingUpdated} from '../bindings';\nimport {DirectiveDef} from '../interfaces/definition';\nimport {AttributeMarker, TAttributes, TNode, TNodeFlags, TNodeType} from '../interfaces/node';\nimport {Renderer} from '../interfaces/renderer';\nimport {RElement} from '../interfaces/renderer_dom';\nimport {getTStylingRangeNext, getTStylingRangeNextDuplicate, getTStylingRangePrev, getTStylingRangePrevDuplicate, TStylingKey, TStylingRange} from '../interfaces/styling';\nimport {LView, RENDERER, TData, TView} from '../interfaces/view';\nimport {applyStyling} from '../node_manipulation';\nimport {getCurrentDirectiveDef, getLView, getSelectedIndex, getTView, incrementBindingIndex} from '../state';\nimport {insertTStylingBinding} from '../styling/style_binding_list';\nimport {getLastParsedKey, getLastParsedValue, parseClassName, parseClassNameNext, parseStyle, parseStyleNext} from '../styling/styling_parser';\nimport {NO_CHANGE} from '../tokens';\nimport {getNativeByIndex} from '../util/view_utils';\n\nimport {setDirectiveInputsWhichShadowsStyling} from './property';\n\n\n/**\n * Update a style binding on an element with the provided value.\n *\n * If the style value is falsy then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `styleMap` or any static styles that are\n * present from when the element was created with `styling`).\n *\n * Note that the styling element is updated as part of `stylingApply`.\n *\n * @param prop A valid CSS property.\n * @param value New value to write (`null` or an empty string to remove).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n *\n * Note that this will apply the provided style value to the host element if this function is called\n * within a host binding function.\n *\n * @codeGenApi\n */\nexport function ɵɵstyleProp(\n prop: string, value: string|number|SafeValue|undefined|null,\n suffix?: string|null): typeof ɵɵstyleProp {\n checkStylingProperty(prop, value, suffix, false);\n return ɵɵstyleProp;\n}\n\n/**\n * Update a class binding on an element with the provided value.\n *\n * This instruction is meant to handle the `[class.foo]=\"exp\"` case and,\n * therefore, the class binding itself must already be allocated using\n * `styling` within the creation block.\n *\n * @param prop A valid CSS class (only one).\n * @param value A true/false value which will turn the class on or off.\n *\n * Note that this will apply the provided class value to the host element if this function\n * is called within a host binding function.\n *\n * @codeGenApi\n */\nexport function ɵɵclassProp(className: string, value: boolean|undefined|null): typeof ɵɵclassProp {\n checkStylingProperty(className, value, null, true);\n return ɵɵclassProp;\n}\n\n\n/**\n * Update style bindings using an object literal on an element.\n *\n * This instruction is meant to apply styling via the `[style]=\"exp\"` template bindings.\n * When styles are applied to the element they will then be updated with respect to\n * any styles/classes set via `styleProp`. If any styles are set to falsy\n * then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n *\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n *\n * Note that this will apply the provided styleMap value to the host element if this function\n * is called within a host binding.\n *\n * @codeGenApi\n */\nexport function ɵɵstyleMap(styles: {[styleName: string]: any}|string|undefined|null): void {\n checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);\n}\n\n\n/**\n * Parse text as style and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵstyleMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nexport function styleStringParser(keyValueArray: KeyValueArray<any>, text: string): void {\n for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {\n styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));\n }\n}\n\n\n/**\n * Update class bindings using an object literal or class-string on an element.\n *\n * This instruction is meant to apply styling via the `[class]=\"exp\"` template bindings.\n * When classes are applied to the element they will then be updated with\n * respect to any styles/classes set via `classProp`. If any\n * classes are set to falsy then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n * Note that this will the provided classMap value to the host element if this function is called\n * within a host binding.\n *\n * @param classes A key/value map or string of CSS classes that will be added to the\n * given element. Any missing classes (that have already been applied to the element\n * beforehand) will be removed (unset) from the element's list of CSS classes.\n *\n * @codeGenApi\n */\nexport function ɵɵclassMap(classes: {[className: string]: boolean|undefined|null}|string|undefined|\n null): void {\n checkStylingMap(keyValueArraySet, classStringParser, classes, true);\n}\n\n/**\n * Parse text as class and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵclassMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nexport function classStringParser(keyValueArray: KeyValueArray<any>, text: string): void {\n for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n keyValueArraySet(keyValueArray, getLastParsedKey(text), true);\n }\n}\n\n/**\n * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.\n *\n * @param prop property name.\n * @param value binding value.\n * @param suffix suffix for the property (e.g. `em` or `px`)\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nexport function checkStylingProperty(\n prop: string, value: any|NO_CHANGE, suffix: string|undefined|null,\n isClassBased: boolean): void {\n const lView = getLView();\n const tView = getTView();\n // Styling instructions use 2 slots per binding.\n // 1. one for the value / TStylingKey\n // 2. one for the intermittent-value / TStylingRange\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);\n }\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n const tNode = tView.data[getSelectedIndex()] as TNode;\n updateStyling(\n tView, tNode, lView, lView[RENDERER], prop,\n lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);\n }\n}\n\n/**\n * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done for tree shaking purposes.\n * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`\n * have different parsers.)\n * @param value bound value from application\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nexport function checkStylingMap(\n keyValueArraySet: (keyValueArray: KeyValueArray<any>, key: string, value: any) => void,\n stringParser: (styleKeyValueArray: KeyValueArray<any>, text: string) => void,\n value: any|NO_CHANGE, isClassBased: boolean): void {\n const tView = getTView();\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);\n }\n const lView = getLView();\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tView.data[getSelectedIndex()] as TNode;\n if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {\n if (ngDevMode) {\n // verify that if we are shadowing then `TData` is appropriately marked so that we skip\n // processing this binding in styling resolution.\n const tStylingKey = tView.data[bindingIndex];\n assertEqual(\n Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false,\n 'Styling linked list shadow input should be marked as \\'false\\'');\n }\n // VE does not concatenate the static portion like we are doing here.\n // Instead VE just ignores the static completely if dynamic binding is present.\n // Because of locality we have already set the static portion because we don't know if there\n // is a dynamic portion until later. If we would ignore the static portion it would look like\n // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong\n // thing as it would think that the static portion was removed. For this reason we\n // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed.\n let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;\n ngDevMode && isClassBased === false && staticPrefix !== null &&\n assertEqual(\n staticPrefix.endsWith(';'), true, 'Expecting static portion to end with \\';\\'');\n if (staticPrefix !== null) {\n // We want to make sure that falsy values of `value` become empty strings.\n value = concatStringsWithSpace(staticPrefix, value ? value : '');\n }\n // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.\n // This takes over the `[style]` binding. (Same for `[class]`)\n setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);\n } else {\n updateStylingMap(\n tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1],\n lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value),\n isClassBased, bindingIndex);\n }\n }\n}\n\n/**\n * Determines when the binding is in `hostBindings` section\n *\n * @param tView Current `TView`\n * @param bindingIndex index of binding which we would like if it is in `hostBindings`\n */\nfunction isInHostBindings(tView: TView, bindingIndex: number): boolean {\n // All host bindings are placed after the expando section.\n return bindingIndex >= tView.expandoStartIndex;\n}\n\n/**\n * Collects the necessary information to insert the binding into a linked list of style bindings\n * using `insertTStylingBinding`.\n *\n * @param tView `TView` where the binding linked list will be stored.\n * @param tStylingKey Property/key of the binding.\n * @param bindingIndex Index of binding associated with the `prop`\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction stylingFirstUpdatePass(\n tView: TView, tStylingKey: TStylingKey, bindingIndex: number, isClassBased: boolean): void {\n ngDevMode && assertFirstUpdatePass(tView);\n const tData = tView.data;\n if (tData[bindingIndex + 1] === null) {\n // The above check is necessary because we don't clear first update pass until first successful\n // (no exception) template execution. This prevents the styling instruction from double adding\n // itself to the list.\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tData[getSelectedIndex()] as TNode;\n ngDevMode && assertDefined(tNode, 'TNode expected');\n const isHostBindings = isInHostBindings(tView, bindingIndex);\n if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {\n // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.\n // If there is a directive which uses `@Input('style')` or `@Input('class')` than\n // we need to neutralize this binding since that directive is shadowing it.\n // We turn this into a noop by setting the key to `false`\n tStylingKey = false;\n }\n tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);\n insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);\n }\n}\n\n/**\n * Adds static styling information to the binding if applicable.\n *\n * The linked list of styles not only stores the list and keys, but also stores static styling\n * information on some of the keys. This function determines if the key should contain the styling\n * information and computes it.\n *\n * See `TStylingStatic` for more details.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nexport function wrapInStaticStylingKey(\n tData: TData, tNode: TNode, stylingKey: TStylingKey, isClassBased: boolean): TStylingKey {\n const hostDirectiveDef = getCurrentDirectiveDef(tData);\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (hostDirectiveDef === null) {\n // We are in template node.\n // If template node already had styling instruction then it has already collected the static\n // styling and there is no need to collect them again. We know that we are the first styling\n // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).\n const isFirstStylingInstructionInTemplate =\n (isClassBased ? tNode.classBindings : tNode.styleBindings) as any as number === 0;\n if (isFirstStylingInstructionInTemplate) {\n // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point\n // they are already merged and it would not be possible to figure which property belongs where\n // in the priority.\n stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);\n stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);\n // We know that if we have styling binding in template we can't have residual.\n residual = null;\n }\n } else {\n // We are in host binding node and there was no binding instruction in template node.\n // This means that we need to compute the residual.\n const directiveStylingLast = tNode.directiveStylingLast;\n const isFirstStylingInstructionInHostBinding =\n directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;\n if (isFirstStylingInstructionInHostBinding) {\n stylingKey =\n collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);\n if (residual === null) {\n // - If `null` than either:\n // - Template styling instruction already ran and it has consumed the static\n // styling into its `TStylingKey` and so there is no need to update residual. Instead\n // we need to update the `TStylingKey` associated with the first template node\n // instruction. OR\n // - Some other styling instruction ran and determined that there are no residuals\n let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);\n if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {\n // Only recompute if `templateStylingKey` had static values. (If no static value found\n // then there is nothing to do since this operation can only produce less static keys, not\n // more.)\n templateStylingKey = collectStylingFromDirectives(\n null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */,\n isClassBased);\n templateStylingKey =\n collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);\n setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);\n }\n } else {\n // We only need to recompute residual if it is not `null`.\n // - If existing residual (implies there was no template styling). This means that some of\n // the statics may have moved from the residual to the `stylingKey` and so we have to\n // recompute.\n // - If `undefined` this is the first time we are running.\n residual = collectResidual(tData, tNode, isClassBased);\n }\n }\n }\n if (residual !== undefined) {\n isClassBased ? (tNode.residualClasses = residual) : (tNode.residualStyles = residual);\n }\n return stylingKey;\n}\n\n/**\n * Retrieve the `TStylingKey` for the template styling instruction.\n *\n * This is needed since `hostBinding` styling instructions are inserted after the template\n * instruction. While the template instruction needs to update the residual in `TNode` the\n * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because\n * the template instruction is downstream from the `hostBindings` instructions.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @return `TStylingKey` if found or `undefined` if not found.\n */\nfunction getTemplateHeadTStylingKey(tData: TData, tNode: TNode, isClassBased: boolean): TStylingKey|\n undefined {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n if (getTStylingRangeNext(bindings) === 0) {\n // There does not seem to be a styling instruction in the `template`.\n return undefined;\n }\n return tData[getTStylingRangePrev(bindings)] as TStylingKey;\n}\n\n/**\n * Update the `TStylingKey` of the first template instruction in `TNode`.\n *\n * Logically `hostBindings` styling instructions are of lower priority than that of the template.\n * However, they execute after the template styling instructions. This means that they get inserted\n * in front of the template styling instructions.\n *\n * If we have a template styling instruction and a new `hostBindings` styling instruction is\n * executed it means that it may need to steal static fields from the template instruction. This\n * method allows us to update the first template instruction `TStylingKey` with a new value.\n *\n * Assume:\n * ```\n * <div my-dir style=\"color: red\" [style.color]=\"tmplExp\"></div>\n *\n * @Directive({\n * host: {\n * 'style': 'width: 100px',\n * '[style.color]': 'dirExp',\n * }\n * })\n * class MyDir {}\n * ```\n *\n * when `[style.color]=\"tmplExp\"` executes it creates this data structure.\n * ```\n * ['', 'color', 'color', 'red', 'width', '100px'],\n * ```\n *\n * The reason for this is that the template instruction does not know if there are styling\n * instructions and must assume that there are none and must collect all of the static styling.\n * (both\n * `color' and 'width`)\n *\n * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.\n * ```\n * ['', 'color', 'width', '100px'], // newly inserted\n * ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong\n * ```\n *\n * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to\n * update it like so:\n * ```\n * ['', 'color', 'width', '100px'],\n * ['', 'color', 'color', 'red'], // UPDATE\n * ```\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param tStylingKey New `TStylingKey` which is replacing the old one.\n */\nfunction setTemplateHeadTStylingKey(\n tData: TData, tNode: TNode, isClassBased: boolean, tStylingKey: TStylingKey): void {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n ngDevMode &&\n assertNotEqual(\n getTStylingRangeNext(bindings), 0,\n 'Expecting to have at least one template styling binding.');\n tData[getTStylingRangePrev(bindings)] = tStylingKey;\n}\n\n/**\n * Collect all static values after the current `TNode.directiveStylingLast` index.\n *\n * Collect the remaining styling information which has not yet been collected by an existing\n * styling instruction.\n *\n * @param tData `TData` where the `DirectiveDefs` are stored.\n * @param tNode `TNode` which contains the directive range.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectResidual(tData: TData, tNode: TNode, isClassBased: boolean): KeyValueArray<any>|\n null {\n let residual: KeyValueArray<any>|null|undefined = undefined;\n const directiveEnd = tNode.directiveEnd;\n ngDevMode &&\n assertNotEqual(\n tNode.directiveStylingLast, -1,\n 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');\n // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are\n // collecting things after the last `hostBindings` directive which had a styling instruction.)\n for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {\n const attrs = (tData[i] as DirectiveDef<any>).hostAttrs;\n residual = collectStylingFromTAttrs(residual, attrs, isClassBased) as KeyValueArray<any>| null;\n }\n return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased) as KeyValueArray<any>| null;\n}\n\n/**\n * Collect the static styling information with lower priority than `hostDirectiveDef`.\n *\n * (This is opposite of residual styling.)\n *\n * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static\n * styling. (Or `null` if template styling)\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey Existing `TStylingKey` to update or wrap.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromDirectives(\n hostDirectiveDef: DirectiveDef<any>|null, tData: TData, tNode: TNode, stylingKey: TStylingKey,\n isClassBased: boolean): TStylingKey {\n // We need to loop because there can be directives which have `hostAttrs` but don't have\n // `hostBindings` so this loop catches up to the current directive..\n let currentDirective: DirectiveDef<any>|null = null;\n const directiveEnd = tNode.directiveEnd;\n let directiveStylingLast = tNode.directiveStylingLast;\n if (directiveStylingLast === -1) {\n directiveStylingLast = tNode.directiveStart;\n } else {\n directiveStylingLast++;\n }\n while (directiveStylingLast < directiveEnd) {\n currentDirective = tData[directiveStylingLast] as DirectiveDef<any>;\n ngDevMode && assertDefined(currentDirective, 'expected to be defined');\n stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);\n if (currentDirective === hostDirectiveDef) break;\n directiveStylingLast++;\n }\n if (hostDirectiveDef !== null) {\n // we only advance the styling cursor if we are collecting data from host bindings.\n // Template executes before host bindings and so if we would update the index,\n // host bindings would not get their statics.\n tNode.directiveStylingLast = directiveStylingLast;\n }\n return stylingKey;\n}\n\n/**\n * Convert `TAttrs` into `TStylingStatic`.\n *\n * @param stylingKey existing `TStylingKey` to update or wrap.\n * @param attrs `TAttributes` to process.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromTAttrs(\n stylingKey: TStylingKey|undefined, attrs: TAttributes|null,\n isClassBased: boolean): TStylingKey {\n const desiredMarker = isClassBased ? AttributeMarker.Classes : AttributeMarker.Styles;\n let currentMarker = AttributeMarker.ImplicitAttributes;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const item = attrs[i] as number | string;\n if (typeof item === 'number') {\n currentMarker = item;\n } else {\n if (currentMarker === desiredMarker) {\n if (!Array.isArray(stylingKey)) {\n stylingKey = stylingKey === undefined ? [] : ['', stylingKey] as any;\n }\n keyValueArraySet(\n stylingKey as KeyValueArray<any>, item, isClassBased ? true : attrs[++i]);\n }\n }\n }\n }\n return stylingKey === undefined ? null : stylingKey;\n}\n\n/**\n * Convert user input to `KeyValueArray`.\n *\n * This function takes user input which could be `string`, Object literal, or iterable and converts\n * it into a consistent representation. The output of this is `KeyValueArray` (which is an array\n * where\n * even indexes contain keys and odd indexes contain values for those keys).\n *\n * The advantage of converting to `KeyValueArray` is that we can perform diff in an input\n * independent\n * way.\n * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be\n * applied)\n *\n * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the\n * difference in linear fashion without the need to allocate any additional data.\n *\n * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine\n * which values need to be deleted, over the new `Map` to determine additions, and we would have to\n * keep additional `Map` to keep track of duplicates or items which have not yet been visited.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done\n * for tree shaking purposes.\n * @param stringParser The parser is passed in so that it will be tree shakable. See\n * `styleStringParser` and `classStringParser`\n * @param value The value to parse/convert to `KeyValueArray`\n */\nexport function toStylingKeyValueArray(\n keyValueArraySet: (keyValueArray: KeyValueArray<any>, key: string, value: any) => void,\n stringParser: (styleKeyValueArray: KeyValueArray<any>, text: string) => void,\n value: string|string[]|{[key: string]: any}|SafeValue|null|undefined): KeyValueArray<any> {\n if (value == null /*|| value === undefined */ || value === '') return EMPTY_ARRAY as any;\n const styleKeyValueArray: KeyValueArray<any> = [] as any;\n const unwrappedValue = unwrapSafeValue(value) as string | string[] | {[key: string]: any};\n if (Array.isArray(unwrappedValue)) {\n for (let i = 0; i < unwrappedValue.length; i++) {\n keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);\n }\n } else if (typeof unwrappedValue === 'object') {\n for (const key in unwrappedValue) {\n if (unwrappedValue.hasOwnProperty(key)) {\n keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);\n }\n }\n } else if (typeof unwrappedValue === 'string') {\n stringParser(styleKeyValueArray, unwrappedValue);\n } else {\n ngDevMode &&\n throwError('Unsupported styling type ' + typeof unwrappedValue + ': ' + unwrappedValue);\n }\n return styleKeyValueArray;\n}\n\n/**\n * Set a `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nexport function styleKeyValueArraySet(keyValueArray: KeyValueArray<any>, key: string, value: any) {\n keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));\n}\n\n/**\n * Update map based styling.\n *\n * Map based styling could be anything which contains more than one binding. For example `string`,\n * or object literal. Dealing with all of these types would complicate the logic so\n * instead this function expects that the complex input is first converted into normalized\n * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it\n * very cheap to compute deltas between the previous and current value.\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param oldKeyValueArray Previous value represented as `KeyValueArray`\n * @param newKeyValueArray Current value represented as `KeyValueArray`\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStylingMap(\n tView: TView, tNode: TNode, lView: LView, renderer: Renderer,\n oldKeyValueArray: KeyValueArray<any>, newKeyValueArray: KeyValueArray<any>,\n isClassBased: boolean, bindingIndex: number) {\n if (oldKeyValueArray as KeyValueArray<any>| NO_CHANGE === NO_CHANGE) {\n // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n oldKeyValueArray = EMPTY_ARRAY as any;\n }\n let oldIndex = 0;\n let newIndex = 0;\n let oldKey: string|null = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;\n let newKey: string|null = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;\n while (oldKey !== null || newKey !== null) {\n ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');\n ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');\n const oldValue =\n oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;\n const newValue =\n newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;\n let setKey: string|null = null;\n let setValue: any = undefined;\n if (oldKey === newKey) {\n // UPDATE: Keys are equal => new value is overwriting old value.\n oldIndex += 2;\n newIndex += 2;\n if (oldValue !== newValue) {\n setKey = newKey;\n setValue = newValue;\n }\n } else if (newKey === null || oldKey !== null && oldKey < newKey!) {\n // DELETE: oldKey key is missing or we did not find the oldKey in the newValue\n // (because the keyValueArray is sorted and `newKey` is found later alphabetically).\n // `\"background\" < \"color\"` so we need to delete `\"background\"` because it is not found in the\n // new array.\n oldIndex += 2;\n setKey = oldKey;\n } else {\n // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.\n // `\"color\" > \"background\"` so we need to add `color` because it is in new array but not in\n // old array.\n ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');\n newIndex += 2;\n setKey = newKey;\n setValue = newValue;\n }\n if (setKey !== null) {\n updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);\n }\n oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;\n newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;\n }\n}\n\n/**\n * Update a simple (property name) styling.\n *\n * This function takes `prop` and updates the DOM to that value. The function takes the binding\n * value as well as binding priority into consideration to determine which value should be written\n * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks\n * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param prop Either style property name or a class name.\n * @param value Either style value for `prop` or `true`/`false` if `prop` is class.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStyling(\n tView: TView, tNode: TNode, lView: LView, renderer: Renderer, prop: string,\n value: string|undefined|null|boolean, isClassBased: boolean, bindingIndex: number) {\n if (!(tNode.type & TNodeType.AnyRNode)) {\n // It is possible to have styling on non-elements (such as ng-container).\n // This is rare, but it does happen. In such a case, just ignore the binding.\n return;\n }\n const tData = tView.data;\n const tRange = tData[bindingIndex + 1] as TStylingRange;\n const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ?\n findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) :\n undefined;\n if (!isStylingValuePresent(higherPriorityValue)) {\n // We don't have a next duplicate, or we did not find a duplicate value.\n if (!isStylingValuePresent(value)) {\n // We should delete current value or restore to lower priority value.\n if (getTStylingRangePrevDuplicate(tRange)) {\n // We have a possible prev duplicate, let's retrieve it.\n value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);\n }\n }\n const rNode = getNativeByIndex(getSelectedIndex(), lView) as RElement;\n applyStyling(renderer, isClassBased, rNode, prop, value);\n }\n}\n\n/**\n * Search for styling value with higher priority which is overwriting current value, or a\n * value of lower priority to which we should fall back if the value is `undefined`.\n *\n * When value is being applied at a location, related values need to be consulted.\n * - If there is a higher priority binding, we should be using that one instead.\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp1`\n * requires that we check `exp2` to see if it is set to value other than `undefined`.\n * - If there is a lower priority binding and we are changing to `undefined`\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp2` to\n * `undefined` requires that we check `exp1` (and static values) and use that as new value.\n *\n * NOTE: The styling stores two values.\n * 1. The raw value which came from the application is stored at `index + 0` location. (This value\n * is used for dirty checking).\n * 2. The normalized value is stored at `index + 1`.\n *\n * @param tData `TData` used for traversing the priority.\n * @param tNode `TNode` to use for resolving static styling. Also controls search direction.\n * - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n * If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n * - `null` search prev and go all the way to end. Return last value where\n * `isStylingValuePresent(value)` is true.\n * @param lView `LView` used for retrieving the actual values.\n * @param prop Property which we are interested in.\n * @param index Starting index in the linked list of styling bindings where the search should start.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction findStylingValue(\n tData: TData, tNode: TNode|null, lView: LView, prop: string, index: number,\n isClassBased: boolean): any {\n // `TNode` to use for resolving static styling. Also controls search direction.\n // - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n // If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n // - `null` search prev and go all the way to end. Return last value where\n // `isStylingValuePresent(value)` is true.\n const isPrevDirection = tNode === null;\n let value: any = undefined;\n while (index > 0) {\n const rawKey = tData[index] as TStylingKey;\n const containsStatics = Array.isArray(rawKey);\n // Unwrap the key if we contain static values.\n const key = containsStatics ? (rawKey as string[])[1] : rawKey;\n const isStylingMap = key === null;\n let valueAtLViewIndex = lView[index + 1];\n if (valueAtLViewIndex === NO_CHANGE) {\n // In firstUpdatePass the styling instructions create a linked list of styling.\n // On subsequent passes it is possible for a styling instruction to try to read a binding\n // which\n // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that\n // we have `undefined` (or empty array in case of styling-map instruction) instead. This\n // allows the resolution to apply the value (which may later be overwritten when the\n // binding actually executes.)\n valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;\n }\n let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :\n (key === prop ? valueAtLViewIndex : undefined);\n if (containsStatics && !isStylingValuePresent(currentValue)) {\n currentValue = keyValueArrayGet(rawKey as KeyValueArray<any>, prop);\n }\n if (isStylingValuePresent(currentValue)) {\n value = currentValue;\n if (isPrevDirection) {\n return value;\n }\n }\n const tRange = tData[index + 1] as TStylingRange;\n index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);\n }\n if (tNode !== null) {\n // in case where we are going in next direction AND we did not find anything, we need to\n // consult residual styling\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /** OR residual !=== undefined */) {\n value = keyValueArrayGet(residual!, prop);\n }\n }\n return value;\n}\n\n/**\n * Determines if the binding value should be used (or if the value is 'undefined' and hence priority\n * resolution should be used.)\n *\n * @param value Binding style value.\n */\nfunction isStylingValuePresent(value: any): boolean {\n // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n // have an opinion as to what this binding should be and you should consult other bindings by\n // priority to determine the valid value.\n // This is extracted into a single function so that we have a single place to control this.\n return value !== undefined;\n}\n\n/**\n * Normalizes and/or adds a suffix to the value.\n *\n * If value is `null`/`undefined` no suffix is added\n * @param value\n * @param suffix\n */\nfunction normalizeSuffix(value: any, suffix: string|undefined|null): string|null|undefined|boolean {\n if (value == null /** || value === undefined */) {\n // do nothing\n } else if (typeof suffix === 'string') {\n value = value + suffix;\n } else if (typeof value === 'object') {\n value = stringify(unwrapSafeValue(value));\n }\n return value;\n}\n\n\n/**\n * Tests if the `TNode` has input shadow.\n *\n * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or\n * `@Input('class')` as input.\n *\n * @param tNode `TNode` which we would like to see if it has shadow.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nexport function hasStylingInputShadow(tNode: TNode, isClassBased: boolean) {\n return (tNode.flags & (isClassBased ? TNodeFlags.hasClassInput : TNodeFlags.hasStyleInput)) !== 0;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {assertEqual, assertIndexInRange} from '../../util/assert';\nimport {TElementNode, TNodeType} from '../interfaces/node';\nimport {HEADER_OFFSET, RENDERER, T_HOST} from '../interfaces/view';\nimport {appendChild, createTextNode} from '../node_manipulation';\nimport {getBindingIndex, getLView, getTView, setCurrentTNode} from '../state';\n\nimport {getOrCreateTNode} from './shared';\n\n\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Static string value to write.\n *\n * @codeGenApi\n */\nexport function ɵɵtext(index: number, value: string = ''): void {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n\n ngDevMode &&\n assertEqual(\n getBindingIndex(), tView.bindingStartIndex,\n 'text nodes should be created before any bindings');\n ngDevMode && assertIndexInRange(lView, adjustedIndex);\n\n const tNode = tView.firstCreatePass ?\n getOrCreateTNode(tView, adjustedIndex, TNodeType.Text, value, null) :\n tView.data[adjustedIndex] as TElementNode;\n\n const textNative = lView[adjustedIndex] = createTextNode(lView[RENDERER], value);\n appendChild(tView, lView, textNative, tNode);\n\n // Text nodes are self closing.\n setCurrentTNode(tNode, false);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {getLView, getSelectedIndex} from '../state';\nimport {NO_CHANGE} from '../tokens';\n\nimport {interpolation1, interpolation2, interpolation3, interpolation4, interpolation5, interpolation6, interpolation7, interpolation8, interpolationV} from './interpolation';\nimport {textBindingInternal} from './shared';\n\n\n/**\n *\n * Update text content with a lone bound value\n *\n * Used when a text node has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div>{{v0}}</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate(v0);\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate(v0: any): typeof ɵɵtextInterpolate {\n ɵɵtextInterpolate1('', v0, '');\n return ɵɵtextInterpolate;\n}\n\n\n/**\n *\n * Update text content with single bound value surrounded by other text.\n *\n * Used when a text node has 1 interpolated value in it:\n *\n * ```html\n * <div>prefix{{v0}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate1('prefix', v0, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate1(\n prefix: string, v0: any, suffix: string): typeof ɵɵtextInterpolate1 {\n const lView = getLView();\n const interpolated = interpolation1(lView, prefix, v0, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate1;\n}\n\n/**\n *\n * Update text content with 2 bound values surrounded by other text.\n *\n * Used when a text node has 2 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate2(\n prefix: string, v0: any, i0: string, v1: any, suffix: string): typeof ɵɵtextInterpolate2 {\n const lView = getLView();\n const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate2;\n}\n\n/**\n *\n * Update text content with 3 bound values surrounded by other text.\n *\n * Used when a text node has 3 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate3(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any,\n suffix: string): typeof ɵɵtextInterpolate3 {\n const lView = getLView();\n const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate3;\n}\n\n/**\n *\n * Update text content with 4 bound values surrounded by other text.\n *\n * Used when a text node has 4 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see ɵɵtextInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate4(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n suffix: string): typeof ɵɵtextInterpolate4 {\n const lView = getLView();\n const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate4;\n}\n\n/**\n *\n * Update text content with 5 bound values surrounded by other text.\n *\n * Used when a text node has 5 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate5(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, suffix: string): typeof ɵɵtextInterpolate5 {\n const lView = getLView();\n const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate5;\n}\n\n/**\n *\n * Update text content with 6 bound values surrounded by other text.\n *\n * Used when a text node has 6 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change. @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate6(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, suffix: string): typeof ɵɵtextInterpolate6 {\n const lView = getLView();\n const interpolated =\n interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate6;\n}\n\n/**\n *\n * Update text content with 7 bound values surrounded by other text.\n *\n * Used when a text node has 7 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate7(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any,\n suffix: string): typeof ɵɵtextInterpolate7 {\n const lView = getLView();\n const interpolated =\n interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate7;\n}\n\n/**\n *\n * Update text content with 8 bound values surrounded by other text.\n *\n * Used when a text node has 8 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nexport function ɵɵtextInterpolate8(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,\n suffix: string): typeof ɵɵtextInterpolate8 {\n const lView = getLView();\n const interpolated = interpolation8(\n lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolate8;\n}\n\n/**\n * Update text content with 9 or more bound values other surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n *\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nexport function ɵɵtextInterpolateV(values: any[]): typeof ɵɵtextInterpolateV {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated as string);\n }\n return ɵɵtextInterpolateV;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// THIS CODE IS GENERATED - DO NOT MODIFY.\nconst u = undefined;\n\nfunction plural(val: number): number {\nconst n = val, i = Math.floor(Math.abs(val)), v = val.toString().replace(/^[^.]*\\.?/, '').length;\n\nif (i === 1 && v === 0)\n return 1;\nreturn 5;\n}\n\nexport default [\"en\",[[\"a\",\"p\"],[\"AM\",\"PM\"],u],[[\"AM\",\"PM\"],u,u],[[\"S\",\"M\",\"T\",\"W\",\"T\",\"F\",\"S\"],[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"]],u,[[\"J\",\"F\",\"M\",\"A\",\"M\",\"J\",\"J\",\"A\",\"S\",\"O\",\"N\",\"D\"],[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]],u,[[\"B\",\"A\"],[\"BC\",\"AD\"],[\"Before Christ\",\"Anno Domini\"]],0,[6,0],[\"M/d/yy\",\"MMM d, y\",\"MMMM d, y\",\"EEEE, MMMM d, y\"],[\"h:mm a\",\"h:mm:ss a\",\"h:mm:ss a z\",\"h:mm:ss a zzzz\"],[\"{1}, {0}\",u,\"{1} 'at' {0}\",u],[\".\",\",\",\";\",\"%\",\"+\",\"-\",\"E\",\"×\",\"‰\",\"∞\",\"NaN\",\":\"],[\"#,##0.###\",\"#,##0%\",\"¤#,##0.00\",\"#E0\"],\"USD\",\"$\",\"US Dollar\",{},\"ltr\", plural];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {global} from '../util/global';\n\nimport localeEn from './locale_en';\n\n/**\n * This const is used to store the locale data registered with `registerLocaleData`\n */\nlet LOCALE_DATA: {[localeId: string]: any} = {};\n\n/**\n * Register locale data to be used internally by Angular. See the\n * [\"I18n guide\"](guide/i18n-common-format-data-locale) to know how to import additional locale\n * data.\n *\n * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1\n */\nexport function registerLocaleData(data: any, localeId?: string|any, extraData?: any): void {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[LocaleDataIndex.LocaleId];\n }\n\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n\n LOCALE_DATA[localeId] = data;\n\n if (extraData) {\n LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData;\n }\n}\n\n/**\n * Finds the locale data for a given locale.\n *\n * @param locale The locale code.\n * @returns The locale data.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n */\nexport function findLocaleData(locale: string): any {\n const normalizedLocale = normalizeLocale(locale);\n\n let match = getLocaleData(normalizedLocale);\n if (match) {\n return match;\n }\n\n // let's try to find a parent locale\n const parentLocale = normalizedLocale.split('-')[0];\n match = getLocaleData(parentLocale);\n if (match) {\n return match;\n }\n\n if (parentLocale === 'en') {\n return localeEn;\n }\n\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_LOCALE_DATA,\n ngDevMode && `Missing locale data for the locale \"${locale}\".`);\n}\n\n/**\n * Retrieves the default currency code for the given locale.\n *\n * The default is defined as the first currency which is still in use.\n *\n * @param locale The code of the locale whose currency code we want.\n * @returns The code of the default currency for the given locale.\n *\n */\nexport function getLocaleCurrencyCode(locale: string): string|null {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.CurrencyCode] || null;\n}\n\n/**\n * Retrieves the plural function used by ICU expressions to determine the plural case to use\n * for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The plural function for the locale.\n * @see `NgPlural`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n */\nexport function getLocalePluralCase(locale: string): (value: number) => number {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.PluralCase];\n}\n\n\n\n/**\n * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`\n * or from the global `ng.common.locale`.\n */\nexport function getLocaleData(normalizedLocale: string): any {\n if (!(normalizedLocale in LOCALE_DATA)) {\n LOCALE_DATA[normalizedLocale] = global.ng && global.ng.common && global.ng.common.locales &&\n global.ng.common.locales[normalizedLocale];\n }\n return LOCALE_DATA[normalizedLocale];\n}\n\n/**\n * Helper function to remove all the locale data from `LOCALE_DATA`.\n */\nexport function unregisterAllLocaleData() {\n LOCALE_DATA = {};\n}\n\n/**\n * Index of each type of locale data from the locale data array\n */\nexport enum LocaleDataIndex {\n LocaleId = 0,\n DayPeriodsFormat,\n DayPeriodsStandalone,\n DaysFormat,\n DaysStandalone,\n MonthsFormat,\n MonthsStandalone,\n Eras,\n FirstDayOfWeek,\n WeekendRange,\n DateFormat,\n TimeFormat,\n DateTimeFormat,\n NumberSymbols,\n NumberFormats,\n CurrencyCode,\n CurrencySymbol,\n CurrencyName,\n Currencies,\n Directionality,\n PluralCase,\n ExtraData\n}\n\n/**\n * Index of each type of locale data from the extra locale data array\n */\nexport const enum ExtraLocaleDataIndex {\n ExtraDayPeriodFormats = 0,\n ExtraDayPeriodStandalone,\n ExtraDayPeriodsRules\n}\n\n/**\n * Index of each value in currency data (used to describe CURRENCIES_EN in currencies.ts)\n */\nexport const enum CurrencyIndex {\n Symbol = 0,\n SymbolNarrow,\n NbOfDigits\n}\n\n/**\n * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.\n */\nfunction normalizeLocale(locale: string): string {\n return locale.toLowerCase().replace(/_/g, '-');\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getLocalePluralCase} from './locale_data_api';\n\nconst pluralMapping = ['zero', 'one', 'two', 'few', 'many'];\n\n/**\n * Returns the plural case based on the locale\n */\nexport function getPluralCase(value: string, locale: string): string {\n const plural = getLocalePluralCase(locale)(parseInt(value, 10));\n const result = pluralMapping[plural];\n return (result !== undefined) ? result : 'other';\n}\n\n/**\n * The locale id that the application is using by default (for translations and ICU expressions).\n */\nexport const DEFAULT_LOCALE_ID = 'en-US';\n\n/**\n * USD currency code that the application uses by default for CurrencyPipe when no\n * DEFAULT_CURRENCY_CODE is provided.\n */\nexport const USD_CURRENCY_CODE = 'USD';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DEFAULT_LOCALE_ID} from '../../i18n/localization';\nimport {assertDefined} from '../../util/assert';\n\n\n/**\n * The locale id that the application is currently using (for translations and ICU expressions).\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nlet LOCALE_ID = DEFAULT_LOCALE_ID;\n\n/**\n * Sets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n *\n * @param localeId\n */\nexport function setLocaleId(localeId: string) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}\n\n/**\n * Gets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nexport function getLocaleId(): string {\n return LOCALE_ID;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {ClassProvider, Provider} from '../di/interface/provider';\nimport {isClassProvider, isTypeProvider} from '../di/provider_collection';\nimport {providerToFactory} from '../di/r3_injector';\nimport {assertDefined} from '../util/assert';\n\nimport {diPublicInInjector, getNodeInjectable, getOrCreateNodeInjectorForNode} from './di';\nimport {ɵɵdirectiveInject} from './instructions/all';\nimport {DirectiveDef} from './interfaces/definition';\nimport {NodeInjectorFactory} from './interfaces/injector';\nimport {TContainerNode, TDirectiveHostNode, TElementContainerNode, TElementNode, TNodeProviderIndexes} from './interfaces/node';\nimport {isComponentDef} from './interfaces/type_checks';\nimport {DestroyHookData, LView, TData, TVIEW, TView} from './interfaces/view';\nimport {getCurrentTNode, getLView, getTView} from './state';\n\n\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nexport function providersResolver<T>(\n def: DirectiveDef<T>, providers: Provider[], viewProviders: Provider[]): void {\n const tView = getTView();\n if (tView.firstCreatePass) {\n const isComponent = isComponentDef(def);\n\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(\n provider: Provider, tInjectables: TData, lInjectablesBlueprint: NodeInjectorFactory[],\n isComponent: boolean, isViewProvider: boolean): void {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(\n provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n } else {\n const tView = getTView();\n const lView = getLView();\n let token: any = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n let providerFactory: () => any = providerToFactory(provider);\n\n const tNode = getCurrentTNode()!;\n const beginIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount =\n tNode.providerIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n const existingFactoryIndex = indexOf(\n token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount,\n endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView),\n tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += TNodeProviderIndexes.CptViewProvidersCountShifter;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n } else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n\n const existingProvidersFactoryIndex =\n indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex =\n indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView),\n tView, token);\n const factory = multiFactory(\n isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver,\n lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += TNodeProviderIndexes.CptViewProvidersCountShifter;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(\n lInjectablesBlueprint!\n [isViewProvider ? existingViewProvidersFactoryIndex :\n existingProvidersFactoryIndex],\n providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(\n tView, provider,\n existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex :\n existingViewProvidersFactoryIndex,\n indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders!++;\n }\n }\n }\n}\n\n/**\n * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.\n * @param tView `TView` in which to register the hook.\n * @param provider Provider whose hook should be registered.\n * @param contextIndex Index under which to find the context for the hook when it's being invoked.\n * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi\n * provider factory.\n */\nfunction registerDestroyHooksIfSupported(\n tView: TView, provider: Exclude<Provider, any[]>, contextIndex: number,\n indexInFactory?: number) {\n const providerIsTypeProvider = isTypeProvider(provider);\n const providerIsClassProvider = isClassProvider(provider);\n\n if (providerIsTypeProvider || providerIsClassProvider) {\n // Resolve forward references as `useClass` can hold a forward reference.\n const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;\n const prototype = classToken.prototype;\n const ngOnDestroy = prototype.ngOnDestroy;\n\n if (ngOnDestroy) {\n const hooks = tView.destroyHooks || (tView.destroyHooks = []);\n\n if (!providerIsTypeProvider && ((provider as ClassProvider)).multi) {\n ngDevMode &&\n assertDefined(\n indexInFactory, 'indexInFactory when registering multi factory destroy hook');\n const existingCallbacksIndex = hooks.indexOf(contextIndex);\n\n if (existingCallbacksIndex === -1) {\n hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);\n } else {\n (hooks[existingCallbacksIndex + 1] as DestroyHookData).push(indexInFactory!, ngOnDestroy);\n }\n } else {\n hooks.push(contextIndex, ngOnDestroy);\n }\n }\n }\n}\n\n/**\n * Add a factory in a multi factory.\n * @returns Index at which the factory was inserted.\n */\nfunction multiFactoryAdd(\n multiFactory: NodeInjectorFactory, factory: () => any, isComponentProvider: boolean): number {\n if (isComponentProvider) {\n multiFactory.componentProviders!++;\n }\n return multiFactory.multi!.push(factory) - 1;\n}\n\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item: any, arr: any[], begin: number, end: number) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n}\n\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(\n this: NodeInjectorFactory, _: undefined, tData: TData, lData: LView,\n tNode: TDirectiveHostNode): any[] {\n return multiResolve(this.multi!, []);\n}\n\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(\n this: NodeInjectorFactory, _: undefined, tData: TData, lView: LView,\n tNode: TDirectiveHostNode): any[] {\n const factories = this.multi!;\n let result: any[];\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders!;\n const multiProviders =\n getNodeInjectable(lView, lView[TVIEW], this.providerFactory!.index!, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories: Array<() => any>, result: any[]): any[] {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i]! as () => null;\n result.push(factory());\n }\n return result;\n}\n\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(\n factoryFn: (\n this: NodeInjectorFactory, _: undefined, tData: TData, lData: LView,\n tNode: TDirectiveHostNode) => any,\n index: number, isViewProvider: boolean, isComponent: boolean,\n f: () => any): NodeInjectorFactory {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ProcessProvidersFunction, Provider} from '../../di/interface/provider';\nimport {providersResolver} from '../di_setup';\nimport {DirectiveDef} from '../interfaces/definition';\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * ```ts\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ɵcmp = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * decls: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * ɵɵtext(0);\n * }\n * if (fs & RenderFlags.Update) {\n * ɵɵtextInterpolate(ctx.greeter.greet());\n * }\n * },\n * features: [ɵɵProvidersFeature([GreeterDE])]\n * });\n * }\n * ```\n *\n * @param definition\n *\n * @codeGenApi\n */\nexport function ɵɵProvidersFeature<T>(providers: Provider[], viewProviders: Provider[] = []) {\n return (definition: DirectiveDef<T>) => {\n definition.providersResolver =\n (def: DirectiveDef<T>, processProvidersFn?: ProcessProvidersFunction) => {\n return providersResolver(\n def, //\n processProvidersFn ? processProvidersFn(providers) : providers, //\n viewProviders);\n };\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {EnvironmentInjector} from '../di/r3_injector';\nimport {Type} from '../interface/type';\n\nimport {ComponentFactoryResolver} from './component_factory_resolver';\n\n\n/**\n * Represents an instance of an `NgModule` created by an `NgModuleFactory`.\n * Provides access to the `NgModule` instance and related objects.\n *\n * @publicApi\n */\nexport abstract class NgModuleRef<T> {\n /**\n * The injector that contains all of the providers of the `NgModule`.\n */\n abstract get injector(): EnvironmentInjector;\n\n /**\n * The resolver that can retrieve component factories in a context of this module.\n *\n * Note: since v13, dynamic component creation via\n * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)\n * does **not** require resolving component factory: component class can be used directly.\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\n abstract get componentFactoryResolver(): ComponentFactoryResolver;\n\n /**\n * The `NgModule` instance.\n */\n abstract get instance(): T;\n\n /**\n * Destroys the module instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Registers a callback to be executed when the module is destroyed.\n */\n abstract onDestroy(callback: () => void): void;\n}\n\nexport interface InternalNgModuleRef<T> extends NgModuleRef<T> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _bootstrapComponents: Type<any>[];\n}\n\n/**\n * @publicApi\n *\n * @deprecated\n * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy\n * JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)\n * for additional context. Angular provides APIs that accept NgModule classes directly (such as\n * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and\n * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of\n * using factory-based ones.\n */\nexport abstract class NgModuleFactory<T> {\n abstract get moduleType(): Type<T>;\n abstract create(parentInjector: Injector|null): NgModuleRef<T>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {createInjectorWithoutInjectorInstances} from '../di/create_injector';\nimport {Injector} from '../di/injector';\nimport {EnvironmentProviders, Provider} from '../di/interface/provider';\nimport {EnvironmentInjector, getNullInjector, R3Injector} from '../di/r3_injector';\nimport {Type} from '../interface/type';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory as viewEngine_NgModuleFactory, NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {assertDefined} from '../util/assert';\nimport {stringify} from '../util/stringify';\n\nimport {ComponentFactoryResolver} from './component_ref';\nimport {getNgModuleDef} from './definition';\nimport {maybeUnwrapFn} from './util/misc_utils';\n\n/**\n * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.\n *\n * @param ngModule NgModule class.\n * @param parentInjector Optional injector instance to use as a parent for the module injector. If\n * not provided, `NullInjector` will be used instead.\n * @returns NgModuleRef that represents an NgModule instance.\n *\n * @publicApi\n */\nexport function createNgModule<T>(\n ngModule: Type<T>, parentInjector?: Injector): viewEngine_NgModuleRef<T> {\n return new NgModuleRef<T>(ngModule, parentInjector ?? null);\n}\n\n/**\n * The `createNgModule` function alias for backwards-compatibility.\n * Please avoid using it directly and use `createNgModule` instead.\n *\n * @deprecated Use `createNgModule` instead.\n */\nexport const createNgModuleRef = createNgModule;\nexport class NgModuleRef<T> extends viewEngine_NgModuleRef<T> implements InternalNgModuleRef<T> {\n // tslint:disable-next-line:require-internal-with-underscore\n _bootstrapComponents: Type<any>[] = [];\n // tslint:disable-next-line:require-internal-with-underscore\n _r3Injector: R3Injector;\n override instance: T;\n destroyCbs: (() => void)[]|null = [];\n\n // When bootstrapping a module we have a dependency graph that looks like this:\n // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the\n // module being resolved tries to inject the ComponentFactoryResolver, it'll create a\n // circular dependency which will result in a runtime error, because the injector doesn't\n // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves\n // and providing it, rather than letting the injector resolve it.\n override readonly componentFactoryResolver: ComponentFactoryResolver =\n new ComponentFactoryResolver(this);\n\n constructor(ngModuleType: Type<T>, public _parent: Injector|null) {\n super();\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode &&\n assertDefined(\n ngModuleDef,\n `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n\n this._bootstrapComponents = maybeUnwrapFn(ngModuleDef!.bootstrap);\n this._r3Injector = createInjectorWithoutInjectorInstances(\n ngModuleType, _parent,\n [\n {provide: viewEngine_NgModuleRef, useValue: this}, {\n provide: viewEngine_ComponentFactoryResolver,\n useValue: this.componentFactoryResolver\n }\n ],\n stringify(ngModuleType), new Set(['environment'])) as R3Injector;\n\n // We need to resolve the injector types separately from the injector creation, because\n // the module might be trying to use this ref in its constructor for DI which will cause a\n // circular error that will eventually error out, because the injector isn't created yet.\n this._r3Injector.resolveInjectorInitializers();\n this.instance = this._r3Injector.get(ngModuleType);\n }\n\n override get injector(): EnvironmentInjector {\n return this._r3Injector;\n }\n\n override destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n const injector = this._r3Injector;\n !injector.destroyed && injector.destroy();\n this.destroyCbs!.forEach(fn => fn());\n this.destroyCbs = null;\n }\n override onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs!.push(callback);\n }\n}\n\nexport class NgModuleFactory<T> extends viewEngine_NgModuleFactory<T> {\n constructor(public moduleType: Type<T>) {\n super();\n }\n\n override create(parentInjector: Injector|null): viewEngine_NgModuleRef<T> {\n return new NgModuleRef(this.moduleType, parentInjector);\n }\n}\n\nclass EnvironmentNgModuleRefAdapter extends viewEngine_NgModuleRef<null> {\n override readonly injector: EnvironmentInjector;\n override readonly componentFactoryResolver: ComponentFactoryResolver =\n new ComponentFactoryResolver(this);\n override readonly instance = null;\n\n constructor(\n providers: Array<Provider|EnvironmentProviders>, parent: EnvironmentInjector|null,\n source: string|null) {\n super();\n const injector = new R3Injector(\n [\n ...providers,\n {provide: viewEngine_NgModuleRef, useValue: this},\n {provide: viewEngine_ComponentFactoryResolver, useValue: this.componentFactoryResolver},\n ],\n parent || getNullInjector(), source, new Set(['environment']));\n this.injector = injector;\n injector.resolveInjectorInitializers();\n }\n\n override destroy(): void {\n this.injector.destroy();\n }\n\n override onDestroy(callback: () => void): void {\n this.injector.onDestroy(callback);\n }\n}\n\n/**\n * Create a new environment injector.\n *\n * Learn more about environment injectors in\n * [this guide](guide/standalone-components#environment-injectors).\n *\n * @param providers An array of providers.\n * @param parent A parent environment injector.\n * @param debugName An optional name for this injector instance, which will be used in error\n * messages.\n *\n * @publicApi\n */\nexport function createEnvironmentInjector(\n providers: Array<Provider|EnvironmentProviders>, parent: EnvironmentInjector,\n debugName: string|null = null): EnvironmentInjector {\n const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);\n return adapter.injector;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ɵɵinject as inject} from '../../di/injector_compatibility';\nimport {ɵɵdefineInjectable as defineInjectable} from '../../di/interface/defs';\nimport {internalImportProvidersFrom} from '../../di/provider_collection';\nimport {EnvironmentInjector} from '../../di/r3_injector';\nimport {OnDestroy} from '../../interface/lifecycle_hooks';\nimport {ComponentDef} from '../interfaces/definition';\nimport {createEnvironmentInjector} from '../ng_module_ref';\n\n/**\n * A service used by the framework to create instances of standalone injectors. Those injectors are\n * created on demand in case of dynamic component instantiation and contain ambient providers\n * collected from the imports graph rooted at a given standalone component.\n */\nclass StandaloneService implements OnDestroy {\n cachedInjectors = new Map<string, EnvironmentInjector|null>();\n\n constructor(private _injector: EnvironmentInjector) {}\n\n getOrCreateStandaloneInjector(componentDef: ComponentDef<unknown>): EnvironmentInjector|null {\n if (!componentDef.standalone) {\n return null;\n }\n\n if (!this.cachedInjectors.has(componentDef.id)) {\n const providers = internalImportProvidersFrom(false, componentDef.type);\n const standaloneInjector = providers.length > 0 ?\n createEnvironmentInjector(\n [providers], this._injector, `Standalone[${componentDef.type.name}]`) :\n null;\n this.cachedInjectors.set(componentDef.id, standaloneInjector);\n }\n\n return this.cachedInjectors.get(componentDef.id)!;\n }\n\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n } finally {\n this.cachedInjectors.clear();\n }\n }\n\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ defineInjectable({\n token: StandaloneService,\n providedIn: 'environment',\n factory: () => new StandaloneService(inject(EnvironmentInjector)),\n });\n}\n\n/**\n * A feature that acts as a setup code for the {@link StandaloneService}.\n *\n * The most important responsibility of this feature is to expose the \"getStandaloneInjector\"\n * function (an entry points to a standalone injector creation) on a component definition object. We\n * go through the features infrastructure to make sure that the standalone injector creation logic\n * is tree-shakable and not included in applications that don't use standalone components.\n *\n * @codeGenApi\n */\nexport function ɵɵStandaloneFeature(definition: ComponentDef<unknown>) {\n definition.getStandaloneInjector = (parentInjector: EnvironmentInjector) => {\n return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertIndexInRange} from '../util/assert';\nimport {bindingUpdated, bindingUpdated2, bindingUpdated3, bindingUpdated4, getBinding, updateBinding} from './bindings';\nimport {LView} from './interfaces/view';\nimport {getBindingRoot, getLView} from './state';\nimport {NO_CHANGE} from './tokens';\n\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return lView[bindingIndex] === NO_CHANGE ?\n updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) :\n getBinding(lView, bindingIndex);\n}\n\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction1(\n slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any {\n return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction2(\n slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any,\n thisArg?: any): any {\n return pureFunction2Internal(\n getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction3(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any,\n thisArg?: any): any {\n return pureFunction3Internal(\n getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction4(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any,\n exp3: any, exp4: any, thisArg?: any): any {\n return pureFunction4Internal(\n getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction5(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different ?\n updateBinding(\n lView, bindingIndex + 5,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :\n pureFn(exp1, exp2, exp3, exp4, exp5)) :\n getBinding(lView, bindingIndex + 5);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction6(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(\n lView, bindingIndex + 6,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction7(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ?\n updateBinding(\n lView, bindingIndex + 7,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :\n getBinding(lView, bindingIndex + 7);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunction8(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any,\n thisArg?: any): any {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ?\n updateBinding(\n lView, bindingIndex + 8,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :\n getBinding(lView, bindingIndex + 8);\n}\n\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nexport function ɵɵpureFunctionV(\n slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any {\n return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);\n}\n\n/**\n * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized\n * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first\n * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE\n * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert\n * it to `undefined`.\n */\nfunction getPureFunctionReturnValue(lView: LView, returnValueIndex: number) {\n ngDevMode && assertIndexInRange(lView, returnValueIndex);\n const lastReturnValue = lView[returnValueIndex];\n return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;\n}\n\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction1Internal(\n lView: LView, bindingRoot: number, slotOffset: number, pureFn: (v: any) => any, exp: any,\n thisArg?: any): any {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp) ?\n updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :\n getPureFunctionReturnValue(lView, bindingIndex + 1);\n}\n\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction2Internal(\n lView: LView, bindingRoot: number, slotOffset: number, pureFn: (v1: any, v2: any) => any,\n exp1: any, exp2: any, thisArg?: any): any {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?\n updateBinding(\n lView, bindingIndex + 2,\n thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :\n getPureFunctionReturnValue(lView, bindingIndex + 2);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction3Internal(\n lView: LView, bindingRoot: number, slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any,\n thisArg?: any): any {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(\n lView, bindingIndex + 3,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}\n\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n */\nexport function pureFunction4Internal(\n lView: LView, bindingRoot: number, slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any, exp3: any, exp4: any,\n thisArg?: any): any {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?\n updateBinding(\n lView, bindingIndex + 4,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :\n getPureFunctionReturnValue(lView, bindingIndex + 4);\n}\n\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunctionVInternal(\n lView: LView, bindingRoot: number, slotOffset: number, pureFn: (...v: any[]) => any,\n exps: any[], thisArg?: any): any {\n let bindingIndex = bindingRoot + slotOffset;\n let different = false;\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :\n getPureFunctionReturnValue(lView, bindingIndex);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PipeTransform} from '../change_detection/pipe_transform';\nimport {setInjectImplementation} from '../di/inject_switch';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {Type} from '../interface/type';\n\nimport {getFactoryDef} from './definition_factory';\nimport {setIncludeViewProviders} from './di';\nimport {store, ɵɵdirectiveInject} from './instructions/all';\nimport {isHostComponentStandalone} from './instructions/element_validation';\nimport {PipeDef, PipeDefList} from './interfaces/definition';\nimport {CONTEXT, DECLARATION_COMPONENT_VIEW, HEADER_OFFSET, LView, TVIEW} from './interfaces/view';\nimport {pureFunction1Internal, pureFunction2Internal, pureFunction3Internal, pureFunction4Internal, pureFunctionVInternal} from './pure_function';\nimport {getBindingRoot, getLView, getTView} from './state';\nimport {load} from './util/view_utils';\n\n\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n *\n * @codeGenApi\n */\nexport function ɵɵpipe(index: number, pipeName: string): any {\n const tView = getTView();\n let pipeDef: PipeDef<any>;\n const adjustedIndex = index + HEADER_OFFSET;\n\n if (tView.firstCreatePass) {\n // The `getPipeDef` throws if a pipe with a given name is not found\n // (so we use non-null assertion below).\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry)!;\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);\n }\n } else {\n pipeDef = tView.data[adjustedIndex] as PipeDef<any>;\n }\n\n const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));\n const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);\n try {\n // DI for pipes is supposed to behave like directives when placed on a component\n // host node, which means that we have to disable access to `viewProviders`.\n const previousIncludeViewProviders = setIncludeViewProviders(false);\n const pipeInstance = pipeFactory();\n setIncludeViewProviders(previousIncludeViewProviders);\n store(tView, getLView(), adjustedIndex, pipeInstance);\n return pipeInstance;\n } finally {\n // we have to restore the injector implementation in finally, just in case the creation of the\n // pipe throws an error.\n setInjectImplementation(previousInjectImplementation);\n }\n}\n\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name: string, registry: PipeDefList|null): PipeDef<any>|undefined {\n if (registry) {\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n if (ngDevMode) {\n throw new RuntimeError(RuntimeErrorCode.PIPE_NOT_FOUND, getPipeNotFoundErrorMessage(name));\n }\n}\n\n/**\n * Generates a helpful error message for the user when a pipe is not found.\n *\n * @param name Name of the missing pipe\n * @returns The error message\n */\nfunction getPipeNotFoundErrorMessage(name: string) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW] as LView<Type<unknown>>;\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `Verify that it is ${\n hostIsStandalone ? 'included in the \\'@Component.imports\\' of this component' :\n 'declared or imported in this module'}`;\n const errorMessage =\n `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nexport function ɵɵpipeBind1(index: number, slotOffset: number, v1: any): any {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load<PipeTransform>(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ?\n pureFunction1Internal(\n lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, pipeInstance) :\n pipeInstance.transform(v1);\n}\n\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nexport function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load<PipeTransform>(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ?\n pureFunction2Internal(\n lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :\n pipeInstance.transform(v1, v2);\n}\n\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nexport function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load<PipeTransform>(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ?\n pureFunction3Internal(\n lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :\n pipeInstance.transform(v1, v2, v3);\n}\n\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nexport function ɵɵpipeBind4(\n index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load<PipeTransform>(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction4Internal(\n lView, getBindingRoot(), slotOffset,\n pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :\n pipeInstance.transform(v1, v2, v3, v4);\n}\n\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n *\n * @codeGenApi\n */\nexport function ɵɵpipeBindV(index: number, slotOffset: number, values: [any, ...any[]]): any {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load<PipeTransform>(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ?\n pureFunctionVInternal(\n lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) :\n pipeInstance.transform.apply(pipeInstance, values);\n}\n\nfunction isPure(lView: LView, index: number): boolean {\n return (<PipeDef<any>>lView[TVIEW].data[index]).pure;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"rxjs\" />\n\nimport {PartialObserver, Subject, Subscription} from 'rxjs';\n\n/**\n * Use in components with the `@Output` directive to emit custom events\n * synchronously or asynchronously, and register handlers for those events\n * by subscribing to an instance.\n *\n * @usageNotes\n *\n * Extends\n * [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject)\n * for Angular by adding the `emit()` method.\n *\n * In the following example, a component defines two output properties\n * that create event emitters. When the title is clicked, the emitter\n * emits an open or close event to toggle the current visibility state.\n *\n * ```html\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * Access the event object with the `$event` argument passed to the output event\n * handler:\n *\n * ```html\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * @see [Observables in Angular](guide/observables-in-angular)\n * @publicApi\n */\nexport interface EventEmitter<T> extends Subject<T> {\n /**\n * @internal\n */\n __isAsync: boolean;\n\n /**\n * Creates an instance of this class that can\n * deliver events synchronously or asynchronously.\n *\n * @param [isAsync=false] When true, deliver events asynchronously.\n *\n */\n new(isAsync?: boolean): EventEmitter<T>;\n\n /**\n * Emits an event containing a given value.\n * @param value The value to emit.\n */\n emit(value?: T): void;\n\n /**\n * Registers handlers for events emitted by this instance.\n * @param next When supplied, a custom handler for emitted events.\n * @param error When supplied, a custom handler for an error notification from this emitter.\n * @param complete When supplied, a custom handler for a completion notification from this\n * emitter.\n */\n subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void):\n Subscription;\n /**\n * Registers handlers for events emitted by this instance.\n * @param observerOrNext When supplied, a custom handler for emitted events, or an observer\n * object.\n * @param error When supplied, a custom handler for an error notification from this emitter.\n * @param complete When supplied, a custom handler for a completion notification from this\n * emitter.\n */\n subscribe(observerOrNext?: any, error?: any, complete?: any): Subscription;\n}\n\nclass EventEmitter_ extends Subject<any> {\n __isAsync: boolean; // tslint:disable-line\n\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n emit(value?: any) {\n super.next(value);\n }\n\n override subscribe(observerOrNext?: any, error?: any, complete?: any): Subscription {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext as PartialObserver<unknown>;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n\n if (this.__isAsync) {\n errorFn = _wrapInTimeout(errorFn);\n\n if (nextFn) {\n nextFn = _wrapInTimeout(nextFn);\n }\n\n if (completeFn) {\n completeFn = _wrapInTimeout(completeFn);\n }\n }\n\n const sink = super.subscribe({next: nextFn, error: errorFn, complete: completeFn});\n\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n\n return sink;\n }\n}\n\nfunction _wrapInTimeout(fn: (value: unknown) => any) {\n return (value: unknown) => {\n setTimeout(fn, undefined, value);\n };\n}\n\n/**\n * @publicApi\n */\nexport const EventEmitter: {\n new (isAsync?: boolean): EventEmitter<any>; new<T>(isAsync?: boolean): EventEmitter<T>;\n readonly prototype: EventEmitter<any>;\n} = EventEmitter_ as any;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {arrayEquals, flatten} from '../util/array_utils';\n\nfunction symbolIterator<T>(this: QueryList<T>): Iterator<T> {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nexport class QueryList<T> implements Iterable<T> {\n public readonly dirty = true;\n private _results: Array<T> = [];\n private _changesDetected: boolean = false;\n private _changes: EventEmitter<QueryList<T>>|null = null;\n\n readonly length: number = 0;\n readonly first: T = undefined!;\n readonly last: T = undefined!;\n\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes(): Observable<any> {\n return this._changes || (this._changes = new EventEmitter());\n }\n\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(private _emitDistinctChangesOnly: boolean = false) {\n // This function should be declared on the prototype, but doing so there will cause the class\n // declaration to have side-effects and become not tree-shakable. For this reason we do it in\n // the constructor.\n // [Symbol.iterator](): Iterator<T> { ... }\n const proto = QueryList.prototype;\n if (!proto[Symbol.iterator]) proto[Symbol.iterator] = symbolIterator;\n }\n\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index: number): T|undefined {\n return this._results[index];\n }\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] {\n return this._results.map(fn);\n }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._results.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._results.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._results.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void {\n this._results.forEach(fn);\n }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._results.some(fn);\n }\n\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray(): T[] {\n return this._results.slice();\n }\n\n toString(): string {\n return this._results.toString();\n }\n\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree: Array<T|any[]>, identityAccessor?: (value: T) => unknown): void {\n // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of\n // QueryList (but not for QueryList itself.)\n const self = this as QueryListInternal<T>;\n (self as {dirty: boolean}).dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {\n self._results = newResultFlat;\n self.length = newResultFlat.length;\n self.last = newResultFlat[this.length - 1];\n self.first = newResultFlat[0];\n }\n }\n\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges(): void {\n if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))\n this._changes.emit(this);\n }\n\n /** internal */\n setDirty() {\n (this as {dirty: boolean}).dirty = true;\n }\n\n /** internal */\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n\n // The implementation of `Symbol.iterator` should be declared here, but this would cause\n // tree-shaking issues with `QueryList. So instead, it's added in the constructor (see comments\n // there) and this declaration is left here to ensure that TypeScript considers QueryList to\n // implement the Iterable interface. This is required for template type-checking of NgFor loops\n // over QueryLists to work correctly, since QueryList must be assignable to NgIterable.\n [Symbol.iterator]!: () => Iterator<T>;\n}\n\n/**\n * Internal set of APIs used by the framework. (not to be made public)\n */\ninterface QueryListInternal<T> extends QueryList<T> {\n reset(a: any[]): void;\n notifyOnChanges(): void;\n length: number;\n last: T;\n first: T;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {assertLContainer} from '../render3/assert';\nimport {createLView, renderView} from '../render3/instructions/shared';\nimport {TContainerNode, TNode, TNodeType} from '../render3/interfaces/node';\nimport {DECLARATION_LCONTAINER, LView, LViewFlags, QUERIES, TView} from '../render3/interfaces/view';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {ViewRef as R3_ViewRef} from '../render3/view_ref';\nimport {assertDefined} from '../util/assert';\n\nimport {createElementRef, ElementRef} from './element_ref';\nimport {EmbeddedViewRef} from './view_ref';\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see `ViewContainerRef`\n * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)\n *\n * @publicApi\n */\nexport abstract class TemplateRef<C> {\n /**\n * The anchor element in the parent view for this embedded view.\n *\n * The data-binding and injection contexts of embedded views created from this `TemplateRef`\n * inherit from the contexts of this location.\n *\n * Typically new embedded views are attached to the view container of this location, but in\n * advanced use-cases, the view can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n // TODO(i): rename to anchor or location\n abstract readonly elementRef: ElementRef;\n\n /**\n * Instantiates an unattached embedded view based on this template.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @param injector Injector to be used within the embedded view.\n * @returns The new embedded view object.\n */\n abstract createEmbeddedView(context: C, injector?: Injector): EmbeddedViewRef<C>;\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: () => TemplateRef<any>| null = injectTemplateRef;\n}\n\nconst ViewEngineTemplateRef = TemplateRef;\n\n// TODO(alxhub): combine interface and implementation. Currently this is challenging since something\n// in g3 depends on them being separate.\nconst R3TemplateRef = class TemplateRef<T> extends ViewEngineTemplateRef<T> {\n constructor(\n private _declarationLView: LView, private _declarationTContainer: TContainerNode,\n public override elementRef: ElementRef) {\n super();\n }\n\n override createEmbeddedView(context: T, injector?: Injector): EmbeddedViewRef<T> {\n const embeddedTView = this._declarationTContainer.tView as TView;\n const embeddedLView = createLView(\n this._declarationLView, embeddedTView, context, LViewFlags.CheckAlways, null,\n embeddedTView.declTNode, null, null, null, null, injector || null);\n\n const declarationLContainer = this._declarationLView[this._declarationTContainer.index];\n ngDevMode && assertLContainer(declarationLContainer);\n embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n\n const declarationViewLQueries = this._declarationLView[QUERIES];\n if (declarationViewLQueries !== null) {\n embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n }\n\n renderView(embeddedTView, embeddedLView, context);\n\n return new R3_ViewRef<T>(embeddedLView);\n }\n};\n\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nexport function injectTemplateRef<T>(): TemplateRef<T>|null {\n return createTemplateRef<T>(getCurrentTNode()!, getLView());\n}\n\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param hostTNode The node on which a TemplateRef is requested\n * @param hostLView The `LView` to which the node belongs\n * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type\n */\nexport function createTemplateRef<T>(hostTNode: TNode, hostLView: LView): TemplateRef<T>|null {\n if (hostTNode.type & TNodeType.Container) {\n ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');\n return new R3TemplateRef(\n hostLView, hostTNode as TContainerNode, createElementRef(hostTNode, hostLView));\n }\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {EnvironmentInjector} from '../di/r3_injector';\nimport {isType, Type} from '../interface/type';\nimport {assertNodeInjector} from '../render3/assert';\nimport {ComponentFactory as R3ComponentFactory} from '../render3/component_ref';\nimport {getComponentDef} from '../render3/definition';\nimport {getParentInjectorLocation, NodeInjector} from '../render3/di';\nimport {addToViewTree, createLContainer} from '../render3/instructions/shared';\nimport {CONTAINER_HEADER_OFFSET, LContainer, NATIVE, VIEW_REFS} from '../render3/interfaces/container';\nimport {NodeInjectorOffset} from '../render3/interfaces/injector';\nimport {TContainerNode, TDirectiveHostNode, TElementContainerNode, TElementNode, TNodeType} from '../render3/interfaces/node';\nimport {RComment, RElement} from '../render3/interfaces/renderer_dom';\nimport {isLContainer} from '../render3/interfaces/type_checks';\nimport {LView, PARENT, RENDERER, T_HOST, TVIEW} from '../render3/interfaces/view';\nimport {assertTNodeType} from '../render3/node_assert';\nimport {addViewToContainer, destroyLView, detachView, getBeforeNodeForView, insertView, nativeInsertBefore, nativeNextSibling, nativeParentNode} from '../render3/node_manipulation';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {getParentInjectorIndex, getParentInjectorView, hasParentInjector} from '../render3/util/injector_utils';\nimport {getNativeByTNode, unwrapRNode, viewAttachedToContainer} from '../render3/util/view_utils';\nimport {ViewRef as R3ViewRef} from '../render3/view_ref';\nimport {addToArray, removeFromArray} from '../util/array_utils';\nimport {assertDefined, assertEqual, assertGreaterThan, assertLessThan, throwError} from '../util/assert';\n\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {createElementRef, ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {TemplateRef} from './template_ref';\nimport {EmbeddedViewRef, ViewRef} from './view_ref';\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a [view hierarchy](guide/glossary#view-tree).\n *\n * @see `ComponentRef`\n * @see `EmbeddedViewRef`\n *\n * @publicApi\n */\nexport abstract class ViewContainerRef {\n /**\n * Anchor element that specifies the location of this container in the containing view.\n * Each view container can have only one anchor element, and each anchor element\n * can have only a single view container.\n *\n * Root elements of views attached to this container become siblings of the anchor element in\n * the rendered view.\n *\n * Access the `ViewContainerRef` of an element by placing a `Directive` injected\n * with `ViewContainerRef` on the element, or use a `ViewChild` query.\n *\n * <!-- TODO: rename to anchorElement -->\n */\n abstract get element(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this view container.\n */\n abstract get injector(): Injector;\n\n /** @deprecated No replacement */\n abstract get parentInjector(): Injector;\n\n /**\n * Destroys all views in this container.\n */\n abstract clear(): void;\n\n /**\n * Retrieves a view from this container.\n * @param index The 0-based index of the view to retrieve.\n * @returns The `ViewRef` instance, or null if the index is out of range.\n */\n abstract get(index: number): ViewRef|null;\n\n /**\n * Reports how many views are currently attached to this container.\n * @returns The number of views.\n */\n abstract get length(): number;\n\n /**\n * Instantiates an embedded view and inserts it\n * into this container.\n * @param templateRef The HTML template that defines the view.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @param options Extra configuration for the created view. Includes:\n * * index: The 0-based index at which to insert the new view into this container.\n * If not specified, appends the new view as the last entry.\n * * injector: Injector to be used within the embedded view.\n *\n * @returns The `ViewRef` instance for the newly created view.\n */\n abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, options?: {\n index?: number,\n injector?: Injector\n }): EmbeddedViewRef<C>;\n\n /**\n * Instantiates an embedded view and inserts it\n * into this container.\n * @param templateRef The HTML template that defines the view.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @param index The 0-based index at which to insert the new view into this container.\n * If not specified, appends the new view as the last entry.\n *\n * @returns The `ViewRef` instance for the newly created view.\n */\n abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C>;\n\n /**\n * Instantiates a single component and inserts its host view into this container.\n *\n * @param componentType Component Type to use.\n * @param options An object that contains extra parameters:\n * * index: the index at which to insert the new component's host view into this container.\n * If not specified, appends the new view as the last entry.\n * * injector: the injector to use as the parent for the new component.\n * * ngModuleRef: an NgModuleRef of the component's NgModule, you should almost always provide\n * this to ensure that all expected providers are available for the component\n * instantiation.\n * * environmentInjector: an EnvironmentInjector which will provide the component's environment.\n * you should almost always provide this to ensure that all expected providers\n * are available for the component instantiation. This option is intended to\n * replace the `ngModuleRef` parameter.\n * * projectableNodes: list of DOM nodes that should be projected through\n * [`<ng-content>`](api/core/ng-content) of the new component instance.\n *\n * @returns The new `ComponentRef` which contains the component instance and the host view.\n */\n abstract createComponent<C>(componentType: Type<C>, options?: {\n index?: number,\n injector?: Injector,\n ngModuleRef?: NgModuleRef<unknown>,\n environmentInjector?: EnvironmentInjector|NgModuleRef<unknown>,\n projectableNodes?: Node[][],\n }): ComponentRef<C>;\n\n /**\n * Instantiates a single component and inserts its host view into this container.\n *\n * @param componentFactory Component factory to use.\n * @param index The index at which to insert the new component's host view into this container.\n * If not specified, appends the new view as the last entry.\n * @param injector The injector to use as the parent for the new component.\n * @param projectableNodes List of DOM nodes that should be projected through\n * [`<ng-content>`](api/core/ng-content) of the new component instance.\n * @param ngModuleRef An instance of the NgModuleRef that represent an NgModule.\n * This information is used to retrieve corresponding NgModule injector.\n *\n * @returns The new `ComponentRef` which contains the component instance and the host view.\n *\n * @deprecated Angular no longer requires component factories to dynamically create components.\n * Use different signature of the `createComponent` method, which allows passing\n * Component class directly.\n */\n abstract createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][],\n environmentInjector?: EnvironmentInjector|NgModuleRef<any>): ComponentRef<C>;\n\n /**\n * Inserts a view into this container.\n * @param viewRef The view to insert.\n * @param index The 0-based index at which to insert the view.\n * If not specified, appends the new view as the last entry.\n * @returns The inserted `ViewRef` instance.\n *\n */\n abstract insert(viewRef: ViewRef, index?: number): ViewRef;\n\n /**\n * Moves a view to a new location in this container.\n * @param viewRef The view to move.\n * @param index The 0-based index of the new location.\n * @returns The moved `ViewRef` instance.\n */\n abstract move(viewRef: ViewRef, currentIndex: number): ViewRef;\n\n /**\n * Returns the index of a view within the current container.\n * @param viewRef The view to query.\n * @returns The 0-based index of the view's position in this container,\n * or `-1` if this container doesn't contain the view.\n */\n abstract indexOf(viewRef: ViewRef): number;\n\n /**\n * Destroys a view attached to this container\n * @param index The 0-based index of the view to destroy.\n * If not specified, the last view in the container is removed.\n */\n abstract remove(index?: number): void;\n\n /**\n * Detaches a view from this container without destroying it.\n * Use along with `insert()` to move a view within the current container.\n * @param index The 0-based index of the view to detach.\n * If not specified, the last view in the container is detached.\n */\n abstract detach(index?: number): ViewRef|null;\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: () => ViewContainerRef = injectViewContainerRef;\n}\n\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nexport function injectViewContainerRef(): ViewContainerRef {\n const previousTNode = getCurrentTNode() as TElementNode | TElementContainerNode | TContainerNode;\n return createContainerRef(previousTNode, getLView());\n}\n\nconst VE_ViewContainerRef = ViewContainerRef;\n\n// TODO(alxhub): cleaning up this indirection triggers a subtle bug in Closure in g3. Once the fix\n// for that lands, this can be cleaned up.\nconst R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {\n constructor(\n private _lContainer: LContainer,\n private _hostTNode: TElementNode|TContainerNode|TElementContainerNode,\n private _hostLView: LView) {\n super();\n }\n\n override get element(): ElementRef {\n return createElementRef(this._hostTNode, this._hostLView);\n }\n\n override get injector(): Injector {\n return new NodeInjector(this._hostTNode, this._hostLView);\n }\n\n /** @deprecated No replacement */\n override get parentInjector(): Injector {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);\n if (hasParentInjector(parentLocation)) {\n const parentView = getParentInjectorView(parentLocation, this._hostLView);\n const injectorIndex = getParentInjectorIndex(parentLocation);\n ngDevMode && assertNodeInjector(parentView, injectorIndex);\n const parentTNode =\n parentView[TVIEW].data[injectorIndex + NodeInjectorOffset.TNODE] as TElementNode;\n return new NodeInjector(parentTNode, parentView);\n } else {\n return new NodeInjector(null, this._hostLView);\n }\n }\n\n override clear(): void {\n while (this.length > 0) {\n this.remove(this.length - 1);\n }\n }\n\n override get(index: number): ViewRef|null {\n const viewRefs = getViewRefs(this._lContainer);\n return viewRefs !== null && viewRefs[index] || null;\n }\n\n override get length(): number {\n return this._lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n\n override createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, options?: {\n index?: number,\n injector?: Injector\n }): EmbeddedViewRef<C>;\n override createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C>;\n override createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, indexOrOptions?: number|{\n index?: number,\n injector?: Injector\n }): EmbeddedViewRef<C> {\n let index: number|undefined;\n let injector: Injector|undefined;\n\n if (typeof indexOrOptions === 'number') {\n index = indexOrOptions;\n } else if (indexOrOptions != null) {\n index = indexOrOptions.index;\n injector = indexOrOptions.injector;\n }\n\n const viewRef = templateRef.createEmbeddedView(context || <any>{}, injector);\n this.insert(viewRef, index);\n return viewRef;\n }\n\n override createComponent<C>(componentType: Type<C>, options?: {\n index?: number,\n injector?: Injector,\n projectableNodes?: Node[][],\n ngModuleRef?: NgModuleRef<unknown>,\n }): ComponentRef<C>;\n /**\n * @deprecated Angular no longer requires component factories to dynamically create components.\n * Use different signature of the `createComponent` method, which allows passing\n * Component class directly.\n */\n override createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number|undefined,\n injector?: Injector|undefined, projectableNodes?: any[][]|undefined,\n environmentInjector?: EnvironmentInjector|NgModuleRef<any>|undefined): ComponentRef<C>;\n override createComponent<C>(\n componentFactoryOrType: ComponentFactory<C>|Type<C>, indexOrOptions?: number|undefined|{\n index?: number,\n injector?: Injector,\n ngModuleRef?: NgModuleRef<unknown>,\n environmentInjector?: EnvironmentInjector|NgModuleRef<unknown>,\n projectableNodes?: Node[][],\n },\n injector?: Injector|undefined, projectableNodes?: any[][]|undefined,\n environmentInjector?: EnvironmentInjector|NgModuleRef<any>|undefined): ComponentRef<C> {\n const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);\n let index: number|undefined;\n\n // This function supports 2 signatures and we need to handle options correctly for both:\n // 1. When first argument is a Component type. This signature also requires extra\n // options to be provided as as object (more ergonomic option).\n // 2. First argument is a Component factory. In this case extra options are represented as\n // positional arguments. This signature is less ergonomic and will be deprecated.\n if (isComponentFactory) {\n if (ngDevMode) {\n assertEqual(\n typeof indexOrOptions !== 'object', true,\n 'It looks like Component factory was provided as the first argument ' +\n 'and an options object as the second argument. This combination of arguments ' +\n 'is incompatible. You can either change the first argument to provide Component ' +\n 'type or change the second argument to be a number (representing an index at ' +\n 'which to insert the new component\\'s host view into this container)');\n }\n index = indexOrOptions as number | undefined;\n } else {\n if (ngDevMode) {\n assertDefined(\n getComponentDef(componentFactoryOrType),\n `Provided Component class doesn't contain Component definition. ` +\n `Please check whether provided class has @Component decorator.`);\n assertEqual(\n typeof indexOrOptions !== 'number', true,\n 'It looks like Component type was provided as the first argument ' +\n 'and a number (representing an index at which to insert the new component\\'s ' +\n 'host view into this container as the second argument. This combination of arguments ' +\n 'is incompatible. Please use an object as the second argument instead.');\n }\n const options = (indexOrOptions || {}) as {\n index?: number,\n injector?: Injector,\n ngModuleRef?: NgModuleRef<unknown>,\n environmentInjector?: EnvironmentInjector | NgModuleRef<unknown>,\n projectableNodes?: Node[][],\n };\n if (ngDevMode && options.environmentInjector && options.ngModuleRef) {\n throwError(\n `Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);\n }\n index = options.index;\n injector = options.injector;\n projectableNodes = options.projectableNodes;\n environmentInjector = options.environmentInjector || options.ngModuleRef;\n }\n\n const componentFactory: ComponentFactory<C> = isComponentFactory ?\n componentFactoryOrType as ComponentFactory<C>:\n new R3ComponentFactory(getComponentDef(componentFactoryOrType)!);\n const contextInjector = injector || this.parentInjector;\n\n // If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.\n if (!environmentInjector && (componentFactory as any).ngModule == null) {\n // For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that\n // an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an\n // `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based\n // use-cases. For the `ComponentFactory` case we preserve backwards-compatibility and try\n // using a provided injector first, then fall back to the parent injector of this\n // `ViewContainerRef` instance.\n //\n // For the factory-less case, it's critical to establish a connection with the module\n // injector tree (by retrieving an instance of an `NgModuleRef` and accessing its injector),\n // so that a component can use DI tokens provided in MgModules. For this reason, we can not\n // rely on the provided injector, since it might be detached from the DI tree (for example, if\n // it was created via `Injector.create` without specifying a parent injector, or if an\n // injector is retrieved from an `NgModuleRef` created via `createNgModule` using an\n // NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent\n // injector, which is normally connected to the DI tree, which includes module injector\n // subtree.\n const _injector = isComponentFactory ? contextInjector : this.parentInjector;\n\n // DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||\n // undefined` expression which seems to cause internal google apps to fail. This is documented\n // in the following internal bug issue: go/b/142967802\n const result = _injector.get(EnvironmentInjector, null);\n if (result) {\n environmentInjector = result;\n }\n }\n\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, environmentInjector);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n override insert(viewRef: ViewRef, index?: number): ViewRef {\n const lView = (viewRef as R3ViewRef<any>)._lView!;\n const tView = lView[TVIEW];\n\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n\n if (viewAttachedToContainer(lView)) {\n // If view is already attached, detach it first so we clean up references appropriately.\n\n const prevIdx = this.indexOf(viewRef);\n\n // A view might be attached either to this or a different container. The `prevIdx` for\n // those cases will be:\n // equal to -1 for views attached to this ViewContainerRef\n // >= 0 for views attached to a different ViewContainerRef\n if (prevIdx !== -1) {\n this.detach(prevIdx);\n } else {\n const prevLContainer = lView[PARENT] as LContainer;\n ngDevMode &&\n assertEqual(\n isLContainer(prevLContainer), true,\n 'An attached view should have its PARENT point to a container.');\n\n\n // We need to re-create a R3ViewContainerRef instance since those are not stored on\n // LView (nor anywhere else).\n const prevVCRef = new R3ViewContainerRef(\n prevLContainer, prevLContainer[T_HOST] as TDirectiveHostNode, prevLContainer[PARENT]);\n\n prevVCRef.detach(prevVCRef.indexOf(viewRef));\n }\n }\n\n // Logical operation of adding `LView` to `LContainer`\n const adjustedIdx = this._adjustIndex(index);\n const lContainer = this._lContainer;\n insertView(tView, lView, lContainer, adjustedIdx);\n\n // Physical operation of adding the DOM nodes.\n const beforeNode = getBeforeNodeForView(adjustedIdx, lContainer);\n const renderer = lView[RENDERER];\n const parentRNode = nativeParentNode(renderer, lContainer[NATIVE] as RElement | RComment);\n if (parentRNode !== null) {\n addViewToContainer(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n }\n\n (viewRef as R3ViewRef<any>).attachToViewContainerRef();\n addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);\n\n return viewRef;\n }\n\n override move(viewRef: ViewRef, newIndex: number): ViewRef {\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n return this.insert(viewRef, newIndex);\n }\n\n override indexOf(viewRef: ViewRef): number {\n const viewRefsArr = getViewRefs(this._lContainer);\n return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;\n }\n\n override remove(index?: number): void {\n const adjustedIdx = this._adjustIndex(index, -1);\n const detachedView = detachView(this._lContainer, adjustedIdx);\n\n if (detachedView) {\n // Before destroying the view, remove it from the container's array of `ViewRef`s.\n // This ensures the view container length is updated before calling\n // `destroyLView`, which could recursively call view container methods that\n // rely on an accurate container length.\n // (e.g. a method on this view container being called by a child directive's OnDestroy\n // lifecycle hook)\n removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);\n destroyLView(detachedView[TVIEW], detachedView);\n }\n }\n\n override detach(index?: number): ViewRef|null {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx);\n\n const wasDetached =\n view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;\n return wasDetached ? new R3ViewRef(view!) : null;\n }\n\n private _adjustIndex(index?: number, shift: number = 0) {\n if (index == null) {\n return this.length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this.length + 1 + shift, 'index');\n }\n return index;\n }\n};\n\nfunction getViewRefs(lContainer: LContainer): ViewRef[]|null {\n return lContainer[VIEW_REFS] as ViewRef[];\n}\n\nfunction getOrCreateViewRefs(lContainer: LContainer): ViewRef[] {\n return (lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = [])) as ViewRef[];\n}\n\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param ViewContainerRefToken The ViewContainerRef type\n * @param ElementRefToken The ElementRef type\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostLView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nexport function createContainerRef(\n hostTNode: TElementNode|TContainerNode|TElementContainerNode,\n hostLView: LView): ViewContainerRef {\n ngDevMode && assertTNodeType(hostTNode, TNodeType.AnyContainer | TNodeType.AnyRNode);\n\n let lContainer: LContainer;\n const slotValue = hostLView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n } else {\n let commentNode: RComment;\n // If the host is an element container, the native host element is guaranteed to be a\n // comment and we can reuse that comment as anchor element for the new LContainer.\n // The comment node in question is already part of the DOM structure so we don't need to append\n // it again.\n if (hostTNode.type & TNodeType.ElementContainer) {\n commentNode = unwrapRNode(slotValue) as RComment;\n } else {\n // If the host is a regular element, we have to insert a comment node manually which will\n // be used as an anchor when inserting elements. In this specific case we use low-level DOM\n // manipulation to insert it.\n const renderer = hostLView[RENDERER];\n ngDevMode && ngDevMode.rendererCreateComment++;\n commentNode = renderer.createComment(ngDevMode ? 'container' : '');\n\n const hostNative = getNativeByTNode(hostTNode, hostLView)!;\n const parentOfHostNative = nativeParentNode(renderer, hostNative);\n nativeInsertBefore(\n renderer, parentOfHostNative!, commentNode, nativeNextSibling(renderer, hostNative),\n false);\n }\n\n hostLView[hostTNode.index] = lContainer =\n createLContainer(slotValue, hostLView, commentNode, hostTNode);\n\n addToViewTree(hostLView, lContainer);\n }\n\n return new R3ViewContainerRef(lContainer, hostTNode, hostLView);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine_from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\n\nimport {ProviderToken} from '../di/provider_token';\nimport {createElementRef, ElementRef as ViewEngine_ElementRef, unwrapElementRef} from '../linker/element_ref';\nimport {QueryList} from '../linker/query_list';\nimport {createTemplateRef, TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\nimport {createContainerRef, ViewContainerRef} from '../linker/view_container_ref';\nimport {assertDefined, assertIndexInRange, assertNumber, throwError} from '../util/assert';\nimport {stringify} from '../util/stringify';\n\nimport {assertFirstCreatePass, assertLContainer} from './assert';\nimport {getNodeInjectable, locateDirectiveOrProvider} from './di';\nimport {storeCleanupWithContext} from './instructions/shared';\nimport {CONTAINER_HEADER_OFFSET, LContainer, MOVED_VIEWS} from './interfaces/container';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType} from './interfaces/node';\nimport {LQueries, LQuery, QueryFlags, TQueries, TQuery, TQueryMetadata} from './interfaces/query';\nimport {DECLARATION_LCONTAINER, LView, PARENT, QUERIES, TVIEW, TView} from './interfaces/view';\nimport {assertTNodeType} from './node_assert';\nimport {getCurrentQueryIndex, getCurrentTNode, getLView, getTView, setCurrentQueryIndex} from './state';\nimport {isCreationMode} from './util/view_utils';\n\nclass LQuery_<T> implements LQuery<T> {\n matches: (T|null)[]|null = null;\n constructor(public queryList: QueryList<T>) {}\n clone(): LQuery<T> {\n return new LQuery_(this.queryList);\n }\n setDirty(): void {\n this.queryList.setDirty();\n }\n}\n\nclass LQueries_ implements LQueries {\n constructor(public queries: LQuery<any>[] = []) {}\n\n createEmbeddedView(tView: TView): LQueries|null {\n const tQueries = tView.queries;\n if (tQueries !== null) {\n const noOfInheritedQueries =\n tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;\n const viewLQueries: LQuery<any>[] = [];\n\n // An embedded view has queries propagated from a declaration view at the beginning of the\n // TQueries collection and up until a first content query declared in the embedded view. Only\n // propagated LQueries are created at this point (LQuery corresponding to declared content\n // queries will be instantiated from the content query instructions for each directive).\n for (let i = 0; i < noOfInheritedQueries; i++) {\n const tQuery = tQueries.getByIndex(i);\n const parentLQuery = this.queries[tQuery.indexInDeclarationView];\n viewLQueries.push(parentLQuery.clone());\n }\n\n return new LQueries_(viewLQueries);\n }\n\n return null;\n }\n\n insertView(tView: TView): void {\n this.dirtyQueriesWithMatches(tView);\n }\n\n detachView(tView: TView): void {\n this.dirtyQueriesWithMatches(tView);\n }\n\n private dirtyQueriesWithMatches(tView: TView) {\n for (let i = 0; i < this.queries.length; i++) {\n if (getTQuery(tView, i).matches !== null) {\n this.queries[i].setDirty();\n }\n }\n }\n}\n\nclass TQueryMetadata_ implements TQueryMetadata {\n constructor(\n public predicate: ProviderToken<unknown>|string[], public flags: QueryFlags,\n public read: any = null) {}\n}\n\nclass TQueries_ implements TQueries {\n constructor(private queries: TQuery[] = []) {}\n\n elementStart(tView: TView, tNode: TNode): void {\n ngDevMode &&\n assertFirstCreatePass(\n tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementStart(tView, tNode);\n }\n }\n elementEnd(tNode: TNode): void {\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementEnd(tNode);\n }\n }\n embeddedTView(tNode: TNode): TQueries|null {\n let queriesForTemplateRef: TQuery[]|null = null;\n\n for (let i = 0; i < this.length; i++) {\n const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;\n const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);\n\n if (tqueryClone) {\n tqueryClone.indexInDeclarationView = i;\n if (queriesForTemplateRef !== null) {\n queriesForTemplateRef.push(tqueryClone);\n } else {\n queriesForTemplateRef = [tqueryClone];\n }\n }\n }\n\n return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null;\n }\n\n template(tView: TView, tNode: TNode): void {\n ngDevMode &&\n assertFirstCreatePass(\n tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].template(tView, tNode);\n }\n }\n\n getByIndex(index: number): TQuery {\n ngDevMode && assertIndexInRange(this.queries, index);\n return this.queries[index];\n }\n\n get length(): number {\n return this.queries.length;\n }\n\n track(tquery: TQuery): void {\n this.queries.push(tquery);\n }\n}\n\nclass TQuery_ implements TQuery {\n matches: number[]|null = null;\n indexInDeclarationView = -1;\n crossesNgTemplate = false;\n\n /**\n * A node index on which a query was declared (-1 for view queries and ones inherited from the\n * declaration template). We use this index (alongside with _appliesToNextNode flag) to know\n * when to apply content queries to elements in a template.\n */\n private _declarationNodeIndex: number;\n\n /**\n * A flag indicating if a given query still applies to nodes it is crossing. We use this flag\n * (alongside with _declarationNodeIndex) to know when to stop applying content queries to\n * elements in a template.\n */\n private _appliesToNextNode = true;\n\n constructor(public metadata: TQueryMetadata, nodeIndex: number = -1) {\n this._declarationNodeIndex = nodeIndex;\n }\n\n elementStart(tView: TView, tNode: TNode): void {\n if (this.isApplyingToNode(tNode)) {\n this.matchTNode(tView, tNode);\n }\n }\n\n elementEnd(tNode: TNode): void {\n if (this._declarationNodeIndex === tNode.index) {\n this._appliesToNextNode = false;\n }\n }\n\n template(tView: TView, tNode: TNode): void {\n this.elementStart(tView, tNode);\n }\n\n embeddedTView(tNode: TNode, childQueryIndex: number): TQuery|null {\n if (this.isApplyingToNode(tNode)) {\n this.crossesNgTemplate = true;\n // A marker indicating a `<ng-template>` element (a placeholder for query results from\n // embedded views created based on this `<ng-template>`).\n this.addMatch(-tNode.index, childQueryIndex);\n return new TQuery_(this.metadata);\n }\n return null;\n }\n\n private isApplyingToNode(tNode: TNode): boolean {\n if (this._appliesToNextNode &&\n (this.metadata.flags & QueryFlags.descendants) !== QueryFlags.descendants) {\n const declarationNodeIdx = this._declarationNodeIndex;\n let parent = tNode.parent;\n // Determine if a given TNode is a \"direct\" child of a node on which a content query was\n // declared (only direct children of query's host node can match with the descendants: false\n // option). There are 3 main use-case / conditions to consider here:\n // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query\n // host node;\n // - <needs-target><ng-template [ngIf]=\"true\"><i #target></i></ng-template></needs-target>:\n // here <i #target> parent node is null;\n // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need\n // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse\n // up past the query's host node!).\n while (parent !== null && (parent.type & TNodeType.ElementContainer) &&\n parent.index !== declarationNodeIdx) {\n parent = parent.parent;\n }\n return declarationNodeIdx === (parent !== null ? parent.index : -1);\n }\n return this._appliesToNextNode;\n }\n\n private matchTNode(tView: TView, tNode: TNode): void {\n const predicate = this.metadata.predicate;\n if (Array.isArray(predicate)) {\n for (let i = 0; i < predicate.length; i++) {\n const name = predicate[i];\n this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));\n // Also try matching the name to a provider since strings can be used as DI tokens too.\n this.matchTNodeWithReadOption(\n tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));\n }\n } else {\n if ((predicate as any) === ViewEngine_TemplateRef) {\n if (tNode.type & TNodeType.Container) {\n this.matchTNodeWithReadOption(tView, tNode, -1);\n }\n } else {\n this.matchTNodeWithReadOption(\n tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));\n }\n }\n }\n\n private matchTNodeWithReadOption(tView: TView, tNode: TNode, nodeMatchIdx: number|null): void {\n if (nodeMatchIdx !== null) {\n const read = this.metadata.read;\n if (read !== null) {\n if (read === ViewEngine_ElementRef || read === ViewContainerRef ||\n read === ViewEngine_TemplateRef && (tNode.type & TNodeType.Container)) {\n this.addMatch(tNode.index, -2);\n } else {\n const directiveOrProviderIdx =\n locateDirectiveOrProvider(tNode, tView, read, false, false);\n if (directiveOrProviderIdx !== null) {\n this.addMatch(tNode.index, directiveOrProviderIdx);\n }\n }\n } else {\n this.addMatch(tNode.index, nodeMatchIdx);\n }\n }\n }\n\n private addMatch(tNodeIdx: number, matchIdx: number) {\n if (this.matches === null) {\n this.matches = [tNodeIdx, matchIdx];\n } else {\n this.matches.push(tNodeIdx, matchIdx);\n }\n }\n}\n\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode: TNode, selector: string): number|null {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1] as number;\n }\n }\n }\n return null;\n}\n\n\nfunction createResultByTNodeType(tNode: TNode, currentView: LView): any {\n if (tNode.type & (TNodeType.AnyRNode | TNodeType.ElementContainer)) {\n return createElementRef(tNode, currentView);\n } else if (tNode.type & TNodeType.Container) {\n return createTemplateRef(tNode, currentView);\n }\n return null;\n}\n\n\nfunction createResultForNode(lView: LView, tNode: TNode, matchingIdx: number, read: any): any {\n if (matchingIdx === -1) {\n // if read token and / or strategy is not specified, detect it using appropriate tNode type\n return createResultByTNodeType(tNode, lView);\n } else if (matchingIdx === -2) {\n // read a special token from a node injector\n return createSpecialToken(lView, tNode, read);\n } else {\n // read a token\n return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode as TElementNode);\n }\n}\n\nfunction createSpecialToken(lView: LView, tNode: TNode, read: any): any {\n if (read === ViewEngine_ElementRef) {\n return createElementRef(tNode, lView);\n } else if (read === ViewEngine_TemplateRef) {\n return createTemplateRef(tNode, lView);\n } else if (read === ViewContainerRef) {\n ngDevMode && assertTNodeType(tNode, TNodeType.AnyRNode | TNodeType.AnyContainer);\n return createContainerRef(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView);\n } else {\n ngDevMode &&\n throwError(\n `Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${\n stringify(read)}.`);\n }\n}\n\n/**\n * A helper function that creates query results for a given view. This function is meant to do the\n * processing once and only once for a given view instance (a set of results for a given view\n * doesn't change).\n */\nfunction materializeViewResults<T>(\n tView: TView, lView: LView, tQuery: TQuery, queryIndex: number): (T|null)[] {\n const lQuery = lView[QUERIES]!.queries![queryIndex];\n if (lQuery.matches === null) {\n const tViewData = tView.data;\n const tQueryMatches = tQuery.matches!;\n const result: T|null[] = [];\n for (let i = 0; i < tQueryMatches.length; i += 2) {\n const matchedNodeIdx = tQueryMatches[i];\n if (matchedNodeIdx < 0) {\n // we at the <ng-template> marker which might have results in views created based on this\n // <ng-template> - those results will be in separate views though, so here we just leave\n // null as a placeholder\n result.push(null);\n } else {\n ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);\n const tNode = tViewData[matchedNodeIdx] as TNode;\n result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));\n }\n }\n lQuery.matches = result;\n }\n\n return lQuery.matches;\n}\n\n/**\n * A helper function that collects (already materialized) query results from a tree of views,\n * starting with a provided LView.\n */\nfunction collectQueryResults<T>(tView: TView, lView: LView, queryIndex: number, result: T[]): T[] {\n const tQuery = tView.queries!.getByIndex(queryIndex);\n const tQueryMatches = tQuery.matches;\n if (tQueryMatches !== null) {\n const lViewResults = materializeViewResults<T>(tView, lView, tQuery, queryIndex);\n\n for (let i = 0; i < tQueryMatches.length; i += 2) {\n const tNodeIdx = tQueryMatches[i];\n if (tNodeIdx > 0) {\n result.push(lViewResults[i / 2] as T);\n } else {\n const childQueryIndex = tQueryMatches[i + 1];\n\n const declarationLContainer = lView[-tNodeIdx] as LContainer;\n ngDevMode && assertLContainer(declarationLContainer);\n\n // collect matches for views inserted in this container\n for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) {\n const embeddedLView = declarationLContainer[i];\n if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n\n // collect matches for views created from this declaration container and inserted into\n // different containers\n if (declarationLContainer[MOVED_VIEWS] !== null) {\n const embeddedLViews = declarationLContainer[MOVED_VIEWS]!;\n for (let i = 0; i < embeddedLViews.length; i++) {\n const embeddedLView = embeddedLViews[i];\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n }\n }\n }\n return result;\n}\n\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n *\n * @returns `true` if a query got dirty during change detection or if this is a static query\n * resolving in creation mode, `false` otherwise.\n *\n * @codeGenApi\n */\nexport function ɵɵqueryRefresh(queryList: QueryList<any>): boolean {\n const lView = getLView();\n const tView = getTView();\n const queryIndex = getCurrentQueryIndex();\n\n setCurrentQueryIndex(queryIndex + 1);\n\n const tQuery = getTQuery(tView, queryIndex);\n if (queryList.dirty &&\n (isCreationMode(lView) ===\n ((tQuery.metadata.flags & QueryFlags.isStatic) === QueryFlags.isStatic))) {\n if (tQuery.matches === null) {\n queryList.reset([]);\n } else {\n const result = tQuery.crossesNgTemplate ?\n collectQueryResults(tView, lView, queryIndex, []) :\n materializeViewResults(tView, lView, tQuery, queryIndex);\n queryList.reset(result, unwrapElementRef);\n queryList.notifyOnChanges();\n }\n return true;\n }\n\n return false;\n}\n\n/**\n * Creates new QueryList, stores the reference in LView and returns QueryList.\n *\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nexport function ɵɵviewQuery<T>(\n predicate: ProviderToken<unknown>|string[], flags: QueryFlags, read?: any): void {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);\n if ((flags & QueryFlags.isStatic) === QueryFlags.isStatic) {\n tView.staticViewQueries = true;\n }\n }\n createLQuery<T>(tView, getLView(), flags);\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n *\n * @param directiveIndex Current directive index\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n * @returns QueryList<T>\n *\n * @codeGenApi\n */\nexport function ɵɵcontentQuery<T>(\n directiveIndex: number, predicate: ProviderToken<unknown>|string[], flags: QueryFlags,\n read?: any): void {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n const tNode = getCurrentTNode()!;\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);\n saveContentQueryAndDirectiveIndex(tView, directiveIndex);\n if ((flags & QueryFlags.isStatic) === QueryFlags.isStatic) {\n tView.staticContentQueries = true;\n }\n }\n\n createLQuery<T>(tView, getLView(), flags);\n}\n\n/**\n * Loads a QueryList corresponding to the current view or content query.\n *\n * @codeGenApi\n */\nexport function ɵɵloadQuery<T>(): QueryList<T> {\n return loadQueryInternal<T>(getLView(), getCurrentQueryIndex());\n}\n\nfunction loadQueryInternal<T>(lView: LView, queryIndex: number): QueryList<T> {\n ngDevMode &&\n assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');\n ngDevMode && assertIndexInRange(lView[QUERIES]!.queries, queryIndex);\n return lView[QUERIES]!.queries[queryIndex].queryList;\n}\n\nfunction createLQuery<T>(tView: TView, lView: LView, flags: QueryFlags) {\n const queryList = new QueryList<T>(\n (flags & QueryFlags.emitDistinctChangesOnly) === QueryFlags.emitDistinctChangesOnly);\n storeCleanupWithContext(tView, lView, queryList, queryList.destroy);\n\n if (lView[QUERIES] === null) lView[QUERIES] = new LQueries_();\n lView[QUERIES]!.queries.push(new LQuery_(queryList));\n}\n\nfunction createTQuery(tView: TView, metadata: TQueryMetadata, nodeIndex: number): void {\n if (tView.queries === null) tView.queries = new TQueries_();\n tView.queries.track(new TQuery_(metadata, nodeIndex));\n}\n\nfunction saveContentQueryAndDirectiveIndex(tView: TView, directiveIndex: number) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex =\n tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1;\n if (directiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(tView.queries!.length - 1, directiveIndex);\n }\n}\n\nfunction getTQuery(tView: TView, index: number): TQuery {\n ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');\n return tView.queries!.getByIndex(index);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {createTemplateRef, TemplateRef} from '../linker/template_ref';\nimport {TNode} from './interfaces/node';\nimport {LView} from './interfaces/view';\n\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n *\n * @codeGenApi\n */\nexport function ɵɵtemplateRefExtractor(tNode: TNode, lView: LView): TemplateRef<any>|null {\n return createTemplateRef(tNode, lView);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function noop(...args: any[]): any {\n // Do nothing.\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/*\n * This file exists to support compilation of @angular/core in Ivy mode.\n *\n * When the Angular compiler processes a compilation unit, it normally writes imports to\n * @angular/core. When compiling the core package itself this strategy isn't usable. Instead, the\n * compiler writes imports to this file.\n *\n * Only a subset of such imports are supported - core is not allowed to declare components or pipes.\n * A check in ngtsc's `R3SymbolsImportRewriter` validates this condition. The rewriter is only used\n * when compiling @angular/core and is responsible for translating an external name (prefixed with\n * ɵ) to the internal symbol name as exported below.\n *\n * The below symbols are used for @Injectable and @NgModule compilation.\n */\n\nexport {ɵɵinject} from './di/injector_compatibility';\nexport {ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵInjectableDeclaration} from './di/interface/defs';\nexport {NgModuleDef} from './metadata/ng_module_def';\nexport {ɵɵdefineNgModule} from './render3/definition';\nexport {ɵɵFactoryDeclaration, ɵɵInjectorDeclaration, ɵɵNgModuleDeclaration} from './render3/interfaces/public_definitions';\nexport {setClassMetadata} from './render3/metadata';\nexport {NgModuleFactory} from './render3/ng_module_ref';\nexport {noSideEffects as ɵnoSideEffects} from './util/closure';\n\n\n\n/**\n * The existence of this constant (in this particular file) informs the Angular compiler that the\n * current program is actually @angular/core, which needs to be compiled specially.\n */\nexport const ITS_JUST_ANGULAR = true;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {Inject, Injectable, InjectionToken, Optional} from './di';\nimport {isObservable, isPromise} from './util/lang';\nimport {noop} from './util/noop';\n\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") that you can use to provide\n * one or more initialization functions.\n *\n * The provided functions are injected at application startup and executed during\n * app initialization. If any of these functions returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a factory function that loads language data\n * or an external configuration, and provide that function to the `APP_INITIALIZER` token.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * @see `ApplicationInitStatus`\n *\n * @usageNotes\n *\n * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token\n * and a function returning a promise.\n *\n * ```\n * function initializeApp(): Promise<any> {\n * return new Promise((resolve, reject) => {\n * // Do some asynchronous stuff\n * resolve();\n * });\n * }\n *\n * @NgModule({\n * imports: [BrowserModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useFactory: () => initializeApp,\n * multi: true\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function\n * returning an observable, see an example below. Note: the `HttpClient` in this example is used for\n * demo purposes to illustrate how the factory function can work with other providers available\n * through DI.\n *\n * ```\n * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {\n * return () => httpClient.get(\"https://someUrl.com/api/user\")\n * .pipe(\n * tap(user => { ... })\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule, HttpClientModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useFactory: initializeAppFactory,\n * deps: [HttpClient],\n * multi: true\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * @publicApi\n */\nexport const APP_INITIALIZER =\n new InjectionToken<ReadonlyArray<() => Observable<unknown>| Promise<unknown>| void>>(\n 'Application Initializer');\n\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER} functions.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class ApplicationInitStatus {\n private resolve = noop;\n private reject = noop;\n private initialized = false;\n public readonly donePromise: Promise<any>;\n public readonly done = false;\n\n constructor(@Inject(APP_INITIALIZER) @Optional() private readonly appInits:\n ReadonlyArray<() => Observable<unknown>| Promise<unknown>| void>) {\n // TODO: Throw RuntimeErrorCode.INVALID_MULTI_PROVIDER if appInits is not an array\n this.donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n\n const asyncInitPromises: Promise<any>[] = [];\n\n const complete = () => {\n (this as {done: boolean}).done = true;\n this.resolve();\n };\n\n if (this.appInits) {\n for (let i = 0; i < this.appInits.length; i++) {\n const initResult = this.appInits[i]();\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n } else if (isObservable(initResult)) {\n const observableAsPromise = new Promise<void>((resolve, reject) => {\n initResult.subscribe({complete: resolve, error: reject});\n });\n asyncInitPromises.push(observableAsPromise);\n }\n }\n }\n\n Promise.all(asyncInitPromises)\n .then(() => {\n complete();\n })\n .catch(e => {\n this.reject(e);\n });\n\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './di';\n\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") representing a unique string ID, used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.\n *\n * BY default, the value is randomly generated and assigned to the application by Angular.\n * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure\n * the root {@link Injector} that uses this token.\n *\n * @publicApi\n */\nexport const APP_ID = new InjectionToken<string>('AppId', {\n providedIn: 'root',\n factory: _appIdRandomProviderFactory,\n});\n\nexport function _appIdRandomProviderFactory() {\n return `${_randomChar()}${_randomChar()}${_randomChar()}`;\n}\n\n/**\n * Providers that generate a random `APP_ID_TOKEN`.\n * @publicApi\n */\nexport const APP_ID_RANDOM_PROVIDER = {\n provide: APP_ID,\n useFactory: _appIdRandomProviderFactory,\n deps: <any[]>[],\n};\n\nfunction _randomChar(): string {\n return String.fromCharCode(97 + Math.floor(Math.random() * 25));\n}\n\n/**\n * A function that is executed when a platform is initialized.\n * @publicApi\n */\nexport const PLATFORM_INITIALIZER = new InjectionToken<Array<() => void>>('Platform Initializer');\n\n/**\n * A token that indicates an opaque platform ID.\n * @publicApi\n */\nexport const PLATFORM_ID = new InjectionToken<Object>('Platform ID', {\n providedIn: 'platform',\n factory: () => 'unknown', // set a default platform name, when none set explicitly\n});\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") that indicates the root directory of\n * the application\n * @publicApi\n */\nexport const PACKAGE_ROOT_URL = new InjectionToken<string>('Application Packages Root URL');\n\n// We keep this token here, rather than the animations package, so that modules that only care\n// about which animations module is loaded (e.g. the CDK) can retrieve it without having to\n// include extra dependencies. See #44970 for more context.\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") that indicates which animations\n * module has been loaded.\n * @publicApi\n */\nexport const ANIMATION_MODULE_TYPE =\n new InjectionToken<'NoopAnimations'|'BrowserAnimations'>('AnimationModuleType');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from './di';\n\n@Injectable({providedIn: 'platform'})\nexport class Console {\n log(message: string): void {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message: string): void {\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {inject} from '../di/injector_compatibility';\nimport {InjectFlags} from '../di/interface/injector';\n\nimport {DEFAULT_LOCALE_ID, USD_CURRENCY_CODE} from './localization';\n\ndeclare const $localize: {locale?: string};\n\n/**\n * Work out the locale from the potential global properties.\n *\n * * Closure Compiler: use `goog.LOCALE`.\n * * Ivy enabled: use `$localize.locale`\n */\nexport function getGlobalLocale(): string {\n if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&\n typeof goog !== 'undefined' && goog.LOCALE !== 'en') {\n // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.\n // * In order to preserve backwards compatibility, we use Angular default value over\n // Closure Compiler's one.\n return goog.LOCALE;\n } else {\n // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE\n // COMPILE-TIME INLINER.\n //\n // * During compile time inlining of translations the expression will be replaced\n // with a string literal that is the current locale. Other forms of this expression are not\n // guaranteed to be replaced.\n //\n // * During runtime translation evaluation, the developer is required to set `$localize.locale`\n // if required, or just to provide their own `LOCALE_ID` provider.\n return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;\n }\n}\n\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n-common-locale-id) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const LOCALE_ID: InjectionToken<string> = new InjectionToken('LocaleId', {\n providedIn: 'root',\n factory: () =>\n inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),\n});\n\n/**\n * Provide this token to set the default currency code your application uses for\n * CurrencyPipe when there is no currency code passed into it. This is only used by\n * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.\n *\n * See the [i18n guide](guide/i18n-common-locale-id) for more information.\n *\n * <div class=\"alert is-helpful\">\n *\n * **Deprecation notice:**\n *\n * The default currency code is currently always `USD` but this is deprecated from v9.\n *\n * **In v10 the default currency code will be taken from the current locale.**\n *\n * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n * your application `NgModule`:\n *\n * ```ts\n * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n * ```\n *\n * </div>\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const DEFAULT_CURRENCY_CODE = new InjectionToken<string>('DefaultCurrencyCode', {\n providedIn: 'root',\n factory: () => USD_CURRENCY_CODE,\n});\n\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n-common-merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const TRANSLATIONS = new InjectionToken<string>('Translations');\n\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n-common-merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const TRANSLATIONS_FORMAT = new InjectionToken<string>('TranslationsFormat');\n\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nexport enum MissingTranslationStrategy {\n Error = 0,\n Warning = 1,\n Ignore = 2,\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../di/injectable';\nimport {InjectionToken} from '../di/injection_token';\nimport {StaticProvider} from '../di/interface/provider';\nimport {MissingTranslationStrategy} from '../i18n/tokens';\nimport {Type} from '../interface/type';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {ComponentFactory as ComponentFactoryR3} from '../render3/component_ref';\nimport {getComponentDef, getNgModuleDef} from '../render3/definition';\nimport {NgModuleFactory as NgModuleFactoryR3} from '../render3/ng_module_ref';\nimport {maybeUnwrapFn} from '../render3/util/misc_utils';\n\nimport {ComponentFactory} from './component_factory';\nimport {NgModuleFactory} from './ng_module_factory';\n\n/**\n * Combination of NgModuleFactory and ComponentFactories.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for\n * additional context.\n */\nexport class ModuleWithComponentFactories<T> {\n constructor(\n public ngModuleFactory: NgModuleFactory<T>,\n public componentFactories: ComponentFactory<any>[]) {}\n}\n\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for\n * additional context.\n */\n@Injectable({providedIn: 'root'})\nexport class Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components listed\n * in `entryComponents` have to be inlined.\n */\n compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T> {\n return new NgModuleFactoryR3(moduleType);\n }\n\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>> {\n return Promise.resolve(this.compileModuleSync(moduleType));\n }\n\n /**\n * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T> {\n const ngModuleFactory = this.compileModuleSync(moduleType);\n const moduleDef = getNgModuleDef(moduleType)!;\n const componentFactories =\n maybeUnwrapFn(moduleDef.declarations)\n .reduce((factories: ComponentFactory<any>[], declaration: Type<any>) => {\n const componentDef = getComponentDef(declaration);\n componentDef && factories.push(new ComponentFactoryR3(componentDef));\n return factories;\n }, [] as ComponentFactory<any>[]);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n\n /**\n * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync<T>(moduleType: Type<T>):\n Promise<ModuleWithComponentFactories<T>> {\n return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));\n }\n\n /**\n * Clears all caches.\n */\n clearCache(): void {}\n\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type: Type<any>) {}\n\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType: Type<any>): string|undefined {\n return undefined;\n }\n}\n\n/**\n * Options for creating a compiler.\n *\n * Note: the `useJit` and `missingTranslation` config options are not used in Ivy, passing them has\n * no effect. Those config options are deprecated since v13.\n *\n * @publicApi\n */\nexport type CompilerOptions = {\n /**\n * @deprecated not used at all in Ivy, providing this config option has no effect.\n */\n useJit?: boolean,\n defaultEncapsulation?: ViewEncapsulation,\n providers?: StaticProvider[],\n /**\n * @deprecated not used at all in Ivy, providing this config option has no effect.\n */\n missingTranslation?: MissingTranslationStrategy,\n preserveWhitespaces?: boolean,\n};\n\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nexport const COMPILER_OPTIONS = new InjectionToken<CompilerOptions[]>('compilerOptions');\n\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for\n * additional context.\n */\nexport abstract class CompilerFactory {\n abstract createCompiler(options?: CompilerOptions[]): Compiler;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst promise: Promise<any> = (() => Promise.resolve(0))();\n\ndeclare const Zone: any;\n\nexport function scheduleMicroTask(fn: Function) {\n if (typeof Zone === 'undefined') {\n // use promise to schedule microTask instead of use Zone\n promise.then(() => {\n fn && fn.apply(null, null);\n });\n } else {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {EventEmitter} from '../event_emitter';\nimport {global} from '../util/global';\nimport {noop} from '../util/noop';\nimport {getNativeRequestAnimationFrame} from '../util/raf';\n\nimport {AsyncStackTaggingZoneSpec} from './async-stack-tagging';\n\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '@angular/core';\n * import {NgIf} from '@angular/common';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class NgZone {\n readonly hasPendingMacrotasks: boolean = false;\n readonly hasPendingMicrotasks: boolean = false;\n\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n readonly isStable: boolean = true;\n\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n readonly onUnstable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n readonly onStable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies that an error has been delivered.\n */\n readonly onError: EventEmitter<any> = new EventEmitter(false);\n\n\n constructor({\n enableLongStackTrace = false,\n shouldCoalesceEventChangeDetection = false,\n shouldCoalesceRunChangeDetection = false\n }) {\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_ZONEJS,\n ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n\n Zone.assertZonePatched();\n const self = this as any as NgZonePrivate;\n self._nesting = 0;\n\n self._outer = self._inner = Zone.current;\n\n // AsyncStackTaggingZoneSpec provides `linked stack traces` to show\n // where the async operation is scheduled. For more details, refer\n // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/\n // And we only import this AsyncStackTaggingZoneSpec in development mode,\n // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n\n if ((Zone as any)['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new ((Zone as any)['TaskTrackingZoneSpec'] as any));\n }\n\n if (enableLongStackTrace && (Zone as any)['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['longStackTraceZoneSpec']);\n }\n // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n self.shouldCoalesceEventChangeDetection =\n !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.lastRequestAnimationFrameId = -1;\n self.nativeRequestAnimationFrame = getNativeRequestAnimationFrame().nativeRequestAnimationFrame;\n forkInnerZoneWithAngularBehavior(self);\n }\n\n static isInAngularZone(): boolean {\n // Zone needs to be checked, because this method might be called even when NoopNgZone is used.\n return typeof Zone !== 'undefined' && Zone.current.get('isAngularZone') === true;\n }\n\n static assertInAngularZone(): void {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_ZONE_STATE,\n ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n\n static assertNotInAngularZone(): void {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_ZONE_STATE,\n ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.run(fn, applyThis, applyArgs);\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T {\n const zone = (this as any as NgZonePrivate)._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n } finally {\n zone.cancelTask(task);\n }\n }\n\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.runGuarded(fn, applyThis, applyArgs);\n }\n\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return (this as any as NgZonePrivate)._outer.run(fn);\n }\n}\n\nconst EMPTY_PAYLOAD = {};\n\ninterface NgZonePrivate extends NgZone {\n _outer: Zone;\n _inner: Zone;\n _nesting: number;\n _hasPendingMicrotasks: boolean;\n\n hasPendingMacrotasks: boolean;\n hasPendingMicrotasks: boolean;\n lastRequestAnimationFrameId: number;\n /**\n * A flag to indicate if NgZone is currently inside\n * checkStable and to prevent re-entry. The flag is\n * needed because it is possible to invoke the change\n * detection from within change detection leading to\n * incorrect behavior.\n *\n * For detail, please refer here,\n * https://github.com/angular/angular/pull/40540\n */\n isCheckStableRunning: boolean;\n isStable: boolean;\n /**\n * Optionally specify coalescing event change detections or not.\n * Consider the following case.\n *\n * <div (click)=\"doSomething()\">\n * <button (click)=\"doSomethingElse()\"></button>\n * </div>\n *\n * When button is clicked, because of the event bubbling, both\n * event handlers will be called and 2 change detections will be\n * triggered. We can coalesce such kind of events to trigger\n * change detection only once.\n *\n * By default, this option will be false. So the events will not be\n * coalesced and the change detection will be triggered multiple times.\n * And if this option be set to true, the change detection will be\n * triggered async by scheduling it in an animation frame. So in the case above,\n * the change detection will only be trigged once.\n */\n shouldCoalesceEventChangeDetection: boolean;\n /**\n * Optionally specify if `NgZone#run()` method invocations should be coalesced\n * into a single change detection.\n *\n * Consider the following case.\n *\n * for (let i = 0; i < 10; i ++) {\n * ngZone.run(() => {\n * // do something\n * });\n * }\n *\n * This case triggers the change detection multiple times.\n * With ngZoneRunCoalescing options, all change detections in an event loops trigger only once.\n * In addition, the change detection executes in requestAnimation.\n *\n */\n shouldCoalesceRunChangeDetection: boolean;\n\n nativeRequestAnimationFrame: (callback: FrameRequestCallback) => number;\n\n // Cache a \"fake\" top eventTask so you don't need to schedule a new task every\n // time you run a `checkStable`.\n fakeTopEventTask: Task;\n}\n\nfunction checkStable(zone: NgZonePrivate) {\n // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n // re-entry. The case is:\n //\n // @Component({...})\n // export class AppComponent {\n // constructor(private ngZone: NgZone) {\n // this.ngZone.onStable.subscribe(() => {\n // this.ngZone.run(() => console.log('stable'););\n // });\n // }\n //\n // The onStable subscriber run another function inside ngZone\n // which causes `checkStable()` re-entry.\n // But this fix causes some issues in g3, so this fix will be\n // launched in another PR.\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\n\nfunction delayChangeDetectionForEvents(zone: NgZonePrivate) {\n /**\n * We also need to check _nesting here\n * Consider the following case with shouldCoalesceRunChangeDetection = true\n *\n * ngZone.run(() => {});\n * ngZone.run(() => {});\n *\n * We want the two `ngZone.run()` only trigger one change detection\n * when shouldCoalesceRunChangeDetection is true.\n * And because in this case, change detection run in async way(requestAnimationFrame),\n * so we also need to check the _nesting here to prevent multiple\n * change detections.\n */\n if (zone.isCheckStableRunning || zone.lastRequestAnimationFrameId !== -1) {\n return;\n }\n zone.lastRequestAnimationFrameId = zone.nativeRequestAnimationFrame.call(global, () => {\n // This is a work around for https://github.com/angular/angular/issues/36839.\n // The core issue is that when event coalescing is enabled it is possible for microtasks\n // to get flushed too early (As is the case with `Promise.then`) between the\n // coalescing eventTasks.\n //\n // To workaround this we schedule a \"fake\" eventTask before we process the\n // coalescing eventTasks. The benefit of this is that the \"fake\" container eventTask\n // will prevent the microtasks queue from getting drained in between the coalescing\n // eventTask execution.\n if (!zone.fakeTopEventTask) {\n zone.fakeTopEventTask = Zone.root.scheduleEventTask('fakeTopEventTask', () => {\n zone.lastRequestAnimationFrameId = -1;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n }, undefined, () => {}, () => {});\n }\n zone.fakeTopEventTask.invoke();\n });\n updateMicroTaskStatus(zone);\n}\n\nfunction forkInnerZoneWithAngularBehavior(zone: NgZonePrivate) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: <any>{'isAngularZone': true},\n onInvokeTask:\n (delegate: ZoneDelegate, current: Zone, target: Zone, task: Task, applyThis: any,\n applyArgs: any): any => {\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n if ((zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask') ||\n zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n\n onInvoke:\n (delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function, applyThis: any,\n applyArgs?: any[], source?: string): any => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n if (zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n\n onHasTask:\n (delegate: ZoneDelegate, current: Zone, target: Zone, hasTaskState: HasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n\n onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\n\nfunction updateMicroTaskStatus(zone: NgZonePrivate) {\n if (zone._hasPendingMicrotasks ||\n ((zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) &&\n zone.lastRequestAnimationFrameId !== -1)) {\n zone.hasPendingMicrotasks = true;\n } else {\n zone.hasPendingMicrotasks = false;\n }\n}\n\nfunction onEnter(zone: NgZonePrivate) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\n\nfunction onLeave(zone: NgZonePrivate) {\n zone._nesting--;\n checkStable(zone);\n}\n\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nexport class NoopNgZone implements NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n readonly isStable: boolean = true;\n readonly onUnstable: EventEmitter<any> = new EventEmitter();\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter();\n readonly onStable: EventEmitter<any> = new EventEmitter();\n readonly onError: EventEmitter<any> = new EventEmitter();\n\n run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any): T {\n return fn.apply(applyThis, applyArgs);\n }\n\n runGuarded<T>(fn: (...args: any[]) => any, applyThis?: any, applyArgs?: any): T {\n return fn.apply(applyThis, applyArgs);\n }\n\n runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return fn();\n }\n\n runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any, name?: string): T {\n return fn.apply(applyThis, applyArgs);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {global} from './global';\n\nexport function getNativeRequestAnimationFrame() {\n let nativeRequestAnimationFrame: (callback: FrameRequestCallback) => number =\n global['requestAnimationFrame'];\n let nativeCancelAnimationFrame: (handle: number) => void = global['cancelAnimationFrame'];\n if (typeof Zone !== 'undefined' && nativeRequestAnimationFrame! && nativeCancelAnimationFrame!) {\n // use unpatched version of requestAnimationFrame(native delegate) if possible\n // to avoid another Change detection\n const unpatchedRequestAnimationFrame =\n (nativeRequestAnimationFrame as any)[(Zone as any).__symbol__('OriginalDelegate')];\n if (unpatchedRequestAnimationFrame) {\n nativeRequestAnimationFrame = unpatchedRequestAnimationFrame;\n }\n const unpatchedCancelAnimationFrame =\n (nativeCancelAnimationFrame as any)[(Zone as any).__symbol__('OriginalDelegate')];\n if (unpatchedCancelAnimationFrame) {\n nativeCancelAnimationFrame = unpatchedCancelAnimationFrame;\n }\n }\n return {nativeRequestAnimationFrame, nativeCancelAnimationFrame};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, InjectionToken} from '../di';\nimport {scheduleMicroTask} from '../util/microtask';\nimport {NgZone} from '../zone/ng_zone';\n\n/**\n * Testability API.\n * `declare` keyword causes tsickle to generate externs, so these methods are\n * not renamed by Closure Compiler.\n * @publicApi\n */\nexport declare interface PublicTestability {\n isStable(): boolean;\n whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;\n findProviders(using: any, provider: string, exactMatch: boolean): any[];\n}\n\n// Angular internal, not intended for public API.\nexport interface PendingMacrotask {\n source: string;\n creationLocation: Error;\n runCount?: number;\n data?: TaskData;\n}\n\nexport interface TaskData {\n target?: XMLHttpRequest;\n delay?: number;\n isPeriodic?: boolean;\n}\n\n// Angular internal, not intended for public API.\nexport type DoneCallback = (didWork: boolean, tasks?: PendingMacrotask[]) => void;\nexport type UpdateCallback = (tasks: PendingMacrotask[]) => boolean;\n\ninterface WaitCallback {\n // Needs to be 'any' - setTimeout returns a number according to ES6, but\n // on NodeJS it returns a Timer.\n timeoutId: any;\n doneCb: DoneCallback;\n updateCb?: UpdateCallback;\n}\n\n/**\n * Internal injection token that can used to access an instance of a Testability class.\n *\n * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is\n * needed to ensure that there are no direct references to the `Testability` class, so it can be\n * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class\n * should be available, this token is used to add a provider that references the `Testability`\n * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.\n */\nexport const TESTABILITY = new InjectionToken<Testability>('');\n\n/**\n * Internal injection token to retrieve Testability getter class instance.\n */\nexport const TESTABILITY_GETTER = new InjectionToken<GetTestability>('');\n\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser.\n *\n * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also\n * instantiate Testability by default (in both development and production modes).\n *\n * For applications bootstrapped using the `bootstrapApplication` function, Testability is not\n * included by default. You can include it into your applications by getting the list of necessary\n * providers using the `provideProtractorTestingSupport()` function and adding them into the\n * `options.providers` array. Example:\n *\n * ```typescript\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);\n * ```\n *\n * @publicApi\n */\n@Injectable()\nexport class Testability implements PublicTestability {\n private _pendingCount: number = 0;\n private _isZoneStable: boolean = true;\n /**\n * Whether any work was done since the last 'whenStable' callback. This is\n * useful to detect if this could have potentially destabilized another\n * component while it is stabilizing.\n * @internal\n */\n private _didWork: boolean = false;\n private _callbacks: WaitCallback[] = [];\n\n private taskTrackingZone: {macroTasks: Task[]}|null = null;\n\n constructor(\n private _ngZone: NgZone, private registry: TestabilityRegistry,\n @Inject(TESTABILITY_GETTER) testabilityGetter: GetTestability) {\n // If there was no Testability logic registered in the global scope\n // before, register the current testability getter as a global one.\n if (!_testabilityGetter) {\n setTestabilityGetter(testabilityGetter);\n testabilityGetter.addToWindow(registry);\n }\n this._watchAngularEvents();\n _ngZone.run(() => {\n this.taskTrackingZone =\n typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n\n private _watchAngularEvents(): void {\n this._ngZone.onUnstable.subscribe({\n next: () => {\n this._didWork = true;\n this._isZoneStable = false;\n }\n });\n\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n scheduleMicroTask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n }\n });\n });\n }\n\n /**\n * Increases the number of pending request\n * @deprecated pending requests are now tracked with zones.\n */\n increasePendingRequestCount(): number {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }\n\n /**\n * Decreases the number of pending request\n * @deprecated pending requests are now tracked with zones\n */\n decreasePendingRequestCount(): number {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }\n\n /**\n * Whether an associated application is stable\n */\n isStable(): boolean {\n return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;\n }\n\n private _runCallbacksIfReady(): void {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n scheduleMicroTask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop()!;\n clearTimeout(cb.timeoutId);\n cb.doneCb(this._didWork);\n }\n this._didWork = false;\n });\n } else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter((cb) => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n\n return true;\n });\n\n this._didWork = true;\n }\n }\n\n private getPendingTasks(): PendingMacrotask[] {\n if (!this.taskTrackingZone) {\n return [];\n }\n\n // Copy the tasks data so that we don't leak tasks.\n return this.taskTrackingZone.macroTasks.map((t: Task) => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: (t as any).creationLocation as Error,\n data: t.data\n };\n });\n }\n\n private addCallback(cb: DoneCallback, timeout?: number, updateCb?: UpdateCallback) {\n let timeoutId: any = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);\n cb(this._didWork, this.getPendingTasks());\n }, timeout);\n }\n this._callbacks.push(<WaitCallback>{doneCb: cb, timeoutId: timeoutId, updateCb: updateCb});\n }\n\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void {\n if (updateCb && !this.taskTrackingZone) {\n throw new Error(\n 'Task tracking zone is required when passing an update callback to ' +\n 'whenStable(). Is \"zone.js/plugins/task-tracking\" loaded?');\n }\n // These arguments are 'Function' above to keep the public API simple.\n this.addCallback(doneCb as DoneCallback, timeout, updateCb as UpdateCallback);\n this._runCallbacksIfReady();\n }\n\n /**\n * Get the number of pending requests\n * @deprecated pending requests are now tracked with zones\n */\n getPendingRequestCount(): number {\n return this._pendingCount;\n }\n /**\n * Registers an application with a testability hook so that it can be tracked.\n * @param token token of application, root element\n *\n * @internal\n */\n registerApplication(token: any) {\n this.registry.registerApplication(token, this);\n }\n\n /**\n * Unregisters an application.\n * @param token token of application, root element\n *\n * @internal\n */\n unregisterApplication(token: any) {\n this.registry.unregisterApplication(token);\n }\n\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using: any, provider: string, exactMatch: boolean): any[] {\n // TODO(juliemr): implement.\n return [];\n }\n}\n\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\n@Injectable({providedIn: 'platform'})\nexport class TestabilityRegistry {\n /** @internal */\n _applications = new Map<any, Testability>();\n\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token: any, testability: Testability) {\n this._applications.set(token, testability);\n }\n\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token: any) {\n this._applications.delete(token);\n }\n\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() {\n this._applications.clear();\n }\n\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem: any): Testability|null {\n return this._applications.get(elem) || null;\n }\n\n /**\n * Get all registered testabilities\n */\n getAllTestabilities(): Testability[] {\n return Array.from(this._applications.values());\n }\n\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements(): any[] {\n return Array.from(this._applications.keys());\n }\n\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability|null {\n return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;\n }\n}\n\n/**\n * Adapter interface for retrieving the `Testability` service associated for a\n * particular context.\n *\n * @publicApi\n */\nexport interface GetTestability {\n addToWindow(registry: TestabilityRegistry): void;\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null;\n}\n\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nexport function setTestabilityGetter(getter: GetTestability): void {\n _testabilityGetter = getter;\n}\n\nlet _testabilityGetter: GetTestability|undefined;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './util/ng_jit_mode';\n\nimport {merge, Observable, Observer, Subscription} from 'rxjs';\nimport {share} from 'rxjs/operators';\n\nimport {ApplicationInitStatus} from './application_init';\nimport {PLATFORM_INITIALIZER} from './application_tokens';\nimport {getCompilerFacade, JitCompilerUsage} from './compiler/compiler_facade';\nimport {Console} from './console';\nimport {Injectable} from './di/injectable';\nimport {InjectionToken} from './di/injection_token';\nimport {Injector} from './di/injector';\nimport {EnvironmentProviders, Provider, StaticProvider} from './di/interface/provider';\nimport {EnvironmentInjector} from './di/r3_injector';\nimport {INJECTOR_SCOPE} from './di/scope';\nimport {ErrorHandler} from './error_handler';\nimport {formatRuntimeError, RuntimeError, RuntimeErrorCode} from './errors';\nimport {DEFAULT_LOCALE_ID} from './i18n/localization';\nimport {LOCALE_ID} from './i18n/tokens';\nimport {Type} from './interface/type';\nimport {COMPILER_OPTIONS, CompilerOptions} from './linker/compiler';\nimport {ComponentFactory, ComponentRef} from './linker/component_factory';\nimport {ComponentFactoryResolver} from './linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nimport {InternalViewRef, ViewRef} from './linker/view_ref';\nimport {isComponentResourceResolutionQueueEmpty, resolveComponentResources} from './metadata/resource_loading';\nimport {assertNgModuleType} from './render3/assert';\nimport {ComponentFactory as R3ComponentFactory} from './render3/component_ref';\nimport {isStandalone} from './render3/definition';\nimport {assertStandaloneComponentType} from './render3/errors';\nimport {setLocaleId} from './render3/i18n/i18n_locale_id';\nimport {setJitOptions} from './render3/jit/jit_options';\nimport {createEnvironmentInjector, NgModuleFactory as R3NgModuleFactory} from './render3/ng_module_ref';\nimport {publishDefaultGlobalUtils as _publishDefaultGlobalUtils} from './render3/util/global_utils';\nimport {TESTABILITY} from './testability/testability';\nimport {isPromise} from './util/lang';\nimport {scheduleMicroTask} from './util/microtask';\nimport {stringify} from './util/stringify';\nimport {NgZone, NoopNgZone} from './zone/ng_zone';\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;\n\nlet _platformInjector: Injector|null = null;\n\n/**\n * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only\n * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.\n */\nexport const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken<boolean>('AllowMultipleToken');\n\n/**\n * Internal token that allows to register extra callbacks that should be invoked during the\n * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the\n * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the\n * entire class tree-shakeable.\n */\nconst PLATFORM_DESTROY_LISTENERS =\n new InjectionToken<Set<VoidFunction>>('PlatformDestroyListeners');\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") that provides a set of callbacks to\n * be called for every component that is bootstrapped.\n *\n * Each callback must take a `ComponentRef` instance and return nothing.\n *\n * `(componentRef: ComponentRef) => void`\n *\n * @publicApi\n */\nexport const APP_BOOTSTRAP_LISTENER =\n new InjectionToken<Array<(compRef: ComponentRef<any>) => void>>('appBootstrapListener');\n\nexport function compileNgModuleFactory<M>(\n injector: Injector, options: CompilerOptions,\n moduleType: Type<M>): Promise<NgModuleFactory<M>> {\n ngDevMode && assertNgModuleType(moduleType);\n\n const moduleFactory = new R3NgModuleFactory(moduleType);\n\n // All of the logic below is irrelevant for AOT-compiled code.\n if (typeof ngJitMode !== 'undefined' && !ngJitMode) {\n return Promise.resolve(moduleFactory);\n }\n\n const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);\n\n // Configure the compiler to use the provided options. This call may fail when multiple modules\n // are bootstrapped with incompatible options, as a component can only be compiled according to\n // a single set of options.\n setJitOptions({\n defaultEncapsulation: _lastDefined(compilerOptions.map(opts => opts.defaultEncapsulation)),\n preserveWhitespaces: _lastDefined(compilerOptions.map(opts => opts.preserveWhitespaces)),\n });\n\n if (isComponentResourceResolutionQueueEmpty()) {\n return Promise.resolve(moduleFactory);\n }\n\n const compilerProviders = _mergeArrays(compilerOptions.map(o => o.providers!));\n\n // In case there are no compiler providers, we just return the module factory as\n // there won't be any resource loader. This can happen with Ivy, because AOT compiled\n // modules can be still passed through \"bootstrapModule\". In that case we shouldn't\n // unnecessarily require the JIT compiler.\n if (compilerProviders.length === 0) {\n return Promise.resolve(moduleFactory);\n }\n\n const compiler = getCompilerFacade({\n usage: JitCompilerUsage.Decorator,\n kind: 'NgModule',\n type: moduleType,\n });\n const compilerInjector = Injector.create({providers: compilerProviders});\n const resourceLoader = compilerInjector.get(compiler.ResourceLoader);\n // The resource loader can also return a string while the \"resolveComponentResources\"\n // always expects a promise. Therefore we need to wrap the returned value in a promise.\n return resolveComponentResources(url => Promise.resolve(resourceLoader.get(url)))\n .then(() => moduleFactory);\n}\n\nexport function publishDefaultGlobalUtils() {\n ngDevMode && _publishDefaultGlobalUtils();\n}\n\nexport function isBoundToModule<C>(cf: ComponentFactory<C>): boolean {\n return (cf as R3ComponentFactory<C>).isBoundToModule;\n}\n\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @publicApi\n */\nexport class NgProbeToken {\n constructor(public name: string, public token: any) {}\n}\n\n/**\n * Creates a platform.\n * Platforms must be created on launch using this function.\n *\n * @publicApi\n */\nexport function createPlatform(injector: Injector): PlatformRef {\n if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new RuntimeError(\n RuntimeErrorCode.MULTIPLE_PLATFORMS,\n ngDevMode &&\n 'There can be only one platform. Destroy the previous one to create a new one.');\n }\n publishDefaultGlobalUtils();\n _platformInjector = injector;\n const platform = injector.get(PlatformRef);\n runPlatformInitializers(injector);\n return platform;\n}\n\n/**\n * The goal of this function is to bootstrap a platform injector,\n * but avoid referencing `PlatformRef` class.\n * This function is needed for bootstrapping a Standalone Component.\n */\nexport function createOrReusePlatformInjector(providers: StaticProvider[] = []): Injector {\n // If a platform injector already exists, it means that the platform\n // is already bootstrapped and no additional actions are required.\n if (_platformInjector) return _platformInjector;\n\n // Otherwise, setup a new platform injector and run platform initializers.\n const injector = createPlatformInjector(providers);\n _platformInjector = injector;\n publishDefaultGlobalUtils();\n runPlatformInitializers(injector);\n return injector;\n}\n\nexport function runPlatformInitializers(injector: Injector): void {\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits) {\n inits.forEach((init: any) => init());\n }\n}\n\n/**\n * Internal create application API that implements the core application creation logic and optional\n * bootstrap logic.\n *\n * Platforms (such as `platform-browser`) may require different set of application and platform\n * providers for an application to function correctly. As a result, platforms may use this function\n * internally and supply the necessary providers during the bootstrap, while exposing\n * platform-specific APIs as a part of their public API.\n *\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n */\nexport function internalCreateApplication(config: {\n rootComponent?: Type<unknown>,\n appProviders?: Array<Provider|EnvironmentProviders>,\n platformProviders?: Provider[],\n}): Promise<ApplicationRef> {\n const {rootComponent, appProviders, platformProviders} = config;\n\n if (NG_DEV_MODE && rootComponent !== undefined) {\n assertStandaloneComponentType(rootComponent);\n }\n\n const platformInjector = createOrReusePlatformInjector(platformProviders as StaticProvider[]);\n\n const ngZone = getNgZone('zone.js', getNgZoneOptions());\n\n return ngZone.run(() => {\n // Create root application injector based on a set of providers configured at the platform\n // bootstrap level as well as providers passed to the bootstrap call by a user.\n const allAppProviders = [\n {provide: NgZone, useValue: ngZone}, //\n ...(appProviders || []), //\n ];\n\n const envInjector = createEnvironmentInjector(\n allAppProviders, platformInjector as EnvironmentInjector, 'Environment Injector');\n\n const exceptionHandler: ErrorHandler|null = envInjector.get(ErrorHandler, null);\n if (NG_DEV_MODE && !exceptionHandler) {\n throw new RuntimeError(\n RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND,\n 'No `ErrorHandler` found in the Dependency Injection tree.');\n }\n\n let onErrorSubscription: Subscription;\n ngZone.runOutsideAngular(() => {\n onErrorSubscription = ngZone.onError.subscribe({\n next: (error: any) => {\n exceptionHandler!.handleError(error);\n }\n });\n });\n\n // If the whole platform is destroyed, invoke the `destroy` method\n // for all bootstrapped applications as well.\n const destroyListener = () => envInjector.destroy();\n const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n\n envInjector.onDestroy(() => {\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n\n return _callAndReportToErrorHandler(exceptionHandler!, ngZone, () => {\n const initStatus = envInjector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n\n return initStatus.donePromise.then(() => {\n const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);\n setLocaleId(localeId || DEFAULT_LOCALE_ID);\n\n const appRef = envInjector.get(ApplicationRef);\n if (rootComponent !== undefined) {\n appRef.bootstrap(rootComponent);\n }\n return appRef;\n });\n });\n });\n}\n\n/**\n * Creates a factory for a platform. Can be used to provide or override `Providers` specific to\n * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.\n * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories\n * to build up configurations that might be required by different libraries or parts of the\n * application.\n * @param name Identifies the new platform factory.\n * @param providers A set of dependency providers for platforms created with the new factory.\n *\n * @publicApi\n */\nexport function createPlatformFactory(\n parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef)|null, name: string,\n providers: StaticProvider[] = []): (extraProviders?: StaticProvider[]) => PlatformRef {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders: StaticProvider[] = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n const platformProviders: StaticProvider[] = [\n ...providers, //\n ...extraProviders, //\n {provide: marker, useValue: true}\n ];\n if (parentPlatformFactory) {\n parentPlatformFactory(platformProviders);\n } else {\n createPlatform(createPlatformInjector(platformProviders, desc));\n }\n }\n return assertPlatform(marker);\n };\n}\n\n/**\n * Checks that there is currently a platform that contains the given token as a provider.\n *\n * @publicApi\n */\nexport function assertPlatform(requiredToken: any): PlatformRef {\n const platform = getPlatform();\n\n if (!platform) {\n throw new RuntimeError(RuntimeErrorCode.PLATFORM_NOT_FOUND, ngDevMode && 'No platform exists!');\n }\n\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n !platform.injector.get(requiredToken, null)) {\n throw new RuntimeError(\n RuntimeErrorCode.MULTIPLE_PLATFORMS,\n 'A platform with a different configuration has been created. Please destroy it first.');\n }\n\n return platform;\n}\n\n/**\n * Helper function to create an instance of a platform injector (that maintains the 'platform'\n * scope).\n */\nexport function createPlatformInjector(providers: StaticProvider[] = [], name?: string): Injector {\n return Injector.create({\n name,\n providers: [\n {provide: INJECTOR_SCOPE, useValue: 'platform'},\n {provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null])},\n ...providers\n ],\n });\n}\n\n/**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n *\n * @publicApi\n */\nexport function destroyPlatform(): void {\n getPlatform()?.destroy();\n}\n\n/**\n * Returns the current platform.\n *\n * @publicApi\n */\nexport function getPlatform(): PlatformRef|null {\n return _platformInjector?.get(PlatformRef) ?? null;\n}\n\n/**\n * Provides additional options to the bootstrapping process.\n *\n * @publicApi\n */\nexport interface BootstrapOptions {\n /**\n * Optionally specify which `NgZone` should be used.\n *\n * - Provide your own `NgZone` instance.\n * - `zone.js` - Use default `NgZone` which requires `Zone.js`.\n * - `noop` - Use `NoopNgZone` which does nothing.\n */\n ngZone?: NgZone|'zone.js'|'noop';\n\n /**\n * Optionally specify coalescing event change detections or not.\n * Consider the following case.\n *\n * ```\n * <div (click)=\"doSomething()\">\n * <button (click)=\"doSomethingElse()\"></button>\n * </div>\n * ```\n *\n * When button is clicked, because of the event bubbling, both\n * event handlers will be called and 2 change detections will be\n * triggered. We can coalesce such kind of events to only trigger\n * change detection only once.\n *\n * By default, this option will be false. So the events will not be\n * coalesced and the change detection will be triggered multiple times.\n * And if this option be set to true, the change detection will be\n * triggered async by scheduling a animation frame. So in the case above,\n * the change detection will only be triggered once.\n */\n ngZoneEventCoalescing?: boolean;\n\n /**\n * Optionally specify if `NgZone#run()` method invocations should be coalesced\n * into a single change detection.\n *\n * Consider the following case.\n * ```\n * for (let i = 0; i < 10; i ++) {\n * ngZone.run(() => {\n * // do something\n * });\n * }\n * ```\n *\n * This case triggers the change detection multiple times.\n * With ngZoneRunCoalescing options, all change detections in an event loop trigger only once.\n * In addition, the change detection executes in requestAnimation.\n *\n */\n ngZoneRunCoalescing?: boolean;\n}\n\n/**\n * The Angular platform is the entry point for Angular on a web page.\n * Each page has exactly one platform. Services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n * A page's platform is initialized implicitly when a platform is created using a platform\n * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'platform'})\nexport class PlatformRef {\n private _modules: NgModuleRef<any>[] = [];\n private _destroyListeners: Array<() => void> = [];\n private _destroyed: boolean = false;\n\n /** @internal */\n constructor(private _injector: Injector) {}\n\n /**\n * Creates an instance of an `@NgModule` for the given platform.\n *\n * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function\n * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.\n */\n bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>, options?: BootstrapOptions):\n Promise<NgModuleRef<M>> {\n // Note: We need to create the NgZone _before_ we instantiate the module,\n // as instantiating the module creates some providers eagerly.\n // So we create a mini parent injector that just contains the new NgZone and\n // pass that as parent to the NgModuleFactory.\n const ngZone = getNgZone(options?.ngZone, getNgZoneOptions(options));\n const providers: StaticProvider[] = [{provide: NgZone, useValue: ngZone}];\n // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are\n // created within the Angular zone\n // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be\n // created outside of the Angular zone.\n return ngZone.run(() => {\n const ngZoneInjector = Injector.create(\n {providers: providers, parent: this.injector, name: moduleFactory.moduleType.name});\n const moduleRef = <InternalNgModuleRef<M>>moduleFactory.create(ngZoneInjector);\n const exceptionHandler: ErrorHandler|null = moduleRef.injector.get(ErrorHandler, null);\n if (!exceptionHandler) {\n throw new RuntimeError(\n RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND,\n ngDevMode && 'No ErrorHandler. Is platform module (BrowserModule) included?');\n }\n ngZone!.runOutsideAngular(() => {\n const subscription = ngZone!.onError.subscribe({\n next: (error: any) => {\n exceptionHandler.handleError(error);\n }\n });\n moduleRef.onDestroy(() => {\n remove(this._modules, moduleRef);\n subscription.unsubscribe();\n });\n });\n return _callAndReportToErrorHandler(exceptionHandler, ngZone!, () => {\n const initStatus: ApplicationInitStatus = moduleRef.injector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n return initStatus.donePromise.then(() => {\n // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy\n const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);\n setLocaleId(localeId || DEFAULT_LOCALE_ID);\n this._moduleDoBootstrap(moduleRef);\n return moduleRef;\n });\n });\n });\n }\n\n /**\n * Creates an instance of an `@NgModule` for a given platform.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule<M>(\n moduleType: Type<M>,\n compilerOptions: (CompilerOptions&BootstrapOptions)|\n Array<CompilerOptions&BootstrapOptions> = []): Promise<NgModuleRef<M>> {\n const options = optionsReducer({}, compilerOptions);\n return compileNgModuleFactory(this.injector, options, moduleType)\n .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));\n }\n\n private _moduleDoBootstrap(moduleRef: InternalNgModuleRef<any>): void {\n const appRef = moduleRef.injector.get(ApplicationRef);\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));\n } else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n } else {\n throw new RuntimeError(\n RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND,\n ngDevMode &&\n `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +\n `but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` +\n `Please define one of these.`);\n }\n this._modules.push(moduleRef);\n }\n\n /**\n * Registers a listener to be called when the platform is destroyed.\n */\n onDestroy(callback: () => void): void {\n this._destroyListeners.push(callback);\n }\n\n /**\n * Retrieves the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector(): Injector {\n return this._injector;\n }\n\n /**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(\n RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED,\n ngDevMode && 'The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n\n const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);\n if (destroyListeners) {\n destroyListeners.forEach(listener => listener());\n destroyListeners.clear();\n }\n\n this._destroyed = true;\n }\n\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n}\n\n// Set of options recognized by the NgZone.\ninterface NgZoneOptions {\n enableLongStackTrace: boolean;\n shouldCoalesceEventChangeDetection: boolean;\n shouldCoalesceRunChangeDetection: boolean;\n}\n\n// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->\n// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in\n// a set of default options returned.\nfunction getNgZoneOptions(options?: BootstrapOptions): NgZoneOptions {\n return {\n enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,\n shouldCoalesceEventChangeDetection: !!(options && options.ngZoneEventCoalescing) || false,\n shouldCoalesceRunChangeDetection: !!(options && options.ngZoneRunCoalescing) || false,\n };\n}\n\nfunction getNgZone(ngZoneToUse: NgZone|'zone.js'|'noop'|undefined, options: NgZoneOptions): NgZone {\n let ngZone: NgZone;\n\n if (ngZoneToUse === 'noop') {\n ngZone = new NoopNgZone();\n } else {\n ngZone = (ngZoneToUse === 'zone.js' ? undefined : ngZoneToUse) || new NgZone(options);\n }\n return ngZone;\n}\n\nfunction _callAndReportToErrorHandler(\n errorHandler: ErrorHandler, ngZone: NgZone, callback: () => any): any {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch((e: any) => {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n\n return result;\n } catch (e) {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\n\nfunction optionsReducer<T extends Object>(dst: any, objs: T|T[]): T {\n if (Array.isArray(objs)) {\n dst = objs.reduce(optionsReducer, dst);\n } else {\n dst = {...dst, ...(objs as any)};\n }\n return dst;\n}\n\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n *\n * {@a is-stable-examples}\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class ApplicationRef {\n /** @internal */\n private _bootstrapListeners: ((compRef: ComponentRef<any>) => void)[] = [];\n private _views: InternalViewRef[] = [];\n private _runningTick: boolean = false;\n private _stable = true;\n private _onMicrotaskEmptySubscription: Subscription;\n private _destroyed = false;\n private _destroyListeners: Array<() => void> = [];\n\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n public readonly componentTypes: Type<any>[] = [];\n\n /**\n * Get a list of components registered to this application.\n */\n public readonly components: ComponentRef<any>[] = [];\n\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n *\n * @see [Usage notes](#is-stable-examples) for examples and caveats when using this API.\n */\n // TODO(issue/24571): remove '!'.\n public readonly isStable!: Observable<boolean>;\n\n /**\n * The `EnvironmentInjector` used to create this application.\n */\n get injector(): EnvironmentInjector {\n return this._injector;\n }\n\n /** @internal */\n constructor(\n private _zone: NgZone,\n private _injector: EnvironmentInjector,\n private _exceptionHandler: ErrorHandler,\n ) {\n this._onMicrotaskEmptySubscription = this._zone.onMicrotaskEmpty.subscribe({\n next: () => {\n this._zone.run(() => {\n this.tick();\n });\n }\n });\n\n const isCurrentlyStable = new Observable<boolean>((observer: Observer<boolean>) => {\n this._stable = this._zone.isStable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks;\n this._zone.runOutsideAngular(() => {\n observer.next(this._stable);\n observer.complete();\n });\n });\n\n const isStable = new Observable<boolean>((observer: Observer<boolean>) => {\n // Create the subscription to onStable outside the Angular Zone so that\n // the callback is run outside the Angular Zone.\n let stableSub: Subscription;\n this._zone.runOutsideAngular(() => {\n stableSub = this._zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n scheduleMicroTask(() => {\n if (!this._stable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks) {\n this._stable = true;\n observer.next(true);\n }\n });\n });\n });\n\n const unstableSub: Subscription = this._zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n if (this._stable) {\n this._stable = false;\n this._zone.runOutsideAngular(() => {\n observer.next(false);\n });\n }\n });\n\n return () => {\n stableSub.unsubscribe();\n unstableSub.unsubscribe();\n };\n });\n\n (this as {isStable: Observable<boolean>}).isStable =\n merge(isCurrentlyStable, isStable.pipe(share()));\n }\n\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n */\n bootstrap<C>(component: Type<C>, rootSelectorOrNode?: string|any): ComponentRef<C>;\n\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n *\n * @deprecated Passing Component factories as the `Application.bootstrap` function argument is\n * deprecated. Pass Component Types instead.\n */\n bootstrap<C>(componentFactory: ComponentFactory<C>, rootSelectorOrNode?: string|any):\n ComponentRef<C>;\n\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n */\n bootstrap<C>(componentOrFactory: ComponentFactory<C>|Type<C>, rootSelectorOrNode?: string|any):\n ComponentRef<C> {\n NG_DEV_MODE && this.warnIfDestroyed();\n const isComponentFactory = componentOrFactory instanceof ComponentFactory;\n const initStatus = this._injector.get(ApplicationInitStatus);\n\n if (!initStatus.done) {\n const standalone = !isComponentFactory && isStandalone(componentOrFactory);\n const errorMessage =\n 'Cannot bootstrap as there are still asynchronous initializers running.' +\n (standalone ? '' :\n ' Bootstrap components in the `ngDoBootstrap` method of the root module.');\n throw new RuntimeError(\n RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING, NG_DEV_MODE && errorMessage);\n }\n\n let componentFactory: ComponentFactory<C>;\n if (isComponentFactory) {\n componentFactory = componentOrFactory;\n } else {\n const resolver = this._injector.get(ComponentFactoryResolver);\n componentFactory = resolver.resolveComponentFactory(componentOrFactory)!;\n }\n this.componentTypes.push(componentFactory.componentType);\n\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule =\n isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n const nativeElement = compRef.location.nativeElement;\n const testability = compRef.injector.get(TESTABILITY, null);\n testability?.registerApplication(nativeElement);\n\n compRef.onDestroy(() => {\n this.detachView(compRef.hostView);\n remove(this.components, compRef);\n testability?.unregisterApplication(nativeElement);\n });\n\n this._loadComponent(compRef);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const _console = this._injector.get(Console);\n _console.log(\n `Angular is running in development mode. Call enableProdMode() to enable production mode.`);\n }\n return compRef;\n }\n\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick(): void {\n NG_DEV_MODE && this.warnIfDestroyed();\n if (this._runningTick) {\n throw new RuntimeError(\n RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK,\n ngDevMode && 'ApplicationRef.tick is called recursively');\n }\n\n try {\n this._runningTick = true;\n for (let view of this._views) {\n view.detectChanges();\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let view of this._views) {\n view.checkNoChanges();\n }\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n } finally {\n this._runningTick = false;\n }\n }\n\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef: ViewRef): void {\n NG_DEV_MODE && this.warnIfDestroyed();\n const view = (viewRef as InternalViewRef);\n this._views.push(view);\n view.attachToAppRef(this);\n }\n\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef: ViewRef): void {\n NG_DEV_MODE && this.warnIfDestroyed();\n const view = (viewRef as InternalViewRef);\n remove(this._views, view);\n view.detachFromAppRef();\n }\n\n private _loadComponent(componentRef: ComponentRef<any>): void {\n this.attachView(componentRef.hostView);\n this.tick();\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);\n if (ngDevMode && !Array.isArray(listeners)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_MULTI_PROVIDER,\n 'Unexpected type of the `APP_BOOTSTRAP_LISTENER` token value ' +\n `(expected an array, but got ${typeof listeners}). ` +\n 'Please check that the `APP_BOOTSTRAP_LISTENER` token is configured as a ' +\n '`multi: true` provider.');\n }\n listeners.push(...this._bootstrapListeners);\n listeners.forEach((listener) => listener(componentRef));\n }\n\n /** @internal */\n ngOnDestroy() {\n if (this._destroyed) return;\n\n try {\n // Call all the lifecycle hooks.\n this._destroyListeners.forEach(listener => listener());\n\n // Destroy all registered views.\n this._views.slice().forEach((view) => view.destroy());\n this._onMicrotaskEmptySubscription.unsubscribe();\n } finally {\n // Indicate that this instance is destroyed.\n this._destroyed = true;\n\n // Release all references.\n this._views = [];\n this._bootstrapListeners = [];\n this._destroyListeners = [];\n }\n }\n\n /**\n * Registers a listener to be called when an instance is destroyed.\n *\n * @param callback A callback function to add as a listener.\n * @returns A function which unregisters a listener.\n *\n * @internal\n */\n onDestroy(callback: () => void): VoidFunction {\n NG_DEV_MODE && this.warnIfDestroyed();\n this._destroyListeners.push(callback);\n return () => remove(this._destroyListeners, callback);\n }\n\n /**\n * Destroys an Angular application represented by this `ApplicationRef`. Calling this function\n * will destroy the associated environment injectors as well as all the bootstrapped components\n * with their views.\n */\n destroy(): void {\n if (this._destroyed) {\n throw new RuntimeError(\n RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED,\n ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');\n }\n\n // This is a temporary type to represent an instance of an R3Injector, which can be destroyed.\n // The type will be replaced with a different one once destroyable injector type is available.\n type DestroyableInjector = Injector&{destroy?: Function, destroyed?: boolean};\n\n const injector = this._injector as DestroyableInjector;\n\n // Check that this injector instance supports destroy operation.\n if (injector.destroy && !injector.destroyed) {\n // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle\n // hook, which invokes the remaining cleanup actions.\n injector.destroy();\n }\n }\n\n /**\n * Returns the number of attached views.\n */\n get viewCount() {\n return this._views.length;\n }\n\n private warnIfDestroyed() {\n if (NG_DEV_MODE && this._destroyed) {\n console.warn(formatRuntimeError(\n RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED,\n 'This instance of the `ApplicationRef` has already been destroyed.'));\n }\n }\n}\n\nfunction remove<T>(list: T[], el: T): void {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\n\nfunction _lastDefined<T>(args: T[]): T|undefined {\n for (let i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _mergeArrays(parts: any[][]): any[] {\n const result: any[] = [];\n parts.forEach((part) => part && result.push(...part));\n return result;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectFlags} from '../di';\nimport {InternalInjectFlags} from '../di/interface/injector';\nimport {TNode, TNodeType} from '../render3/interfaces/node';\nimport {isComponentHost} from '../render3/interfaces/type_checks';\nimport {DECLARATION_COMPONENT_VIEW, LView} from '../render3/interfaces/view';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {getComponentLViewByIndex} from '../render3/util/view_utils';\nimport {ViewRef as R3_ViewRef} from '../render3/view_ref';\n\n/**\n * Base class that provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.\n *\n * @see [Using change detection hooks](guide/lifecycle-hooks#using-change-detection-hooks)\n * @see [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection)\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval. See [live demo](https://plnkr.co/edit/GC512b?p=preview).\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n * region=\"mark-for-check\"></code-example>\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n *\n * @publicApi\n */\nexport abstract class ChangeDetectorRef {\n /**\n * When a view uses the {@link ChangeDetectionStrategy#OnPush OnPush} (checkOnce)\n * change detection strategy, explicitly marks the view as changed so that\n * it can be checked again.\n *\n * Components are normally marked as dirty (in need of rerendering) when inputs\n * have changed or events have fired in the view. Call this method to ensure that\n * a component is checked even if these triggers have not occurred.\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n */\n abstract markForCheck(): void;\n\n /**\n * Detaches this view from the change-detection tree.\n * A detached view is not checked until it is reattached.\n * Use in combination with `detectChanges()` to implement local change detection checks.\n *\n * Detached views are not checked during change detection runs until they are\n * re-attached, even if they are marked as dirty.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detach(): void;\n\n /**\n * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach\n * detach}\n * to implement local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detectChanges(): void;\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * Use in development mode to verify that running change detection doesn't introduce\n * other changes. Calling it in production mode is a noop.\n */\n abstract checkNoChanges(): void;\n\n /**\n * Re-attaches the previously detached view to the change detection tree.\n * Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n */\n abstract reattach(): void;\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: (flags: InjectFlags) => ChangeDetectorRef = injectChangeDetectorRef;\n}\n\n\n\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nexport function injectChangeDetectorRef(flags: InjectFlags): ChangeDetectorRef {\n return createViewRef(\n getCurrentTNode()!, getLView(),\n (flags & InternalInjectFlags.ForPipe) === InternalInjectFlags.ForPipe);\n}\n\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n *\n * @param tNode The node that is requesting a ChangeDetectorRef\n * @param lView The view to which the node belongs\n * @param isPipe Whether the view is being injected into a pipe.\n * @returns The ChangeDetectorRef to use\n */\nfunction createViewRef(tNode: TNode, lView: LView, isPipe: boolean): ChangeDetectorRef {\n if (isComponentHost(tNode) && !isPipe) {\n // The LView represents the location where the component is declared.\n // Instead we want the LView for the component View and so we need to look it up.\n const componentView = getComponentLViewByIndex(tNode.index, lView); // look down\n return new R3_ViewRef(componentView, componentView);\n } else if (tNode.type & (TNodeType.AnyRNode | TNodeType.AnyContainer | TNodeType.Icu)) {\n // The LView represents the location where the injection is requested from.\n // We need to locate the containing LView (in case where the `lView` is an embedded view)\n const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up\n return new R3_ViewRef(hostComponentView, lView);\n }\n return null!;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {isListLikeIterable, iterateListLike} from '../../util/iterable';\nimport {stringify} from '../../util/stringify';\n\nimport {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, NgIterable, TrackByFunction} from './iterable_differs';\n\n\nexport class DefaultIterableDifferFactory implements IterableDifferFactory {\n constructor() {}\n supports(obj: Object|null|undefined): boolean {\n return isListLikeIterable(obj);\n }\n\n create<V>(trackByFn?: TrackByFunction<V>): DefaultIterableDiffer<V> {\n return new DefaultIterableDiffer<V>(trackByFn);\n }\n}\n\nconst trackByIdentity = (index: number, item: any) => item;\n\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n * @publicApi\n */\nexport class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {\n public readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n public readonly collection!: V[]|Iterable<V>|null;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n private _linkedRecords: _DuplicateMap<V>|null = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n private _unlinkedRecords: _DuplicateMap<V>|null = null;\n private _previousItHead: IterableChangeRecord_<V>|null = null;\n private _itHead: IterableChangeRecord_<V>|null = null;\n private _itTail: IterableChangeRecord_<V>|null = null;\n private _additionsHead: IterableChangeRecord_<V>|null = null;\n private _additionsTail: IterableChangeRecord_<V>|null = null;\n private _movesHead: IterableChangeRecord_<V>|null = null;\n private _movesTail: IterableChangeRecord_<V>|null = null;\n private _removalsHead: IterableChangeRecord_<V>|null = null;\n private _removalsTail: IterableChangeRecord_<V>|null = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n private _identityChangesHead: IterableChangeRecord_<V>|null = null;\n private _identityChangesTail: IterableChangeRecord_<V>|null = null;\n private _trackByFn: TrackByFunction<V>;\n\n constructor(trackByFn?: TrackByFunction<V>) {\n this._trackByFn = trackByFn || trackByIdentity;\n }\n\n forEachItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachOperation(\n fn: (item: IterableChangeRecord<V>, previousIndex: number|null, currentIndex: number|null) =>\n void) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets: number[]|null = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record: IterableChangeRecord<V> = !nextRemove ||\n nextIt &&\n nextIt.currentIndex! <\n getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?\n nextIt! :\n nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n } else {\n nextIt = nextIt!._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex! - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n\n forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n\n diff(collection: NgIterable<V>|null|undefined): DefaultIterableDiffer<V>|null {\n if (collection == null) collection = [];\n if (!isListLikeIterable(collection)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_DIFFER_INPUT,\n ngDevMode &&\n `Error trying to diff '${\n stringify(collection)}'. Only arrays and iterables are allowed`);\n }\n\n if (this.check(collection)) {\n return this;\n } else {\n return null;\n }\n }\n\n onDestroy() {}\n\n check(collection: NgIterable<V>): boolean {\n this._reset();\n\n let record: IterableChangeRecord_<V>|null = this._itHead;\n let mayBeDirty: boolean = false;\n let index: number;\n let item: V;\n let itemTrackBy: any;\n if (Array.isArray(collection)) {\n (this as {length: number}).length = collection.length;\n\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n }\n\n record = record._next;\n }\n } else {\n index = 0;\n iterateListLike(collection, (item: V) => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n (this as {length: number}).length = index;\n }\n\n this._truncate(record);\n (this as {collection: V[] | Iterable<V>}).collection = collection;\n return this.isDirty;\n }\n\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty(): boolean {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }\n\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record: IterableChangeRecord_<V>|null;\n\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n record.previousIndex = record.currentIndex;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(record: IterableChangeRecord_<V>|null, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n // The previous record after which we will append the current one.\n let previousRecord: IterableChangeRecord_<V>|null;\n\n if (record === null) {\n previousRecord = this._itTail;\n } else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n\n // See if we have evicted the item, which used to be at some anterior position of _itHead list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n\n this._reinsertAfter(record, previousRecord, index);\n } else {\n // Attempt to see if the item is at some posterior position of _itHead list.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have the item in _itHead at/after `index` position. We need to move it forward in the\n // collection.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n\n this._moveAfter(record, previousRecord, index);\n } else {\n // It is a new item: add it.\n record =\n this._addAfter(new IterableChangeRecord_<V>(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\n }\n\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(record: IterableChangeRecord_<V>, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n let reinsertRecord: IterableChangeRecord_<V>|null =\n this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev!, index);\n } else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record: IterableChangeRecord_<V>|null) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord: IterableChangeRecord_<V>|null = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n\n /** @internal */\n _reinsertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n\n if (prev === null) {\n this._removalsHead = next;\n } else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n } else {\n next._prevRemoved = prev;\n }\n\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _moveAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _addAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._insertAfter(record, prevRecord, index);\n\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n } else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n\n /** @internal */\n _insertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n\n const next: IterableChangeRecord_<V>|null =\n prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n } else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n } else {\n prevRecord._next = record;\n }\n\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap<V>();\n }\n this._linkedRecords.put(record);\n\n record.currentIndex = index;\n return record;\n }\n\n /** @internal */\n _remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n return this._addToRemovals(this._unlink(record));\n }\n\n /** @internal */\n _unlink(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n\n const prev = record._prev;\n const next = record._next;\n\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n\n if (prev === null) {\n this._itHead = next;\n } else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n } else {\n next._prev = prev;\n }\n\n return record;\n }\n\n /** @internal */\n _addToMoves(record: IterableChangeRecord_<V>, toIndex: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n\n if (record.previousIndex === toIndex) {\n return record;\n }\n\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n } else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n\n return record;\n }\n\n private _addToRemovals(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap<V>();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n } else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n\n /** @internal */\n _addIdentityChange(record: IterableChangeRecord_<V>, item: V) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n } else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\n\nexport class IterableChangeRecord_<V> implements IterableChangeRecord<V> {\n currentIndex: number|null = null;\n previousIndex: number|null = null;\n\n /** @internal */\n _nextPrevious: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prev: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _next: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextAdded: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextMoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextIdentityChange: IterableChangeRecord_<V>|null = null;\n\n\n constructor(public item: V, public trackById: any) {}\n}\n\n// A linked list of IterableChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList<V> {\n /** @internal */\n _head: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _tail: IterableChangeRecord_<V>|null = null;\n\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record: IterableChangeRecord_<V>): void {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail!._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex!) &&\n Object.is(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record: IterableChangeRecord_<V>): boolean {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n\n const prev: IterableChangeRecord_<V>|null = record._prevDup;\n const next: IterableChangeRecord_<V>|null = record._nextDup;\n if (prev === null) {\n this._head = next;\n } else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n } else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\n\nclass _DuplicateMap<V> {\n map = new Map<any, _DuplicateItemRecordList<V>>();\n\n put(record: IterableChangeRecord_<V>) {\n const key = record.trackById;\n\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList<V>();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n const key = record.trackById;\n const recordList: _DuplicateItemRecordList<V> = this.map.get(key)!;\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n\n get isEmpty(): boolean {\n return this.map.size === 0;\n }\n\n clear() {\n this.map.clear();\n }\n}\n\nfunction getPreviousIndex(item: any, addRemoveOffset: number, moveOffsets: number[]|null): number {\n const previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {isJsObject} from '../../util/iterable';\nimport {stringify} from '../../util/stringify';\n\nimport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory} from './keyvalue_differs';\n\n\nexport class DefaultKeyValueDifferFactory<K, V> implements KeyValueDifferFactory {\n constructor() {}\n supports(obj: any): boolean {\n return obj instanceof Map || isJsObject(obj);\n }\n\n create<K, V>(): KeyValueDiffer<K, V> {\n return new DefaultKeyValueDiffer<K, V>();\n }\n}\n\nexport class DefaultKeyValueDiffer<K, V> implements KeyValueDiffer<K, V>, KeyValueChanges<K, V> {\n private _records = new Map<K, KeyValueChangeRecord_<K, V>>();\n private _mapHead: KeyValueChangeRecord_<K, V>|null = null;\n // _appendAfter is used in the check loop\n private _appendAfter: KeyValueChangeRecord_<K, V>|null = null;\n private _previousMapHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesTail: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsTail: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsTail: KeyValueChangeRecord_<K, V>|null = null;\n\n get isDirty(): boolean {\n return this._additionsHead !== null || this._changesHead !== null ||\n this._removalsHead !== null;\n }\n\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n diff(map?: Map<any, any>|{[k: string]: any}|null): any {\n if (!map) {\n map = new Map();\n } else if (!(map instanceof Map || isJsObject(map))) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_DIFFER_INPUT,\n ngDevMode &&\n `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);\n }\n\n return this.check(map) ? this : null;\n }\n\n onDestroy() {}\n\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map: Map<any, any>|{[k: string]: any}): boolean {\n this._reset();\n\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n\n this._forEach(map, (value: any, key: any) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n\n this._removalsHead = insertBefore;\n\n for (let record: KeyValueChangeRecord_<K, V>|null = insertBefore; record !== null;\n record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n\n return this.isDirty;\n }\n\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n private _insertBeforeOrAppend(\n before: KeyValueChangeRecord_<K, V>|null,\n record: KeyValueChangeRecord_<K, V>): KeyValueChangeRecord_<K, V>|null {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n\n this._appendAfter = before;\n return before;\n }\n\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n } else {\n this._mapHead = record;\n }\n\n this._appendAfter = record;\n return null;\n }\n\n private _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_<K, V> {\n if (this._records.has(key)) {\n const record = this._records.get(key)!;\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n\n return record;\n }\n\n const record = new KeyValueChangeRecord_<K, V>(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record: KeyValueChangeRecord_<K, V>|null;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n\n // Add the record or a given key to the list of changes only when the value has actually changed\n private _maybeAddToChanges(record: KeyValueChangeRecord_<K, V>, newValue: any): void {\n if (!Object.is(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n\n private _addToAdditions(record: KeyValueChangeRecord_<K, V>) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else {\n this._additionsTail!._nextAdded = record;\n this._additionsTail = record;\n }\n }\n\n private _addToChanges(record: KeyValueChangeRecord_<K, V>) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else {\n this._changesTail!._nextChanged = record;\n this._changesTail = record;\n }\n }\n\n /** @internal */\n private _forEach<K, V>(obj: Map<K, V>|{[k: string]: V}, fn: (v: V, k: any) => void) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n } else {\n Object.keys(obj).forEach(k => fn(obj[k], k));\n }\n }\n}\n\nclass KeyValueChangeRecord_<K, V> implements KeyValueChangeRecord<K, V> {\n previousValue: V|null = null;\n currentValue: V|null = null;\n\n /** @internal */\n _nextPrevious: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _next: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _prev: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextAdded: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextRemoved: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextChanged: KeyValueChangeRecord_<K, V>|null = null;\n\n constructor(public key: K) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵɵdefineInjectable} from '../../di/interface/defs';\nimport {StaticProvider} from '../../di/interface/provider';\nimport {Optional, SkipSelf} from '../../di/metadata';\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';\n\n\n\n/**\n * A type describing supported iterable types.\n *\n * @publicApi\n */\nexport type NgIterable<T> = Array<T>|Iterable<T>;\n\n/**\n * A strategy for tracking changes over time to an iterable. Used by {@link NgForOf} to\n * respond to changes in an iterable by effecting equivalent changes in the DOM.\n *\n * @publicApi\n */\nexport interface IterableDiffer<V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: NgIterable<V>|undefined|null): IterableChanges<V>|null;\n}\n\n/**\n * An object describing the changes in the `Iterable` collection since last time\n * `IterableDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface IterableChanges<V> {\n /**\n * Iterate over all changes. `IterableChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /**\n * Iterate over a set of operations which when applied to the original `Iterable` will produce the\n * new `Iterable`.\n *\n * NOTE: These are not necessarily the actual operations which were applied to the original\n * `Iterable`, rather these are a set of computed operations which may not be the same as the\n * ones applied.\n *\n * @param record A change which needs to be applied\n * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the\n * original `Iterable` location, where as `previousIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the\n * original `Iterable` location, where as `currentIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n */\n forEachOperation(\n fn:\n (record: IterableChangeRecord<V>, previousIndex: number|null,\n currentIndex: number|null) => void): void;\n\n /**\n * Iterate over changes in the order of original `Iterable` showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all added items. */\n forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all moved items. */\n forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all removed items. */\n forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /**\n * Iterate over all items which had their identity (as computed by the `TrackByFunction`)\n * changed.\n */\n forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface IterableChangeRecord<V> {\n /** Current index of the item in `Iterable` or null if removed. */\n readonly currentIndex: number|null;\n\n /** Previous index of the item in `Iterable` or null if added. */\n readonly previousIndex: number|null;\n\n /** The item. */\n readonly item: V;\n\n /** Track by identity as computed by the `TrackByFunction`. */\n readonly trackById: any;\n}\n\n/**\n * A function optionally passed into the `NgForOf` directive to customize how `NgForOf` uniquely\n * identifies items in an iterable.\n *\n * `NgForOf` needs to uniquely identify items in the iterable to correctly perform DOM updates\n * when items in the iterable are reordered, new items are added, or existing items are removed.\n *\n *\n * In all of these scenarios it is usually desirable to only update the DOM elements associated\n * with the items affected by the change. This behavior is important to:\n *\n * - preserve any DOM-specific UI state (like cursor position, focus, text selection) when the\n * iterable is modified\n * - enable animation of item addition, removal, and iterable reordering\n * - preserve the value of the `<select>` element when nested `<option>` elements are dynamically\n * populated using `NgForOf` and the bound iterable is updated\n *\n * A common use for custom `trackBy` functions is when the model that `NgForOf` iterates over\n * contains a property with a unique identifier. For example, given a model:\n *\n * ```ts\n * class User {\n * id: number;\n * name: string;\n * ...\n * }\n * ```\n * a custom `trackBy` function could look like the following:\n * ```ts\n * function userTrackBy(index, user) {\n * return user.id;\n * }\n * ```\n *\n * A custom `trackBy` function must have several properties:\n *\n * - be [idempotent](https://en.wikipedia.org/wiki/Idempotence) (be without side effects, and always\n * return the same value for a given input)\n * - return unique value for all unique inputs\n * - be fast\n *\n * @see [`NgForOf#ngForTrackBy`](api/common/NgForOf#ngForTrackBy)\n * @publicApi\n */\nexport interface TrackByFunction<T> {\n // Note: the type parameter `U` enables more accurate template type checking in case a trackBy\n // function is declared using a base type of the iterated type. The `U` type gives TypeScript\n // additional freedom to infer a narrower type for the `item` parameter type, instead of imposing\n // the trackBy's declared item type as the inferred type for `T`.\n // See https://github.com/angular/angular/issues/40125\n\n /**\n * @param index The index of the item within the iterable.\n * @param item The item in the iterable.\n */\n <U extends T>(index: number, item: T&U): any;\n}\n\n/**\n * Provides a factory for {@link IterableDiffer}.\n *\n * @publicApi\n */\nexport interface IterableDifferFactory {\n supports(objects: any): boolean;\n create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;\n}\n\nexport function defaultIterableDiffersFactory() {\n return new IterableDiffers([new DefaultIterableDifferFactory()]);\n}\n\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n *\n * @publicApi\n */\nexport class IterableDiffers {\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable(\n {token: IterableDiffers, providedIn: 'root', factory: defaultIterableDiffersFactory});\n\n /**\n * @deprecated v4.0.0 - Should be private\n */\n factories: IterableDifferFactory[];\n constructor(factories: IterableDifferFactory[]) {\n this.factories = factories;\n }\n\n static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {\n if (parent != null) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n\n return new IterableDiffers(factories);\n }\n\n /**\n * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n * inherited {@link IterableDiffers} instance with the provided factories and return a new\n * {@link IterableDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link IterableDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories: IterableDifferFactory[]): StaticProvider {\n return {\n provide: IterableDiffers,\n useFactory: (parent: IterableDiffers|null) => {\n // if parent is null, it means that we are in the root injector and we have just overridden\n // the default injection mechanism for IterableDiffers, in such a case just assume\n // `defaultIterableDiffersFactory`.\n return IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(iterable: any): IterableDifferFactory {\n const factory = this.factories.find(f => f.supports(iterable));\n if (factory != null) {\n return factory;\n } else {\n throw new RuntimeError(\n RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY,\n ngDevMode &&\n `Cannot find a differ supporting object '${iterable}' of type '${\n getTypeNameForDebugging(iterable)}'`);\n }\n }\n}\n\nexport function getTypeNameForDebugging(type: any): string {\n return type['name'] || typeof type;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Optional, SkipSelf, StaticProvider, ɵɵdefineInjectable} from '../../di';\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\n\nimport {DefaultKeyValueDifferFactory} from './default_keyvalue_differ';\n\n\n/**\n * A differ that tracks changes made to an object over time.\n *\n * @publicApi\n */\nexport interface KeyValueDiffer<K, V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: Map<K, V>): KeyValueChanges<K, V>|null;\n\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: {[key: string]: V}): KeyValueChanges<string, V>|null;\n // TODO(TS2.1): diff<KP extends string>(this: KeyValueDiffer<KP, V>, object: Record<KP, V>):\n // KeyValueDiffer<KP, V>;\n}\n\n/**\n * An object describing the changes in the `Map` or `{[k:string]: string}` since last time\n * `KeyValueDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface KeyValueChanges<K, V> {\n /**\n * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over changes in the order of original Map showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all keys for which values have changed.\n */\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all added items.\n */\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all removed items.\n */\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface KeyValueChangeRecord<K, V> {\n /**\n * Current key in the Map.\n */\n readonly key: K;\n\n /**\n * Current value for the key or `null` if removed.\n */\n readonly currentValue: V|null;\n\n /**\n * Previous value for the key or `null` if added.\n */\n readonly previousValue: V|null;\n}\n\n/**\n * Provides a factory for {@link KeyValueDiffer}.\n *\n * @publicApi\n */\nexport interface KeyValueDifferFactory {\n /**\n * Test to see if the differ knows how to diff this kind of object.\n */\n supports(objects: any): boolean;\n\n /**\n * Create a `KeyValueDiffer`.\n */\n create<K, V>(): KeyValueDiffer<K, V>;\n}\n\nexport function defaultKeyValueDiffersFactory() {\n return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);\n}\n\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n *\n * @publicApi\n */\nexport class KeyValueDiffers {\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable(\n {token: KeyValueDiffers, providedIn: 'root', factory: defaultKeyValueDiffersFactory});\n\n /**\n * @deprecated v4.0.0 - Should be private.\n */\n factories: KeyValueDifferFactory[];\n\n constructor(factories: KeyValueDifferFactory[]) {\n this.factories = factories;\n }\n\n static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {\n if (parent) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\n }\n\n /**\n * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n * {@link KeyValueDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link KeyValueDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n */\n static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider {\n return {\n provide: KeyValueDiffers,\n useFactory: (parent: KeyValueDiffers) => {\n // if parent is null, it means that we are in the root injector and we have just overridden\n // the default injection mechanism for KeyValueDiffers, in such a case just assume\n // `defaultKeyValueDiffersFactory`.\n return KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(kv: any): KeyValueDifferFactory {\n const factory = this.factories.find(f => f.supports(kv));\n if (factory) {\n return factory;\n }\n throw new RuntimeError(\n RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY,\n ngDevMode && `Cannot find a differ supporting object '${kv}'`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nimport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nimport {IterableDifferFactory, IterableDiffers} from './differs/iterable_differs';\nimport {KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\n\nexport {SimpleChange, SimpleChanges} from '../interface/simple_change';\nexport {devModeEqual} from '../util/comparison';\nexport {ChangeDetectorRef} from './change_detector_ref';\nexport {ChangeDetectionStrategy} from './constants';\nexport {DefaultIterableDiffer, DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nexport {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFunction} from './differs/iterable_differs';\nexport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\nexport {PipeTransform} from './pipe_transform';\n\n\n\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nconst keyValDiff: KeyValueDifferFactory[] = [new DefaultKeyValueDifferFactory()];\n\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nconst iterableDiff: IterableDifferFactory[] = [new DefaultIterableDifferFactory()];\n\nexport const defaultIterableDiffers = new IterableDiffers(iterableDiff);\n\nexport const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {createPlatformFactory, PlatformRef} from './application_ref';\nimport {StaticProvider} from './di';\n\n/**\n * This platform has to be included in any other platform\n *\n * @publicApi\n */\nexport const platformCore: (extraProviders?: StaticProvider[]|undefined) => PlatformRef =\n createPlatformFactory(null, 'core', []);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from './application_ref';\nimport {NgModule} from './metadata';\n\n/**\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command. Eagerly injects\n * `ApplicationRef` to instantiate it.\n *\n * @publicApi\n */\n@NgModule()\nexport class ApplicationModule {\n // Inject ApplicationRef to make it eager...\n constructor(appRef: ApplicationRef) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Coerces a value (typically a string) to a boolean. */\nexport function coerceToBoolean(value: unknown): boolean {\n return typeof value === 'boolean' ? value : (value != null && value !== 'false');\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nlet _DOM: DomAdapter = null!;\n\nexport function getDOM(): DomAdapter {\n return _DOM;\n}\n\nexport function setRootDomAdapter(adapter: DomAdapter) {\n if (!_DOM) {\n _DOM = adapter;\n }\n}\n\n/* tslint:disable:requireParameterType */\n/**\n * Provides DOM operations in an environment-agnostic way.\n *\n * @security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\nexport abstract class DomAdapter {\n // Needs Domino-friendly test utility\n abstract dispatchEvent(el: any, evt: any): any;\n abstract readonly supportsDOMEvents: boolean;\n\n // Used by Meta\n abstract remove(el: any): void;\n abstract createElement(tagName: any, doc?: any): HTMLElement;\n abstract createHtmlDocument(): Document;\n abstract getDefaultDocument(): Document;\n\n // Used by By.css\n abstract isElementNode(node: any): boolean;\n\n // Used by Testability\n abstract isShadowRoot(node: any): boolean;\n\n // Used by KeyEventsPlugin\n abstract onAndCancel(el: any, evt: any, listener: any): Function;\n\n // Used by PlatformLocation and ServerEventManagerPlugin\n abstract getGlobalEventTarget(doc: Document, target: string): any;\n\n // Used by PlatformLocation\n abstract getBaseHref(doc: Document): string|null;\n abstract resetBaseElement(): void;\n\n // TODO: remove dependency in DefaultValueAccessor\n abstract getUserAgent(): string;\n\n // Used in the legacy @angular/http package which has some usage in g3.\n abstract getCookie(name: string): string|null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/**\n * A DI Token representing the main rendering context. In a browser this is the DOM Document.\n *\n * Note: Document might not be available in the Application Context when Application and Rendering\n * Contexts are not the same (e.g. when running the application in a Web Worker).\n *\n * @publicApi\n */\nexport const DOCUMENT = new InjectionToken<Document>('DocumentToken');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, InjectionToken, ɵɵinject} from '@angular/core';\n\nimport {getDOM} from '../dom_adapter';\nimport {DOCUMENT} from '../dom_tokens';\n\n/**\n * This class should not be used directly by an application developer. Instead, use\n * {@link Location}.\n *\n * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be\n * platform-agnostic.\n * This means that we can have different implementation of `PlatformLocation` for the different\n * platforms that Angular supports. For example, `@angular/platform-browser` provides an\n * implementation specific to the browser environment, while `@angular/platform-server` provides\n * one suitable for use with server-side rendering.\n *\n * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}\n * when they need to interact with the DOM APIs like pushState, popState, etc.\n *\n * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly\n * by the {@link Router} in order to navigate between routes. Since all interactions between {@link\n * Router} /\n * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`\n * class, they are all platform-agnostic.\n *\n * @publicApi\n */\n@Injectable({\n providedIn: 'platform',\n // See #23917\n useFactory: useBrowserPlatformLocation\n})\nexport abstract class PlatformLocation {\n abstract getBaseHrefFromDOM(): string;\n abstract getState(): unknown;\n /**\n * Returns a function that, when executed, removes the `popstate` event handler.\n */\n abstract onPopState(fn: LocationChangeListener): VoidFunction;\n /**\n * Returns a function that, when executed, removes the `hashchange` event handler.\n */\n abstract onHashChange(fn: LocationChangeListener): VoidFunction;\n\n abstract get href(): string;\n abstract get protocol(): string;\n abstract get hostname(): string;\n abstract get port(): string;\n abstract get pathname(): string;\n abstract get search(): string;\n abstract get hash(): string;\n\n abstract replaceState(state: any, title: string, url: string): void;\n\n abstract pushState(state: any, title: string, url: string): void;\n\n abstract forward(): void;\n\n abstract back(): void;\n\n historyGo?(relativePosition: number): void {\n throw new Error('Not implemented');\n }\n}\n\nexport function useBrowserPlatformLocation() {\n return ɵɵinject(BrowserPlatformLocation);\n}\n\n/**\n * @description\n * Indicates when a location is initialized.\n *\n * @publicApi\n */\nexport const LOCATION_INITIALIZED = new InjectionToken<Promise<any>>('Location Initialized');\n\n/**\n * @description\n * A serializable version of the event from `onPopState` or `onHashChange`\n *\n * @publicApi\n */\nexport interface LocationChangeEvent {\n type: string;\n state: any;\n}\n\n/**\n * @publicApi\n */\nexport interface LocationChangeListener {\n (event: LocationChangeEvent): any;\n}\n\n\n\n/**\n * `PlatformLocation` encapsulates all of the direct calls to platform APIs.\n * This class should not be used directly by an application developer. Instead, use\n * {@link Location}.\n *\n * @publicApi\n */\n@Injectable({\n providedIn: 'platform',\n // See #23917\n useFactory: createBrowserPlatformLocation,\n})\nexport class BrowserPlatformLocation extends PlatformLocation {\n private _location: Location;\n private _history: History;\n\n constructor(@Inject(DOCUMENT) private _doc: any) {\n super();\n this._location = window.location;\n this._history = window.history;\n }\n\n override getBaseHrefFromDOM(): string {\n return getDOM().getBaseHref(this._doc)!;\n }\n\n override onPopState(fn: LocationChangeListener): VoidFunction {\n const window = getDOM().getGlobalEventTarget(this._doc, 'window');\n window.addEventListener('popstate', fn, false);\n return () => window.removeEventListener('popstate', fn);\n }\n\n override onHashChange(fn: LocationChangeListener): VoidFunction {\n const window = getDOM().getGlobalEventTarget(this._doc, 'window');\n window.addEventListener('hashchange', fn, false);\n return () => window.removeEventListener('hashchange', fn);\n }\n\n override get href(): string {\n return this._location.href;\n }\n override get protocol(): string {\n return this._location.protocol;\n }\n override get hostname(): string {\n return this._location.hostname;\n }\n override get port(): string {\n return this._location.port;\n }\n override get pathname(): string {\n return this._location.pathname;\n }\n override get search(): string {\n return this._location.search;\n }\n override get hash(): string {\n return this._location.hash;\n }\n override set pathname(newPath: string) {\n this._location.pathname = newPath;\n }\n\n override pushState(state: any, title: string, url: string): void {\n if (supportsState()) {\n this._history.pushState(state, title, url);\n } else {\n this._location.hash = url;\n }\n }\n\n override replaceState(state: any, title: string, url: string): void {\n if (supportsState()) {\n this._history.replaceState(state, title, url);\n } else {\n this._location.hash = url;\n }\n }\n\n override forward(): void {\n this._history.forward();\n }\n\n override back(): void {\n this._history.back();\n }\n\n override historyGo(relativePosition: number = 0): void {\n this._history.go(relativePosition);\n }\n\n override getState(): unknown {\n return this._history.state;\n }\n}\n\nexport function supportsState(): boolean {\n return !!window.history.pushState;\n}\nexport function createBrowserPlatformLocation() {\n return new BrowserPlatformLocation(ɵɵinject(DOCUMENT));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * Joins two parts of a URL with a slash if needed.\n *\n * @param start URL string\n * @param end URL string\n *\n *\n * @returns The joined URL string.\n */\nexport function joinWithSlash(start: string, end: string): string {\n if (start.length == 0) {\n return end;\n }\n if (end.length == 0) {\n return start;\n }\n let slashes = 0;\n if (start.endsWith('/')) {\n slashes++;\n }\n if (end.startsWith('/')) {\n slashes++;\n }\n if (slashes == 2) {\n return start + end.substring(1);\n }\n if (slashes == 1) {\n return start + end;\n }\n return start + '/' + end;\n}\n\n/**\n * Removes a trailing slash from a URL string if needed.\n * Looks for the first occurrence of either `#`, `?`, or the end of the\n * line as `/` characters and removes the trailing slash if one exists.\n *\n * @param url URL string.\n *\n * @returns The URL string, modified if needed.\n */\nexport function stripTrailingSlash(url: string): string {\n const match = url.match(/#|\\?|$/);\n const pathEndIdx = match && match.index || url.length;\n const droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);\n return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);\n}\n\n/**\n * Normalizes URL parameters by prepending with `?` if needed.\n *\n * @param params String of URL parameters.\n *\n * @returns The normalized URL parameters string.\n */\nexport function normalizeQueryParams(params: string): string {\n return params && params[0] !== '?' ? '?' + params : params;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, inject, Injectable, InjectionToken, OnDestroy, Optional} from '@angular/core';\n\nimport {DOCUMENT} from '../dom_tokens';\n\nimport {LocationChangeListener, PlatformLocation} from './platform_location';\nimport {joinWithSlash, normalizeQueryParams} from './util';\n\n/**\n * Enables the `Location` service to read route state from the browser's URL.\n * Angular provides two strategies:\n * `HashLocationStrategy` and `PathLocationStrategy`.\n *\n * Applications should use the `Router` or `Location` services to\n * interact with application route state.\n *\n * For instance, `HashLocationStrategy` produces URLs like\n * <code class=\"no-auto-link\">http://example.com#/foo</code>,\n * and `PathLocationStrategy` produces\n * <code class=\"no-auto-link\">http://example.com/foo</code> as an equivalent URL.\n *\n * See these two classes for more.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root', useFactory: () => inject(PathLocationStrategy)})\nexport abstract class LocationStrategy {\n abstract path(includeHash?: boolean): string;\n abstract prepareExternalUrl(internal: string): string;\n abstract getState(): unknown;\n abstract pushState(state: any, title: string, url: string, queryParams: string): void;\n abstract replaceState(state: any, title: string, url: string, queryParams: string): void;\n abstract forward(): void;\n abstract back(): void;\n historyGo?(relativePosition: number): void {\n throw new Error('Not implemented');\n }\n abstract onPopState(fn: LocationChangeListener): void;\n abstract getBaseHref(): string;\n}\n\n/**\n * A predefined [DI token](guide/glossary#di-token) for the base href\n * to be used with the `PathLocationStrategy`.\n * The base href is the URL prefix that should be preserved when generating\n * and recognizing URLs.\n *\n * @usageNotes\n *\n * The following example shows how to use this token to configure the root app injector\n * with a base href value, so that the DI framework can supply the dependency anywhere in the app.\n *\n * ```typescript\n * import {Component, NgModule} from '@angular/core';\n * import {APP_BASE_HREF} from '@angular/common';\n *\n * @NgModule({\n * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]\n * })\n * class AppModule {}\n * ```\n *\n * @publicApi\n */\nexport const APP_BASE_HREF = new InjectionToken<string>('appBaseHref');\n\n/**\n * @description\n * A {@link LocationStrategy} used to configure the {@link Location} service to\n * represent its state in the\n * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the\n * browser's URL.\n *\n * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF}\n * or add a `<base href>` element to the document to override the default.\n *\n * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,\n * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`.\n *\n * Similarly, if you add `<base href='/my/app/'/>` to the document and call\n * `location.go('/foo')`, the browser's URL will become\n * `example.com/my/app/foo`.\n *\n * Note that when using `PathLocationStrategy`, neither the query nor\n * the fragment in the `<base href>` will be preserved, as outlined\n * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/location/ts/path_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root'})\nexport class PathLocationStrategy extends LocationStrategy implements OnDestroy {\n private _baseHref: string;\n private _removeListenerFns: (() => void)[] = [];\n\n constructor(\n private _platformLocation: PlatformLocation,\n @Optional() @Inject(APP_BASE_HREF) href?: string) {\n super();\n\n this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ??\n inject(DOCUMENT).location?.origin ?? '';\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n while (this._removeListenerFns.length) {\n this._removeListenerFns.pop()!();\n }\n }\n\n override onPopState(fn: LocationChangeListener): void {\n this._removeListenerFns.push(\n this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));\n }\n\n override getBaseHref(): string {\n return this._baseHref;\n }\n\n override prepareExternalUrl(internal: string): string {\n return joinWithSlash(this._baseHref, internal);\n }\n\n override path(includeHash: boolean = false): string {\n const pathname =\n this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);\n const hash = this._platformLocation.hash;\n return hash && includeHash ? `${pathname}${hash}` : pathname;\n }\n\n override pushState(state: any, title: string, url: string, queryParams: string) {\n const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n this._platformLocation.pushState(state, title, externalUrl);\n }\n\n override replaceState(state: any, title: string, url: string, queryParams: string) {\n const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));\n this._platformLocation.replaceState(state, title, externalUrl);\n }\n\n override forward(): void {\n this._platformLocation.forward();\n }\n\n override back(): void {\n this._platformLocation.back();\n }\n\n override getState(): unknown {\n return this._platformLocation.getState();\n }\n\n override historyGo(relativePosition: number = 0): void {\n this._platformLocation.historyGo?.(relativePosition);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, OnDestroy, Optional} from '@angular/core';\n\nimport {APP_BASE_HREF, LocationStrategy} from './location_strategy';\nimport {LocationChangeListener, PlatformLocation} from './platform_location';\nimport {joinWithSlash, normalizeQueryParams} from './util';\n\n\n\n/**\n * @description\n * A {@link LocationStrategy} used to configure the {@link Location} service to\n * represent its state in the\n * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)\n * of the browser's URL.\n *\n * For instance, if you call `location.go('/foo')`, the browser's URL will become\n * `example.com#/foo`.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}\n *\n * @publicApi\n */\n@Injectable()\nexport class HashLocationStrategy extends LocationStrategy implements OnDestroy {\n private _baseHref: string = '';\n private _removeListenerFns: (() => void)[] = [];\n\n constructor(\n private _platformLocation: PlatformLocation,\n @Optional() @Inject(APP_BASE_HREF) _baseHref?: string) {\n super();\n if (_baseHref != null) {\n this._baseHref = _baseHref;\n }\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n while (this._removeListenerFns.length) {\n this._removeListenerFns.pop()!();\n }\n }\n\n override onPopState(fn: LocationChangeListener): void {\n this._removeListenerFns.push(\n this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));\n }\n\n override getBaseHref(): string {\n return this._baseHref;\n }\n\n override path(includeHash: boolean = false): string {\n // the hash value is always prefixed with a `#`\n // and if it is empty then it will stay empty\n let path = this._platformLocation.hash;\n if (path == null) path = '#';\n\n return path.length > 0 ? path.substring(1) : path;\n }\n\n override prepareExternalUrl(internal: string): string {\n const url = joinWithSlash(this._baseHref, internal);\n return url.length > 0 ? ('#' + url) : url;\n }\n\n override pushState(state: any, title: string, path: string, queryParams: string) {\n let url: string|null = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));\n if (url.length == 0) {\n url = this._platformLocation.pathname;\n }\n this._platformLocation.pushState(state, title, url);\n }\n\n override replaceState(state: any, title: string, path: string, queryParams: string) {\n let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));\n if (url.length == 0) {\n url = this._platformLocation.pathname;\n }\n this._platformLocation.replaceState(state, title, url);\n }\n\n override forward(): void {\n this._platformLocation.forward();\n }\n\n override back(): void {\n this._platformLocation.back();\n }\n\n override getState(): unknown {\n return this._platformLocation.getState();\n }\n\n override historyGo(relativePosition: number = 0): void {\n this._platformLocation.historyGo?.(relativePosition);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter, Injectable, OnDestroy, ɵɵinject} from '@angular/core';\nimport {SubscriptionLike} from 'rxjs';\n\nimport {LocationStrategy} from './location_strategy';\nimport {joinWithSlash, normalizeQueryParams, stripTrailingSlash} from './util';\n\n/** @publicApi */\nexport interface PopStateEvent {\n pop?: boolean;\n state?: any;\n type?: string;\n url?: string;\n}\n\n/**\n * @description\n *\n * A service that applications can use to interact with a browser's URL.\n *\n * Depending on the `LocationStrategy` used, `Location` persists\n * to the URL's path or the URL's hash segment.\n *\n * @usageNotes\n *\n * It's better to use the `Router.navigate()` service to trigger route changes. Use\n * `Location` only if you need to interact with or create normalized URLs outside of\n * routing.\n *\n * `Location` is responsible for normalizing the URL against the application's base href.\n * A normalized URL is absolute from the URL host, includes the application's base href, and has no\n * trailing slash:\n * - `/my/app/user/123` is normalized\n * - `my/app/user/123` **is not** normalized\n * - `/my/app/user/123/` **is not** normalized\n *\n * ### Example\n *\n * <code-example path='common/location/ts/path_location_component.ts'\n * region='LocationComponent'></code-example>\n *\n * @publicApi\n */\n@Injectable({\n providedIn: 'root',\n // See #23917\n useFactory: createLocation,\n})\nexport class Location implements OnDestroy {\n /** @internal */\n _subject: EventEmitter<any> = new EventEmitter();\n /** @internal */\n _basePath: string;\n /** @internal */\n _locationStrategy: LocationStrategy;\n /** @internal */\n _urlChangeListeners: ((url: string, state: unknown) => void)[] = [];\n /** @internal */\n _urlChangeSubscription: SubscriptionLike|null = null;\n\n constructor(locationStrategy: LocationStrategy) {\n this._locationStrategy = locationStrategy;\n const baseHref = this._locationStrategy.getBaseHref();\n // Note: This class's interaction with base HREF does not fully follow the rules\n // outlined in the spec https://www.freesoft.org/CIE/RFC/1808/18.htm.\n // Instead of trying to fix individual bugs with more and more code, we should\n // investigate using the URL constructor and providing the base as a second\n // argument.\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters\n this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));\n this._locationStrategy.onPopState((ev) => {\n this._subject.emit({\n 'url': this.path(true),\n 'pop': true,\n 'state': ev.state,\n 'type': ev.type,\n });\n });\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n this._urlChangeSubscription?.unsubscribe();\n this._urlChangeListeners = [];\n }\n\n /**\n * Normalizes the URL path for this location.\n *\n * @param includeHash True to include an anchor fragment in the path.\n *\n * @returns The normalized URL path.\n */\n // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is\n // removed.\n path(includeHash: boolean = false): string {\n return this.normalize(this._locationStrategy.path(includeHash));\n }\n\n /**\n * Reports the current state of the location history.\n * @returns The current value of the `history.state` object.\n */\n getState(): unknown {\n return this._locationStrategy.getState();\n }\n\n /**\n * Normalizes the given path and compares to the current normalized path.\n *\n * @param path The given URL path.\n * @param query Query parameters.\n *\n * @returns True if the given URL path is equal to the current normalized path, false\n * otherwise.\n */\n isCurrentPathEqualTo(path: string, query: string = ''): boolean {\n return this.path() == this.normalize(path + normalizeQueryParams(query));\n }\n\n /**\n * Normalizes a URL path by stripping any trailing slashes.\n *\n * @param url String representing a URL.\n *\n * @returns The normalized URL string.\n */\n normalize(url: string): string {\n return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));\n }\n\n /**\n * Normalizes an external URL path.\n * If the given URL doesn't begin with a leading slash (`'/'`), adds one\n * before normalizing. Adds a hash if `HashLocationStrategy` is\n * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.\n *\n * @param url String representing a URL.\n *\n * @returns A normalized platform-specific URL.\n */\n prepareExternalUrl(url: string): string {\n if (url && url[0] !== '/') {\n url = '/' + url;\n }\n return this._locationStrategy.prepareExternalUrl(url);\n }\n\n // TODO: rename this method to pushState\n /**\n * Changes the browser's URL to a normalized version of a given URL, and pushes a\n * new item onto the platform's history.\n *\n * @param path URL path to normalize.\n * @param query Query parameters.\n * @param state Location history state.\n *\n */\n go(path: string, query: string = '', state: any = null): void {\n this._locationStrategy.pushState(state, '', path, query);\n this._notifyUrlChangeListeners(\n this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }\n\n /**\n * Changes the browser's URL to a normalized version of the given URL, and replaces\n * the top item on the platform's history stack.\n *\n * @param path URL path to normalize.\n * @param query Query parameters.\n * @param state Location history state.\n */\n replaceState(path: string, query: string = '', state: any = null): void {\n this._locationStrategy.replaceState(state, '', path, query);\n this._notifyUrlChangeListeners(\n this.prepareExternalUrl(path + normalizeQueryParams(query)), state);\n }\n\n /**\n * Navigates forward in the platform's history.\n */\n forward(): void {\n this._locationStrategy.forward();\n }\n\n /**\n * Navigates back in the platform's history.\n */\n back(): void {\n this._locationStrategy.back();\n }\n\n /**\n * Navigate to a specific page from session history, identified by its relative position to the\n * current page.\n *\n * @param relativePosition Position of the target page in the history relative to the current\n * page.\n * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`\n * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go\n * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs\n * when `relativePosition` equals 0.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history\n */\n historyGo(relativePosition: number = 0): void {\n this._locationStrategy.historyGo?.(relativePosition);\n }\n\n /**\n * Registers a URL change listener. Use to catch updates performed by the Angular\n * framework that are not detectible through \"popstate\" or \"hashchange\" events.\n *\n * @param fn The change handler function, which take a URL and a location history state.\n * @returns A function that, when executed, unregisters a URL change listener.\n */\n onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction {\n this._urlChangeListeners.push(fn);\n\n if (!this._urlChangeSubscription) {\n this._urlChangeSubscription = this.subscribe(v => {\n this._notifyUrlChangeListeners(v.url, v.state);\n });\n }\n\n return () => {\n const fnIndex = this._urlChangeListeners.indexOf(fn);\n this._urlChangeListeners.splice(fnIndex, 1);\n\n if (this._urlChangeListeners.length === 0) {\n this._urlChangeSubscription?.unsubscribe();\n this._urlChangeSubscription = null;\n }\n };\n }\n\n /** @internal */\n _notifyUrlChangeListeners(url: string = '', state: unknown) {\n this._urlChangeListeners.forEach(fn => fn(url, state));\n }\n\n /**\n * Subscribes to the platform's `popState` events.\n *\n * Note: `Location.go()` does not trigger the `popState` event in the browser. Use\n * `Location.onUrlChange()` to subscribe to URL changes instead.\n *\n * @param value Event that is triggered when the state history changes.\n * @param exception The exception to throw.\n *\n * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)\n *\n * @returns Subscribed events.\n */\n subscribe(\n onNext: (value: PopStateEvent) => void, onThrow?: ((exception: any) => void)|null,\n onReturn?: (() => void)|null): SubscriptionLike {\n return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});\n }\n\n /**\n * Normalizes URL parameters by prepending with `?` if needed.\n *\n * @param params String of URL parameters.\n *\n * @returns The normalized URL parameters string.\n */\n public static normalizeQueryParams: (params: string) => string = normalizeQueryParams;\n\n /**\n * Joins two parts of a URL with a slash if needed.\n *\n * @param start URL string\n * @param end URL string\n *\n *\n * @returns The joined URL string.\n */\n public static joinWithSlash: (start: string, end: string) => string = joinWithSlash;\n\n /**\n * Removes a trailing slash from a URL string if needed.\n * Looks for the first occurrence of either `#`, `?`, or the end of the\n * line as `/` characters and removes the trailing slash if one exists.\n *\n * @param url URL string.\n *\n * @returns The URL string, modified if needed.\n */\n public static stripTrailingSlash: (url: string) => string = stripTrailingSlash;\n}\n\nexport function createLocation() {\n return new Location(ɵɵinject(LocationStrategy as any));\n}\n\nfunction _stripBasePath(basePath: string, url: string): string {\n if (!basePath || !url.startsWith(basePath)) {\n return url;\n }\n const strippedUrl = url.substring(basePath.length);\n if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) {\n return strippedUrl;\n }\n return url;\n}\n\nfunction _stripIndexHtml(url: string): string {\n return url.replace(/\\/index.html$/, '');\n}\n\nfunction _stripOrigin(baseHref: string): string {\n // DO NOT REFACTOR! Previously, this check looked like this:\n // `/^(https?:)?\\/\\//.test(baseHref)`, but that resulted in\n // syntactically incorrect code after Closure Compiler minification.\n // This was likely caused by a bug in Closure Compiler, but\n // for now, the check is rewritten to use `new RegExp` instead.\n const isAbsoluteUrl = (new RegExp('^(https?:)?//')).test(baseHref);\n if (isAbsoluteUrl) {\n const [, pathname] = baseHref.split(/\\/\\/[^\\/]+/);\n return pathname;\n }\n return baseHref;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵCurrencyIndex, ɵExtraLocaleDataIndex, ɵfindLocaleData, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, ɵLocaleDataIndex} from '@angular/core';\n\nimport {CURRENCIES_EN, CurrenciesSymbols} from './currencies';\n\n\n/**\n * Format styles that can be used to represent numbers.\n * @see `getLocaleNumberFormat()`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport enum NumberFormatStyle {\n Decimal,\n Percent,\n Currency,\n Scientific\n}\n\n/**\n * Plurality cases used for translating plurals to different languages.\n *\n * @see `NgPlural`\n * @see `NgPluralCase`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport enum Plural {\n Zero = 0,\n One = 1,\n Two = 2,\n Few = 3,\n Many = 4,\n Other = 5,\n}\n\n/**\n * Context-dependant translation forms for strings.\n * Typically the standalone version is for the nominative form of the word,\n * and the format version is used for the genitive case.\n * @see [CLDR website](http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles)\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport enum FormStyle {\n Format,\n Standalone\n}\n\n/**\n * String widths available for translations.\n * The specific character widths are locale-specific.\n * Examples are given for the word \"Sunday\" in English.\n *\n * @publicApi\n */\nexport enum TranslationWidth {\n /** 1 character for `en-US`. For example: 'S' */\n Narrow,\n /** 3 characters for `en-US`. For example: 'Sun' */\n Abbreviated,\n /** Full length for `en-US`. For example: \"Sunday\" */\n Wide,\n /** 2 characters for `en-US`, For example: \"Su\" */\n Short\n}\n\n/**\n * String widths available for date-time formats.\n * The specific character widths are locale-specific.\n * Examples are given for `en-US`.\n *\n * @see `getLocaleDateFormat()`\n * @see `getLocaleTimeFormat()`\n * @see `getLocaleDateTimeFormat()`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n * @publicApi\n */\nexport enum FormatWidth {\n /**\n * For `en-US`, 'M/d/yy, h:mm a'`\n * (Example: `6/15/15, 9:03 AM`)\n */\n Short,\n /**\n * For `en-US`, `'MMM d, y, h:mm:ss a'`\n * (Example: `Jun 15, 2015, 9:03:01 AM`)\n */\n Medium,\n /**\n * For `en-US`, `'MMMM d, y, h:mm:ss a z'`\n * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`)\n */\n Long,\n /**\n * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'`\n * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`)\n */\n Full\n}\n\n/**\n * Symbols that can be used to replace placeholders in number patterns.\n * Examples are based on `en-US` values.\n *\n * @see `getLocaleNumberSymbol()`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport enum NumberSymbol {\n /**\n * Decimal separator.\n * For `en-US`, the dot character.\n * Example: 2,345`.`67\n */\n Decimal,\n /**\n * Grouping separator, typically for thousands.\n * For `en-US`, the comma character.\n * Example: 2`,`345.67\n */\n Group,\n /**\n * List-item separator.\n * Example: \"one, two, and three\"\n */\n List,\n /**\n * Sign for percentage (out of 100).\n * Example: 23.4%\n */\n PercentSign,\n /**\n * Sign for positive numbers.\n * Example: +23\n */\n PlusSign,\n /**\n * Sign for negative numbers.\n * Example: -23\n */\n MinusSign,\n /**\n * Computer notation for exponential value (n times a power of 10).\n * Example: 1.2E3\n */\n Exponential,\n /**\n * Human-readable format of exponential.\n * Example: 1.2x103\n */\n SuperscriptingExponent,\n /**\n * Sign for permille (out of 1000).\n * Example: 23.4‰\n */\n PerMille,\n /**\n * Infinity, can be used with plus and minus.\n * Example: ∞, +∞, -∞\n */\n Infinity,\n /**\n * Not a number.\n * Example: NaN\n */\n NaN,\n /**\n * Symbol used between time units.\n * Example: 10:52\n */\n TimeSeparator,\n /**\n * Decimal separator for currency values (fallback to `Decimal`).\n * Example: $2,345.67\n */\n CurrencyDecimal,\n /**\n * Group separator for currency values (fallback to `Group`).\n * Example: $2,345.67\n */\n CurrencyGroup\n}\n\n/**\n * The value for each day of the week, based on the `en-US` locale\n *\n * @publicApi\n */\nexport enum WeekDay {\n Sunday = 0,\n Monday,\n Tuesday,\n Wednesday,\n Thursday,\n Friday,\n Saturday\n}\n\n/**\n * Retrieves the locale ID from the currently loaded locale.\n * The loaded locale could be, for example, a global one rather than a regional one.\n * @param locale A locale code, such as `fr-FR`.\n * @returns The locale code. For example, `fr`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleId(locale: string): string {\n return ɵfindLocaleData(locale)[ɵLocaleDataIndex.LocaleId];\n}\n\n/**\n * Retrieves day period strings for the given locale.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleDayPeriods(\n locale: string, formStyle: FormStyle, width: TranslationWidth): Readonly<[string, string]> {\n const data = ɵfindLocaleData(locale);\n const amPmData = <[string, string][][]>[\n data[ɵLocaleDataIndex.DayPeriodsFormat], data[ɵLocaleDataIndex.DayPeriodsStandalone]\n ];\n const amPm = getLastDefinedValue(amPmData, formStyle);\n return getLastDefinedValue(amPm, width);\n}\n\n/**\n * Retrieves days of the week for the given locale, using the Gregorian calendar.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns An array of localized name strings.\n * For example,`[Sunday, Monday, ... Saturday]` for `en-US`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleDayNames(\n locale: string, formStyle: FormStyle, width: TranslationWidth): ReadonlyArray<string> {\n const data = ɵfindLocaleData(locale);\n const daysData =\n <string[][][]>[data[ɵLocaleDataIndex.DaysFormat], data[ɵLocaleDataIndex.DaysStandalone]];\n const days = getLastDefinedValue(daysData, formStyle);\n return getLastDefinedValue(days, width);\n}\n\n/**\n * Retrieves months of the year for the given locale, using the Gregorian calendar.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns An array of localized name strings.\n * For example, `[January, February, ...]` for `en-US`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleMonthNames(\n locale: string, formStyle: FormStyle, width: TranslationWidth): ReadonlyArray<string> {\n const data = ɵfindLocaleData(locale);\n const monthsData =\n <string[][][]>[data[ɵLocaleDataIndex.MonthsFormat], data[ɵLocaleDataIndex.MonthsStandalone]];\n const months = getLastDefinedValue(monthsData, formStyle);\n return getLastDefinedValue(months, width);\n}\n\n/**\n * Retrieves Gregorian-calendar eras for the given locale.\n * @param locale A locale code for the locale format rules to use.\n * @param width The required character width.\n\n * @returns An array of localized era strings.\n * For example, `[AD, BC]` for `en-US`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleEraNames(\n locale: string, width: TranslationWidth): Readonly<[string, string]> {\n const data = ɵfindLocaleData(locale);\n const erasData = <[string, string][]>data[ɵLocaleDataIndex.Eras];\n return getLastDefinedValue(erasData, width);\n}\n\n/**\n * Retrieves the first day of the week for the given locale.\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns A day index number, using the 0-based week-day index for `en-US`\n * (Sunday = 0, Monday = 1, ...).\n * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleFirstDayOfWeek(locale: string): WeekDay {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.FirstDayOfWeek];\n}\n\n/**\n * Range of week days that are considered the week-end for the given locale.\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns The range of day values, `[startDay, endDay]`.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleWeekEndRange(locale: string): [WeekDay, WeekDay] {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.WeekendRange];\n}\n\n/**\n * Retrieves a localized date-value formatting string.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param width The format type.\n * @returns The localized formatting string.\n * @see `FormatWidth`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleDateFormat(locale: string, width: FormatWidth): string {\n const data = ɵfindLocaleData(locale);\n return getLastDefinedValue(data[ɵLocaleDataIndex.DateFormat], width);\n}\n\n/**\n * Retrieves a localized time-value formatting string.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param width The format type.\n * @returns The localized formatting string.\n * @see `FormatWidth`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n\n * @publicApi\n */\nexport function getLocaleTimeFormat(locale: string, width: FormatWidth): string {\n const data = ɵfindLocaleData(locale);\n return getLastDefinedValue(data[ɵLocaleDataIndex.TimeFormat], width);\n}\n\n/**\n * Retrieves a localized date-time formatting string.\n *\n * @param locale A locale code for the locale format rules to use.\n * @param width The format type.\n * @returns The localized formatting string.\n * @see `FormatWidth`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleDateTimeFormat(locale: string, width: FormatWidth): string {\n const data = ɵfindLocaleData(locale);\n const dateTimeFormatData = <string[]>data[ɵLocaleDataIndex.DateTimeFormat];\n return getLastDefinedValue(dateTimeFormatData, width);\n}\n\n/**\n * Retrieves a localized number symbol that can be used to replace placeholders in number formats.\n * @param locale The locale code.\n * @param symbol The symbol to localize.\n * @returns The character for the localized symbol.\n * @see `NumberSymbol`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleNumberSymbol(locale: string, symbol: NumberSymbol): string {\n const data = ɵfindLocaleData(locale);\n const res = data[ɵLocaleDataIndex.NumberSymbols][symbol];\n if (typeof res === 'undefined') {\n if (symbol === NumberSymbol.CurrencyDecimal) {\n return data[ɵLocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];\n } else if (symbol === NumberSymbol.CurrencyGroup) {\n return data[ɵLocaleDataIndex.NumberSymbols][NumberSymbol.Group];\n }\n }\n return res;\n}\n\n/**\n * Retrieves a number format for a given locale.\n *\n * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`\n * when used to format the number 12345.678 could result in \"12'345,678\". That would happen if the\n * grouping separator for your language is an apostrophe, and the decimal separator is a comma.\n *\n * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders\n * that stand for the decimal separator, and so on, and are NOT real characters.\n * You must NOT \"translate\" the placeholders. For example, don't change `.` to `,` even though in\n * your language the decimal point is written with a comma. The symbols should be replaced by the\n * local equivalents, using the appropriate `NumberSymbol` for your language.\n *\n * Here are the special characters used in number patterns:\n *\n * | Symbol | Meaning |\n * |--------|---------|\n * | . | Replaced automatically by the character used for the decimal point. |\n * | , | Replaced by the \"grouping\" (thousands) separator. |\n * | 0 | Replaced by a digit (or zero if there aren't enough digits). |\n * | # | Replaced by a digit (or nothing if there aren't enough). |\n * | ¤ | Replaced by a currency symbol, such as $ or USD. |\n * | % | Marks a percent format. The % symbol may change position, but must be retained. |\n * | E | Marks a scientific format. The E symbol may change position, but must be retained. |\n * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |\n *\n * @param locale A locale code for the locale format rules to use.\n * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.)\n * @returns The localized format string.\n * @see `NumberFormatStyle`\n * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns)\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleNumberFormat(locale: string, type: NumberFormatStyle): string {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.NumberFormats][type];\n}\n\n/**\n * Retrieves the symbol used to represent the currency for the main country\n * corresponding to a given locale. For example, '$' for `en-US`.\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns The localized symbol character,\n * or `null` if the main country cannot be determined.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleCurrencySymbol(locale: string): string|null {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.CurrencySymbol] || null;\n}\n\n/**\n * Retrieves the name of the currency for the main country corresponding\n * to a given locale. For example, 'US Dollar' for `en-US`.\n * @param locale A locale code for the locale format rules to use.\n * @returns The currency name,\n * or `null` if the main country cannot be determined.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleCurrencyName(locale: string): string|null {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.CurrencyName] || null;\n}\n\n/**\n * Retrieves the default currency code for the given locale.\n *\n * The default is defined as the first currency which is still in use.\n *\n * @param locale The code of the locale whose currency code we want.\n * @returns The code of the default currency for the given locale.\n *\n * @publicApi\n */\nexport function getLocaleCurrencyCode(locale: string): string|null {\n return ɵgetLocaleCurrencyCode(locale);\n}\n\n/**\n * Retrieves the currency values for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The currency values.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n */\nfunction getLocaleCurrencies(locale: string): {[code: string]: CurrenciesSymbols} {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.Currencies];\n}\n\n/**\n * @alias core/ɵgetLocalePluralCase\n * @publicApi\n */\nexport const getLocalePluralCase: (locale: string) => ((value: number) => Plural) =\n ɵgetLocalePluralCase;\n\nfunction checkFullData(data: any) {\n if (!data[ɵLocaleDataIndex.ExtraData]) {\n throw new Error(`Missing extra locale data for the locale \"${\n data[ɵLocaleDataIndex\n .LocaleId]}\". Use \"registerLocaleData\" to load new data. See the \"I18n guide\" on angular.io to know more.`);\n }\n}\n\n/**\n * Retrieves locale-specific rules used to determine which day period to use\n * when more than one period is defined for a locale.\n *\n * There is a rule for each defined day period. The\n * first rule is applied to the first day period and so on.\n * Fall back to AM/PM when no rules are available.\n *\n * A rule can specify a period as time range, or as a single time value.\n *\n * This functionality is only available when you have loaded the full locale data.\n * See the [\"I18n guide\"](guide/i18n-common-format-data-locale).\n *\n * @param locale A locale code for the locale format rules to use.\n * @returns The rules for the locale, a single time value or array of *from-time, to-time*,\n * or null if no periods are available.\n *\n * @see `getLocaleExtraDayPeriods()`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleExtraDayPeriodRules(locale: string): (Time|[Time, Time])[] {\n const data = ɵfindLocaleData(locale);\n checkFullData(data);\n const rules = data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodsRules] || [];\n return rules.map((rule: string|[string, string]) => {\n if (typeof rule === 'string') {\n return extractTime(rule);\n }\n return [extractTime(rule[0]), extractTime(rule[1])];\n });\n}\n\n/**\n * Retrieves locale-specific day periods, which indicate roughly how a day is broken up\n * in different languages.\n * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight.\n *\n * This functionality is only available when you have loaded the full locale data.\n * See the [\"I18n guide\"](guide/i18n-common-format-data-locale).\n *\n * @param locale A locale code for the locale format rules to use.\n * @param formStyle The required grammatical form.\n * @param width The required character width.\n * @returns The translated day-period strings.\n * @see `getLocaleExtraDayPeriodRules()`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getLocaleExtraDayPeriods(\n locale: string, formStyle: FormStyle, width: TranslationWidth): string[] {\n const data = ɵfindLocaleData(locale);\n checkFullData(data);\n const dayPeriodsData = <string[][][]>[\n data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodFormats],\n data[ɵLocaleDataIndex.ExtraData][ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone]\n ];\n const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];\n return getLastDefinedValue(dayPeriods, width) || [];\n}\n\n/**\n * Retrieves the writing direction of a specified locale\n * @param locale A locale code for the locale format rules to use.\n * @publicApi\n * @returns 'rtl' or 'ltr'\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n */\nexport function getLocaleDirection(locale: string): 'ltr'|'rtl' {\n const data = ɵfindLocaleData(locale);\n return data[ɵLocaleDataIndex.Directionality];\n}\n\n/**\n * Retrieves the first value that is defined in an array, going backwards from an index position.\n *\n * To avoid repeating the same data (as when the \"format\" and \"standalone\" forms are the same)\n * add the first value to the locale data arrays, and add other values only if they are different.\n *\n * @param data The data array to retrieve from.\n * @param index A 0-based index into the array to start from.\n * @returns The value immediately before the given index position.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nfunction getLastDefinedValue<T>(data: T[], index: number): T {\n for (let i = index; i > -1; i--) {\n if (typeof data[i] !== 'undefined') {\n return data[i];\n }\n }\n throw new Error('Locale data API: locale data undefined');\n}\n\n/**\n * Represents a time value with hours and minutes.\n *\n * @publicApi\n */\nexport type Time = {\n hours: number,\n minutes: number\n};\n\n/**\n * Extracts the hours and minutes from a string like \"15:45\"\n */\nfunction extractTime(time: string): Time {\n const [h, m] = time.split(':');\n return {hours: +h, minutes: +m};\n}\n\n\n\n/**\n * Retrieves the currency symbol for a given currency code.\n *\n * For example, for the default `en-US` locale, the code `USD` can\n * be represented by the narrow symbol `$` or the wide symbol `US$`.\n *\n * @param code The currency code.\n * @param format The format, `wide` or `narrow`.\n * @param locale A locale code for the locale format rules to use.\n *\n * @returns The symbol, or the currency code if no symbol is available.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getCurrencySymbol(code: string, format: 'wide'|'narrow', locale = 'en'): string {\n const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];\n const symbolNarrow = currency[ɵCurrencyIndex.SymbolNarrow];\n\n if (format === 'narrow' && typeof symbolNarrow === 'string') {\n return symbolNarrow;\n }\n\n return currency[ɵCurrencyIndex.Symbol] || code;\n}\n\n// Most currencies have cents, that's why the default is 2\nconst DEFAULT_NB_OF_CURRENCY_DIGITS = 2;\n\n/**\n * Reports the number of decimal digits for a given currency.\n * The value depends upon the presence of cents in that particular currency.\n *\n * @param code The currency code.\n * @returns The number of decimal digits, typically 0 or 2.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function getNumberOfCurrencyDigits(code: string): number {\n let digits;\n const currency = CURRENCIES_EN[code];\n if (currency) {\n digits = currency[ɵCurrencyIndex.NbOfDigits];\n }\n return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FormatWidth, FormStyle, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleId, getLocaleMonthNames, getLocaleNumberSymbol, getLocaleTimeFormat, NumberSymbol, Time, TranslationWidth} from './locale_data_api';\n\nexport const ISO8601_DATE_REGEX =\n /^(\\d{4,})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n// 1 2 3 4 5 6 7 8 9 10 11\nconst NAMED_FORMATS: {[localeId: string]: {[format: string]: string}} = {};\nconst DATE_FORMATS_SPLIT =\n /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\\s\\S]*)/;\n\nenum ZoneWidth {\n Short,\n ShortGMT,\n Long,\n Extended\n}\n\nenum DateType {\n FullYear,\n Month,\n Date,\n Hours,\n Minutes,\n Seconds,\n FractionalSeconds,\n Day\n}\n\nenum TranslationType {\n DayPeriods,\n Days,\n Months,\n Eras\n}\n\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a date according to locale rules.\n *\n * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch)\n * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime).\n * @param format The date-time components to include. See `DatePipe` for details.\n * @param locale A locale code for the locale format rules to use.\n * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`),\n * or a standard UTC/GMT or continental US time zone abbreviation.\n * If not specified, uses host system settings.\n *\n * @returns The formatted date string.\n *\n * @see `DatePipe`\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n-overview)\n *\n * @publicApi\n */\nexport function formatDate(\n value: string|number|Date, format: string, locale: string, timezone?: string): string {\n let date = toDate(value);\n const namedFormat = getNamedFormat(locale, format);\n format = namedFormat || format;\n\n let parts: string[] = [];\n let match;\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = parts.concat(match.slice(1));\n const part = parts.pop();\n if (!part) {\n break;\n }\n format = part;\n } else {\n parts.push(format);\n break;\n }\n }\n\n let dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n\n let text = '';\n parts.forEach(value => {\n const dateFormatter = getDateFormatter(value);\n text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) :\n value === '\\'\\'' ? '\\'' :\n value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n });\n\n return text;\n}\n\n/**\n * Create a new Date object with the given date value, and the time set to midnight.\n *\n * We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.\n * See: https://github.com/angular/angular/issues/40377\n *\n * Note that this function returns a Date object whose time is midnight in the current locale's\n * timezone. In the future we might want to change this to be midnight in UTC, but this would be a\n * considerable breaking change.\n */\nfunction createDate(year: number, month: number, date: number): Date {\n // The `newDate` is set to midnight (UTC) on January 1st 1970.\n // - In PST this will be December 31st 1969 at 4pm.\n // - In GMT this will be January 1st 1970 at 1am.\n // Note that they even have different years, dates and months!\n const newDate = new Date(0);\n\n // `setFullYear()` allows years like 0001 to be set correctly. This function does not\n // change the internal time of the date.\n // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).\n // - In PST this will now be September 20, 2019 at 4pm\n // - In GMT this will now be September 20, 2019 at 1am\n\n newDate.setFullYear(year, month, date);\n // We want the final date to be at local midnight, so we reset the time.\n // - In PST this will now be September 20, 2019 at 12am\n // - In GMT this will now be September 20, 2019 at 12am\n newDate.setHours(0, 0, 0);\n\n return newDate;\n}\n\nfunction getNamedFormat(locale: string, format: string): string {\n const localeId = getLocaleId(locale);\n NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};\n\n if (NAMED_FORMATS[localeId][format]) {\n return NAMED_FORMATS[localeId][format];\n }\n\n let formatValue = '';\n switch (format) {\n case 'shortDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Short);\n break;\n case 'mediumDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);\n break;\n case 'longDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Long);\n break;\n case 'fullDate':\n formatValue = getLocaleDateFormat(locale, FormatWidth.Full);\n break;\n case 'shortTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);\n break;\n case 'mediumTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);\n break;\n case 'longTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);\n break;\n case 'fullTime':\n formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);\n break;\n case 'short':\n const shortTime = getNamedFormat(locale, 'shortTime');\n const shortDate = getNamedFormat(locale, 'shortDate');\n formatValue = formatDateTime(\n getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);\n break;\n case 'medium':\n const mediumTime = getNamedFormat(locale, 'mediumTime');\n const mediumDate = getNamedFormat(locale, 'mediumDate');\n formatValue = formatDateTime(\n getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);\n break;\n case 'long':\n const longTime = getNamedFormat(locale, 'longTime');\n const longDate = getNamedFormat(locale, 'longDate');\n formatValue =\n formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);\n break;\n case 'full':\n const fullTime = getNamedFormat(locale, 'fullTime');\n const fullDate = getNamedFormat(locale, 'fullDate');\n formatValue =\n formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);\n break;\n }\n if (formatValue) {\n NAMED_FORMATS[localeId][format] = formatValue;\n }\n return formatValue;\n}\n\nfunction formatDateTime(str: string, opt_values: string[]) {\n if (opt_values) {\n str = str.replace(/\\{([^}]+)}/g, function(match, key) {\n return (opt_values != null && key in opt_values) ? opt_values[key] : match;\n });\n }\n return str;\n}\n\nfunction padNumber(\n num: number, digits: number, minusSign = '-', trim?: boolean, negWrap?: boolean): string {\n let neg = '';\n if (num < 0 || (negWrap && num <= 0)) {\n if (negWrap) {\n num = -num + 1;\n } else {\n num = -num;\n neg = minusSign;\n }\n }\n let strNum = String(num);\n while (strNum.length < digits) {\n strNum = '0' + strNum;\n }\n if (trim) {\n strNum = strNum.slice(strNum.length - digits);\n }\n return neg + strNum;\n}\n\nfunction formatFractionalSeconds(milliseconds: number, digits: number): string {\n const strMs = padNumber(milliseconds, 3);\n return strMs.substring(0, digits);\n}\n\n/**\n * Returns a date formatter that transforms a date into its locale digit representation\n */\nfunction dateGetter(\n name: DateType, size: number, offset: number = 0, trim = false,\n negWrap = false): DateFormatter {\n return function(date: Date, locale: string): string {\n let part = getDatePart(name, date);\n if (offset > 0 || part > -offset) {\n part += offset;\n }\n\n if (name === DateType.Hours) {\n if (part === 0 && offset === -12) {\n part = 12;\n }\n } else if (name === DateType.FractionalSeconds) {\n return formatFractionalSeconds(part, size);\n }\n\n const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n return padNumber(part, size, localeMinus, trim, negWrap);\n };\n}\n\nfunction getDatePart(part: DateType, date: Date): number {\n switch (part) {\n case DateType.FullYear:\n return date.getFullYear();\n case DateType.Month:\n return date.getMonth();\n case DateType.Date:\n return date.getDate();\n case DateType.Hours:\n return date.getHours();\n case DateType.Minutes:\n return date.getMinutes();\n case DateType.Seconds:\n return date.getSeconds();\n case DateType.FractionalSeconds:\n return date.getMilliseconds();\n case DateType.Day:\n return date.getDay();\n default:\n throw new Error(`Unknown DateType value \"${part}\".`);\n }\n}\n\n/**\n * Returns a date formatter that transforms a date into its locale string representation\n */\nfunction dateStrGetter(\n name: TranslationType, width: TranslationWidth, form: FormStyle = FormStyle.Format,\n extended = false): DateFormatter {\n return function(date: Date, locale: string): string {\n return getDateTranslation(date, locale, name, width, form, extended);\n };\n}\n\n/**\n * Returns the locale translation of a date for a given form, type and width\n */\nfunction getDateTranslation(\n date: Date, locale: string, name: TranslationType, width: TranslationWidth, form: FormStyle,\n extended: boolean) {\n switch (name) {\n case TranslationType.Months:\n return getLocaleMonthNames(locale, form, width)[date.getMonth()];\n case TranslationType.Days:\n return getLocaleDayNames(locale, form, width)[date.getDay()];\n case TranslationType.DayPeriods:\n const currentHours = date.getHours();\n const currentMinutes = date.getMinutes();\n if (extended) {\n const rules = getLocaleExtraDayPeriodRules(locale);\n const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);\n const index = rules.findIndex(rule => {\n if (Array.isArray(rule)) {\n // morning, afternoon, evening, night\n const [from, to] = rule;\n const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;\n const beforeTo =\n (currentHours < to.hours ||\n (currentHours === to.hours && currentMinutes < to.minutes));\n // We must account for normal rules that span a period during the day (e.g. 6am-9am)\n // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g.\n // 10pm - 5am) where `from` is greater (later!) than `to`.\n //\n // In the first case the current time must be BOTH after `from` AND before `to`\n // (e.g. 8am is after 6am AND before 10am).\n //\n // In the second case the current time must be EITHER after `from` OR before `to`\n // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is\n // after 10pm).\n if (from.hours < to.hours) {\n if (afterFrom && beforeTo) {\n return true;\n }\n } else if (afterFrom || beforeTo) {\n return true;\n }\n } else { // noon or midnight\n if (rule.hours === currentHours && rule.minutes === currentMinutes) {\n return true;\n }\n }\n return false;\n });\n if (index !== -1) {\n return dayPeriods[index];\n }\n }\n // if no rules for the day periods, we use am/pm by default\n return getLocaleDayPeriods(locale, form, <TranslationWidth>width)[currentHours < 12 ? 0 : 1];\n case TranslationType.Eras:\n return getLocaleEraNames(locale, <TranslationWidth>width)[date.getFullYear() <= 0 ? 0 : 1];\n default:\n // This default case is not needed by TypeScript compiler, as the switch is exhaustive.\n // However Closure Compiler does not understand that and reports an error in typed mode.\n // The `throw new Error` below works around the problem, and the unexpected: never variable\n // makes sure tsc still checks this code is unreachable.\n const unexpected: never = name;\n throw new Error(`unexpected translation type ${unexpected}`);\n }\n}\n\n/**\n * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or\n * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,\n * extended = +04:30)\n */\nfunction timeZoneGetter(width: ZoneWidth): DateFormatter {\n return function(date: Date, locale: string, offset: number) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n } else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\n}\n\nconst JANUARY = 0;\nconst THURSDAY = 4;\nfunction getFirstThursdayOfYear(year: number) {\n const firstDayOfYear = createDate(year, JANUARY, 1).getDay();\n return createDate(\n year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);\n}\n\nfunction getThursdayThisWeek(datetime: Date) {\n return createDate(\n datetime.getFullYear(), datetime.getMonth(),\n datetime.getDate() + (THURSDAY - datetime.getDay()));\n}\n\nfunction weekGetter(size: number, monthBased = false): DateFormatter {\n return function(date: Date, locale: string) {\n let result;\n if (monthBased) {\n const nbDaysBefore1stDayOfMonth =\n new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;\n const today = date.getDate();\n result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);\n } else {\n const thisThurs = getThursdayThisWeek(date);\n // Some days of a year are part of next year according to ISO 8601.\n // Compute the firstThurs from the year of this week's Thursday\n const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());\n const diff = thisThurs.getTime() - firstThurs.getTime();\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n }\n\n return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));\n };\n}\n\n/**\n * Returns a date formatter that provides the week-numbering year for the input date.\n */\nfunction weekNumberingYearGetter(size: number, trim = false): DateFormatter {\n return function(date: Date, locale: string) {\n const thisThurs = getThursdayThisWeek(date);\n const weekNumberingYear = thisThurs.getFullYear();\n return padNumber(\n weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);\n };\n}\n\ntype DateFormatter = (date: Date, locale: string, offset: number) => string;\n\nconst DATE_FORMATS: {[format: string]: DateFormatter} = {};\n\n// Based on CLDR formats:\n// See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n// See also explanations: http://cldr.unicode.org/translation/date-time\n// TODO(ocombe): support all missing cldr formats: U, Q, D, F, e, j, J, C, A, v, V, X, x\nfunction getDateFormatter(format: string): DateFormatter|null {\n if (DATE_FORMATS[format]) {\n return DATE_FORMATS[format];\n }\n let formatter;\n switch (format) {\n // Era name (AD/BC)\n case 'G':\n case 'GG':\n case 'GGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);\n break;\n case 'GGGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);\n break;\n case 'GGGGG':\n formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);\n break;\n\n // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)\n case 'y':\n formatter = dateGetter(DateType.FullYear, 1, 0, false, true);\n break;\n // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yy':\n formatter = dateGetter(DateType.FullYear, 2, 0, true, true);\n break;\n // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)\n case 'yyy':\n formatter = dateGetter(DateType.FullYear, 3, 0, false, true);\n break;\n // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)\n case 'yyyy':\n formatter = dateGetter(DateType.FullYear, 4, 0, false, true);\n break;\n\n // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)\n case 'Y':\n formatter = weekNumberingYearGetter(1);\n break;\n // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD\n // 2010 => 10)\n case 'YY':\n formatter = weekNumberingYearGetter(2, true);\n break;\n // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD\n // 2010 => 2010)\n case 'YYY':\n formatter = weekNumberingYearGetter(3);\n break;\n // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)\n case 'YYYY':\n formatter = weekNumberingYearGetter(4);\n break;\n\n // Month of the year (1-12), numeric\n case 'M':\n case 'L':\n formatter = dateGetter(DateType.Month, 1, 1);\n break;\n case 'MM':\n case 'LL':\n formatter = dateGetter(DateType.Month, 2, 1);\n break;\n\n // Month of the year (January, ...), string, format\n case 'MMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);\n break;\n case 'MMMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);\n break;\n case 'MMMMM':\n formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);\n break;\n\n // Month of the year (January, ...), string, standalone\n case 'LLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);\n break;\n case 'LLLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);\n break;\n case 'LLLLL':\n formatter =\n dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);\n break;\n\n // Week of the year (1, ... 52)\n case 'w':\n formatter = weekGetter(1);\n break;\n case 'ww':\n formatter = weekGetter(2);\n break;\n\n // Week of the month (1, ...)\n case 'W':\n formatter = weekGetter(1, true);\n break;\n\n // Day of the month (1-31)\n case 'd':\n formatter = dateGetter(DateType.Date, 1);\n break;\n case 'dd':\n formatter = dateGetter(DateType.Date, 2);\n break;\n\n // Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo)\n case 'c':\n case 'cc':\n formatter = dateGetter(DateType.Day, 1);\n break;\n case 'ccc':\n formatter =\n dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated, FormStyle.Standalone);\n break;\n case 'cccc':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide, FormStyle.Standalone);\n break;\n case 'ccccc':\n formatter =\n dateStrGetter(TranslationType.Days, TranslationWidth.Narrow, FormStyle.Standalone);\n break;\n case 'cccccc':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short, FormStyle.Standalone);\n break;\n\n // Day of the Week\n case 'E':\n case 'EE':\n case 'EEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);\n break;\n case 'EEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);\n break;\n case 'EEEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);\n break;\n case 'EEEEEE':\n formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);\n break;\n\n // Generic period of the day (am-pm)\n case 'a':\n case 'aa':\n case 'aaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);\n break;\n case 'aaaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);\n break;\n case 'aaaaa':\n formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);\n break;\n\n // Extended period of the day (midnight, at night, ...), standalone\n case 'b':\n case 'bb':\n case 'bbb':\n formatter = dateStrGetter(\n TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);\n break;\n case 'bbbb':\n formatter = dateStrGetter(\n TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);\n break;\n case 'bbbbb':\n formatter = dateStrGetter(\n TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);\n break;\n\n // Extended period of the day (midnight, night, ...), standalone\n case 'B':\n case 'BB':\n case 'BBB':\n formatter = dateStrGetter(\n TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);\n break;\n case 'BBBB':\n formatter =\n dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);\n break;\n case 'BBBBB':\n formatter = dateStrGetter(\n TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);\n break;\n\n // Hour in AM/PM, (1-12)\n case 'h':\n formatter = dateGetter(DateType.Hours, 1, -12);\n break;\n case 'hh':\n formatter = dateGetter(DateType.Hours, 2, -12);\n break;\n\n // Hour of the day (0-23)\n case 'H':\n formatter = dateGetter(DateType.Hours, 1);\n break;\n // Hour in day, padded (00-23)\n case 'HH':\n formatter = dateGetter(DateType.Hours, 2);\n break;\n\n // Minute of the hour (0-59)\n case 'm':\n formatter = dateGetter(DateType.Minutes, 1);\n break;\n case 'mm':\n formatter = dateGetter(DateType.Minutes, 2);\n break;\n\n // Second of the minute (0-59)\n case 's':\n formatter = dateGetter(DateType.Seconds, 1);\n break;\n case 'ss':\n formatter = dateGetter(DateType.Seconds, 2);\n break;\n\n // Fractional second\n case 'S':\n formatter = dateGetter(DateType.FractionalSeconds, 1);\n break;\n case 'SS':\n formatter = dateGetter(DateType.FractionalSeconds, 2);\n break;\n case 'SSS':\n formatter = dateGetter(DateType.FractionalSeconds, 3);\n break;\n\n\n // Timezone ISO8601 short format (-0430)\n case 'Z':\n case 'ZZ':\n case 'ZZZ':\n formatter = timeZoneGetter(ZoneWidth.Short);\n break;\n // Timezone ISO8601 extended format (-04:30)\n case 'ZZZZZ':\n formatter = timeZoneGetter(ZoneWidth.Extended);\n break;\n\n // Timezone GMT short format (GMT+4)\n case 'O':\n case 'OO':\n case 'OOO':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'z':\n case 'zz':\n case 'zzz':\n formatter = timeZoneGetter(ZoneWidth.ShortGMT);\n break;\n // Timezone GMT long format (GMT+0430)\n case 'OOOO':\n case 'ZZZZ':\n // Should be location, but fallback to format O instead because we don't have the data yet\n case 'zzzz':\n formatter = timeZoneGetter(ZoneWidth.Long);\n break;\n default:\n return null;\n }\n DATE_FORMATS[format] = formatter;\n return formatter;\n}\n\nfunction timezoneToOffset(timezone: string, fallback: number): number {\n // Support: IE 11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(/:/g, '');\n const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n\nfunction addDateMinutes(date: Date, minutes: number) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n\nfunction convertTimezoneToLocal(date: Date, timezone: string, reverse: boolean): Date {\n const reverseValue = reverse ? -1 : 1;\n const dateTimezoneOffset = date.getTimezoneOffset();\n const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));\n}\n\n/**\n * Converts a value to date.\n *\n * Supported input formats:\n * - `Date`\n * - number: timestamp\n * - string: numeric (e.g. \"1234\"), ISO and date strings in a format supported by\n * [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\n * Note: ISO strings without time return a date without timeoffset.\n *\n * Throws if unable to convert to a date.\n */\nexport function toDate(value: string|number|Date): Date {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val: string) => +val);\n return createDate(y, m - 1, d);\n }\n\n const parsedNb = parseFloat(value);\n\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value as any - parsedNb)) {\n return new Date(parsedNb);\n }\n\n let match: RegExpMatchArray|null;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n const date = new Date(value as any);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}\n\n/**\n * Converts a date in ISO8601 to a Date.\n * Used instead of `Date.parse` because of browser discrepancies.\n */\nexport function isoStringToDate(match: RegExpMatchArray): Date {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}\n\nexport function isDate(value: any): value is Date {\n return value instanceof Date && !isNaN(value.valueOf());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function parseCookieValue(cookieStr: string, name: string): string|null {\n name = encodeURIComponent(name);\n for (const cookie of cookieStr.split(';')) {\n const eqIndex = cookie.indexOf('=');\n const [cookieName, cookieValue]: string[] =\n eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];\n if (cookieName.trim() === name) {\n return decodeURIComponent(cookieValue);\n }\n }\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Directive, DoCheck, ElementRef, Input, IterableDiffers, KeyValueDiffers, Renderer2, ɵstringify as stringify} from '@angular/core';\n\ntype NgClassSupportedTypes = string[]|Set<string>|{[klass: string]: any}|null|undefined;\n\nconst WS_REGEXP = /\\s+/;\n\nconst EMPTY_ARRAY: string[] = [];\n\n/**\n * Represents internal object used to track state of each CSS class. There are 3 different (boolean)\n * flags that, combined together, indicate state of a given CSS class:\n * - enabled: indicates if a class should be present in the DOM (true) or not (false);\n * - changed: tracks if a class was toggled (added or removed) during the custom dirty-checking\n * process; changed classes must be synchronized with the DOM;\n * - touched: tracks if a class is present in the current object bound to the class / ngClass input;\n * classes that are not present any more can be removed from the internal data structures;\n */\ninterface CssClassState {\n // PERF: could use a bit mask to represent state as all fields are boolean flags\n enabled: boolean;\n changed: boolean;\n touched: boolean;\n}\n\n/**\n * @ngModule CommonModule\n *\n * @usageNotes\n * ```\n * <some-element [ngClass]=\"'first second'\">...</some-element>\n *\n * <some-element [ngClass]=\"['first', 'second']\">...</some-element>\n *\n * <some-element [ngClass]=\"{'first': true, 'second': true, 'third': false}\">...</some-element>\n *\n * <some-element [ngClass]=\"stringExp|arrayExp|objExp\">...</some-element>\n *\n * <some-element [ngClass]=\"{'class1 class2 class3' : true}\">...</some-element>\n * ```\n *\n * @description\n *\n * Adds and removes CSS classes on an HTML element.\n *\n * The CSS classes are updated as follows, depending on the type of the expression evaluation:\n * - `string` - the CSS classes listed in the string (space delimited) are added,\n * - `Array` - the CSS classes declared as Array elements are added,\n * - `Object` - keys are CSS classes that get added when the expression given in the value\n * evaluates to a truthy value, otherwise they are removed.\n *\n * @publicApi\n */\n@Directive({\n selector: '[ngClass]',\n standalone: true,\n})\nexport class NgClass implements DoCheck {\n private initialClasses = EMPTY_ARRAY;\n private rawClass: NgClassSupportedTypes;\n\n private stateMap = new Map<string, CssClassState>();\n\n constructor(\n // leaving references to differs in place since flex layout is extending NgClass...\n private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers,\n private _ngEl: ElementRef, private _renderer: Renderer2) {}\n\n @Input('class')\n set klass(value: string) {\n this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;\n }\n\n @Input('ngClass')\n set ngClass(value: string|string[]|Set<string>|{[klass: string]: any}|null|undefined) {\n this.rawClass = typeof value === 'string' ? value.trim().split(WS_REGEXP) : value;\n }\n\n /*\n The NgClass directive uses the custom change detection algorithm for its inputs. The custom\n algorithm is necessary since inputs are represented as complex object or arrays that need to be\n deeply-compared.\n\n This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance\n might negatively impact runtime performance of the entire change detection cycle. The design of\n this algorithm is making sure that:\n - there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when\n needed), even if references to bound objects change;\n - there is no memory allocation if nothing changes (even relatively modest memory allocation\n during the change detection cycle can result in GC pauses for some of the CD cycles).\n\n The algorithm works by iterating over the set of bound classes, staring with [class] binding and\n then going over [ngClass] binding. For each CSS class name:\n - check if it was seen before (this information is tracked in the state map) and if its value\n changed;\n - mark it as \"touched\" - names that are not marked are not present in the latest set of binding\n and we can remove such class name from the internal data structures;\n\n After iteration over all the CSS class names we've got data structure with all the information\n necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush\n changes to the DOM and reset internal data structures so those are ready for the next change\n detection cycle.\n */\n ngDoCheck(): void {\n // classes from the [class] binding\n for (const klass of this.initialClasses) {\n this._updateState(klass, true);\n }\n\n // classes from the [ngClass] binding\n const rawClass = this.rawClass;\n if (Array.isArray(rawClass) || rawClass instanceof Set) {\n for (const klass of rawClass) {\n this._updateState(klass, true);\n }\n } else if (rawClass != null) {\n for (const klass of Object.keys(rawClass)) {\n this._updateState(klass, Boolean(rawClass[klass]));\n }\n }\n\n this._applyStateDiff();\n }\n\n private _updateState(klass: string, nextEnabled: boolean) {\n const state = this.stateMap.get(klass);\n if (state !== undefined) {\n if (state.enabled !== nextEnabled) {\n state.changed = true;\n state.enabled = nextEnabled;\n }\n state.touched = true;\n } else {\n this.stateMap.set(klass, {enabled: nextEnabled, changed: true, touched: true});\n }\n }\n\n private _applyStateDiff() {\n for (const stateEntry of this.stateMap) {\n const klass = stateEntry[0];\n const state = stateEntry[1];\n\n if (state.changed) {\n this._toggleClass(klass, state.enabled);\n state.changed = false;\n } else if (!state.touched) {\n // A class that was previously active got removed from the new collection of classes -\n // remove from the DOM as well.\n if (state.enabled) {\n this._toggleClass(klass, false);\n }\n this.stateMap.delete(klass);\n }\n\n state.touched = false;\n }\n }\n\n private _toggleClass(klass: string, enabled: boolean): void {\n if (ngDevMode) {\n if (typeof klass !== 'string') {\n throw new Error(\n `NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);\n }\n }\n klass = klass.trim();\n if (klass.length > 0) {\n klass.split(WS_REGEXP).forEach(klass => {\n if (enabled) {\n this._renderer.addClass(this._ngEl.nativeElement, klass);\n } else {\n this._renderer.removeClass(this._ngEl.nativeElement, klass);\n }\n });\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, DoCheck, EmbeddedViewRef, Input, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDiffers, NgIterable, TemplateRef, TrackByFunction, ViewContainerRef, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;\n\n/**\n * @publicApi\n */\nexport class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {\n constructor(public $implicit: T, public ngForOf: U, public index: number, public count: number) {}\n\n get first(): boolean {\n return this.index === 0;\n }\n\n get last(): boolean {\n return this.index === this.count - 1;\n }\n\n get even(): boolean {\n return this.index % 2 === 0;\n }\n\n get odd(): boolean {\n return !this.even;\n }\n}\n\n/**\n * A [structural directive](guide/structural-directives) that renders\n * a template for each item in a collection.\n * The directive is placed on an element, which becomes the parent\n * of the cloned templates.\n *\n * The `ngForOf` directive is generally used in the\n * [shorthand form](guide/structural-directives#asterisk) `*ngFor`.\n * In this form, the template to be rendered for each iteration is the content\n * of an anchor element containing the directive.\n *\n * The following example shows the shorthand syntax with some options,\n * contained in an `<li>` element.\n *\n * ```\n * <li *ngFor=\"let item of items; index as i; trackBy: trackByFn\">...</li>\n * ```\n *\n * The shorthand form expands into a long form that uses the `ngForOf` selector\n * on an `<ng-template>` element.\n * The content of the `<ng-template>` element is the `<li>` element that held the\n * short-form directive.\n *\n * Here is the expanded version of the short-form example.\n *\n * ```\n * <ng-template ngFor let-item [ngForOf]=\"items\" let-i=\"index\" [ngForTrackBy]=\"trackByFn\">\n * <li>...</li>\n * </ng-template>\n * ```\n *\n * Angular automatically expands the shorthand syntax as it compiles the template.\n * The context for each embedded view is logically merged to the current component\n * context according to its lexical position.\n *\n * When using the shorthand syntax, Angular allows only [one structural directive\n * on an element](guide/structural-directives#one-per-element).\n * If you want to iterate conditionally, for example,\n * put the `*ngIf` on a container element that wraps the `*ngFor` element.\n * For further discussion, see\n * [Structural Directives](guide/structural-directives#one-per-element).\n *\n * @usageNotes\n *\n * ### Local variables\n *\n * `NgForOf` provides exported values that can be aliased to local variables.\n * For example:\n *\n * ```\n * <li *ngFor=\"let user of users; index as i; first as isFirst\">\n * {{i}}/{{users.length}}. {{user}} <span *ngIf=\"isFirst\">default</span>\n * </li>\n * ```\n *\n * The following exported values can be aliased to local variables:\n *\n * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).\n * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is\n * more complex then a property access, for example when using the async pipe (`userStreams |\n * async`).\n * - `index: number`: The index of the current item in the iterable.\n * - `count: number`: The length of the iterable.\n * - `first: boolean`: True when the item is the first item in the iterable.\n * - `last: boolean`: True when the item is the last item in the iterable.\n * - `even: boolean`: True when the item has an even index in the iterable.\n * - `odd: boolean`: True when the item has an odd index in the iterable.\n *\n * ### Change propagation\n *\n * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n *\n * Angular uses object identity to track insertions and deletions within the iterator and reproduce\n * those changes in the DOM. This has important implications for animations and any stateful\n * controls that are present, such as `<input>` elements that accept user input. Inserted rows can\n * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state\n * such as user input.\n * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers).\n *\n * The identities of elements in the iterator can change while the data does not.\n * This can happen, for example, if the iterator is produced from an RPC to the server, and that\n * RPC is re-run. Even if the data hasn't changed, the second response produces objects with\n * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old\n * elements were deleted and all new elements inserted).\n *\n * To avoid this expensive operation, you can customize the default tracking algorithm.\n * by supplying the `trackBy` option to `NgForOf`.\n * `trackBy` takes a function that has two arguments: `index` and `item`.\n * If `trackBy` is given, Angular tracks changes by the return value of the function.\n *\n * @see [Structural Directives](guide/structural-directives)\n * @ngModule CommonModule\n * @publicApi\n */\n@Directive({\n selector: '[ngFor][ngForOf]',\n standalone: true,\n})\nexport class NgForOf<T, U extends NgIterable<T> = NgIterable<T>> implements DoCheck {\n /**\n * The value of the iterable expression, which can be used as a\n * [template input variable](guide/structural-directives#shorthand).\n */\n @Input()\n set ngForOf(ngForOf: U&NgIterable<T>|undefined|null) {\n this._ngForOf = ngForOf;\n this._ngForOfDirty = true;\n }\n /**\n * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.\n *\n * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object\n * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n * as the key.\n *\n * `NgForOf` uses the computed key to associate items in an iterable with DOM elements\n * it produces for these items.\n *\n * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an\n * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a\n * primary key), and this iterable could be updated with new object instances that still\n * represent the same underlying entity (for example, when data is re-fetched from the server,\n * and the iterable is recreated and re-rendered, but most of the data is still the same).\n *\n * @see `TrackByFunction`\n */\n @Input()\n set ngForTrackBy(fn: TrackByFunction<T>) {\n if (NG_DEV_MODE && fn != null && typeof fn !== 'function') {\n console.warn(\n `trackBy must be a function, but received ${JSON.stringify(fn)}. ` +\n `See https://angular.io/api/common/NgForOf#change-propagation for more information.`);\n }\n this._trackByFn = fn;\n }\n\n get ngForTrackBy(): TrackByFunction<T> {\n return this._trackByFn;\n }\n\n private _ngForOf: U|undefined|null = null;\n private _ngForOfDirty: boolean = true;\n private _differ: IterableDiffer<T>|null = null;\n // TODO(issue/24571): remove '!'\n // waiting for microsoft/typescript#43662 to allow the return type `TrackByFunction|undefined` for\n // the getter\n private _trackByFn!: TrackByFunction<T>;\n\n constructor(\n private _viewContainer: ViewContainerRef,\n private _template: TemplateRef<NgForOfContext<T, U>>, private _differs: IterableDiffers) {}\n\n /**\n * A reference to the template that is stamped out for each item in the iterable.\n * @see [template reference variable](guide/template-reference-variables)\n */\n @Input()\n set ngForTemplate(value: TemplateRef<NgForOfContext<T, U>>) {\n // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1\n // The current type is too restrictive; a template that just uses index, for example,\n // should be acceptable.\n if (value) {\n this._template = value;\n }\n }\n\n /**\n * Applies the changes when needed.\n * @nodoc\n */\n ngDoCheck(): void {\n if (this._ngForOfDirty) {\n this._ngForOfDirty = false;\n // React on ngForOf changes only once all inputs have been initialized\n const value = this._ngForOf;\n if (!this._differ && value) {\n if (NG_DEV_MODE) {\n try {\n // CAUTION: this logic is duplicated for production mode below, as the try-catch\n // is only present in development builds.\n this._differ = this._differs.find(value).create(this.ngForTrackBy);\n } catch {\n let errorMessage = `Cannot find a differ supporting object '${value}' of type '` +\n `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;\n if (typeof value === 'object') {\n errorMessage += ' Did you mean to use the keyvalue pipe?';\n }\n throw new RuntimeError(RuntimeErrorCode.NG_FOR_MISSING_DIFFER, errorMessage);\n }\n } else {\n // CAUTION: this logic is duplicated for development mode above, as the try-catch\n // is only present in development builds.\n this._differ = this._differs.find(value).create(this.ngForTrackBy);\n }\n }\n }\n if (this._differ) {\n const changes = this._differ.diff(this._ngForOf);\n if (changes) this._applyChanges(changes);\n }\n }\n\n private _applyChanges(changes: IterableChanges<T>) {\n const viewContainer = this._viewContainer;\n changes.forEachOperation(\n (item: IterableChangeRecord<T>, adjustedPreviousIndex: number|null,\n currentIndex: number|null) => {\n if (item.previousIndex == null) {\n // NgForOf is never \"null\" or \"undefined\" here because the differ detected\n // that a new item needs to be inserted from the iterable. This implies that\n // there is an iterable value for \"_ngForOf\".\n viewContainer.createEmbeddedView(\n this._template, new NgForOfContext<T, U>(item.item, this._ngForOf!, -1, -1),\n currentIndex === null ? undefined : currentIndex);\n } else if (currentIndex == null) {\n viewContainer.remove(\n adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);\n } else if (adjustedPreviousIndex !== null) {\n const view = viewContainer.get(adjustedPreviousIndex)!;\n viewContainer.move(view, currentIndex);\n applyViewChange(view as EmbeddedViewRef<NgForOfContext<T, U>>, item);\n }\n });\n\n for (let i = 0, ilen = viewContainer.length; i < ilen; i++) {\n const viewRef = <EmbeddedViewRef<NgForOfContext<T, U>>>viewContainer.get(i);\n const context = viewRef.context;\n context.index = i;\n context.count = ilen;\n context.ngForOf = this._ngForOf!;\n }\n\n changes.forEachIdentityChange((record: any) => {\n const viewRef = <EmbeddedViewRef<NgForOfContext<T, U>>>viewContainer.get(record.currentIndex);\n applyViewChange(viewRef, record);\n });\n }\n\n /**\n * Asserts the correct type of the context for the template that `NgForOf` will render.\n *\n * The presence of this method is a signal to the Ivy template type-check compiler that the\n * `NgForOf` structural directive renders its template with a specific context type.\n */\n static ngTemplateContextGuard<T, U extends NgIterable<T>>(dir: NgForOf<T, U>, ctx: any):\n ctx is NgForOfContext<T, U> {\n return true;\n }\n}\n\n// Also export the `NgForOf` class as `NgFor` to improve the DX for\n// cases when the directive is used as standalone, so the class name\n// matches the CSS selector (*ngFor).\nexport {NgForOf as NgFor};\n\nfunction applyViewChange<T>(\n view: EmbeddedViewRef<NgForOfContext<T>>, record: IterableChangeRecord<T>) {\n view.context.$implicit = record.item;\n}\n\nfunction getTypeName(type: any): string {\n return type['name'] || typeof type;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, EmbeddedViewRef, Input, TemplateRef, ViewContainerRef, ɵstringify as stringify} from '@angular/core';\n\n\n/**\n * A structural directive that conditionally includes a template based on the value of\n * an expression coerced to Boolean.\n * When the expression evaluates to true, Angular renders the template\n * provided in a `then` clause, and when false or null,\n * Angular renders the template provided in an optional `else` clause. The default\n * template for the `else` clause is blank.\n *\n * A [shorthand form](guide/structural-directives#asterisk) of the directive,\n * `*ngIf=\"condition\"`, is generally used, provided\n * as an attribute of the anchor element for the inserted template.\n * Angular expands this into a more explicit version, in which the anchor element\n * is contained in an `<ng-template>` element.\n *\n * Simple form with shorthand syntax:\n *\n * ```\n * <div *ngIf=\"condition\">Content to render when condition is true.</div>\n * ```\n *\n * Simple form with expanded syntax:\n *\n * ```\n * <ng-template [ngIf]=\"condition\"><div>Content to render when condition is\n * true.</div></ng-template>\n * ```\n *\n * Form with an \"else\" block:\n *\n * ```\n * <div *ngIf=\"condition; else elseBlock\">Content to render when condition is true.</div>\n * <ng-template #elseBlock>Content to render when condition is false.</ng-template>\n * ```\n *\n * Shorthand form with \"then\" and \"else\" blocks:\n *\n * ```\n * <div *ngIf=\"condition; then thenBlock else elseBlock\"></div>\n * <ng-template #thenBlock>Content to render when condition is true.</ng-template>\n * <ng-template #elseBlock>Content to render when condition is false.</ng-template>\n * ```\n *\n * Form with storing the value locally:\n *\n * ```\n * <div *ngIf=\"condition as value; else elseBlock\">{{value}}</div>\n * <ng-template #elseBlock>Content to render when value is null.</ng-template>\n * ```\n *\n * @usageNotes\n *\n * The `*ngIf` directive is most commonly used to conditionally show an inline template,\n * as seen in the following example.\n * The default `else` template is blank.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfSimple'}\n *\n * ### Showing an alternative template using `else`\n *\n * To display a template when `expression` evaluates to false, use an `else` template\n * binding as shown in the following example.\n * The `else` binding points to an `<ng-template>` element labeled `#elseBlock`.\n * The template can be defined anywhere in the component view, but is typically placed right after\n * `ngIf` for readability.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfElse'}\n *\n * ### Using an external `then` template\n *\n * In the previous example, the then-clause template is specified inline, as the content of the\n * tag that contains the `ngIf` directive. You can also specify a template that is defined\n * externally, by referencing a labeled `<ng-template>` element. When you do this, you can\n * change which template to use at runtime, as shown in the following example.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}\n *\n * ### Storing a conditional result in a variable\n *\n * You might want to show a set of properties from the same object. If you are waiting\n * for asynchronous data, the object can be undefined.\n * In this case, you can use `ngIf` and store the result of the condition in a local\n * variable as shown in the following example.\n *\n * {@example common/ngIf/ts/module.ts region='NgIfAs'}\n *\n * This code uses only one `AsyncPipe`, so only one subscription is created.\n * The conditional statement stores the result of `userStream|async` in the local variable `user`.\n * You can then bind the local `user` repeatedly.\n *\n * The conditional displays the data only if `userStream` returns a value,\n * so you don't need to use the\n * safe-navigation-operator (`?.`)\n * to guard against null values when accessing properties.\n * You can display an alternative template while waiting for the data.\n *\n * ### Shorthand syntax\n *\n * The shorthand syntax `*ngIf` expands into two separate template specifications\n * for the \"then\" and \"else\" clauses. For example, consider the following shorthand statement,\n * that is meant to show a loading page while waiting for data to be loaded.\n *\n * ```\n * <div class=\"hero-list\" *ngIf=\"heroes else loading\">\n * ...\n * </div>\n *\n * <ng-template #loading>\n * <div>Loading...</div>\n * </ng-template>\n * ```\n *\n * You can see that the \"else\" clause references the `<ng-template>`\n * with the `#loading` label, and the template for the \"then\" clause\n * is provided as the content of the anchor element.\n *\n * However, when Angular expands the shorthand syntax, it creates\n * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives.\n * The anchor element containing the template for the \"then\" clause becomes\n * the content of this unlabeled `<ng-template>` tag.\n *\n * ```\n * <ng-template [ngIf]=\"heroes\" [ngIfElse]=\"loading\">\n * <div class=\"hero-list\">\n * ...\n * </div>\n * </ng-template>\n *\n * <ng-template #loading>\n * <div>Loading...</div>\n * </ng-template>\n * ```\n *\n * The presence of the implicit template object has implications for the nesting of\n * structural directives. For more on this subject, see\n * [Structural Directives](guide/structural-directives#one-per-element).\n *\n * @ngModule CommonModule\n * @publicApi\n */\n@Directive({\n selector: '[ngIf]',\n standalone: true,\n})\nexport class NgIf<T = unknown> {\n private _context: NgIfContext<T> = new NgIfContext<T>();\n private _thenTemplateRef: TemplateRef<NgIfContext<T>>|null = null;\n private _elseTemplateRef: TemplateRef<NgIfContext<T>>|null = null;\n private _thenViewRef: EmbeddedViewRef<NgIfContext<T>>|null = null;\n private _elseViewRef: EmbeddedViewRef<NgIfContext<T>>|null = null;\n\n constructor(private _viewContainer: ViewContainerRef, templateRef: TemplateRef<NgIfContext<T>>) {\n this._thenTemplateRef = templateRef;\n }\n\n /**\n * The Boolean expression to evaluate as the condition for showing a template.\n */\n @Input()\n set ngIf(condition: T) {\n this._context.$implicit = this._context.ngIf = condition;\n this._updateView();\n }\n\n /**\n * A template to show if the condition expression evaluates to true.\n */\n @Input()\n set ngIfThen(templateRef: TemplateRef<NgIfContext<T>>|null) {\n assertTemplate('ngIfThen', templateRef);\n this._thenTemplateRef = templateRef;\n this._thenViewRef = null; // clear previous view if any.\n this._updateView();\n }\n\n /**\n * A template to show if the condition expression evaluates to false.\n */\n @Input()\n set ngIfElse(templateRef: TemplateRef<NgIfContext<T>>|null) {\n assertTemplate('ngIfElse', templateRef);\n this._elseTemplateRef = templateRef;\n this._elseViewRef = null; // clear previous view if any.\n this._updateView();\n }\n\n private _updateView() {\n if (this._context.$implicit) {\n if (!this._thenViewRef) {\n this._viewContainer.clear();\n this._elseViewRef = null;\n if (this._thenTemplateRef) {\n this._thenViewRef =\n this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);\n }\n }\n } else {\n if (!this._elseViewRef) {\n this._viewContainer.clear();\n this._thenViewRef = null;\n if (this._elseTemplateRef) {\n this._elseViewRef =\n this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);\n }\n }\n }\n }\n\n /** @internal */\n public static ngIfUseIfTypeGuard: void;\n\n /**\n * Assert the correct type of the expression bound to the `ngIf` input within the template.\n *\n * The presence of this static field is a signal to the Ivy template type check compiler that\n * when the `NgIf` structural directive renders its template, the type of the expression bound\n * to `ngIf` should be narrowed in some way. For `NgIf`, the binding expression itself is used to\n * narrow its type, which allows the strictNullChecks feature of TypeScript to work with `NgIf`.\n */\n static ngTemplateGuard_ngIf: 'binding';\n\n /**\n * Asserts the correct type of the context for the template that `NgIf` will render.\n *\n * The presence of this method is a signal to the Ivy template type-check compiler that the\n * `NgIf` structural directive renders its template with a specific context type.\n */\n static ngTemplateContextGuard<T>(dir: NgIf<T>, ctx: any):\n ctx is NgIfContext<Exclude<T, false|0|''|null|undefined>> {\n return true;\n }\n}\n\n/**\n * @publicApi\n */\nexport class NgIfContext<T = unknown> {\n public $implicit: T = null!;\n public ngIf: T = null!;\n}\n\nfunction assertTemplate(property: string, templateRef: TemplateRef<any>|null): void {\n const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);\n if (!isTemplateRefOrNull) {\n throw new Error(`${property} must be a TemplateRef, but received '${stringify(templateRef)}'.`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, DoCheck, Host, Input, Optional, TemplateRef, ViewContainerRef, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nexport class SwitchView {\n private _created = false;\n\n constructor(\n private _viewContainerRef: ViewContainerRef, private _templateRef: TemplateRef<Object>) {}\n\n create(): void {\n this._created = true;\n this._viewContainerRef.createEmbeddedView(this._templateRef);\n }\n\n destroy(): void {\n this._created = false;\n this._viewContainerRef.clear();\n }\n\n enforceState(created: boolean) {\n if (created && !this._created) {\n this.create();\n } else if (!created && this._created) {\n this.destroy();\n }\n }\n}\n\n/**\n * @ngModule CommonModule\n *\n * @description\n * The `[ngSwitch]` directive on a container specifies an expression to match against.\n * The expressions to match are provided by `ngSwitchCase` directives on views within the container.\n * - Every view that matches is rendered.\n * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.\n * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`\n * or `ngSwitchDefault` directive are preserved at the location.\n *\n * @usageNotes\n * Define a container element for the directive, and specify the switch expression\n * to match against as an attribute:\n *\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * ```\n *\n * Within the container, `*ngSwitchCase` statements specify the match expressions\n * as attributes. Include `*ngSwitchDefault` as the final case.\n *\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * ...\n * <some-element *ngSwitchDefault>...</some-element>\n * </container-element>\n * ```\n *\n * ### Usage Examples\n *\n * The following example shows how to use more than one case to display the same view:\n *\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <!-- the same view can be shown in more than one case -->\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n * <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n * <!--default case when there are no matches -->\n * <some-element *ngSwitchDefault>...</some-element>\n * </container-element>\n * ```\n *\n * The following example shows how cases can be nested:\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * <some-element *ngSwitchCase=\"match_expression_2\">...</some-element>\n * <some-other-element *ngSwitchCase=\"match_expression_3\">...</some-other-element>\n * <ng-container *ngSwitchCase=\"match_expression_3\">\n * <!-- use a ng-container to group multiple root nodes -->\n * <inner-element></inner-element>\n * <inner-other-element></inner-other-element>\n * </ng-container>\n * <some-element *ngSwitchDefault>...</some-element>\n * </container-element>\n * ```\n *\n * @publicApi\n * @see `NgSwitchCase`\n * @see `NgSwitchDefault`\n * @see [Structural Directives](guide/structural-directives)\n *\n */\n@Directive({\n selector: '[ngSwitch]',\n standalone: true,\n})\nexport class NgSwitch {\n private _defaultViews: SwitchView[] = [];\n private _defaultUsed = false;\n private _caseCount = 0;\n private _lastCaseCheckIndex = 0;\n private _lastCasesMatched = false;\n private _ngSwitch: any;\n\n @Input()\n set ngSwitch(newValue: any) {\n this._ngSwitch = newValue;\n if (this._caseCount === 0) {\n this._updateDefaultCases(true);\n }\n }\n\n /** @internal */\n _addCase(): number {\n return this._caseCount++;\n }\n\n /** @internal */\n _addDefault(view: SwitchView) {\n this._defaultViews.push(view);\n }\n\n /** @internal */\n _matchCase(value: any): boolean {\n const matched = value == this._ngSwitch;\n this._lastCasesMatched = this._lastCasesMatched || matched;\n this._lastCaseCheckIndex++;\n if (this._lastCaseCheckIndex === this._caseCount) {\n this._updateDefaultCases(!this._lastCasesMatched);\n this._lastCaseCheckIndex = 0;\n this._lastCasesMatched = false;\n }\n return matched;\n }\n\n private _updateDefaultCases(useDefault: boolean) {\n if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {\n this._defaultUsed = useDefault;\n for (const defaultView of this._defaultViews) {\n defaultView.enforceState(useDefault);\n }\n }\n }\n}\n\n/**\n * @ngModule CommonModule\n *\n * @description\n * Provides a switch case expression to match against an enclosing `ngSwitch` expression.\n * When the expressions match, the given `NgSwitchCase` template is rendered.\n * If multiple match expressions match the switch expression value, all of them are displayed.\n *\n * @usageNotes\n *\n * Within a switch container, `*ngSwitchCase` statements specify the match expressions\n * as attributes. Include `*ngSwitchDefault` as the final case.\n *\n * ```\n * <container-element [ngSwitch]=\"switch_expression\">\n * <some-element *ngSwitchCase=\"match_expression_1\">...</some-element>\n * ...\n * <some-element *ngSwitchDefault>...</some-element>\n * </container-element>\n * ```\n *\n * Each switch-case statement contains an in-line HTML template or template reference\n * that defines the subtree to be selected if the value of the match expression\n * matches the value of the switch expression.\n *\n * Unlike JavaScript, which uses strict equality, Angular uses loose equality.\n * This means that the empty string, `\"\"` matches 0.\n *\n * @publicApi\n * @see `NgSwitch`\n * @see `NgSwitchDefault`\n *\n */\n@Directive({\n selector: '[ngSwitchCase]',\n standalone: true,\n})\nexport class NgSwitchCase implements DoCheck {\n private _view: SwitchView;\n /**\n * Stores the HTML template to be selected on match.\n */\n @Input() ngSwitchCase: any;\n\n constructor(\n viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>,\n @Optional() @Host() private ngSwitch: NgSwitch) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {\n throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase');\n }\n\n ngSwitch._addCase();\n this._view = new SwitchView(viewContainer, templateRef);\n }\n\n /**\n * Performs case matching. For internal use only.\n * @nodoc\n */\n ngDoCheck() {\n this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));\n }\n}\n\n/**\n * @ngModule CommonModule\n *\n * @description\n *\n * Creates a view that is rendered when no `NgSwitchCase` expressions\n * match the `NgSwitch` expression.\n * This statement should be the final case in an `NgSwitch`.\n *\n * @publicApi\n * @see `NgSwitch`\n * @see `NgSwitchCase`\n *\n */\n@Directive({\n selector: '[ngSwitchDefault]',\n standalone: true,\n})\nexport class NgSwitchDefault {\n constructor(\n viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>,\n @Optional() @Host() ngSwitch: NgSwitch) {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {\n throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault');\n }\n\n ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));\n }\n}\n\nfunction throwNgSwitchProviderNotFoundError(attrName: string, directiveName: string): never {\n throw new RuntimeError(\n RuntimeErrorCode.PARENT_NG_SWITCH_NOT_FOUND,\n `An element with the \"${attrName}\" attribute ` +\n `(matching the \"${\n directiveName}\" directive) must be located inside an element with the \"ngSwitch\" attribute ` +\n `(matching \"NgSwitch\" directive)`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, EmbeddedViewRef, Injector, Input, OnChanges, SimpleChanges, TemplateRef, ViewContainerRef} from '@angular/core';\n\n/**\n * @ngModule CommonModule\n *\n * @description\n *\n * Inserts an embedded view from a prepared `TemplateRef`.\n *\n * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.\n * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding\n * by the local template `let` declarations.\n *\n * @usageNotes\n * ```\n * <ng-container *ngTemplateOutlet=\"templateRefExp; context: contextExp\"></ng-container>\n * ```\n *\n * Using the key `$implicit` in the context object will set its value as default.\n *\n * ### Example\n *\n * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}\n *\n * @publicApi\n */\n@Directive({\n selector: '[ngTemplateOutlet]',\n standalone: true,\n})\nexport class NgTemplateOutlet implements OnChanges {\n private _viewRef: EmbeddedViewRef<any>|null = null;\n\n /**\n * A context object to attach to the {@link EmbeddedViewRef}. This should be an\n * object, the object's keys will be available for binding by the local template `let`\n * declarations.\n * Using the key `$implicit` in the context object will set its value as default.\n */\n @Input() public ngTemplateOutletContext: Object|null = null;\n\n /**\n * A string defining the template reference and optionally the context object for the template.\n */\n @Input() public ngTemplateOutlet: TemplateRef<any>|null = null;\n\n /** Injector to be used within the embedded view. */\n @Input() public ngTemplateOutletInjector: Injector|null = null;\n\n constructor(private _viewContainerRef: ViewContainerRef) {}\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges) {\n if (changes['ngTemplateOutlet'] || changes['ngTemplateOutletInjector']) {\n const viewContainerRef = this._viewContainerRef;\n\n if (this._viewRef) {\n viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));\n }\n\n if (this.ngTemplateOutlet) {\n const {\n ngTemplateOutlet: template,\n ngTemplateOutletContext: context,\n ngTemplateOutletInjector: injector\n } = this;\n this._viewRef = viewContainerRef.createEmbeddedView(\n template, context, injector ? {injector} : undefined);\n } else {\n this._viewRef = null;\n }\n } else if (\n this._viewRef && changes['ngTemplateOutletContext'] && this.ngTemplateOutletContext) {\n this._viewRef.context = this.ngTemplateOutletContext;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type, ɵRuntimeError as RuntimeError, ɵstringify as stringify} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nexport function invalidPipeArgumentError(type: Type<any>, value: Object) {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PIPE_ARGUMENT,\n ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef, EventEmitter, OnDestroy, Pipe, PipeTransform, ɵisPromise, ɵisSubscribable} from '@angular/core';\nimport {Observable, Subscribable, Unsubscribable} from 'rxjs';\n\nimport {invalidPipeArgumentError} from './invalid_pipe_argument_error';\n\ninterface SubscriptionStrategy {\n createSubscription(async: Subscribable<any>|Promise<any>, updateLatestValue: any): Unsubscribable\n |Promise<any>;\n dispose(subscription: Unsubscribable|Promise<any>): void;\n}\n\nclass SubscribableStrategy implements SubscriptionStrategy {\n createSubscription(async: Subscribable<any>, updateLatestValue: any): Unsubscribable {\n return async.subscribe({\n next: updateLatestValue,\n error: (e: any) => {\n throw e;\n }\n });\n }\n\n dispose(subscription: Unsubscribable): void {\n subscription.unsubscribe();\n }\n}\n\nclass PromiseStrategy implements SubscriptionStrategy {\n createSubscription(async: Promise<any>, updateLatestValue: (v: any) => any): Promise<any> {\n return async.then(updateLatestValue, e => {\n throw e;\n });\n }\n\n dispose(subscription: Promise<any>): void {}\n}\n\nconst _promiseStrategy = new PromiseStrategy();\nconst _subscribableStrategy = new SubscribableStrategy();\n\n/**\n * @ngModule CommonModule\n * @description\n *\n * Unwraps a value from an asynchronous primitive.\n *\n * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has\n * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for\n * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid\n * potential memory leaks. When the reference of the expression changes, the `async` pipe\n * automatically unsubscribes from the old `Observable` or `Promise` and subscribes to the new one.\n *\n * @usageNotes\n *\n * ### Examples\n *\n * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the\n * promise.\n *\n * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}\n *\n * It's also possible to use `async` with Observables. The example below binds the `time` Observable\n * to the view. The Observable continuously updates the view with the current time.\n *\n * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}\n *\n * @publicApi\n */\n@Pipe({\n name: 'async',\n pure: false,\n standalone: true,\n})\nexport class AsyncPipe implements OnDestroy, PipeTransform {\n private _ref: ChangeDetectorRef|null;\n private _latestValue: any = null;\n\n private _subscription: Unsubscribable|Promise<any>|null = null;\n private _obj: Subscribable<any>|Promise<any>|EventEmitter<any>|null = null;\n private _strategy: SubscriptionStrategy|null = null;\n\n constructor(ref: ChangeDetectorRef) {\n // Assign `ref` into `this._ref` manually instead of declaring `_ref` in the constructor\n // parameter list, as the type of `this._ref` includes `null` unlike the type of `ref`.\n this._ref = ref;\n }\n\n ngOnDestroy(): void {\n if (this._subscription) {\n this._dispose();\n }\n // Clear the `ChangeDetectorRef` and its association with the view data, to mitigate\n // potential memory leaks in Observables that could otherwise cause the view data to\n // be retained.\n // https://github.com/angular/angular/issues/17624\n this._ref = null;\n }\n\n // NOTE(@benlesh): Because Observable has deprecated a few call patterns for `subscribe`,\n // TypeScript has a hard time matching Observable to Subscribable, for more information\n // see https://github.com/microsoft/TypeScript/issues/43643\n\n transform<T>(obj: Observable<T>|Subscribable<T>|Promise<T>): T|null;\n transform<T>(obj: null|undefined): null;\n transform<T>(obj: Observable<T>|Subscribable<T>|Promise<T>|null|undefined): T|null;\n transform<T>(obj: Observable<T>|Subscribable<T>|Promise<T>|null|undefined): T|null {\n if (!this._obj) {\n if (obj) {\n this._subscribe(obj);\n }\n return this._latestValue;\n }\n\n if (obj !== this._obj) {\n this._dispose();\n return this.transform(obj);\n }\n\n return this._latestValue;\n }\n\n private _subscribe(obj: Subscribable<any>|Promise<any>|EventEmitter<any>): void {\n this._obj = obj;\n this._strategy = this._selectStrategy(obj);\n this._subscription = this._strategy.createSubscription(\n obj, (value: Object) => this._updateLatestValue(obj, value));\n }\n\n private _selectStrategy(obj: Subscribable<any>|Promise<any>|\n EventEmitter<any>): SubscriptionStrategy {\n if (ɵisPromise(obj)) {\n return _promiseStrategy;\n }\n\n if (ɵisSubscribable(obj)) {\n return _subscribableStrategy;\n }\n\n throw invalidPipeArgumentError(AsyncPipe, obj);\n }\n\n private _dispose(): void {\n // Note: `dispose` is only called if a subscription has been initialized before, indicating\n // that `this._strategy` is also available.\n this._strategy!.dispose(this._subscription!);\n this._latestValue = null;\n this._subscription = null;\n this._obj = null;\n }\n\n private _updateLatestValue(async: any, value: Object): void {\n if (async === this._obj) {\n this._latestValue = value;\n // Note: `this._ref` is only cleared in `ngOnDestroy` so is known to be available when a\n // value is being updated.\n this._ref!.markForCheck();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * An interface that describes the date pipe configuration, which can be provided using the\n * `DATE_PIPE_DEFAULT_OPTIONS` token.\n *\n * @see `DATE_PIPE_DEFAULT_OPTIONS`\n *\n * @publicApi\n */\nexport interface DatePipeConfig {\n dateFormat: string;\n timezone: string;\n}\n\n/**\n * The default date format of Angular date pipe, which corresponds to the following format:\n * `'MMM d,y'` (e.g. `Jun 15, 2015`)\n */\nexport const DEFAULT_DATE_FORMAT = 'mediumDate';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, InjectionToken, LOCALE_ID, Optional, Pipe, PipeTransform} from '@angular/core';\n\nimport {formatDate} from '../i18n/format_date';\n\nimport {DatePipeConfig, DEFAULT_DATE_FORMAT} from './date_pipe_config';\nimport {invalidPipeArgumentError} from './invalid_pipe_argument_error';\n\n/**\n * Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`).\n * If the value isn't provided, the `DatePipe` will use the end-user's local system timezone.\n *\n * @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe\n */\nexport const DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken<string>('DATE_PIPE_DEFAULT_TIMEZONE');\n\n/**\n * DI token that allows to provide default configuration for the `DatePipe` instances in an\n * application. The value is an object which can include the following fields:\n * - `dateFormat`: configures the default date format. If not provided, the `DatePipe`\n * will use the 'mediumDate' as a value.\n * - `timezone`: configures the default timezone. If not provided, the `DatePipe` will\n * use the end-user's local system timezone.\n *\n * @see `DatePipeConfig`\n *\n * @usageNotes\n *\n * Various date pipe default values can be overwritten by providing this token with\n * the value that has this interface.\n *\n * For example:\n *\n * Override the default date format by providing a value using the token:\n * ```typescript\n * providers: [\n * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}\n * ]\n * ```\n *\n * Override the default timezone by providing a value using the token:\n * ```typescript\n * providers: [\n * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}\n * ]\n * ```\n */\nexport const DATE_PIPE_DEFAULT_OPTIONS =\n new InjectionToken<DatePipeConfig>('DATE_PIPE_DEFAULT_OPTIONS');\n\n// clang-format off\n/**\n * @ngModule CommonModule\n * @description\n *\n * Formats a date value according to locale rules.\n *\n * `DatePipe` is executed only when it detects a pure change to the input value.\n * A pure change is either a change to a primitive input value\n * (such as `String`, `Number`, `Boolean`, or `Symbol`),\n * or a changed object reference (such as `Date`, `Array`, `Function`, or `Object`).\n *\n * Note that mutating a `Date` object does not cause the pipe to be rendered again.\n * To ensure that the pipe is executed, you must create a new `Date` object.\n *\n * Only the `en-US` locale data comes with Angular. To localize dates\n * in another language, you must import the corresponding locale data.\n * See the [I18n guide](guide/i18n-common-format-data-locale) for more information.\n *\n * The time zone of the formatted value can be specified either by passing it in as the second\n * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_OPTIONS`\n * injection token. The value that is passed in as the second parameter takes precedence over\n * the one defined using the injection token.\n *\n * @see `formatDate()`\n *\n *\n * @usageNotes\n *\n * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to\n * reformat the date on every change-detection cycle, treat the date as an immutable object\n * and change the reference when the pipe needs to run again.\n *\n * ### Pre-defined format options\n *\n * | Option | Equivalent to | Examples (given in `en-US` locale) |\n * |---------------|-------------------------------------|-------------------------------------------------|\n * | `'short'` | `'M/d/yy, h:mm a'` | `6/15/15, 9:03 AM` |\n * | `'medium'` | `'MMM d, y, h:mm:ss a'` | `Jun 15, 2015, 9:03:01 AM` |\n * | `'long'` | `'MMMM d, y, h:mm:ss a z'` | `June 15, 2015 at 9:03:01 AM GMT+1` |\n * | `'full'` | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |\n * | `'shortDate'` | `'M/d/yy'` | `6/15/15` |\n * | `'mediumDate'`| `'MMM d, y'` | `Jun 15, 2015` |\n * | `'longDate'` | `'MMMM d, y'` | `June 15, 2015` |\n * | `'fullDate'` | `'EEEE, MMMM d, y'` | `Monday, June 15, 2015` |\n * | `'shortTime'` | `'h:mm a'` | `9:03 AM` |\n * | `'mediumTime'`| `'h:mm:ss a'` | `9:03:01 AM` |\n * | `'longTime'` | `'h:mm:ss a z'` | `9:03:01 AM GMT+1` |\n * | `'fullTime'` | `'h:mm:ss a zzzz'` | `9:03:01 AM GMT+01:00` |\n *\n * ### Custom format options\n *\n * You can construct a format string using symbols to specify the components\n * of a date-time value, as described in the following table.\n * Format details depend on the locale.\n * Fields marked with (*) are only available in the extra data set for the given locale.\n *\n * | Field type | Format | Description | Example Value |\n * |-------------------- |-------------|---------------------------------------------------------------|------------------------------------------------------------|\n * | Era | G, GG & GGG | Abbreviated | AD |\n * | | GGGG | Wide | Anno Domini |\n * | | GGGGG | Narrow | A |\n * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |\n * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |\n * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |\n * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |\n * | Week-numbering year | Y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |\n * | | YY | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |\n * | | YYY | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |\n * | | YYYY | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |\n * | Month | M | Numeric: 1 digit | 9, 12 |\n * | | MM | Numeric: 2 digits + zero padded | 09, 12 |\n * | | MMM | Abbreviated | Sep |\n * | | MMMM | Wide | September |\n * | | MMMMM | Narrow | S |\n * | Month standalone | L | Numeric: 1 digit | 9, 12 |\n * | | LL | Numeric: 2 digits + zero padded | 09, 12 |\n * | | LLL | Abbreviated | Sep |\n * | | LLLL | Wide | September |\n * | | LLLLL | Narrow | S |\n * | Week of year | w | Numeric: minimum digits | 1... 53 |\n * | | ww | Numeric: 2 digits + zero padded | 01... 53 |\n * | Week of month | W | Numeric: 1 digit | 1... 5 |\n * | Day of month | d | Numeric: minimum digits | 1 |\n * | | dd | Numeric: 2 digits + zero padded | 01 |\n * | Week day | E, EE & EEE | Abbreviated | Tue |\n * | | EEEE | Wide | Tuesday |\n * | | EEEEE | Narrow | T |\n * | | EEEEEE | Short | Tu |\n * | Week day standalone | c, cc | Numeric: 1 digit | 2 |\n * | | ccc | Abbreviated | Tue |\n * | | cccc | Wide | Tuesday |\n * | | ccccc | Narrow | T |\n * | | cccccc | Short | Tu |\n * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |\n * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |\n * | | aaaaa | Narrow | a/p |\n * | Period* | B, BB & BBB | Abbreviated | mid. |\n * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | BBBBB | Narrow | md |\n * | Period standalone* | b, bb & bbb | Abbreviated | mid. |\n * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |\n * | | bbbbb | Narrow | md |\n * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |\n * | | hh | Numeric: 2 digits + zero padded | 01, 12 |\n * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |\n * | | HH | Numeric: 2 digits + zero padded | 00, 23 |\n * | Minute | m | Numeric: minimum digits | 8, 59 |\n * | | mm | Numeric: 2 digits + zero padded | 08, 59 |\n * | Second | s | Numeric: minimum digits | 0... 59 |\n * | | ss | Numeric: 2 digits + zero padded | 00... 59 |\n * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |\n * | | SS | Numeric: 2 digits + zero padded | 00... 99 |\n * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |\n * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |\n * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |\n * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |\n * | | ZZZZ | Long localized GMT format | GMT-8:00 |\n * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |\n * | | O, OO & OOO | Short localized GMT format | GMT-8 |\n * | | OOOO | Long localized GMT format | GMT-08:00 |\n *\n *\n * ### Format examples\n *\n * These examples transform a date into various formats,\n * assuming that `dateObj` is a JavaScript `Date` object for\n * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,\n * given in the local time for the `en-US` locale.\n *\n * ```\n * {{ dateObj | date }} // output is 'Jun 15, 2015'\n * {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'\n * {{ dateObj | date:'shortTime' }} // output is '9:43 PM'\n * {{ dateObj | date:'mm:ss' }} // output is '43:11'\n * ```\n *\n * ### Usage example\n *\n * The following component uses a date pipe to display the current date in different formats.\n *\n * ```\n * @Component({\n * selector: 'date-pipe',\n * template: `<div>\n * <p>Today is {{today | date}}</p>\n * <p>Or if you prefer, {{today | date:'fullDate'}}</p>\n * <p>The time is {{today | date:'h:mm a z'}}</p>\n * </div>`\n * })\n * // Get the current date and time as a date-time value.\n * export class DatePipeComponent {\n * today: number = Date.now();\n * }\n * ```\n *\n * @publicApi\n */\n// clang-format on\n@Pipe({\n name: 'date',\n pure: true,\n standalone: true,\n})\nexport class DatePipe implements PipeTransform {\n constructor(\n @Inject(LOCALE_ID) private locale: string,\n @Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() private defaultTimezone?: string|null,\n @Inject(DATE_PIPE_DEFAULT_OPTIONS) @Optional() private defaultOptions?: DatePipeConfig|null,\n ) {}\n\n /**\n * @param value The date expression: a `Date` object, a number\n * (milliseconds since UTC epoch), or an ISO string (https://www.w3.org/TR/NOTE-datetime).\n * @param format The date/time components to include, using predefined options or a\n * custom format string. When not provided, the `DatePipe` looks for the value using the\n * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `dateFormat` property).\n * If the token is not configured, the `mediumDate` is used as a value.\n * @param timezone A timezone offset (such as `'+0430'`), or a standard UTC/GMT, or continental US\n * timezone abbreviation. When not provided, the `DatePipe` looks for the value using the\n * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `timezone` property). If the token\n * is not configured, the end-user's local system timezone is used as a value.\n * @param locale A locale code for the locale format rules to use.\n * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.\n * See [Setting your app locale](guide/i18n-common-locale-id).\n *\n * @see `DATE_PIPE_DEFAULT_OPTIONS`\n *\n * @returns A date string in the desired format.\n */\n transform(value: Date|string|number, format?: string, timezone?: string, locale?: string): string\n |null;\n transform(value: null|undefined, format?: string, timezone?: string, locale?: string): null;\n transform(\n value: Date|string|number|null|undefined, format?: string, timezone?: string,\n locale?: string): string|null;\n transform(\n value: Date|string|number|null|undefined, format?: string, timezone?: string,\n locale?: string): string|null {\n if (value == null || value === '' || value !== value) return null;\n\n try {\n const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;\n const _timezone =\n timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;\n return formatDate(value, _format, locale || this.locale, _timezone);\n } catch (error) {\n throw invalidPipeArgumentError(DatePipe, (error as Error).message);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {COMMON_DIRECTIVES} from './directives/index';\nimport {COMMON_PIPES} from './pipes/index';\n\n\n\n// Note: This does not contain the location providers,\n// as they need some platform specific implementations to work.\n/**\n * Exports all the basic Angular directives and pipes,\n * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command.\n *\n * @publicApi\n */\n@NgModule({\n imports: [COMMON_DIRECTIVES, COMMON_PIPES],\n exports: [COMMON_DIRECTIVES, COMMON_PIPES],\n})\nexport class CommonModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const PLATFORM_BROWSER_ID = 'browser';\nexport const PLATFORM_SERVER_ID = 'server';\nexport const PLATFORM_WORKER_APP_ID = 'browserWorkerApp';\nexport const PLATFORM_WORKER_UI_ID = 'browserWorkerUi';\n\n/**\n * Returns whether a platform id represents a browser platform.\n * @publicApi\n */\nexport function isPlatformBrowser(platformId: Object): boolean {\n return platformId === PLATFORM_BROWSER_ID;\n}\n\n/**\n * Returns whether a platform id represents a server platform.\n * @publicApi\n */\nexport function isPlatformServer(platformId: Object): boolean {\n return platformId === PLATFORM_SERVER_ID;\n}\n\n/**\n * Returns whether a platform id represents a web worker app platform.\n * @publicApi\n */\nexport function isPlatformWorkerApp(platformId: Object): boolean {\n return platformId === PLATFORM_WORKER_APP_ID;\n}\n\n/**\n * Returns whether a platform id represents a web worker UI platform.\n * @publicApi\n */\nexport function isPlatformWorkerUi(platformId: Object): boolean {\n return platformId === PLATFORM_WORKER_UI_ID;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A wrapper around the `XMLHttpRequest` constructor.\n *\n * @publicApi\n */\nexport abstract class XhrFactory {\n abstract build(): XMLHttpRequest;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵDomAdapter as DomAdapter} from '@angular/common';\n\n\n\n/**\n * Provides DOM operations in any browser environment.\n *\n * @security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\nexport abstract class GenericBrowserDomAdapter extends DomAdapter {\n readonly supportsDOMEvents: boolean = true;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵparseCookieValue as parseCookieValue, ɵsetRootDomAdapter as setRootDomAdapter} from '@angular/common';\n\nimport {GenericBrowserDomAdapter} from './generic_browser_adapter';\n\n/**\n * A `DomAdapter` powered by full browser DOM APIs.\n *\n * @security Tread carefully! Interacting with the DOM directly is dangerous and\n * can introduce XSS risks.\n */\n/* tslint:disable:requireParameterType no-console */\nexport class BrowserDomAdapter extends GenericBrowserDomAdapter {\n static makeCurrent() {\n setRootDomAdapter(new BrowserDomAdapter());\n }\n\n onAndCancel(el: Node, evt: any, listener: any): Function {\n el.addEventListener(evt, listener, false);\n // Needed to follow Dart's subscription semantic, until fix of\n // https://code.google.com/p/dart/issues/detail?id=17406\n return () => {\n el.removeEventListener(evt, listener, false);\n };\n }\n dispatchEvent(el: Node, evt: any) {\n el.dispatchEvent(evt);\n }\n remove(node: Node): void {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n createElement(tagName: string, doc?: Document): HTMLElement {\n doc = doc || this.getDefaultDocument();\n return doc.createElement(tagName);\n }\n createHtmlDocument(): Document {\n return document.implementation.createHTMLDocument('fakeTitle');\n }\n getDefaultDocument(): Document {\n return document;\n }\n\n isElementNode(node: Node): boolean {\n return node.nodeType === Node.ELEMENT_NODE;\n }\n\n isShadowRoot(node: any): boolean {\n return node instanceof DocumentFragment;\n }\n\n /** @deprecated No longer being used in Ivy code. To be removed in version 14. */\n getGlobalEventTarget(doc: Document, target: string): EventTarget|null {\n if (target === 'window') {\n return window;\n }\n if (target === 'document') {\n return doc;\n }\n if (target === 'body') {\n return doc.body;\n }\n return null;\n }\n getBaseHref(doc: Document): string|null {\n const href = getBaseElementHref();\n return href == null ? null : relativePath(href);\n }\n resetBaseElement(): void {\n baseElement = null;\n }\n getUserAgent(): string {\n return window.navigator.userAgent;\n }\n getCookie(name: string): string|null {\n return parseCookieValue(document.cookie, name);\n }\n}\n\nlet baseElement: HTMLElement|null = null;\nfunction getBaseElementHref(): string|null {\n baseElement = baseElement || document.querySelector('base');\n return baseElement ? baseElement.getAttribute('href') : null;\n}\n\n// based on urlUtils.js in AngularJS 1\nlet urlParsingNode: HTMLAnchorElement|undefined;\nfunction relativePath(url: any): string {\n urlParsingNode = urlParsingNode || document.createElement('a');\n urlParsingNode.setAttribute('href', url);\n const pathName = urlParsingNode.pathname;\n return pathName.charAt(0) === '/' ? pathName : `/${pathName}`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {APP_INITIALIZER, ApplicationInitStatus, InjectionToken, Injector, StaticProvider} from '@angular/core';\n\n/**\n * An id that identifies a particular application being bootstrapped, that should\n * match across the client/server boundary.\n */\nexport const TRANSITION_ID = new InjectionToken('TRANSITION_ID');\n\nexport function appInitializerFactory(transitionId: string, document: any, injector: Injector) {\n return () => {\n // Wait for all application initializers to be completed before removing the styles set by\n // the server.\n injector.get(ApplicationInitStatus).donePromise.then(() => {\n const dom = getDOM();\n const styles: HTMLCollectionOf<HTMLStyleElement> =\n document.querySelectorAll(`style[ng-transition=\"${transitionId}\"]`);\n for (let i = 0; i < styles.length; i++) {\n dom.remove(styles[i]);\n }\n });\n };\n}\n\nexport const SERVER_TRANSITION_PROVIDERS: StaticProvider[] = [\n {\n provide: APP_INITIALIZER,\n useFactory: appInitializerFactory,\n deps: [TRANSITION_ID, DOCUMENT, Injector],\n multi: true\n },\n];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {XhrFactory} from '@angular/common';\nimport {Injectable} from '@angular/core';\n\n/**\n * A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API.\n */\n@Injectable()\nexport class BrowserXhr implements XhrFactory {\n build(): XMLHttpRequest {\n return new XMLHttpRequest();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable, InjectionToken, NgZone} from '@angular/core';\n\n/**\n * The injection token for the event-manager plug-in service.\n *\n * @publicApi\n */\nexport const EVENT_MANAGER_PLUGINS =\n new InjectionToken<EventManagerPlugin[]>('EventManagerPlugins');\n\n/**\n * An injectable service that provides event management for Angular\n * through a browser plug-in.\n *\n * @publicApi\n */\n@Injectable()\nexport class EventManager {\n private _plugins: EventManagerPlugin[];\n private _eventNameToPlugin = new Map<string, EventManagerPlugin>();\n\n /**\n * Initializes an instance of the event-manager service.\n */\n constructor(@Inject(EVENT_MANAGER_PLUGINS) plugins: EventManagerPlugin[], private _zone: NgZone) {\n plugins.forEach((plugin) => {\n plugin.manager = this;\n });\n this._plugins = plugins.slice().reverse();\n }\n\n /**\n * Registers a handler for a specific element and event.\n *\n * @param element The HTML element to receive event notifications.\n * @param eventName The name of the event to listen for.\n * @param handler A function to call when the notification occurs. Receives the\n * event object as an argument.\n * @returns A callback function that can be used to remove the handler.\n */\n addEventListener(element: HTMLElement, eventName: string, handler: Function): Function {\n const plugin = this._findPluginFor(eventName);\n return plugin.addEventListener(element, eventName, handler);\n }\n\n /**\n * Registers a global handler for an event in a target view.\n *\n * @param target A target for global event notifications. One of \"window\", \"document\", or \"body\".\n * @param eventName The name of the event to listen for.\n * @param handler A function to call when the notification occurs. Receives the\n * event object as an argument.\n * @returns A callback function that can be used to remove the handler.\n * @deprecated No longer being used in Ivy code. To be removed in version 14.\n */\n addGlobalEventListener(target: string, eventName: string, handler: Function): Function {\n const plugin = this._findPluginFor(eventName);\n return plugin.addGlobalEventListener(target, eventName, handler);\n }\n\n /**\n * Retrieves the compilation zone in which event listeners are registered.\n */\n getZone(): NgZone {\n return this._zone;\n }\n\n /** @internal */\n _findPluginFor(eventName: string): EventManagerPlugin {\n const plugin = this._eventNameToPlugin.get(eventName);\n if (plugin) {\n return plugin;\n }\n\n const plugins = this._plugins;\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.supports(eventName)) {\n this._eventNameToPlugin.set(eventName, plugin);\n return plugin;\n }\n }\n throw new Error(`No event manager plugin found for event ${eventName}`);\n }\n}\n\nexport abstract class EventManagerPlugin {\n constructor(private _doc: any) {}\n\n // Using non-null assertion because it's set by EventManager's constructor\n manager!: EventManager;\n\n abstract supports(eventName: string): boolean;\n\n abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;\n\n addGlobalEventListener(element: string, eventName: string, handler: Function): Function {\n const target: HTMLElement = getDOM().getGlobalEventTarget(this._doc, element);\n if (!target) {\n throw new Error(`Unsupported event target ${target} for event ${eventName}`);\n }\n return this.addEventListener(target, eventName, handler);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, OnDestroy} from '@angular/core';\n\n@Injectable()\nexport class SharedStylesHost implements OnDestroy {\n private readonly usageCount = new Map<string /** Style string */, number /** Usage count */>();\n\n addStyles(styles: string[]): void {\n for (const style of styles) {\n const usageCount = this.changeUsageCount(style, 1);\n\n if (usageCount === 1) {\n this.onStyleAdded(style);\n }\n }\n }\n\n removeStyles(styles: string[]): void {\n for (const style of styles) {\n const usageCount = this.changeUsageCount(style, -1);\n\n if (usageCount === 0) {\n this.onStyleRemoved(style);\n }\n }\n }\n\n onStyleRemoved(style: string): void {}\n\n onStyleAdded(style: string): void {}\n\n getAllStyles(): IterableIterator<string> {\n return this.usageCount.keys();\n }\n\n private changeUsageCount(style: string, delta: number): number {\n const map = this.usageCount;\n let usage = map.get(style) ?? 0;\n usage += delta;\n\n if (usage > 0) {\n map.set(style, usage);\n } else {\n map.delete(style);\n }\n\n return usage;\n }\n\n ngOnDestroy(): void {\n for (const style of this.getAllStyles()) {\n this.onStyleRemoved(style);\n }\n\n this.usageCount.clear();\n }\n}\n\n@Injectable()\nexport class DomSharedStylesHost extends SharedStylesHost implements OnDestroy {\n // Maps all registered host nodes to a list of style nodes that have been added to the host node.\n private readonly styleRef = new Map<string, HTMLStyleElement[]>();\n private hostNodes = new Set<Node>();\n\n constructor(@Inject(DOCUMENT) private readonly doc: any) {\n super();\n this.resetHostNodes();\n }\n\n override onStyleAdded(style: string): void {\n for (const host of this.hostNodes) {\n this.addStyleToHost(host, style);\n }\n }\n\n override onStyleRemoved(style: string): void {\n const styleRef = this.styleRef;\n const styleElements = styleRef.get(style);\n styleElements?.forEach(e => e.remove());\n styleRef.delete(style);\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.styleRef.clear();\n this.resetHostNodes();\n }\n\n addHost(hostNode: Node): void {\n this.hostNodes.add(hostNode);\n\n for (const style of this.getAllStyles()) {\n this.addStyleToHost(hostNode, style);\n }\n }\n\n removeHost(hostNode: Node): void {\n this.hostNodes.delete(hostNode);\n }\n\n private addStyleToHost(host: Node, style: string): void {\n const styleEl = this.doc.createElement('style');\n styleEl.textContent = style;\n host.appendChild(styleEl);\n\n const styleElRef = this.styleRef.get(style);\n if (styleElRef) {\n styleElRef.push(styleEl);\n } else {\n this.styleRef.set(style, [styleEl]);\n }\n }\n\n private resetHostNodes(): void {\n const hostNodes = this.hostNodes;\n hostNodes.clear();\n // Re-add the head element back since this is the default host.\n hostNodes.add(this.doc.head);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {APP_ID, Inject, Injectable, InjectionToken, OnDestroy, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, ViewEncapsulation} from '@angular/core';\n\nimport {EventManager} from './events/event_manager';\nimport {DomSharedStylesHost} from './shared_styles_host';\n\nexport const NAMESPACE_URIS: {[ns: string]: string} = {\n 'svg': 'http://www.w3.org/2000/svg',\n 'xhtml': 'http://www.w3.org/1999/xhtml',\n 'xlink': 'http://www.w3.org/1999/xlink',\n 'xml': 'http://www.w3.org/XML/1998/namespace',\n 'xmlns': 'http://www.w3.org/2000/xmlns/',\n 'math': 'http://www.w3.org/1998/MathML/',\n};\n\nconst COMPONENT_REGEX = /%COMP%/g;\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;\n\nexport const COMPONENT_VARIABLE = '%COMP%';\nexport const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;\nexport const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;\n\n/**\n * The default value for the `REMOVE_STYLES_ON_COMPONENT_DESTROY` DI token.\n */\nconst REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = false;\n\n/**\n * A [DI token](guide/glossary#di-token \"DI token definition\") that indicates whether styles\n * of destroyed components should be removed from DOM.\n *\n * By default, the value is set to `false`. This will be changed in the next major version.\n * @publicApi\n */\nexport const REMOVE_STYLES_ON_COMPONENT_DESTROY =\n new InjectionToken<boolean>('RemoveStylesOnCompDestory', {\n providedIn: 'root',\n factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT,\n });\n\nexport function shimContentAttribute(componentShortId: string): string {\n return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n\nexport function shimHostAttribute(componentShortId: string): string {\n return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);\n}\n\nexport function flattenStyles(compId: string, styles: Array<string|string[]>): string[] {\n // Cannot use `Infinity` as depth as `infinity` is not a number literal in TypeScript.\n // See: https://github.com/microsoft/TypeScript/issues/32277\n return styles.flat(100).map(s => s.replace(COMPONENT_REGEX, compId));\n}\n\nfunction decoratePreventDefault(eventHandler: Function): Function {\n // `DebugNode.triggerEventHandler` needs to know if the listener was created with\n // decoratePreventDefault or is a listener added outside the Angular context so it can handle the\n // two differently. In the first case, the special '__ngUnwrap__' token is passed to the unwrap\n // the listener (see below).\n return (event: any) => {\n // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function\n // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The debug_node\n // can inspect the listener toString contents for the existence of this special token. Because\n // the token is a string literal, it is ensured to not be modified by compiled code.\n if (event === '__ngUnwrap__') {\n return eventHandler;\n }\n\n const allowDefaultBehavior = eventHandler(event);\n if (allowDefaultBehavior === false) {\n // TODO(tbosch): move preventDefault into event plugins...\n event.preventDefault();\n event.returnValue = false;\n }\n\n return undefined;\n };\n}\n\n@Injectable()\nexport class DomRendererFactory2 implements RendererFactory2, OnDestroy {\n private rendererByCompId =\n new Map<string, EmulatedEncapsulationDomRenderer2|NoneEncapsulationDomRenderer>();\n private defaultRenderer: Renderer2;\n\n constructor(\n private eventManager: EventManager, private sharedStylesHost: DomSharedStylesHost,\n @Inject(APP_ID) private appId: string,\n @Inject(REMOVE_STYLES_ON_COMPONENT_DESTROY) private removeStylesOnCompDestory: boolean) {\n this.defaultRenderer = new DefaultDomRenderer2(eventManager);\n }\n\n createRenderer(element: any, type: RendererType2|null): Renderer2 {\n if (!element || !type) {\n return this.defaultRenderer;\n }\n\n const renderer = this.getOrCreateRenderer(element, type);\n\n // Renderers have different logic due to different encapsulation behaviours.\n // Ex: for emulated, an attribute is added to the element.\n if (renderer instanceof EmulatedEncapsulationDomRenderer2) {\n renderer.applyToHost(element);\n } else if (renderer instanceof NoneEncapsulationDomRenderer) {\n renderer.applyStyles();\n }\n\n return renderer;\n }\n\n private getOrCreateRenderer(element: any, type: RendererType2): Renderer2 {\n const rendererByCompId = this.rendererByCompId;\n let renderer = rendererByCompId.get(type.id);\n\n if (!renderer) {\n const eventManager = this.eventManager;\n const sharedStylesHost = this.sharedStylesHost;\n const removeStylesOnCompDestory = this.removeStylesOnCompDestory;\n\n switch (type.encapsulation) {\n case ViewEncapsulation.Emulated:\n renderer = new EmulatedEncapsulationDomRenderer2(\n eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestory);\n break;\n case ViewEncapsulation.ShadowDom:\n return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type);\n default:\n renderer = new NoneEncapsulationDomRenderer(\n eventManager, sharedStylesHost, type, removeStylesOnCompDestory);\n break;\n }\n\n renderer.onDestroy = () => rendererByCompId.delete(type.id);\n rendererByCompId.set(type.id, renderer);\n }\n\n return renderer;\n }\n\n ngOnDestroy() {\n this.rendererByCompId.clear();\n }\n\n begin() {}\n end() {}\n}\n\nclass DefaultDomRenderer2 implements Renderer2 {\n data: {[key: string]: any} = Object.create(null);\n\n constructor(private eventManager: EventManager) {}\n\n destroy(): void {}\n\n destroyNode = null;\n\n createElement(name: string, namespace?: string): any {\n if (namespace) {\n // TODO: `|| namespace` was added in\n // https://github.com/angular/angular/commit/2b9cc8503d48173492c29f5a271b61126104fbdb to\n // support how Ivy passed around the namespace URI rather than short name at the time. It did\n // not, however extend the support to other parts of the system (setAttribute, setAttribute,\n // and the ServerRenderer). We should decide what exactly the semantics for dealing with\n // namespaces should be and make it consistent.\n // Related issues:\n // https://github.com/angular/angular/issues/44028\n // https://github.com/angular/angular/issues/44883\n return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);\n }\n\n return document.createElement(name);\n }\n\n createComment(value: string): any {\n return document.createComment(value);\n }\n\n createText(value: string): any {\n return document.createTextNode(value);\n }\n\n appendChild(parent: any, newChild: any): void {\n const targetParent = isTemplateNode(parent) ? parent.content : parent;\n targetParent.appendChild(newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any): void {\n if (parent) {\n const targetParent = isTemplateNode(parent) ? parent.content : parent;\n targetParent.insertBefore(newChild, refChild);\n }\n }\n\n removeChild(parent: any, oldChild: any): void {\n if (parent) {\n parent.removeChild(oldChild);\n }\n }\n\n selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any {\n let el: any = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :\n selectorOrNode;\n if (!el) {\n throw new Error(`The selector \"${selectorOrNode}\" did not match any elements`);\n }\n if (!preserveContent) {\n el.textContent = '';\n }\n return el;\n }\n\n parentNode(node: any): any {\n return node.parentNode;\n }\n\n nextSibling(node: any): any {\n return node.nextSibling;\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string): void {\n if (namespace) {\n name = namespace + ':' + name;\n const namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.setAttributeNS(namespaceUri, name, value);\n } else {\n el.setAttribute(name, value);\n }\n } else {\n el.setAttribute(name, value);\n }\n }\n\n removeAttribute(el: any, name: string, namespace?: string): void {\n if (namespace) {\n const namespaceUri = NAMESPACE_URIS[namespace];\n if (namespaceUri) {\n el.removeAttributeNS(namespaceUri, name);\n } else {\n el.removeAttribute(`${namespace}:${name}`);\n }\n } else {\n el.removeAttribute(name);\n }\n }\n\n addClass(el: any, name: string): void {\n el.classList.add(name);\n }\n\n removeClass(el: any, name: string): void {\n el.classList.remove(name);\n }\n\n setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n if (flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {\n el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? 'important' : '');\n } else {\n el.style[style] = value;\n }\n }\n\n removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n if (flags & RendererStyleFlags2.DashCase) {\n el.style.removeProperty(style);\n } else {\n // IE requires '' instead of null\n // see https://github.com/angular/angular/issues/7916\n el.style[style] = '';\n }\n }\n\n setProperty(el: any, name: string, value: any): void {\n NG_DEV_MODE && checkNoSyntheticProp(name, 'property');\n el[name] = value;\n }\n\n setValue(node: any, value: string): void {\n node.nodeValue = value;\n }\n\n listen(target: 'window'|'document'|'body'|any, event: string, callback: (event: any) => boolean):\n () => void {\n NG_DEV_MODE && checkNoSyntheticProp(event, 'listener');\n if (typeof target === 'string') {\n return <() => void>this.eventManager.addGlobalEventListener(\n target, event, decoratePreventDefault(callback));\n }\n return <() => void>this.eventManager.addEventListener(\n target, event, decoratePreventDefault(callback)) as () => void;\n }\n}\n\nconst AT_CHARCODE = (() => '@'.charCodeAt(0))();\nfunction checkNoSyntheticProp(name: string, nameKind: string) {\n if (name.charCodeAt(0) === AT_CHARCODE) {\n throw new Error(`Unexpected synthetic ${nameKind} ${name} found. Please make sure that:\n - Either \\`BrowserAnimationsModule\\` or \\`NoopAnimationsModule\\` are imported in your application.\n - There is corresponding configuration for the animation named \\`${\n name}\\` defined in the \\`animations\\` field of the \\`@Component\\` decorator (see https://angular.io/api/core/Component#animations).`);\n }\n}\n\n\nfunction isTemplateNode(node: any): node is HTMLTemplateElement {\n return node.tagName === 'TEMPLATE' && node.content !== undefined;\n}\n\nclass ShadowDomRenderer extends DefaultDomRenderer2 {\n private shadowRoot: any;\n\n constructor(\n eventManager: EventManager, private sharedStylesHost: DomSharedStylesHost,\n private hostEl: any, component: RendererType2) {\n super(eventManager);\n this.shadowRoot = (hostEl as any).attachShadow({mode: 'open'});\n\n this.sharedStylesHost.addHost(this.shadowRoot);\n const styles = flattenStyles(component.id, component.styles);\n\n for (const style of styles) {\n const styleEl = document.createElement('style');\n styleEl.textContent = style;\n this.shadowRoot.appendChild(styleEl);\n }\n }\n\n private nodeOrShadowRoot(node: any): any {\n return node === this.hostEl ? this.shadowRoot : node;\n }\n\n override appendChild(parent: any, newChild: any): void {\n return super.appendChild(this.nodeOrShadowRoot(parent), newChild);\n }\n override insertBefore(parent: any, newChild: any, refChild: any): void {\n return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);\n }\n override removeChild(parent: any, oldChild: any): void {\n return super.removeChild(this.nodeOrShadowRoot(parent), oldChild);\n }\n override parentNode(node: any): any {\n return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));\n }\n\n override destroy() {\n this.sharedStylesHost.removeHost(this.shadowRoot);\n }\n}\n\nclass NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {\n private readonly styles: string[];\n private rendererUsageCount = 0;\n onDestroy: VoidFunction|undefined;\n\n constructor(\n eventManager: EventManager,\n private readonly sharedStylesHost: DomSharedStylesHost,\n component: RendererType2,\n private removeStylesOnCompDestory: boolean,\n compId = component.id,\n ) {\n super(eventManager);\n this.styles = flattenStyles(compId, component.styles);\n }\n\n applyStyles(): void {\n this.sharedStylesHost.addStyles(this.styles);\n this.rendererUsageCount++;\n }\n\n override destroy(): void {\n if (!this.removeStylesOnCompDestory) {\n return;\n }\n\n this.sharedStylesHost.removeStyles(this.styles);\n this.rendererUsageCount--;\n if (this.rendererUsageCount === 0) {\n this.onDestroy?.();\n }\n }\n}\n\nclass EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer {\n private contentAttr: string;\n private hostAttr: string;\n\n constructor(\n eventManager: EventManager, sharedStylesHost: DomSharedStylesHost, component: RendererType2,\n appId: string, removeStylesOnCompDestory: boolean) {\n const compId = appId + '-' + component.id;\n super(eventManager, sharedStylesHost, component, removeStylesOnCompDestory, compId);\n this.contentAttr = shimContentAttribute(compId);\n this.hostAttr = shimHostAttribute(compId);\n }\n\n applyToHost(element: any): void {\n this.applyStyles();\n this.setAttribute(element, this.hostAttr, '');\n }\n\n override createElement(parent: any, name: string): Element {\n const el = super.createElement(parent, name);\n super.setAttribute(el, this.contentAttr, '');\n return el;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\n\nimport {EventManagerPlugin} from './event_manager';\n\n@Injectable()\nexport class DomEventsPlugin extends EventManagerPlugin {\n constructor(@Inject(DOCUMENT) doc: any) {\n super(doc);\n }\n\n // This plugin should come last in the list of plugins, because it accepts all\n // events.\n override supports(eventName: string): boolean {\n return true;\n }\n\n override addEventListener(element: HTMLElement, eventName: string, handler: Function): Function {\n element.addEventListener(eventName, handler as EventListener, false);\n return () => this.removeEventListener(element, eventName, handler as EventListener);\n }\n\n removeEventListener(target: any, eventName: string, callback: Function): void {\n return target.removeEventListener(eventName, callback as EventListener);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable, NgZone} from '@angular/core';\n\nimport {EventManagerPlugin} from './event_manager';\n\n/**\n * Defines supported modifiers for key events.\n */\nconst MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];\n\n// The following values are here for cross-browser compatibility and to match the W3C standard\n// cf https://www.w3.org/TR/DOM-Level-3-Events-key/\nconst _keyMap: {[k: string]: string} = {\n '\\b': 'Backspace',\n '\\t': 'Tab',\n '\\x7F': 'Delete',\n '\\x1B': 'Escape',\n 'Del': 'Delete',\n 'Esc': 'Escape',\n 'Left': 'ArrowLeft',\n 'Right': 'ArrowRight',\n 'Up': 'ArrowUp',\n 'Down': 'ArrowDown',\n 'Menu': 'ContextMenu',\n 'Scroll': 'ScrollLock',\n 'Win': 'OS'\n};\n\n/**\n * Retrieves modifiers from key-event objects.\n */\nconst MODIFIER_KEY_GETTERS: {[key: string]: (event: KeyboardEvent) => boolean} = {\n 'alt': (event: KeyboardEvent) => event.altKey,\n 'control': (event: KeyboardEvent) => event.ctrlKey,\n 'meta': (event: KeyboardEvent) => event.metaKey,\n 'shift': (event: KeyboardEvent) => event.shiftKey\n};\n\n/**\n * @publicApi\n * A browser plug-in that provides support for handling of key events in Angular.\n */\n@Injectable()\nexport class KeyEventsPlugin extends EventManagerPlugin {\n /**\n * Initializes an instance of the browser plug-in.\n * @param doc The document in which key events will be detected.\n */\n constructor(@Inject(DOCUMENT) doc: any) {\n super(doc);\n }\n\n /**\n * Reports whether a named key event is supported.\n * @param eventName The event name to query.\n * @return True if the named key event is supported.\n */\n override supports(eventName: string): boolean {\n return KeyEventsPlugin.parseEventName(eventName) != null;\n }\n\n /**\n * Registers a handler for a specific element and key event.\n * @param element The HTML element to receive event notifications.\n * @param eventName The name of the key event to listen for.\n * @param handler A function to call when the notification occurs. Receives the\n * event object as an argument.\n * @returns The key event that was registered.\n */\n override addEventListener(element: HTMLElement, eventName: string, handler: Function): Function {\n const parsedEvent = KeyEventsPlugin.parseEventName(eventName)!;\n\n const outsideHandler =\n KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());\n\n return this.manager.getZone().runOutsideAngular(() => {\n return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);\n });\n }\n\n /**\n * Parses the user provided full keyboard event definition and normalizes it for\n * later internal use. It ensures the string is all lowercase, converts special\n * characters to a standard spelling, and orders all the values consistently.\n *\n * @param eventName The name of the key event to listen for.\n * @returns an object with the full, normalized string, and the dom event name\n * or null in the case when the event doesn't match a keyboard event.\n */\n static parseEventName(eventName: string): {fullKey: string, domEventName: string}|null {\n const parts: string[] = eventName.toLowerCase().split('.');\n\n const domEventName = parts.shift();\n if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {\n return null;\n }\n\n const key = KeyEventsPlugin._normalizeKey(parts.pop()!);\n\n let fullKey = '';\n let codeIX = parts.indexOf('code');\n if (codeIX > -1) {\n parts.splice(codeIX, 1);\n fullKey = 'code.';\n }\n MODIFIER_KEYS.forEach(modifierName => {\n const index: number = parts.indexOf(modifierName);\n if (index > -1) {\n parts.splice(index, 1);\n fullKey += modifierName + '.';\n }\n });\n fullKey += key;\n\n if (parts.length != 0 || key.length === 0) {\n // returning null instead of throwing to let another plugin process the event\n return null;\n }\n\n // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming.\n // The code must remain in the `result['domEventName']` form.\n // return {domEventName, fullKey};\n const result: {fullKey: string, domEventName: string} = {} as any;\n result['domEventName'] = domEventName;\n result['fullKey'] = fullKey;\n return result;\n }\n\n /**\n * Determines whether the actual keys pressed match the configured key code string.\n * The `fullKeyCode` event is normalized in the `parseEventName` method when the\n * event is attached to the DOM during the `addEventListener` call. This is unseen\n * by the end user and is normalized for internal consistency and parsing.\n *\n * @param event The keyboard event.\n * @param fullKeyCode The normalized user defined expected key event string\n * @returns boolean.\n */\n static matchEventFullKeyCode(event: KeyboardEvent, fullKeyCode: string): boolean {\n let keycode = _keyMap[event.key] || event.key;\n let key = '';\n if (fullKeyCode.indexOf('code.') > -1) {\n keycode = event.code;\n key = 'code.';\n }\n // the keycode could be unidentified so we have to check here\n if (keycode == null || !keycode) return false;\n keycode = keycode.toLowerCase();\n if (keycode === ' ') {\n keycode = 'space'; // for readability\n } else if (keycode === '.') {\n keycode = 'dot'; // because '.' is used as a separator in event names\n }\n MODIFIER_KEYS.forEach(modifierName => {\n if (modifierName !== keycode) {\n const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];\n if (modifierGetter(event)) {\n key += modifierName + '.';\n }\n }\n });\n key += keycode;\n return key === fullKeyCode;\n }\n\n /**\n * Configures a handler callback for a key event.\n * @param fullKey The event name that combines all simultaneous keystrokes.\n * @param handler The function that responds to the key event.\n * @param zone The zone in which the event occurred.\n * @returns A callback function.\n */\n static eventCallback(fullKey: string, handler: Function, zone: NgZone): Function {\n return (event: KeyboardEvent) => {\n if (KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) {\n zone.runGuarded(() => handler(event));\n }\n };\n }\n\n /** @internal */\n static _normalizeKey(keyName: string): string {\n // TODO: switch to a Map if the mapping grows too much\n switch (keyName) {\n case 'esc':\n return 'escape';\n default:\n return keyName;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule, DOCUMENT, XhrFactory, ɵPLATFORM_BROWSER_ID as PLATFORM_BROWSER_ID} from '@angular/common';\nimport {APP_ID, ApplicationModule, ApplicationRef, createPlatformFactory, EnvironmentProviders, ErrorHandler, Inject, InjectionToken, ModuleWithProviders, NgModule, NgZone, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, platformCore, PlatformRef, Provider, RendererFactory2, SkipSelf, StaticProvider, Testability, TestabilityRegistry, Type, ɵINJECTOR_SCOPE as INJECTOR_SCOPE, ɵinternalCreateApplication as internalCreateApplication, ɵsetDocument, ɵTESTABILITY as TESTABILITY, ɵTESTABILITY_GETTER as TESTABILITY_GETTER} from '@angular/core';\n\nimport {BrowserDomAdapter} from './browser/browser_adapter';\nimport {SERVER_TRANSITION_PROVIDERS, TRANSITION_ID} from './browser/server-transition';\nimport {BrowserGetTestability} from './browser/testability';\nimport {BrowserXhr} from './browser/xhr';\nimport {DomRendererFactory2, REMOVE_STYLES_ON_COMPONENT_DESTROY} from './dom/dom_renderer';\nimport {DomEventsPlugin} from './dom/events/dom_events';\nimport {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';\nimport {KeyEventsPlugin} from './dom/events/key_events';\nimport {DomSharedStylesHost, SharedStylesHost} from './dom/shared_styles_host';\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;\n\n/**\n * Set of config options available during the application bootstrap operation.\n *\n * @publicApi\n */\nexport interface ApplicationConfig {\n /**\n * List of providers that should be available to the root component and all its children.\n */\n providers: Array<Provider|EnvironmentProviders>;\n}\n\n/**\n * Bootstraps an instance of an Angular application and renders a standalone component as the\n * application's root component. More information about standalone components can be found in [this\n * guide](guide/standalone-components).\n *\n * @usageNotes\n * The root component passed into this function *must* be a standalone one (should have the\n * `standalone: true` flag in the `@Component` decorator config).\n *\n * ```typescript\n * @Component({\n * standalone: true,\n * template: 'Hello world!'\n * })\n * class RootComponent {}\n *\n * const appRef: ApplicationRef = await bootstrapApplication(RootComponent);\n * ```\n *\n * You can add the list of providers that should be available in the application injector by\n * specifying the `providers` field in an object passed as the second argument:\n *\n * ```typescript\n * await bootstrapApplication(RootComponent, {\n * providers: [\n * {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}\n * ]\n * });\n * ```\n *\n * The `importProvidersFrom` helper method can be used to collect all providers from any\n * existing NgModule (and transitively from all NgModules that it imports):\n *\n * ```typescript\n * await bootstrapApplication(RootComponent, {\n * providers: [\n * importProvidersFrom(SomeNgModule)\n * ]\n * });\n * ```\n *\n * Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by\n * default. You can add [Testability](api/core/Testability) by getting the list of necessary\n * providers using `provideProtractorTestingSupport()` function and adding them into the `providers`\n * array, for example:\n *\n * ```typescript\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(RootComponent, {providers: [provideProtractorTestingSupport()]});\n * ```\n *\n * @param rootComponent A reference to a standalone component that should be rendered.\n * @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for\n * additional info.\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n *\n * @publicApi\n */\nexport function bootstrapApplication(\n rootComponent: Type<unknown>, options?: ApplicationConfig): Promise<ApplicationRef> {\n return internalCreateApplication({rootComponent, ...createProvidersConfig(options)});\n}\n\n/**\n * Create an instance of an Angular application without bootstrapping any components. This is useful\n * for the situation where one wants to decouple application environment creation (a platform and\n * associated injectors) from rendering components on a screen. Components can be subsequently\n * bootstrapped on the returned `ApplicationRef`.\n *\n * @param options Extra configuration for the application environment, see `ApplicationConfig` for\n * additional info.\n * @returns A promise that returns an `ApplicationRef` instance once resolved.\n *\n * @publicApi\n */\nexport function createApplication(options?: ApplicationConfig) {\n return internalCreateApplication(createProvidersConfig(options));\n}\n\nfunction createProvidersConfig(options?: ApplicationConfig) {\n return {\n appProviders: [\n ...BROWSER_MODULE_PROVIDERS,\n ...(options?.providers ?? []),\n ],\n platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS\n };\n}\n\n/**\n * Returns a set of providers required to setup [Testability](api/core/Testability) for an\n * application bootstrapped using the `bootstrapApplication` function. The set of providers is\n * needed to support testing an application with Protractor (which relies on the Testability APIs\n * to be present).\n *\n * @returns An array of providers required to setup Testability for an application and make it\n * available for testing using Protractor.\n *\n * @publicApi\n */\nexport function provideProtractorTestingSupport(): Provider[] {\n // Return a copy to prevent changes to the original array in case any in-place\n // alterations are performed to the `provideProtractorTestingSupport` call results in app code.\n return [...TESTABILITY_PROVIDERS];\n}\n\nexport function initDomAdapter() {\n BrowserDomAdapter.makeCurrent();\n}\n\nexport function errorHandler(): ErrorHandler {\n return new ErrorHandler();\n}\n\nexport function _document(): any {\n // Tell ivy about the global document\n ɵsetDocument(document);\n return document;\n}\n\nexport const INTERNAL_BROWSER_PLATFORM_PROVIDERS: StaticProvider[] = [\n {provide: PLATFORM_ID, useValue: PLATFORM_BROWSER_ID},\n {provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true},\n {provide: DOCUMENT, useFactory: _document, deps: []},\n];\n\n/**\n * A factory function that returns a `PlatformRef` instance associated with browser service\n * providers.\n *\n * @publicApi\n */\nexport const platformBrowser: (extraProviders?: StaticProvider[]) => PlatformRef =\n createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);\n\n/**\n * Internal marker to signal whether providers from the `BrowserModule` are already present in DI.\n * This is needed to avoid loading `BrowserModule` providers twice. We can't rely on the\n * `BrowserModule` presence itself, since the standalone-based bootstrap just imports\n * `BrowserModule` providers without referencing the module itself.\n */\nconst BROWSER_MODULE_PROVIDERS_MARKER =\n new InjectionToken(NG_DEV_MODE ? 'BrowserModule Providers Marker' : '');\n\nconst TESTABILITY_PROVIDERS = [\n {\n provide: TESTABILITY_GETTER,\n useClass: BrowserGetTestability,\n deps: [],\n },\n {\n provide: TESTABILITY,\n useClass: Testability,\n deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]\n },\n {\n provide: Testability, // Also provide as `Testability` for backwards-compatibility.\n useClass: Testability,\n deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]\n }\n];\n\nconst BROWSER_MODULE_PROVIDERS: Provider[] = [\n {provide: INJECTOR_SCOPE, useValue: 'root'},\n {provide: ErrorHandler, useFactory: errorHandler, deps: []}, {\n provide: EVENT_MANAGER_PLUGINS,\n useClass: DomEventsPlugin,\n multi: true,\n deps: [DOCUMENT, NgZone, PLATFORM_ID]\n },\n {provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT]}, {\n provide: DomRendererFactory2,\n useClass: DomRendererFactory2,\n deps: [EventManager, DomSharedStylesHost, APP_ID, REMOVE_STYLES_ON_COMPONENT_DESTROY]\n },\n {provide: RendererFactory2, useExisting: DomRendererFactory2},\n {provide: SharedStylesHost, useExisting: DomSharedStylesHost},\n {provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT]},\n {provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone]},\n {provide: XhrFactory, useClass: BrowserXhr, deps: []},\n NG_DEV_MODE ? {provide: BROWSER_MODULE_PROVIDERS_MARKER, useValue: true} : []\n];\n\n/**\n * Exports required infrastructure for all Angular apps.\n * Included by default in all Angular apps created with the CLI\n * `new` command.\n * Re-exports `CommonModule` and `ApplicationModule`, making their\n * exports and providers available to all apps.\n *\n * @publicApi\n */\n@NgModule({\n providers: [\n ...BROWSER_MODULE_PROVIDERS, //\n ...TESTABILITY_PROVIDERS\n ],\n exports: [CommonModule, ApplicationModule],\n})\nexport class BrowserModule {\n constructor(@Optional() @SkipSelf() @Inject(BROWSER_MODULE_PROVIDERS_MARKER)\n providersAlreadyPresent: boolean|null) {\n if (NG_DEV_MODE && providersAlreadyPresent) {\n throw new Error(\n `Providers from the \\`BrowserModule\\` have already been loaded. If you need access ` +\n `to common directives such as NgIf and NgFor, import the \\`CommonModule\\` instead.`);\n }\n }\n\n /**\n * Configures a browser-based app to transition from a server-rendered app, if\n * one is present on the page.\n *\n * @param params An object containing an identifier for the app to transition.\n * The ID must match between the client and server versions of the app.\n * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.\n */\n static withServerTransition(params: {appId: string}): ModuleWithProviders<BrowserModule> {\n return {\n ngModule: BrowserModule,\n providers: [\n {provide: APP_ID, useValue: params.appId},\n {provide: TRANSITION_ID, useExisting: APP_ID},\n SERVER_TRANSITION_PROVIDERS,\n ],\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵgetDOM as getDOM} from '@angular/common';\nimport {GetTestability, Testability, TestabilityRegistry, ɵglobal as global} from '@angular/core';\n\nexport class BrowserGetTestability implements GetTestability {\n addToWindow(registry: TestabilityRegistry): void {\n global['getAngularTestability'] = (elem: any, findInAncestors: boolean = true) => {\n const testability = registry.findTestabilityInTree(elem, findInAncestors);\n if (testability == null) {\n throw new Error('Could not find testability for element.');\n }\n return testability;\n };\n\n global['getAllAngularTestabilities'] = () => registry.getAllTestabilities();\n\n global['getAllAngularRootElements'] = () => registry.getAllRootElements();\n\n const whenAllStable = (callback: any /** TODO #9100 */) => {\n const testabilities = global['getAllAngularTestabilities']();\n let count = testabilities.length;\n let didWork = false;\n const decrement = function(didWork_: any /** TODO #9100 */) {\n didWork = didWork || didWork_;\n count--;\n if (count == 0) {\n callback(didWork);\n }\n };\n testabilities.forEach(function(testability: any /** TODO #9100 */) {\n testability.whenStable(decrement);\n });\n };\n\n if (!global['frameworkStabilizers']) {\n global['frameworkStabilizers'] = [];\n }\n global['frameworkStabilizers'].push(whenAllStable);\n }\n\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null {\n if (elem == null) {\n return null;\n }\n const t = registry.getTestability(elem);\n if (t != null) {\n return t;\n } else if (!findInAncestors) {\n return null;\n }\n if (getDOM().isShadowRoot(elem)) {\n return this.findTestabilityInTree(registry, (<any>elem).host, true);\n }\n return this.findTestabilityInTree(registry, elem.parentElement, true);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst win = typeof window !== 'undefined' && window || <any>{};\nexport {win as window};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, InjectionToken, NgModule, Optional, Provider, ɵConsole as Console} from '@angular/core';\n\nimport {EVENT_MANAGER_PLUGINS, EventManagerPlugin} from './event_manager';\n\n\n\n/**\n * Supported HammerJS recognizer event names.\n */\nconst EVENT_NAMES = {\n // pan\n 'pan': true,\n 'panstart': true,\n 'panmove': true,\n 'panend': true,\n 'pancancel': true,\n 'panleft': true,\n 'panright': true,\n 'panup': true,\n 'pandown': true,\n // pinch\n 'pinch': true,\n 'pinchstart': true,\n 'pinchmove': true,\n 'pinchend': true,\n 'pinchcancel': true,\n 'pinchin': true,\n 'pinchout': true,\n // press\n 'press': true,\n 'pressup': true,\n // rotate\n 'rotate': true,\n 'rotatestart': true,\n 'rotatemove': true,\n 'rotateend': true,\n 'rotatecancel': true,\n // swipe\n 'swipe': true,\n 'swipeleft': true,\n 'swiperight': true,\n 'swipeup': true,\n 'swipedown': true,\n // tap\n 'tap': true,\n 'doubletap': true\n};\n\n/**\n * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.\n * @see `HammerGestureConfig`\n *\n * @ngModule HammerModule\n * @publicApi\n */\nexport const HAMMER_GESTURE_CONFIG = new InjectionToken<HammerGestureConfig>('HammerGestureConfig');\n\n\n/**\n * Function that loads HammerJS, returning a promise that is resolved once HammerJs is loaded.\n *\n * @publicApi\n */\nexport type HammerLoader = () => Promise<void>;\n\n/**\n * Injection token used to provide a {@link HammerLoader} to Angular.\n *\n * @publicApi\n */\nexport const HAMMER_LOADER = new InjectionToken<HammerLoader>('HammerLoader');\n\nexport interface HammerInstance {\n on(eventName: string, callback?: Function): void;\n off(eventName: string, callback?: Function): void;\n destroy?(): void;\n}\n\n/**\n * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)\n * for gesture recognition. Configures specific event recognition.\n * @publicApi\n */\n@Injectable()\nexport class HammerGestureConfig {\n /**\n * A set of supported event names for gestures to be used in Angular.\n * Angular supports all built-in recognizers, as listed in\n * [HammerJS documentation](https://hammerjs.github.io/).\n */\n events: string[] = [];\n\n /**\n * Maps gesture event names to a set of configuration options\n * that specify overrides to the default values for specific properties.\n *\n * The key is a supported event name to be configured,\n * and the options object contains a set of properties, with override values\n * to be applied to the named recognizer event.\n * For example, to disable recognition of the rotate event, specify\n * `{\"rotate\": {\"enable\": false}}`.\n *\n * Properties that are not present take the HammerJS default values.\n * For information about which properties are supported for which events,\n * and their allowed and default values, see\n * [HammerJS documentation](https://hammerjs.github.io/).\n *\n */\n overrides: {[key: string]: Object} = {};\n\n /**\n * Properties whose default values can be overridden for a given event.\n * Different sets of properties apply to different events.\n * For information about which properties are supported for which events,\n * and their allowed and default values, see\n * [HammerJS documentation](https://hammerjs.github.io/).\n */\n options?: {\n cssProps?: any;\n domEvents?: boolean;\n enable?: boolean | ((manager: any) => boolean);\n preset?: any[];\n touchAction?: string;\n recognizers?: any[];\n inputClass?: any;\n inputTarget?: EventTarget;\n };\n\n /**\n * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)\n * and attaches it to a given HTML element.\n * @param element The element that will recognize gestures.\n * @returns A HammerJS event-manager object.\n */\n buildHammer(element: HTMLElement): HammerInstance {\n const mc = new Hammer!(element, this.options);\n\n mc.get('pinch').set({enable: true});\n mc.get('rotate').set({enable: true});\n\n for (const eventName in this.overrides) {\n mc.get(eventName).set(this.overrides[eventName]);\n }\n\n return mc;\n }\n}\n\n/**\n * Event plugin that adds Hammer support to an application.\n *\n * @ngModule HammerModule\n */\n@Injectable()\nexport class HammerGesturesPlugin extends EventManagerPlugin {\n private _loaderPromise: Promise<void>|null = null;\n\n constructor(\n @Inject(DOCUMENT) doc: any,\n @Inject(HAMMER_GESTURE_CONFIG) private _config: HammerGestureConfig, private console: Console,\n @Optional() @Inject(HAMMER_LOADER) private loader?: HammerLoader|null) {\n super(doc);\n }\n\n override supports(eventName: string): boolean {\n if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {\n return false;\n }\n\n if (!(window as any).Hammer && !this.loader) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n this.console.warn(\n `The \"${eventName}\" event cannot be bound because Hammer.JS is not ` +\n `loaded and no custom loader has been specified.`);\n }\n return false;\n }\n\n return true;\n }\n\n override addEventListener(element: HTMLElement, eventName: string, handler: Function): Function {\n const zone = this.manager.getZone();\n eventName = eventName.toLowerCase();\n\n // If Hammer is not present but a loader is specified, we defer adding the event listener\n // until Hammer is loaded.\n if (!(window as any).Hammer && this.loader) {\n this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader!());\n // This `addEventListener` method returns a function to remove the added listener.\n // Until Hammer is loaded, the returned function needs to *cancel* the registration rather\n // than remove anything.\n let cancelRegistration = false;\n let deregister: Function = () => {\n cancelRegistration = true;\n };\n\n zone.runOutsideAngular(\n () => this._loaderPromise!\n .then(() => {\n // If Hammer isn't actually loaded when the custom loader resolves, give up.\n if (!(window as any).Hammer) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n this.console.warn(\n `The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);\n }\n deregister = () => {};\n return;\n }\n\n if (!cancelRegistration) {\n // Now that Hammer is loaded and the listener is being loaded for real,\n // the deregistration function changes from canceling registration to\n // removal.\n deregister = this.addEventListener(element, eventName, handler);\n }\n })\n .catch(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n this.console.warn(\n `The \"${eventName}\" event cannot be bound because the custom ` +\n `Hammer.JS loader failed.`);\n }\n deregister = () => {};\n }));\n\n // Return a function that *executes* `deregister` (and not `deregister` itself) so that we\n // can change the behavior of `deregister` once the listener is added. Using a closure in\n // this way allows us to avoid any additional data structures to track listener removal.\n return () => {\n deregister();\n };\n }\n\n return zone.runOutsideAngular(() => {\n // Creating the manager bind events, must be done outside of angular\n const mc = this._config.buildHammer(element);\n const callback = function(eventObj: HammerInput) {\n zone.runGuarded(function() {\n handler(eventObj);\n });\n };\n mc.on(eventName, callback);\n return () => {\n mc.off(eventName, callback);\n // destroy mc to prevent memory leak\n if (typeof mc.destroy === 'function') {\n mc.destroy();\n }\n };\n });\n }\n\n isCustomEvent(eventName: string): boolean {\n return this._config.events.indexOf(eventName) > -1;\n }\n}\n\n/**\n * Adds support for HammerJS.\n *\n * Import this module at the root of your application so that Angular can work with\n * HammerJS to detect gesture events.\n *\n * Note that applications still need to include the HammerJS script itself. This module\n * simply sets up the coordination layer between HammerJS and Angular's EventManager.\n *\n * @publicApi\n */\n@NgModule({\n providers: [\n {\n provide: EVENT_MANAGER_PLUGINS,\n useClass: HammerGesturesPlugin,\n multi: true,\n deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Console, [new Optional(), HAMMER_LOADER]]\n },\n {provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: []},\n ]\n})\nexport class HammerModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {forwardRef, Inject, Injectable, Injector, Sanitizer, SecurityContext, ɵ_sanitizeHtml as _sanitizeHtml, ɵ_sanitizeUrl as _sanitizeUrl, ɵallowSanitizationBypassAndThrow as allowSanitizationBypassOrThrow, ɵbypassSanitizationTrustHtml as bypassSanitizationTrustHtml, ɵbypassSanitizationTrustResourceUrl as bypassSanitizationTrustResourceUrl, ɵbypassSanitizationTrustScript as bypassSanitizationTrustScript, ɵbypassSanitizationTrustStyle as bypassSanitizationTrustStyle, ɵbypassSanitizationTrustUrl as bypassSanitizationTrustUrl, ɵBypassType as BypassType, ɵgetSanitizationBypassType as getSanitizationBypassType, ɵunwrapSafeValue as unwrapSafeValue, ɵXSS_SECURITY_URL as XSS_SECURITY_URL} from '@angular/core';\n\nexport {SecurityContext};\n\n\n\n/**\n * Marker interface for a value that's safe to use in a particular context.\n *\n * @publicApi\n */\nexport interface SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as HTML.\n *\n * @publicApi\n */\nexport interface SafeHtml extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as style (CSS).\n *\n * @publicApi\n */\nexport interface SafeStyle extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as JavaScript.\n *\n * @publicApi\n */\nexport interface SafeScript extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as a URL linking to a document.\n *\n * @publicApi\n */\nexport interface SafeUrl extends SafeValue {}\n\n/**\n * Marker interface for a value that's safe to use as a URL to load executable code from.\n *\n * @publicApi\n */\nexport interface SafeResourceUrl extends SafeValue {}\n\n/**\n * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing\n * values to be safe to use in the different DOM contexts.\n *\n * For example, when binding a URL in an `<a [href]=\"someValue\">` hyperlink, `someValue` will be\n * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on\n * the website.\n *\n * In specific situations, it might be necessary to disable sanitization, for example if the\n * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.\n * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`\n * methods, and then binding to that value from the template.\n *\n * These situations should be very rare, and extraordinary care must be taken to avoid creating a\n * Cross Site Scripting (XSS) security bug!\n *\n * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as\n * close as possible to the source of the value, to make it easy to verify no security bug is\n * created by its use.\n *\n * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that\n * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous\n * code. The sanitizer leaves safe values intact.\n *\n * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in\n * sanitization for the value passed in. Carefully check and audit all values and code paths going\n * into this call. Make sure any user data is appropriately escaped for this security context.\n * For more detail, see the [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl)})\nexport abstract class DomSanitizer implements Sanitizer {\n /**\n * Gets a safe value from either a known safe value or a value with unknown safety.\n *\n * If the given value is already a `SafeValue`, this method returns the unwrapped value.\n * If the security context is HTML and the given value is a plain string, this method\n * sanitizes the string, removing any potentially unsafe content.\n * For any other security context, this method throws an error if provided\n * with a plain string.\n */\n abstract sanitize(context: SecurityContext, value: SafeValue|string|null): string|null;\n\n /**\n * Bypass security and trust the given value to be safe HTML. Only use this when the bound HTML\n * is unsafe (e.g. contains `<script>` tags) and the code should be executed. The sanitizer will\n * leave safe HTML intact, so in most situations this method should not be used.\n *\n * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n * security risks!\n */\n abstract bypassSecurityTrustHtml(value: string): SafeHtml;\n\n /**\n * Bypass security and trust the given value to be safe style value (CSS).\n *\n * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n * security risks!\n */\n abstract bypassSecurityTrustStyle(value: string): SafeStyle;\n\n /**\n * Bypass security and trust the given value to be safe JavaScript.\n *\n * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n * security risks!\n */\n abstract bypassSecurityTrustScript(value: string): SafeScript;\n\n /**\n * Bypass security and trust the given value to be a safe style URL, i.e. a value that can be used\n * in hyperlinks or `<img src>`.\n *\n * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n * security risks!\n */\n abstract bypassSecurityTrustUrl(value: string): SafeUrl;\n\n /**\n * Bypass security and trust the given value to be a safe resource URL, i.e. a location that may\n * be used to load executable code from, like `<script src>`, or `<iframe src>`.\n *\n * **WARNING:** calling this method with untrusted user data exposes your application to XSS\n * security risks!\n */\n abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;\n}\n\nexport function domSanitizerImplFactory(injector: Injector) {\n return new DomSanitizerImpl(injector.get(DOCUMENT));\n}\n\n@Injectable({providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [Injector]})\nexport class DomSanitizerImpl extends DomSanitizer {\n constructor(@Inject(DOCUMENT) private _doc: any) {\n super();\n }\n\n override sanitize(ctx: SecurityContext, value: SafeValue|string|null): string|null {\n if (value == null) return null;\n switch (ctx) {\n case SecurityContext.NONE:\n return value as string;\n case SecurityContext.HTML:\n if (allowSanitizationBypassOrThrow(value, BypassType.Html)) {\n return unwrapSafeValue(value);\n }\n return _sanitizeHtml(this._doc, String(value)).toString();\n case SecurityContext.STYLE:\n if (allowSanitizationBypassOrThrow(value, BypassType.Style)) {\n return unwrapSafeValue(value);\n }\n return value as string;\n case SecurityContext.SCRIPT:\n if (allowSanitizationBypassOrThrow(value, BypassType.Script)) {\n return unwrapSafeValue(value);\n }\n throw new Error('unsafe value used in a script context');\n case SecurityContext.URL:\n if (allowSanitizationBypassOrThrow(value, BypassType.Url)) {\n return unwrapSafeValue(value);\n }\n return _sanitizeUrl(String(value));\n case SecurityContext.RESOURCE_URL:\n if (allowSanitizationBypassOrThrow(value, BypassType.ResourceUrl)) {\n return unwrapSafeValue(value);\n }\n throw new Error(`unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n default:\n throw new Error(`Unexpected SecurityContext ${ctx} (see ${XSS_SECURITY_URL})`);\n }\n }\n\n override bypassSecurityTrustHtml(value: string): SafeHtml {\n return bypassSanitizationTrustHtml(value);\n }\n override bypassSecurityTrustStyle(value: string): SafeStyle {\n return bypassSanitizationTrustStyle(value);\n }\n override bypassSecurityTrustScript(value: string): SafeScript {\n return bypassSanitizationTrustScript(value);\n }\n override bypassSecurityTrustUrl(value: string): SafeUrl {\n return bypassSanitizationTrustUrl(value);\n }\n override bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl {\n return bypassSanitizationTrustResourceUrl(value);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport type Ng1Token = string;\n\nexport type Ng1Expression = string|Function;\n\nexport interface IAnnotatedFunction extends Function {\n // Older versions of `@types/angular` typings extend the global `Function` interface with\n // `$inject?: string[]`, which is not compatible with `$inject?: ReadonlyArray<string>` (used in\n // latest versions).\n $inject?: Function extends {$inject?: string[]}? Ng1Token[]: ReadonlyArray<Ng1Token>;\n}\n\nexport type IInjectable = (Ng1Token|Function)[]|IAnnotatedFunction;\n\nexport type SingleOrListOrMap<T> = T|T[]|{[key: string]: T};\n\nexport interface IModule {\n name: string;\n requires: (string|IInjectable)[];\n config(fn: IInjectable): IModule;\n directive(selector: string, factory: IInjectable): IModule;\n component(selector: string, component: IComponent): IModule;\n controller(name: string, type: IInjectable): IModule;\n factory(key: Ng1Token, factoryFn: IInjectable): IModule;\n value(key: Ng1Token, value: any): IModule;\n constant(token: Ng1Token, value: any): IModule;\n run(a: IInjectable): IModule;\n}\nexport interface ICompileService {\n (element: Element|NodeList|Node[]|string, transclude?: Function): ILinkFn;\n}\nexport interface ILinkFn {\n (scope: IScope, cloneAttachFn?: ICloneAttachFunction, options?: ILinkFnOptions): IAugmentedJQuery;\n $$slots?: {[slotName: string]: ILinkFn};\n}\nexport interface ILinkFnOptions {\n parentBoundTranscludeFn?: Function;\n transcludeControllers?: {[key: string]: any};\n futureParentElement?: Node;\n}\nexport interface IRootScopeService {\n $new(isolate?: boolean): IScope;\n $id: string;\n $parent: IScope;\n $root: IScope;\n $watch(exp: Ng1Expression, fn?: (a1?: any, a2?: any) => void): Function;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $destroy(): any;\n $apply(exp?: Ng1Expression): any;\n $digest(): any;\n $evalAsync(exp: Ng1Expression, locals?: any): void;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $$childTail: IScope;\n $$childHead: IScope;\n $$nextSibling: IScope;\n [key: string]: any;\n}\nexport interface IScope extends IRootScopeService {}\n\nexport interface IAngularBootstrapConfig {\n strictDi?: boolean;\n}\nexport interface IDirective {\n compile?: IDirectiveCompileFn;\n controller?: IController;\n controllerAs?: string;\n bindToController?: boolean|{[key: string]: string};\n link?: IDirectiveLinkFn|IDirectivePrePost;\n name?: string;\n priority?: number;\n replace?: boolean;\n require?: DirectiveRequireProperty;\n restrict?: string;\n scope?: boolean|{[key: string]: string};\n template?: string|Function;\n templateUrl?: string|Function;\n templateNamespace?: string;\n terminal?: boolean;\n transclude?: DirectiveTranscludeProperty;\n}\nexport type DirectiveRequireProperty = SingleOrListOrMap<string>;\nexport type DirectiveTranscludeProperty = boolean|'element'|{[key: string]: string};\nexport interface IDirectiveCompileFn {\n (templateElement: IAugmentedJQuery, templateAttributes: IAttributes,\n transclude: ITranscludeFunction): IDirectivePrePost;\n}\nexport interface IDirectivePrePost {\n pre?: IDirectiveLinkFn;\n post?: IDirectiveLinkFn;\n}\nexport interface IDirectiveLinkFn {\n (scope: IScope, instanceElement: IAugmentedJQuery, instanceAttributes: IAttributes,\n controller: any, transclude: ITranscludeFunction): void;\n}\nexport interface IComponent {\n bindings?: {[key: string]: string};\n controller?: string|IInjectable;\n controllerAs?: string;\n require?: DirectiveRequireProperty;\n template?: string|Function;\n templateUrl?: string|Function;\n transclude?: DirectiveTranscludeProperty;\n}\nexport interface IAttributes {\n $observe(attr: string, fn: (v: string) => void): void;\n [key: string]: any;\n}\nexport interface ITranscludeFunction {\n // If the scope is provided, then the cloneAttachFn must be as well.\n (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;\n // If one argument is provided, then it's assumed to be the cloneAttachFn.\n (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;\n}\nexport interface ICloneAttachFunction {\n (clonedElement: IAugmentedJQuery, scope: IScope): any;\n}\nexport type IAugmentedJQuery = Node[]&{\n on?: (name: string, fn: () => void) => void;\n data?: (name: string, value?: any) => any;\n text?: () => string;\n inheritedData?: (name: string, value?: any) => any;\n children?: () => IAugmentedJQuery;\n contents?: () => IAugmentedJQuery;\n parent?: () => IAugmentedJQuery;\n empty?: () => void;\n append?: (content: IAugmentedJQuery|string) => IAugmentedJQuery;\n controller?: (name: string) => any;\n isolateScope?: () => IScope;\n injector?: () => IInjectorService;\n triggerHandler?: (eventTypeOrObject: string|Event, extraParameters?: any[]) => IAugmentedJQuery;\n remove?: () => void;\n removeData?: () => void;\n};\nexport interface IProvider {\n $get: IInjectable;\n}\nexport interface IProvideService {\n provider(token: Ng1Token, provider: IProvider): IProvider;\n factory(token: Ng1Token, factory: IInjectable): IProvider;\n service(token: Ng1Token, type: IInjectable): IProvider;\n value(token: Ng1Token, value: any): IProvider;\n constant(token: Ng1Token, value: any): void;\n decorator(token: Ng1Token, factory: IInjectable): void;\n}\nexport interface IParseService {\n (expression: string): ICompiledExpression;\n}\nexport interface ICompiledExpression {\n (context: any, locals: any): any;\n assign?: (context: any, value: any) => any;\n}\nexport interface IHttpBackendService {\n (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number,\n withCredentials?: boolean): void;\n}\nexport interface ICacheObject {\n put<T>(key: string, value?: T): T;\n get(key: string): any;\n}\nexport interface ITemplateCacheService extends ICacheObject {}\nexport type IController = string|IInjectable;\nexport interface IControllerService {\n (controllerConstructor: IController, locals?: any, later?: any, ident?: any): any;\n (controllerName: string, locals?: any): any;\n}\n\nexport interface IInjectorService {\n get(key: string): any;\n has(key: string): boolean;\n}\n\nexport interface IIntervalService {\n (func: Function, delay: number, count?: number, invokeApply?: boolean,\n ...args: any[]): Promise<any>;\n cancel(promise: Promise<any>): boolean;\n}\n\nexport interface ITestabilityService {\n findBindings(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n findModels(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n getLocation(): string;\n setLocation(url: string): void;\n whenStable(callback: Function): void;\n}\n\nexport interface INgModelController {\n $render(): void;\n $isEmpty(value: any): boolean;\n $setValidity(validationErrorKey: string, isValid: boolean): void;\n $setPristine(): void;\n $setDirty(): void;\n $setUntouched(): void;\n $setTouched(): void;\n $rollbackViewValue(): void;\n $validate(): void;\n $commitViewValue(): void;\n $setViewValue(value: any, trigger: string): void;\n\n $viewValue: any;\n $modelValue: any;\n $parsers: Function[];\n $formatters: Function[];\n $validators: {[key: string]: Function};\n $asyncValidators: {[key: string]: Function};\n $viewChangeListeners: Function[];\n $error: Object;\n $pending: Object;\n $untouched: boolean;\n $touched: boolean;\n $pristine: boolean;\n $dirty: boolean;\n $valid: boolean;\n $invalid: boolean;\n $name: string;\n}\n\nfunction noNg(): never {\n throw new Error('AngularJS v1.x is not loaded!');\n}\n\nconst noNgElement: typeof angular.element = (() => noNg()) as any;\nnoNgElement.cleanData = noNg;\n\nlet angular: {\n bootstrap: (e: Element, modules: (string|IInjectable)[], config?: IAngularBootstrapConfig) =>\n IInjectorService,\n module: (prefix: string, dependencies?: string[]) => IModule,\n element: {\n (e: string|Element|Document|IAugmentedJQuery): IAugmentedJQuery;\n cleanData: (nodes: Node[]|NodeList) => void;\n },\n injector: (modules: Array<string|IInjectable>, strictDi?: boolean) => IInjectorService,\n version: {major: number},\n resumeBootstrap: () => void,\n getTestability: (e: Element) => ITestabilityService\n} = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined as any,\n resumeBootstrap: noNg,\n getTestability: noNg\n};\n\ntry {\n if (window.hasOwnProperty('angular')) {\n angular = (<any>window).angular;\n }\n} catch {\n // ignore in CJS mode.\n}\n\n/**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function setAngularLib(ng: any): void {\n setAngularJSGlobal(ng);\n}\n\n/**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function getAngularLib(): any {\n return getAngularJSGlobal();\n}\n\n/**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\nexport function setAngularJSGlobal(ng: any): void {\n angular = ng;\n}\n\n/**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\nexport function getAngularJSGlobal(): any {\n return angular;\n}\n\nexport const bootstrap: typeof angular.bootstrap = (e, modules, config?) =>\n angular.bootstrap(e, modules, config);\n\n// Do not declare as `module` to avoid webpack bug\n// (see https://github.com/angular/angular/issues/30050).\nexport const module_: typeof angular.module = (prefix, dependencies?) =>\n angular.module(prefix, dependencies);\n\nexport const element: typeof angular.element = (e => angular.element(e)) as typeof angular.element;\nelement.cleanData = nodes => angular.element.cleanData(nodes);\n\nexport const injector: typeof angular.injector =\n (modules: Array<string|IInjectable>, strictDi?: boolean) => angular.injector(modules, strictDi);\n\nexport const resumeBootstrap: typeof angular.resumeBootstrap = () => angular.resumeBootstrap();\n\nexport const getTestability: typeof angular.getTestability = e => angular.getTestability(e);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const $COMPILE = '$compile';\nexport const $CONTROLLER = '$controller';\nexport const $DELEGATE = '$delegate';\nexport const $EXCEPTION_HANDLER = '$exceptionHandler';\nexport const $HTTP_BACKEND = '$httpBackend';\nexport const $INJECTOR = '$injector';\nexport const $INTERVAL = '$interval';\nexport const $PARSE = '$parse';\nexport const $PROVIDE = '$provide';\nexport const $ROOT_ELEMENT = '$rootElement';\nexport const $ROOT_SCOPE = '$rootScope';\nexport const $SCOPE = '$scope';\nexport const $TEMPLATE_CACHE = '$templateCache';\nexport const $TEMPLATE_REQUEST = '$templateRequest';\n\nexport const $$TESTABILITY = '$$testability';\n\nexport const COMPILER_KEY = '$$angularCompiler';\nexport const DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\nexport const GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\nexport const INJECTOR_KEY = '$$angularInjector';\nexport const LAZY_MODULE_REF = '$$angularLazyModuleRef';\nexport const NG_ZONE_KEY = '$$angularNgZone';\nexport const UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\n\nexport const REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\nexport const REQUIRE_NG_MODEL = '?ngModel';\n\nexport const UPGRADE_MODULE_NAME = '$$UpgradeModule';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A `PropertyBinding` represents a mapping between a property name\n * and an attribute name. It is parsed from a string of the form\n * `\"prop: attr\"`; or simply `\"propAndAttr\" where the property\n * and attribute have the same identifier.\n */\nexport class PropertyBinding {\n bracketAttr: string;\n bracketParenAttr: string;\n parenAttr: string;\n onAttr: string;\n bindAttr: string;\n bindonAttr: string;\n\n constructor(public prop: string, public attr: string) {\n this.bracketAttr = `[${this.attr}]`;\n this.parenAttr = `(${this.attr})`;\n this.bracketParenAttr = `[(${this.attr})]`;\n const capitalAttr = this.attr.charAt(0).toUpperCase() + this.attr.slice(1);\n this.onAttr = `on${capitalAttr}`;\n this.bindAttr = `bind${capitalAttr}`;\n this.bindonAttr = `bindon${capitalAttr}`;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, Type, ɵNG_MOD_DEF} from '@angular/core';\n\nimport {element as angularElement, IAugmentedJQuery, IInjectorService, INgModelController, IRootScopeService} from './angular1';\nimport {$ROOT_ELEMENT, $ROOT_SCOPE, DOWNGRADED_MODULE_COUNT_KEY, UPGRADE_APP_TYPE_KEY} from './constants';\n\nconst DIRECTIVE_PREFIX_REGEXP = /^(?:x|data)[:\\-_]/i;\nconst DIRECTIVE_SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n\nexport function onError(e: any) {\n // TODO: (misko): We seem to not have a stack trace here!\n console.error(e, e.stack);\n throw e;\n}\n\n/**\n * Clean the jqLite/jQuery data on the element and all its descendants.\n * Equivalent to how jqLite/jQuery invoke `cleanData()` on an Element when removed:\n * https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/jqLite.js#L349-L355\n * https://github.com/jquery/jquery/blob/6984d1747623dbc5e87fd6c261a5b6b1628c107c/src/manipulation.js#L182\n *\n * NOTE:\n * `cleanData()` will also invoke the AngularJS `$destroy` DOM event on the element:\n * https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/Angular.js#L1932-L1945\n *\n * @param node The DOM node whose data needs to be cleaned.\n */\nexport function cleanData(node: Node): void {\n angularElement.cleanData([node]);\n if (isParentNode(node)) {\n angularElement.cleanData(node.querySelectorAll('*'));\n }\n}\n\nexport function controllerKey(name: string): string {\n return '$' + name + 'Controller';\n}\n\n/**\n * Destroy an AngularJS app given the app `$injector`.\n *\n * NOTE: Destroying an app is not officially supported by AngularJS, but try to do our best by\n * destroying `$rootScope` and clean the jqLite/jQuery data on `$rootElement` and all\n * descendants.\n *\n * @param $injector The `$injector` of the AngularJS app to destroy.\n */\nexport function destroyApp($injector: IInjectorService): void {\n const $rootElement: IAugmentedJQuery = $injector.get($ROOT_ELEMENT);\n const $rootScope: IRootScopeService = $injector.get($ROOT_SCOPE);\n\n $rootScope.$destroy();\n cleanData($rootElement[0]);\n}\n\nexport function directiveNormalize(name: string): string {\n return name.replace(DIRECTIVE_PREFIX_REGEXP, '')\n .replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());\n}\n\nexport function getTypeName(type: Type<any>): string {\n // Return the name of the type or the first line of its stringified version.\n return (type as any).overriddenName || type.name || type.toString().split('\\n')[0];\n}\n\nexport function getDowngradedModuleCount($injector: IInjectorService): number {\n return $injector.has(DOWNGRADED_MODULE_COUNT_KEY) ? $injector.get(DOWNGRADED_MODULE_COUNT_KEY) :\n 0;\n}\n\nexport function getUpgradeAppType($injector: IInjectorService): UpgradeAppType {\n return $injector.has(UPGRADE_APP_TYPE_KEY) ? $injector.get(UPGRADE_APP_TYPE_KEY) :\n UpgradeAppType.None;\n}\n\nexport function isFunction(value: any): value is Function {\n return typeof value === 'function';\n}\n\nexport function isNgModuleType(value: any): value is Type<unknown> {\n // NgModule class should have the `ɵmod` static property attached by AOT or JIT compiler.\n return isFunction(value) && !!value[ɵNG_MOD_DEF];\n}\n\nfunction isParentNode(node: Node|ParentNode): node is ParentNode {\n return isFunction((node as unknown as ParentNode).querySelectorAll);\n}\n\nexport function validateInjectionKey(\n $injector: IInjectorService, downgradedModule: string, injectionKey: string,\n attemptedAction: string): void {\n const upgradeAppType = getUpgradeAppType($injector);\n const downgradedModuleCount = getDowngradedModuleCount($injector);\n\n // Check for common errors.\n switch (upgradeAppType) {\n case UpgradeAppType.Dynamic:\n case UpgradeAppType.Static:\n if (downgradedModule) {\n throw new Error(\n `Error while ${attemptedAction}: 'downgradedModule' unexpectedly specified.\\n` +\n 'You should not specify a value for \\'downgradedModule\\', unless you are downgrading ' +\n 'more than one Angular module (via \\'downgradeModule()\\').');\n }\n break;\n case UpgradeAppType.Lite:\n if (!downgradedModule && (downgradedModuleCount >= 2)) {\n throw new Error(\n `Error while ${attemptedAction}: 'downgradedModule' not specified.\\n` +\n 'This application contains more than one downgraded Angular module, thus you need to ' +\n 'always specify \\'downgradedModule\\' when downgrading components and injectables.');\n }\n\n if (!$injector.has(injectionKey)) {\n throw new Error(\n `Error while ${attemptedAction}: Unable to find the specified downgraded module.\\n` +\n 'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n 'application?');\n }\n\n break;\n default:\n throw new Error(\n `Error while ${attemptedAction}: Not a valid '@angular/upgrade' application.\\n` +\n 'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n 'application?');\n }\n}\n\nexport class Deferred<R> {\n promise: Promise<R>;\n resolve!: (value: R|PromiseLike<R>) => void;\n reject!: (error?: any) => void;\n\n constructor() {\n this.promise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n}\n\nexport interface LazyModuleRef {\n injector?: Injector;\n promise?: Promise<Injector>;\n}\n\nexport const enum UpgradeAppType {\n // App NOT using `@angular/upgrade`. (This should never happen in an `ngUpgrade` app.)\n None,\n\n // App using the deprecated `@angular/upgrade` APIs (a.k.a. dynamic `ngUpgrade`).\n Dynamic,\n\n // App using `@angular/upgrade/static` with `UpgradeModule`.\n Static,\n\n // App using @angular/upgrade/static` with `downgradeModule()` (a.k.a `ngUpgrade`-lite ).\n Lite,\n}\n\n/**\n * @return Whether the passed-in component implements the subset of the\n * `ControlValueAccessor` interface needed for AngularJS `ng-model`\n * compatibility.\n */\nfunction supportsNgModel(component: any) {\n return typeof component.writeValue === 'function' &&\n typeof component.registerOnChange === 'function';\n}\n\n/**\n * Glue the AngularJS `NgModelController` (if it exists) to the component\n * (if it implements the needed subset of the `ControlValueAccessor` interface).\n */\nexport function hookupNgModel(ngModel: INgModelController, component: any) {\n if (ngModel && supportsNgModel(component)) {\n ngModel.$render = () => {\n component.writeValue(ngModel.$viewValue);\n };\n component.registerOnChange(ngModel.$setViewValue.bind(ngModel));\n if (typeof component.registerOnTouched === 'function') {\n component.registerOnTouched(ngModel.$setTouched.bind(ngModel));\n }\n }\n}\n\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nexport function strictEquals(val1: any, val2: any): boolean {\n return val1 === val2 || (val1 !== val1 && val2 !== val2);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentRef, EventEmitter, Injector, OnChanges, SimpleChange, SimpleChanges, StaticProvider, Testability, TestabilityRegistry, Type} from '@angular/core';\n\nimport {IAttributes, IAugmentedJQuery, ICompileService, INgModelController, IParseService, IScope} from './angular1';\nimport {PropertyBinding} from './component_info';\nimport {$SCOPE} from './constants';\nimport {cleanData, getTypeName, hookupNgModel, strictEquals} from './util';\n\nconst INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\n\nexport class DowngradeComponentAdapter {\n private implementsOnChanges = false;\n private inputChangeCount: number = 0;\n private inputChanges: SimpleChanges = {};\n private componentScope: IScope;\n\n constructor(\n private element: IAugmentedJQuery, private attrs: IAttributes, private scope: IScope,\n private ngModel: INgModelController, private parentInjector: Injector,\n private $compile: ICompileService, private $parse: IParseService,\n private componentFactory: ComponentFactory<any>,\n private wrapCallback: <T>(cb: () => T) => () => T) {\n this.componentScope = scope.$new();\n }\n\n compileContents(): Node[][] {\n const compiledProjectableNodes: Node[][] = [];\n const projectableNodes: Node[][] = this.groupProjectableNodes();\n const linkFns = projectableNodes.map(nodes => this.$compile(nodes));\n\n this.element.empty!();\n\n linkFns.forEach(linkFn => {\n linkFn(this.scope, (clone: Node[]) => {\n compiledProjectableNodes.push(clone);\n this.element.append!(clone);\n });\n });\n\n return compiledProjectableNodes;\n }\n\n createComponentAndSetup(\n projectableNodes: Node[][], manuallyAttachView = false,\n propagateDigest = true): ComponentRef<any> {\n const component = this.createComponent(projectableNodes);\n this.setupInputs(manuallyAttachView, propagateDigest, component);\n this.setupOutputs(component.componentRef);\n this.registerCleanup(component.componentRef);\n\n return component.componentRef;\n }\n\n private createComponent(projectableNodes: Node[][]): ComponentInfo {\n const providers: StaticProvider[] = [{provide: $SCOPE, useValue: this.componentScope}];\n const childInjector = Injector.create(\n {providers: providers, parent: this.parentInjector, name: 'DowngradeComponentAdapter'});\n\n const componentRef =\n this.componentFactory.create(childInjector, projectableNodes, this.element[0]);\n const viewChangeDetector = componentRef.injector.get(ChangeDetectorRef);\n const changeDetector = componentRef.changeDetectorRef;\n\n // testability hook is commonly added during component bootstrap in\n // packages/core/src/application_ref.bootstrap()\n // in downgraded application, component creation will take place here as well as adding the\n // testability hook.\n const testability = componentRef.injector.get(Testability, null);\n if (testability) {\n componentRef.injector.get(TestabilityRegistry)\n .registerApplication(componentRef.location.nativeElement, testability);\n }\n\n hookupNgModel(this.ngModel, componentRef.instance);\n\n return {viewChangeDetector, componentRef, changeDetector};\n }\n\n private setupInputs(\n manuallyAttachView: boolean, propagateDigest = true,\n {componentRef, changeDetector, viewChangeDetector}: ComponentInfo): void {\n const attrs = this.attrs;\n const inputs = this.componentFactory.inputs || [];\n for (const input of inputs) {\n const inputBinding = new PropertyBinding(input.propName, input.templateName);\n let expr: string|null = null;\n\n if (attrs.hasOwnProperty(inputBinding.attr)) {\n const observeFn = (prop => {\n let prevValue = INITIAL_VALUE;\n return (currValue: any) => {\n // Initially, both `$observe()` and `$watch()` will call this function.\n if (!strictEquals(prevValue, currValue)) {\n if (prevValue === INITIAL_VALUE) {\n prevValue = currValue;\n }\n\n this.updateInput(componentRef, prop, prevValue, currValue);\n prevValue = currValue;\n }\n };\n })(inputBinding.prop);\n attrs.$observe(inputBinding.attr, observeFn);\n\n // Use `$watch()` (in addition to `$observe()`) in order to initialize the input in time\n // for `ngOnChanges()`. This is necessary if we are already in a `$digest`, which means that\n // `ngOnChanges()` (which is called by a watcher) will run before the `$observe()` callback.\n let unwatch: Function|null = this.componentScope.$watch(() => {\n unwatch!();\n unwatch = null;\n observeFn(attrs[inputBinding.attr]);\n });\n } else if (attrs.hasOwnProperty(inputBinding.bindAttr)) {\n expr = attrs[inputBinding.bindAttr];\n } else if (attrs.hasOwnProperty(inputBinding.bracketAttr)) {\n expr = attrs[inputBinding.bracketAttr];\n } else if (attrs.hasOwnProperty(inputBinding.bindonAttr)) {\n expr = attrs[inputBinding.bindonAttr];\n } else if (attrs.hasOwnProperty(inputBinding.bracketParenAttr)) {\n expr = attrs[inputBinding.bracketParenAttr];\n }\n if (expr != null) {\n const watchFn =\n ((prop) => (currValue: unknown, prevValue: unknown) =>\n this.updateInput(componentRef, prop, prevValue, currValue))(inputBinding.prop);\n this.componentScope.$watch(expr, watchFn);\n }\n }\n\n // Invoke `ngOnChanges()` and Change Detection (when necessary)\n const detectChanges = () => changeDetector.detectChanges();\n const prototype = this.componentFactory.componentType.prototype;\n this.implementsOnChanges = !!(prototype && (<OnChanges>prototype).ngOnChanges);\n\n this.componentScope.$watch(() => this.inputChangeCount, this.wrapCallback(() => {\n // Invoke `ngOnChanges()`\n if (this.implementsOnChanges) {\n const inputChanges = this.inputChanges;\n this.inputChanges = {};\n (<OnChanges>componentRef.instance).ngOnChanges(inputChanges);\n }\n\n viewChangeDetector.markForCheck();\n\n // If opted out of propagating digests, invoke change detection when inputs change.\n if (!propagateDigest) {\n detectChanges();\n }\n }));\n\n // If not opted out of propagating digests, invoke change detection on every digest\n if (propagateDigest) {\n this.componentScope.$watch(this.wrapCallback(detectChanges));\n }\n\n // If necessary, attach the view so that it will be dirty-checked.\n // (Allow time for the initial input values to be set and `ngOnChanges()` to be called.)\n if (manuallyAttachView || !propagateDigest) {\n let unwatch: Function|null = this.componentScope.$watch(() => {\n unwatch!();\n unwatch = null;\n\n const appRef = this.parentInjector.get<ApplicationRef>(ApplicationRef);\n appRef.attachView(componentRef.hostView);\n });\n }\n }\n\n private setupOutputs(componentRef: ComponentRef<any>) {\n const attrs = this.attrs;\n const outputs = this.componentFactory.outputs || [];\n for (const output of outputs) {\n const outputBindings = new PropertyBinding(output.propName, output.templateName);\n const bindonAttr =\n outputBindings.bindonAttr.substring(0, outputBindings.bindonAttr.length - 6);\n const bracketParenAttr = `[(${\n outputBindings.bracketParenAttr.substring(\n 2, outputBindings.bracketParenAttr.length - 8)})]`;\n // order below is important - first update bindings then evaluate expressions\n if (attrs.hasOwnProperty(bindonAttr)) {\n this.subscribeToOutput(componentRef, outputBindings, attrs[bindonAttr], true);\n }\n if (attrs.hasOwnProperty(bracketParenAttr)) {\n this.subscribeToOutput(componentRef, outputBindings, attrs[bracketParenAttr], true);\n }\n if (attrs.hasOwnProperty(outputBindings.onAttr)) {\n this.subscribeToOutput(componentRef, outputBindings, attrs[outputBindings.onAttr]);\n }\n if (attrs.hasOwnProperty(outputBindings.parenAttr)) {\n this.subscribeToOutput(componentRef, outputBindings, attrs[outputBindings.parenAttr]);\n }\n }\n }\n\n private subscribeToOutput(\n componentRef: ComponentRef<any>, output: PropertyBinding, expr: string,\n isAssignment: boolean = false) {\n const getter = this.$parse(expr);\n const setter = getter.assign;\n if (isAssignment && !setter) {\n throw new Error(`Expression '${expr}' is not assignable!`);\n }\n const emitter = componentRef.instance[output.prop] as EventEmitter<any>;\n if (emitter) {\n emitter.subscribe({\n next: isAssignment ? (v: any) => setter!(this.scope, v) :\n (v: any) => getter(this.scope, {'$event': v})\n });\n } else {\n throw new Error(`Missing emitter '${output.prop}' on component '${\n getTypeName(this.componentFactory.componentType)}'!`);\n }\n }\n\n private registerCleanup(componentRef: ComponentRef<any>) {\n const testabilityRegistry = componentRef.injector.get(TestabilityRegistry);\n const destroyComponentRef = this.wrapCallback(() => componentRef.destroy());\n let destroyed = false;\n\n this.element.on!('$destroy', () => {\n // The `$destroy` event may have been triggered by the `cleanData()` call in the\n // `componentScope` `$destroy` handler below. In that case, we don't want to call\n // `componentScope.$destroy()` again.\n if (!destroyed) this.componentScope.$destroy();\n });\n this.componentScope.$on('$destroy', () => {\n if (!destroyed) {\n destroyed = true;\n testabilityRegistry.unregisterApplication(componentRef.location.nativeElement);\n\n // The `componentScope` might be getting destroyed, because an ancestor element is being\n // removed/destroyed. If that is the case, jqLite/jQuery would normally invoke `cleanData()`\n // on the removed element and all descendants.\n // https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/jqLite.js#L349-L355\n // https://github.com/jquery/jquery/blob/6984d1747623dbc5e87fd6c261a5b6b1628c107c/src/manipulation.js#L182\n //\n // Here, however, `destroyComponentRef()` may under some circumstances remove the element\n // from the DOM and therefore it will no longer be a descendant of the removed element when\n // `cleanData()` is called. This would result in a memory leak, because the element's data\n // and event handlers (and all objects directly or indirectly referenced by them) would be\n // retained.\n //\n // To ensure the element is always properly cleaned up, we manually call `cleanData()` on\n // this element and its descendants before destroying the `ComponentRef`.\n cleanData(this.element[0]);\n\n destroyComponentRef();\n }\n });\n }\n\n private updateInput(\n componentRef: ComponentRef<any>, prop: string, prevValue: any, currValue: any) {\n if (this.implementsOnChanges) {\n this.inputChanges[prop] = new SimpleChange(prevValue, currValue, prevValue === currValue);\n }\n\n this.inputChangeCount++;\n componentRef.instance[prop] = currValue;\n }\n\n private groupProjectableNodes() {\n let ngContentSelectors = this.componentFactory.ngContentSelectors;\n return groupNodesBySelector(ngContentSelectors, this.element.contents!());\n }\n}\n\n/**\n * Group a set of DOM nodes into `ngContent` groups, based on the given content selectors.\n */\nexport function groupNodesBySelector(ngContentSelectors: string[], nodes: Node[]): Node[][] {\n const projectableNodes: Node[][] = [];\n\n for (let i = 0, ii = ngContentSelectors.length; i < ii; ++i) {\n projectableNodes[i] = [];\n }\n\n for (let j = 0, jj = nodes.length; j < jj; ++j) {\n const node = nodes[j];\n const ngContentIndex = findMatchingNgContentIndex(node, ngContentSelectors);\n if (ngContentIndex != null) {\n projectableNodes[ngContentIndex].push(node);\n }\n }\n\n return projectableNodes;\n}\n\nfunction findMatchingNgContentIndex(element: any, ngContentSelectors: string[]): number|null {\n const ngContentIndices: number[] = [];\n let wildcardNgContentIndex: number = -1;\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const selector = ngContentSelectors[i];\n if (selector === '*') {\n wildcardNgContentIndex = i;\n } else {\n if (matchesSelector(element, selector)) {\n ngContentIndices.push(i);\n }\n }\n }\n ngContentIndices.sort();\n\n if (wildcardNgContentIndex !== -1) {\n ngContentIndices.push(wildcardNgContentIndex);\n }\n return ngContentIndices.length ? ngContentIndices[0] : null;\n}\n\nfunction matchesSelector(el: any, selector: string): boolean {\n const elProto = <any>Element.prototype;\n\n return el.nodeType === Node.ELEMENT_NODE\n // matches is supported by all browsers from 2014 onwards except non-chromium edge\n ?\n (elProto.matches ?? elProto.msMatchesSelector).call(el, selector) :\n false;\n}\n\ninterface ComponentInfo {\n componentRef: ComponentRef<any>;\n changeDetector: ChangeDetectorRef;\n viewChangeDetector: ChangeDetectorRef;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isFunction} from './util';\n\nexport interface Thenable<T> {\n then(callback: (value: T) => any): any;\n}\n\nexport function isThenable<T>(obj: unknown): obj is Thenable<T> {\n return !!obj && isFunction((obj as any).then);\n}\n\n/**\n * Synchronous, promise-like object.\n */\nexport class SyncPromise<T> {\n protected value: T|undefined;\n private resolved = false;\n private callbacks: ((value: T) => unknown)[] = [];\n\n static all<T>(valuesOrPromises: (T|Thenable<T>)[]): SyncPromise<T[]> {\n const aggrPromise = new SyncPromise<T[]>();\n\n let resolvedCount = 0;\n const results: T[] = [];\n const resolve = (idx: number, value: T) => {\n results[idx] = value;\n if (++resolvedCount === valuesOrPromises.length) aggrPromise.resolve(results);\n };\n\n valuesOrPromises.forEach((p, idx) => {\n if (isThenable(p)) {\n p.then(v => resolve(idx, v));\n } else {\n resolve(idx, p);\n }\n });\n\n return aggrPromise;\n }\n\n resolve(value: T): void {\n // Do nothing, if already resolved.\n if (this.resolved) return;\n\n this.value = value;\n this.resolved = true;\n\n // Run the queued callbacks.\n this.callbacks.forEach(callback => callback(value));\n this.callbacks.length = 0;\n }\n\n then(callback: (value: T) => unknown): void {\n if (this.resolved) {\n callback(this.value!);\n } else {\n this.callbacks.push(callback);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentFactory, ComponentFactoryResolver, Injector, NgZone, Type} from '@angular/core';\n\nimport {IAnnotatedFunction, IAttributes, IAugmentedJQuery, ICompileService, IDirective, IInjectorService, INgModelController, IParseService, IScope} from './angular1';\nimport {$COMPILE, $INJECTOR, $PARSE, INJECTOR_KEY, LAZY_MODULE_REF, REQUIRE_INJECTOR, REQUIRE_NG_MODEL} from './constants';\nimport {DowngradeComponentAdapter} from './downgrade_component_adapter';\nimport {SyncPromise, Thenable} from './promise_util';\nimport {controllerKey, getDowngradedModuleCount, getTypeName, getUpgradeAppType, LazyModuleRef, UpgradeAppType, validateInjectionKey} from './util';\n\n\n/**\n * @description\n *\n * A helper function that allows an Angular component to be used from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function to be used for registering\n * an AngularJS wrapper directive for \"downgrading\" an Angular component.\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an Angular component called `ng2Heroes` that needs\n * to be made available in AngularJS templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes\"}\n *\n * We must create an AngularJS [directive](https://docs.angularjs.org/guide/directive)\n * that will make this Angular component available inside AngularJS templates.\n * The `downgradeComponent()` function returns a factory function that we\n * can use to define the AngularJS directive that wraps the \"downgraded\" component.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-wrapper\"}\n *\n * For more details and examples on downgrading Angular components to AngularJS components please\n * visit the [Upgrade guide](guide/upgrade#using-angular-components-from-angularjs-code).\n *\n * @param info contains information about the Component that is being downgraded:\n *\n * - `component: Type<any>`: The type of the Component that will be downgraded\n * - `downgradedModule?: string`: The name of the downgraded module (if any) that the component\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose\n * corresponding Angular module will be bootstrapped, when the component needs to be instantiated.\n * <br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one\n * Angular module.)\n * - `propagateDigest?: boolean`: Whether to perform {@link ChangeDetectorRef#detectChanges\n * change detection} on the component on every\n * [$digest](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest). If set to `false`,\n * change detection will still be performed when any of the component's inputs changes.\n * (Default: true)\n *\n * @returns a factory function that can be used to register the component in an\n * AngularJS module.\n *\n * @publicApi\n */\nexport function downgradeComponent(info: {\n component: Type<any>;\n downgradedModule?: string;\n propagateDigest?: boolean;\n /** @deprecated since v4. This parameter is no longer used */\n inputs?: string[];\n /** @deprecated since v4. This parameter is no longer used */\n outputs?: string[];\n /** @deprecated since v4. This parameter is no longer used */\n selectors?: string[];\n}): any /* angular.IInjectable */ {\n const directiveFactory: IAnnotatedFunction = function(\n $compile: ICompileService, $injector: IInjectorService, $parse: IParseService): IDirective {\n // When using `downgradeModule()`, we need to handle certain things specially. For example:\n // - We always need to attach the component view to the `ApplicationRef` for it to be\n // dirty-checked.\n // - We need to ensure callbacks to Angular APIs (e.g. change detection) are run inside the\n // Angular zone.\n // NOTE: This is not needed, when using `UpgradeModule`, because `$digest()` will be run\n // inside the Angular zone (except if explicitly escaped, in which case we shouldn't\n // force it back in).\n const isNgUpgradeLite = getUpgradeAppType($injector) === UpgradeAppType.Lite;\n const wrapCallback: <T>(cb: () => T) => typeof cb =\n !isNgUpgradeLite ? cb => cb : cb => () => NgZone.isInAngularZone() ? cb() : ngZone.run(cb);\n let ngZone: NgZone;\n\n // When downgrading multiple modules, special handling is needed wrt injectors.\n const hasMultipleDowngradedModules =\n isNgUpgradeLite && (getDowngradedModuleCount($injector) > 1);\n\n return {\n restrict: 'E',\n terminal: true,\n require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],\n link: (scope: IScope, element: IAugmentedJQuery, attrs: IAttributes, required: any[]) => {\n // We might have to compile the contents asynchronously, because this might have been\n // triggered by `UpgradeNg1ComponentAdapterBuilder`, before the Angular templates have\n // been compiled.\n\n const ngModel: INgModelController = required[1];\n const parentInjector: Injector|Thenable<Injector>|undefined = required[0];\n let moduleInjector: Injector|Thenable<Injector>|undefined = undefined;\n let ranAsync = false;\n\n if (!parentInjector || hasMultipleDowngradedModules) {\n const downgradedModule = info.downgradedModule || '';\n const lazyModuleRefKey = `${LAZY_MODULE_REF}${downgradedModule}`;\n const attemptedAction = `instantiating component '${getTypeName(info.component)}'`;\n\n validateInjectionKey($injector, downgradedModule, lazyModuleRefKey, attemptedAction);\n\n const lazyModuleRef = $injector.get(lazyModuleRefKey) as LazyModuleRef;\n moduleInjector = lazyModuleRef.injector ?? lazyModuleRef.promise;\n }\n\n // Notes:\n //\n // There are two injectors: `finalModuleInjector` and `finalParentInjector` (they might be\n // the same instance, but that is irrelevant):\n // - `finalModuleInjector` is used to retrieve `ComponentFactoryResolver`, thus it must be\n // on the same tree as the `NgModule` that declares this downgraded component.\n // - `finalParentInjector` is used for all other injection purposes.\n // (Note that Angular knows to only traverse the component-tree part of that injector,\n // when looking for an injectable and then switch to the module injector.)\n //\n // There are basically three cases:\n // - If there is no parent component (thus no `parentInjector`), we bootstrap the downgraded\n // `NgModule` and use its injector as both `finalModuleInjector` and\n // `finalParentInjector`.\n // - If there is a parent component (and thus a `parentInjector`) and we are sure that it\n // belongs to the same `NgModule` as this downgraded component (e.g. because there is only\n // one downgraded module, we use that `parentInjector` as both `finalModuleInjector` and\n // `finalParentInjector`.\n // - If there is a parent component, but it may belong to a different `NgModule`, then we\n // use the `parentInjector` as `finalParentInjector` and this downgraded component's\n // declaring `NgModule`'s injector as `finalModuleInjector`.\n // Note 1: If the `NgModule` is already bootstrapped, we just get its injector (we don't\n // bootstrap again).\n // Note 2: It is possible that (while there are multiple downgraded modules) this\n // downgraded component and its parent component both belong to the same NgModule.\n // In that case, we could have used the `parentInjector` as both\n // `finalModuleInjector` and `finalParentInjector`, but (for simplicity) we are\n // treating this case as if they belong to different `NgModule`s. That doesn't\n // really affect anything, since `parentInjector` has `moduleInjector` as ancestor\n // and trying to resolve `ComponentFactoryResolver` from either one will return\n // the same instance.\n\n // If there is a parent component, use its injector as parent injector.\n // If this is a \"top-level\" Angular component, use the module injector.\n const finalParentInjector = parentInjector || moduleInjector!;\n\n // If this is a \"top-level\" Angular component or the parent component may belong to a\n // different `NgModule`, use the module injector for module-specific dependencies.\n // If there is a parent component that belongs to the same `NgModule`, use its injector.\n const finalModuleInjector = moduleInjector || parentInjector!;\n\n const doDowngrade = (injector: Injector, moduleInjector: Injector) => {\n // Retrieve `ComponentFactoryResolver` from the injector tied to the `NgModule` this\n // component belongs to.\n const componentFactoryResolver: ComponentFactoryResolver =\n moduleInjector.get(ComponentFactoryResolver);\n const componentFactory: ComponentFactory<any> =\n componentFactoryResolver.resolveComponentFactory(info.component)!;\n\n if (!componentFactory) {\n throw new Error(`Expecting ComponentFactory for: ${getTypeName(info.component)}`);\n }\n\n const injectorPromise = new ParentInjectorPromise(element);\n const facade = new DowngradeComponentAdapter(\n element, attrs, scope, ngModel, injector, $compile, $parse, componentFactory,\n wrapCallback);\n\n const projectableNodes = facade.compileContents();\n const componentRef = facade.createComponentAndSetup(\n projectableNodes, isNgUpgradeLite, info.propagateDigest);\n\n injectorPromise.resolve(componentRef.injector);\n\n if (ranAsync) {\n // If this is run async, it is possible that it is not run inside a\n // digest and initial input values will not be detected.\n scope.$evalAsync(() => {});\n }\n };\n\n const downgradeFn =\n !isNgUpgradeLite ? doDowngrade : (pInjector: Injector, mInjector: Injector) => {\n if (!ngZone) {\n ngZone = pInjector.get(NgZone);\n }\n\n wrapCallback(() => doDowngrade(pInjector, mInjector))();\n };\n\n // NOTE:\n // Not using `ParentInjectorPromise.all()` (which is inherited from `SyncPromise`), because\n // Closure Compiler (or some related tool) complains:\n // `TypeError: ...$src$downgrade_component_ParentInjectorPromise.all is not a function`\n SyncPromise.all([finalParentInjector, finalModuleInjector])\n .then(([pInjector, mInjector]) => downgradeFn(pInjector, mInjector));\n\n ranAsync = true;\n }\n };\n };\n\n // bracket-notation because of closure - see #14441\n directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE];\n return directiveFactory;\n}\n\n/**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of AngularJS's `$compile`.\n */\nclass ParentInjectorPromise extends SyncPromise<Injector> {\n private injectorKey: string = controllerKey(INJECTOR_KEY);\n\n constructor(private element: IAugmentedJQuery) {\n super();\n\n // Store the promise on the element.\n element.data!(this.injectorKey, this);\n }\n\n override resolve(injector: Injector): void {\n // Store the real injector on the element.\n this.element.data!(this.injectorKey, injector);\n\n // Release the element to prevent memory leaks.\n this.element = null!;\n\n // Resolve the promise.\n super.resolve(injector);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '@angular/core';\n\nimport {IInjectorService} from './angular1';\nimport {$INJECTOR, INJECTOR_KEY} from './constants';\nimport {getTypeName, isFunction, validateInjectionKey} from './util';\n\n/**\n * @description\n *\n * A helper function to allow an Angular service to be accessible from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function that provides access to the Angular\n * service identified by the `token` parameter.\n *\n * @usageNotes\n * ### Examples\n *\n * First ensure that the service to be downgraded is provided in an `NgModule`\n * that will be part of the upgrade application. For example, let's assume we have\n * defined `HeroesService`\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-service\"}\n *\n * and that we have included this in our upgrade app `NgModule`\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-module\"}\n *\n * Now we can register the `downgradeInjectable` factory function for the service\n * on an AngularJS module.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"downgrade-ng2-heroes-service\"}\n *\n * Inside an AngularJS component's controller we can get hold of the\n * downgraded service via the name we gave when downgrading.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"example-app\"}\n *\n * <div class=\"alert is-important\">\n *\n * When using `downgradeModule()`, downgraded injectables will not be available until the Angular\n * module that provides them is instantiated. In order to be safe, you need to ensure that the\n * downgraded injectables are not used anywhere _outside_ the part of the app where it is\n * guaranteed that their module has been instantiated.\n *\n * For example, it is _OK_ to use a downgraded service in an upgraded component that is only used\n * from a downgraded Angular component provided by the same Angular module as the injectable, but\n * it is _not OK_ to use it in an AngularJS component that may be used independently of Angular or\n * use it in a downgraded Angular component from a different module.\n *\n * </div>\n *\n * @param token an `InjectionToken` that identifies a service provided from Angular.\n * @param downgradedModule the name of the downgraded module (if any) that the injectable\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose injector will\n * be used for instantiating the injectable.<br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one Angular\n * module.)\n *\n * @returns a [factory function](https://docs.angularjs.org/guide/di) that can be\n * used to register the service on an AngularJS module.\n *\n * @publicApi\n */\nexport function downgradeInjectable(token: any, downgradedModule: string = ''): Function {\n const factory = function($injector: IInjectorService) {\n const injectorKey = `${INJECTOR_KEY}${downgradedModule}`;\n const injectableName = isFunction(token) ? getTypeName(token) : String(token);\n const attemptedAction = `instantiating injectable '${injectableName}'`;\n\n validateInjectionKey($injector, downgradedModule, injectorKey, attemptedAction);\n\n try {\n const injector: Injector = $injector.get(injectorKey);\n return injector.get(token);\n } catch (err) {\n throw new Error(`Error while ${attemptedAction}: ${(err as Error).message || err}`);\n }\n };\n (factory as any)['$inject'] = [$INJECTOR];\n\n return factory;\n}\n","\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {IInjectorService} from '../../src/common/src/angular1';\n\n// We have to do a little dance to get the ng1 injector into the module injector.\n// We store the ng1 injector so that the provider in the module injector can access it\n// Then we \"get\" the ng1 injector from the module injector, which triggers the provider to read\n// the stored injector and release the reference to it.\nlet tempInjectorRef: IInjectorService|null = null;\nexport function setTempInjectorRef(injector: IInjectorService) {\n tempInjectorRef = injector;\n}\nexport function injectorFactory() {\n if (!tempInjectorRef) {\n throw new Error('Trying to get the AngularJS injector before it being set.');\n }\n\n const injector: IInjectorService = tempInjectorRef;\n tempInjectorRef = null; // clear the value to prevent memory leaks\n return injector;\n}\n\nexport function rootScopeFactory(i: IInjectorService) {\n return i.get('$rootScope');\n}\n\nexport function compileFactory(i: IInjectorService) {\n return i.get('$compile');\n}\n\nexport function parseFactory(i: IInjectorService) {\n return i.get('$parse');\n}\n\nexport const angular1Providers = [\n // We must use exported named functions for the ng2 factories to keep the compiler happy:\n // > Metadata collected contains an error that will be reported at runtime:\n // > Function calls are not supported.\n // > Consider replacing the function or lambda with a reference to an exported function\n {provide: '$injector', useFactory: injectorFactory, deps: []},\n {provide: '$rootScope', useFactory: rootScopeFactory, deps: ['$injector']},\n {provide: '$compile', useFactory: compileFactory, deps: ['$injector']},\n {provide: '$parse', useFactory: parseFactory, deps: ['$injector']}\n];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from '@angular/core';\n\n\nexport class NgAdapterInjector implements Injector {\n constructor(private modInjector: Injector) {}\n\n // When Angular locate a service in the component injector tree, the not found value is set to\n // `NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR`. In such a case we should not walk up to the module\n // injector.\n // AngularJS only supports a single tree and should always check the module injector.\n get(token: any, notFoundValue?: any): any {\n if (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n return notFoundValue;\n }\n\n return this.modInjector.get(token, notFoundValue);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, NgModuleFactory, NgModuleRef, PlatformRef, StaticProvider, Type} from '@angular/core';\nimport {platformBrowser} from '@angular/platform-browser';\n\nimport {IInjectorService, IProvideService, module_ as angularModule} from '../../src/common/src/angular1';\nimport {$INJECTOR, $PROVIDE, DOWNGRADED_MODULE_COUNT_KEY, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';\nimport {destroyApp, getDowngradedModuleCount, isFunction, isNgModuleType, LazyModuleRef, UpgradeAppType} from '../../src/common/src/util';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\n\n\nlet moduleUid = 0;\n\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n * NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n * bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n * `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n * that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"alert is-important\">\n *\n * You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n * Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n * inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n * [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n * detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * <div class=\"alert is-helpful\">\n *\n * You can manually trigger a change detection run in AngularJS using\n * [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n * [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n * You can manually trigger a change detection run in Angular using {@link NgZone#run\n * ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n * module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n * `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n * `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n * {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n * downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n * will be created for every injectable provided in `\"root\"` (via\n * {@link Injectable#providedIn `providedIn`}).\n * If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n * module) and create all downgraded modules using that module's injector:\n *\n * {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n */\nexport function downgradeModule<T>(moduleOrBootstrapFn: Type<T>|(\n (extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string;\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n * NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n * bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n * `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n * that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"alert is-important\">\n *\n * You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n * Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n * inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n * [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n * detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * <div class=\"alert is-helpful\">\n *\n * You can manually trigger a change detection run in AngularJS using\n * [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n * [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n * You can manually trigger a change detection run in Angular using {@link NgZone#run\n * ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n * module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n * `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n * `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n * {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n * downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n * will be created for every injectable provided in `\"root\"` (via\n * {@link Injectable#providedIn `providedIn`}).\n * If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n * module) and create all downgraded modules using that module's injector:\n *\n * {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n *\n * @deprecated Passing `NgModuleFactory` as the `downgradeModule` function argument is deprecated,\n * please pass an NgModule class reference instead.\n */\nexport function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): string;\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory`, `NgModule` class or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n * NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n * bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n * `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n * that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"alert is-important\">\n *\n * You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n * Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n * inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n * [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n * detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * <div class=\"alert is-helpful\">\n *\n * You can manually trigger a change detection run in AngularJS using\n * [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n * [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n * You can manually trigger a change detection run in Angular using {@link NgZone#run\n * ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n * module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n * `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n * `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n * {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n * downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n * will be created for every injectable provided in `\"root\"` (via\n * {@link Injectable#providedIn `providedIn`}).\n * If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n * module) and create all downgraded modules using that module's injector:\n *\n * {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n */\nexport function downgradeModule<T>(moduleOrBootstrapFn: Type<T>|NgModuleFactory<T>|(\n (extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string {\n const lazyModuleName = `${UPGRADE_MODULE_NAME}.lazy${++moduleUid}`;\n const lazyModuleRefKey = `${LAZY_MODULE_REF}${lazyModuleName}`;\n const lazyInjectorKey = `${INJECTOR_KEY}${lazyModuleName}`;\n\n let bootstrapFn: (extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>;\n if (isNgModuleType(moduleOrBootstrapFn)) {\n // NgModule class\n bootstrapFn = (extraProviders: StaticProvider[]) =>\n platformBrowser(extraProviders).bootstrapModule(moduleOrBootstrapFn);\n } else if (!isFunction(moduleOrBootstrapFn)) {\n // NgModule factory\n bootstrapFn = (extraProviders: StaticProvider[]) =>\n platformBrowser(extraProviders).bootstrapModuleFactory(moduleOrBootstrapFn);\n } else {\n // bootstrap function\n bootstrapFn = moduleOrBootstrapFn;\n }\n\n let injector: Injector;\n\n // Create an ng1 module to bootstrap.\n angularModule(lazyModuleName, [])\n .constant(UPGRADE_APP_TYPE_KEY, UpgradeAppType.Lite)\n .factory(INJECTOR_KEY, [lazyInjectorKey, identity])\n .factory(\n lazyInjectorKey,\n () => {\n if (!injector) {\n throw new Error(\n 'Trying to get the Angular injector before bootstrapping the corresponding ' +\n 'Angular module.');\n }\n return injector;\n })\n .factory(LAZY_MODULE_REF, [lazyModuleRefKey, identity])\n .factory(\n lazyModuleRefKey,\n [\n $INJECTOR,\n ($injector: IInjectorService) => {\n setTempInjectorRef($injector);\n const result: LazyModuleRef = {\n promise: bootstrapFn(angular1Providers).then(ref => {\n injector = result.injector = new NgAdapterInjector(ref.injector);\n injector.get($INJECTOR);\n\n // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n // This does not happen in a typical SPA scenario, but it might be useful for\n // other use-cases where disposing of an Angular/AngularJS app is necessary\n // (such as Hot Module Replacement (HMR)).\n // See https://github.com/angular/angular/issues/39935.\n injector.get(PlatformRef).onDestroy(() => destroyApp($injector));\n\n return injector;\n })\n };\n return result;\n }\n ])\n .config([\n $INJECTOR, $PROVIDE,\n ($injector: IInjectorService, $provide: IProvideService) => {\n $provide.constant(DOWNGRADED_MODULE_COUNT_KEY, getDowngradedModuleCount($injector) + 1);\n }\n ]);\n\n return lazyModuleName;\n}\n\nfunction identity<T = any>(x: T): T {\n return x;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, DoCheck, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';\n\nimport {IAttributes, IAugmentedJQuery, IDirective, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../../src/common/src/angular1';\nimport {$SCOPE} from '../../src/common/src/constants';\nimport {IBindingDestination, IControllerInstance, UpgradeHelper} from '../../src/common/src/upgrade_helper';\nimport {isFunction} from '../../src/common/src/util';\n\nconst NOT_SUPPORTED: any = 'NOT_SUPPORTED';\nconst INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\n\nclass Bindings {\n twoWayBoundProperties: string[] = [];\n twoWayBoundLastValues: any[] = [];\n\n expressionBoundProperties: string[] = [];\n\n propertyToOutputMap: {[propName: string]: string} = {};\n}\n\n/**\n * @description\n *\n * A helper class that allows an AngularJS component to be used from Angular.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation.*\n *\n * This helper class should be used as a base class for creating Angular directives\n * that wrap AngularJS components that need to be \"upgraded\".\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an AngularJS component called `ng1Hero` that needs\n * to be made available in Angular templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero\"}\n *\n * We must create a `Directive` that will make this AngularJS component\n * available inside Angular templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero-wrapper\"}\n *\n * In this example you can see that we must derive from the `UpgradeComponent`\n * base class but also provide an {@link Directive `@Directive`} decorator. This is\n * because the AOT compiler requires that this information is statically available at\n * compile time.\n *\n * Note that we must do the following:\n * * specify the directive's selector (`ng1-hero`)\n * * specify all inputs and outputs that the AngularJS component expects\n * * derive from `UpgradeComponent`\n * * call the base class from the constructor, passing\n * * the AngularJS name of the component (`ng1Hero`)\n * * the `ElementRef` and `Injector` for the component wrapper\n *\n * @publicApi\n * @extensible\n */\n@Directive()\nexport class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {\n private helper: UpgradeHelper;\n\n private $element: IAugmentedJQuery;\n private $componentScope: IScope;\n\n private directive: IDirective;\n private bindings: Bindings;\n\n private controllerInstance?: IControllerInstance;\n private bindingDestination?: IBindingDestination;\n\n // We will be instantiating the controller in the `ngOnInit` hook, when the\n // first `ngOnChanges` will have been already triggered. We store the\n // `SimpleChanges` and \"play them back\" later.\n private pendingChanges: SimpleChanges|null = null;\n\n private unregisterDoCheckWatcher?: Function;\n\n /**\n * Create a new `UpgradeComponent` instance. You should not normally need to do this.\n * Instead you should derive a new class from this one and call the super constructor\n * from the base class.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero-wrapper\" }\n *\n * * The `name` parameter should be the name of the AngularJS directive.\n * * The `elementRef` and `injector` parameters should be acquired from Angular by dependency\n * injection into the base class constructor.\n */\n constructor(name: string, elementRef: ElementRef, injector: Injector) {\n this.helper = new UpgradeHelper(injector, name, elementRef);\n\n this.$element = this.helper.$element;\n\n this.directive = this.helper.directive;\n this.bindings = this.initializeBindings(this.directive, name);\n\n // We ask for the AngularJS scope from the Angular injector, since\n // we will put the new component scope onto the new injector for each component\n const $parentScope = injector.get($SCOPE);\n // QUESTION 1: Should we create an isolated scope if the scope is only true?\n // QUESTION 2: Should we make the scope accessible through `$element.scope()/isolateScope()`?\n this.$componentScope = $parentScope.$new(!!this.directive.scope);\n\n this.initializeOutputs();\n }\n\n ngOnInit() {\n // Collect contents, insert and compile template\n const attachChildNodes: ILinkFn|undefined = this.helper.prepareTransclusion();\n const linkFn = this.helper.compileTemplate();\n\n // Instantiate controller\n const controllerType = this.directive.controller;\n const bindToController = this.directive.bindToController;\n let controllerInstance = controllerType ?\n this.helper.buildController(controllerType, this.$componentScope) :\n undefined;\n let bindingDestination: IBindingDestination;\n\n if (!bindToController) {\n bindingDestination = this.$componentScope;\n } else if (controllerType && controllerInstance) {\n bindingDestination = controllerInstance;\n } else {\n throw new Error(`Upgraded directive '${\n this.directive.name}' specifies 'bindToController' but no controller.`);\n }\n this.controllerInstance = controllerInstance;\n this.bindingDestination = bindingDestination;\n\n // Set up outputs\n this.bindOutputs(bindingDestination);\n\n // Require other controllers\n const requiredControllers = this.helper.resolveAndBindRequiredControllers(controllerInstance);\n\n // Hook: $onChanges\n if (this.pendingChanges) {\n this.forwardChanges(this.pendingChanges, bindingDestination);\n this.pendingChanges = null;\n }\n\n // Hook: $onInit\n if (this.controllerInstance && isFunction(this.controllerInstance.$onInit)) {\n this.controllerInstance.$onInit();\n }\n\n // Hook: $doCheck\n if (controllerInstance && isFunction(controllerInstance.$doCheck)) {\n const callDoCheck = () => controllerInstance?.$doCheck?.();\n\n this.unregisterDoCheckWatcher = this.$componentScope.$parent.$watch(callDoCheck);\n callDoCheck();\n }\n\n // Linking\n const link = this.directive.link;\n const preLink = typeof link == 'object' && link.pre;\n const postLink = typeof link == 'object' ? link.post : link;\n const attrs: IAttributes = NOT_SUPPORTED;\n const transcludeFn: ITranscludeFunction = NOT_SUPPORTED;\n if (preLink) {\n preLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n\n linkFn(this.$componentScope, null!, {parentBoundTranscludeFn: attachChildNodes});\n\n if (postLink) {\n postLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n\n // Hook: $postLink\n if (this.controllerInstance && isFunction(this.controllerInstance.$postLink)) {\n this.controllerInstance.$postLink();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (!this.bindingDestination) {\n this.pendingChanges = changes;\n } else {\n this.forwardChanges(changes, this.bindingDestination);\n }\n }\n\n ngDoCheck() {\n const twoWayBoundProperties = this.bindings.twoWayBoundProperties;\n const twoWayBoundLastValues = this.bindings.twoWayBoundLastValues;\n const propertyToOutputMap = this.bindings.propertyToOutputMap;\n\n twoWayBoundProperties.forEach((propName, idx) => {\n const newValue = this.bindingDestination?.[propName];\n const oldValue = twoWayBoundLastValues[idx];\n\n if (!Object.is(newValue, oldValue)) {\n const outputName = propertyToOutputMap[propName];\n const eventEmitter: EventEmitter<any> = (this as any)[outputName];\n\n eventEmitter.emit(newValue);\n twoWayBoundLastValues[idx] = newValue;\n }\n });\n }\n\n ngOnDestroy() {\n if (isFunction(this.unregisterDoCheckWatcher)) {\n this.unregisterDoCheckWatcher();\n }\n this.helper.onDestroy(this.$componentScope, this.controllerInstance);\n }\n\n private initializeBindings(directive: IDirective, name: string) {\n const btcIsObject = typeof directive.bindToController === 'object';\n if (btcIsObject && Object.keys(directive.scope!).length) {\n throw new Error(\n `Binding definitions on scope and controller at the same time is not supported.`);\n }\n\n const context = btcIsObject ? directive.bindToController : directive.scope;\n const bindings = new Bindings();\n\n if (typeof context == 'object') {\n Object.keys(context).forEach(propName => {\n const definition = context[propName];\n const bindingType = definition.charAt(0);\n\n // QUESTION: What about `=*`? Ignore? Throw? Support?\n\n switch (bindingType) {\n case '@':\n case '<':\n // We don't need to do anything special. They will be defined as inputs on the\n // upgraded component facade and the change propagation will be handled by\n // `ngOnChanges()`.\n break;\n case '=':\n bindings.twoWayBoundProperties.push(propName);\n bindings.twoWayBoundLastValues.push(INITIAL_VALUE);\n bindings.propertyToOutputMap[propName] = propName + 'Change';\n break;\n case '&':\n bindings.expressionBoundProperties.push(propName);\n bindings.propertyToOutputMap[propName] = propName;\n break;\n default:\n let json = JSON.stringify(context);\n throw new Error(\n `Unexpected mapping '${bindingType}' in '${json}' in '${name}' directive.`);\n }\n });\n }\n\n return bindings;\n }\n\n private initializeOutputs() {\n // Initialize the outputs for `=` and `&` bindings\n this.bindings.twoWayBoundProperties.concat(this.bindings.expressionBoundProperties)\n .forEach(propName => {\n const outputName = this.bindings.propertyToOutputMap[propName];\n (this as any)[outputName] = new EventEmitter();\n });\n }\n\n private bindOutputs(bindingDestination: IBindingDestination) {\n // Bind `&` bindings to the corresponding outputs\n this.bindings.expressionBoundProperties.forEach(propName => {\n const outputName = this.bindings.propertyToOutputMap[propName];\n const emitter: EventEmitter<any> = (this as any)[outputName];\n\n bindingDestination[propName] = (value: any) => emitter.emit(value);\n });\n }\n\n private forwardChanges(changes: SimpleChanges, bindingDestination: IBindingDestination) {\n // Forward input changes to `bindingDestination`\n Object.keys(changes).forEach(\n propName => bindingDestination[propName] = changes[propName].currentValue);\n\n if (isFunction(bindingDestination.$onChanges)) {\n bindingDestination.$onChanges(changes);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, NgModule, NgZone, PlatformRef, Testability} from '@angular/core';\n\nimport {bootstrap, element as angularElement, IInjectorService, IIntervalService, IProvideService, ITestabilityService, module_ as angularModule} from '../../src/common/src/angular1';\nimport {$$TESTABILITY, $DELEGATE, $INJECTOR, $INTERVAL, $PROVIDE, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';\nimport {controllerKey, destroyApp, LazyModuleRef, UpgradeAppType} from '../../src/common/src/util';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\n\n\n\n/**\n * @description\n *\n * An `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * The `upgrade/static` package contains helpers that allow AngularJS and Angular components\n * to be used together inside a hybrid upgrade application, which supports AOT compilation.\n *\n * Specifically, the classes and functions in the `upgrade/static` module allow the following:\n *\n * 1. Creation of an Angular directive that wraps and exposes an AngularJS component so\n * that it can be used in an Angular template. See `UpgradeComponent`.\n * 2. Creation of an AngularJS directive that wraps and exposes an Angular component so\n * that it can be used in an AngularJS template. See `downgradeComponent`.\n * 3. Creation of an Angular root injector provider that wraps and exposes an AngularJS\n * service so that it can be injected into an Angular context. See\n * {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an AngularJS service} below.\n * 4. Creation of an AngularJS service that wraps and exposes an Angular injectable\n * so that it can be injected into an AngularJS context. See `downgradeInjectable`.\n * 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks\n * coexisting in a single application.\n *\n * @usageNotes\n *\n * ```ts\n * import {UpgradeModule} from '@angular/upgrade/static';\n * ```\n *\n * See also the {@link UpgradeModule#examples examples} below.\n *\n * ### Mental Model\n *\n * When reasoning about how a hybrid application works it is useful to have a mental model which\n * describes what is happening and explains what is happening at the lowest level.\n *\n * 1. There are two independent frameworks running in a single application, each framework treats\n * the other as a black box.\n * 2. Each DOM element on the page is owned exactly by one framework. Whichever framework\n * instantiated the element is the owner. Each framework only updates/interacts with its own\n * DOM elements and ignores others.\n * 3. AngularJS directives always execute inside the AngularJS framework codebase regardless of\n * where they are instantiated.\n * 4. Angular components always execute inside the Angular framework codebase regardless of\n * where they are instantiated.\n * 5. An AngularJS component can be \"upgraded\"\" to an Angular component. This is achieved by\n * defining an Angular directive, which bootstraps the AngularJS component at its location\n * in the DOM. See `UpgradeComponent`.\n * 6. An Angular component can be \"downgraded\" to an AngularJS component. This is achieved by\n * defining an AngularJS directive, which bootstraps the Angular component at its location\n * in the DOM. See `downgradeComponent`.\n * 7. Whenever an \"upgraded\"/\"downgraded\" component is instantiated the host element is owned by\n * the framework doing the instantiation. The other framework then instantiates and owns the\n * view for that component.\n * 1. This implies that the component bindings will always follow the semantics of the\n * instantiation framework.\n * 2. The DOM attributes are parsed by the framework that owns the current template. So\n * attributes in AngularJS templates must use kebab-case, while AngularJS templates must use\n * camelCase.\n * 3. However the template binding syntax will always use the Angular style, e.g. square\n * brackets (`[...]`) for property binding.\n * 8. Angular is bootstrapped first; AngularJS is bootstrapped second. AngularJS always owns the\n * root component of the application.\n * 9. The new application is running in an Angular zone, and therefore it no longer needs calls to\n * `$apply()`.\n *\n * ### The `UpgradeModule` class\n *\n * This class is an `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * * Core AngularJS services<br />\n * Importing this `NgModule` will add providers for the core\n * [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector.\n *\n * * Bootstrap<br />\n * The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}\n * method, which you use to bootstrap the top level AngularJS module onto an element in the\n * DOM for the hybrid upgrade app.\n *\n * It also contains properties to access the {@link UpgradeModule#injector root injector}, the\n * bootstrap `NgZone` and the\n * [AngularJS $injector](https://docs.angularjs.org/api/auto/service/$injector).\n *\n * ### Examples\n *\n * Import the `UpgradeModule` into your top level {@link NgModule Angular `NgModule`}.\n *\n * {@example upgrade/static/ts/full/module.ts region='ng2-module'}\n *\n * Then inject `UpgradeModule` into your Angular `NgModule` and use it to bootstrap the top level\n * [AngularJS module](https://docs.angularjs.org/api/ng/type/angular.Module) in the\n * `ngDoBootstrap()` method.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng1'}\n *\n * Finally, kick off the whole process, by bootstrapping your top level Angular `NgModule`.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng2'}\n *\n * {@a upgrading-an-angular-1-service}\n * ### Upgrading an AngularJS service\n *\n * There is no specific API for upgrading an AngularJS service. Instead you should just follow the\n * following recipe:\n *\n * Let's say you have an AngularJS service:\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-text-formatter-service\"}\n *\n * Then you should define an Angular provider to be included in your `NgModule` `providers`\n * property.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"upgrade-ng1-service\"}\n *\n * Then you can use the \"upgraded\" AngularJS service by injecting it into an Angular component\n * or service.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"use-ng1-upgraded-service\"}\n *\n * @publicApi\n */\n@NgModule({providers: [angular1Providers]})\nexport class UpgradeModule {\n /**\n * The AngularJS `$injector` for the upgrade application.\n */\n public $injector: any /*angular.IInjectorService*/;\n /** The Angular Injector **/\n public injector: Injector;\n\n constructor(\n /** The root `Injector` for the upgrade application. */\n injector: Injector,\n /** The bootstrap zone for the upgrade application */\n public ngZone: NgZone,\n /**\n * The owning `NgModuleRef`s `PlatformRef` instance.\n * This is used to tie the lifecycle of the bootstrapped AngularJS apps to that of the Angular\n * `PlatformRef`.\n */\n private platformRef: PlatformRef) {\n this.injector = new NgAdapterInjector(injector);\n }\n\n /**\n * Bootstrap an AngularJS application from this NgModule\n * @param element the element on which to bootstrap the AngularJS application\n * @param [modules] the AngularJS modules to bootstrap for this application\n * @param [config] optional extra AngularJS bootstrap configuration\n * @return The value returned by\n * [angular.bootstrap()](https://docs.angularjs.org/api/ng/function/angular.bootstrap).\n */\n bootstrap(\n element: Element, modules: string[] = [], config?: any /*angular.IAngularBootstrapConfig*/):\n any /*ReturnType<typeof angular.bootstrap>*/ {\n const INIT_MODULE_NAME = UPGRADE_MODULE_NAME + '.init';\n\n // Create an ng1 module to bootstrap\n angularModule(INIT_MODULE_NAME, [])\n\n .constant(UPGRADE_APP_TYPE_KEY, UpgradeAppType.Static)\n\n .value(INJECTOR_KEY, this.injector)\n\n .factory(\n LAZY_MODULE_REF, [INJECTOR_KEY, (injector: Injector) => ({injector} as LazyModuleRef)])\n\n .config([\n $PROVIDE, $INJECTOR,\n ($provide: IProvideService, $injector: IInjectorService) => {\n if ($injector.has($$TESTABILITY)) {\n $provide.decorator($$TESTABILITY, [\n $DELEGATE,\n (testabilityDelegate: ITestabilityService) => {\n const originalWhenStable: Function = testabilityDelegate.whenStable;\n const injector = this.injector;\n // Cannot use arrow function below because we need the context\n const newWhenStable = function(callback: Function) {\n originalWhenStable.call(testabilityDelegate, function() {\n const ng2Testability: Testability = injector.get(Testability);\n if (ng2Testability.isStable()) {\n callback();\n } else {\n ng2Testability.whenStable(\n newWhenStable.bind(testabilityDelegate, callback));\n }\n });\n };\n\n testabilityDelegate.whenStable = newWhenStable;\n return testabilityDelegate;\n }\n ]);\n }\n\n if ($injector.has($INTERVAL)) {\n $provide.decorator($INTERVAL, [\n $DELEGATE,\n (intervalDelegate: IIntervalService) => {\n // Wrap the $interval service so that setInterval is called outside NgZone,\n // but the callback is still invoked within it. This is so that $interval\n // won't block stability, which preserves the behavior from AngularJS.\n let wrappedInterval =\n (fn: Function, delay: number, count?: number, invokeApply?: boolean,\n ...pass: any[]) => {\n return this.ngZone.runOutsideAngular(() => {\n return intervalDelegate((...args: any[]) => {\n // Run callback in the next VM turn - $interval calls\n // $rootScope.$apply, and running the callback in NgZone will\n // cause a '$digest already in progress' error if it's in the\n // same vm turn.\n setTimeout(() => {\n this.ngZone.run(() => fn(...args));\n });\n }, delay, count, invokeApply, ...pass);\n });\n };\n\n (Object.keys(intervalDelegate) as (keyof IIntervalService)[])\n .forEach(prop => (wrappedInterval as any)[prop] = intervalDelegate[prop]);\n\n // the `flush` method will be present when ngMocks is used\n if (intervalDelegate.hasOwnProperty('flush')) {\n (wrappedInterval as any)['flush'] = () => {\n (intervalDelegate as any)['flush']();\n return wrappedInterval;\n };\n }\n\n return wrappedInterval;\n }\n ]);\n }\n }\n ])\n\n .run([\n $INJECTOR,\n ($injector: IInjectorService) => {\n this.$injector = $injector;\n const $rootScope = $injector.get('$rootScope');\n\n // Initialize the ng1 $injector provider\n setTempInjectorRef($injector);\n this.injector.get($INJECTOR);\n\n // Put the injector on the DOM, so that it can be \"required\"\n angularElement(element).data!(controllerKey(INJECTOR_KEY), this.injector);\n\n // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n // This does not happen in a typical SPA scenario, but it might be useful for\n // other use-cases where disposing of an Angular/AngularJS app is necessary\n // (such as Hot Module Replacement (HMR)).\n // See https://github.com/angular/angular/issues/39935.\n this.platformRef.onDestroy(() => destroyApp($injector));\n\n // Wire up the ng1 rootScope to run a digest cycle whenever the zone settles\n // We need to do this in the next tick so that we don't prevent the bootup stabilizing\n setTimeout(() => {\n const subscription = this.ngZone.onMicrotaskEmpty.subscribe(() => {\n if ($rootScope.$$phase) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(\n 'A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.');\n }\n\n return $rootScope.$evalAsync();\n }\n\n return $rootScope.$digest();\n });\n $rootScope.$on('$destroy', () => {\n subscription.unsubscribe();\n });\n }, 0);\n }\n ]);\n\n const upgradeModule = angularModule(UPGRADE_MODULE_NAME, [INIT_MODULE_NAME].concat(modules));\n\n // Make sure resumeBootstrap() only exists if the current bootstrap is deferred\n const windowAngular = (window as any)['angular'];\n windowAngular.resumeBootstrap = undefined;\n\n // Bootstrap the AngularJS application inside our zone\n const returnValue = this.ngZone.run(() => bootstrap(element, [upgradeModule.name], config));\n\n // Patch resumeBootstrap() to run inside the ngZone\n if (windowAngular.resumeBootstrap) {\n const originalResumeBootstrap: () => void = windowAngular.resumeBootstrap;\n const ngZone = this.ngZone;\n windowAngular.resumeBootstrap = function() {\n let args = arguments;\n windowAngular.resumeBootstrap = originalResumeBootstrap;\n return ngZone.run(() => windowAngular.resumeBootstrap.apply(this, args));\n };\n }\n\n return returnValue;\n }\n}\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Type describing the allowed values for a boolean input.\n * @docs-private\n */\nexport type BooleanInput = string | boolean | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Wraps the provided value in an array, unless the provided value is an array. */\nexport function coerceArray<T>(value: T | T[]): T[];\nexport function coerceArray<T>(value: T | readonly T[]): readonly T[];\nexport function coerceArray<T>(value: T | T[]): T[] {\n return Array.isArray(value) ? value : [value];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Coerces a value to a CSS pixel value. */\nexport function coerceCssPixelValue(value: any): string {\n if (value == null) {\n return '';\n }\n\n return typeof value === 'string' ? value : `${value}px`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n","import { SchedulerLike } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { fromArray } from './fromArray';\nimport { Observable } from '../Observable';\nimport { scheduleArray } from '../scheduled/scheduleArray';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T>(a: T, scheduler: SchedulerLike): Observable<T>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2>(a: T, b: T2, scheduler: SchedulerLike): Observable<T | T2>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3>(a: T, b: T2, c: T3, scheduler: SchedulerLike): Observable<T | T2 | T3>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3, T4>(a: T, b: T2, c: T3, d: T4, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3, T4, T5>(a: T, b: T2, c: T3, d: T4, e: T5, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3, T4, T5, T6>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3, T4, T5, T6, T7>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, scheduler: SchedulerLike):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3, T4, T5, T6, T7, T8>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, scheduler: SchedulerLike):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>;\n/** @deprecated use {@link scheduled} instead `scheduled([a, b, c], scheduler)` */\nexport function of<T, T2, T3, T4, T5, T6, T7, T8, T9>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9, scheduler: SchedulerLike):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;\nexport function of<T>(...args: (T | SchedulerLike)[]): Observable<T>;\n\n// TODO(benlesh): Update the typings for this when we can switch to TS 3.x\nexport function of<T>(a: T): Observable<T>;\nexport function of<T, T2>(a: T, b: T2): Observable<T | T2>;\nexport function of<T, T2, T3>(a: T, b: T2, c: T3): Observable<T | T2 | T3>;\nexport function of<T, T2, T3, T4>(a: T, b: T2, c: T3, d: T4): Observable<T | T2 | T3 | T4>;\nexport function of<T, T2, T3, T4, T5>(a: T, b: T2, c: T3, d: T4, e: T5): Observable<T | T2 | T3 | T4 | T5>;\nexport function of<T, T2, T3, T4, T5, T6>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6): Observable<T | T2 | T3 | T4 | T5 | T6>;\nexport function of<T, T2, T3, T4, T5, T6, T7>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7>;\nexport function of<T, T2, T3, T4, T5, T6, T7, T8>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>;\nexport function of<T, T2, T3, T4, T5, T6, T7, T8, T9>(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9):\n Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;\nexport function of<T>(...args: T[]): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Converts the arguments to an observable sequence.\n *\n * <span class=\"informal\">Each argument becomes a `next` notification.</span>\n *\n * \n *\n * Unlike {@link from}, it does not do any flattening and emits each argument in whole\n * as a separate `next` notification.\n *\n * ## Examples\n *\n * Emit the values `10, 20, 30`\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * of(10, 20, 30)\n * .subscribe(\n * next => console.log('next:', next),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'next: 10'\n * // 'next: 20'\n * // 'next: 30'\n *\n * ```\n *\n * Emit the array `[1,2,3]`\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * of([1,2,3])\n * .subscribe(\n * next => console.log('next:', next),\n * err => console.log('error:', err),\n * () => console.log('the end'),\n * );\n * // result:\n * // 'next: [1,2,3]'\n * ```\n *\n * @see {@link from}\n * @see {@link range}\n *\n * @param {...T} values A comma separated list of arguments you want to be emitted\n * @return {Observable} An Observable that emits the arguments\n * described above and then completes.\n * @method of\n * @owner Observable\n */\n\nexport function of<T>(...args: Array<T | SchedulerLike>): Observable<T> {\n let scheduler = args[args.length - 1] as SchedulerLike;\n if (isScheduler(scheduler)) {\n args.pop();\n return scheduleArray(args as T[], scheduler);\n } else {\n return fromArray(args as T[]);\n }\n}\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { Subscriber } from '../Subscriber';\nimport { map } from '../operators/map';\n\nconst toString: Function = (() => Object.prototype.toString)();\n\nexport interface NodeStyleEventEmitter {\n addListener: (eventName: string | symbol, handler: NodeEventHandler) => this;\n removeListener: (eventName: string | symbol, handler: NodeEventHandler) => this;\n}\n\nexport type NodeEventHandler = (...args: any[]) => void;\n\n// For APIs that implement `addListener` and `removeListener` methods that may\n// not use the same arguments or return EventEmitter values\n// such as React Native\nexport interface NodeCompatibleEventEmitter {\n addListener: (eventName: string, handler: NodeEventHandler) => void | {};\n removeListener: (eventName: string, handler: NodeEventHandler) => void | {};\n}\n\nexport interface JQueryStyleEventEmitter {\n on: (eventName: string, handler: Function) => void;\n off: (eventName: string, handler: Function) => void;\n}\n\nexport interface HasEventTargetAddRemove<E> {\n addEventListener(type: string, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: string, listener?: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void;\n}\n\nexport type EventTargetLike<T> = HasEventTargetAddRemove<T> | NodeStyleEventEmitter | NodeCompatibleEventEmitter | JQueryStyleEventEmitter;\n\nexport type FromEventTarget<T> = EventTargetLike<T> | ArrayLike<EventTargetLike<T>>;\n\nexport interface EventListenerOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n}\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\n/* tslint:disable:max-line-length */\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string, resultSelector: (...args: any[]) => T): Observable<T>;\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string, options: EventListenerOptions): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEvent<T>(target: FromEventTarget<T>, eventName: string, options: EventListenerOptions, resultSelector: (...args: any[]) => T): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable that emits events of a specific type coming from the\n * given event target.\n *\n * <span class=\"informal\">Creates an Observable from DOM events, or Node.js\n * EventEmitter events or others.</span>\n *\n * \n *\n * `fromEvent` accepts as a first argument event target, which is an object with methods\n * for registering event handler functions. As a second argument it takes string that indicates\n * type of event we want to listen for. `fromEvent` supports selected types of event targets,\n * which are described in detail below. If your event target does not match any of the ones listed,\n * you should use {@link fromEventPattern}, which can be used on arbitrary APIs.\n * When it comes to APIs supported by `fromEvent`, their methods for adding and removing event\n * handler functions have different names, but they all accept a string describing event type\n * and function itself, which will be called whenever said event happens.\n *\n * Every time resulting Observable is subscribed, event handler function will be registered\n * to event target on given event type. When that event fires, value\n * passed as a first argument to registered function will be emitted by output Observable.\n * When Observable is unsubscribed, function will be unregistered from event target.\n *\n * Note that if event target calls registered function with more than one argument, second\n * and following arguments will not appear in resulting stream. In order to get access to them,\n * you can pass to `fromEvent` optional project function, which will be called with all arguments\n * passed to event handler. Output Observable will then emit value returned by project function,\n * instead of the usual value.\n *\n * Remember that event targets listed below are checked via duck typing. It means that\n * no matter what kind of object you have and no matter what environment you work in,\n * you can safely use `fromEvent` on that object if it exposes described methods (provided\n * of course they behave as was described above). So for example if Node.js library exposes\n * event target which has the same method names as DOM EventTarget, `fromEvent` is still\n * a good choice.\n *\n * If the API you use is more callback then event handler oriented (subscribed\n * callback function fires only once and thus there is no need to manually\n * unregister it), you should use {@link bindCallback} or {@link bindNodeCallback}\n * instead.\n *\n * `fromEvent` supports following types of event targets:\n *\n * **DOM EventTarget**\n *\n * This is an object with `addEventListener` and `removeEventListener` methods.\n *\n * In the browser, `addEventListener` accepts - apart from event type string and event\n * handler function arguments - optional third parameter, which is either an object or boolean,\n * both used for additional configuration how and when passed function will be called. When\n * `fromEvent` is used with event target of that type, you can provide this values\n * as third parameter as well.\n *\n * **Node.js EventEmitter**\n *\n * An object with `addListener` and `removeListener` methods.\n *\n * **JQuery-style event target**\n *\n * An object with `on` and `off` methods\n *\n * **DOM NodeList**\n *\n * List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`.\n *\n * Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes\n * it contains and install event handler function in every of them. When returned Observable\n * is unsubscribed, function will be removed from all Nodes.\n *\n * **DOM HtmlCollection**\n *\n * Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is\n * installed and removed in each of elements.\n *\n *\n * ## Examples\n * ### Emits clicks happening on the DOM document\n * ```ts\n * import { fromEvent } from 'rxjs';\n *\n * const clicks = fromEvent(document, 'click');\n * clicks.subscribe(x => console.log(x));\n *\n * // Results in:\n * // MouseEvent object logged to console every time a click\n * // occurs on the document.\n * ```\n *\n * ### Use addEventListener with capture option\n * ```ts\n * import { fromEvent } from 'rxjs';\n *\n * const clicksInDocument = fromEvent(document, 'click', true); // note optional configuration parameter\n * // which will be passed to addEventListener\n * const clicksInDiv = fromEvent(someDivInDocument, 'click');\n *\n * clicksInDocument.subscribe(() => console.log('document'));\n * clicksInDiv.subscribe(() => console.log('div'));\n *\n * // By default events bubble UP in DOM tree, so normally\n * // when we would click on div in document\n * // \"div\" would be logged first and then \"document\".\n * // Since we specified optional `capture` option, document\n * // will catch event when it goes DOWN DOM tree, so console\n * // will log \"document\" and then \"div\".\n * ```\n *\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n * @see {@link fromEventPattern}\n *\n * @param {FromEventTarget<T>} target The DOM EventTarget, Node.js\n * EventEmitter, JQuery-like event target, NodeList or HTMLCollection to attach the event handler to.\n * @param {string} eventName The event name of interest, being emitted by the\n * `target`.\n * @param {EventListenerOptions} [options] Options to pass through to addEventListener\n * @return {Observable<T>}\n * @name fromEvent\n */\nexport function fromEvent<T>(\n target: FromEventTarget<T>,\n eventName: string,\n options?: EventListenerOptions | ((...args: any[]) => T),\n resultSelector?: ((...args: any[]) => T)\n): Observable<T> {\n\n if (isFunction(options)) {\n // DEPRECATED PATH\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEvent<T>(target, eventName, <EventListenerOptions | undefined>options).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable<T>(subscriber => {\n function handler(e: T) {\n if (arguments.length > 1) {\n subscriber.next(Array.prototype.slice.call(arguments));\n } else {\n subscriber.next(e);\n }\n }\n setupSubscription(target, eventName, handler, subscriber, options as EventListenerOptions);\n });\n}\n\nfunction setupSubscription<T>(sourceObj: FromEventTarget<T>, eventName: string,\n handler: (...args: any[]) => void, subscriber: Subscriber<T>,\n options?: EventListenerOptions) {\n let unsubscribe: () => void;\n if (isEventTarget(sourceObj)) {\n const source = sourceObj;\n sourceObj.addEventListener(eventName, handler, options);\n unsubscribe = () => source.removeEventListener(eventName, handler, options);\n } else if (isJQueryStyleEventEmitter(sourceObj)) {\n const source = sourceObj;\n sourceObj.on(eventName, handler);\n unsubscribe = () => source.off(eventName, handler);\n } else if (isNodeStyleEventEmitter(sourceObj)) {\n const source = sourceObj;\n sourceObj.addListener(eventName, handler as NodeEventHandler);\n unsubscribe = () => source.removeListener(eventName, handler as NodeEventHandler);\n } else if (sourceObj && (sourceObj as any).length) {\n for (let i = 0, len = (sourceObj as any).length; i < len; i++) {\n setupSubscription(sourceObj[i], eventName, handler, subscriber, options);\n }\n } else {\n throw new TypeError('Invalid event target');\n }\n\n subscriber.add(unsubscribe);\n}\n\nfunction isNodeStyleEventEmitter(sourceObj: any): sourceObj is NodeStyleEventEmitter {\n return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';\n}\n\nfunction isJQueryStyleEventEmitter(sourceObj: any): sourceObj is JQueryStyleEventEmitter {\n return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';\n}\n\nfunction isEventTarget(sourceObj: any): sourceObj is HasEventTargetAddRemove<any> {\n return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';\n}\n","import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action<T> extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action<T>\n */\nexport class Action<T> extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction<T>, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n","import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AsyncAction<T> extends Action<T> {\n\n public id: any;\n public state: T;\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, id?: any, delay: number = 0): any {\n return setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(scheduler: AsyncScheduler, id: any, delay: number = 0): any {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n clearInterval(id);\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, delay: number): any {\n let errored: boolean = false;\n let errorValue: any = 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\n /** @deprecated This is an internal implementation detail, do not use. */\n _unsubscribe() {\n\n const id = this.id;\n const scheduler = this.scheduler;\n const actions = scheduler.actions;\n const index = actions.indexOf(this);\n\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n\n if (index !== -1) {\n actions.splice(index, 1);\n }\n\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null;\n }\n}\n","import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}\n */\nexport class Scheduler implements SchedulerLike {\n\n /**\n * Note: the extra arrow function wrapper is to make testing by overriding\n * Date.now easier.\n * @nocollapse\n */\n public static now: () => number = () => Date.now();\n\n constructor(private SchedulerAction: typeof Action,\n now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.SchedulerAction<T>(this, work).schedule(state, delay);\n }\n}\n","import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\n\nexport class AsyncScheduler extends Scheduler {\n public static delegate?: Scheduler;\n public actions: Array<AsyncAction<any>> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @deprecated internal use only\n */\n public active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @deprecated internal use only\n */\n public scheduled: any = undefined;\n\n constructor(SchedulerAction: typeof Action,\n now: () => number = Scheduler.now) {\n super(SchedulerAction, () => {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.now();\n } else {\n return now();\n }\n });\n }\n\n public schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {\n if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {\n return AsyncScheduler.delegate.schedule(work, delay, state);\n } else {\n return super.schedule(work, delay, state);\n }\n }\n\n public flush(action: AsyncAction<any>): void {\n\n const {actions} = this;\n\n if (this.active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this.active = true;\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift()); // exhaust the scheduler queue\n\n this.active = false;\n\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * <span class=\"informal\">Perform task when `window.requestAnimationFrame` would fire</span>\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```ts\n * // html: <div style=\"background: #0ff;\"></div>\n * import { animationFrameScheduler } from 'rxjs';\n *\n * const div = document.querySelector('div');\n *\n * animationFrameScheduler.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see a div element growing in height\n * ```\n */\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\n\n/**\n * @deprecated renamed. Use {@link animationFrameScheduler}\n */\nexport const animationFrame = animationFrameScheduler;\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction<any>): void {\n\n this.active = true;\n this.scheduled = undefined;\n\n const {actions} = this;\n let error: any;\n let index: number = -1;\n let count: number = actions.length;\n action = action || actions.shift();\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n\n this.active = false;\n\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AnimationFrameAction<T> extends AsyncAction<T> {\n\n constructor(protected scheduler: AnimationFrameScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: any, delay: number = 0): any {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(\n () => scheduler.flush(null)));\n }\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue is empty, cancel the requested animation frame and\n // set the scheduled flag to undefined so the next AnimationFrameAction will\n // request its own.\n if (scheduler.actions.length === 0) {\n cancelAnimationFrame(id);\n scheduler.scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n","let nextHandle = 1;\nconst RESOLVED = (() => Promise.resolve())();\nconst activeHandles: { [key: number]: any } = {};\n\n/**\n * Finds the handle in the list of active handles, and removes it.\n * Returns `true` if found, `false` otherwise. Used both to clear\n * Immediate scheduled tasks, and to identify if a task should be scheduled.\n */\nfunction findAndClearHandle(handle: number): boolean {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\n\n/**\n * Helper functions to schedule and unschedule microtasks.\n */\nexport const Immediate = {\n setImmediate(cb: () => void): number {\n const handle = nextHandle++;\n activeHandles[handle] = true;\n RESOLVED.then(() => findAndClearHandle(handle) && cb());\n return handle;\n },\n\n clearImmediate(handle: number): void {\n findAndClearHandle(handle);\n },\n};\n\n/**\n * Used for internal testing purposes only. Do not export from library.\n */\nexport const TestTools = {\n pending() {\n return Object.keys(activeHandles).length;\n }\n};\n","import { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\n\n/**\n *\n * Asap Scheduler\n *\n * <span class=\"informal\">Perform task as fast as it can be performed asynchronously</span>\n *\n * `asap` scheduler behaves the same as {@link asyncScheduler} scheduler when you use it to delay task\n * in time. If however you set delay to `0`, `asap` will wait for current synchronously executing\n * code to end and then it will try to execute given task as fast as possible.\n *\n * `asap` scheduler will do its best to minimize time between end of currently executing code\n * and start of scheduled task. This makes it best candidate for performing so called \"deferring\".\n * Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves\n * some (although minimal) unwanted delay.\n *\n * Note that using `asap` scheduler does not necessarily mean that your task will be first to process\n * after currently executing code. In particular, if some task was also scheduled with `asap` before,\n * that task will execute first. That being said, if you need to schedule task asynchronously, but\n * as soon as possible, `asap` scheduler is your best bet.\n *\n * ## Example\n * Compare async and asap scheduler<\n * ```ts\n * import { asapScheduler, asyncScheduler } from 'rxjs';\n *\n * asyncScheduler.schedule(() => console.log('async')); // scheduling 'async' first...\n * asapScheduler.schedule(() => console.log('asap'));\n *\n * // Logs:\n * // \"asap\"\n * // \"async\"\n * // ... but 'asap' goes first!\n * ```\n */\nexport const asapScheduler = new AsapScheduler(AsapAction);\n\n/**\n * @deprecated renamed. Use {@link asapScheduler}\n */\nexport const asap = asapScheduler;\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AsapScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction<any>): void {\n\n this.active = true;\n this.scheduled = undefined;\n\n const {actions} = this;\n let error: any;\n let index: number = -1;\n let count: number = actions.length;\n action = action || actions.shift();\n\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (++index < count && (action = actions.shift()));\n\n this.active = false;\n\n if (error) {\n while (++index < count && (action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { Immediate } from '../util/Immediate';\nimport { AsyncAction } from './AsyncAction';\nimport { AsapScheduler } from './AsapScheduler';\nimport { SchedulerAction } from '../types';\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class AsapAction<T> extends AsyncAction<T> {\n\n constructor(protected scheduler: AsapScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AsapScheduler, id?: any, delay: number = 0): any {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If a microtask has already been scheduled, don't schedule another\n // one. If a microtask hasn't been scheduled yet, schedule one now. Return\n // the current scheduled microtask id.\n return scheduler.scheduled || (scheduler.scheduled = Immediate.setImmediate(\n scheduler.flush.bind(scheduler, null)\n ));\n }\n protected recycleAsyncId(scheduler: AsapScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue is empty, cancel the requested microtask and\n // set the scheduled flag to undefined so the next AsapAction will schedule\n // its own.\n if (scheduler.actions.length === 0) {\n Immediate.clearImmediate(id);\n scheduler.scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput } from '../types';\n\n/**\n * Tests to see if the object is an RxJS {@link Observable}\n * @param obj the object to test\n */\nexport function isObservable<T>(obj: any): obj is Observable<T> {\n return !!obj && (obj instanceof Observable || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function distinctUntilChanged<T>(compare?: (x: T, y: T) => boolean): MonoTypeOperatorFunction<T>;\nexport function distinctUntilChanged<T, K>(compare: (x: K, y: K) => boolean, keySelector: (x: T) => K): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item.\n *\n * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted.\n *\n * If a comparator function is not provided, an equality check is used by default.\n *\n * ## Example\n * A simple example with numbers\n * ```ts\n * import { of } from 'rxjs';\n * import { distinctUntilChanged } from 'rxjs/operators';\n *\n * of(1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 4).pipe(\n * distinctUntilChanged(),\n * )\n * .subscribe(x => console.log(x)); // 1, 2, 1, 2, 3, 4\n * ```\n *\n * An example using a compare function\n * ```typescript\n * import { of } from 'rxjs';\n * import { distinctUntilChanged } from 'rxjs/operators';\n *\n * interface Person {\n * age: number,\n * name: string\n * }\n *\n * of<Person>(\n * { age: 4, name: 'Foo'},\n * { age: 7, name: 'Bar'},\n * { age: 5, name: 'Foo'},\n * { age: 6, name: 'Foo'},\n * ).pipe(\n * distinctUntilChanged((p: Person, q: Person) => p.name === q.name),\n * )\n * .subscribe(x => console.log(x));\n *\n * // displays:\n * // { age: 4, name: 'Foo' }\n * // { age: 7, name: 'Bar' }\n * // { age: 5, name: 'Foo' }\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilKeyChanged}\n *\n * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.\n * @return {Observable} An Observable that emits items from the source Observable with distinct values.\n * @method distinctUntilChanged\n * @owner Observable\n */\nexport function distinctUntilChanged<T, K>(compare?: (x: K, y: K) => boolean, keySelector?: (x: T) => K): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new DistinctUntilChangedOperator<T, K>(compare, keySelector));\n}\n\nclass DistinctUntilChangedOperator<T, K> implements Operator<T, T> {\n constructor(private compare: (x: K, y: K) => boolean,\n private keySelector: (x: T) => K) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DistinctUntilChangedSubscriber<T, K> extends Subscriber<T> {\n private key: K;\n private hasKey: boolean = false;\n\n constructor(destination: Subscriber<T>,\n compare: (x: K, y: K) => boolean,\n private keySelector: (x: T) => K) {\n super(destination);\n if (typeof compare === 'function') {\n this.compare = compare;\n }\n }\n\n private compare(x: any, y: any): boolean {\n return x === y;\n }\n\n protected _next(value: T): void {\n let key: any;\n try {\n const { keySelector } = this;\n key = keySelector ? keySelector(value) : value;\n } catch (err) {\n return this.destination.error(err);\n }\n let result = false;\n if (this.hasKey) {\n try {\n const { compare } = this;\n result = compare(this.key, key);\n } catch (err) {\n return this.destination.error(err);\n }\n } else {\n this.hasKey = true;\n }\n if (!result) {\n this.key = key;\n this.destination.next(value);\n }\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * <span class=\"informal\">Schedule task as if you used setTimeout(task, duration)</span>\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated renamed. Use {@link asyncScheduler}\n */\nexport const async = asyncScheduler;","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SubscribableOrPromise, TeardownLogic } from '../types';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\n\n/**\n * Ignores source values for a duration determined by another Observable, then\n * emits the most recent value from the source Observable, then repeats this\n * process.\n *\n * <span class=\"informal\">It's like {@link auditTime}, but the silencing\n * duration is determined by a second Observable.</span>\n *\n * \n *\n * `audit` is similar to `throttle`, but emits the last value from the silenced\n * time window, instead of the first value. `audit` emits the most recent value\n * from the source Observable on the output Observable as soon as its internal\n * timer becomes disabled, and ignores source values while the timer is enabled.\n * Initially, the timer is disabled. As soon as the first source value arrives,\n * the timer is enabled by calling the `durationSelector` function with the\n * source value, which returns the \"duration\" Observable. When the duration\n * Observable emits a value or completes, the timer is disabled, then the most\n * recent source value is emitted on the output Observable, and this process\n * repeats for the next source value.\n *\n * ## Example\n *\n * Emit clicks at a rate of at most one click per second\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { audit } from 'rxjs/operators'\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(audit(ev => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttle}\n *\n * @param {function(value: T): SubscribableOrPromise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration, returned as an Observable or a Promise.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method audit\n * @owner Observable\n */\nexport function audit<T>(durationSelector: (value: T) => SubscribableOrPromise<any>): MonoTypeOperatorFunction<T> {\n return function auditOperatorFunction(source: Observable<T>) {\n return source.lift(new AuditOperator(durationSelector));\n };\n}\n\nclass AuditOperator<T> implements Operator<T, T> {\n constructor(private durationSelector: (value: T) => SubscribableOrPromise<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new AuditSubscriber<T, T>(subscriber, this.durationSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass AuditSubscriber<T, R> extends SimpleOuterSubscriber<T, R> {\n\n private value?: T;\n private hasValue: boolean = false;\n private throttled?: Subscription;\n\n constructor(destination: Subscriber<T>,\n private durationSelector: (value: T) => SubscribableOrPromise<any>) {\n super(destination);\n }\n\n protected _next(value: T): void {\n this.value = value;\n this.hasValue = true;\n if (!this.throttled) {\n let duration;\n try {\n const { durationSelector } = this;\n duration = durationSelector(value);\n } catch (err) {\n return this.destination.error!(err);\n }\n const innerSubscription = innerSubscribe(duration, new SimpleInnerSubscriber(this));\n if (!innerSubscription || innerSubscription.closed) {\n this.clearThrottle();\n } else {\n this.add(this.throttled = innerSubscription);\n }\n }\n }\n\n clearThrottle() {\n const { value, hasValue, throttled } = this;\n if (throttled) {\n this.remove(throttled);\n this.throttled = undefined;\n throttled.unsubscribe();\n }\n if (hasValue) {\n this.value = undefined;\n this.hasValue = false;\n this.destination.next!(value);\n }\n }\n\n notifyNext(): void {\n this.clearThrottle();\n }\n\n notifyComplete(): void {\n this.clearThrottle();\n }\n}\n","import { isArray } from './isArray';\n\nexport function isNumeric(val: any): val is number | string {\n // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n // subtraction forces infinities to NaN\n // adding 1 corrects loss of precision from parseFloat (#15100)\n return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n}\n","import { Observable } from '../Observable';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { async } from '../scheduler/async';\nimport { isNumeric } from '../util/isNumeric';\nimport { isScheduler } from '../util/isScheduler';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that starts emitting after an `dueTime` and\n * emits ever increasing numbers after each `period` of time thereafter.\n *\n * <span class=\"informal\">Its like {@link index/interval}, but you can specify when\n * should the emissions start.</span>\n *\n * \n *\n * `timer` returns an Observable that emits an infinite sequence of ascending\n * integers, with a constant interval of time, `period` of your choosing\n * between those emissions. The first emission happens after the specified\n * `dueTime`. The initial delay may be a `Date`. By default, this\n * operator uses the {@link asyncScheduler} {@link SchedulerLike} to provide a notion of time, but you\n * may pass any {@link SchedulerLike} to it. If `period` is not specified, the output\n * Observable emits only one value, `0`. Otherwise, it emits an infinite\n * sequence.\n *\n * ## Examples\n * ### Emits ascending numbers, one every second (1000ms), starting after 3 seconds\n * ```ts\n * import { timer } from 'rxjs';\n *\n * const numbers = timer(3000, 1000);\n * numbers.subscribe(x => console.log(x));\n * ```\n *\n * ### Emits one number after five seconds\n * ```ts\n * import { timer } from 'rxjs';\n *\n * const numbers = timer(5000);\n * numbers.subscribe(x => console.log(x));\n * ```\n * @see {@link index/interval}\n * @see {@link delay}\n *\n * @param {number|Date} [dueTime] The initial delay time specified as a Date object or as an integer denoting\n * milliseconds to wait before emitting the first value of 0`.\n * @param {number|SchedulerLike} [periodOrScheduler] The period of time between emissions of the\n * subsequent numbers.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling\n * the emission of values, and providing a notion of \"time\".\n * @return {Observable} An Observable that emits a `0` after the\n * `dueTime` and ever increasing numbers after each `period` of time\n * thereafter.\n * @static true\n * @name timer\n * @owner Observable\n */\nexport function timer(dueTime: number | Date = 0,\n periodOrScheduler?: number | SchedulerLike,\n scheduler?: SchedulerLike): Observable<number> {\n let period = -1;\n if (isNumeric(periodOrScheduler)) {\n period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);\n } else if (isScheduler(periodOrScheduler)) {\n scheduler = periodOrScheduler as any;\n }\n\n if (!isScheduler(scheduler)) {\n scheduler = async;\n }\n\n return new Observable(subscriber => {\n const due = isNumeric(dueTime)\n ? (dueTime as number)\n : (+dueTime - scheduler.now());\n\n return scheduler.schedule(dispatch, due, {\n index: 0, period, subscriber\n });\n });\n}\n\ninterface TimerState {\n index: number;\n period: number;\n subscriber: Subscriber<number>;\n}\n\nfunction dispatch(this: SchedulerAction<TimerState>, state: TimerState) {\n const { index, period, subscriber } = state;\n subscriber.next(index);\n\n if (subscriber.closed) {\n return;\n } else if (period === -1) {\n return subscriber.complete();\n }\n\n state.index = index + 1;\n this.schedule(state, period);\n}\n","import { async } from '../scheduler/async';\nimport { audit } from './audit';\nimport { timer } from '../observable/timer';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\n\n/**\n * Ignores source values for `duration` milliseconds, then emits the most recent\n * value from the source Observable, then repeats this process.\n *\n * <span class=\"informal\">When it sees a source value, it ignores that plus\n * the next ones for `duration` milliseconds, and then it emits the most recent\n * value from the source.</span>\n *\n * \n *\n * `auditTime` is similar to `throttleTime`, but emits the last value from the\n * silenced time window, instead of the first value. `auditTime` emits the most\n * recent value from the source Observable on the output Observable as soon as\n * its internal timer becomes disabled, and ignores source values while the\n * timer is enabled. Initially, the timer is disabled. As soon as the first\n * source value arrives, the timer is enabled. After `duration` milliseconds (or\n * the time unit determined internally by the optional `scheduler`) has passed,\n * the timer is disabled, then the most recent source value is emitted on the\n * output Observable, and this process repeats for the next source value.\n * Optionally takes a {@link SchedulerLike} for managing timers.\n *\n * ## Example\n *\n * Emit clicks at a rate of at most one click per second\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { auditTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(auditTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link debounceTime}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} duration Time to wait before emitting the most recent source\n * value, measured in milliseconds or the time unit determined internally\n * by the optional `scheduler`.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the rate-limiting behavior.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method auditTime\n * @owner Observable\n */\nexport function auditTime<T>(duration: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n return audit(() => timer(duration, scheduler));\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function filter<T, S extends T>(predicate: (value: T, index: number) => value is S,\n thisArg?: any): OperatorFunction<T, S>;\nexport function filter<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * \n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * ## Example\n * Emit only click events whose target was a DIV element\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { filter } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const clicksOnDivs = clicks.pipe(filter(ev => ev.target.tagName === 'DIV'));\n * clicksOnDivs.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nexport function filter<T>(predicate: (value: T, index: number) => boolean,\n thisArg?: any): MonoTypeOperatorFunction<T> {\n return function filterOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\n\nclass FilterOperator<T> implements Operator<T, T> {\n constructor(private predicate: (value: T, index: number) => boolean,\n private thisArg?: any) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FilterSubscriber<T> extends Subscriber<T> {\n\n count: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number) => boolean,\n private thisArg: any) {\n super(destination);\n }\n\n // the try catch block below is left specifically for\n // optimization and perf reasons. a tryCatcher is not necessary here.\n protected _next(value: T) {\n let result: any;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\n\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\nimport { innerSubscribe, SimpleInnerSubscriber, SimpleOuterSubscriber } from '../innerSubscribe';\n\n/**\n * Emits the values emitted by the source Observable until a `notifier`\n * Observable emits a value.\n *\n * <span class=\"informal\">Lets values pass until a second Observable,\n * `notifier`, emits a value. Then, it completes.</span>\n *\n * \n *\n * `takeUntil` subscribes and begins mirroring the source Observable. It also\n * monitors a second Observable, `notifier` that you provide. If the `notifier`\n * emits a value, the output Observable stops mirroring the source Observable\n * and completes. If the `notifier` doesn't emit any value and completes\n * then `takeUntil` will pass all values.\n *\n * ## Example\n * Tick every second until the first click happens\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { takeUntil } from 'rxjs/operators';\n *\n * const source = interval(1000);\n * const clicks = fromEvent(document, 'click');\n * const result = source.pipe(takeUntil(clicks));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link take}\n * @see {@link takeLast}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @param {Observable} notifier The Observable whose first emitted value will\n * cause the output Observable of `takeUntil` to stop emitting values from the\n * source Observable.\n * @return {Observable<T>} An Observable that emits the values from the source\n * Observable until such time as `notifier` emits its first value.\n * @method takeUntil\n * @owner Observable\n */\nexport function takeUntil<T>(notifier: Observable<any>): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new TakeUntilOperator(notifier));\n}\n\nclass TakeUntilOperator<T> implements Operator<T, T> {\n constructor(private notifier: Observable<any>) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n const takeUntilSubscriber = new TakeUntilSubscriber(subscriber);\n const notifierSubscription = innerSubscribe(this.notifier, new SimpleInnerSubscriber(takeUntilSubscriber));\n if (notifierSubscription && !takeUntilSubscriber.seenValue) {\n takeUntilSubscriber.add(notifierSubscription);\n return source.subscribe(takeUntilSubscriber);\n }\n return takeUntilSubscriber;\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeUntilSubscriber<T, R> extends SimpleOuterSubscriber<T, R> {\n seenValue = false;\n\n constructor(destination: Subscriber<any>, ) {\n super(destination);\n }\n\n notifyNext(): void {\n this.seenValue = true;\n this.complete();\n }\n\n notifyComplete(): void {\n // noop\n }\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { of } from './of';\nimport { from } from './from';\nimport { concatAll } from '../operators/concatAll';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O1 extends ObservableInput<any>>(v1: O1, scheduler: SchedulerLike): Observable<ObservedValueOf<O1>>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2>>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3>>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4>>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5>>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler: SchedulerLike): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5> | ObservedValueOf<O6>>;\n\nexport function concat<O1 extends ObservableInput<any>>(v1: O1): Observable<ObservedValueOf<O1>>;\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2): Observable<ObservedValueOf<O1> | ObservedValueOf<O2>>;\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3>>;\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4>>;\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5>>;\nexport function concat<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6): Observable<ObservedValueOf<O1> | ObservedValueOf<O2> | ObservedValueOf<O3> | ObservedValueOf<O4> | ObservedValueOf<O5> | ObservedValueOf<O6>>;\nexport function concat<O extends ObservableInput<any>>(...observables: O[]): Observable<ObservedValueOf<O>>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<O extends ObservableInput<any>>(...observables: (O | SchedulerLike)[]): Observable<ObservedValueOf<O>>;\nexport function concat<R>(...observables: ObservableInput<any>[]): Observable<R>;\n/** @deprecated Use {@link scheduled} and {@link concatAll} (e.g. `scheduled([o1, o2, o3], scheduler).pipe(concatAll())`) */\nexport function concat<R>(...observables: (ObservableInput<any> | SchedulerLike)[]): Observable<R>;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which sequentially emits all values from given\n * Observable and then moves on to the next.\n *\n * <span class=\"informal\">Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.</span>\n *\n * \n *\n * `concat` joins multiple Observables together, by subscribing to them one at a time and\n * merging their results into the output Observable. You can pass either an array of\n * Observables, or put them directly as arguments. Passing an empty array will result\n * in Observable that completes immediately.\n *\n * `concat` will subscribe to first input Observable and emit all its values, without\n * changing or affecting them in any way. When that Observable completes, it will\n * subscribe to then next Observable passed and, again, emit its values. This will be\n * repeated, until the operator runs out of Observables. When last input Observable completes,\n * `concat` will complete as well. At any given moment only one Observable passed to operator\n * emits values. If you would like to emit values from passed Observables concurrently, check out\n * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,\n * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.\n *\n * Note that if some input Observable never completes, `concat` will also never complete\n * and Observables following the one that did not complete will never be subscribed. On the other\n * hand, if some Observable simply completes immediately after it is subscribed, it will be\n * invisible for `concat`, which will just move on to the next Observable.\n *\n * If any Observable in chain errors, instead of passing control to the next Observable,\n * `concat` will error immediately as well. Observables that would be subscribed after\n * the one that emitted error, never will.\n *\n * If you pass to `concat` the same Observable many times, its stream of values\n * will be \"replayed\" on every subscription, which means you can repeat given Observable\n * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,\n * you can always use {@link repeat}.\n *\n * ## Examples\n * ### Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10\n * ```ts\n * import { concat, interval, range } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer = interval(1000).pipe(take(4));\n * const sequence = range(1, 10);\n * const result = concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * // results in:\n * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10\n * ```\n *\n * ### Concatenate 3 Observables\n * ```ts\n * import { concat, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer1 = interval(1000).pipe(take(10));\n * const timer2 = interval(2000).pipe(take(6));\n * const timer3 = interval(500).pipe(take(10));\n *\n * const result = concat(timer1, timer2, timer3);\n * result.subscribe(x => console.log(x));\n *\n * // results in the following:\n * // (Prints to console sequentially)\n * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9\n * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5\n * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9\n * ```\n *\n * ### Concatenate the same Observable to repeat it\n * ```ts\n * import { concat, interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const timer = interval(1000).pipe(take(2));\n *\n * concat(timer, timer) // concatenating the same Observable!\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('...and it is done!')\n * );\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 0 after 3s\n * // 1 after 4s\n * // \"...and it is done!\" also after 4s\n * ```\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link startWith}\n * @see {@link endWith}\n *\n * @param {ObservableInput} input1 An input Observable to concatenate with others.\n * @param {ObservableInput} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {SchedulerLike} [scheduler=null] An optional {@link SchedulerLike} to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n */\nexport function concat<O extends ObservableInput<any>, R>(...observables: Array<O | SchedulerLike>): Observable<ObservedValueOf<O> | R> {\n return concatAll<R>()(of(...observables));\n}\n","\nimport { mergeAll } from './mergeAll';\nimport { OperatorFunction, ObservableInput } from '../types';\n\nexport function concatAll<T>(): OperatorFunction<ObservableInput<T>, T>;\nexport function concatAll<R>(): OperatorFunction<any, R>;\n\n/**\n * Converts a higher-order Observable into a first-order Observable by\n * concatenating the inner Observables in order.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables by putting one\n * inner Observable after the other.</span>\n *\n * \n *\n * Joins every Observable emitted by the source (a higher-order Observable), in\n * a serial fashion. It subscribes to each inner Observable only after the\n * previous inner Observable has completed, and merges all of their values into\n * the returned observable.\n *\n * __Warning:__ If the source Observable emits Observables quickly and\n * endlessly, and the inner Observables it emits generally complete slower than\n * the source emits, you can run into memory issues as the incoming Observables\n * collect in an unbounded buffer.\n *\n * Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set\n * to `1`.\n *\n * ## Example\n *\n * For each click event, tick every second from 0 to 3, with no concurrency\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { map, take, concatAll } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const higherOrder = clicks.pipe(\n * map(ev => interval(1000).pipe(take(4))),\n * );\n * const firstOrder = higherOrder.pipe(concatAll());\n * firstOrder.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link combineAll}\n * @see {@link concat}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link exhaust}\n * @see {@link mergeAll}\n * @see {@link switchAll}\n * @see {@link switchMap}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable emitting values from all the inner\n * Observables concatenated.\n * @method concatAll\n * @owner Observable\n */\nexport function concatAll<T>(): OperatorFunction<ObservableInput<T>, T> {\n return mergeAll<T>(1);\n}\n","import { Observable } from '../Observable';\nimport { concat } from '../observable/concat';\nimport { isScheduler } from '../util/isScheduler';\nimport { MonoTypeOperatorFunction, OperatorFunction, SchedulerLike } from '../types';\n\n/* tslint:disable:max-line-length */\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T>(scheduler: SchedulerLike): MonoTypeOperatorFunction<T>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D>(v1: D, scheduler: SchedulerLike): OperatorFunction<T, T | D>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D, E>(v1: D, v2: E, scheduler: SchedulerLike): OperatorFunction<T, T | D | E>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D, E, F>(v1: D, v2: E, v3: F, scheduler: SchedulerLike): OperatorFunction<T, T | D | E | F>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D, E, F, G>(v1: D, v2: E, v3: F, v4: G, scheduler: SchedulerLike): OperatorFunction<T, T | D | E | F | G>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D, E, F, G, H>(v1: D, v2: E, v3: F, v4: G, v5: H, scheduler: SchedulerLike): OperatorFunction<T, T | D | E | F | G | H>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D, E, F, G, H, I>(v1: D, v2: E, v3: F, v4: G, v5: H, v6: I, scheduler: SchedulerLike): OperatorFunction<T, T | D | E | F | G | H | I>;\n\nexport function startWith<T, D>(v1: D): OperatorFunction<T, T | D>;\nexport function startWith<T, D, E>(v1: D, v2: E): OperatorFunction<T, T | D | E>;\nexport function startWith<T, D, E, F>(v1: D, v2: E, v3: F): OperatorFunction<T, T | D | E | F>;\nexport function startWith<T, D, E, F, G>(v1: D, v2: E, v3: F, v4: G): OperatorFunction<T, T | D | E | F | G>;\nexport function startWith<T, D, E, F, G, H>(v1: D, v2: E, v3: F, v4: G, v5: H): OperatorFunction<T, T | D | E | F | G | H>;\nexport function startWith<T, D, E, F, G, H, I>(v1: D, v2: E, v3: F, v4: G, v5: H, v6: I): OperatorFunction<T, T | D | E | F | G | H | I>;\nexport function startWith<T, D = T>(...array: D[]): OperatorFunction<T, T | D>;\n/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([[a, b, c], source], scheduler).pipe(concatAll())`) */\nexport function startWith<T, D = T>(...array: Array<D | SchedulerLike>): OperatorFunction<T, T | D>;\n/* tslint:enable:max-line-length */\n\n/**\n * Returns an Observable that emits the items you specify as arguments before it begins to emit\n * items emitted by the source Observable.\n *\n * <span class=\"informal\">First emits its arguments in order, and then any\n * emissions from the source.</span>\n *\n * \n *\n * ## Examples\n *\n * Start the chain of emissions with `\"first\"`, `\"second\"`\n *\n * ```ts\n * import { of } from 'rxjs';\n * import { startWith } from 'rxjs/operators';\n *\n * of(\"from source\")\n * .pipe(startWith(\"first\", \"second\"))\n * .subscribe(x => console.log(x));\n *\n * // results:\n * // \"first\"\n * // \"second\"\n * // \"from source\"\n * ```\n *\n * @param {...T} values - Items you want the modified Observable to emit first.\n * @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits the items in the specified Iterable and then emits the items\n * emitted by the source Observable.\n * @method startWith\n * @owner Observable\n */\nexport function startWith<T, D>(...array: Array<T | SchedulerLike>): OperatorFunction<T, T | D> {\n const scheduler = array[array.length - 1] as SchedulerLike;\n if (isScheduler(scheduler)) {\n // deprecated path\n array.pop();\n return (source: Observable<T>) => concat(array as T[], source, scheduler);\n } else {\n return (source: Observable<T>) => concat(array as T[], source);\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { map } from './map';\nimport { from } from '../observable/from';\nimport { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';\n\n/* tslint:disable:max-line-length */\nexport function switchMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated resultSelector is no longer supported, use inner map instead */\nexport function switchMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated resultSelector is no longer supported, use inner map instead */\nexport function switchMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables.</span>\n *\n * \n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * ## Example\n * Generate new Observable according to source Observable values\n * ```typescript\n * import { of } from 'rxjs';\n * import { switchMap } from 'rxjs/operators';\n *\n * const switched = of(1, 2, 3).pipe(switchMap((x: number) => of(x, x ** 2, x ** 3)));\n * switched.subscribe(x => console.log(x));\n * // outputs\n * // 1\n * // 1\n * // 1\n * // 2\n * // 4\n * // 8\n * // ... and so on\n * ```\n *\n * Rerun an interval Observable on every click event\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { switchMap } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(switchMap((ev) => interval(1000)));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchAll}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item\n * emitted by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nexport function switchMap<T, R, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n resultSelector?: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R,\n): OperatorFunction<T, ObservedValueOf<O>|R> {\n if (typeof resultSelector === 'function') {\n return (source: Observable<T>) => source.pipe(\n switchMap((a, i) => from(project(a, i)).pipe(\n map((b, ii) => resultSelector(a, b, i, ii))\n ))\n );\n }\n return (source: Observable<T>) => source.lift(new SwitchMapOperator(project));\n}\n\nclass SwitchMapOperator<T, R> implements Operator<T, R> {\n constructor(private project: (value: T, index: number) => ObservableInput<R>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SwitchMapSubscriber<T, R> extends SimpleOuterSubscriber<T, R> {\n private index = 0;\n private innerSubscription?: Subscription;\n\n constructor(destination: Subscriber<R>,\n private project: (value: T, index: number) => ObservableInput<R>) {\n super(destination);\n }\n\n protected _next(value: T) {\n let result: ObservableInput<R>;\n const index = this.index++;\n try {\n result = this.project(value, index);\n } catch (error) {\n this.destination.error!(error);\n return;\n }\n this._innerSub(result);\n }\n\n private _innerSub(result: ObservableInput<R>) {\n const innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n const innerSubscriber = new SimpleInnerSubscriber(this);\n const destination = this.destination as Subscription;\n destination.add(innerSubscriber);\n this.innerSubscription = innerSubscribe(result, innerSubscriber);\n // The returned subscription will usually be the subscriber that was\n // passed. However, interop subscribers will be wrapped and for\n // unsubscriptions to chain correctly, the wrapper needs to be added, too.\n if (this.innerSubscription !== innerSubscriber) {\n destination.add(this.innerSubscription);\n }\n }\n\n protected _complete(): void {\n const {innerSubscription} = this;\n if (!innerSubscription || innerSubscription.closed) {\n super._complete();\n }\n this.unsubscribe();\n }\n\n protected _unsubscribe() {\n this.innerSubscription = undefined;\n }\n\n notifyComplete(): void {\n this.innerSubscription = undefined;\n if (this.isStopped) {\n super._complete();\n }\n }\n\n notifyNext(innerValue: R): void {\n this.destination.next!(innerValue);\n }\n}\n","import { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\n\n/**\n *\n * Queue Scheduler\n *\n * <span class=\"informal\">Put every next task on a queue, instead of executing it immediately</span>\n *\n * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.\n *\n * When used without delay, it schedules given task synchronously - executes it right when\n * it is scheduled. However when called recursively, that is when inside the scheduled task,\n * another task is scheduled with queue scheduler, instead of executing immediately as well,\n * that task will be put on a queue and wait for current one to finish.\n *\n * This means that when you execute task with `queue` scheduler, you are sure it will end\n * before any other task scheduled with that scheduler will start.\n *\n * ## Examples\n * Schedule recursively first, then do something\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(() => {\n * queueScheduler.schedule(() => console.log('second')); // will not happen now, but will be put on a queue\n *\n * console.log('first');\n * });\n *\n * // Logs:\n * // \"first\"\n * // \"second\"\n * ```\n *\n * Reschedule itself recursively\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(function(state) {\n * if (state !== 0) {\n * console.log('before', state);\n * this.schedule(state - 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * console.log('after', state);\n * }\n * }, 0, 3);\n *\n * // In scheduler that runs recursively, you would expect:\n * // \"before\", 3\n * // \"before\", 2\n * // \"before\", 1\n * // \"after\", 1\n * // \"after\", 2\n * // \"after\", 3\n *\n * // But with queue it logs:\n * // \"before\", 3\n * // \"after\", 3\n * // \"before\", 2\n * // \"after\", 2\n * // \"before\", 1\n * // \"after\", 1\n * ```\n */\nexport const queueScheduler = new QueueScheduler(QueueAction);\n\n/**\n * @deprecated renamed. Use {@link queueScheduler}\n */\nexport const queue = queueScheduler;\n","import { AsyncScheduler } from './AsyncScheduler';\n\nexport class QueueScheduler extends AsyncScheduler {\n}\n","import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { QueueScheduler } from './QueueScheduler';\nimport { SchedulerAction } from '../types';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class QueueAction<T> extends AsyncAction<T> {\n\n constructor(protected scheduler: QueueScheduler,\n protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (delay > 0) {\n return super.schedule(state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n }\n\n public execute(state: T, delay: number): any {\n return (delay > 0 || this.closed) ?\n super.execute(state, delay) :\n this._execute(state, delay) ;\n }\n\n protected requestAsyncId(scheduler: QueueScheduler, id?: any, delay: number = 0): any {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Otherwise flush the scheduler starting with this action.\n return scheduler.flush(this);\n }\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * The same Observable instance returned by any call to {@link empty} without a\n * `scheduler`. It is preferrable to use this over `empty()`.\n */\nexport const EMPTY = new Observable<never>(subscriber => subscriber.complete());\n\n/**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * <span class=\"informal\">Just emits 'complete', and nothing else.\n * </span>\n *\n * \n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n * ### Emit the number 7, then complete\n * ```ts\n * import { empty } from 'rxjs';\n * import { startWith } from 'rxjs/operators';\n *\n * const result = empty().pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * ### Map and flatten only odd numbers to the sequence 'a', 'b', 'c'\n * ```ts\n * import { empty, interval, of } from 'rxjs';\n * import { mergeMap } from 'rxjs/operators';\n *\n * const interval$ = interval(1000);\n * const result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : empty()),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throwError}\n *\n * @param scheduler A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @return An \"empty\" Observable: emits only the complete\n * notification.\n * @deprecated Deprecated in favor of using {@link EMPTY} constant, or {@link scheduled} (e.g. `scheduled([], scheduler)`)\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nfunction emptyScheduled(scheduler: SchedulerLike) {\n return new Observable<never>(subscriber => scheduler.schedule(() => subscriber.complete()));\n}\n","import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits an error notification.\n *\n * <span class=\"informal\">Just emits 'error', and nothing else.\n * </span>\n *\n * \n *\n * This static operator is useful for creating a simple Observable that only\n * emits the error notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n * ### Emit the number 7, then emit an error\n * ```ts\n * import { throwError, concat, of } from 'rxjs';\n *\n * const result = concat(of(7), throwError(new Error('oops!')));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * // Logs:\n * // 7\n * // Error: oops!\n * ```\n *\n * ---\n *\n * ### Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 2\n * ```ts\n * import { throwError, interval, of } from 'rxjs';\n * import { mergeMap } from 'rxjs/operators';\n *\n * interval(1000).pipe(\n * mergeMap(x => x === 2\n * ? throwError('Twos are bad')\n * : of('a', 'b', 'c')\n * ),\n * ).subscribe(x => console.log(x), e => console.error(e));\n *\n * // Logs:\n * // a\n * // b\n * // c\n * // a\n * // b\n * // c\n * // Twos are bad\n * ```\n *\n * @see {@link Observable}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link of}\n *\n * @param {any} error The particular Error to pass to the error notification.\n * @param {SchedulerLike} [scheduler] A {@link SchedulerLike} to use for scheduling\n * the emission of the error notification.\n * @return {Observable} An error Observable: emits only the error notification\n * using the given error argument.\n * @static true\n * @name throwError\n * @owner Observable\n */\nexport function throwError(error: any, scheduler?: SchedulerLike): Observable<never> {\n if (!scheduler) {\n return new Observable(subscriber => subscriber.error(error));\n } else {\n return new Observable(subscriber => scheduler.schedule(dispatch, 0, { error, subscriber }));\n }\n}\n\ninterface DispatchArg {\n error: any;\n subscriber: Subscriber<any>;\n}\n\nfunction dispatch({ error, subscriber }: DispatchArg) {\n subscriber.error(error);\n}\n","import { PartialObserver } from './types';\nimport { Observable } from './Observable';\nimport { empty } from './observable/empty';\nimport { of } from './observable/of';\nimport { throwError } from './observable/throwError';\nimport { deprecate } from 'util';\n\n// TODO: When this enum is removed, replace it with a type alias. See #4556.\n/**\n * @deprecated NotificationKind is deprecated as const enums are not compatible with isolated modules. Use a string literal instead.\n */\nexport enum NotificationKind {\n NEXT = 'N',\n ERROR = 'E',\n COMPLETE = 'C',\n}\n\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification<T>\n */\nexport class Notification<T> {\n hasValue: boolean;\n\n constructor(public kind: 'N' | 'E' | 'C', public value?: T, public error?: any) {\n this.hasValue = kind === 'N';\n }\n\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n observe(observer: PartialObserver<T>): any {\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\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n do(next: (value: T) => void, error?: (err: any) => void, complete?: () => void): any {\n const 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\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n accept(nextOrObserver: PartialObserver<T> | ((value: T) => void), error?: (err: any) => void, complete?: () => void) {\n if (nextOrObserver && typeof (<PartialObserver<T>>nextOrObserver).next === 'function') {\n return this.observe(<PartialObserver<T>>nextOrObserver);\n } else {\n return this.do(<(value: T) => void>nextOrObserver, error, complete);\n }\n }\n\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n toObservable(): Observable<T> {\n const 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();\n }\n throw new Error('unexpected notification kind value');\n }\n\n private static completeNotification: Notification<any> = new Notification('C');\n private static undefinedValueNotification: Notification<any> = new Notification('N', undefined);\n\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification<T>} The \"next\" Notification representing the\n * argument.\n * @nocollapse\n */\n static createNext<T>(value: T): Notification<T> {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n }\n\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification<T>} The \"error\" Notification representing the\n * argument.\n * @nocollapse\n */\n static createError<T>(err?: any): Notification<T> {\n return new Notification('E', undefined, err);\n }\n\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification<any>} The valueless \"complete\" Notification.\n * @nocollapse\n */\n static createComplete(): Notification<any> {\n return Notification.completeNotification;\n }\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Notification } from '../Notification';\nimport { MonoTypeOperatorFunction, PartialObserver, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * <span class=\"informal\">Ensure a specific scheduler is used, from outside of an Observable.</span>\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * ## Example\n * Ensure values in subscribe are called just before browser repaint.\n * ```ts\n * import { interval } from 'rxjs';\n * import { observeOn } from 'rxjs/operators';\n *\n * const intervals = interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n * intervals.pipe(\n * observeOn(animationFrameScheduler), // ...but we will observe on animationFrame\n * ) // scheduler to ensure smooth animation.\n * .subscribe(val => {\n * someDiv.style.height = val + 'px';\n * });\n * ```\n *\n * @see {@link delay}\n *\n * @param {SchedulerLike} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable<T>} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nexport function observeOn<T>(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction<T> {\n return function observeOnOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\n\nexport class ObserveOnOperator<T> implements Operator<T, T> {\n constructor(private scheduler: SchedulerLike, private delay: number = 0) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ObserveOnSubscriber<T> extends Subscriber<T> {\n /** @nocollapse */\n static dispatch(this: SchedulerAction<ObserveOnMessage>, arg: ObserveOnMessage) {\n const { notification, destination } = arg;\n notification.observe(destination);\n this.unsubscribe();\n }\n\n constructor(destination: Subscriber<T>,\n private scheduler: SchedulerLike,\n private delay: number = 0) {\n super(destination);\n }\n\n private scheduleMessage(notification: Notification<any>): void {\n const destination = this.destination as Subscription;\n destination.add(this.scheduler.schedule(\n ObserveOnSubscriber.dispatch,\n this.delay,\n new ObserveOnMessage(notification, this.destination)\n ));\n }\n\n protected _next(value: T): void {\n this.scheduleMessage(Notification.createNext(value));\n }\n\n protected _error(err: any): void {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n }\n}\n\nexport class ObserveOnMessage {\n constructor(public notification: Notification<any>,\n public destination: PartialObserver<any>) {\n }\n}\n","import { Subject } from './Subject';\nimport { SchedulerLike } from './types';\nimport { queue } from './scheduler/queue';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObserveOnSubscriber } from './operators/observeOn';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\n/**\n * A variant of Subject that \"replays\" or emits old values to new subscribers.\n * It buffers a set number of values and will emit those values immediately to\n * any new subscribers in addition to emitting new values to existing subscribers.\n *\n * @class ReplaySubject<T>\n */\nexport class ReplaySubject<T> extends Subject<T> {\n private _events: (ReplayEvent<T> | T)[] = [];\n private _bufferSize: number;\n private _windowTime: number;\n private _infiniteTimeWindow: boolean = false;\n\n constructor(bufferSize: number = Number.POSITIVE_INFINITY,\n windowTime: number = Number.POSITIVE_INFINITY,\n private scheduler?: SchedulerLike) {\n super();\n this._bufferSize = bufferSize < 1 ? 1 : bufferSize;\n this._windowTime = windowTime < 1 ? 1 : windowTime;\n\n if (windowTime === Number.POSITIVE_INFINITY) {\n this._infiniteTimeWindow = true;\n this.next = this.nextInfiniteTimeWindow;\n } else {\n this.next = this.nextTimeWindow;\n }\n }\n\n private nextInfiniteTimeWindow(value: T): void {\n if (!this.isStopped) {\n const _events = this._events;\n _events.push(value);\n // Since this method is invoked in every next() call than the buffer\n // can overgrow the max size only by one item\n if (_events.length > this._bufferSize) {\n _events.shift();\n }\n }\n super.next(value);\n }\n\n private nextTimeWindow(value: T): void {\n if (!this.isStopped) {\n this._events.push(new ReplayEvent(this._getNow(), value));\n this._trimBufferThenGetEvents();\n }\n super.next(value);\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n // When `_infiniteTimeWindow === true` then the buffer is already trimmed\n const _infiniteTimeWindow = this._infiniteTimeWindow;\n const _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();\n const scheduler = this.scheduler;\n const len = _events.length;\n let subscription: Subscription;\n\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\n if (scheduler) {\n subscriber.add(subscriber = new ObserveOnSubscriber<T>(subscriber, scheduler));\n }\n\n if (_infiniteTimeWindow) {\n for (let i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next(<T>_events[i]);\n }\n } else {\n for (let i = 0; i < len && !subscriber.closed; i++) {\n subscriber.next((<ReplayEvent<T>>_events[i]).value);\n }\n }\n\n if (this.hasError) {\n subscriber.error(this.thrownError);\n } else if (this.isStopped) {\n subscriber.complete();\n }\n\n return subscription;\n }\n\n _getNow(): number {\n return (this.scheduler || queue).now();\n }\n\n private _trimBufferThenGetEvents(): ReplayEvent<T>[] {\n const now = this._getNow();\n const _bufferSize = this._bufferSize;\n const _windowTime = this._windowTime;\n const _events = <ReplayEvent<T>[]>this._events;\n\n const eventsCount = _events.length;\n let spliceCount = 0;\n\n // Trim events that fall out of the time window.\n // Start at the front of the list. Break early once\n // we encounter an event that falls within the window.\n while (spliceCount < eventsCount) {\n if ((now - _events[spliceCount].time) < _windowTime) {\n break;\n }\n spliceCount++;\n }\n\n if (eventsCount > _bufferSize) {\n spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);\n }\n\n if (spliceCount > 0) {\n _events.splice(0, spliceCount);\n }\n\n return _events;\n }\n\n}\n\nclass ReplayEvent<T> {\n constructor(public time: number, public value: T) {\n }\n}\n","import { Observable } from '../Observable';\nimport { ReplaySubject } from '../ReplaySubject';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SchedulerLike } from '../types';\nimport { Subscriber } from '../Subscriber';\n\nexport interface ShareReplayConfig {\n bufferSize?: number;\n windowTime?: number;\n refCount: boolean;\n scheduler?: SchedulerLike;\n}\n\n/**\n * Share source and replay specified number of emissions on subscription.\n *\n * This operator is a specialization of `replay` that connects to a source observable\n * and multicasts through a `ReplaySubject` constructed with the specified arguments.\n * A successfully completed source will stay cached in the `shareReplayed observable` forever,\n * but an errored source can be retried.\n *\n * ## Why use shareReplay?\n * You generally want to use `shareReplay` when you have side-effects or taxing computations\n * that you do not wish to be executed amongst multiple subscribers.\n * It may also be valuable in situations where you know you will have late subscribers to\n * a stream that need access to previously emitted values.\n * This ability to replay values on subscription is what differentiates {@link share} and `shareReplay`.\n *\n * \n *\n * ## Example\n * ```ts\n * import { interval } from 'rxjs';\n * import { shareReplay, take } from 'rxjs/operators';\n *\n * const obs$ = interval(1000);\n * const shared$ = obs$.pipe(\n * take(4),\n * shareReplay(3)\n * );\n * shared$.subscribe(x => console.log('source A: ', x));\n * shared$.subscribe(y => console.log('source B: ', y));\n *\n * ```\n *\n * @see {@link publish}\n * @see {@link share}\n * @see {@link publishReplay}\n *\n * @param {Number} [bufferSize=Number.POSITIVE_INFINITY] Maximum element count of the replay buffer.\n * @param {Number} [windowTime=Number.POSITIVE_INFINITY] Maximum time length of the replay buffer in milliseconds.\n * @param {Scheduler} [scheduler] Scheduler where connected observers within the selector function\n * will be invoked on.\n * @return {Observable} An observable sequence that contains the elements of a sequence produced\n * by multicasting the source sequence within a selector function.\n * @method shareReplay\n * @owner Observable\n */\nexport function shareReplay<T>(\n config: ShareReplayConfig\n): MonoTypeOperatorFunction<T>;\nexport function shareReplay<T>(\n bufferSize?: number,\n windowTime?: number,\n scheduler?: SchedulerLike\n): MonoTypeOperatorFunction<T>;\nexport function shareReplay<T>(\n configOrBufferSize?: ShareReplayConfig | number,\n windowTime?: number,\n scheduler?: SchedulerLike\n): MonoTypeOperatorFunction<T> {\n let config: ShareReplayConfig;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n config = configOrBufferSize as ShareReplayConfig;\n } else {\n config = {\n bufferSize: configOrBufferSize as number | undefined,\n windowTime,\n refCount: false,\n scheduler,\n };\n }\n return (source: Observable<T>) => source.lift(shareReplayOperator(config));\n}\n\nfunction shareReplayOperator<T>({\n bufferSize = Number.POSITIVE_INFINITY,\n windowTime = Number.POSITIVE_INFINITY,\n refCount: useRefCount,\n scheduler,\n}: ShareReplayConfig) {\n let subject: ReplaySubject<T> | undefined;\n let refCount = 0;\n let subscription: Subscription | undefined;\n let hasError = false;\n let isComplete = false;\n\n return function shareReplayOperation(\n this: Subscriber<T>,\n source: Observable<T>\n ) {\n refCount++;\n let innerSub: Subscription;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject<T>(bufferSize, windowTime, scheduler);\n innerSub = subject.subscribe(this);\n subscription = source.subscribe({\n next(value) {\n subject.next(value);\n },\n error(err) {\n hasError = true;\n subject.error(err);\n },\n complete() {\n isComplete = true;\n subscription = undefined;\n subject.complete();\n },\n });\n\n // Here we need to check to see if the source synchronously completed. Although\n // we're setting `subscription = undefined` in the completion handler, if the source\n // is synchronous, that will happen *before* subscription is set by the return of\n // the `subscribe` call.\n if (isComplete) {\n subscription = undefined;\n }\n } else {\n innerSub = subject.subscribe(this);\n }\n\n this.add(() => {\n refCount--;\n innerSub.unsubscribe();\n innerSub = undefined;\n if (subscription && !isComplete && useRefCount && refCount === 0) {\n subscription.unsubscribe();\n subscription = undefined;\n subject = undefined;\n }\n });\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator;\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId\n ? isPlatformBrowser(this._platformId)\n : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean =\n this.isBrowser &&\n !!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' &&\n !this.EDGE &&\n !this.TRIDENT;\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean =\n this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) &&\n !this.BLINK &&\n !this.EDGE &&\n !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean =\n this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener(\n 'test',\n null!,\n Object.defineProperty({}, 'passive', {\n get: () => (supportsPassiveEvents = true),\n }),\n );\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(\n options: AddEventListenerOptions,\n): AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED,\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType | undefined;\n\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported: boolean | undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement!.style) {\n scrollBehaviorSupported = true;\n } else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction: Function | undefined = Element.prototype.scrollTo;\n\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n } else {\n scrollBehaviorSupported = false;\n }\n }\n }\n\n return scrollBehaviorSupported;\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.remove();\n }\n return rtlScrollAxisType;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): ShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n\n/**\n * Gets the currently-focused element on the page while\n * also piercing through Shadow DOM boundaries.\n */\nexport function _getFocusedElementPierceShadowDom(): HTMLElement | null {\n let activeElement =\n typeof document !== 'undefined' && document\n ? (document.activeElement as HTMLElement | null)\n : null;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement as HTMLElement | null;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\n}\n\n/** Gets the target of an event while accounting for Shadow DOM. */\nexport function _getEventTarget<T extends EventTarget>(event: Event): T | null {\n // If an event is bound outside the Shadow DOM, the `event.target` will\n // point to the shadow root so we have to use `composedPath` instead.\n return (event.composedPath ? event.composedPath()[0] : event.target) as T | null;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Gets whether the code is currently running in a test environment. */\nexport function _isTestEnvironment(): boolean {\n // We can't use `declare const` because it causes conflicts inside Google with the real typings\n // for these symbols and we can't read them off the global object, because they don't appear to\n // be attached there for some runners like Jest.\n // (see: https://github.com/angular/components/issues/23365#issuecomment-938146643)\n return (\n // @ts-ignore\n (typeof __karma__ !== 'undefined' && !!__karma__) ||\n // @ts-ignore\n (typeof jasmine !== 'undefined' && !!jasmine) ||\n // @ts-ignore\n (typeof jest !== 'undefined' && !!jest) ||\n // @ts-ignore\n (typeof Mocha !== 'undefined' && !!Mocha)\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * @docs-private\n */\nexport const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY,\n});\n\n/** @docs-private */\nexport function DIR_DOCUMENT_FACTORY(): Document {\n return inject(DOCUMENT);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter, Inject, Injectable, Optional, OnDestroy} from '@angular/core';\nimport {DIR_DOCUMENT} from './dir-document-token';\n\nexport type Direction = 'ltr' | 'rtl';\n\n/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */\nconst RTL_LOCALE_PATTERN =\n /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;\n\n/** Resolves a string value to a specific direction. */\nexport function _resolveDirectionality(rawValue: string): Direction {\n const value = rawValue?.toLowerCase() || '';\n\n if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {\n return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';\n }\n\n return value === 'rtl' ? 'rtl' : 'ltr';\n}\n\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\n@Injectable({providedIn: 'root'})\nexport class Directionality implements OnDestroy {\n /** The current 'ltr' or 'rtl' value. */\n readonly value: Direction = 'ltr';\n\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n readonly change = new EventEmitter<Direction>();\n\n constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) {\n if (_document) {\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr');\n }\n }\n\n ngOnDestroy() {\n this.change.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {Dir} from './dir';\n\n@NgModule({\n exports: [Dir],\n declarations: [Dir],\n})\nexport class BidiModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n/** The injection token used to specify the virtual scrolling strategy. */\nexport const VIRTUAL_SCROLL_STRATEGY = new InjectionToken<VirtualScrollStrategy>(\n 'VIRTUAL_SCROLL_STRATEGY',\n);\n\n/** A strategy that dictates which items should be rendered in the viewport. */\nexport interface VirtualScrollStrategy {\n /** Emits when the index of the first element visible in the viewport changes. */\n scrolledIndexChange: Observable<number>;\n\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport: CdkVirtualScrollViewport): void;\n\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach(): void;\n\n /** Called when the viewport is scrolled (debounced using requestAnimationFrame). */\n onContentScrolled(): void;\n\n /** Called when the length of the data changes. */\n onDataLengthChanged(): void;\n\n /** Called when the range of items rendered in the DOM has changed. */\n onContentRendered(): void;\n\n /** Called when the offset of the rendered items changed. */\n onRenderedOffsetChanged(): void;\n\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n scrollToIndex(index: number, behavior: ScrollBehavior): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Directive, forwardRef, Input, OnChanges} from '@angular/core';\nimport {Observable, Subject} from 'rxjs';\nimport {distinctUntilChanged} from 'rxjs/operators';\nimport {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-strategy';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n/** Virtual scrolling strategy for lists with items of known fixed size. */\nexport class FixedSizeVirtualScrollStrategy implements VirtualScrollStrategy {\n private readonly _scrolledIndexChange = new Subject<number>();\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n scrolledIndexChange: Observable<number> = this._scrolledIndexChange.pipe(distinctUntilChanged());\n\n /** The attached viewport. */\n private _viewport: CdkVirtualScrollViewport | null = null;\n\n /** The size of the items in the virtually scrolling list. */\n private _itemSize: number;\n\n /** The minimum amount of buffer rendered beyond the viewport (in pixels). */\n private _minBufferPx: number;\n\n /** The number of buffer items to render beyond the edge of the viewport (in pixels). */\n private _maxBufferPx: number;\n\n /**\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n constructor(itemSize: number, minBufferPx: number, maxBufferPx: number) {\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport: CdkVirtualScrollViewport) {\n this._viewport = viewport;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach() {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n }\n\n /**\n * Update the item size and buffer size.\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n updateItemAndBufferSize(itemSize: number, minBufferPx: number, maxBufferPx: number) {\n if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentScrolled() {\n this._updateRenderedRange();\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onDataLengthChanged() {\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentRendered() {\n /* no-op */\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onRenderedOffsetChanged() {\n /* no-op */\n }\n\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n scrollToIndex(index: number, behavior: ScrollBehavior): void {\n if (this._viewport) {\n this._viewport.scrollToOffset(index * this._itemSize, behavior);\n }\n }\n\n /** Update the viewport's total content size. */\n private _updateTotalContentSize() {\n if (!this._viewport) {\n return;\n }\n\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n }\n\n /** Update the viewport's rendered range. */\n private _updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = {start: renderedRange.start, end: renderedRange.end};\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0;\n\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(\n 0,\n Math.min(firstVisibleIndex, dataLength - maxVisibleItems),\n );\n\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(\n dataLength,\n Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize),\n );\n } else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(\n 0,\n Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize),\n );\n }\n }\n }\n\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }\n}\n\n/**\n * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created\n * `FixedSizeVirtualScrollStrategy` from the given directive.\n * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the\n * `FixedSizeVirtualScrollStrategy` from.\n */\nexport function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir: CdkFixedSizeVirtualScroll) {\n return fixedSizeDir._scrollStrategy;\n}\n\n/** A virtual scroll strategy that supports fixed-size items. */\n@Directive({\n selector: 'cdk-virtual-scroll-viewport[itemSize]',\n standalone: true,\n providers: [\n {\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _fixedSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkFixedSizeVirtualScroll)],\n },\n ],\n})\nexport class CdkFixedSizeVirtualScroll implements OnChanges {\n /** The size of the items in the list (in pixels). */\n @Input()\n get itemSize(): number {\n return this._itemSize;\n }\n set itemSize(value: NumberInput) {\n this._itemSize = coerceNumberProperty(value);\n }\n _itemSize = 20;\n\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n @Input()\n get minBufferPx(): number {\n return this._minBufferPx;\n }\n set minBufferPx(value: NumberInput) {\n this._minBufferPx = coerceNumberProperty(value);\n }\n _minBufferPx = 100;\n\n /**\n * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.\n */\n @Input()\n get maxBufferPx(): number {\n return this._maxBufferPx;\n }\n set maxBufferPx(value: NumberInput) {\n this._maxBufferPx = coerceNumberProperty(value);\n }\n _maxBufferPx = 200;\n\n /** The scroll strategy used by this directive. */\n _scrollStrategy = new FixedSizeVirtualScrollStrategy(\n this.itemSize,\n this.minBufferPx,\n this.maxBufferPx,\n );\n\n ngOnChanges() {\n this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {Platform} from '@angular/cdk/platform';\nimport {ElementRef, Injectable, NgZone, OnDestroy, Optional, Inject} from '@angular/core';\nimport {fromEvent, of as observableOf, Subject, Subscription, Observable, Observer} from 'rxjs';\nimport {auditTime, filter} from 'rxjs/operators';\nimport {CdkScrollable} from './scrollable';\nimport {DOCUMENT} from '@angular/common';\n\n/** Time in ms to throttle the scrolling events by default. */\nexport const DEFAULT_SCROLL_TIME = 20;\n\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\n@Injectable({providedIn: 'root'})\nexport class ScrollDispatcher implements OnDestroy {\n /** Used to reference correct document/window */\n protected _document: Document;\n\n constructor(\n private _ngZone: NgZone,\n private _platform: Platform,\n @Optional() @Inject(DOCUMENT) document: any,\n ) {\n this._document = document;\n }\n\n /** Subject for notifying that a registered scrollable reference element has been scrolled. */\n private readonly _scrolled = new Subject<CdkScrollable | void>();\n\n /** Keeps track of the global `scroll` and `resize` subscriptions. */\n _globalSubscription: Subscription | null = null;\n\n /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */\n private _scrolledCount = 0;\n\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n scrollContainers: Map<CdkScrollable, Subscription> = new Map();\n\n /**\n * Registers a scrollable instance with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event to its scrolled observable.\n * @param scrollable Scrollable instance to be registered.\n */\n register(scrollable: CdkScrollable): void {\n if (!this.scrollContainers.has(scrollable)) {\n this.scrollContainers.set(\n scrollable,\n scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable)),\n );\n }\n }\n\n /**\n * De-registers a Scrollable reference and unsubscribes from its scroll event observable.\n * @param scrollable Scrollable instance to be deregistered.\n */\n deregister(scrollable: CdkScrollable): void {\n const scrollableReference = this.scrollContainers.get(scrollable);\n\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollContainers.delete(scrollable);\n }\n }\n\n /**\n * Returns an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n *\n * **Note:** in order to avoid hitting change detection for every scroll event,\n * all of the events emitted from this stream will be run outside the Angular zone.\n * If you need to update any data bindings as a result of a scroll event, you have\n * to run the callback using `NgZone.run`.\n */\n scrolled(auditTimeInMs: number = DEFAULT_SCROLL_TIME): Observable<CdkScrollable | void> {\n if (!this._platform.isBrowser) {\n return observableOf<void>();\n }\n\n return new Observable((observer: Observer<CdkScrollable | void>) => {\n if (!this._globalSubscription) {\n this._addGlobalListener();\n }\n\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n const subscription =\n auditTimeInMs > 0\n ? this._scrolled.pipe(auditTime(auditTimeInMs)).subscribe(observer)\n : this._scrolled.subscribe(observer);\n\n this._scrolledCount++;\n\n return () => {\n subscription.unsubscribe();\n this._scrolledCount--;\n\n if (!this._scrolledCount) {\n this._removeGlobalListener();\n }\n };\n });\n }\n\n ngOnDestroy() {\n this._removeGlobalListener();\n this.scrollContainers.forEach((_, container) => this.deregister(container));\n this._scrolled.complete();\n }\n\n /**\n * Returns an observable that emits whenever any of the\n * scrollable ancestors of an element are scrolled.\n * @param elementOrElementRef Element whose ancestors to listen for.\n * @param auditTimeInMs Time to throttle the scroll events.\n */\n ancestorScrolled(\n elementOrElementRef: ElementRef | HTMLElement,\n auditTimeInMs?: number,\n ): Observable<CdkScrollable | void> {\n const ancestors = this.getAncestorScrollContainers(elementOrElementRef);\n\n return this.scrolled(auditTimeInMs).pipe(\n filter(target => {\n return !target || ancestors.indexOf(target) > -1;\n }),\n );\n }\n\n /** Returns all registered Scrollables that contain the provided element. */\n getAncestorScrollContainers(elementOrElementRef: ElementRef | HTMLElement): CdkScrollable[] {\n const scrollingContainers: CdkScrollable[] = [];\n\n this.scrollContainers.forEach((_subscription: Subscription, scrollable: CdkScrollable) => {\n if (this._scrollableContainsElement(scrollable, elementOrElementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n\n return scrollingContainers;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window;\n }\n\n /** Returns true if the element is contained within the provided Scrollable. */\n private _scrollableContainsElement(\n scrollable: CdkScrollable,\n elementOrElementRef: ElementRef | HTMLElement,\n ): boolean {\n let element: HTMLElement | null = coerceElement(elementOrElementRef);\n let scrollableElement = scrollable.getElementRef().nativeElement;\n\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) {\n return true;\n }\n } while ((element = element!.parentElement));\n\n return false;\n }\n\n /** Sets up the global scroll listeners. */\n private _addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n return fromEvent(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }\n\n /** Cleans up the global scroll listener. */\n private _removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n getRtlScrollAxisType,\n RtlScrollAxisType,\n supportsScrollBehavior,\n} from '@angular/cdk/platform';\nimport {Directive, ElementRef, NgZone, OnDestroy, OnInit, Optional} from '@angular/core';\nimport {fromEvent, Observable, Subject, Observer} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {ScrollDispatcher} from './scroll-dispatcher';\n\nexport type _Without<T> = {[P in keyof T]?: never};\nexport type _XOR<T, U> = (_Without<T> & U) | (_Without<U> & T);\nexport type _Top = {top?: number};\nexport type _Bottom = {bottom?: number};\nexport type _Left = {left?: number};\nexport type _Right = {right?: number};\nexport type _Start = {start?: number};\nexport type _End = {end?: number};\nexport type _XAxis = _XOR<_XOR<_Left, _Right>, _XOR<_Start, _End>>;\nexport type _YAxis = _XOR<_Top, _Bottom>;\n\n/**\n * An extended version of ScrollToOptions that allows expressing scroll offsets relative to the\n * top, bottom, left, right, start, or end of the viewport rather than just the top and left.\n * Please note: the top and bottom properties are mutually exclusive, as are the left, right,\n * start, and end properties.\n */\nexport type ExtendedScrollToOptions = _XAxis & _YAxis & ScrollOptions;\n\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\n@Directive({\n selector: '[cdk-scrollable], [cdkScrollable]',\n standalone: true,\n})\nexport class CdkScrollable implements OnInit, OnDestroy {\n protected readonly _destroyed = new Subject<void>();\n\n protected _elementScrolled: Observable<Event> = new Observable((observer: Observer<Event>) =>\n this.ngZone.runOutsideAngular(() =>\n fromEvent(this.elementRef.nativeElement, 'scroll')\n .pipe(takeUntil(this._destroyed))\n .subscribe(observer),\n ),\n );\n\n constructor(\n protected elementRef: ElementRef<HTMLElement>,\n protected scrollDispatcher: ScrollDispatcher,\n protected ngZone: NgZone,\n @Optional() protected dir?: Directionality,\n ) {}\n\n ngOnInit() {\n this.scrollDispatcher.register(this);\n }\n\n ngOnDestroy() {\n this.scrollDispatcher.deregister(this);\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Returns observable that emits when a scroll event is fired on the host element. */\n elementScrolled(): Observable<Event> {\n return this._elementScrolled;\n }\n\n /** Gets the ElementRef for the viewport. */\n getElementRef(): ElementRef<HTMLElement> {\n return this.elementRef;\n }\n\n /**\n * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo\n * method, since browsers are not consistent about what scrollLeft means in RTL. For this method\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param options specified the offsets to scroll to.\n */\n scrollTo(options: ExtendedScrollToOptions): void {\n const el = this.elementRef.nativeElement;\n const isRtl = this.dir && this.dir.value == 'rtl';\n\n // Rewrite start & end offsets as right or left offsets.\n if (options.left == null) {\n options.left = isRtl ? options.end : options.start;\n }\n\n if (options.right == null) {\n options.right = isRtl ? options.start : options.end;\n }\n\n // Rewrite the bottom offset as a top offset.\n if (options.bottom != null) {\n (options as _Without<_Bottom> & _Top).top =\n el.scrollHeight - el.clientHeight - options.bottom;\n }\n\n // Rewrite the right offset as a left offset.\n if (isRtl && getRtlScrollAxisType() != RtlScrollAxisType.NORMAL) {\n if (options.left != null) {\n (options as _Without<_Left> & _Right).right =\n el.scrollWidth - el.clientWidth - options.left;\n }\n\n if (getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {\n options.left = options.right;\n } else if (getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {\n options.left = options.right ? -options.right : options.right;\n }\n } else {\n if (options.right != null) {\n (options as _Without<_Right> & _Left).left =\n el.scrollWidth - el.clientWidth - options.right;\n }\n }\n\n this._applyScrollToOptions(options);\n }\n\n private _applyScrollToOptions(options: ScrollToOptions): void {\n const el = this.elementRef.nativeElement;\n\n if (supportsScrollBehavior()) {\n el.scrollTo(options);\n } else {\n if (options.top != null) {\n el.scrollTop = options.top;\n }\n if (options.left != null) {\n el.scrollLeft = options.left;\n }\n }\n }\n\n /**\n * Measures the scroll offset relative to the specified edge of the viewport. This method can be\n * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent\n * about what scrollLeft means in RTL. The values returned by this method are normalized such that\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param from The edge to measure from.\n */\n measureScrollOffset(from: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number {\n const LEFT = 'left';\n const RIGHT = 'right';\n const el = this.elementRef.nativeElement;\n if (from == 'top') {\n return el.scrollTop;\n }\n if (from == 'bottom') {\n return el.scrollHeight - el.clientHeight - el.scrollTop;\n }\n\n // Rewrite start & end as left or right offsets.\n const isRtl = this.dir && this.dir.value == 'rtl';\n if (from == 'start') {\n from = isRtl ? RIGHT : LEFT;\n } else if (from == 'end') {\n from = isRtl ? LEFT : RIGHT;\n }\n\n if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {\n // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n } else {\n return el.scrollLeft;\n }\n } else if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {\n // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft + el.scrollWidth - el.clientWidth;\n } else {\n return -el.scrollLeft;\n }\n } else {\n // For NORMAL, as well as non-RTL contexts, scrollLeft is 0 when scrolled all the way left and\n // (scrollWidth - clientWidth) when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft;\n } else {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {Injectable, NgZone, OnDestroy, Optional, Inject} from '@angular/core';\nimport {Observable, Subject} from 'rxjs';\nimport {auditTime} from 'rxjs/operators';\nimport {DOCUMENT} from '@angular/common';\n\n/** Time in ms to throttle the resize events by default. */\nexport const DEFAULT_RESIZE_TIME = 20;\n\n/** Object that holds the scroll position of the viewport in each direction. */\nexport interface ViewportScrollPosition {\n top: number;\n left: number;\n}\n\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class ViewportRuler implements OnDestroy {\n /** Cached viewport dimensions. */\n private _viewportSize: {width: number; height: number} | null;\n\n /** Stream of viewport change events. */\n private readonly _change = new Subject<Event>();\n\n /** Event listener that will be used to handle the viewport change events. */\n private _changeListener = (event: Event) => {\n this._change.next(event);\n };\n\n /** Used to reference correct document/window */\n protected _document: Document;\n\n constructor(\n private _platform: Platform,\n ngZone: NgZone,\n @Optional() @Inject(DOCUMENT) document: any,\n ) {\n this._document = document;\n\n ngZone.runOutsideAngular(() => {\n if (_platform.isBrowser) {\n const window = this._getWindow();\n\n // Note that bind the events ourselves, rather than going through something like RxJS's\n // `fromEvent` so that we can ensure that they're bound outside of the NgZone.\n window.addEventListener('resize', this._changeListener);\n window.addEventListener('orientationchange', this._changeListener);\n }\n\n // Clear the cached position so that the viewport is re-measured next time it is required.\n // We don't need to keep track of the subscription, because it is completed on destroy.\n this.change().subscribe(() => (this._viewportSize = null));\n });\n }\n\n ngOnDestroy() {\n if (this._platform.isBrowser) {\n const window = this._getWindow();\n window.removeEventListener('resize', this._changeListener);\n window.removeEventListener('orientationchange', this._changeListener);\n }\n\n this._change.complete();\n }\n\n /** Returns the viewport's width and height. */\n getViewportSize(): Readonly<{width: number; height: number}> {\n if (!this._viewportSize) {\n this._updateViewportSize();\n }\n\n const output = {width: this._viewportSize!.width, height: this._viewportSize!.height};\n\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null!;\n }\n\n return output;\n }\n\n /** Gets a ClientRect for the viewport's bounds. */\n getViewportRect() {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition();\n const {width, height} = this.getViewportSize();\n\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n };\n }\n\n /** Gets the (top, left) scroll position of the viewport. */\n getViewportScrollPosition(): ViewportScrollPosition {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return {top: 0, left: 0};\n }\n\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document;\n const window = this._getWindow();\n const documentElement = document.documentElement!;\n const documentRect = documentElement.getBoundingClientRect();\n\n const top =\n -documentRect.top ||\n document.body.scrollTop ||\n window.scrollY ||\n documentElement.scrollTop ||\n 0;\n\n const left =\n -documentRect.left ||\n document.body.scrollLeft ||\n window.scrollX ||\n documentElement.scrollLeft ||\n 0;\n\n return {top, left};\n }\n\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * This stream emits outside of the Angular zone.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n change(throttleTime: number = DEFAULT_RESIZE_TIME): Observable<Event> {\n return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window;\n }\n\n /** Updates the cached viewport size. */\n private _updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser\n ? {width: window.innerWidth, height: window.innerHeight}\n : {width: 0, height: 0};\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {Directive, ElementRef, InjectionToken, NgZone, Optional} from '@angular/core';\nimport {ScrollDispatcher} from './scroll-dispatcher';\nimport {CdkScrollable} from './scrollable';\n\nexport const VIRTUAL_SCROLLABLE = new InjectionToken<CdkVirtualScrollable>('VIRTUAL_SCROLLABLE');\n\n/**\n * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling.\n */\n@Directive()\nexport abstract class CdkVirtualScrollable extends CdkScrollable {\n constructor(\n elementRef: ElementRef<HTMLElement>,\n scrollDispatcher: ScrollDispatcher,\n ngZone: NgZone,\n @Optional() dir?: Directionality,\n ) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n }\n\n /**\n * Measure the viewport size for the provided orientation.\n *\n * @param orientation The orientation to measure the size from.\n */\n measureViewportSize(orientation: 'horizontal' | 'vertical') {\n const viewportEl = this.elementRef.nativeElement;\n return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight;\n }\n\n /**\n * Measure the bounding ClientRect size including the scroll offset.\n *\n * @param from The edge to measure from.\n */\n abstract measureBoundingClientRectWithScrollOffset(\n from: 'left' | 'top' | 'right' | 'bottom',\n ): number;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {ListRange} from '@angular/cdk/collections';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {\n animationFrameScheduler,\n asapScheduler,\n Observable,\n Subject,\n Observer,\n Subscription,\n} from 'rxjs';\nimport {auditTime, startWith, takeUntil} from 'rxjs/operators';\nimport {ScrollDispatcher} from './scroll-dispatcher';\nimport {CdkScrollable, ExtendedScrollToOptions} from './scrollable';\nimport {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-strategy';\nimport {ViewportRuler} from './viewport-ruler';\nimport {CdkVirtualScrollRepeater} from './virtual-scroll-repeater';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {CdkVirtualScrollable, VIRTUAL_SCROLLABLE} from './virtual-scrollable';\n\n/** Checks if the given ranges are equal. */\nfunction rangesEqual(r1: ListRange, r2: ListRange): boolean {\n return r1.start == r2.start && r1.end == r2.end;\n}\n\n/**\n * Scheduler to be used for scroll events. Needs to fall back to\n * something that doesn't rely on requestAnimationFrame on environments\n * that don't support it (e.g. server-side rendering).\n */\nconst SCROLL_SCHEDULER =\n typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;\n\n/** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */\n@Component({\n selector: 'cdk-virtual-scroll-viewport',\n templateUrl: 'virtual-scroll-viewport.html',\n styleUrls: ['virtual-scroll-viewport.css'],\n host: {\n 'class': 'cdk-virtual-scroll-viewport',\n '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === \"horizontal\"',\n '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== \"horizontal\"',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n providers: [\n {\n provide: CdkScrollable,\n useFactory: (\n virtualScrollable: CdkVirtualScrollable | null,\n viewport: CdkVirtualScrollViewport,\n ) => virtualScrollable || viewport,\n deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport],\n },\n ],\n})\nexport class CdkVirtualScrollViewport extends CdkVirtualScrollable implements OnInit, OnDestroy {\n private _platform = inject(Platform);\n\n /** Emits when the viewport is detached from a CdkVirtualForOf. */\n private readonly _detachedSubject = new Subject<void>();\n\n /** Emits when the rendered range changes. */\n private readonly _renderedRangeSubject = new Subject<ListRange>();\n\n /** The direction the viewport scrolls. */\n @Input()\n get orientation() {\n return this._orientation;\n }\n\n set orientation(orientation: 'horizontal' | 'vertical') {\n if (this._orientation !== orientation) {\n this._orientation = orientation;\n this._calculateSpacerSize();\n }\n }\n private _orientation: 'horizontal' | 'vertical' = 'vertical';\n\n /**\n * Whether rendered items should persist in the DOM after scrolling out of view. By default, items\n * will be removed.\n */\n @Input()\n get appendOnly(): boolean {\n return this._appendOnly;\n }\n set appendOnly(value: BooleanInput) {\n this._appendOnly = coerceBooleanProperty(value);\n }\n private _appendOnly = false;\n\n // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll\n // strategy lazily (i.e. only if the user is actually listening to the events). We do this because\n // depending on how the strategy calculates the scrolled index, it may come at a cost to\n // performance.\n /** Emits when the index of the first element visible in the viewport changes. */\n @Output()\n readonly scrolledIndexChange: Observable<number> = new Observable((observer: Observer<number>) =>\n this._scrollStrategy.scrolledIndexChange.subscribe(index =>\n Promise.resolve().then(() => this.ngZone.run(() => observer.next(index))),\n ),\n );\n\n /** The element that wraps the rendered content. */\n @ViewChild('contentWrapper', {static: true}) _contentWrapper: ElementRef<HTMLElement>;\n\n /** A stream that emits whenever the rendered range changes. */\n readonly renderedRangeStream: Observable<ListRange> = this._renderedRangeSubject;\n\n /**\n * The total size of all content (in pixels), including content that is not currently rendered.\n */\n private _totalContentSize = 0;\n\n /** A string representing the `style.width` property value to be used for the spacer element. */\n _totalContentWidth = '';\n\n /** A string representing the `style.height` property value to be used for the spacer element. */\n _totalContentHeight = '';\n\n /**\n * The CSS transform applied to the rendered subset of items so that they appear within the bounds\n * of the visible viewport.\n */\n private _renderedContentTransform: string;\n\n /** The currently rendered range of indices. */\n private _renderedRange: ListRange = {start: 0, end: 0};\n\n /** The length of the data bound to this viewport (in number of items). */\n private _dataLength = 0;\n\n /** The size of the viewport (in pixels). */\n private _viewportSize = 0;\n\n /** the currently attached CdkVirtualScrollRepeater. */\n private _forOf: CdkVirtualScrollRepeater<any> | null;\n\n /** The last rendered content offset that was set. */\n private _renderedContentOffset = 0;\n\n /**\n * Whether the last rendered content offset was to the end of the content (and therefore needs to\n * be rewritten as an offset to the start of the content).\n */\n private _renderedContentOffsetNeedsRewrite = false;\n\n /** Whether there is a pending change detection cycle. */\n private _isChangeDetectionPending = false;\n\n /** A list of functions to run after the next change detection cycle. */\n private _runAfterChangeDetection: Function[] = [];\n\n /** Subscription to changes in the viewport size. */\n private _viewportChanges = Subscription.EMPTY;\n\n constructor(\n public override elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n ngZone: NgZone,\n @Optional()\n @Inject(VIRTUAL_SCROLL_STRATEGY)\n private _scrollStrategy: VirtualScrollStrategy,\n @Optional() dir: Directionality,\n scrollDispatcher: ScrollDispatcher,\n viewportRuler: ViewportRuler,\n @Optional() @Inject(VIRTUAL_SCROLLABLE) public scrollable: CdkVirtualScrollable,\n ) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n\n if (!_scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Error: cdk-virtual-scroll-viewport requires the \"itemSize\" property to be set.');\n }\n\n this._viewportChanges = viewportRuler.change().subscribe(() => {\n this.checkViewportSize();\n });\n\n if (!this.scrollable) {\n // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable\n this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable');\n this.scrollable = this;\n }\n }\n\n override ngOnInit() {\n // Scrolling depends on the element dimensions which we can't get during SSR.\n if (!this._platform.isBrowser) {\n return;\n }\n\n if (this.scrollable === this) {\n super.ngOnInit();\n }\n // It's still too early to measure the viewport at this point. Deferring with a promise allows\n // the Viewport to be rendered with the correct size before we measure. We run this outside the\n // zone to avoid causing more change detection cycles. We handle the change detection loop\n // ourselves instead.\n this.ngZone.runOutsideAngular(() =>\n Promise.resolve().then(() => {\n this._measureViewportSize();\n this._scrollStrategy.attach(this);\n\n this.scrollable\n .elementScrolled()\n .pipe(\n // Start off with a fake scroll event so we properly detect our initial position.\n startWith(null),\n // Collect multiple events into one until the next animation frame. This way if\n // there are multiple scroll events in the same frame we only need to recheck\n // our layout once.\n auditTime(0, SCROLL_SCHEDULER),\n )\n .subscribe(() => this._scrollStrategy.onContentScrolled());\n\n this._markChangeDetectionNeeded();\n }),\n );\n }\n\n override ngOnDestroy() {\n this.detach();\n this._scrollStrategy.detach();\n\n // Complete all subjects\n this._renderedRangeSubject.complete();\n this._detachedSubject.complete();\n this._viewportChanges.unsubscribe();\n\n super.ngOnDestroy();\n }\n\n /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */\n attach(forOf: CdkVirtualScrollRepeater<any>) {\n if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkVirtualScrollViewport is already attached.');\n }\n\n // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length\n // changes. Run outside the zone to avoid triggering change detection, since we're managing the\n // change detection loop ourselves.\n this.ngZone.runOutsideAngular(() => {\n this._forOf = forOf;\n this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe(data => {\n const newLength = data.length;\n if (newLength !== this._dataLength) {\n this._dataLength = newLength;\n this._scrollStrategy.onDataLengthChanged();\n }\n this._doChangeDetection();\n });\n });\n }\n\n /** Detaches the current `CdkVirtualForOf`. */\n detach() {\n this._forOf = null;\n this._detachedSubject.next();\n }\n\n /** Gets the length of the data bound to this viewport (in number of items). */\n getDataLength(): number {\n return this._dataLength;\n }\n\n /** Gets the size of the viewport (in pixels). */\n getViewportSize(): number {\n return this._viewportSize;\n }\n\n // TODO(mmalerba): This is technically out of sync with what's really rendered until a render\n // cycle happens. I'm being careful to only call it after the render cycle is complete and before\n // setting it to something else, but its error prone and should probably be split into\n // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.\n\n /** Get the current rendered range of items. */\n getRenderedRange(): ListRange {\n return this._renderedRange;\n }\n\n measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number {\n return this.getElementRef().nativeElement.getBoundingClientRect()[from];\n }\n\n /**\n * Sets the total size of all content (in pixels), including content that is not currently\n * rendered.\n */\n setTotalContentSize(size: number) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }\n\n /** Sets the currently rendered range of indices. */\n setRenderedRange(range: ListRange) {\n if (!rangesEqual(this._renderedRange, range)) {\n if (this.appendOnly) {\n range = {start: 0, end: Math.max(this._renderedRange.end, range.end)};\n }\n this._renderedRangeSubject.next((this._renderedRange = range));\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }\n\n /**\n * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).\n */\n getOffsetToRenderedContentStart(): number | null {\n return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;\n }\n\n /**\n * Sets the offset from the start of the viewport to either the start or end of the rendered data\n * (in pixels).\n */\n setRenderedContentOffset(offset: number, to: 'to-start' | 'to-end' = 'to-start') {\n // In appendOnly, we always start from the top\n offset = this.appendOnly && to === 'to-start' ? 0 : offset;\n\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n const isRtl = this.dir && this.dir.value == 'rtl';\n const isHorizontal = this.orientation == 'horizontal';\n const axis = isHorizontal ? 'X' : 'Y';\n const axisDirection = isHorizontal && isRtl ? -1 : 1;\n let transform = `translate${axis}(${Number(axisDirection * offset)}px)`;\n this._renderedContentOffset = offset;\n if (to === 'to-end') {\n transform += ` translate${axis}(-100%)`;\n // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n this._renderedContentOffsetNeedsRewrite = true;\n }\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n this._markChangeDetectionNeeded(() => {\n if (this._renderedContentOffsetNeedsRewrite) {\n this._renderedContentOffset -= this.measureRenderedContentSize();\n this._renderedContentOffsetNeedsRewrite = false;\n this.setRenderedContentOffset(this._renderedContentOffset);\n } else {\n this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n }\n\n /**\n * Scrolls to the given offset from the start of the viewport. Please note that this is not always\n * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left\n * direction, this would be the equivalent of setting a fictional `scrollRight` property.\n * @param offset The offset to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToOffset(offset: number, behavior: ScrollBehavior = 'auto') {\n const options: ExtendedScrollToOptions = {behavior};\n if (this.orientation === 'horizontal') {\n options.start = offset;\n } else {\n options.top = offset;\n }\n this.scrollable.scrollTo(options);\n }\n\n /**\n * Scrolls to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToIndex(index: number, behavior: ScrollBehavior = 'auto') {\n this._scrollStrategy.scrollToIndex(index, behavior);\n }\n\n /**\n * Gets the current scroll offset from the start of the scrollable (in pixels).\n * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'\n * in horizontal mode.\n */\n override measureScrollOffset(\n from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end',\n ): number {\n // This is to break the call cycle\n let measureScrollOffset: InstanceType<typeof CdkVirtualScrollable>['measureScrollOffset'];\n if (this.scrollable == this) {\n measureScrollOffset = (_from: NonNullable<typeof from>) => super.measureScrollOffset(_from);\n } else {\n measureScrollOffset = (_from: NonNullable<typeof from>) =>\n this.scrollable.measureScrollOffset(_from);\n }\n\n return Math.max(\n 0,\n measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) -\n this.measureViewportOffset(),\n );\n }\n\n /**\n * Measures the offset of the viewport from the scrolling container\n * @param from The edge to measure from.\n */\n measureViewportOffset(from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end') {\n let fromRect: 'left' | 'top' | 'right' | 'bottom';\n const LEFT = 'left';\n const RIGHT = 'right';\n const isRtl = this.dir?.value == 'rtl';\n if (from == 'start') {\n fromRect = isRtl ? RIGHT : LEFT;\n } else if (from == 'end') {\n fromRect = isRtl ? LEFT : RIGHT;\n } else if (from) {\n fromRect = from;\n } else {\n fromRect = this.orientation === 'horizontal' ? 'left' : 'top';\n }\n\n const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);\n const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];\n\n return viewportClientRect - scrollerClientRect;\n }\n\n /** Measure the combined size of all of the rendered items. */\n measureRenderedContentSize(): number {\n const contentEl = this._contentWrapper.nativeElement;\n return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight;\n }\n\n /**\n * Measure the total combined size of the given range. Throws if the range includes items that are\n * not rendered.\n */\n measureRangeSize(range: ListRange): number {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }\n\n /** Update the viewport dimensions and re-render. */\n checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }\n\n /** Measure the viewport size. */\n private _measureViewportSize() {\n this._viewportSize = this.scrollable.measureViewportSize(this.orientation);\n }\n\n /** Queue up change detection to run. */\n private _markChangeDetectionNeeded(runAfter?: Function) {\n if (runAfter) {\n this._runAfterChangeDetection.push(runAfter);\n }\n\n // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of\n // properties sequentially we only have to run `_doChangeDetection` once at the end.\n if (!this._isChangeDetectionPending) {\n this._isChangeDetectionPending = true;\n this.ngZone.runOutsideAngular(() =>\n Promise.resolve().then(() => {\n this._doChangeDetection();\n }),\n );\n }\n }\n\n /** Run change detection. */\n private _doChangeDetection() {\n this._isChangeDetectionPending = false;\n\n // Apply the content transform. The transform can't be set via an Angular binding because\n // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of\n // string literals, a variable that can only be 'X' or 'Y', and user input that is run through\n // the `Number` function first to coerce it to a numeric value.\n this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;\n // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection\n // from the root, since the repeated items are content projected in. Calling `detectChanges`\n // instead does not properly check the projected content.\n this.ngZone.run(() => this._changeDetectorRef.markForCheck());\n\n const runAfterChangeDetection = this._runAfterChangeDetection;\n this._runAfterChangeDetection = [];\n for (const fn of runAfterChangeDetection) {\n fn();\n }\n }\n\n /** Calculates the `style.width` and `style.height` for the spacer element. */\n private _calculateSpacerSize() {\n this._totalContentHeight =\n this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;\n this._totalContentWidth =\n this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';\n }\n}\n","<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ArrayDataSource,\n CollectionViewer,\n DataSource,\n ListRange,\n isDataSource,\n _RecycleViewRepeaterStrategy,\n _VIEW_REPEATER_STRATEGY,\n _ViewRepeaterItemInsertArgs,\n} from '@angular/cdk/collections';\nimport {\n Directive,\n DoCheck,\n EmbeddedViewRef,\n Inject,\n Input,\n IterableChangeRecord,\n IterableChanges,\n IterableDiffer,\n IterableDiffers,\n NgIterable,\n NgZone,\n OnDestroy,\n SkipSelf,\n TemplateRef,\n TrackByFunction,\n ViewContainerRef,\n} from '@angular/core';\nimport {coerceNumberProperty, NumberInput} from '@angular/cdk/coercion';\nimport {Observable, Subject, of as observableOf, isObservable} from 'rxjs';\nimport {pairwise, shareReplay, startWith, switchMap, takeUntil} from 'rxjs/operators';\nimport {CdkVirtualScrollRepeater} from './virtual-scroll-repeater';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n/** The context for an item rendered by `CdkVirtualForOf` */\nexport type CdkVirtualForOfContext<T> = {\n /** The item value. */\n $implicit: T;\n /** The DataSource, Observable, or NgIterable that was passed to *cdkVirtualFor. */\n cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T>;\n /** The index of the item in the DataSource. */\n index: number;\n /** The number of items in the DataSource. */\n count: number;\n /** Whether this is the first item in the DataSource. */\n first: boolean;\n /** Whether this is the last item in the DataSource. */\n last: boolean;\n /** Whether the index is even. */\n even: boolean;\n /** Whether the index is odd. */\n odd: boolean;\n};\n\n/** Helper to extract the offset of a DOM Node in a certain direction. */\nfunction getOffset(orientation: 'horizontal' | 'vertical', direction: 'start' | 'end', node: Node) {\n const el = node as Element;\n if (!el.getBoundingClientRect) {\n return 0;\n }\n const rect = el.getBoundingClientRect();\n\n if (orientation === 'horizontal') {\n return direction === 'start' ? rect.left : rect.right;\n }\n\n return direction === 'start' ? rect.top : rect.bottom;\n}\n\n/**\n * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling\n * container.\n */\n@Directive({\n selector: '[cdkVirtualFor][cdkVirtualForOf]',\n providers: [{provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy}],\n standalone: true,\n})\nexport class CdkVirtualForOf<T>\n implements CdkVirtualScrollRepeater<T>, CollectionViewer, DoCheck, OnDestroy\n{\n /** Emits when the rendered view of the data changes. */\n readonly viewChange = new Subject<ListRange>();\n\n /** Subject that emits when a new DataSource instance is given. */\n private readonly _dataSourceChanges = new Subject<DataSource<T>>();\n\n /** The DataSource to display. */\n @Input()\n get cdkVirtualForOf(): DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined {\n return this._cdkVirtualForOf;\n }\n set cdkVirtualForOf(value: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined) {\n this._cdkVirtualForOf = value;\n if (isDataSource(value)) {\n this._dataSourceChanges.next(value);\n } else {\n // If value is an an NgIterable, convert it to an array.\n this._dataSourceChanges.next(\n new ArrayDataSource<T>(isObservable(value) ? value : Array.from(value || [])),\n );\n }\n }\n\n _cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;\n\n /**\n * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and\n * the item and produces a value to be used as the item's identity when tracking changes.\n */\n @Input()\n get cdkVirtualForTrackBy(): TrackByFunction<T> | undefined {\n return this._cdkVirtualForTrackBy;\n }\n set cdkVirtualForTrackBy(fn: TrackByFunction<T> | undefined) {\n this._needsUpdate = true;\n this._cdkVirtualForTrackBy = fn\n ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item)\n : undefined;\n }\n private _cdkVirtualForTrackBy: TrackByFunction<T> | undefined;\n\n /** The template used to stamp out new elements. */\n @Input()\n set cdkVirtualForTemplate(value: TemplateRef<CdkVirtualForOfContext<T>>) {\n if (value) {\n this._needsUpdate = true;\n this._template = value;\n }\n }\n\n /**\n * The size of the cache used to store templates that are not being used for re-use later.\n * Setting the cache size to `0` will disable caching. Defaults to 20 templates.\n */\n @Input()\n get cdkVirtualForTemplateCacheSize(): number {\n return this._viewRepeater.viewCacheSize;\n }\n set cdkVirtualForTemplateCacheSize(size: NumberInput) {\n this._viewRepeater.viewCacheSize = coerceNumberProperty(size);\n }\n\n /** Emits whenever the data in the current DataSource changes. */\n readonly dataStream: Observable<readonly T[]> = this._dataSourceChanges.pipe(\n // Start off with null `DataSource`.\n startWith(null),\n // Bundle up the previous and current data sources so we can work with both.\n pairwise(),\n // Use `_changeDataSource` to disconnect from the previous data source and connect to the\n // new one, passing back a stream of data changes which we run through `switchMap` to give\n // us a data stream that emits the latest data from whatever the current `DataSource` is.\n switchMap(([prev, cur]) => this._changeDataSource(prev, cur)),\n // Replay the last emitted data when someone subscribes.\n shareReplay(1),\n );\n\n /** The differ used to calculate changes to the data. */\n private _differ: IterableDiffer<T> | null = null;\n\n /** The most recent data emitted from the DataSource. */\n private _data: readonly T[];\n\n /** The currently rendered items. */\n private _renderedItems: T[];\n\n /** The currently rendered range of indices. */\n private _renderedRange: ListRange;\n\n /** Whether the rendered data should be updated during the next ngDoCheck cycle. */\n private _needsUpdate = false;\n\n private readonly _destroyed = new Subject<void>();\n\n constructor(\n /** The view container to add items to. */\n private _viewContainerRef: ViewContainerRef,\n /** The template to use when stamping out new items. */\n private _template: TemplateRef<CdkVirtualForOfContext<T>>,\n /** The set of available differs. */\n private _differs: IterableDiffers,\n /** The strategy used to render items in the virtual scroll viewport. */\n @Inject(_VIEW_REPEATER_STRATEGY)\n private _viewRepeater: _RecycleViewRepeaterStrategy<T, T, CdkVirtualForOfContext<T>>,\n /** The virtual scrolling viewport that these items are being rendered in. */\n @SkipSelf() private _viewport: CdkVirtualScrollViewport,\n ngZone: NgZone,\n ) {\n this.dataStream.subscribe(data => {\n this._data = data;\n this._onRenderedDataChange();\n });\n this._viewport.renderedRangeStream.pipe(takeUntil(this._destroyed)).subscribe(range => {\n this._renderedRange = range;\n if (this.viewChange.observers.length) {\n ngZone.run(() => this.viewChange.next(this._renderedRange));\n }\n this._onRenderedDataChange();\n });\n this._viewport.attach(this);\n }\n\n /**\n * Measures the combined size (width for horizontal orientation, height for vertical) of all items\n * in the specified range. Throws an error if the range includes items that are not currently\n * rendered.\n */\n measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number {\n if (range.start >= range.end) {\n return 0;\n }\n if (\n (range.start < this._renderedRange.start || range.end > this._renderedRange.end) &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw Error(`Error: attempted to measure an item that isn't rendered.`);\n }\n\n // The index into the list of rendered views for the first item in the range.\n const renderedStartIndex = range.start - this._renderedRange.start;\n // The length of the range we're measuring.\n const rangeLen = range.end - range.start;\n\n // Loop over all the views, find the first and land node and compute the size by subtracting\n // the top of the first node from the bottom of the last one.\n let firstNode: HTMLElement | undefined;\n let lastNode: HTMLElement | undefined;\n\n // Find the first node by starting from the beginning and going forwards.\n for (let i = 0; i < rangeLen; i++) {\n const view = this._viewContainerRef.get(i + renderedStartIndex) as EmbeddedViewRef<\n CdkVirtualForOfContext<T>\n > | null;\n if (view && view.rootNodes.length) {\n firstNode = lastNode = view.rootNodes[0];\n break;\n }\n }\n\n // Find the last node by starting from the end and going backwards.\n for (let i = rangeLen - 1; i > -1; i--) {\n const view = this._viewContainerRef.get(i + renderedStartIndex) as EmbeddedViewRef<\n CdkVirtualForOfContext<T>\n > | null;\n if (view && view.rootNodes.length) {\n lastNode = view.rootNodes[view.rootNodes.length - 1];\n break;\n }\n }\n\n return firstNode && lastNode\n ? getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode)\n : 0;\n }\n\n ngDoCheck() {\n if (this._differ && this._needsUpdate) {\n // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of\n // this list being rendered (can use simpler algorithm) vs needs update due to data actually\n // changing (need to do this diff).\n const changes = this._differ.diff(this._renderedItems);\n if (!changes) {\n this._updateContext();\n } else {\n this._applyChanges(changes);\n }\n this._needsUpdate = false;\n }\n }\n\n ngOnDestroy() {\n this._viewport.detach();\n\n this._dataSourceChanges.next(undefined!);\n this._dataSourceChanges.complete();\n this.viewChange.complete();\n\n this._destroyed.next();\n this._destroyed.complete();\n this._viewRepeater.detach();\n }\n\n /** React to scroll state changes in the viewport. */\n private _onRenderedDataChange() {\n if (!this._renderedRange) {\n return;\n }\n this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);\n if (!this._differ) {\n // Use a wrapper function for the `trackBy` so any new values are\n // picked up automatically without having to recreate the differ.\n this._differ = this._differs.find(this._renderedItems).create((index, item) => {\n return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item;\n });\n }\n this._needsUpdate = true;\n }\n\n /** Swap out one `DataSource` for another. */\n private _changeDataSource(\n oldDs: DataSource<T> | null,\n newDs: DataSource<T> | null,\n ): Observable<readonly T[]> {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : observableOf();\n }\n\n /** Update the `CdkVirtualForOfContext` for all views. */\n private _updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i) as EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }\n\n /** Apply changes to the DOM. */\n private _applyChanges(changes: IterableChanges<T>) {\n this._viewRepeater.applyChanges(\n changes,\n this._viewContainerRef,\n (\n record: IterableChangeRecord<T>,\n _adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n ) => this._getEmbeddedViewArgs(record, currentIndex!),\n record => record.item,\n );\n\n // Update $implicit for any items that had an identity change.\n changes.forEachIdentityChange((record: IterableChangeRecord<T>) => {\n const view = this._viewContainerRef.get(record.currentIndex!) as EmbeddedViewRef<\n CdkVirtualForOfContext<T>\n >;\n view.context.$implicit = record.item;\n });\n\n // Update the context variables on all items.\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i) as EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n }\n }\n\n /** Update the computed properties on the `CdkVirtualForOfContext`. */\n private _updateComputedContextProperties(context: CdkVirtualForOfContext<any>) {\n context.first = context.index === 0;\n context.last = context.index === context.count - 1;\n context.even = context.index % 2 === 0;\n context.odd = !context.even;\n }\n\n private _getEmbeddedViewArgs(\n record: IterableChangeRecord<T>,\n index: number,\n ): _ViewRepeaterItemInsertArgs<CdkVirtualForOfContext<T>> {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return {\n templateRef: this._template,\n context: {\n $implicit: record.item,\n // It's guaranteed that the iterable is not \"undefined\" or \"null\" because we only\n // generate views for elements if the \"cdkVirtualForOf\" iterable has elements.\n cdkVirtualForOf: this._cdkVirtualForOf!,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false,\n },\n index,\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {NgModule} from '@angular/core';\nimport {CdkFixedSizeVirtualScroll} from './fixed-size-virtual-scroll';\nimport {CdkScrollable} from './scrollable';\nimport {CdkVirtualForOf} from './virtual-for-of';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\nimport {CdkVirtualScrollableElement} from './virtual-scrollable-element';\nimport {CdkVirtualScrollableWindow} from './virtual-scrollable-window';\n\n@NgModule({\n exports: [CdkScrollable],\n imports: [CdkScrollable],\n})\nexport class CdkScrollableModule {}\n\n/**\n * @docs-primary-export\n */\n@NgModule({\n imports: [\n BidiModule,\n CdkScrollableModule,\n CdkVirtualScrollViewport,\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollableWindow,\n CdkVirtualScrollableElement,\n ],\n exports: [\n BidiModule,\n CdkScrollableModule,\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\n CdkVirtualScrollableWindow,\n CdkVirtualScrollableElement,\n ],\n})\nexport class ScrollingModule {}\n","import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { SubscriptionLike } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n *\n * @class BehaviorSubject<T>\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @deprecated This is an internal implementation detail, do not use. */\n _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n if (subscription && !(<SubscriptionLike>subscription).closed) {\n subscriber.next(this._value);\n }\n return subscription;\n }\n\n getValue(): T {\n if (this.hasError) {\n throw this.thrownError;\n } else if (this.closed) {\n throw new ObjectUnsubscribedError();\n } else {\n return this._value;\n }\n }\n\n next(value: T): void {\n super.next(this._value = value);\n }\n}\n","/* tslint:disable:no-empty */\nexport function noop() { }\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, PartialObserver, TeardownLogic } from '../types';\nimport { noop } from '../util/noop';\nimport { isFunction } from '../util/isFunction';\n\n/* tslint:disable:max-line-length */\n/** @deprecated Use an observer instead of a complete callback */\nexport function tap<T>(next: null | undefined, error: null | undefined, complete: () => void): MonoTypeOperatorFunction<T>;\n/** @deprecated Use an observer instead of an error callback */\nexport function tap<T>(next: null | undefined, error: (error: any) => void, complete?: () => void): MonoTypeOperatorFunction<T>;\n/** @deprecated Use an observer instead of a complete callback */\nexport function tap<T>(next: (value: T) => void, error: null | undefined, complete: () => void): MonoTypeOperatorFunction<T>;\nexport function tap<T>(next?: (x: T) => void, error?: (e: any) => void, complete?: () => void): MonoTypeOperatorFunction<T>;\nexport function tap<T>(observer: PartialObserver<T>): MonoTypeOperatorFunction<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Perform a side effect for every emission on the source Observable, but return\n * an Observable that is identical to the source.\n *\n * <span class=\"informal\">Intercepts each emission on the source and runs a\n * function, but returns an output which is identical to the source as long as errors don't occur.</span>\n *\n * \n *\n * Returns a mirrored Observable of the source Observable, but modified so that\n * the provided Observer is called to perform a side effect for every value,\n * error, and completion emitted by the source. Any errors that are thrown in\n * the aforementioned Observer or handlers are safely sent down the error path\n * of the output Observable.\n *\n * This operator is useful for debugging your Observables for the correct values\n * or performing other side effects.\n *\n * Note: this is different to a `subscribe` on the Observable. If the Observable\n * returned by `tap` is not subscribed, the side effects specified by the\n * Observer will never happen. `tap` therefore simply spies on existing\n * execution, it does not trigger an execution to happen like `subscribe` does.\n *\n * ## Example\n * Map every click to the clientX position of that click, while also logging the click event\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { tap, map } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const positions = clicks.pipe(\n * tap(ev => console.log(ev)),\n * map(ev => ev.clientX),\n * );\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n * @see {@link Observable#subscribe}\n *\n * @param {Observer|function} [nextOrObserver] A normal Observer object or a\n * callback for `next`.\n * @param {function} [error] Callback for errors in the source.\n * @param {function} [complete] Callback for the completion of the source.\n * @return {Observable} An Observable identical to the source, but runs the\n * specified Observer or callback(s) for each item.\n * @name tap\n */\nexport function tap<T>(nextOrObserver?: PartialObserver<T> | ((x: T) => void),\n error?: (e: any) => void,\n complete?: () => void): MonoTypeOperatorFunction<T> {\n return function tapOperatorFunction(source: Observable<T>): Observable<T> {\n return source.lift(new DoOperator(nextOrObserver, error, complete));\n };\n}\n\nclass DoOperator<T> implements Operator<T, T> {\n constructor(private nextOrObserver?: PartialObserver<T> | ((x: T) => void),\n private error?: (e: any) => void,\n private complete?: () => void) {\n }\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\n\nclass TapSubscriber<T> extends Subscriber<T> {\n private _context: any;\n\n private _tapNext: ((value: T) => void) = noop;\n\n private _tapError: ((err: any) => void) = noop;\n\n private _tapComplete: (() => void) = noop;\n\n constructor(destination: Subscriber<T>,\n observerOrNext?: PartialObserver<T> | ((value: T) => void),\n error?: (e?: any) => void,\n complete?: () => void) {\n super(destination);\n this._tapError = error || noop;\n this._tapComplete = complete || noop;\n if (isFunction(observerOrNext)) {\n this._context = this;\n this._tapNext = observerOrNext;\n } else if (observerOrNext) {\n this._context = observerOrNext;\n this._tapNext = observerOrNext.next || noop;\n this._tapError = observerOrNext.error || noop;\n this._tapComplete = observerOrNext.complete || noop;\n }\n }\n\n _next(value: T) {\n try {\n this._tapNext.call(this._context, value);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(value);\n }\n\n _error(err: any) {\n try {\n this._tapError.call(this._context, err);\n } catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.error(err);\n }\n\n _complete() {\n try {\n this._tapComplete.call(this._context, );\n } catch (err) {\n this.destination.error(err);\n return;\n }\n return this.destination.complete();\n }\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { async } from '../scheduler/async';\nimport { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';\n\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.</span>\n *\n * \n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link SchedulerLike} for\n * managing timers.\n *\n * ## Example\n * Emit the most recent click after a burst of clicks\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { debounceTime } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(debounceTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nexport function debounceTime<T>(dueTime: number, scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new DebounceTimeOperator(dueTime, scheduler));\n}\n\nclass DebounceTimeOperator<T> implements Operator<T, T> {\n constructor(private dueTime: number, private scheduler: SchedulerLike) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass DebounceTimeSubscriber<T> extends Subscriber<T> {\n private debouncedSubscription: Subscription = null;\n private lastValue: T = null;\n private hasValue: boolean = false;\n\n constructor(destination: Subscriber<T>,\n private dueTime: number,\n private scheduler: SchedulerLike) {\n super(destination);\n }\n\n protected _next(value: T) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n }\n\n protected _complete() {\n this.debouncedNext();\n this.destination.complete();\n }\n\n debouncedNext(): void {\n this.clearDebounce();\n\n if (this.hasValue) {\n const { lastValue } = this;\n // This must be done *before* passing the value\n // along to the destination because it's possible for\n // the value to synchronously re-enter this operator\n // recursively when scheduled with things like\n // VirtualScheduler/TestScheduler.\n this.lastValue = null;\n this.hasValue = false;\n this.destination.next(lastValue);\n }\n }\n\n private clearDebounce(): void {\n const debouncedSubscription = this.debouncedSubscription;\n\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n }\n}\n\nfunction dispatchNext(subscriber: DebounceTimeSubscriber<any>) {\n subscriber.debouncedNext();\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that skips the first `count` items emitted by the source Observable.\n *\n * \n *\n * @param {Number} count - The number of times, items emitted by source Observable should be skipped.\n * @return {Observable} An Observable that skips values emitted by the source Observable.\n *\n * @method skip\n * @owner Observable\n */\nexport function skip<T>(count: number): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SkipOperator(count));\n}\n\nclass SkipOperator<T> implements Operator<T, T> {\n constructor(private total: number) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SkipSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipSubscriber<T> extends Subscriber<T> {\n count: number = 0;\n\n constructor(destination: Subscriber<T>, private total: number) {\n super(destination);\n }\n\n protected _next(x: T) {\n if (++this.count > this.total) {\n this.destination.next(x);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n coerceBooleanProperty,\n coerceNumberProperty,\n coerceElement,\n BooleanInput,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<\n Element,\n {\n observer: MutationObserver | null;\n readonly stream: Subject<MutationRecord[]>;\n count: number;\n }\n >();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = coerceElement(elementOrRef);\n\n return new Observable((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') readonly event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number {\n return this._debounce;\n }\n set debounce(value: NumberInput) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(\n private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone,\n ) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription = (\n this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream\n ).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n this._currentSubscription?.unsubscribe();\n }\n}\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory],\n})\nexport class ObserversModule {}\n","import { Subscriber } from './Subscriber';\nimport { InnerSubscriber } from './InnerSubscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class OuterSubscriber<T, R> extends Subscriber<T> {\n notifyNext(outerValue: T, innerValue: R,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber<T, R>): void {\n this.destination.next(innerValue);\n }\n\n notifyError(error: any, innerSub: InnerSubscriber<T, R>): void {\n this.destination.error(error);\n }\n\n notifyComplete(innerSub: InnerSubscriber<T, R>): void {\n this.destination.complete();\n }\n}\n","import { Subscriber } from './Subscriber';\nimport { OuterSubscriber } from './OuterSubscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class InnerSubscriber<T, R> extends Subscriber<R> {\n private index = 0;\n\n constructor(private parent: OuterSubscriber<T, R>, public outerValue: T, public outerIndex: number) {\n super();\n }\n\n protected _next(value: R): void {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n }\n\n protected _error(error: any): void {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n }\n\n protected _complete(): void {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n }\n}\n","import { Subscription } from '../Subscription';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { Subscriber } from '../Subscriber';\nimport { subscribeTo } from './subscribeTo';\nimport { Observable } from '../Observable';\n\nexport function subscribeToResult<T, R>(\n outerSubscriber: OuterSubscriber<T, R>,\n result: any,\n outerValue: undefined,\n outerIndex: undefined,\n innerSubscriber: InnerSubscriber<T, R>\n): Subscription | undefined;\n\nexport function subscribeToResult<T, R>(\n outerSubscriber: OuterSubscriber<T, R>,\n result: any,\n outerValue?: T,\n outerIndex?: number\n): Subscription | undefined;\n\nexport function subscribeToResult<T, R>(\n outerSubscriber: OuterSubscriber<T, R>,\n result: any,\n outerValue?: T,\n outerIndex?: number,\n innerSubscriber: Subscriber<R> = new InnerSubscriber(outerSubscriber, outerValue, outerIndex)\n): Subscription | undefined {\n if (innerSubscriber.closed) {\n return undefined;\n }\n if (result instanceof Observable) {\n return result.subscribe(innerSubscriber);\n }\n return subscribeTo(result)(innerSubscriber) as Subscription;\n}\n","import { Observable } from '../Observable';\nimport { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';\nimport { isScheduler } from '../util/isScheduler';\nimport { isArray } from '../util/isArray';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { Operator } from '../Operator';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { fromArray } from './fromArray';\n\nconst NONE = {};\n\n/* tslint:disable:max-line-length */\n\n// If called with a single array, it \"auto-spreads\" the array, with result selector\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, R>(sources: [O1], resultSelector: (v1: ObservedValueOf<O1>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, R>(sources: [O1, O2], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(sources: [O1, O2, O3], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4, O5], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4, O5, O6], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O extends ObservableInput<any>, R>(sources: O[], resultSelector: (...args: ObservedValueOf<O>[]) => R, scheduler?: SchedulerLike): Observable<R>;\n\n// standard call, but with a result selector\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, R>(v1: O1, resultSelector: (v1: ObservedValueOf<O1>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, R>(v1: O1, v2: O2, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R, scheduler?: SchedulerLike): Observable<R>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R, scheduler?: SchedulerLike): Observable<R>;\n\n// With a scheduler (deprecated)\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O1 extends ObservableInput<any>>(sources: [O1], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(sources: [O1, O2], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(sources: [O1, O2, O3], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(sources: [O1, O2, O3, O4], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O extends ObservableInput<any>>(sources: O[], scheduler: SchedulerLike): Observable<ObservedValueOf<O>[]>;\n\n// Best case\nexport function combineLatest<O1 extends ObservableInput<any>>(sources: [O1]): Observable<[ObservedValueOf<O1>]>;\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(sources: [O1, O2]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(sources: [O1, O2, O3]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(sources: [O1, O2, O3, O4]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;\nexport function combineLatest<O extends ObservableInput<any>>(sources: O[]): Observable<ObservedValueOf<O>[]>;\n\n// Standard calls\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O1 extends ObservableInput<any>>(v1: O1, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;\n\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O extends ObservableInput<any>>(...observables: O[]): Observable<any[]>;\n\n/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */\nexport function combineLatest<O extends ObservableInput<any>, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;\n\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function combineLatest<O extends ObservableInput<any>, R>(array: O[], resultSelector: (...values: ObservedValueOf<O>[]) => R, scheduler?: SchedulerLike): Observable<R>;\n\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O extends ObservableInput<any>>(...observables: Array<O | SchedulerLike>): Observable<any[]>;\n\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<O extends ObservableInput<any>, R>(...observables: Array<O | ((...values: ObservedValueOf<O>[]) => R) | SchedulerLike>): Observable<R>;\n\n/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */\nexport function combineLatest<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R) | SchedulerLike>): Observable<R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Combines multiple Observables to create an Observable whose values are\n * calculated from the latest values of each of its input Observables.\n *\n * <span class=\"informal\">Whenever any input Observable emits a value, it\n * computes a formula using the latest values from all the inputs, then emits\n * the output of that formula.</span>\n *\n * \n *\n * `combineLatest` combines the values from all the Observables passed as\n * arguments. This is done by subscribing to each Observable in order and,\n * whenever any Observable emits, collecting an array of the most recent\n * values from each Observable. So if you pass `n` Observables to operator,\n * returned Observable will always emit an array of `n` values, in order\n * corresponding to order of passed Observables (value from the first Observable\n * on the first place and so on).\n *\n * Static version of `combineLatest` accepts either an array of Observables\n * or each Observable can be put directly as an argument. Note that array of\n * Observables is good choice, if you don't know beforehand how many Observables\n * you will combine. Passing empty array will result in Observable that\n * completes immediately.\n *\n * To ensure output array has always the same length, `combineLatest` will\n * actually wait for all input Observables to emit at least once,\n * before it starts emitting results. This means if some Observable emits\n * values before other Observables started emitting, all these values but the last\n * will be lost. On the other hand, if some Observable does not emit a value but\n * completes, resulting Observable will complete at the same moment without\n * emitting anything, since it will be now impossible to include value from\n * completed Observable in resulting array. Also, if some input Observable does\n * not emit any value and never completes, `combineLatest` will also never emit\n * and never complete, since, again, it will wait for all streams to emit some\n * value.\n *\n * If at least one Observable was passed to `combineLatest` and all passed Observables\n * emitted something, resulting Observable will complete when all combined\n * streams complete. So even if some Observable completes, result of\n * `combineLatest` will still emit values when other Observables do. In case\n * of completed Observable, its value from now on will always be the last\n * emitted value. On the other hand, if any Observable errors, `combineLatest`\n * will error immediately as well, and all other Observables will be unsubscribed.\n *\n * `combineLatest` accepts as optional parameter `project` function, which takes\n * as arguments all values that would normally be emitted by resulting Observable.\n * `project` can return any kind of value, which will be then emitted by Observable\n * instead of default array. Note that `project` does not take as argument that array\n * of values, but values themselves. That means default `project` can be imagined\n * as function that takes all its arguments and puts them into an array.\n *\n * ## Examples\n * ### Combine two timer Observables\n * ```ts\n * import { combineLatest, timer } from 'rxjs';\n *\n * const firstTimer = timer(0, 1000); // emit 0, 1, 2... after every second, starting from now\n * const secondTimer = timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now\n * const combinedTimers = combineLatest(firstTimer, secondTimer);\n * combinedTimers.subscribe(value => console.log(value));\n * // Logs\n * // [0, 0] after 0.5s\n * // [1, 0] after 1s\n * // [1, 1] after 1.5s\n * // [2, 1] after 2s\n * ```\n *\n * ### Combine an array of Observables\n * ```ts\n * import { combineLatest, of } from 'rxjs';\n * import { delay, starWith } from 'rxjs/operators';\n *\n * const observables = [1, 5, 10].map(\n * n => of(n).pipe(\n * delay(n * 1000), // emit 0 and then emit n after n seconds\n * startWith(0),\n * )\n * );\n * const combined = combineLatest(observables);\n * combined.subscribe(value => console.log(value));\n * // Logs\n * // [0, 0, 0] immediately\n * // [1, 0, 0] after 1s\n * // [1, 5, 0] after 5s\n * // [1, 5, 10] after 10s\n * ```\n *\n *\n * ### Use project function to dynamically calculate the Body-Mass Index\n * ```ts\n * import { combineLatest, of } from 'rxjs';\n * import { map } from 'rxjs/operators';\n *\n * const weight = of(70, 72, 76, 79, 75);\n * const height = of(1.76, 1.77, 1.78);\n * const bmi = combineLatest(weight, height).pipe(\n * map(([w, h]) => w / (h * h)),\n * );\n * bmi.subscribe(x => console.log('BMI is ' + x));\n *\n * // With output to console:\n * // BMI is 24.212293388429753\n * // BMI is 23.93948099205209\n * // BMI is 23.671253629592222\n * ```\n *\n * @see {@link combineAll}\n * @see {@link merge}\n * @see {@link withLatestFrom}\n *\n * @param {ObservableInput} observable1 An input Observable to combine with other Observables.\n * @param {ObservableInput} observable2 An input Observable to combine with other Observables.\n * More than one input Observables may be given as arguments\n * or an array of Observables may be given as the first argument.\n * @param {function} [project] An optional function to project the values from\n * the combined latest values into a new value on the output Observable.\n * @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for subscribing to\n * each input Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n */\nexport function combineLatest<O extends ObservableInput<any>, R>(\n ...observables: (O | ((...values: ObservedValueOf<O>[]) => R) | SchedulerLike)[]\n): Observable<R> {\n let resultSelector: ((...values: Array<any>) => R) | undefined = undefined;\n let scheduler: SchedulerLike|undefined = undefined;\n\n if (isScheduler(observables[observables.length - 1])) {\n scheduler = observables.pop() as SchedulerLike;\n }\n\n if (typeof observables[observables.length - 1] === 'function') {\n resultSelector = observables.pop() as (...values: Array<any>) => R;\n }\n\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], resultSelector)`\n if (observables.length === 1 && isArray(observables[0])) {\n observables = observables[0] as any;\n }\n\n return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));\n}\n\nexport class CombineLatestOperator<T, R> implements Operator<T, R> {\n constructor(private resultSelector?: (...values: Array<any>) => R) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class CombineLatestSubscriber<T, R> extends OuterSubscriber<T, R> {\n private active: number = 0;\n private values: any[] = [];\n private observables: any[] = [];\n private toRespond?: number;\n\n constructor(destination: Subscriber<R>, private resultSelector?: (...values: Array<any>) => R) {\n super(destination);\n }\n\n protected _next(observable: any) {\n this.values.push(NONE);\n this.observables.push(observable);\n }\n\n protected _complete() {\n const observables = this.observables;\n const len = observables.length;\n if (len === 0) {\n this.destination.complete!();\n } else {\n this.active = len;\n this.toRespond = len;\n for (let i = 0; i < len; i++) {\n const observable = observables[i];\n this.add(subscribeToResult(this, observable, undefined, i));\n }\n }\n }\n\n notifyComplete(unused: Subscriber<R>): void {\n if ((this.active -= 1) === 0) {\n this.destination.complete!();\n }\n }\n\n notifyNext(_outerValue: T, innerValue: R,\n outerIndex: number): void {\n const values = this.values;\n const oldVal = values[outerIndex];\n const toRespond = !this.toRespond\n ? 0\n : oldVal === NONE ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n\n if (toRespond === 0) {\n if (this.resultSelector) {\n this._tryResultSelector(values);\n } else {\n this.destination.next!(values.slice());\n }\n }\n }\n\n private _tryResultSelector(values: any[]) {\n let result: any;\n try {\n result = this.resultSelector!.apply(this, values);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.destination.next!(result);\n }\n}\n","export interface ArgumentOutOfRangeError extends Error {\n}\n\nexport interface ArgumentOutOfRangeErrorCtor {\n new(): ArgumentOutOfRangeError;\n}\n\nconst ArgumentOutOfRangeErrorImpl = (() => {\n function ArgumentOutOfRangeErrorImpl(this: any) {\n Error.call(this);\n this.message = 'argument out of range';\n this.name = 'ArgumentOutOfRangeError';\n return this;\n }\n\n ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);\n\n return ArgumentOutOfRangeErrorImpl;\n})();\n\n/**\n * An error thrown when an element was queried at a certain index of an\n * Observable, but no such index or position exists in that sequence.\n *\n * @see {@link elementAt}\n * @see {@link take}\n * @see {@link takeLast}\n *\n * @class ArgumentOutOfRangeError\n */\nexport const ArgumentOutOfRangeError: ArgumentOutOfRangeErrorCtor = ArgumentOutOfRangeErrorImpl as any;","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Emits only the first `count` values emitted by the source Observable.\n *\n * <span class=\"informal\">Takes the first `count` values from the source, then\n * completes.</span>\n *\n * \n *\n * `take` returns an Observable that emits only the first `count` values emitted\n * by the source Observable. If the source emits fewer than `count` values then\n * all of its values are emitted. After that, it completes, regardless if the\n * source completes.\n *\n * ## Example\n * Take the first 5 seconds of an infinite 1-second interval Observable\n * ```ts\n * import { interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const intervalCount = interval(1000);\n * const takeFive = intervalCount.pipe(take(5));\n * takeFive.subscribe(x => console.log(x));\n *\n * // Logs:\n * // 0\n * // 1\n * // 2\n * // 3\n * // 4\n * ```\n *\n * @see {@link takeLast}\n * @see {@link takeUntil}\n * @see {@link takeWhile}\n * @see {@link skip}\n *\n * @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an\n * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.\n *\n * @param {number} count The maximum number of `next` values to emit.\n * @return {Observable<T>} An Observable that emits only the first `count`\n * values emitted by the source Observable, or all of the values from the source\n * if the source emits fewer than `count` values.\n * @method take\n * @owner Observable\n */\nexport function take<T>(count: number): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => {\n if (count === 0) {\n return empty();\n } else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\n\nclass TakeOperator<T> implements Operator<T, T> {\n constructor(private total: number) {\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass TakeSubscriber<T> extends Subscriber<T> {\n private count: number = 0;\n\n constructor(destination: Subscriber<T>, private total: number) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const total = this.total;\n const count = ++this.count;\n if (count <= total) {\n this.destination.next(value);\n if (count === total) {\n this.destination.complete();\n this.unsubscribe();\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private _platform: Platform) {\n this._matchMedia =\n this._platform.isBrowser && window.matchMedia\n ? // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window)\n : noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {},\n } as any;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceArray} from '@angular/cdk/coercion';\nimport {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {combineLatest, concat, Observable, Observer, Subject} from 'rxjs';\nimport {debounceTime, map, skip, startWith, take, takeUntil} from 'rxjs/operators';\nimport {MediaMatcher} from './media-matcher';\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private readonly _destroySubject = new Subject<void>();\n\n constructor(private _mediaMatcher: MediaMatcher, private _zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | readonly string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | readonly string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n let stateObservable = combineLatest(observables);\n // Emit the first state immediately, and then debounce the subsequent emissions.\n stateObservable = concat(\n stateObservable.pipe(take(1)),\n stateObservable.pipe(skip(1), debounceTime(0)),\n );\n return stateObservable.pipe(\n map(breakpointStates => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach(({matches, query}) => {\n response.matches = response.matches || matches;\n response.breakpoints[query] = matches;\n });\n return response;\n }),\n );\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql = this._mediaMatcher.matchMedia(query);\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = new Observable((observer: Observer<MediaQueryListEvent>) => {\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n const handler = (e: MediaQueryListEvent): void => this._zone.run(() => observer.next(e));\n mql.addListener(handler);\n\n return () => {\n mql.removeListener(handler);\n };\n }).pipe(\n startWith(mql),\n map(({matches}) => ({query, matches})),\n takeUntil(this._destroySubject),\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: readonly string[]): readonly string[] {\n return queries\n .map(query => query.split(','))\n .reduce((a1, a2) => a1.concat(a2))\n .map(query => query.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */\nexport function isFakeMousedownFromScreenReader(event: MouseEvent): boolean {\n // Some screen readers will dispatch a fake `mousedown` event when pressing enter or space on\n // a clickable element. We can distinguish these events when both `offsetX` and `offsetY` are\n // zero or `event.buttons` is zero, depending on the browser:\n // - `event.buttons` works on Firefox, but fails on Chrome.\n // - `offsetX` and `offsetY` work on Chrome, but fail on Firefox.\n // Note that there's an edge case where the user could click the 0x0 spot of the\n // screen themselves, but that is unlikely to contain interactive elements.\n return event.buttons === 0 || (event.offsetX === 0 && event.offsetY === 0);\n}\n\n/** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */\nexport function isFakeTouchstartFromScreenReader(event: TouchEvent): boolean {\n const touch: Touch | undefined =\n (event.touches && event.touches[0]) || (event.changedTouches && event.changedTouches[0]);\n\n // A fake `touchstart` can be distinguished from a real one by looking at the `identifier`\n // which is typically >= 0 on a real device versus -1 from a screen reader. Just to be safe,\n // we can also look at `radiusX` and `radiusY`. This behavior was observed against a Windows 10\n // device with a touch screen running NVDA v2020.4 and Firefox 85 or Chrome 88.\n return (\n !!touch &&\n touch.identifier === -1 &&\n (touch.radiusX == null || touch.radiusX === 1) &&\n (touch.radiusY == null || touch.radiusY === 1)\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ALT, CONTROL, MAC_META, META, SHIFT} from '@angular/cdk/keycodes';\nimport {Inject, Injectable, InjectionToken, OnDestroy, Optional, NgZone} from '@angular/core';\nimport {normalizePassiveListenerOptions, Platform, _getEventTarget} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {distinctUntilChanged, skip} from 'rxjs/operators';\nimport {\n isFakeMousedownFromScreenReader,\n isFakeTouchstartFromScreenReader,\n} from '../fake-event-detection';\n\n/**\n * The input modalities detected by this service. Null is used if the input modality is unknown.\n */\nexport type InputModality = 'keyboard' | 'mouse' | 'touch' | null;\n\n/** Options to configure the behavior of the InputModalityDetector. */\nexport interface InputModalityDetectorOptions {\n /** Keys to ignore when detecting keyboard input modality. */\n ignoreKeys?: number[];\n}\n\n/**\n * Injectable options for the InputModalityDetector. These are shallowly merged with the default\n * options.\n */\nexport const INPUT_MODALITY_DETECTOR_OPTIONS = new InjectionToken<InputModalityDetectorOptions>(\n 'cdk-input-modality-detector-options',\n);\n\n/**\n * Default options for the InputModalityDetector.\n *\n * Modifier keys are ignored by default (i.e. when pressed won't cause the service to detect\n * keyboard input modality) for two reasons:\n *\n * 1. Modifier keys are commonly used with mouse to perform actions such as 'right click' or 'open\n * in new tab', and are thus less representative of actual keyboard interaction.\n * 2. VoiceOver triggers some keyboard events when linearly navigating with Control + Option (but\n * confusingly not with Caps Lock). Thus, to have parity with other screen readers, we ignore\n * these keys so as to not update the input modality.\n *\n * Note that we do not by default ignore the right Meta key on Safari because it has the same key\n * code as the ContextMenu key on other browsers. When we switch to using event.key, we can\n * distinguish between the two.\n */\nexport const INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS: InputModalityDetectorOptions = {\n ignoreKeys: [ALT, CONTROL, MAC_META, META, SHIFT],\n};\n\n/**\n * The amount of time needed to pass after a touchstart event in order for a subsequent mousedown\n * event to be attributed as mouse and not touch.\n *\n * This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found\n * that a value of around 650ms seems appropriate.\n */\nexport const TOUCH_BUFFER_MS = 650;\n\n/**\n * Event listener options that enable capturing and also mark the listener as passive if the browser\n * supports it.\n */\nconst modalityEventListenerOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n\n/**\n * Service that detects the user's input modality.\n *\n * This service does not update the input modality when a user navigates with a screen reader\n * (e.g. linear navigation with VoiceOver, object navigation / browse mode with NVDA, virtual PC\n * cursor mode with JAWS). This is in part due to technical limitations (i.e. keyboard events do not\n * fire as expected in these modes) but is also arguably the correct behavior. Navigating with a\n * screen reader is akin to visually scanning a page, and should not be interpreted as actual user\n * input interaction.\n *\n * When a user is not navigating but *interacting* with a screen reader, this service attempts to\n * update the input modality to keyboard, but in general this service's behavior is largely\n * undefined.\n */\n@Injectable({providedIn: 'root'})\nexport class InputModalityDetector implements OnDestroy {\n /** Emits whenever an input modality is detected. */\n readonly modalityDetected: Observable<InputModality>;\n\n /** Emits when the input modality changes. */\n readonly modalityChanged: Observable<InputModality>;\n\n /** The most recently detected input modality. */\n get mostRecentModality(): InputModality {\n return this._modality.value;\n }\n\n /**\n * The most recently detected input modality event target. Is null if no input modality has been\n * detected or if the associated event target is null for some unknown reason.\n */\n _mostRecentTarget: HTMLElement | null = null;\n\n /** The underlying BehaviorSubject that emits whenever an input modality is detected. */\n private readonly _modality = new BehaviorSubject<InputModality>(null);\n\n /** Options for this InputModalityDetector. */\n private readonly _options: InputModalityDetectorOptions;\n\n /**\n * The timestamp of the last touch input modality. Used to determine whether mousedown events\n * should be attributed to mouse or touch.\n */\n private _lastTouchMs = 0;\n\n /**\n * Handles keydown events. Must be an arrow function in order to preserve the context when it gets\n * bound.\n */\n private _onKeydown = (event: KeyboardEvent) => {\n // If this is one of the keys we should ignore, then ignore it and don't update the input\n // modality to keyboard.\n if (this._options?.ignoreKeys?.some(keyCode => keyCode === event.keyCode)) {\n return;\n }\n\n this._modality.next('keyboard');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n /**\n * Handles mousedown events. Must be an arrow function in order to preserve the context when it\n * gets bound.\n */\n private _onMousedown = (event: MouseEvent) => {\n // Touches trigger both touch and mouse events, so we need to distinguish between mouse events\n // that were triggered via mouse vs touch. To do so, check if the mouse event occurs closely\n // after the previous touch event.\n if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) {\n return;\n }\n\n // Fake mousedown events are fired by some screen readers when controls are activated by the\n // screen reader. Attribute them to keyboard input modality.\n this._modality.next(isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n /**\n * Handles touchstart events. Must be an arrow function in order to preserve the context when it\n * gets bound.\n */\n private _onTouchstart = (event: TouchEvent) => {\n // Same scenario as mentioned in _onMousedown, but on touch screen devices, fake touchstart\n // events are fired. Again, attribute to keyboard input modality.\n if (isFakeTouchstartFromScreenReader(event)) {\n this._modality.next('keyboard');\n return;\n }\n\n // Store the timestamp of this touch event, as it's used to distinguish between mouse events\n // triggered via mouse vs touch.\n this._lastTouchMs = Date.now();\n\n this._modality.next('touch');\n this._mostRecentTarget = _getEventTarget(event);\n };\n\n constructor(\n private readonly _platform: Platform,\n ngZone: NgZone,\n @Inject(DOCUMENT) document: Document,\n @Optional()\n @Inject(INPUT_MODALITY_DETECTOR_OPTIONS)\n options?: InputModalityDetectorOptions,\n ) {\n this._options = {\n ...INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS,\n ...options,\n };\n\n // Skip the first emission as it's null.\n this.modalityDetected = this._modality.pipe(skip(1));\n this.modalityChanged = this.modalityDetected.pipe(distinctUntilChanged());\n\n // If we're not in a browser, this service should do nothing, as there's no relevant input\n // modality to detect.\n if (_platform.isBrowser) {\n ngZone.runOutsideAngular(() => {\n document.addEventListener('keydown', this._onKeydown, modalityEventListenerOptions);\n document.addEventListener('mousedown', this._onMousedown, modalityEventListenerOptions);\n document.addEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions);\n });\n }\n }\n\n ngOnDestroy() {\n this._modality.complete();\n\n if (this._platform.isBrowser) {\n document.removeEventListener('keydown', this._onKeydown, modalityEventListenerOptions);\n document.removeEventListener('mousedown', this._onMousedown, modalityEventListenerOptions);\n document.removeEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const MAC_ENTER = 3;\nexport const BACKSPACE = 8;\nexport const TAB = 9;\nexport const NUM_CENTER = 12;\nexport const ENTER = 13;\nexport const SHIFT = 16;\nexport const CONTROL = 17;\nexport const ALT = 18;\nexport const PAUSE = 19;\nexport const CAPS_LOCK = 20;\nexport const ESCAPE = 27;\nexport const SPACE = 32;\nexport const PAGE_UP = 33;\nexport const PAGE_DOWN = 34;\nexport const END = 35;\nexport const HOME = 36;\nexport const LEFT_ARROW = 37;\nexport const UP_ARROW = 38;\nexport const RIGHT_ARROW = 39;\nexport const DOWN_ARROW = 40;\nexport const PLUS_SIGN = 43;\nexport const PRINT_SCREEN = 44;\nexport const INSERT = 45;\nexport const DELETE = 46;\nexport const ZERO = 48;\nexport const ONE = 49;\nexport const TWO = 50;\nexport const THREE = 51;\nexport const FOUR = 52;\nexport const FIVE = 53;\nexport const SIX = 54;\nexport const SEVEN = 55;\nexport const EIGHT = 56;\nexport const NINE = 57;\nexport const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186\nexport const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187\nexport const QUESTION_MARK = 63;\nexport const AT_SIGN = 64;\nexport const A = 65;\nexport const B = 66;\nexport const C = 67;\nexport const D = 68;\nexport const E = 69;\nexport const F = 70;\nexport const G = 71;\nexport const H = 72;\nexport const I = 73;\nexport const J = 74;\nexport const K = 75;\nexport const L = 76;\nexport const M = 77;\nexport const N = 78;\nexport const O = 79;\nexport const P = 80;\nexport const Q = 81;\nexport const R = 82;\nexport const S = 83;\nexport const T = 84;\nexport const U = 85;\nexport const V = 86;\nexport const W = 87;\nexport const X = 88;\nexport const Y = 89;\nexport const Z = 90;\nexport const META = 91; // WIN_KEY_LEFT\nexport const MAC_WK_CMD_LEFT = 91;\nexport const MAC_WK_CMD_RIGHT = 93;\nexport const CONTEXT_MENU = 93;\nexport const NUMPAD_ZERO = 96;\nexport const NUMPAD_ONE = 97;\nexport const NUMPAD_TWO = 98;\nexport const NUMPAD_THREE = 99;\nexport const NUMPAD_FOUR = 100;\nexport const NUMPAD_FIVE = 101;\nexport const NUMPAD_SIX = 102;\nexport const NUMPAD_SEVEN = 103;\nexport const NUMPAD_EIGHT = 104;\nexport const NUMPAD_NINE = 105;\nexport const NUMPAD_MULTIPLY = 106;\nexport const NUMPAD_PLUS = 107;\nexport const NUMPAD_MINUS = 109;\nexport const NUMPAD_PERIOD = 110;\nexport const NUMPAD_DIVIDE = 111;\nexport const F1 = 112;\nexport const F2 = 113;\nexport const F3 = 114;\nexport const F4 = 115;\nexport const F5 = 116;\nexport const F6 = 117;\nexport const F7 = 118;\nexport const F8 = 119;\nexport const F9 = 120;\nexport const F10 = 121;\nexport const F11 = 122;\nexport const F12 = 123;\nexport const NUM_LOCK = 144;\nexport const SCROLL_LOCK = 145;\nexport const FIRST_MEDIA = 166;\nexport const FF_MINUS = 173;\nexport const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE\nexport const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN\nexport const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP\nexport const FF_MUTE = 181;\nexport const FF_VOLUME_DOWN = 182;\nexport const LAST_MEDIA = 183;\nexport const FF_VOLUME_UP = 183;\nexport const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON\nexport const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS\nexport const COMMA = 188;\nexport const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS\nexport const PERIOD = 190;\nexport const SLASH = 191;\nexport const APOSTROPHE = 192;\nexport const TILDE = 192;\nexport const OPEN_SQUARE_BRACKET = 219;\nexport const BACKSLASH = 220;\nexport const CLOSE_SQUARE_BRACKET = 221;\nexport const SINGLE_QUOTE = 222;\nexport const MAC_META = 224;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, OnDestroy, APP_ID, inject} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {addAriaReferencedId, getAriaReferenceIds, removeAriaReferencedId} from './aria-reference';\n\n/**\n * Interface used to register message elements and keep a count of how many registrations have\n * the same message and the reference to the message element used for the `aria-describedby`.\n */\nexport interface RegisteredMessage {\n /** The element containing the message. */\n messageElement: Element;\n\n /** The number of elements that reference this message element via `aria-describedby`. */\n referenceCount: number;\n}\n\n/**\n * ID used for the body container where all messages are appended.\n * @deprecated No longer being used. To be removed.\n * @breaking-change 14.0.0\n */\nexport const MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container';\n\n/**\n * ID prefix used for each created message element.\n * @deprecated To be turned into a private variable.\n * @breaking-change 14.0.0\n */\nexport const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message';\n\n/**\n * Attribute given to each host element that is described by a message element.\n * @deprecated To be turned into a private variable.\n * @breaking-change 14.0.0\n */\nexport const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host';\n\n/** Global incremental identifier for each registered message element. */\nlet nextId = 0;\n\n/**\n * Utility that creates visually hidden elements with a message content. Useful for elements that\n * want to use aria-describedby to further describe themselves without adding additional visual\n * content.\n */\n@Injectable({providedIn: 'root'})\nexport class AriaDescriber implements OnDestroy {\n private _document: Document;\n\n /** Map of all registered message elements that have been placed into the document. */\n private _messageRegistry = new Map<string | Element, RegisteredMessage>();\n\n /** Container for all registered messages. */\n private _messagesContainer: HTMLElement | null = null;\n\n /** Unique ID for the service. */\n private readonly _id = `${nextId++}`;\n\n constructor(\n @Inject(DOCUMENT) _document: any,\n /**\n * @deprecated To be turned into a required parameter.\n * @breaking-change 14.0.0\n */\n private _platform?: Platform,\n ) {\n this._document = _document;\n this._id = inject(APP_ID) + '-' + nextId++;\n }\n\n /**\n * Adds to the host element an aria-describedby reference to a hidden element that contains\n * the message. If the same message has already been registered, then it will reuse the created\n * message element.\n */\n describe(hostElement: Element, message: string, role?: string): void;\n\n /**\n * Adds to the host element an aria-describedby reference to an already-existing message element.\n */\n describe(hostElement: Element, message: HTMLElement): void;\n\n describe(hostElement: Element, message: string | HTMLElement, role?: string): void {\n if (!this._canBeDescribed(hostElement, message)) {\n return;\n }\n\n const key = getKey(message, role);\n\n if (typeof message !== 'string') {\n // We need to ensure that the element has an ID.\n setMessageId(message, this._id);\n this._messageRegistry.set(key, {messageElement: message, referenceCount: 0});\n } else if (!this._messageRegistry.has(key)) {\n this._createMessageElement(message, role);\n }\n\n if (!this._isElementDescribedByMessage(hostElement, key)) {\n this._addMessageReference(hostElement, key);\n }\n }\n\n /** Removes the host element's aria-describedby reference to the message. */\n removeDescription(hostElement: Element, message: string, role?: string): void;\n\n /** Removes the host element's aria-describedby reference to the message element. */\n removeDescription(hostElement: Element, message: HTMLElement): void;\n\n removeDescription(hostElement: Element, message: string | HTMLElement, role?: string): void {\n if (!message || !this._isElementNode(hostElement)) {\n return;\n }\n\n const key = getKey(message, role);\n\n if (this._isElementDescribedByMessage(hostElement, key)) {\n this._removeMessageReference(hostElement, key);\n }\n\n // If the message is a string, it means that it's one that we created for the\n // consumer so we can remove it safely, otherwise we should leave it in place.\n if (typeof message === 'string') {\n const registeredMessage = this._messageRegistry.get(key);\n if (registeredMessage && registeredMessage.referenceCount === 0) {\n this._deleteMessageElement(key);\n }\n }\n\n if (this._messagesContainer?.childNodes.length === 0) {\n this._messagesContainer.remove();\n this._messagesContainer = null;\n }\n }\n\n /** Unregisters all created message elements and removes the message container. */\n ngOnDestroy() {\n const describedElements = this._document.querySelectorAll(\n `[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}=\"${this._id}\"]`,\n );\n\n for (let i = 0; i < describedElements.length; i++) {\n this._removeCdkDescribedByReferenceIds(describedElements[i]);\n describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);\n }\n\n this._messagesContainer?.remove();\n this._messagesContainer = null;\n this._messageRegistry.clear();\n }\n\n /**\n * Creates a new element in the visually hidden message container element with the message\n * as its content and adds it to the message registry.\n */\n private _createMessageElement(message: string, role?: string) {\n const messageElement = this._document.createElement('div');\n setMessageId(messageElement, this._id);\n messageElement.textContent = message;\n\n if (role) {\n messageElement.setAttribute('role', role);\n }\n\n this._createMessagesContainer();\n this._messagesContainer!.appendChild(messageElement);\n this._messageRegistry.set(getKey(message, role), {messageElement, referenceCount: 0});\n }\n\n /** Deletes the message element from the global messages container. */\n private _deleteMessageElement(key: string | Element) {\n this._messageRegistry.get(key)?.messageElement?.remove();\n this._messageRegistry.delete(key);\n }\n\n /** Creates the global container for all aria-describedby messages. */\n private _createMessagesContainer() {\n if (this._messagesContainer) {\n return;\n }\n\n const containerClassName = 'cdk-describedby-message-container';\n const serverContainers = this._document.querySelectorAll(\n `.${containerClassName}[platform=\"server\"]`,\n );\n\n for (let i = 0; i < serverContainers.length; i++) {\n // When going from the server to the client, we may end up in a situation where there's\n // already a container on the page, but we don't have a reference to it. Clear the\n // old container so we don't get duplicates. Doing this, instead of emptying the previous\n // container, should be slightly faster.\n serverContainers[i].remove();\n }\n\n const messagesContainer = this._document.createElement('div');\n\n // We add `visibility: hidden` in order to prevent text in this container from\n // being searchable by the browser's Ctrl + F functionality.\n // Screen-readers will still read the description for elements with aria-describedby even\n // when the description element is not visible.\n messagesContainer.style.visibility = 'hidden';\n // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that\n // the description element doesn't impact page layout.\n messagesContainer.classList.add(containerClassName);\n messagesContainer.classList.add('cdk-visually-hidden');\n\n // @breaking-change 14.0.0 Remove null check for `_platform`.\n if (this._platform && !this._platform.isBrowser) {\n messagesContainer.setAttribute('platform', 'server');\n }\n\n this._document.body.appendChild(messagesContainer);\n this._messagesContainer = messagesContainer;\n }\n\n /** Removes all cdk-describedby messages that are hosted through the element. */\n private _removeCdkDescribedByReferenceIds(element: Element) {\n // Remove all aria-describedby reference IDs that are prefixed by CDK_DESCRIBEDBY_ID_PREFIX\n const originalReferenceIds = getAriaReferenceIds(element, 'aria-describedby').filter(\n id => id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0,\n );\n element.setAttribute('aria-describedby', originalReferenceIds.join(' '));\n }\n\n /**\n * Adds a message reference to the element using aria-describedby and increments the registered\n * message's reference count.\n */\n private _addMessageReference(element: Element, key: string | Element) {\n const registeredMessage = this._messageRegistry.get(key)!;\n\n // Add the aria-describedby reference and set the\n // describedby_host attribute to mark the element.\n addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);\n element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id);\n registeredMessage.referenceCount++;\n }\n\n /**\n * Removes a message reference from the element using aria-describedby\n * and decrements the registered message's reference count.\n */\n private _removeMessageReference(element: Element, key: string | Element) {\n const registeredMessage = this._messageRegistry.get(key)!;\n registeredMessage.referenceCount--;\n\n removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);\n element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);\n }\n\n /** Returns true if the element has been described by the provided message ID. */\n private _isElementDescribedByMessage(element: Element, key: string | Element): boolean {\n const referenceIds = getAriaReferenceIds(element, 'aria-describedby');\n const registeredMessage = this._messageRegistry.get(key);\n const messageId = registeredMessage && registeredMessage.messageElement.id;\n\n return !!messageId && referenceIds.indexOf(messageId) != -1;\n }\n\n /** Determines whether a message can be described on a particular element. */\n private _canBeDescribed(element: Element, message: string | HTMLElement | void): boolean {\n if (!this._isElementNode(element)) {\n return false;\n }\n\n if (message && typeof message === 'object') {\n // We'd have to make some assumptions about the description element's text, if the consumer\n // passed in an element. Assume that if an element is passed in, the consumer has verified\n // that it can be used as a description.\n return true;\n }\n\n const trimmedMessage = message == null ? '' : `${message}`.trim();\n const ariaLabel = element.getAttribute('aria-label');\n\n // We shouldn't set descriptions if they're exactly the same as the `aria-label` of the\n // element, because screen readers will end up reading out the same text twice in a row.\n return trimmedMessage ? !ariaLabel || ariaLabel.trim() !== trimmedMessage : false;\n }\n\n /** Checks whether a node is an Element node. */\n private _isElementNode(element: Node): element is Element {\n return element.nodeType === this._document.ELEMENT_NODE;\n }\n}\n\n/** Gets a key that can be used to look messages up in the registry. */\nfunction getKey(message: string | Element, role?: string): string | Element {\n return typeof message === 'string' ? `${role || ''}/${message}` : message;\n}\n\n/** Assigns a unique ID to an element, if it doesn't have one already. */\nfunction setMessageId(element: HTMLElement, serviceId: string) {\n if (!element.id) {\n element.id = `${CDK_DESCRIBEDBY_ID_PREFIX}-${serviceId}-${nextId++}`;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n Platform,\n normalizePassiveListenerOptions,\n _getShadowRoot,\n _getEventTarget,\n} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n Injectable,\n InjectionToken,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n AfterViewInit,\n} from '@angular/core';\nimport {Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {InputModalityDetector, TOUCH_BUFFER_MS} from '../input-modality/input-modality-detector';\n\nexport type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;\n\n/**\n * Corresponds to the options that can be passed to the native `focus` event.\n * via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus\n */\nexport interface FocusOptions {\n /** Whether the browser should scroll to the element when it is focused. */\n preventScroll?: boolean;\n}\n\n/** Detection mode used for attributing the origin of a focus event. */\nexport const enum FocusMonitorDetectionMode {\n /**\n * Any mousedown, keydown, or touchstart event that happened in the previous\n * tick or the current tick will be used to assign a focus event's origin (to\n * either mouse, keyboard, or touch). This is the default option.\n */\n IMMEDIATE,\n /**\n * A focus event's origin is always attributed to the last corresponding\n * mousedown, keydown, or touchstart event, no matter how long ago it occurred.\n */\n EVENTUAL,\n}\n\n/** Injectable service-level options for FocusMonitor. */\nexport interface FocusMonitorOptions {\n detectionMode?: FocusMonitorDetectionMode;\n}\n\n/** InjectionToken for FocusMonitorOptions. */\nexport const FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken<FocusMonitorOptions>(\n 'cdk-focus-monitor-default-options',\n);\n\ntype MonitoredElementInfo = {\n checkChildren: boolean;\n readonly subject: Subject<FocusOrigin>;\n rootNode: HTMLElement | ShadowRoot | Document;\n};\n\n/**\n * Event listener options that enable capturing and also\n * mark the listener as passive if the browser supports it.\n */\nconst captureEventListenerOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n\n/** Monitors mouse and keyboard events to determine the cause of focus events. */\n@Injectable({providedIn: 'root'})\nexport class FocusMonitor implements OnDestroy {\n /** The focus origin that the next focus event is a result of. */\n private _origin: FocusOrigin = null;\n\n /** The FocusOrigin of the last focus event tracked by the FocusMonitor. */\n private _lastFocusOrigin: FocusOrigin;\n\n /** Whether the window has just been focused. */\n private _windowFocused = false;\n\n /** The timeout id of the window focus timeout. */\n private _windowFocusTimeoutId: number;\n\n /** The timeout id of the origin clearing timeout. */\n private _originTimeoutId: number;\n\n /**\n * Whether the origin was determined via a touch interaction. Necessary as properly attributing\n * focus events to touch interactions requires special logic.\n */\n private _originFromTouchInteraction = false;\n\n /** Map of elements being monitored to their info. */\n private _elementInfo = new Map<HTMLElement, MonitoredElementInfo>();\n\n /** The number of elements currently being monitored. */\n private _monitoredElementCount = 0;\n\n /**\n * Keeps track of the root nodes to which we've currently bound a focus/blur handler,\n * as well as the number of monitored elements that they contain. We have to treat focus/blur\n * handlers differently from the rest of the events, because the browser won't emit events\n * to the document when focus moves inside of a shadow root.\n */\n private _rootNodeFocusListenerCount = new Map<HTMLElement | Document | ShadowRoot, number>();\n\n /**\n * The specified detection mode, used for attributing the origin of a focus\n * event.\n */\n private readonly _detectionMode: FocusMonitorDetectionMode;\n\n /**\n * Event listener for `focus` events on the window.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _windowFocusListener = () => {\n // Make a note of when the window regains focus, so we can\n // restore the origin info for the focused element.\n this._windowFocused = true;\n this._windowFocusTimeoutId = window.setTimeout(() => (this._windowFocused = false));\n };\n\n /** Used to reference correct document/window */\n protected _document?: Document;\n\n /** Subject for stopping our InputModalityDetector subscription. */\n private readonly _stopInputModalityDetector = new Subject<void>();\n\n constructor(\n private _ngZone: NgZone,\n private _platform: Platform,\n private readonly _inputModalityDetector: InputModalityDetector,\n /** @breaking-change 11.0.0 make document required */\n @Optional() @Inject(DOCUMENT) document: any | null,\n @Optional() @Inject(FOCUS_MONITOR_DEFAULT_OPTIONS) options: FocusMonitorOptions | null,\n ) {\n this._document = document;\n this._detectionMode = options?.detectionMode || FocusMonitorDetectionMode.IMMEDIATE;\n }\n /**\n * Event listener for `focus` and 'blur' events on the document.\n * Needs to be an arrow function in order to preserve the context when it gets bound.\n */\n private _rootNodeFocusAndBlurListener = (event: Event) => {\n const target = _getEventTarget<HTMLElement>(event);\n\n // We need to walk up the ancestor chain in order to support `checkChildren`.\n for (let element = target; element; element = element.parentElement) {\n if (event.type === 'focus') {\n this._onFocus(event as FocusEvent, element);\n } else {\n this._onBlur(event as FocusEvent, element);\n }\n }\n };\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>;\n\n /**\n * Monitors focus on an element and applies appropriate CSS classes.\n * @param element The element to monitor\n * @param checkChildren Whether to count the element as focused when its children are focused.\n * @returns An observable that emits when the focus state of the element changes.\n * When the element is blurred, null will be emitted.\n */\n monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>;\n\n monitor(\n element: HTMLElement | ElementRef<HTMLElement>,\n checkChildren: boolean = false,\n ): Observable<FocusOrigin> {\n const nativeElement = coerceElement(element);\n\n // Do nothing if we're not on the browser platform or the passed in node isn't an element.\n if (!this._platform.isBrowser || nativeElement.nodeType !== 1) {\n return observableOf(null);\n }\n\n // If the element is inside the shadow DOM, we need to bind our focus/blur listeners to\n // the shadow root, rather than the `document`, because the browser won't emit focus events\n // to the `document`, if focus is moving within the same shadow root.\n const rootNode = _getShadowRoot(nativeElement) || this._getDocument();\n const cachedInfo = this._elementInfo.get(nativeElement);\n\n // Check if we're already monitoring this element.\n if (cachedInfo) {\n if (checkChildren) {\n // TODO(COMP-318): this can be problematic, because it'll turn all non-checkChildren\n // observers into ones that behave as if `checkChildren` was turned on. We need a more\n // robust solution.\n cachedInfo.checkChildren = true;\n }\n\n return cachedInfo.subject;\n }\n\n // Create monitored element info.\n const info: MonitoredElementInfo = {\n checkChildren: checkChildren,\n subject: new Subject<FocusOrigin>(),\n rootNode,\n };\n this._elementInfo.set(nativeElement, info);\n this._registerGlobalListeners(info);\n\n return info.subject;\n }\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: HTMLElement): void;\n\n /**\n * Stops monitoring an element and removes all focus classes.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<HTMLElement>): void;\n\n stopMonitoring(element: HTMLElement | ElementRef<HTMLElement>): void {\n const nativeElement = coerceElement(element);\n const elementInfo = this._elementInfo.get(nativeElement);\n\n if (elementInfo) {\n elementInfo.subject.complete();\n\n this._setClasses(nativeElement);\n this._elementInfo.delete(nativeElement);\n this._removeGlobalListeners(elementInfo);\n }\n }\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions): void;\n\n /**\n * Focuses the element via the specified focus origin.\n * @param element Element to focus.\n * @param origin Focus origin.\n * @param options Options that can be used to configure the focus behavior.\n */\n focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions): void;\n\n focusVia(\n element: HTMLElement | ElementRef<HTMLElement>,\n origin: FocusOrigin,\n options?: FocusOptions,\n ): void {\n const nativeElement = coerceElement(element);\n const focusedElement = this._getDocument().activeElement;\n\n // If the element is focused already, calling `focus` again won't trigger the event listener\n // which means that the focus classes won't be updated. If that's the case, update the classes\n // directly without waiting for an event.\n if (nativeElement === focusedElement) {\n this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) =>\n this._originChanged(currentElement, origin, info),\n );\n } else {\n this._setOrigin(origin);\n\n // `focus` isn't available on the server\n if (typeof nativeElement.focus === 'function') {\n nativeElement.focus(options);\n }\n }\n }\n\n ngOnDestroy() {\n this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));\n }\n\n /** Access injected document if available or fallback to global document reference */\n private _getDocument(): Document {\n return this._document || document;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }\n\n private _getFocusOrigin(focusEventTarget: HTMLElement | null): FocusOrigin {\n if (this._origin) {\n // If the origin was realized via a touch interaction, we need to perform additional checks\n // to determine whether the focus origin should be attributed to touch or program.\n if (this._originFromTouchInteraction) {\n return this._shouldBeAttributedToTouch(focusEventTarget) ? 'touch' : 'program';\n } else {\n return this._origin;\n }\n }\n\n // If the window has just regained focus, we can restore the most recent origin from before the\n // window blurred. Otherwise, we've reached the point where we can't identify the source of the\n // focus. This typically means one of two things happened:\n //\n // 1) The element was programmatically focused, or\n // 2) The element was focused via screen reader navigation (which generally doesn't fire\n // events).\n //\n // Because we can't distinguish between these two cases, we default to setting `program`.\n if (this._windowFocused && this._lastFocusOrigin) {\n return this._lastFocusOrigin;\n }\n\n // If the interaction is coming from an input label, we consider it a mouse interactions.\n // This is a special case where focus moves on `click`, rather than `mousedown` which breaks\n // our detection, because all our assumptions are for `mousedown`. We need to handle this\n // special case, because it's very common for checkboxes and radio buttons.\n if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) {\n return 'mouse';\n }\n\n return 'program';\n }\n\n /**\n * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a\n * touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we\n * handle a focus event following a touch interaction, we need to determine whether (1) the focus\n * event was directly caused by the touch interaction or (2) the focus event was caused by a\n * subsequent programmatic focus call triggered by the touch interaction.\n * @param focusEventTarget The target of the focus event under examination.\n */\n private _shouldBeAttributedToTouch(focusEventTarget: HTMLElement | null): boolean {\n // Please note that this check is not perfect. Consider the following edge case:\n //\n // <div #parent tabindex=\"0\">\n // <div #child tabindex=\"0\" (click)=\"#parent.focus()\"></div>\n // </div>\n //\n // Suppose there is a FocusMonitor in IMMEDIATE mode attached to #parent. When the user touches\n // #child, #parent is programmatically focused. This code will attribute the focus to touch\n // instead of program. This is a relatively minor edge-case that can be worked around by using\n // focusVia(parent, 'program') to focus #parent.\n return (\n this._detectionMode === FocusMonitorDetectionMode.EVENTUAL ||\n !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget)\n );\n }\n\n /**\n * Sets the focus classes on the element based on the given focus origin.\n * @param element The element to update the classes on.\n * @param origin The focus origin.\n */\n private _setClasses(element: HTMLElement, origin?: FocusOrigin): void {\n element.classList.toggle('cdk-focused', !!origin);\n element.classList.toggle('cdk-touch-focused', origin === 'touch');\n element.classList.toggle('cdk-keyboard-focused', origin === 'keyboard');\n element.classList.toggle('cdk-mouse-focused', origin === 'mouse');\n element.classList.toggle('cdk-program-focused', origin === 'program');\n }\n\n /**\n * Updates the focus origin. If we're using immediate detection mode, we schedule an async\n * function to clear the origin at the end of a timeout. The duration of the timeout depends on\n * the origin being set.\n * @param origin The origin to set.\n * @param isFromInteraction Whether we are setting the origin from an interaction event.\n */\n private _setOrigin(origin: FocusOrigin, isFromInteraction = false): void {\n this._ngZone.runOutsideAngular(() => {\n this._origin = origin;\n this._originFromTouchInteraction = origin === 'touch' && isFromInteraction;\n\n // If we're in IMMEDIATE mode, reset the origin at the next tick (or in `TOUCH_BUFFER_MS` ms\n // for a touch event). We reset the origin at the next tick because Firefox focuses one tick\n // after the interaction event. We wait `TOUCH_BUFFER_MS` ms before resetting the origin for\n // a touch event because when a touch event is fired, the associated focus event isn't yet in\n // the event queue. Before doing so, clear any pending timeouts.\n if (this._detectionMode === FocusMonitorDetectionMode.IMMEDIATE) {\n clearTimeout(this._originTimeoutId);\n const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1;\n this._originTimeoutId = setTimeout(() => (this._origin = null), ms);\n }\n });\n }\n\n /**\n * Handles focus events on a registered element.\n * @param event The focus event.\n * @param element The monitored element.\n */\n private _onFocus(event: FocusEvent, element: HTMLElement) {\n // NOTE(mmalerba): We currently set the classes based on the focus origin of the most recent\n // focus event affecting the monitored element. If we want to use the origin of the first event\n // instead we should check for the cdk-focused class here and return if the element already has\n // it. (This only matters for elements that have includesChildren = true).\n\n // If we are not counting child-element-focus as focused, make sure that the event target is the\n // monitored element itself.\n const elementInfo = this._elementInfo.get(element);\n const focusEventTarget = _getEventTarget<HTMLElement>(event);\n if (!elementInfo || (!elementInfo.checkChildren && element !== focusEventTarget)) {\n return;\n }\n\n this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo);\n }\n\n /**\n * Handles blur events on a registered element.\n * @param event The blur event.\n * @param element The monitored element.\n */\n _onBlur(event: FocusEvent, element: HTMLElement) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n\n if (\n !elementInfo ||\n (elementInfo.checkChildren &&\n event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))\n ) {\n return;\n }\n\n this._setClasses(element);\n this._emitOrigin(elementInfo, null);\n }\n\n private _emitOrigin(info: MonitoredElementInfo, origin: FocusOrigin) {\n if (info.subject.observers.length) {\n this._ngZone.run(() => info.subject.next(origin));\n }\n }\n\n private _registerGlobalListeners(elementInfo: MonitoredElementInfo) {\n if (!this._platform.isBrowser) {\n return;\n }\n\n const rootNode = elementInfo.rootNode;\n const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;\n\n if (!rootNodeFocusListeners) {\n this._ngZone.runOutsideAngular(() => {\n rootNode.addEventListener(\n 'focus',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n rootNode.addEventListener(\n 'blur',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n });\n }\n\n this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);\n\n // Register global listeners when first element is monitored.\n if (++this._monitoredElementCount === 1) {\n // Note: we listen to events in the capture phase so we\n // can detect them even if the user stops propagation.\n this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n window.addEventListener('focus', this._windowFocusListener);\n });\n\n // The InputModalityDetector is also just a collection of global listeners.\n this._inputModalityDetector.modalityDetected\n .pipe(takeUntil(this._stopInputModalityDetector))\n .subscribe(modality => {\n this._setOrigin(modality, true /* isFromInteraction */);\n });\n }\n }\n\n private _removeGlobalListeners(elementInfo: MonitoredElementInfo) {\n const rootNode = elementInfo.rootNode;\n\n if (this._rootNodeFocusListenerCount.has(rootNode)) {\n const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode)!;\n\n if (rootNodeFocusListeners > 1) {\n this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);\n } else {\n rootNode.removeEventListener(\n 'focus',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n rootNode.removeEventListener(\n 'blur',\n this._rootNodeFocusAndBlurListener,\n captureEventListenerOptions,\n );\n this._rootNodeFocusListenerCount.delete(rootNode);\n }\n }\n\n // Unregister global listeners when last element is unmonitored.\n if (!--this._monitoredElementCount) {\n const window = this._getWindow();\n window.removeEventListener('focus', this._windowFocusListener);\n\n // Equivalently, stop our InputModalityDetector subscription.\n this._stopInputModalityDetector.next();\n\n // Clear timeouts for all potentially pending timeouts to prevent the leaks.\n clearTimeout(this._windowFocusTimeoutId);\n clearTimeout(this._originTimeoutId);\n }\n }\n\n /** Updates all the state on an element once its focus origin has changed. */\n private _originChanged(\n element: HTMLElement,\n origin: FocusOrigin,\n elementInfo: MonitoredElementInfo,\n ) {\n this._setClasses(element, origin);\n this._emitOrigin(elementInfo, origin);\n this._lastFocusOrigin = origin;\n }\n\n /**\n * Collects the `MonitoredElementInfo` of a particular element and\n * all of its ancestors that have enabled `checkChildren`.\n * @param element Element from which to start the search.\n */\n private _getClosestElementsInfo(element: HTMLElement): [HTMLElement, MonitoredElementInfo][] {\n const results: [HTMLElement, MonitoredElementInfo][] = [];\n\n this._elementInfo.forEach((info, currentElement) => {\n if (currentElement === element || (info.checkChildren && currentElement.contains(element))) {\n results.push([currentElement, info]);\n }\n });\n\n return results;\n }\n\n /**\n * Returns whether an interaction is likely to have come from the user clicking the `label` of\n * an `input` or `textarea` in order to focus it.\n * @param focusEventTarget Target currently receiving focus.\n */\n private _isLastInteractionFromInputLabel(focusEventTarget: HTMLElement): boolean {\n const {_mostRecentTarget: mostRecentTarget, mostRecentModality} = this._inputModalityDetector;\n\n // If the last interaction used the mouse on an element contained by one of the labels\n // of an `input`/`textarea` that is currently focused, it is very likely that the\n // user redirected focus using the label.\n if (\n mostRecentModality !== 'mouse' ||\n !mostRecentTarget ||\n mostRecentTarget === focusEventTarget ||\n (focusEventTarget.nodeName !== 'INPUT' && focusEventTarget.nodeName !== 'TEXTAREA') ||\n (focusEventTarget as HTMLInputElement | HTMLTextAreaElement).disabled\n ) {\n return false;\n }\n\n const labels = (focusEventTarget as HTMLInputElement | HTMLTextAreaElement).labels;\n\n if (labels) {\n for (let i = 0; i < labels.length; i++) {\n if (labels[i].contains(mostRecentTarget)) {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n\n/**\n * Directive that determines how a particular element was focused (via keyboard, mouse, touch, or\n * programmatically) and adds corresponding classes to the element.\n *\n * There are two variants of this directive:\n * 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is\n * focused.\n * 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused.\n */\n@Directive({\n selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',\n exportAs: 'cdkMonitorFocus',\n})\nexport class CdkMonitorFocus implements AfterViewInit, OnDestroy {\n private _monitorSubscription: Subscription;\n private _focusOrigin: FocusOrigin = null;\n\n @Output() readonly cdkFocusChange = new EventEmitter<FocusOrigin>();\n\n constructor(private _elementRef: ElementRef<HTMLElement>, private _focusMonitor: FocusMonitor) {}\n\n get focusOrigin(): FocusOrigin {\n return this._focusOrigin;\n }\n\n ngAfterViewInit() {\n const element = this._elementRef.nativeElement;\n this._monitorSubscription = this._focusMonitor\n .monitor(element, element.nodeType === 1 && element.hasAttribute('cdkMonitorSubtreeFocus'))\n .subscribe(origin => {\n this._focusOrigin = origin;\n this.cdkFocusChange.emit(origin);\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n\n if (this._monitorSubscription) {\n this._monitorSubscription.unsubscribe();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {inject, Inject, Injectable, OnDestroy} from '@angular/core';\nimport {BreakpointObserver} from '@angular/cdk/layout';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {Subscription} from 'rxjs';\n\n/** Set of possible high-contrast mode backgrounds. */\nexport const enum HighContrastMode {\n NONE,\n BLACK_ON_WHITE,\n WHITE_ON_BLACK,\n}\n\n/** CSS class applied to the document body when in black-on-white high-contrast mode. */\nexport const BLACK_ON_WHITE_CSS_CLASS = 'cdk-high-contrast-black-on-white';\n\n/** CSS class applied to the document body when in white-on-black high-contrast mode. */\nexport const WHITE_ON_BLACK_CSS_CLASS = 'cdk-high-contrast-white-on-black';\n\n/** CSS class applied to the document body when in high-contrast mode. */\nexport const HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS = 'cdk-high-contrast-active';\n\n/**\n * Service to determine whether the browser is currently in a high-contrast-mode environment.\n *\n * Microsoft Windows supports an accessibility feature called \"High Contrast Mode\". This mode\n * changes the appearance of all applications, including web applications, to dramatically increase\n * contrast.\n *\n * IE, Edge, and Firefox currently support this mode. Chrome does not support Windows High Contrast\n * Mode. This service does not detect high-contrast mode as added by the Chrome \"High Contrast\"\n * browser extension.\n */\n@Injectable({providedIn: 'root'})\nexport class HighContrastModeDetector implements OnDestroy {\n /**\n * Figuring out the high contrast mode and adding the body classes can cause\n * some expensive layouts. This flag is used to ensure that we only do it once.\n */\n private _hasCheckedHighContrastMode: boolean;\n private _document: Document;\n private _breakpointSubscription: Subscription;\n\n constructor(private _platform: Platform, @Inject(DOCUMENT) document: any) {\n this._document = document;\n\n this._breakpointSubscription = inject(BreakpointObserver)\n .observe('(forced-colors: active)')\n .subscribe(() => {\n if (this._hasCheckedHighContrastMode) {\n this._hasCheckedHighContrastMode = false;\n this._applyBodyHighContrastModeCssClasses();\n }\n });\n }\n\n /** Gets the current high-contrast-mode for the page. */\n getHighContrastMode(): HighContrastMode {\n if (!this._platform.isBrowser) {\n return HighContrastMode.NONE;\n }\n\n // Create a test element with an arbitrary background-color that is neither black nor\n // white; high-contrast mode will coerce the color to either black or white. Also ensure that\n // appending the test element to the DOM does not affect layout by absolutely positioning it\n const testElement = this._document.createElement('div');\n testElement.style.backgroundColor = 'rgb(1,2,3)';\n testElement.style.position = 'absolute';\n this._document.body.appendChild(testElement);\n\n // Get the computed style for the background color, collapsing spaces to normalize between\n // browsers. Once we get this color, we no longer need the test element. Access the `window`\n // via the document so we can fake it in tests. Note that we have extra null checks, because\n // this logic will likely run during app bootstrap and throwing can break the entire app.\n const documentWindow = this._document.defaultView || window;\n const computedStyle =\n documentWindow && documentWindow.getComputedStyle\n ? documentWindow.getComputedStyle(testElement)\n : null;\n const computedColor = ((computedStyle && computedStyle.backgroundColor) || '').replace(\n / /g,\n '',\n );\n testElement.remove();\n\n switch (computedColor) {\n // Pre Windows 11 dark theme.\n case 'rgb(0,0,0)':\n // Windows 11 dark themes.\n case 'rgb(45,50,54)':\n case 'rgb(32,32,32)':\n return HighContrastMode.WHITE_ON_BLACK;\n // Pre Windows 11 light theme.\n case 'rgb(255,255,255)':\n // Windows 11 light theme.\n case 'rgb(255,250,239)':\n return HighContrastMode.BLACK_ON_WHITE;\n }\n return HighContrastMode.NONE;\n }\n\n ngOnDestroy(): void {\n this._breakpointSubscription.unsubscribe();\n }\n\n /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */\n _applyBodyHighContrastModeCssClasses(): void {\n if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {\n const bodyClasses = this._document.body.classList;\n bodyClasses.remove(\n HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS,\n BLACK_ON_WHITE_CSS_CLASS,\n WHITE_ON_BLACK_CSS_CLASS,\n );\n this._hasCheckedHighContrastMode = true;\n\n const mode = this.getHighContrastMode();\n if (mode === HighContrastMode.BLACK_ON_WHITE) {\n bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS);\n } else if (mode === HighContrastMode.WHITE_ON_BLACK) {\n bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {CdkMonitorFocus} from './focus-monitor/focus-monitor';\nimport {CdkTrapFocus} from './focus-trap/focus-trap';\nimport {HighContrastModeDetector} from './high-contrast-mode/high-contrast-mode-detector';\nimport {CdkAriaLive} from './live-announcer/live-announcer';\n\n@NgModule({\n imports: [ObserversModule],\n declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],\n exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],\n})\nexport class A11yModule {\n constructor(highContrastModeDetector: HighContrastModeDetector) {\n highContrastModeDetector._applyBodyHighContrastModeCssClasses();\n }\n}\n","import { Observable } from '../Observable';\nimport { async } from '../scheduler/async';\nimport { SchedulerAction, SchedulerLike } from '../types';\nimport { isNumeric } from '../util/isNumeric';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * Creates an Observable that emits sequential numbers every specified\n * interval of time, on a specified {@link SchedulerLike}.\n *\n * <span class=\"informal\">Emits incremental numbers periodically in time.\n * </span>\n *\n * \n *\n * `interval` returns an Observable that emits an infinite sequence of\n * ascending integers, with a constant interval of time of your choosing\n * between those emissions. The first emission is not sent immediately, but\n * only after the first period has passed. By default, this operator uses the\n * `async` {@link SchedulerLike} to provide a notion of time, but you may pass any\n * {@link SchedulerLike} to it.\n *\n * ## Example\n * Emits ascending numbers, one every second (1000ms) up to the number 3\n * ```ts\n * import { interval } from 'rxjs';\n * import { take } from 'rxjs/operators';\n *\n * const numbers = interval(1000);\n *\n * const takeFourNumbers = numbers.pipe(take(4));\n *\n * takeFourNumbers.subscribe(x => console.log('Next: ', x));\n *\n * // Logs:\n * // Next: 0\n * // Next: 1\n * // Next: 2\n * // Next: 3\n * ```\n *\n * @see {@link timer}\n * @see {@link delay}\n *\n * @param {number} [period=0] The interval size in milliseconds (by default)\n * or the time unit determined by the scheduler's clock.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling\n * the emission of values, and providing a notion of \"time\".\n * @return {Observable} An Observable that emits a sequential number each time\n * interval.\n * @static true\n * @name interval\n * @owner Observable\n */\nexport function interval(period = 0,\n scheduler: SchedulerLike = async): Observable<number> {\n if (!isNumeric(period) || period < 0) {\n period = 0;\n }\n\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n scheduler = async;\n }\n\n return new Observable<number>(subscriber => {\n subscriber.add(\n scheduler.schedule(dispatch, period, { subscriber, counter: 0, period })\n );\n return subscriber;\n });\n}\n\nfunction dispatch(this: SchedulerAction<IntervalState>, state: IntervalState) {\n const { subscriber, counter, period } = state;\n subscriber.next(counter);\n this.schedule({ subscriber, counter: counter + 1, period }, period);\n}\n\ninterface IntervalState {\n subscriber: Subscriber<number>;\n counter: number;\n period: number;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Extended CSSStyleDeclaration that includes a couple of drag-related\n * properties that aren't in the built-in TS typings.\n */\nexport interface DragCSSStyleDeclaration extends CSSStyleDeclaration {\n msScrollSnapType: string;\n scrollSnapType: string;\n webkitTapHighlightColor: string;\n}\n\n/**\n * Shallow-extends a stylesheet object with another stylesheet-like object.\n * Note that the keys in `source` have to be dash-cased.\n * @docs-private\n */\nexport function extendStyles(\n dest: CSSStyleDeclaration,\n source: Record<string, string>,\n importantProperties?: Set<string>,\n) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n const value = source[key];\n\n if (value) {\n dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : '');\n } else {\n dest.removeProperty(key);\n }\n }\n }\n\n return dest;\n}\n\n/**\n * Toggles whether the native drag interactions should be enabled for an element.\n * @param element Element on which to toggle the drag interactions.\n * @param enable Whether the drag interactions should be enabled.\n * @docs-private\n */\nexport function toggleNativeDragInteractions(element: HTMLElement, enable: boolean) {\n const userSelect = enable ? '' : 'none';\n\n extendStyles(element.style, {\n 'touch-action': enable ? '' : 'none',\n '-webkit-user-drag': enable ? '' : 'none',\n '-webkit-tap-highlight-color': enable ? '' : 'transparent',\n 'user-select': userSelect,\n '-ms-user-select': userSelect,\n '-webkit-user-select': userSelect,\n '-moz-user-select': userSelect,\n });\n}\n\n/**\n * Toggles whether an element is visible while preserving its dimensions.\n * @param element Element whose visibility to toggle\n * @param enable Whether the element should be visible.\n * @param importantProperties Properties to be set as `!important`.\n * @docs-private\n */\nexport function toggleVisibility(\n element: HTMLElement,\n enable: boolean,\n importantProperties?: Set<string>,\n) {\n extendStyles(\n element.style,\n {\n position: enable ? '' : 'fixed',\n top: enable ? '' : '0',\n opacity: enable ? '' : '0',\n left: enable ? '' : '-999em',\n },\n importantProperties,\n );\n}\n\n/**\n * Combines a transform string with an optional other transform\n * that exited before the base transform was applied.\n */\nexport function combineTransforms(transform: string, initialTransform?: string): string {\n return initialTransform && initialTransform != 'none'\n ? transform + ' ' + initialTransform\n : transform;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Parses a CSS time value to milliseconds. */\nfunction parseCssTimeUnitsToMs(value: string): number {\n // Some browsers will return it in seconds, whereas others will return milliseconds.\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\n\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\n const computedStyle = getComputedStyle(element);\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\n\n // If there's no transition for `all` or `transform`, we shouldn't do anything.\n if (!property) {\n return 0;\n }\n\n // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n const propertyIndex = transitionedProperties.indexOf(property);\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n\n return (\n parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\n parseCssTimeUnitsToMs(rawDelays[propertyIndex])\n );\n}\n\n/** Parses out multiple values from a computed style into an array. */\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Gets a mutable version of an element's bounding `ClientRect`. */\nexport function getMutableClientRect(element: Element): ClientRect {\n const clientRect = element.getBoundingClientRect();\n\n // We need to clone the `clientRect` here, because all the values on it are readonly\n // and we need to be able to update them. Also we can't use a spread here, because\n // the values on a `ClientRect` aren't own properties. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\n return {\n top: clientRect.top,\n right: clientRect.right,\n bottom: clientRect.bottom,\n left: clientRect.left,\n width: clientRect.width,\n height: clientRect.height,\n x: clientRect.x,\n y: clientRect.y,\n } as ClientRect;\n}\n\n/**\n * Checks whether some coordinates are within a `ClientRect`.\n * @param clientRect ClientRect that is being checked.\n * @param x Coordinates along the X axis.\n * @param y Coordinates along the Y axis.\n */\nexport function isInsideClientRect(clientRect: ClientRect, x: number, y: number) {\n const {top, bottom, left, right} = clientRect;\n return y >= top && y <= bottom && x >= left && x <= right;\n}\n\n/**\n * Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts.\n * @param clientRect `ClientRect` that should be updated.\n * @param top Amount to add to the `top` position.\n * @param left Amount to add to the `left` position.\n */\nexport function adjustClientRect(\n clientRect: {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n },\n top: number,\n left: number,\n) {\n clientRect.top += top;\n clientRect.bottom = clientRect.top + clientRect.height;\n\n clientRect.left += left;\n clientRect.right = clientRect.left + clientRect.width;\n}\n\n/**\n * Checks whether the pointer coordinates are close to a ClientRect.\n * @param rect ClientRect to check against.\n * @param threshold Threshold around the ClientRect.\n * @param pointerX Coordinates along the X axis.\n * @param pointerY Coordinates along the Y axis.\n */\nexport function isPointerNearClientRect(\n rect: ClientRect,\n threshold: number,\n pointerX: number,\n pointerY: number,\n): boolean {\n const {top, right, bottom, left, width, height} = rect;\n const xThreshold = width * threshold;\n const yThreshold = height * threshold;\n\n return (\n pointerY > top - yThreshold &&\n pointerY < bottom + yThreshold &&\n pointerX > left - xThreshold &&\n pointerX < right + xThreshold\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {_getEventTarget} from '@angular/cdk/platform';\nimport {getMutableClientRect, adjustClientRect} from './client-rect';\n\n/** Object holding the scroll position of something. */\ninterface ScrollPosition {\n top: number;\n left: number;\n}\n\n/** Keeps track of the scroll position and dimensions of the parents of an element. */\nexport class ParentPositionTracker {\n /** Cached positions of the scrollable parent elements. */\n readonly positions = new Map<\n Document | HTMLElement,\n {\n scrollPosition: ScrollPosition;\n clientRect?: ClientRect;\n }\n >();\n\n constructor(private _document: Document) {}\n\n /** Clears the cached positions. */\n clear() {\n this.positions.clear();\n }\n\n /** Caches the positions. Should be called at the beginning of a drag sequence. */\n cache(elements: readonly HTMLElement[]) {\n this.clear();\n this.positions.set(this._document, {\n scrollPosition: this.getViewportScrollPosition(),\n });\n\n elements.forEach(element => {\n this.positions.set(element, {\n scrollPosition: {top: element.scrollTop, left: element.scrollLeft},\n clientRect: getMutableClientRect(element),\n });\n });\n }\n\n /** Handles scrolling while a drag is taking place. */\n handleScroll(event: Event): ScrollPosition | null {\n const target = _getEventTarget<HTMLElement | Document>(event)!;\n const cachedPosition = this.positions.get(target);\n\n if (!cachedPosition) {\n return null;\n }\n\n const scrollPosition = cachedPosition.scrollPosition;\n let newTop: number;\n let newLeft: number;\n\n if (target === this._document) {\n const viewportScrollPosition = this.getViewportScrollPosition();\n newTop = viewportScrollPosition.top;\n newLeft = viewportScrollPosition.left;\n } else {\n newTop = (target as HTMLElement).scrollTop;\n newLeft = (target as HTMLElement).scrollLeft;\n }\n\n const topDifference = scrollPosition.top - newTop;\n const leftDifference = scrollPosition.left - newLeft;\n\n // Go through and update the cached positions of the scroll\n // parents that are inside the element that was scrolled.\n this.positions.forEach((position, node) => {\n if (position.clientRect && target !== node && target.contains(node)) {\n adjustClientRect(position.clientRect, topDifference, leftDifference);\n }\n });\n\n scrollPosition.top = newTop;\n scrollPosition.left = newLeft;\n\n return {top: topDifference, left: leftDifference};\n }\n\n /**\n * Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,\n * instead of going through the `ViewportRuler`, because the first value the ruler looks at is\n * the top/left offset of the `document.documentElement` which works for most cases, but breaks\n * if the element is offset by something like the `BlockScrollStrategy`.\n */\n getViewportScrollPosition() {\n return {top: window.scrollY, left: window.scrollX};\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Creates a deep clone of an element. */\nexport function deepCloneNode(node: HTMLElement): HTMLElement {\n const clone = node.cloneNode(true) as HTMLElement;\n const descendantsWithId = clone.querySelectorAll('[id]');\n const nodeName = node.nodeName.toLowerCase();\n\n // Remove the `id` to avoid having multiple elements with the same id on the page.\n clone.removeAttribute('id');\n\n for (let i = 0; i < descendantsWithId.length; i++) {\n descendantsWithId[i].removeAttribute('id');\n }\n\n if (nodeName === 'canvas') {\n transferCanvasData(node as HTMLCanvasElement, clone as HTMLCanvasElement);\n } else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') {\n transferInputData(node as HTMLInputElement, clone as HTMLInputElement);\n }\n\n transferData('canvas', node, clone, transferCanvasData);\n transferData('input, textarea, select', node, clone, transferInputData);\n return clone;\n}\n\n/** Matches elements between an element and its clone and allows for their data to be cloned. */\nfunction transferData<T extends Element>(\n selector: string,\n node: HTMLElement,\n clone: HTMLElement,\n callback: (source: T, clone: T) => void,\n) {\n const descendantElements = node.querySelectorAll<T>(selector);\n\n if (descendantElements.length) {\n const cloneElements = clone.querySelectorAll<T>(selector);\n\n for (let i = 0; i < descendantElements.length; i++) {\n callback(descendantElements[i], cloneElements[i]);\n }\n }\n}\n\n// Counter for unique cloned radio button names.\nlet cloneUniqueId = 0;\n\n/** Transfers the data of one input element to another. */\nfunction transferInputData(\n source: Element & {value: string},\n clone: Element & {value: string; name: string; type: string},\n) {\n // Browsers throw an error when assigning the value of a file input programmatically.\n if (clone.type !== 'file') {\n clone.value = source.value;\n }\n\n // Radio button `name` attributes must be unique for radio button groups\n // otherwise original radio buttons can lose their checked state\n // once the clone is inserted in the DOM.\n if (clone.type === 'radio' && clone.name) {\n clone.name = `mat-clone-${clone.name}-${cloneUniqueId++}`;\n }\n}\n\n/** Transfers the data of one canvas element to another. */\nfunction transferCanvasData(source: HTMLCanvasElement, clone: HTMLCanvasElement) {\n const context = clone.getContext('2d');\n\n if (context) {\n // In some cases `drawImage` can throw (e.g. if the canvas size is 0x0).\n // We can't do much about it so just ignore the error.\n try {\n context.drawImage(source, 0, 0);\n } catch {}\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EmbeddedViewRef, ElementRef, NgZone, ViewContainerRef, TemplateRef} from '@angular/core';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {Direction} from '@angular/cdk/bidi';\nimport {\n normalizePassiveListenerOptions,\n _getEventTarget,\n _getShadowRoot,\n} from '@angular/cdk/platform';\nimport {coerceBooleanProperty, coerceElement} from '@angular/cdk/coercion';\nimport {isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader} from '@angular/cdk/a11y';\nimport {Subscription, Subject, Observable} from 'rxjs';\nimport {DropListRefInternal as DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {\n combineTransforms,\n DragCSSStyleDeclaration,\n extendStyles,\n toggleNativeDragInteractions,\n toggleVisibility,\n} from './dom/styling';\nimport {getTransformTransitionDurationInMs} from './dom/transition-duration';\nimport {getMutableClientRect, adjustClientRect} from './dom/client-rect';\nimport {ParentPositionTracker} from './dom/parent-position-tracker';\nimport {deepCloneNode} from './dom/clone-node';\n\n/** Object that can be used to configure the behavior of DragRef. */\nexport interface DragRefConfig {\n /**\n * Minimum amount of pixels that the user should\n * drag, before the CDK initiates a drag sequence.\n */\n dragStartThreshold: number;\n\n /**\n * Amount the pixels the user should drag before the CDK\n * considers them to have changed the drag direction.\n */\n pointerDirectionChangeThreshold: number;\n\n /** `z-index` for the absolutely-positioned elements that are created by the drag item. */\n zIndex?: number;\n\n /** Ref that the current drag item is nested in. */\n parentDragRef?: DragRef;\n}\n\n/** Options that can be used to bind a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/** Options that can be used to bind an active event listener. */\nconst activeEventListenerOptions = normalizePassiveListenerOptions({passive: false});\n\n/**\n * Time in milliseconds for which to ignore mouse events, after\n * receiving a touch event. Used to avoid doing double work for\n * touch devices where the browser fires fake mouse events, in\n * addition to touch events.\n */\nconst MOUSE_EVENT_IGNORE_TIME = 800;\n\n// TODO(crisbeto): add an API for moving a draggable up/down the\n// list programmatically. Useful for keyboard controls.\n\n/**\n * Internal compile-time-only representation of a `DragRef`.\n * Used to avoid circular import issues between the `DragRef` and the `DropListRef`.\n * @docs-private\n */\nexport interface DragRefInternal extends DragRef {}\n\n/** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */\ninterface DragHelperTemplate<T = any> {\n template: TemplateRef<T> | null;\n viewContainer: ViewContainerRef;\n context: T;\n}\n\n/** Template that can be used to create a drag preview element. */\ninterface DragPreviewTemplate<T = any> extends DragHelperTemplate<T> {\n matchSize?: boolean;\n}\n\n/** Point on the page or within an element. */\nexport interface Point {\n x: number;\n y: number;\n}\n\n/** Inline styles to be set as `!important` while dragging. */\nconst dragImportantProperties = new Set([\n // Needs to be important, because some `mat-table` sets `position: sticky !important`. See #22781.\n 'position',\n]);\n\n/**\n * Possible places into which the preview of a drag item can be inserted.\n * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that\n * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain\n * its inherited styles.\n * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that\n * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be\n * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors\n * like `:nth-child` and some flexbox configurations.\n * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.\n * Same advantages and disadvantages as `parent`.\n */\nexport type PreviewContainer = 'global' | 'parent' | ElementRef<HTMLElement> | HTMLElement;\n\n/**\n * Reference to a draggable item. Used to manipulate or dispose of the item.\n */\nexport class DragRef<T = any> {\n /** Element displayed next to the user's pointer while the element is dragged. */\n private _preview: HTMLElement;\n\n /** Reference to the view of the preview element. */\n private _previewRef: EmbeddedViewRef<any> | null;\n\n /** Container into which to insert the preview. */\n private _previewContainer: PreviewContainer | undefined;\n\n /** Reference to the view of the placeholder element. */\n private _placeholderRef: EmbeddedViewRef<any> | null;\n\n /** Element that is rendered instead of the draggable item while it is being sorted. */\n private _placeholder: HTMLElement;\n\n /** Coordinates within the element at which the user picked up the element. */\n private _pickupPositionInElement: Point;\n\n /** Coordinates on the page at which the user picked up the element. */\n private _pickupPositionOnPage: Point;\n\n /**\n * Anchor node used to save the place in the DOM where the element was\n * picked up so that it can be restored at the end of the drag sequence.\n */\n private _anchor: Comment;\n\n /**\n * CSS `transform` applied to the element when it isn't being dragged. We need a\n * passive transform in order for the dragged element to retain its new position\n * after the user has stopped dragging and because we need to know the relative\n * position in case they start dragging again. This corresponds to `element.style.transform`.\n */\n private _passiveTransform: Point = {x: 0, y: 0};\n\n /** CSS `transform` that is applied to the element while it's being dragged. */\n private _activeTransform: Point = {x: 0, y: 0};\n\n /** Inline `transform` value that the element had before the first dragging sequence. */\n private _initialTransform?: string;\n\n /**\n * Whether the dragging sequence has been started. Doesn't\n * necessarily mean that the element has been moved.\n */\n private _hasStartedDragging = false;\n\n /** Whether the element has moved since the user started dragging it. */\n private _hasMoved: boolean;\n\n /** Drop container in which the DragRef resided when dragging began. */\n private _initialContainer: DropListRef;\n\n /** Index at which the item started in its initial container. */\n private _initialIndex: number;\n\n /** Cached positions of scrollable parent elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Emits when the item is being moved. */\n private readonly _moveEvents = new Subject<{\n source: DragRef;\n pointerPosition: {x: number; y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n }>();\n\n /** Keeps track of the direction in which the user is dragging along each axis. */\n private _pointerDirectionDelta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n\n /** Pointer position at which the last change in the delta occurred. */\n private _pointerPositionAtLastDirectionChange: Point;\n\n /** Position of the pointer at the last pointer event. */\n private _lastKnownPointerPosition: Point;\n\n /**\n * Root DOM node of the drag instance. This is the element that will\n * be moved around as the user is dragging.\n */\n private _rootElement: HTMLElement;\n\n /**\n * Nearest ancestor SVG, relative to which coordinates are calculated if dragging SVGElement\n */\n private _ownerSVGElement: SVGSVGElement | null;\n\n /**\n * Inline style value of `-webkit-tap-highlight-color` at the time the\n * dragging was started. Used to restore the value once we're done dragging.\n */\n private _rootElementTapHighlight: string;\n\n /** Subscription to pointer movement events. */\n private _pointerMoveSubscription = Subscription.EMPTY;\n\n /** Subscription to the event that is dispatched when the user lifts their pointer. */\n private _pointerUpSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being scrolled. */\n private _scrollSubscription = Subscription.EMPTY;\n\n /** Subscription to the viewport being resized. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /**\n * Time at which the last touch event occurred. Used to avoid firing the same\n * events multiple times on touch devices where the browser will fire a fake\n * mouse event for each touch event, after a certain time.\n */\n private _lastTouchEventTime: number;\n\n /** Time at which the last dragging sequence was started. */\n private _dragStartTime: number;\n\n /** Cached reference to the boundary element. */\n private _boundaryElement: HTMLElement | null = null;\n\n /** Whether the native dragging interactions have been enabled on the root element. */\n private _nativeInteractionsEnabled = true;\n\n /** Client rect of the root element when the dragging sequence has started. */\n private _initialClientRect?: ClientRect;\n\n /** Cached dimensions of the preview element. Should be read via `_getPreviewRect`. */\n private _previewRect?: ClientRect;\n\n /** Cached dimensions of the boundary element. */\n private _boundaryRect?: ClientRect;\n\n /** Element that will be used as a template to create the draggable item's preview. */\n private _previewTemplate?: DragPreviewTemplate | null;\n\n /** Template for placeholder element rendered to show where a draggable would be dropped. */\n private _placeholderTemplate?: DragHelperTemplate | null;\n\n /** Elements that can be used to drag the draggable item. */\n private _handles: HTMLElement[] = [];\n\n /** Registered handles that are currently disabled. */\n private _disabledHandles = new Set<HTMLElement>();\n\n /** Droppable container that the draggable is a part of. */\n private _dropContainer?: DropListRef;\n\n /** Layout direction of the item. */\n private _direction: Direction = 'ltr';\n\n /** Ref that the current drag item is nested in. */\n private _parentDragRef: DragRef<unknown> | null;\n\n /**\n * Cached shadow root that the element is placed in. `null` means that the element isn't in\n * the shadow DOM and `undefined` means that it hasn't been resolved yet. Should be read via\n * `_getShadowRoot`, not directly.\n */\n private _cachedShadowRoot: ShadowRoot | null | undefined;\n\n /** Axis along which dragging is locked. */\n lockAxis: 'x' | 'y';\n\n /**\n * Amount of milliseconds to wait after the user has put their\n * pointer down before starting to drag the element.\n */\n dragStartDelay: number | {touch: number; mouse: number} = 0;\n\n /** Class to be added to the preview element. */\n previewClass: string | string[] | undefined;\n\n /** Whether starting to drag this element is disabled. */\n get disabled(): boolean {\n return this._disabled || !!(this._dropContainer && this._dropContainer.disabled);\n }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this._disabled) {\n this._disabled = newValue;\n this._toggleNativeDragInteractions();\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, newValue));\n }\n }\n private _disabled = false;\n\n /** Emits as the drag sequence is being prepared. */\n readonly beforeStarted = new Subject<void>();\n\n /** Emits when the user starts dragging the item. */\n readonly started = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\n\n /** Emits when the user has released a drag item, before any animations have started. */\n readonly released = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\n\n /** Emits when the user stops dragging an item in the container. */\n readonly ended = new Subject<{\n source: DragRef;\n distance: Point;\n dropPoint: Point;\n event: MouseEvent | TouchEvent;\n }>();\n\n /** Emits when the user has moved the item into a new container. */\n readonly entered = new Subject<{container: DropListRef; item: DragRef; currentIndex: number}>();\n\n /** Emits when the user removes the item its container by dragging it into another container. */\n readonly exited = new Subject<{container: DropListRef; item: DragRef}>();\n\n /** Emits when the user drops the item inside a container. */\n readonly dropped = new Subject<{\n previousIndex: number;\n currentIndex: number;\n item: DragRef;\n container: DropListRef;\n previousContainer: DropListRef;\n distance: Point;\n dropPoint: Point;\n isPointerOverContainer: boolean;\n event: MouseEvent | TouchEvent;\n }>();\n\n /**\n * Emits as the user is dragging the item. Use with caution,\n * because this event will fire for every pixel that the user has dragged.\n */\n readonly moved: Observable<{\n source: DragRef;\n pointerPosition: {x: number; y: number};\n event: MouseEvent | TouchEvent;\n distance: Point;\n delta: {x: -1 | 0 | 1; y: -1 | 0 | 1};\n }> = this._moveEvents;\n\n /** Arbitrary data that can be attached to the drag item. */\n data: T;\n\n /**\n * Function that can be used to customize the logic of how the position of the drag item\n * is limited while it's being dragged. Gets called with a point containing the current position\n * of the user's pointer on the page, a reference to the item being dragged and its dimensions.\n * Should return a point describing where the item should be rendered.\n */\n constrainPosition?: (\n userPointerPosition: Point,\n dragRef: DragRef,\n dimensions: ClientRect,\n pickupPositionInElement: Point,\n ) => Point;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _config: DragRefConfig,\n private _document: Document,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n ) {\n this.withRootElement(element).withParent(_config.parentDragRef || null);\n this._parentPositions = new ParentPositionTracker(_document);\n _dragDropRegistry.registerDragItem(this);\n }\n\n /**\n * Returns the element that is being used as a placeholder\n * while the current element is being dragged.\n */\n getPlaceholderElement(): HTMLElement {\n return this._placeholder;\n }\n\n /** Returns the root draggable element. */\n getRootElement(): HTMLElement {\n return this._rootElement;\n }\n\n /**\n * Gets the currently-visible element that represents the drag item.\n * While dragging this is the placeholder, otherwise it's the root element.\n */\n getVisibleElement(): HTMLElement {\n return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement();\n }\n\n /** Registers the handles that can be used to drag the element. */\n withHandles(handles: (HTMLElement | ElementRef<HTMLElement>)[]): this {\n this._handles = handles.map(handle => coerceElement(handle));\n this._handles.forEach(handle => toggleNativeDragInteractions(handle, this.disabled));\n this._toggleNativeDragInteractions();\n\n // Delete any lingering disabled handles that may have been destroyed. Note that we re-create\n // the set, rather than iterate over it and filter out the destroyed handles, because while\n // the ES spec allows for sets to be modified while they're being iterated over, some polyfills\n // use an array internally which may throw an error.\n const disabledHandles = new Set<HTMLElement>();\n this._disabledHandles.forEach(handle => {\n if (this._handles.indexOf(handle) > -1) {\n disabledHandles.add(handle);\n }\n });\n this._disabledHandles = disabledHandles;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag preview.\n * @param template Template that from which to stamp out the preview.\n */\n withPreviewTemplate(template: DragPreviewTemplate | null): this {\n this._previewTemplate = template;\n return this;\n }\n\n /**\n * Registers the template that should be used for the drag placeholder.\n * @param template Template that from which to stamp out the placeholder.\n */\n withPlaceholderTemplate(template: DragHelperTemplate | null): this {\n this._placeholderTemplate = template;\n return this;\n }\n\n /**\n * Sets an alternate drag root element. The root element is the element that will be moved as\n * the user is dragging. Passing an alternate root element is useful when trying to enable\n * dragging on an element that you might not have access to.\n */\n withRootElement(rootElement: ElementRef<HTMLElement> | HTMLElement): this {\n const element = coerceElement(rootElement);\n\n if (element !== this._rootElement) {\n if (this._rootElement) {\n this._removeRootElementListeners(this._rootElement);\n }\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.addEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n element.addEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);\n });\n this._initialTransform = undefined;\n this._rootElement = element;\n }\n\n if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) {\n this._ownerSVGElement = this._rootElement.ownerSVGElement;\n }\n\n return this;\n }\n\n /**\n * Element to which the draggable's position will be constrained.\n */\n withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this {\n this._boundaryElement = boundaryElement ? coerceElement(boundaryElement) : null;\n this._resizeSubscription.unsubscribe();\n if (boundaryElement) {\n this._resizeSubscription = this._viewportRuler\n .change(10)\n .subscribe(() => this._containInsideBoundaryOnResize());\n }\n return this;\n }\n\n /** Sets the parent ref that the ref is nested in. */\n withParent(parent: DragRef<unknown> | null): this {\n this._parentDragRef = parent;\n return this;\n }\n\n /** Removes the dragging functionality from the DOM element. */\n dispose() {\n this._removeRootElementListeners(this._rootElement);\n\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n this._rootElement?.remove();\n }\n\n this._anchor?.remove();\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeSubscriptions();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._parentPositions.clear();\n this._boundaryElement =\n this._rootElement =\n this._ownerSVGElement =\n this._placeholderTemplate =\n this._previewTemplate =\n this._anchor =\n this._parentDragRef =\n null!;\n }\n\n /** Checks whether the element is currently being dragged. */\n isDragging(): boolean {\n return this._hasStartedDragging && this._dragDropRegistry.isDragging(this);\n }\n\n /** Resets a standalone drag item to its initial position. */\n reset(): void {\n this._rootElement.style.transform = this._initialTransform || '';\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform = {x: 0, y: 0};\n }\n\n /**\n * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.\n * @param handle Handle element that should be disabled.\n */\n disableHandle(handle: HTMLElement) {\n if (!this._disabledHandles.has(handle) && this._handles.indexOf(handle) > -1) {\n this._disabledHandles.add(handle);\n toggleNativeDragInteractions(handle, true);\n }\n }\n\n /**\n * Enables a handle, if it has been disabled.\n * @param handle Handle element to be enabled.\n */\n enableHandle(handle: HTMLElement) {\n if (this._disabledHandles.has(handle)) {\n this._disabledHandles.delete(handle);\n toggleNativeDragInteractions(handle, this.disabled);\n }\n }\n\n /** Sets the layout direction of the draggable item. */\n withDirection(direction: Direction): this {\n this._direction = direction;\n return this;\n }\n\n /** Sets the container that the item is part of. */\n _withDropContainer(container: DropListRef) {\n this._dropContainer = container;\n }\n\n /**\n * Gets the current position in pixels the draggable outside of a drop container.\n */\n getFreeDragPosition(): Readonly<Point> {\n const position = this.isDragging() ? this._activeTransform : this._passiveTransform;\n return {x: position.x, y: position.y};\n }\n\n /**\n * Sets the current position in pixels the draggable outside of a drop container.\n * @param value New position to be set.\n */\n setFreeDragPosition(value: Point): this {\n this._activeTransform = {x: 0, y: 0};\n this._passiveTransform.x = value.x;\n this._passiveTransform.y = value.y;\n\n if (!this._dropContainer) {\n this._applyRootElementTransform(value.x, value.y);\n }\n\n return this;\n }\n\n /**\n * Sets the container into which to insert the preview element.\n * @param value Container into which to insert the preview.\n */\n withPreviewContainer(value: PreviewContainer): this {\n this._previewContainer = value;\n return this;\n }\n\n /** Updates the item's sort order based on the last-known pointer position. */\n _sortFromLastPointerPosition() {\n const position = this._lastKnownPointerPosition;\n\n if (position && this._dropContainer) {\n this._updateActiveDropContainer(this._getConstrainedPointerPosition(position), position);\n }\n }\n\n /** Unsubscribes from the global subscriptions. */\n private _removeSubscriptions() {\n this._pointerMoveSubscription.unsubscribe();\n this._pointerUpSubscription.unsubscribe();\n this._scrollSubscription.unsubscribe();\n }\n\n /** Destroys the preview element and its ViewRef. */\n private _destroyPreview() {\n this._preview?.remove();\n this._previewRef?.destroy();\n this._preview = this._previewRef = null!;\n }\n\n /** Destroys the placeholder element and its ViewRef. */\n private _destroyPlaceholder() {\n this._placeholder?.remove();\n this._placeholderRef?.destroy();\n this._placeholder = this._placeholderRef = null!;\n }\n\n /** Handler for the `mousedown`/`touchstart` events. */\n private _pointerDown = (event: MouseEvent | TouchEvent) => {\n this.beforeStarted.next();\n\n // Delegate the event based on whether it started from a handle or the element itself.\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n this._initializeDragSequence(targetHandle, event);\n }\n } else if (!this.disabled) {\n this._initializeDragSequence(this._rootElement, event);\n }\n };\n\n /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */\n private _pointerMove = (event: MouseEvent | TouchEvent) => {\n const pointerPosition = this._getPointerPositionOnPage(event);\n\n if (!this._hasStartedDragging) {\n const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);\n const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y);\n const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold;\n\n // Only start dragging after the user has moved more than the minimum distance in either\n // direction. Note that this is preferable over doing something like `skip(minimumDistance)`\n // in the `pointerMove` subscription, because we're not guaranteed to have one move event\n // per pixel of movement (e.g. if the user moves their pointer quickly).\n if (isOverThreshold) {\n const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event);\n const container = this._dropContainer;\n\n if (!isDelayElapsed) {\n this._endDragSequence(event);\n return;\n }\n\n // Prevent other drag sequences from starting while something in the container is still\n // being dragged. This can happen while we're waiting for the drop animation to finish\n // and can cause errors, because some elements might still be moving around.\n if (!container || (!container.isDragging() && !container.isReceiving())) {\n // Prevent the default action as soon as the dragging sequence is considered as\n // \"started\" since waiting for the next event can allow the device to begin scrolling.\n event.preventDefault();\n this._hasStartedDragging = true;\n this._ngZone.run(() => this._startDragSequence(event));\n }\n }\n\n return;\n }\n\n // We prevent the default action down here so that we know that dragging has started. This is\n // important for touch devices where doing this too early can unnecessarily block scrolling,\n // if there's a dragging delay.\n event.preventDefault();\n\n const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition);\n this._hasMoved = true;\n this._lastKnownPointerPosition = pointerPosition;\n this._updatePointerDirectionDelta(constrainedPointerPosition);\n\n if (this._dropContainer) {\n this._updateActiveDropContainer(constrainedPointerPosition, pointerPosition);\n } else {\n // If there's a position constraint function, we want the element's top/left to be at the\n // specific position on the page. Use the initial position as a reference if that's the case.\n const offset = this.constrainPosition ? this._initialClientRect! : this._pickupPositionOnPage;\n const activeTransform = this._activeTransform;\n activeTransform.x = constrainedPointerPosition.x - offset.x + this._passiveTransform.x;\n activeTransform.y = constrainedPointerPosition.y - offset.y + this._passiveTransform.y;\n this._applyRootElementTransform(activeTransform.x, activeTransform.y);\n }\n\n // Since this event gets fired for every pixel while dragging, we only\n // want to fire it if the consumer opted into it. Also we have to\n // re-enter the zone because we run all of the events on the outside.\n if (this._moveEvents.observers.length) {\n this._ngZone.run(() => {\n this._moveEvents.next({\n source: this,\n pointerPosition: constrainedPointerPosition,\n event,\n distance: this._getDragDistance(constrainedPointerPosition),\n delta: this._pointerDirectionDelta,\n });\n });\n }\n };\n\n /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */\n private _pointerUp = (event: MouseEvent | TouchEvent) => {\n this._endDragSequence(event);\n };\n\n /**\n * Clears subscriptions and stops the dragging sequence.\n * @param event Browser event object that ended the sequence.\n */\n private _endDragSequence(event: MouseEvent | TouchEvent) {\n // Note that here we use `isDragging` from the service, rather than from `this`.\n // The difference is that the one from the service reflects whether a dragging sequence\n // has been initiated, whereas the one on `this` includes whether the user has passed\n // the minimum dragging threshold.\n if (!this._dragDropRegistry.isDragging(this)) {\n return;\n }\n\n this._removeSubscriptions();\n this._dragDropRegistry.stopDragging(this);\n this._toggleNativeDragInteractions();\n\n if (this._handles) {\n (this._rootElement.style as DragCSSStyleDeclaration).webkitTapHighlightColor =\n this._rootElementTapHighlight;\n }\n\n if (!this._hasStartedDragging) {\n return;\n }\n\n this.released.next({source: this, event});\n\n if (this._dropContainer) {\n // Stop scrolling immediately, instead of waiting for the animation to finish.\n this._dropContainer._stopScrolling();\n this._animatePreviewToPlaceholder().then(() => {\n this._cleanupDragArtifacts(event);\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n });\n } else {\n // Convert the active transform into a passive one. This means that next time\n // the user starts dragging the item, its position will be calculated relatively\n // to the new passive transform.\n this._passiveTransform.x = this._activeTransform.x;\n const pointerPosition = this._getPointerPositionOnPage(event);\n this._passiveTransform.y = this._activeTransform.y;\n this._ngZone.run(() => {\n this.ended.next({\n source: this,\n distance: this._getDragDistance(pointerPosition),\n dropPoint: pointerPosition,\n event,\n });\n });\n this._cleanupCachedDimensions();\n this._dragDropRegistry.stopDragging(this);\n }\n }\n\n /** Starts the dragging sequence. */\n private _startDragSequence(event: MouseEvent | TouchEvent) {\n if (isTouchEvent(event)) {\n this._lastTouchEventTime = Date.now();\n }\n\n this._toggleNativeDragInteractions();\n\n const dropContainer = this._dropContainer;\n\n if (dropContainer) {\n const element = this._rootElement;\n const parent = element.parentNode as HTMLElement;\n const placeholder = (this._placeholder = this._createPlaceholderElement());\n const anchor = (this._anchor = this._anchor || this._document.createComment(''));\n\n // Needs to happen before the root element is moved.\n const shadowRoot = this._getShadowRoot();\n\n // Insert an anchor node so that we can restore the element's position in the DOM.\n parent.insertBefore(anchor, element);\n\n // There's no risk of transforms stacking when inside a drop container so\n // we can keep the initial transform up to date any time dragging starts.\n this._initialTransform = element.style.transform || '';\n\n // Create the preview after the initial transform has\n // been cached, because it can be affected by the transform.\n this._preview = this._createPreviewElement();\n\n // We move the element out at the end of the body and we make it hidden, because keeping it in\n // place will throw off the consumer's `:last-child` selectors. We can't remove the element\n // from the DOM completely, because iOS will stop firing all subsequent events in the chain.\n toggleVisibility(element, false, dragImportantProperties);\n this._document.body.appendChild(parent.replaceChild(placeholder, element));\n this._getPreviewInsertionPoint(parent, shadowRoot).appendChild(this._preview);\n this.started.next({source: this, event}); // Emit before notifying the container.\n dropContainer.start();\n this._initialContainer = dropContainer;\n this._initialIndex = dropContainer.getItemIndex(this);\n } else {\n this.started.next({source: this, event});\n this._initialContainer = this._initialIndex = undefined!;\n }\n\n // Important to run after we've called `start` on the parent container\n // so that it has had time to resolve its scrollable parents.\n this._parentPositions.cache(dropContainer ? dropContainer.getScrollableParents() : []);\n }\n\n /**\n * Sets up the different variables and subscriptions\n * that will be necessary for the dragging sequence.\n * @param referenceElement Element that started the drag sequence.\n * @param event Browser event object that started the sequence.\n */\n private _initializeDragSequence(referenceElement: HTMLElement, event: MouseEvent | TouchEvent) {\n // Stop propagation if the item is inside another\n // draggable so we don't start multiple drag sequences.\n if (this._parentDragRef) {\n event.stopPropagation();\n }\n\n const isDragging = this.isDragging();\n const isTouchSequence = isTouchEvent(event);\n const isAuxiliaryMouseButton = !isTouchSequence && (event as MouseEvent).button !== 0;\n const rootElement = this._rootElement;\n const target = _getEventTarget(event);\n const isSyntheticEvent =\n !isTouchSequence &&\n this._lastTouchEventTime &&\n this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now();\n const isFakeEvent = isTouchSequence\n ? isFakeTouchstartFromScreenReader(event as TouchEvent)\n : isFakeMousedownFromScreenReader(event as MouseEvent);\n\n // If the event started from an element with the native HTML drag&drop, it'll interfere\n // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\n // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\n // it's flaky and it fails if the user drags it away quickly. Also note that we only want\n // to do this for `mousedown` since doing the same for `touchstart` will stop any `click`\n // events from firing on touch devices.\n if (target && (target as HTMLElement).draggable && event.type === 'mousedown') {\n event.preventDefault();\n }\n\n // Abort if the user is already dragging or is using a mouse button other than the primary one.\n if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent || isFakeEvent) {\n return;\n }\n\n // If we've got handles, we need to disable the tap highlight on the entire root element,\n // otherwise iOS will still add it, even though all the drag interactions on the handle\n // are disabled.\n if (this._handles.length) {\n const rootStyles = rootElement.style as DragCSSStyleDeclaration;\n this._rootElementTapHighlight = rootStyles.webkitTapHighlightColor || '';\n rootStyles.webkitTapHighlightColor = 'transparent';\n }\n\n this._hasStartedDragging = this._hasMoved = false;\n\n // Avoid multiple subscriptions and memory leaks when multi touch\n // (isDragging check above isn't enough because of possible temporal and/or dimensional delays)\n this._removeSubscriptions();\n this._initialClientRect = this._rootElement.getBoundingClientRect();\n this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove);\n this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp);\n this._scrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(scrollEvent => this._updateOnScroll(scrollEvent));\n\n if (this._boundaryElement) {\n this._boundaryRect = getMutableClientRect(this._boundaryElement);\n }\n\n // If we have a custom preview we can't know ahead of time how large it'll be so we position\n // it next to the cursor. The exception is when the consumer has opted into making the preview\n // the same size as the root element, in which case we do know the size.\n const previewTemplate = this._previewTemplate;\n this._pickupPositionInElement =\n previewTemplate && previewTemplate.template && !previewTemplate.matchSize\n ? {x: 0, y: 0}\n : this._getPointerPositionInElement(this._initialClientRect, referenceElement, event);\n const pointerPosition =\n (this._pickupPositionOnPage =\n this._lastKnownPointerPosition =\n this._getPointerPositionOnPage(event));\n this._pointerDirectionDelta = {x: 0, y: 0};\n this._pointerPositionAtLastDirectionChange = {x: pointerPosition.x, y: pointerPosition.y};\n this._dragStartTime = Date.now();\n this._dragDropRegistry.startDragging(this, event);\n }\n\n /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */\n private _cleanupDragArtifacts(event: MouseEvent | TouchEvent) {\n // Restore the element's visibility and insert it at its old position in the DOM.\n // It's important that we maintain the position, because moving the element around in the DOM\n // can throw off `NgFor` which does smart diffing and re-creates elements only when necessary,\n // while moving the existing elements in all other cases.\n toggleVisibility(this._rootElement, true, dragImportantProperties);\n this._anchor.parentNode!.replaceChild(this._rootElement, this._anchor);\n\n this._destroyPreview();\n this._destroyPlaceholder();\n this._initialClientRect =\n this._boundaryRect =\n this._previewRect =\n this._initialTransform =\n undefined;\n\n // Re-enter the NgZone since we bound `document` events on the outside.\n this._ngZone.run(() => {\n const container = this._dropContainer!;\n const currentIndex = container.getItemIndex(this);\n const pointerPosition = this._getPointerPositionOnPage(event);\n const distance = this._getDragDistance(pointerPosition);\n const isPointerOverContainer = container._isOverContainer(\n pointerPosition.x,\n pointerPosition.y,\n );\n\n this.ended.next({source: this, distance, dropPoint: pointerPosition, event});\n this.dropped.next({\n item: this,\n currentIndex,\n previousIndex: this._initialIndex,\n container: container,\n previousContainer: this._initialContainer,\n isPointerOverContainer,\n distance,\n dropPoint: pointerPosition,\n event,\n });\n container.drop(\n this,\n currentIndex,\n this._initialIndex,\n this._initialContainer,\n isPointerOverContainer,\n distance,\n pointerPosition,\n event,\n );\n this._dropContainer = this._initialContainer;\n });\n }\n\n /**\n * Updates the item's position in its drop container, or moves it\n * into a new one, depending on its current drag position.\n */\n private _updateActiveDropContainer({x, y}: Point, {x: rawX, y: rawY}: Point) {\n // Drop container that draggable has been moved into.\n let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);\n\n // If we couldn't find a new container to move the item into, and the item has left its\n // initial container, check whether the it's over the initial container. This handles the\n // case where two containers are connected one way and the user tries to undo dragging an\n // item into a new container.\n if (\n !newContainer &&\n this._dropContainer !== this._initialContainer &&\n this._initialContainer._isOverContainer(x, y)\n ) {\n newContainer = this._initialContainer;\n }\n\n if (newContainer && newContainer !== this._dropContainer) {\n this._ngZone.run(() => {\n // Notify the old container that the item has left.\n this.exited.next({item: this, container: this._dropContainer!});\n this._dropContainer!.exit(this);\n // Notify the new container that the item has entered.\n this._dropContainer = newContainer!;\n this._dropContainer.enter(\n this,\n x,\n y,\n newContainer === this._initialContainer &&\n // If we're re-entering the initial container and sorting is disabled,\n // put item the into its starting index to begin with.\n newContainer.sortingDisabled\n ? this._initialIndex\n : undefined,\n );\n this.entered.next({\n item: this,\n container: newContainer!,\n currentIndex: newContainer!.getItemIndex(this),\n });\n });\n }\n\n // Dragging may have been interrupted as a result of the events above.\n if (this.isDragging()) {\n this._dropContainer!._startScrollingIfNecessary(rawX, rawY);\n this._dropContainer!._sortItem(this, x, y, this._pointerDirectionDelta);\n\n if (this.constrainPosition) {\n this._applyPreviewTransform(x, y);\n } else {\n this._applyPreviewTransform(\n x - this._pickupPositionInElement.x,\n y - this._pickupPositionInElement.y,\n );\n }\n }\n }\n\n /**\n * Creates the element that will be rendered next to the user's pointer\n * and will be used as a preview of the element that is being dragged.\n */\n private _createPreviewElement(): HTMLElement {\n const previewConfig = this._previewTemplate;\n const previewClass = this.previewClass;\n const previewTemplate = previewConfig ? previewConfig.template : null;\n let preview: HTMLElement;\n\n if (previewTemplate && previewConfig) {\n // Measure the element before we've inserted the preview\n // since the insertion could throw off the measurement.\n const rootRect = previewConfig.matchSize ? this._initialClientRect : null;\n const viewRef = previewConfig.viewContainer.createEmbeddedView(\n previewTemplate,\n previewConfig.context,\n );\n viewRef.detectChanges();\n preview = getRootNode(viewRef, this._document);\n this._previewRef = viewRef;\n if (previewConfig.matchSize) {\n matchElementSize(preview, rootRect!);\n } else {\n preview.style.transform = getTransform(\n this._pickupPositionOnPage.x,\n this._pickupPositionOnPage.y,\n );\n }\n } else {\n preview = deepCloneNode(this._rootElement);\n matchElementSize(preview, this._initialClientRect!);\n\n if (this._initialTransform) {\n preview.style.transform = this._initialTransform;\n }\n }\n\n extendStyles(\n preview.style,\n {\n // It's important that we disable the pointer events on the preview, because\n // it can throw off the `document.elementFromPoint` calls in the `CdkDropList`.\n 'pointer-events': 'none',\n // We have to reset the margin, because it can throw off positioning relative to the viewport.\n 'margin': '0',\n 'position': 'fixed',\n 'top': '0',\n 'left': '0',\n 'z-index': `${this._config.zIndex || 1000}`,\n },\n dragImportantProperties,\n );\n\n toggleNativeDragInteractions(preview, false);\n preview.classList.add('cdk-drag-preview');\n preview.setAttribute('dir', this._direction);\n\n if (previewClass) {\n if (Array.isArray(previewClass)) {\n previewClass.forEach(className => preview.classList.add(className));\n } else {\n preview.classList.add(previewClass);\n }\n }\n\n return preview;\n }\n\n /**\n * Animates the preview element from its current position to the location of the drop placeholder.\n * @returns Promise that resolves when the animation completes.\n */\n private _animatePreviewToPlaceholder(): Promise<void> {\n // If the user hasn't moved yet, the transitionend event won't fire.\n if (!this._hasMoved) {\n return Promise.resolve();\n }\n\n const placeholderRect = this._placeholder.getBoundingClientRect();\n\n // Apply the class that adds a transition to the preview.\n this._preview.classList.add('cdk-drag-animating');\n\n // Move the preview to the placeholder position.\n this._applyPreviewTransform(placeholderRect.left, placeholderRect.top);\n\n // If the element doesn't have a `transition`, the `transitionend` event won't fire. Since\n // we need to trigger a style recalculation in order for the `cdk-drag-animating` class to\n // apply its style, we take advantage of the available info to figure out whether we need to\n // bind the event in the first place.\n const duration = getTransformTransitionDurationInMs(this._preview);\n\n if (duration === 0) {\n return Promise.resolve();\n }\n\n return this._ngZone.runOutsideAngular(() => {\n return new Promise(resolve => {\n const handler = ((event: TransitionEvent) => {\n if (\n !event ||\n (_getEventTarget(event) === this._preview && event.propertyName === 'transform')\n ) {\n this._preview?.removeEventListener('transitionend', handler);\n resolve();\n clearTimeout(timeout);\n }\n }) as EventListenerOrEventListenerObject;\n\n // If a transition is short enough, the browser might not fire the `transitionend` event.\n // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\n // fire if the transition hasn't completed when it was supposed to.\n const timeout = setTimeout(handler as Function, duration * 1.5);\n this._preview.addEventListener('transitionend', handler);\n });\n });\n }\n\n /** Creates an element that will be shown instead of the current element while dragging. */\n private _createPlaceholderElement(): HTMLElement {\n const placeholderConfig = this._placeholderTemplate;\n const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null;\n let placeholder: HTMLElement;\n\n if (placeholderTemplate) {\n this._placeholderRef = placeholderConfig!.viewContainer.createEmbeddedView(\n placeholderTemplate,\n placeholderConfig!.context,\n );\n this._placeholderRef.detectChanges();\n placeholder = getRootNode(this._placeholderRef, this._document);\n } else {\n placeholder = deepCloneNode(this._rootElement);\n }\n\n // Stop pointer events on the preview so the user can't\n // interact with it while the preview is animating.\n placeholder.style.pointerEvents = 'none';\n placeholder.classList.add('cdk-drag-placeholder');\n return placeholder;\n }\n\n /**\n * Figures out the coordinates at which an element was picked up.\n * @param referenceElement Element that initiated the dragging.\n * @param event Event that initiated the dragging.\n */\n private _getPointerPositionInElement(\n elementRect: ClientRect,\n referenceElement: HTMLElement,\n event: MouseEvent | TouchEvent,\n ): Point {\n const handleElement = referenceElement === this._rootElement ? null : referenceElement;\n const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect;\n const point = isTouchEvent(event) ? event.targetTouches[0] : event;\n const scrollPosition = this._getViewportScrollPosition();\n const x = point.pageX - referenceRect.left - scrollPosition.left;\n const y = point.pageY - referenceRect.top - scrollPosition.top;\n\n return {\n x: referenceRect.left - elementRect.left + x,\n y: referenceRect.top - elementRect.top + y,\n };\n }\n\n /** Determines the point of the page that was touched by the user. */\n private _getPointerPositionOnPage(event: MouseEvent | TouchEvent): Point {\n const scrollPosition = this._getViewportScrollPosition();\n const point = isTouchEvent(event)\n ? // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n // Also note that on real devices we're guaranteed for either `touches` or `changedTouches`\n // to have a value, but Firefox in device emulation mode has a bug where both can be empty\n // for `touchstart` and `touchend` so we fall back to a dummy object in order to avoid\n // throwing an error. The value returned here will be incorrect, but since this only\n // breaks inside a developer tool and the value is only used for secondary information,\n // we can get away with it. See https://bugzilla.mozilla.org/show_bug.cgi?id=1615824.\n event.touches[0] || event.changedTouches[0] || {pageX: 0, pageY: 0}\n : event;\n\n const x = point.pageX - scrollPosition.left;\n const y = point.pageY - scrollPosition.top;\n\n // if dragging SVG element, try to convert from the screen coordinate system to the SVG\n // coordinate system\n if (this._ownerSVGElement) {\n const svgMatrix = this._ownerSVGElement.getScreenCTM();\n if (svgMatrix) {\n const svgPoint = this._ownerSVGElement.createSVGPoint();\n svgPoint.x = x;\n svgPoint.y = y;\n return svgPoint.matrixTransform(svgMatrix.inverse());\n }\n }\n\n return {x, y};\n }\n\n /** Gets the pointer position on the page, accounting for any position constraints. */\n private _getConstrainedPointerPosition(point: Point): Point {\n const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null;\n let {x, y} = this.constrainPosition\n ? this.constrainPosition(point, this, this._initialClientRect!, this._pickupPositionInElement)\n : point;\n\n if (this.lockAxis === 'x' || dropContainerLock === 'x') {\n y = this._pickupPositionOnPage.y;\n } else if (this.lockAxis === 'y' || dropContainerLock === 'y') {\n x = this._pickupPositionOnPage.x;\n }\n\n if (this._boundaryRect) {\n const {x: pickupX, y: pickupY} = this._pickupPositionInElement;\n const boundaryRect = this._boundaryRect;\n const {width: previewWidth, height: previewHeight} = this._getPreviewRect();\n const minY = boundaryRect.top + pickupY;\n const maxY = boundaryRect.bottom - (previewHeight - pickupY);\n const minX = boundaryRect.left + pickupX;\n const maxX = boundaryRect.right - (previewWidth - pickupX);\n\n x = clamp(x, minX, maxX);\n y = clamp(y, minY, maxY);\n }\n\n return {x, y};\n }\n\n /** Updates the current drag delta, based on the user's current pointer position on the page. */\n private _updatePointerDirectionDelta(pointerPositionOnPage: Point) {\n const {x, y} = pointerPositionOnPage;\n const delta = this._pointerDirectionDelta;\n const positionSinceLastChange = this._pointerPositionAtLastDirectionChange;\n\n // Amount of pixels the user has dragged since the last time the direction changed.\n const changeX = Math.abs(x - positionSinceLastChange.x);\n const changeY = Math.abs(y - positionSinceLastChange.y);\n\n // Because we handle pointer events on a per-pixel basis, we don't want the delta\n // to change for every pixel, otherwise anything that depends on it can look erratic.\n // To make the delta more consistent, we track how much the user has moved since the last\n // delta change and we only update it after it has reached a certain threshold.\n if (changeX > this._config.pointerDirectionChangeThreshold) {\n delta.x = x > positionSinceLastChange.x ? 1 : -1;\n positionSinceLastChange.x = x;\n }\n\n if (changeY > this._config.pointerDirectionChangeThreshold) {\n delta.y = y > positionSinceLastChange.y ? 1 : -1;\n positionSinceLastChange.y = y;\n }\n\n return delta;\n }\n\n /** Toggles the native drag interactions, based on how many handles are registered. */\n private _toggleNativeDragInteractions() {\n if (!this._rootElement || !this._handles) {\n return;\n }\n\n const shouldEnable = this._handles.length > 0 || !this.isDragging();\n\n if (shouldEnable !== this._nativeInteractionsEnabled) {\n this._nativeInteractionsEnabled = shouldEnable;\n toggleNativeDragInteractions(this._rootElement, shouldEnable);\n }\n }\n\n /** Removes the manually-added event listeners from the root element. */\n private _removeRootElementListeners(element: HTMLElement) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n element.removeEventListener('dragstart', this._nativeDragStart, activeEventListenerOptions);\n }\n\n /**\n * Applies a `transform` to the root element, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyRootElementTransform(x: number, y: number) {\n const transform = getTransform(x, y);\n const styles = this._rootElement.style;\n\n // Cache the previous transform amount only after the first drag sequence, because\n // we don't want our own transforms to stack on top of each other.\n // Should be excluded none because none + translate3d(x, y, x) is invalid css\n if (this._initialTransform == null) {\n this._initialTransform =\n styles.transform && styles.transform != 'none' ? styles.transform : '';\n }\n\n // Preserve the previous `transform` value, if there was one. Note that we apply our own\n // transform before the user's, because things like rotation can affect which direction\n // the element will be translated towards.\n styles.transform = combineTransforms(transform, this._initialTransform);\n }\n\n /**\n * Applies a `transform` to the preview, taking into account any existing transforms on it.\n * @param x New transform value along the X axis.\n * @param y New transform value along the Y axis.\n */\n private _applyPreviewTransform(x: number, y: number) {\n // Only apply the initial transform if the preview is a clone of the original element, otherwise\n // it could be completely different and the transform might not make sense anymore.\n const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform;\n const transform = getTransform(x, y);\n this._preview.style.transform = combineTransforms(transform, initialTransform);\n }\n\n /**\n * Gets the distance that the user has dragged during the current drag sequence.\n * @param currentPosition Current position of the user's pointer.\n */\n private _getDragDistance(currentPosition: Point): Point {\n const pickupPosition = this._pickupPositionOnPage;\n\n if (pickupPosition) {\n return {x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y};\n }\n\n return {x: 0, y: 0};\n }\n\n /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */\n private _cleanupCachedDimensions() {\n this._boundaryRect = this._previewRect = undefined;\n this._parentPositions.clear();\n }\n\n /**\n * Checks whether the element is still inside its boundary after the viewport has been resized.\n * If not, the position is adjusted so that the element fits again.\n */\n private _containInsideBoundaryOnResize() {\n let {x, y} = this._passiveTransform;\n\n if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) {\n return;\n }\n\n // Note: don't use `_clientRectAtStart` here, because we want the latest position.\n const elementRect = this._rootElement.getBoundingClientRect();\n const boundaryRect = this._boundaryElement.getBoundingClientRect();\n\n // It's possible that the element got hidden away after dragging (e.g. by switching to a\n // different tab). Don't do anything in this case so we don't clear the user's position.\n if (\n (boundaryRect.width === 0 && boundaryRect.height === 0) ||\n (elementRect.width === 0 && elementRect.height === 0)\n ) {\n return;\n }\n\n const leftOverflow = boundaryRect.left - elementRect.left;\n const rightOverflow = elementRect.right - boundaryRect.right;\n const topOverflow = boundaryRect.top - elementRect.top;\n const bottomOverflow = elementRect.bottom - boundaryRect.bottom;\n\n // If the element has become wider than the boundary, we can't\n // do much to make it fit so we just anchor it to the left.\n if (boundaryRect.width > elementRect.width) {\n if (leftOverflow > 0) {\n x += leftOverflow;\n }\n\n if (rightOverflow > 0) {\n x -= rightOverflow;\n }\n } else {\n x = 0;\n }\n\n // If the element has become taller than the boundary, we can't\n // do much to make it fit so we just anchor it to the top.\n if (boundaryRect.height > elementRect.height) {\n if (topOverflow > 0) {\n y += topOverflow;\n }\n\n if (bottomOverflow > 0) {\n y -= bottomOverflow;\n }\n } else {\n y = 0;\n }\n\n if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) {\n this.setFreeDragPosition({y, x});\n }\n }\n\n /** Gets the drag start delay, based on the event type. */\n private _getDragStartDelay(event: MouseEvent | TouchEvent): number {\n const value = this.dragStartDelay;\n\n if (typeof value === 'number') {\n return value;\n } else if (isTouchEvent(event)) {\n return value.touch;\n }\n\n return value ? value.mouse : 0;\n }\n\n /** Updates the internal state of the draggable element when scrolling has occurred. */\n private _updateOnScroll(event: Event) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\n const target = _getEventTarget<HTMLElement | Document>(event)!;\n\n // ClientRect dimensions are based on the scroll position of the page and its parent\n // node so we have to update the cached boundary ClientRect if the user has scrolled.\n if (\n this._boundaryRect &&\n target !== this._boundaryElement &&\n target.contains(this._boundaryElement)\n ) {\n adjustClientRect(this._boundaryRect, scrollDifference.top, scrollDifference.left);\n }\n\n this._pickupPositionOnPage.x += scrollDifference.left;\n this._pickupPositionOnPage.y += scrollDifference.top;\n\n // If we're in free drag mode, we have to update the active transform, because\n // it isn't relative to the viewport like the preview inside a drop list.\n if (!this._dropContainer) {\n this._activeTransform.x -= scrollDifference.left;\n this._activeTransform.y -= scrollDifference.top;\n this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y);\n }\n }\n }\n\n /** Gets the scroll position of the viewport. */\n private _getViewportScrollPosition() {\n return (\n this._parentPositions.positions.get(this._document)?.scrollPosition ||\n this._parentPositions.getViewportScrollPosition()\n );\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): ShadowRoot | null {\n if (this._cachedShadowRoot === undefined) {\n this._cachedShadowRoot = _getShadowRoot(this._rootElement);\n }\n\n return this._cachedShadowRoot;\n }\n\n /** Gets the element into which the drag preview should be inserted. */\n private _getPreviewInsertionPoint(\n initialParent: HTMLElement,\n shadowRoot: ShadowRoot | null,\n ): HTMLElement {\n const previewContainer = this._previewContainer || 'global';\n\n if (previewContainer === 'parent') {\n return initialParent;\n }\n\n if (previewContainer === 'global') {\n const documentRef = this._document;\n\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n // TODO(crisbeto): dedupe this with the `FullscreenOverlayContainer` eventually.\n return (\n shadowRoot ||\n documentRef.fullscreenElement ||\n (documentRef as any).webkitFullscreenElement ||\n (documentRef as any).mozFullScreenElement ||\n (documentRef as any).msFullscreenElement ||\n documentRef.body\n );\n }\n\n return coerceElement(previewContainer);\n }\n\n /** Lazily resolves and returns the dimensions of the preview. */\n private _getPreviewRect(): ClientRect {\n // Cache the preview element rect if we haven't cached it already or if\n // we cached it too early before the element dimensions were computed.\n if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) {\n this._previewRect = this._preview\n ? this._preview.getBoundingClientRect()\n : this._initialClientRect!;\n }\n\n return this._previewRect;\n }\n\n /** Handles a native `dragstart` event. */\n private _nativeDragStart = (event: DragEvent) => {\n if (this._handles.length) {\n const targetHandle = this._getTargetHandle(event);\n\n if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) {\n event.preventDefault();\n }\n } else if (!this.disabled) {\n // Usually this isn't necessary since the we prevent the default action in `pointerDown`,\n // but some cases like dragging of links can slip through (see #24403).\n event.preventDefault();\n }\n };\n\n /** Gets a handle that is the target of an event. */\n private _getTargetHandle(event: Event): HTMLElement | undefined {\n return this._handles.find(handle => {\n return event.target && (event.target === handle || handle.contains(event.target as Node));\n });\n }\n}\n\n/**\n * Gets a 3d `transform` that can be applied to an element.\n * @param x Desired position of the element along the X axis.\n * @param y Desired position of the element along the Y axis.\n */\nfunction getTransform(x: number, y: number): string {\n // Round the transforms since some browsers will\n // blur the elements for sub-pixel transforms.\n return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;\n}\n\n/** Clamps a value between a minimum and a maximum. */\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\n/** Determines whether an event is a touch event. */\nfunction isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nfunction getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNodes: Node[] = viewRef.rootNodes;\n\n if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {\n return rootNodes[0] as HTMLElement;\n }\n\n const wrapper = _document.createElement('div');\n rootNodes.forEach(node => wrapper.appendChild(node));\n return wrapper;\n}\n\n/**\n * Matches the target element's size to the source's size.\n * @param target Element that needs to be resized.\n * @param sourceRect Dimensions of the source element.\n */\nfunction matchElementSize(target: HTMLElement, sourceRect: ClientRect): void {\n target.style.width = `${sourceRect.width}px`;\n target.style.height = `${sourceRect.height}px`;\n target.style.transform = getTransform(sourceRect.left, sourceRect.top);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Moves an item one index in an array to another.\n * @param array Array in which to move the item.\n * @param fromIndex Starting index of the item.\n * @param toIndex Index to which the item should be moved.\n */\nexport function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void {\n const from = clamp(fromIndex, array.length - 1);\n const to = clamp(toIndex, array.length - 1);\n\n if (from === to) {\n return;\n }\n\n const target = array[from];\n const delta = to < from ? -1 : 1;\n\n for (let i = from; i !== to; i += delta) {\n array[i] = array[i + delta];\n }\n\n array[to] = target;\n}\n\n/**\n * Moves an item from one array to another.\n * @param currentArray Array from which to transfer the item.\n * @param targetArray Array into which to put the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n */\nexport function transferArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const from = clamp(currentIndex, currentArray.length - 1);\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray.splice(from, 1)[0]);\n }\n}\n\n/**\n * Copies an item from one array to another, leaving it in its\n * original position in current array.\n * @param currentArray Array from which to copy the item.\n * @param targetArray Array into which is copy the item.\n * @param currentIndex Index of the item in its current array.\n * @param targetIndex Index at which to insert the item.\n *\n */\nexport function copyArrayItem<T = any>(\n currentArray: T[],\n targetArray: T[],\n currentIndex: number,\n targetIndex: number,\n): void {\n const to = clamp(targetIndex, targetArray.length);\n\n if (currentArray.length) {\n targetArray.splice(to, 0, currentArray[currentIndex]);\n }\n}\n\n/** Clamps a number between zero and a maximum. */\nfunction clamp(value: number, max: number): number {\n return Math.max(0, Math.min(max, value));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Direction} from '@angular/cdk/bidi';\nimport {ElementRef} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {DragDropRegistry} from '../drag-drop-registry';\nimport {moveItemInArray} from '../drag-utils';\nimport {combineTransforms} from '../dom/styling';\nimport {adjustClientRect, getMutableClientRect, isInsideClientRect} from '../dom/client-rect';\nimport {\n DropListSortStrategy,\n DropListSortStrategyItem,\n SortPredicate,\n} from './drop-list-sort-strategy';\n\n/**\n * Entry in the position cache for draggable items.\n * @docs-private\n */\ninterface CachedItemPosition<T> {\n /** Instance of the drag item. */\n drag: T;\n /** Dimensions of the item. */\n clientRect: ClientRect;\n /** Amount by which the item has been moved since dragging started. */\n offset: number;\n /** Inline transform that the drag item had when dragging started. */\n initialTransform: string;\n}\n\n/**\n * Strategy that only supports sorting along a single axis.\n * Items are reordered using CSS transforms which allows for sorting to be animated.\n * @docs-private\n */\nexport class SingleAxisSortStrategy<T extends DropListSortStrategyItem>\n implements DropListSortStrategy<T>\n{\n /** Function used to determine if an item can be sorted into a specific index. */\n private _sortPredicate: SortPredicate<T>;\n\n /** Cache of the dimensions of all the items inside the container. */\n private _itemPositions: CachedItemPosition<T>[] = [];\n\n /**\n * Draggable items that are currently active inside the container. Includes the items\n * that were there at the start of the sequence, as well as any items that have been dragged\n * in, but haven't been dropped yet.\n */\n private _activeDraggables: T[];\n\n /** Direction in which the list is oriented. */\n orientation: 'vertical' | 'horizontal' = 'vertical';\n\n /** Layout direction of the drop list. */\n direction: Direction;\n\n constructor(\n private _element: HTMLElement | ElementRef<HTMLElement>,\n private _dragDropRegistry: DragDropRegistry<T, unknown>,\n ) {}\n\n /**\n * Keeps track of the item that was last swapped with the dragged item, as well as what direction\n * the pointer was moving in when the swap occurred and whether the user's pointer continued to\n * overlap with the swapped item after the swapping occurred.\n */\n private _previousSwap = {\n drag: null as T | null,\n delta: 0,\n overlaps: false,\n };\n\n /**\n * To be called when the drag sequence starts.\n * @param items Items that are currently in the list.\n */\n start(items: readonly T[]) {\n this.withItems(items);\n }\n\n /**\n * To be called when an item is being sorted.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n sort(item: T, pointerX: number, pointerY: number, pointerDelta: {x: number; y: number}) {\n const siblings = this._itemPositions;\n const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta);\n\n if (newIndex === -1 && siblings.length > 0) {\n return null;\n }\n\n const isHorizontal = this.orientation === 'horizontal';\n const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item);\n const siblingAtNewPosition = siblings[newIndex];\n const currentPosition = siblings[currentIndex].clientRect;\n const newPosition = siblingAtNewPosition.clientRect;\n const delta = currentIndex > newIndex ? 1 : -1;\n\n // How many pixels the item's placeholder should be offset.\n const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta);\n\n // How many pixels all the other items should be offset.\n const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta);\n\n // Save the previous order of the items before moving the item to its new index.\n // We use this to check whether an item has been moved as a result of the sorting.\n const oldOrder = siblings.slice();\n\n // Shuffle the array in place.\n moveItemInArray(siblings, currentIndex, newIndex);\n\n siblings.forEach((sibling, index) => {\n // Don't do anything if the position hasn't changed.\n if (oldOrder[index] === sibling) {\n return;\n }\n\n const isDraggedItem = sibling.drag === item;\n const offset = isDraggedItem ? itemOffset : siblingOffset;\n const elementToOffset = isDraggedItem\n ? item.getPlaceholderElement()\n : sibling.drag.getRootElement();\n\n // Update the offset to reflect the new position.\n sibling.offset += offset;\n\n // Since we're moving the items with a `transform`, we need to adjust their cached\n // client rects to reflect their new position, as well as swap their positions in the cache.\n // Note that we shouldn't use `getBoundingClientRect` here to update the cache, because the\n // elements may be mid-animation which will give us a wrong result.\n if (isHorizontal) {\n // Round the transforms since some browsers will\n // blur the elements, for sub-pixel transforms.\n elementToOffset.style.transform = combineTransforms(\n `translate3d(${Math.round(sibling.offset)}px, 0, 0)`,\n sibling.initialTransform,\n );\n adjustClientRect(sibling.clientRect, 0, offset);\n } else {\n elementToOffset.style.transform = combineTransforms(\n `translate3d(0, ${Math.round(sibling.offset)}px, 0)`,\n sibling.initialTransform,\n );\n adjustClientRect(sibling.clientRect, offset, 0);\n }\n });\n\n // Note that it's important that we do this after the client rects have been adjusted.\n this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY);\n this._previousSwap.drag = siblingAtNewPosition.drag;\n this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y;\n\n return {previousIndex: currentIndex, currentIndex: newIndex};\n }\n\n /**\n * Called when an item is being moved into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: T, pointerX: number, pointerY: number, index?: number): void {\n const newIndex =\n index == null || index < 0\n ? // We use the coordinates of where the item entered the drop\n // zone to figure out at which index it should be inserted.\n this._getItemIndexFromPointerPosition(item, pointerX, pointerY)\n : index;\n\n const activeDraggables = this._activeDraggables;\n const currentIndex = activeDraggables.indexOf(item);\n const placeholder = item.getPlaceholderElement();\n let newPositionReference: T | undefined = activeDraggables[newIndex];\n\n // If the item at the new position is the same as the item that is being dragged,\n // it means that we're trying to restore the item to its initial position. In this\n // case we should use the next item from the list as the reference.\n if (newPositionReference === item) {\n newPositionReference = activeDraggables[newIndex + 1];\n }\n\n // If we didn't find a new position reference, it means that either the item didn't start off\n // in this container, or that the item requested to be inserted at the end of the list.\n if (\n !newPositionReference &&\n (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) &&\n this._shouldEnterAsFirstChild(pointerX, pointerY)\n ) {\n newPositionReference = activeDraggables[0];\n }\n\n // Since the item may be in the `activeDraggables` already (e.g. if the user dragged it\n // into another container and back again), we have to ensure that it isn't duplicated.\n if (currentIndex > -1) {\n activeDraggables.splice(currentIndex, 1);\n }\n\n // Don't use items that are being dragged as a reference, because\n // their element has been moved down to the bottom of the body.\n if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) {\n const element = newPositionReference.getRootElement();\n element.parentElement!.insertBefore(placeholder, element);\n activeDraggables.splice(newIndex, 0, item);\n } else {\n coerceElement(this._element).appendChild(placeholder);\n activeDraggables.push(item);\n }\n\n // The transform needs to be cleared so it doesn't throw off the measurements.\n placeholder.style.transform = '';\n\n // Note that usually `start` is called together with `enter` when an item goes into a new\n // container. This will cache item positions, but we need to refresh them since the amount\n // of items has changed.\n this._cacheItemPositions();\n }\n\n /** Sets the items that are currently part of the list. */\n withItems(items: readonly T[]): void {\n this._activeDraggables = items.slice();\n this._cacheItemPositions();\n }\n\n /** Assigns a sort predicate to the strategy. */\n withSortPredicate(predicate: SortPredicate<T>): void {\n this._sortPredicate = predicate;\n }\n\n /** Resets the strategy to its initial state before dragging was started. */\n reset() {\n // TODO(crisbeto): may have to wait for the animations to finish.\n this._activeDraggables.forEach(item => {\n const rootElement = item.getRootElement();\n\n if (rootElement) {\n const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform;\n rootElement.style.transform = initialTransform || '';\n }\n });\n\n this._itemPositions = [];\n this._activeDraggables = [];\n this._previousSwap.drag = null;\n this._previousSwap.delta = 0;\n this._previousSwap.overlaps = false;\n }\n\n /**\n * Gets a snapshot of items currently in the list.\n * Can include items that we dragged in from another list.\n */\n getActiveItemsSnapshot(): readonly T[] {\n return this._activeDraggables;\n }\n\n /** Gets the index of a specific item. */\n getItemIndex(item: T): number {\n // Items are sorted always by top/left in the cache, however they flow differently in RTL.\n // The rest of the logic still stands no matter what orientation we're in, however\n // we need to invert the array when determining the index.\n const items =\n this.orientation === 'horizontal' && this.direction === 'rtl'\n ? this._itemPositions.slice().reverse()\n : this._itemPositions;\n\n return items.findIndex(currentItem => currentItem.drag === item);\n }\n\n /** Used to notify the strategy that the scroll position has changed. */\n updateOnScroll(topDifference: number, leftDifference: number) {\n // Since we know the amount that the user has scrolled we can shift all of the\n // client rectangles ourselves. This is cheaper than re-measuring everything and\n // we can avoid inconsistent behavior where we might be measuring the element before\n // its position has changed.\n this._itemPositions.forEach(({clientRect}) => {\n adjustClientRect(clientRect, topDifference, leftDifference);\n });\n\n // We need two loops for this, because we want all of the cached\n // positions to be up-to-date before we re-sort the item.\n this._itemPositions.forEach(({drag}) => {\n if (this._dragDropRegistry.isDragging(drag)) {\n // We need to re-sort the item manually, because the pointer move\n // events won't be dispatched while the user is scrolling.\n drag._sortFromLastPointerPosition();\n }\n });\n }\n\n /** Refreshes the position cache of the items and sibling containers. */\n private _cacheItemPositions() {\n const isHorizontal = this.orientation === 'horizontal';\n\n this._itemPositions = this._activeDraggables\n .map(drag => {\n const elementToMeasure = drag.getVisibleElement();\n return {\n drag,\n offset: 0,\n initialTransform: elementToMeasure.style.transform || '',\n clientRect: getMutableClientRect(elementToMeasure),\n };\n })\n .sort((a, b) => {\n return isHorizontal\n ? a.clientRect.left - b.clientRect.left\n : a.clientRect.top - b.clientRect.top;\n });\n }\n\n /**\n * Gets the offset in pixels by which the item that is being dragged should be moved.\n * @param currentPosition Current position of the item.\n * @param newPosition Position of the item where the current item should be moved.\n * @param delta Direction in which the user is moving.\n */\n private _getItemOffsetPx(currentPosition: ClientRect, newPosition: ClientRect, delta: 1 | -1) {\n const isHorizontal = this.orientation === 'horizontal';\n let itemOffset = isHorizontal\n ? newPosition.left - currentPosition.left\n : newPosition.top - currentPosition.top;\n\n // Account for differences in the item width/height.\n if (delta === -1) {\n itemOffset += isHorizontal\n ? newPosition.width - currentPosition.width\n : newPosition.height - currentPosition.height;\n }\n\n return itemOffset;\n }\n\n /**\n * Gets the offset in pixels by which the items that aren't being dragged should be moved.\n * @param currentIndex Index of the item currently being dragged.\n * @param siblings All of the items in the list.\n * @param delta Direction in which the user is moving.\n */\n private _getSiblingOffsetPx(\n currentIndex: number,\n siblings: CachedItemPosition<T>[],\n delta: 1 | -1,\n ) {\n const isHorizontal = this.orientation === 'horizontal';\n const currentPosition = siblings[currentIndex].clientRect;\n const immediateSibling = siblings[currentIndex + delta * -1];\n let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta;\n\n if (immediateSibling) {\n const start = isHorizontal ? 'left' : 'top';\n const end = isHorizontal ? 'right' : 'bottom';\n\n // Get the spacing between the start of the current item and the end of the one immediately\n // after it in the direction in which the user is dragging, or vice versa. We add it to the\n // offset in order to push the element to where it will be when it's inline and is influenced\n // by the `margin` of its siblings.\n if (delta === -1) {\n siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end];\n } else {\n siblingOffset += currentPosition[start] - immediateSibling.clientRect[end];\n }\n }\n\n return siblingOffset;\n }\n\n /**\n * Checks if pointer is entering in the first position\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n */\n private _shouldEnterAsFirstChild(pointerX: number, pointerY: number) {\n if (!this._activeDraggables.length) {\n return false;\n }\n\n const itemPositions = this._itemPositions;\n const isHorizontal = this.orientation === 'horizontal';\n\n // `itemPositions` are sorted by position while `activeDraggables` are sorted by child index\n // check if container is using some sort of \"reverse\" ordering (eg: flex-direction: row-reverse)\n const reversed = itemPositions[0].drag !== this._activeDraggables[0];\n if (reversed) {\n const lastItemRect = itemPositions[itemPositions.length - 1].clientRect;\n return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom;\n } else {\n const firstItemRect = itemPositions[0].clientRect;\n return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top;\n }\n }\n\n /**\n * Gets the index of an item in the drop container, based on the position of the user's pointer.\n * @param item Item that is being sorted.\n * @param pointerX Position of the user's pointer along the X axis.\n * @param pointerY Position of the user's pointer along the Y axis.\n * @param delta Direction in which the user is moving their pointer.\n */\n private _getItemIndexFromPointerPosition(\n item: T,\n pointerX: number,\n pointerY: number,\n delta?: {x: number; y: number},\n ): number {\n const isHorizontal = this.orientation === 'horizontal';\n const index = this._itemPositions.findIndex(({drag, clientRect}) => {\n // Skip the item itself.\n if (drag === item) {\n return false;\n }\n\n if (delta) {\n const direction = isHorizontal ? delta.x : delta.y;\n\n // If the user is still hovering over the same item as last time, their cursor hasn't left\n // the item after we made the swap, and they didn't change the direction in which they're\n // dragging, we don't consider it a direction swap.\n if (\n drag === this._previousSwap.drag &&\n this._previousSwap.overlaps &&\n direction === this._previousSwap.delta\n ) {\n return false;\n }\n }\n\n return isHorizontal\n ? // Round these down since most browsers report client rects with\n // sub-pixel precision, whereas the pointer coordinates are rounded to pixels.\n pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right)\n : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom);\n });\n\n return index === -1 || !this._sortPredicate(index, item) ? -1 : index;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {_getShadowRoot} from '@angular/cdk/platform';\nimport {Subject, Subscription, interval, animationFrameScheduler} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {DragDropRegistry} from './drag-drop-registry';\nimport {DragRefInternal as DragRef, Point} from './drag-ref';\nimport {isPointerNearClientRect, isInsideClientRect} from './dom/client-rect';\nimport {ParentPositionTracker} from './dom/parent-position-tracker';\nimport {DragCSSStyleDeclaration} from './dom/styling';\nimport {DropListSortStrategy} from './sorting/drop-list-sort-strategy';\nimport {SingleAxisSortStrategy} from './sorting/single-axis-sort-strategy';\n\n/**\n * Proximity, as a ratio to width/height, at which a\n * dragged item will affect the drop container.\n */\nconst DROP_PROXIMITY_THRESHOLD = 0.05;\n\n/**\n * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the\n * viewport. The value comes from trying it out manually until it feels right.\n */\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\n\n/** Vertical direction in which we can auto-scroll. */\nconst enum AutoScrollVerticalDirection {\n NONE,\n UP,\n DOWN,\n}\n\n/** Horizontal direction in which we can auto-scroll. */\nconst enum AutoScrollHorizontalDirection {\n NONE,\n LEFT,\n RIGHT,\n}\n\n/**\n * Internal compile-time-only representation of a `DropListRef`.\n * Used to avoid circular import issues between the `DropListRef` and the `DragRef`.\n * @docs-private\n */\nexport interface DropListRefInternal extends DropListRef {}\n\ntype RootNode = DocumentOrShadowRoot & {\n // As of TS 4.4 the built in DOM typings don't include `elementFromPoint` on `ShadowRoot`,\n // even though it exists (see https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot).\n // This type is a utility to avoid having to add casts everywhere.\n elementFromPoint(x: number, y: number): Element | null;\n};\n\n/**\n * Reference to a drop list. Used to manipulate or dispose of the container.\n */\nexport class DropListRef<T = any> {\n /** Element that the drop list is attached to. */\n element: HTMLElement | ElementRef<HTMLElement>;\n\n /** Whether starting a dragging sequence from this container is disabled. */\n disabled: boolean = false;\n\n /** Whether sorting items within the list is disabled. */\n sortingDisabled: boolean = false;\n\n /** Locks the position of the draggable elements inside the container along the specified axis. */\n lockAxis: 'x' | 'y';\n\n /**\n * Whether auto-scrolling the view when the user\n * moves their pointer close to the edges is disabled.\n */\n autoScrollDisabled: boolean = false;\n\n /** Number of pixels to scroll for each frame when auto-scrolling an element. */\n autoScrollStep: number = 2;\n\n /**\n * Function that is used to determine whether an item\n * is allowed to be moved into a drop container.\n */\n enterPredicate: (drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Function that is used to determine whether an item can be sorted into a particular index. */\n sortPredicate: (index: number, drag: DragRef, drop: DropListRef) => boolean = () => true;\n\n /** Emits right before dragging has started. */\n readonly beforeStarted = new Subject<void>();\n\n /**\n * Emits when the user has moved a new drag item into this container.\n */\n readonly entered = new Subject<{item: DragRef; container: DropListRef; currentIndex: number}>();\n\n /**\n * Emits when the user removes an item from the container\n * by dragging it into another container.\n */\n readonly exited = new Subject<{item: DragRef; container: DropListRef}>();\n\n /** Emits when the user drops an item inside the container. */\n readonly dropped = new Subject<{\n item: DragRef;\n currentIndex: number;\n previousIndex: number;\n container: DropListRef;\n previousContainer: DropListRef;\n isPointerOverContainer: boolean;\n distance: Point;\n dropPoint: Point;\n event: MouseEvent | TouchEvent;\n }>();\n\n /** Emits as the user is swapping items while actively dragging. */\n readonly sorted = new Subject<{\n previousIndex: number;\n currentIndex: number;\n container: DropListRef;\n item: DragRef;\n }>();\n\n /** Emits when a dragging sequence is started in a list connected to the current one. */\n readonly receivingStarted = new Subject<{\n receiver: DropListRef;\n initiator: DropListRef;\n items: DragRef[];\n }>();\n\n /** Emits when a dragging sequence is stopped from a list connected to the current one. */\n readonly receivingStopped = new Subject<{\n receiver: DropListRef;\n initiator: DropListRef;\n }>();\n\n /** Arbitrary data that can be attached to the drop list. */\n data: T;\n\n /** Whether an item in the list is being dragged. */\n private _isDragging = false;\n\n /** Keeps track of the positions of any parent scrollable elements. */\n private _parentPositions: ParentPositionTracker;\n\n /** Strategy being used to sort items within the list. */\n private _sortStrategy: DropListSortStrategy<DragRef>;\n\n /** Cached `ClientRect` of the drop list. */\n private _clientRect: ClientRect | undefined;\n\n /** Draggable items in the container. */\n private _draggables: readonly DragRef[] = [];\n\n /** Drop lists that are connected to the current one. */\n private _siblings: readonly DropListRef[] = [];\n\n /** Connected siblings that currently have a dragged item. */\n private _activeSiblings = new Set<DropListRef>();\n\n /** Subscription to the window being scrolled. */\n private _viewportScrollSubscription = Subscription.EMPTY;\n\n /** Vertical direction in which the list is currently scrolling. */\n private _verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n\n /** Horizontal direction in which the list is currently scrolling. */\n private _horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n /** Node that is being auto-scrolled. */\n private _scrollNode: HTMLElement | Window;\n\n /** Used to signal to the current auto-scroll sequence when to stop. */\n private readonly _stopScrollTimers = new Subject<void>();\n\n /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */\n private _cachedShadowRoot: RootNode | null = null;\n\n /** Reference to the document. */\n private _document: Document;\n\n /** Elements that can be scrolled while the user is dragging. */\n private _scrollableElements: HTMLElement[];\n\n /** Initial value for the element's `scroll-snap-type` style. */\n private _initialScrollSnap: string;\n\n constructor(\n element: ElementRef<HTMLElement> | HTMLElement,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n ) {\n this.element = coerceElement(element);\n this._document = _document;\n this.withScrollableParents([this.element]);\n _dragDropRegistry.registerDropContainer(this);\n this._parentPositions = new ParentPositionTracker(_document);\n this._sortStrategy = new SingleAxisSortStrategy(this.element, _dragDropRegistry);\n this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));\n }\n\n /** Removes the drop list functionality from the DOM element. */\n dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this.receivingStarted.complete();\n this.receivingStopped.complete();\n this._activeSiblings.clear();\n this._scrollNode = null!;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }\n\n /** Whether an item from this list is currently being dragged. */\n isDragging() {\n return this._isDragging;\n }\n\n /** Starts dragging an item. */\n start(): void {\n this._draggingStarted();\n this._notifyReceivingSiblings();\n }\n\n /**\n * Attempts to move an item into the container.\n * @param item Item that was moved into the container.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param index Index at which the item entered. If omitted, the container will try to figure it\n * out automatically.\n */\n enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void {\n this._draggingStarted();\n\n // If sorting is disabled, we want the item to return to its starting\n // position if the user is returning it to its initial container.\n if (index == null && this.sortingDisabled) {\n index = this._draggables.indexOf(item);\n }\n\n this._sortStrategy.enter(item, pointerX, pointerY, index);\n\n // Note that this usually happens inside `_draggingStarted` as well, but the dimensions\n // can change when the sort strategy moves the item around inside `enter`.\n this._cacheParentPositions();\n\n // Notify siblings at the end so that the item has been inserted into the `activeDraggables`.\n this._notifyReceivingSiblings();\n this.entered.next({item, container: this, currentIndex: this.getItemIndex(item)});\n }\n\n /**\n * Removes an item from the container after it was dragged into another container by the user.\n * @param item Item that was dragged out.\n */\n exit(item: DragRef): void {\n this._reset();\n this.exited.next({item, container: this});\n }\n\n /**\n * Drops an item into this container.\n * @param item Item being dropped into the container.\n * @param currentIndex Index at which the item should be inserted.\n * @param previousIndex Index of the item when dragging started.\n * @param previousContainer Container from which the item got dragged in.\n * @param isPointerOverContainer Whether the user's pointer was over the\n * container when the item was dropped.\n * @param distance Distance the user has dragged since the start of the dragging sequence.\n * @param event Event that triggered the dropping sequence.\n *\n * @breaking-change 15.0.0 `previousIndex` and `event` parameters to become required.\n */\n drop(\n item: DragRef,\n currentIndex: number,\n previousIndex: number,\n previousContainer: DropListRef,\n isPointerOverContainer: boolean,\n distance: Point,\n dropPoint: Point,\n event: MouseEvent | TouchEvent = {} as any,\n ): void {\n this._reset();\n this.dropped.next({\n item,\n currentIndex,\n previousIndex,\n container: this,\n previousContainer,\n isPointerOverContainer,\n distance,\n dropPoint,\n event,\n });\n }\n\n /**\n * Sets the draggable items that are a part of this list.\n * @param items Items that are a part of this list.\n */\n withItems(items: DragRef[]): this {\n const previousItems = this._draggables;\n this._draggables = items;\n items.forEach(item => item._withDropContainer(this));\n\n if (this.isDragging()) {\n const draggedItems = previousItems.filter(item => item.isDragging());\n\n // If all of the items being dragged were removed\n // from the list, abort the current drag sequence.\n if (draggedItems.every(item => items.indexOf(item) === -1)) {\n this._reset();\n } else {\n this._sortStrategy.withItems(this._draggables);\n }\n }\n\n return this;\n }\n\n /** Sets the layout direction of the drop list. */\n withDirection(direction: Direction): this {\n this._sortStrategy.direction = direction;\n return this;\n }\n\n /**\n * Sets the containers that are connected to this one. When two or more containers are\n * connected, the user will be allowed to transfer items between them.\n * @param connectedTo Other containers that the current containers should be connected to.\n */\n connectedTo(connectedTo: DropListRef[]): this {\n this._siblings = connectedTo.slice();\n return this;\n }\n\n /**\n * Sets the orientation of the container.\n * @param orientation New orientation for the container.\n */\n withOrientation(orientation: 'vertical' | 'horizontal'): this {\n // TODO(crisbeto): eventually we should be constructing the new sort strategy here based on\n // the new orientation. For now we can assume that it'll always be `SingleAxisSortStrategy`.\n (this._sortStrategy as SingleAxisSortStrategy<DragRef>).orientation = orientation;\n return this;\n }\n\n /**\n * Sets which parent elements are can be scrolled while the user is dragging.\n * @param elements Elements that can be scrolled.\n */\n withScrollableParents(elements: HTMLElement[]): this {\n const element = coerceElement(this.element);\n\n // We always allow the current element to be scrollable\n // so we need to ensure that it's in the array.\n this._scrollableElements =\n elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice();\n return this;\n }\n\n /** Gets the scrollable parents that are registered with this drop container. */\n getScrollableParents(): readonly HTMLElement[] {\n return this._scrollableElements;\n }\n\n /**\n * Figures out the index of an item in the container.\n * @param item Item whose index should be determined.\n */\n getItemIndex(item: DragRef): number {\n return this._isDragging\n ? this._sortStrategy.getItemIndex(item)\n : this._draggables.indexOf(item);\n }\n\n /**\n * Whether the list is able to receive the item that\n * is currently being dragged inside a connected drop list.\n */\n isReceiving(): boolean {\n return this._activeSiblings.size > 0;\n }\n\n /**\n * Sorts an item inside the container based on its position.\n * @param item Item to be sorted.\n * @param pointerX Position of the item along the X axis.\n * @param pointerY Position of the item along the Y axis.\n * @param pointerDelta Direction in which the pointer is moving along each axis.\n */\n _sortItem(\n item: DragRef,\n pointerX: number,\n pointerY: number,\n pointerDelta: {x: number; y: number},\n ): void {\n // Don't sort the item if sorting is disabled or it's out of range.\n if (\n this.sortingDisabled ||\n !this._clientRect ||\n !isPointerNearClientRect(this._clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)\n ) {\n return;\n }\n\n const result = this._sortStrategy.sort(item, pointerX, pointerY, pointerDelta);\n\n if (result) {\n this.sorted.next({\n previousIndex: result.previousIndex,\n currentIndex: result.currentIndex,\n container: this,\n item,\n });\n }\n }\n\n /**\n * Checks whether the user's pointer is close to the edges of either the\n * viewport or the drop list and starts the auto-scroll sequence.\n * @param pointerX User's pointer position along the x axis.\n * @param pointerY User's pointer position along the y axis.\n */\n _startScrollingIfNecessary(pointerX: number, pointerY: number) {\n if (this.autoScrollDisabled) {\n return;\n }\n\n let scrollNode: HTMLElement | Window | undefined;\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Check whether we should start scrolling any of the parent containers.\n this._parentPositions.positions.forEach((position, element) => {\n // We have special handling for the `document` below. Also this would be\n // nicer with a for...of loop, but it requires changing a compiler flag.\n if (element === this._document || !position.clientRect || scrollNode) {\n return;\n }\n\n if (\n isPointerNearClientRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)\n ) {\n [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(\n element as HTMLElement,\n position.clientRect,\n pointerX,\n pointerY,\n );\n\n if (verticalScrollDirection || horizontalScrollDirection) {\n scrollNode = element as HTMLElement;\n }\n }\n });\n\n // Otherwise check if we can start scrolling the viewport.\n if (!verticalScrollDirection && !horizontalScrollDirection) {\n const {width, height} = this._viewportRuler.getViewportSize();\n const clientRect = {\n width,\n height,\n top: 0,\n right: width,\n bottom: height,\n left: 0,\n } as ClientRect;\n verticalScrollDirection = getVerticalScrollDirection(clientRect, pointerY);\n horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);\n scrollNode = window;\n }\n\n if (\n scrollNode &&\n (verticalScrollDirection !== this._verticalScrollDirection ||\n horizontalScrollDirection !== this._horizontalScrollDirection ||\n scrollNode !== this._scrollNode)\n ) {\n this._verticalScrollDirection = verticalScrollDirection;\n this._horizontalScrollDirection = horizontalScrollDirection;\n this._scrollNode = scrollNode;\n\n if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) {\n this._ngZone.runOutsideAngular(this._startScrollInterval);\n } else {\n this._stopScrolling();\n }\n }\n }\n\n /** Stops any currently-running auto-scroll sequences. */\n _stopScrolling() {\n this._stopScrollTimers.next();\n }\n\n /** Starts the dragging sequence within the list. */\n private _draggingStarted() {\n const styles = coerceElement(this.element).style as DragCSSStyleDeclaration;\n this.beforeStarted.next();\n this._isDragging = true;\n\n // We need to disable scroll snapping while the user is dragging, because it breaks automatic\n // scrolling. The browser seems to round the value based on the snapping points which means\n // that we can't increment/decrement the scroll position.\n this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || '';\n styles.scrollSnapType = styles.msScrollSnapType = 'none';\n this._sortStrategy.start(this._draggables);\n this._cacheParentPositions();\n this._viewportScrollSubscription.unsubscribe();\n this._listenToScrollEvents();\n }\n\n /** Caches the positions of the configured scrollable parents. */\n private _cacheParentPositions() {\n const element = coerceElement(this.element);\n this._parentPositions.cache(this._scrollableElements);\n\n // The list element is always in the `scrollableElements`\n // so we can take advantage of the cached `ClientRect`.\n this._clientRect = this._parentPositions.positions.get(element)!.clientRect!;\n }\n\n /** Resets the container to its initial state. */\n private _reset() {\n this._isDragging = false;\n\n const styles = coerceElement(this.element).style as DragCSSStyleDeclaration;\n styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap;\n\n this._siblings.forEach(sibling => sibling._stopReceiving(this));\n this._sortStrategy.reset();\n this._stopScrolling();\n this._viewportScrollSubscription.unsubscribe();\n this._parentPositions.clear();\n }\n\n /** Starts the interval that'll auto-scroll the element. */\n private _startScrollInterval = () => {\n this._stopScrolling();\n\n interval(0, animationFrameScheduler)\n .pipe(takeUntil(this._stopScrollTimers))\n .subscribe(() => {\n const node = this._scrollNode;\n const scrollStep = this.autoScrollStep;\n\n if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {\n node.scrollBy(0, -scrollStep);\n } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\n node.scrollBy(0, scrollStep);\n }\n\n if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\n node.scrollBy(-scrollStep, 0);\n } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\n node.scrollBy(scrollStep, 0);\n }\n });\n };\n\n /**\n * Checks whether the user's pointer is positioned over the container.\n * @param x Pointer position along the X axis.\n * @param y Pointer position along the Y axis.\n */\n _isOverContainer(x: number, y: number): boolean {\n return this._clientRect != null && isInsideClientRect(this._clientRect, x, y);\n }\n\n /**\n * Figures out whether an item should be moved into a sibling\n * drop container, based on its current position.\n * @param item Drag item that is being moved.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _getSiblingContainerFromPosition(item: DragRef, x: number, y: number): DropListRef | undefined {\n return this._siblings.find(sibling => sibling._canReceive(item, x, y));\n }\n\n /**\n * Checks whether the drop list can receive the passed-in item.\n * @param item Item that is being dragged into the list.\n * @param x Position of the item along the X axis.\n * @param y Position of the item along the Y axis.\n */\n _canReceive(item: DragRef, x: number, y: number): boolean {\n if (\n !this._clientRect ||\n !isInsideClientRect(this._clientRect, x, y) ||\n !this.enterPredicate(item, this)\n ) {\n return false;\n }\n\n const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y) as HTMLElement | null;\n\n // If there's no element at the pointer position, then\n // the client rect is probably scrolled out of the view.\n if (!elementFromPoint) {\n return false;\n }\n\n const nativeElement = coerceElement(this.element);\n\n // The `ClientRect`, that we're using to find the container over which the user is\n // hovering, doesn't give us any information on whether the element has been scrolled\n // out of the view or whether it's overlapping with other containers. This means that\n // we could end up transferring the item into a container that's invisible or is positioned\n // below another one. We use the result from `elementFromPoint` to get the top-most element\n // at the pointer position and to find whether it's one of the intersecting drop containers.\n return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint);\n }\n\n /**\n * Called by one of the connected drop lists when a dragging sequence has started.\n * @param sibling Sibling in which dragging has started.\n */\n _startReceiving(sibling: DropListRef, items: DragRef[]) {\n const activeSiblings = this._activeSiblings;\n\n if (\n !activeSiblings.has(sibling) &&\n items.every(item => {\n // Note that we have to add an exception to the `enterPredicate` for items that started off\n // in this drop list. The drag ref has logic that allows an item to return to its initial\n // container, if it has left the initial container and none of the connected containers\n // allow it to enter. See `DragRef._updateActiveDropContainer` for more context.\n return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1;\n })\n ) {\n activeSiblings.add(sibling);\n this._cacheParentPositions();\n this._listenToScrollEvents();\n this.receivingStarted.next({\n initiator: sibling,\n receiver: this,\n items,\n });\n }\n }\n\n /**\n * Called by a connected drop list when dragging has stopped.\n * @param sibling Sibling whose dragging has stopped.\n */\n _stopReceiving(sibling: DropListRef) {\n this._activeSiblings.delete(sibling);\n this._viewportScrollSubscription.unsubscribe();\n this.receivingStopped.next({initiator: sibling, receiver: this});\n }\n\n /**\n * Starts listening to scroll events on the viewport.\n * Used for updating the internal state of the list.\n */\n private _listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n\n if (scrollDifference) {\n this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left);\n }\n } else if (this.isReceiving()) {\n this._cacheParentPositions();\n }\n });\n }\n\n /**\n * Lazily resolves and returns the shadow root of the element. We do this in a function, rather\n * than saving it in property directly on init, because we want to resolve it as late as possible\n * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the\n * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.\n */\n private _getShadowRoot(): RootNode {\n if (!this._cachedShadowRoot) {\n const shadowRoot = _getShadowRoot(coerceElement(this.element));\n this._cachedShadowRoot = (shadowRoot || this._document) as RootNode;\n }\n\n return this._cachedShadowRoot;\n }\n\n /** Notifies any siblings that may potentially receive the item. */\n private _notifyReceivingSiblings() {\n const draggedItems = this._sortStrategy\n .getActiveItemsSnapshot()\n .filter(item => item.isDragging());\n this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));\n }\n}\n\n/**\n * Gets whether the vertical auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getVerticalScrollDirection(clientRect: ClientRect, pointerY: number) {\n const {top, bottom, height} = clientRect;\n const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\n return AutoScrollVerticalDirection.UP;\n } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\n return AutoScrollVerticalDirection.DOWN;\n }\n\n return AutoScrollVerticalDirection.NONE;\n}\n\n/**\n * Gets whether the horizontal auto-scroll direction of a node.\n * @param clientRect Dimensions of the node.\n * @param pointerX Position of the user's pointer along the x axis.\n */\nfunction getHorizontalScrollDirection(clientRect: ClientRect, pointerX: number) {\n const {left, right, width} = clientRect;\n const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\n\n if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\n return AutoScrollHorizontalDirection.LEFT;\n } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\n return AutoScrollHorizontalDirection.RIGHT;\n }\n\n return AutoScrollHorizontalDirection.NONE;\n}\n\n/**\n * Gets the directions in which an element node should be scrolled,\n * assuming that the user's pointer is already within it scrollable region.\n * @param element Element for which we should calculate the scroll direction.\n * @param clientRect Bounding client rectangle of the element.\n * @param pointerX Position of the user's pointer along the x axis.\n * @param pointerY Position of the user's pointer along the y axis.\n */\nfunction getElementScrollDirections(\n element: HTMLElement,\n clientRect: ClientRect,\n pointerX: number,\n pointerY: number,\n): [AutoScrollVerticalDirection, AutoScrollHorizontalDirection] {\n const computedVertical = getVerticalScrollDirection(clientRect, pointerY);\n const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);\n let verticalScrollDirection = AutoScrollVerticalDirection.NONE;\n let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\n\n // Note that we here we do some extra checks for whether the element is actually scrollable in\n // a certain direction and we only assign the scroll direction if it is. We do this so that we\n // can allow other elements to be scrolled, if the current element can't be scrolled anymore.\n // This allows us to handle cases where the scroll regions of two scrollable elements overlap.\n if (computedVertical) {\n const scrollTop = element.scrollTop;\n\n if (computedVertical === AutoScrollVerticalDirection.UP) {\n if (scrollTop > 0) {\n verticalScrollDirection = AutoScrollVerticalDirection.UP;\n }\n } else if (element.scrollHeight - scrollTop > element.clientHeight) {\n verticalScrollDirection = AutoScrollVerticalDirection.DOWN;\n }\n }\n\n if (computedHorizontal) {\n const scrollLeft = element.scrollLeft;\n\n if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {\n if (scrollLeft > 0) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;\n }\n } else if (element.scrollWidth - scrollLeft > element.clientWidth) {\n horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;\n }\n }\n\n return [verticalScrollDirection, horizontalScrollDirection];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, NgZone, OnDestroy, Inject} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {merge, Observable, Observer, Subject} from 'rxjs';\n\n/** Event options that can be used to bind an active, capturing event. */\nconst activeCapturingEventOptions = normalizePassiveListenerOptions({\n passive: false,\n capture: true,\n});\n\n/**\n * Service that keeps track of all the drag item and drop container\n * instances, and manages global event listeners on the `document`.\n * @docs-private\n */\n// Note: this class is generic, rather than referencing CdkDrag and CdkDropList directly, in order\n// to avoid circular imports. If we were to reference them here, importing the registry into the\n// classes that are registering themselves will introduce a circular import.\n@Injectable({providedIn: 'root'})\nexport class DragDropRegistry<I extends {isDragging(): boolean}, C> implements OnDestroy {\n private _document: Document;\n\n /** Registered drop container instances. */\n private _dropInstances = new Set<C>();\n\n /** Registered drag item instances. */\n private _dragInstances = new Set<I>();\n\n /** Drag item instances that are currently being dragged. */\n private _activeDragInstances: I[] = [];\n\n /** Keeps track of the event listeners that we've bound to the `document`. */\n private _globalListeners = new Map<\n string,\n {\n handler: (event: Event) => void;\n options?: AddEventListenerOptions | boolean;\n }\n >();\n\n /**\n * Predicate function to check if an item is being dragged. Moved out into a property,\n * because it'll be called a lot and we don't want to create a new function every time.\n */\n private _draggingPredicate = (item: I) => item.isDragging();\n\n /**\n * Emits the `touchmove` or `mousemove` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerMove: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /**\n * Emits the `touchend` or `mouseup` events that are dispatched\n * while the user is dragging a drag item instance.\n */\n readonly pointerUp: Subject<TouchEvent | MouseEvent> = new Subject<TouchEvent | MouseEvent>();\n\n /**\n * Emits when the viewport has been scrolled while the user is dragging an item.\n * @deprecated To be turned into a private member. Use the `scrolled` method instead.\n * @breaking-change 13.0.0\n */\n readonly scroll: Subject<Event> = new Subject<Event>();\n\n constructor(private _ngZone: NgZone, @Inject(DOCUMENT) _document: any) {\n this._document = _document;\n }\n\n /** Adds a drop container to the registry. */\n registerDropContainer(drop: C) {\n if (!this._dropInstances.has(drop)) {\n this._dropInstances.add(drop);\n }\n }\n\n /** Adds a drag item instance to the registry. */\n registerDragItem(drag: I) {\n this._dragInstances.add(drag);\n\n // The `touchmove` event gets bound once, ahead of time, because WebKit\n // won't preventDefault on a dynamically-added `touchmove` listener.\n // See https://bugs.webkit.org/show_bug.cgi?id=184250.\n if (this._dragInstances.size === 1) {\n this._ngZone.runOutsideAngular(() => {\n // The event handler has to be explicitly active,\n // because newer browsers make it passive by default.\n this._document.addEventListener(\n 'touchmove',\n this._persistentTouchmoveListener,\n activeCapturingEventOptions,\n );\n });\n }\n }\n\n /** Removes a drop container from the registry. */\n removeDropContainer(drop: C) {\n this._dropInstances.delete(drop);\n }\n\n /** Removes a drag item instance from the registry. */\n removeDragItem(drag: I) {\n this._dragInstances.delete(drag);\n this.stopDragging(drag);\n\n if (this._dragInstances.size === 0) {\n this._document.removeEventListener(\n 'touchmove',\n this._persistentTouchmoveListener,\n activeCapturingEventOptions,\n );\n }\n }\n\n /**\n * Starts the dragging sequence for a drag instance.\n * @param drag Drag instance which is being dragged.\n * @param event Event that initiated the dragging.\n */\n startDragging(drag: I, event: TouchEvent | MouseEvent) {\n // Do not process the same drag twice to avoid memory leaks and redundant listeners\n if (this._activeDragInstances.indexOf(drag) > -1) {\n return;\n }\n\n this._activeDragInstances.push(drag);\n\n if (this._activeDragInstances.length === 1) {\n const isTouchEvent = event.type.startsWith('touch');\n\n // We explicitly bind __active__ listeners here, because newer browsers will default to\n // passive ones for `mousemove` and `touchmove`. The events need to be active, because we\n // use `preventDefault` to prevent the page from scrolling while the user is dragging.\n this._globalListeners\n .set(isTouchEvent ? 'touchend' : 'mouseup', {\n handler: (e: Event) => this.pointerUp.next(e as TouchEvent | MouseEvent),\n options: true,\n })\n .set('scroll', {\n handler: (e: Event) => this.scroll.next(e),\n // Use capturing so that we pick up scroll changes in any scrollable nodes that aren't\n // the document. See https://github.com/angular/components/issues/17144.\n options: true,\n })\n // Preventing the default action on `mousemove` isn't enough to disable text selection\n // on Safari so we need to prevent the selection event as well. Alternatively this can\n // be done by setting `user-select: none` on the `body`, however it has causes a style\n // recalculation which can be expensive on pages with a lot of elements.\n .set('selectstart', {\n handler: this._preventDefaultWhileDragging,\n options: activeCapturingEventOptions,\n });\n\n // We don't have to bind a move event for touch drag sequences, because\n // we already have a persistent global one bound from `registerDragItem`.\n if (!isTouchEvent) {\n this._globalListeners.set('mousemove', {\n handler: (e: Event) => this.pointerMove.next(e as MouseEvent),\n options: activeCapturingEventOptions,\n });\n }\n\n this._ngZone.runOutsideAngular(() => {\n this._globalListeners.forEach((config, name) => {\n this._document.addEventListener(name, config.handler, config.options);\n });\n });\n }\n }\n\n /** Stops dragging a drag item instance. */\n stopDragging(drag: I) {\n const index = this._activeDragInstances.indexOf(drag);\n\n if (index > -1) {\n this._activeDragInstances.splice(index, 1);\n\n if (this._activeDragInstances.length === 0) {\n this._clearGlobalListeners();\n }\n }\n }\n\n /** Gets whether a drag item instance is currently being dragged. */\n isDragging(drag: I) {\n return this._activeDragInstances.indexOf(drag) > -1;\n }\n\n /**\n * Gets a stream that will emit when any element on the page is scrolled while an item is being\n * dragged.\n * @param shadowRoot Optional shadow root that the current dragging sequence started from.\n * Top-level listeners won't pick up events coming from the shadow DOM so this parameter can\n * be used to include an additional top-level listener at the shadow root level.\n */\n scrolled(shadowRoot?: DocumentOrShadowRoot | null): Observable<Event> {\n const streams: Observable<Event>[] = [this.scroll];\n\n if (shadowRoot && shadowRoot !== this._document) {\n // Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves,\n // because we want to guarantee that the event is bound outside of the `NgZone`. With\n // `fromEvent` it'll only happen if the subscription is outside the `NgZone`.\n streams.push(\n new Observable((observer: Observer<Event>) => {\n return this._ngZone.runOutsideAngular(() => {\n const eventOptions = true;\n const callback = (event: Event) => {\n if (this._activeDragInstances.length) {\n observer.next(event);\n }\n };\n\n (shadowRoot as ShadowRoot).addEventListener('scroll', callback, eventOptions);\n\n return () => {\n (shadowRoot as ShadowRoot).removeEventListener('scroll', callback, eventOptions);\n };\n });\n }),\n );\n }\n\n return merge(...streams);\n }\n\n ngOnDestroy() {\n this._dragInstances.forEach(instance => this.removeDragItem(instance));\n this._dropInstances.forEach(instance => this.removeDropContainer(instance));\n this._clearGlobalListeners();\n this.pointerMove.complete();\n this.pointerUp.complete();\n }\n\n /**\n * Event listener that will prevent the default browser action while the user is dragging.\n * @param event Event whose default action should be prevented.\n */\n private _preventDefaultWhileDragging = (event: Event) => {\n if (this._activeDragInstances.length > 0) {\n event.preventDefault();\n }\n };\n\n /** Event listener for `touchmove` that is bound even if no dragging is happening. */\n private _persistentTouchmoveListener = (event: TouchEvent) => {\n if (this._activeDragInstances.length > 0) {\n // Note that we only want to prevent the default action after dragging has actually started.\n // Usually this is the same time at which the item is added to the `_activeDragInstances`,\n // but it could be pushed back if the user has set up a drag delay or threshold.\n if (this._activeDragInstances.some(this._draggingPredicate)) {\n event.preventDefault();\n }\n\n this.pointerMove.next(event);\n }\n };\n\n /** Clears out the global event listeners from the `document`. */\n private _clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n\n this._globalListeners.clear();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, Inject, NgZone, ElementRef} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {DragRef, DragRefConfig} from './drag-ref';\nimport {DropListRef} from './drop-list-ref';\nimport {DragDropRegistry} from './drag-drop-registry';\n\n/** Default configuration to be used when creating a `DragRef`. */\nconst DEFAULT_CONFIG = {\n dragStartThreshold: 5,\n pointerDirectionChangeThreshold: 5,\n};\n\n/**\n * Service that allows for drag-and-drop functionality to be attached to DOM elements.\n */\n@Injectable({providedIn: 'root'})\nexport class DragDrop {\n constructor(\n @Inject(DOCUMENT) private _document: any,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>,\n ) {}\n\n /**\n * Turns an element into a draggable item.\n * @param element Element to which to attach the dragging functionality.\n * @param config Object used to configure the dragging behavior.\n */\n createDrag<T = any>(\n element: ElementRef<HTMLElement> | HTMLElement,\n config: DragRefConfig = DEFAULT_CONFIG,\n ): DragRef<T> {\n return new DragRef<T>(\n element,\n config,\n this._document,\n this._ngZone,\n this._viewportRuler,\n this._dragDropRegistry,\n );\n }\n\n /**\n * Turns an element into a drop list.\n * @param element Element to which to attach the drop list functionality.\n */\n createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T> {\n return new DropListRef<T>(\n element,\n this._dragDropRegistry,\n this._document,\n this._ngZone,\n this._viewportRuler,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkScrollableModule} from '@angular/cdk/scrolling';\nimport {CdkDropList} from './directives/drop-list';\nimport {CdkDropListGroup} from './directives/drop-list-group';\nimport {CdkDrag} from './directives/drag';\nimport {CdkDragHandle} from './directives/drag-handle';\nimport {CdkDragPreview} from './directives/drag-preview';\nimport {CdkDragPlaceholder} from './directives/drag-placeholder';\nimport {DragDrop} from './drag-drop';\n\nconst DRAG_DROP_DIRECTIVES = [\n CdkDropList,\n CdkDropListGroup,\n CdkDrag,\n CdkDragHandle,\n CdkDragPreview,\n CdkDragPlaceholder,\n];\n\n@NgModule({\n imports: DRAG_DROP_DIRECTIVES,\n exports: [CdkScrollableModule, ...DRAG_DROP_DIRECTIVES],\n providers: [DragDrop],\n})\nexport class DragDropModule {}\n","import { Observable } from '../Observable';\nimport { ObservableInput, ObservedValuesFromArray, ObservedValueOf, SubscribableOrPromise } from '../types';\nimport { isArray } from '../util/isArray';\nimport { map } from '../operators/map';\nimport { isObject } from '../util/isObject';\nimport { isObservable } from '../util/isObservable';\nimport { from } from './from';\n\n/* tslint:disable:max-line-length */\n\n// forkJoin(a$, b$, c$)\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T>(v1: SubscribableOrPromise<T>): Observable<[T]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<[T, T2]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<[T, T2, T3]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<[T, T2, T3, T4]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<[T, T2, T3, T4, T5]>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<[T, T2, T3, T4, T5, T6]>;\n\n// forkJoin([a$, b$, c$]);\n// TODO(benlesh): Uncomment for TS 3.0\n// export function forkJoin(sources: []): Observable<never>;\nexport function forkJoin<A>(sources: [ObservableInput<A>]): Observable<[A]>;\nexport function forkJoin<A, B>(sources: [ObservableInput<A>, ObservableInput<B>]): Observable<[A, B]>;\nexport function forkJoin<A, B, C>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>]): Observable<[A, B, C]>;\nexport function forkJoin<A, B, C, D>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>]): Observable<[A, B, C, D]>;\nexport function forkJoin<A, B, C, D, E>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>, ObservableInput<E>]): Observable<[A, B, C, D, E]>;\nexport function forkJoin<A, B, C, D, E, F>(sources: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>, ObservableInput<E>, ObservableInput<F>]): Observable<[A, B, C, D, E, F]>;\nexport function forkJoin<A extends ObservableInput<any>[]>(sources: A): Observable<ObservedValuesFromArray<A>[]>;\n\n// forkJoin({})\nexport function forkJoin(sourcesObject: {}): Observable<never>;\nexport function forkJoin<T, K extends keyof T>(sourcesObject: T): Observable<{ [K in keyof T]: ObservedValueOf<T[K]> }>;\n\n/** @deprecated resultSelector is deprecated, pipe to map instead */\nexport function forkJoin(...args: Array<ObservableInput<any>|Function>): Observable<any>;\n/** @deprecated Use the version that takes an array of Observables instead */\nexport function forkJoin<T>(...sources: ObservableInput<T>[]): Observable<T[]>;\n/* tslint:enable:max-line-length */\n\n/**\n * Accepts an `Array` of {@link ObservableInput} or a dictionary `Object` of {@link ObservableInput} and returns\n * an {@link Observable} that emits either an array of values in the exact same order as the passed array,\n * or a dictionary of values in the same shape as the passed dictionary.\n *\n * <span class=\"informal\">Wait for Observables to complete and then combine last values they emitted.</span>\n *\n * \n *\n * `forkJoin` is an operator that takes any number of input observables which can be passed either as an array\n * or a dictionary of input observables. If no input observables are provided, resulting stream will complete\n * immediately.\n *\n * `forkJoin` will wait for all passed observables to complete and then it will emit an array or an object with last\n * values from corresponding observables.\n *\n * If you pass an array of `n` observables to the operator, resulting\n * array will have `n` values, where first value is the last thing emitted by the first observable,\n * second value is the last thing emitted by the second observable and so on.\n *\n * If you pass a dictionary of observables to the operator, resulting\n * objects will have the same keys as the dictionary passed, with their last values they've emitted\n * located at the corresponding key.\n *\n * That means `forkJoin` will not emit more than once and it will complete after that. If you need to emit combined\n * values not only at the end of lifecycle of passed observables, but also throughout it, try out {@link combineLatest}\n * or {@link zip} instead.\n *\n * In order for resulting array to have the same length as the number of input observables, whenever any of\n * that observables completes without emitting any value, `forkJoin` will complete at that moment as well\n * and it will not emit anything either, even if it already has some last values from other observables.\n * Conversely, if there is an observable that never completes, `forkJoin` will never complete as well,\n * unless at any point some other observable completes without emitting value, which brings us back to\n * the previous case. Overall, in order for `forkJoin` to emit a value, all observables passed as arguments\n * have to emit something at least once and complete.\n *\n * If any input observable errors at some point, `forkJoin` will error as well and all other observables\n * will be immediately unsubscribed.\n *\n * Optionally `forkJoin` accepts project function, that will be called with values which normally\n * would land in emitted array. Whatever is returned by project function, will appear in output\n * observable instead. This means that default project can be thought of as a function that takes\n * all its arguments and puts them into an array. Note that project function will be called only\n * when output observable is supposed to emit a result.\n *\n * ## Examples\n *\n * ### Use forkJoin with a dictionary of observable inputs\n * ```ts\n * import { forkJoin, of, timer } from 'rxjs';\n *\n * const observable = forkJoin({\n * foo: of(1, 2, 3, 4),\n * bar: Promise.resolve(8),\n * baz: timer(4000),\n * });\n * observable.subscribe({\n * next: value => console.log(value),\n * complete: () => console.log('This is how it ends!'),\n * });\n *\n * // Logs:\n * // { foo: 4, bar: 8, baz: 0 } after 4 seconds\n * // \"This is how it ends!\" immediately after\n * ```\n *\n * ### Use forkJoin with an array of observable inputs\n * ```ts\n * import { forkJoin, of } from 'rxjs';\n *\n * const observable = forkJoin([\n * of(1, 2, 3, 4),\n * Promise.resolve(8),\n * timer(4000),\n * ]);\n * observable.subscribe({\n * next: value => console.log(value),\n * complete: () => console.log('This is how it ends!'),\n * });\n *\n * // Logs:\n * // [4, 8, 0] after 4 seconds\n * // \"This is how it ends!\" immediately after\n * ```\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n *\n * @param {...ObservableInput} sources Any number of Observables provided either as an array or as an arguments\n * passed directly to the operator.\n * @param {function} [project] Function that takes values emitted by input Observables and returns value\n * that will appear in resulting Observable instead of default array.\n * @return {Observable} Observable emitting either an array of last values emitted by passed Observables\n * or value from project function.\n */\nexport function forkJoin(\n ...sources: any[]\n): Observable<any> {\n if (sources.length === 1) {\n const first = sources[0];\n if (isArray(first)) {\n return forkJoinInternal(first, null);\n }\n // TODO(benlesh): isObservable check will not be necessary when deprecated path is removed.\n if (isObject(first) && Object.getPrototypeOf(first) === Object.prototype) {\n const keys = Object.keys(first);\n return forkJoinInternal(keys.map(key => first[key]), keys);\n }\n }\n\n // DEPRECATED PATHS BELOW HERE\n if (typeof sources[sources.length - 1] === 'function') {\n const resultSelector = sources.pop() as Function;\n sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;\n return forkJoinInternal(sources, null).pipe(\n map((args: any[]) => resultSelector(...args))\n );\n }\n\n return forkJoinInternal(sources, null);\n}\n\nfunction forkJoinInternal(sources: ObservableInput<any>[], keys: string[] | null): Observable<any> {\n return new Observable(subscriber => {\n const len = sources.length;\n if (len === 0) {\n subscriber.complete();\n return;\n }\n const values = new Array(len);\n let completed = 0;\n let emitted = 0;\n for (let i = 0; i < len; i++) {\n const source = from(sources[i]);\n let hasValue = false;\n subscriber.add(source.subscribe({\n next: value => {\n if (!hasValue) {\n hasValue = true;\n emitted++;\n }\n values[i] = value;\n },\n error: err => subscriber.error(err),\n complete: () => {\n completed++;\n if (completed === len || !hasValue) {\n if (emitted === len) {\n subscriber.next(keys ?\n keys.reduce((result, key, i) => (result[key] = values[i], result), {}) :\n values);\n }\n subscriber.complete();\n }\n }\n }));\n }\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, InjectionToken, Renderer2} from '@angular/core';\n\n/**\n * @description\n * Defines an interface that acts as a bridge between the Angular forms API and a\n * native element in the DOM.\n *\n * Implement this interface to create a custom form control directive\n * that integrates with Angular forms.\n *\n * @see DefaultValueAccessor\n *\n * @publicApi\n */\nexport interface ControlValueAccessor {\n /**\n * @description\n * Writes a new value to the element.\n *\n * This method is called by the forms API to write to the view when programmatic\n * changes from model to view are requested.\n *\n * @usageNotes\n * ### Write a value to the element\n *\n * The following example writes a value to the native DOM element.\n *\n * ```ts\n * writeValue(value: any): void {\n * this._renderer.setProperty(this._elementRef.nativeElement, 'value', value);\n * }\n * ```\n *\n * @param obj The new value for the element\n */\n writeValue(obj: any): void;\n\n /**\n * @description\n * Registers a callback function that is called when the control's value\n * changes in the UI.\n *\n * This method is called by the forms API on initialization to update the form\n * model when values propagate from the view to the model.\n *\n * When implementing the `registerOnChange` method in your own value accessor,\n * save the given function so your class calls it at the appropriate time.\n *\n * @usageNotes\n * ### Store the change function\n *\n * The following example stores the provided function as an internal method.\n *\n * ```ts\n * registerOnChange(fn: (_: any) => void): void {\n * this._onChange = fn;\n * }\n * ```\n *\n * When the value changes in the UI, call the registered\n * function to allow the forms API to update itself:\n *\n * ```ts\n * host: {\n * '(change)': '_onChange($event.target.value)'\n * }\n * ```\n *\n * @param fn The callback function to register\n */\n registerOnChange(fn: any): void;\n\n /**\n * @description\n * Registers a callback function that is called by the forms API on initialization\n * to update the form model on blur.\n *\n * When implementing `registerOnTouched` in your own value accessor, save the given\n * function so your class calls it when the control should be considered\n * blurred or \"touched\".\n *\n * @usageNotes\n * ### Store the callback function\n *\n * The following example stores the provided function as an internal method.\n *\n * ```ts\n * registerOnTouched(fn: any): void {\n * this._onTouched = fn;\n * }\n * ```\n *\n * On blur (or equivalent), your class should call the registered function to allow\n * the forms API to update itself:\n *\n * ```ts\n * host: {\n * '(blur)': '_onTouched()'\n * }\n * ```\n *\n * @param fn The callback function to register\n */\n registerOnTouched(fn: any): void;\n\n /**\n * @description\n * Function that is called by the forms API when the control status changes to\n * or from 'DISABLED'. Depending on the status, it enables or disables the\n * appropriate DOM element.\n *\n * @usageNotes\n * The following is an example of writing the disabled property to a native DOM element:\n *\n * ```ts\n * setDisabledState(isDisabled: boolean): void {\n * this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n * }\n * ```\n *\n * @param isDisabled The disabled status to set on the element\n */\n setDisabledState?(isDisabled: boolean): void;\n}\n\n/**\n * Base class for all ControlValueAccessor classes defined in Forms package.\n * Contains common logic and utility functions.\n *\n * Note: this is an *internal-only* class and should not be extended or used directly in\n * applications code.\n */\n@Directive()\nexport class BaseControlValueAccessor {\n /**\n * The registered callback function called when a change or input event occurs on the input\n * element.\n * @nodoc\n */\n onChange = (_: any) => {};\n\n /**\n * The registered callback function called when a blur event occurs on the input element.\n * @nodoc\n */\n onTouched = () => {};\n\n constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {}\n\n /**\n * Helper method that sets a property on a target element using the current Renderer\n * implementation.\n * @nodoc\n */\n protected setProperty(key: string, value: any): void {\n this._renderer.setProperty(this._elementRef.nativeElement, key, value);\n }\n\n /**\n * Registers a function called when the control is touched.\n * @nodoc\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Registers a function called when the control value changes.\n * @nodoc\n */\n registerOnChange(fn: (_: any) => {}): void {\n this.onChange = fn;\n }\n\n /**\n * Sets the \"disabled\" property on the range input element.\n * @nodoc\n */\n setDisabledState(isDisabled: boolean): void {\n this.setProperty('disabled', isDisabled);\n }\n}\n\n/**\n * Base class for all built-in ControlValueAccessor classes (except DefaultValueAccessor, which is\n * used in case no other CVAs can be found). We use this class to distinguish between default CVA,\n * built-in CVAs and custom CVAs, so that Forms logic can recognize built-in CVAs and treat custom\n * ones with higher priority (when both built-in and custom CVAs are present).\n *\n * Note: this is an *internal-only* class and should not be extended or used directly in\n * applications code.\n */\n@Directive()\nexport class BuiltInControlValueAccessor extends BaseControlValueAccessor {\n}\n\n/**\n * Used to provide a `ControlValueAccessor` for form controls.\n *\n * See `DefaultValueAccessor` for how to implement one.\n *\n * @publicApi\n */\nexport const NG_VALUE_ACCESSOR =\n new InjectionToken<ReadonlyArray<ControlValueAccessor>>('NgValueAccessor');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵgetDOM as getDOM} from '@angular/common';\nimport {Directive, ElementRef, forwardRef, Inject, InjectionToken, Optional, Renderer2} from '@angular/core';\n\nimport {BaseControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';\n\nexport const DEFAULT_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DefaultValueAccessor),\n multi: true\n};\n\n/**\n * We must check whether the agent is Android because composition events\n * behave differently between iOS and Android.\n */\nfunction _isAndroid(): boolean {\n const userAgent = getDOM() ? getDOM().getUserAgent() : '';\n return /android (\\d+)/.test(userAgent.toLowerCase());\n}\n\n/**\n * @description\n * Provide this token to control if form directives buffer IME input until\n * the \"compositionend\" event occurs.\n * @publicApi\n */\nexport const COMPOSITION_BUFFER_MODE = new InjectionToken<boolean>('CompositionEventMode');\n\n/**\n * The default `ControlValueAccessor` for writing a value and listening to changes on input\n * elements. The accessor is used by the `FormControlDirective`, `FormControlName`, and\n * `NgModel` directives.\n *\n * {@searchKeywords ngDefaultControl}\n *\n * @usageNotes\n *\n * ### Using the default value accessor\n *\n * The following example shows how to use an input element that activates the default value accessor\n * (in this case, a text field).\n *\n * ```ts\n * const firstNameControl = new FormControl();\n * ```\n *\n * ```\n * <input type=\"text\" [formControl]=\"firstNameControl\">\n * ```\n *\n * This value accessor is used by default for `<input type=\"text\">` and `<textarea>` elements, but\n * you could also use it for custom components that have similar behavior and do not require special\n * processing. In order to attach the default value accessor to a custom element, add the\n * `ngDefaultControl` attribute as shown below.\n *\n * ```\n * <custom-input-component ngDefaultControl [(ngModel)]=\"value\"></custom-input-component>\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',\n // TODO: vsavkin replace the above selector with the one below it once\n // https://github.com/angular/angular/issues/3011 is implemented\n // selector: '[ngModel],[formControl],[formControlName]',\n host: {\n '(input)': '$any(this)._handleInput($event.target.value)',\n '(blur)': 'onTouched()',\n '(compositionstart)': '$any(this)._compositionStart()',\n '(compositionend)': '$any(this)._compositionEnd($event.target.value)'\n },\n providers: [DEFAULT_VALUE_ACCESSOR]\n})\nexport class DefaultValueAccessor extends BaseControlValueAccessor implements ControlValueAccessor {\n /** Whether the user is creating a composition string (IME events). */\n private _composing = false;\n\n constructor(\n renderer: Renderer2, elementRef: ElementRef,\n @Optional() @Inject(COMPOSITION_BUFFER_MODE) private _compositionMode: boolean) {\n super(renderer, elementRef);\n if (this._compositionMode == null) {\n this._compositionMode = !_isAndroid();\n }\n }\n\n /**\n * Sets the \"value\" property on the input element.\n * @nodoc\n */\n writeValue(value: any): void {\n const normalizedValue = value == null ? '' : value;\n this.setProperty('value', normalizedValue);\n }\n\n /** @internal */\n _handleInput(value: any): void {\n if (!this._compositionMode || (this._compositionMode && !this._composing)) {\n this.onChange(value);\n }\n }\n\n /** @internal */\n _compositionStart(): void {\n this._composing = true;\n }\n\n /** @internal */\n _compositionEnd(value: any): void {\n this._composing = false;\n this._compositionMode && this.onChange(value);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken, ɵisObservable as isObservable, ɵisPromise as isPromise, ɵRuntimeError as RuntimeError} from '@angular/core';\nimport {forkJoin, from, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\nimport {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './directives/validators';\nimport {RuntimeErrorCode} from './errors';\nimport {AbstractControl} from './model/abstract_model';\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;\n\nfunction isEmptyInputValue(value: any): boolean {\n /**\n * Check if the object is a string or array before evaluating the length attribute.\n * This avoids falsely rejecting objects that contain a custom length attribute.\n * For example, the object {id: 1, length: 0, width: 0} should not be returned as empty.\n */\n return value == null ||\n ((typeof value === 'string' || Array.isArray(value)) && value.length === 0);\n}\n\nfunction hasValidLength(value: any): boolean {\n // non-strict comparison is intentional, to check for both `null` and `undefined` values\n return value != null && typeof value.length === 'number';\n}\n\n/**\n * @description\n * An `InjectionToken` for registering additional synchronous validators used with\n * `AbstractControl`s.\n *\n * @see `NG_ASYNC_VALIDATORS`\n *\n * @usageNotes\n *\n * ### Providing a custom validator\n *\n * The following example registers a custom validator directive. Adding the validator to the\n * existing collection of validators requires the `multi: true` option.\n *\n * ```typescript\n * @Directive({\n * selector: '[customValidator]',\n * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]\n * })\n * class CustomValidatorDirective implements Validator {\n * validate(control: AbstractControl): ValidationErrors | null {\n * return { 'custom': true };\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport const NG_VALIDATORS = new InjectionToken<Array<Validator|Function>>('NgValidators');\n\n/**\n * @description\n * An `InjectionToken` for registering additional asynchronous validators used with\n * `AbstractControl`s.\n *\n * @see `NG_VALIDATORS`\n *\n * @usageNotes\n *\n * ### Provide a custom async validator directive\n *\n * The following example implements the `AsyncValidator` interface to create an\n * async validator directive with a custom error key.\n *\n * ```typescript\n * @Directive({\n * selector: '[customAsyncValidator]',\n * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi:\n * true}]\n * })\n * class CustomAsyncValidatorDirective implements AsyncValidator {\n * validate(control: AbstractControl): Promise<ValidationErrors|null> {\n * return Promise.resolve({'custom': true});\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport const NG_ASYNC_VALIDATORS =\n new InjectionToken<Array<Validator|Function>>('NgAsyncValidators');\n\n/**\n * A regular expression that matches valid e-mail addresses.\n *\n * At a high level, this regexp matches e-mail addresses of the format `local-part@tld`, where:\n * - `local-part` consists of one or more of the allowed characters (alphanumeric and some\n * punctuation symbols).\n * - `local-part` cannot begin or end with a period (`.`).\n * - `local-part` cannot be longer than 64 characters.\n * - `tld` consists of one or more `labels` separated by periods (`.`). For example `localhost` or\n * `foo.com`.\n * - A `label` consists of one or more of the allowed characters (alphanumeric, dashes (`-`) and\n * periods (`.`)).\n * - A `label` cannot begin or end with a dash (`-`) or a period (`.`).\n * - A `label` cannot be longer than 63 characters.\n * - The whole address cannot be longer than 254 characters.\n *\n * ## Implementation background\n *\n * This regexp was ported over from AngularJS (see there for git history):\n * https://github.com/angular/angular.js/blob/c133ef836/src/ng/directive/input.js#L27\n * It is based on the\n * [WHATWG version](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with\n * some enhancements to incorporate more RFC rules (such as rules related to domain names and the\n * lengths of different parts of the address). The main differences from the WHATWG version are:\n * - Disallow `local-part` to begin or end with a period (`.`).\n * - Disallow `local-part` length to exceed 64 characters.\n * - Disallow total address length to exceed 254 characters.\n *\n * See [this commit](https://github.com/angular/angular.js/commit/f3f5cf72e) for more details.\n */\nconst EMAIL_REGEXP =\n /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\n/**\n * @description\n * Provides a set of built-in validators that can be used by form controls.\n *\n * A validator is a function that processes a `FormControl` or collection of\n * controls and returns an error map or null. A null map means that validation has passed.\n *\n * @see [Form Validation](/guide/form-validation)\n *\n * @publicApi\n */\nexport class Validators {\n /**\n * @description\n * Validator that requires the control's value to be greater than or equal to the provided number.\n *\n * @usageNotes\n *\n * ### Validate against a minimum of 3\n *\n * ```typescript\n * const control = new FormControl(2, Validators.min(3));\n *\n * console.log(control.errors); // {min: {min: 3, actual: 2}}\n * ```\n *\n * @returns A validator function that returns an error map with the\n * `min` property if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static min(min: number): ValidatorFn {\n return minValidator(min);\n }\n\n /**\n * @description\n * Validator that requires the control's value to be less than or equal to the provided number.\n *\n * @usageNotes\n *\n * ### Validate against a maximum of 15\n *\n * ```typescript\n * const control = new FormControl(16, Validators.max(15));\n *\n * console.log(control.errors); // {max: {max: 15, actual: 16}}\n * ```\n *\n * @returns A validator function that returns an error map with the\n * `max` property if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static max(max: number): ValidatorFn {\n return maxValidator(max);\n }\n\n /**\n * @description\n * Validator that requires the control have a non-empty value.\n *\n * @usageNotes\n *\n * ### Validate that the field is non-empty\n *\n * ```typescript\n * const control = new FormControl('', Validators.required);\n *\n * console.log(control.errors); // {required: true}\n * ```\n *\n * @returns An error map with the `required` property\n * if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static required(control: AbstractControl): ValidationErrors|null {\n return requiredValidator(control);\n }\n\n /**\n * @description\n * Validator that requires the control's value be true. This validator is commonly\n * used for required checkboxes.\n *\n * @usageNotes\n *\n * ### Validate that the field value is true\n *\n * ```typescript\n * const control = new FormControl('some value', Validators.requiredTrue);\n *\n * console.log(control.errors); // {required: true}\n * ```\n *\n * @returns An error map that contains the `required` property\n * set to `true` if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static requiredTrue(control: AbstractControl): ValidationErrors|null {\n return requiredTrueValidator(control);\n }\n\n /**\n * @description\n * Validator that requires the control's value pass an email validation test.\n *\n * Tests the value using a [regular\n * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)\n * pattern suitable for common use cases. The pattern is based on the definition of a valid email\n * address in the [WHATWG HTML\n * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with\n * some enhancements to incorporate more RFC rules (such as rules related to domain names and the\n * lengths of different parts of the address).\n *\n * The differences from the WHATWG version include:\n * - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`).\n * - Disallow `local-part` to be longer than 64 characters.\n * - Disallow the whole address to be longer than 254 characters.\n *\n * If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to\n * validate the value against a different pattern.\n *\n * @usageNotes\n *\n * ### Validate that the field matches a valid email pattern\n *\n * ```typescript\n * const control = new FormControl('bad@', Validators.email);\n *\n * console.log(control.errors); // {email: true}\n * ```\n *\n * @returns An error map with the `email` property\n * if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static email(control: AbstractControl): ValidationErrors|null {\n return emailValidator(control);\n }\n\n /**\n * @description\n * Validator that requires the length of the control's value to be greater than or equal\n * to the provided minimum length. This validator is also provided by default if you use the\n * the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used\n * only for types that have a numeric `length` property, such as strings or arrays. The\n * `minLength` validator logic is also not invoked for values when their `length` property is 0\n * (for example in case of an empty string or an empty array), to support optional controls. You\n * can use the standard `required` validator if empty values should not be considered valid.\n *\n * @usageNotes\n *\n * ### Validate that the field has a minimum of 3 characters\n *\n * ```typescript\n * const control = new FormControl('ng', Validators.minLength(3));\n *\n * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}}\n * ```\n *\n * ```html\n * <input minlength=\"5\">\n * ```\n *\n * @returns A validator function that returns an error map with the\n * `minlength` property if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static minLength(minLength: number): ValidatorFn {\n return minLengthValidator(minLength);\n }\n\n /**\n * @description\n * Validator that requires the length of the control's value to be less than or equal\n * to the provided maximum length. This validator is also provided by default if you use the\n * the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used\n * only for types that have a numeric `length` property, such as strings or arrays.\n *\n * @usageNotes\n *\n * ### Validate that the field has maximum of 5 characters\n *\n * ```typescript\n * const control = new FormControl('Angular', Validators.maxLength(5));\n *\n * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}}\n * ```\n *\n * ```html\n * <input maxlength=\"5\">\n * ```\n *\n * @returns A validator function that returns an error map with the\n * `maxlength` property if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static maxLength(maxLength: number): ValidatorFn {\n return maxLengthValidator(maxLength);\n }\n\n /**\n * @description\n * Validator that requires the control's value to match a regex pattern. This validator is also\n * provided by default if you use the HTML5 `pattern` attribute.\n *\n * @usageNotes\n *\n * ### Validate that the field only contains letters or spaces\n *\n * ```typescript\n * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*'));\n *\n * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}}\n * ```\n *\n * ```html\n * <input pattern=\"[a-zA-Z ]*\">\n * ```\n *\n * ### Pattern matching with the global or sticky flag\n *\n * `RegExp` objects created with the `g` or `y` flags that are passed into `Validators.pattern`\n * can produce different results on the same input when validations are run consecutively. This is\n * due to how the behavior of `RegExp.prototype.test` is\n * specified in [ECMA-262](https://tc39.es/ecma262/#sec-regexpbuiltinexec)\n * (`RegExp` preserves the index of the last match when the global or sticky flag is used).\n * Due to this behavior, it is recommended that when using\n * `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky\n * flag enabled.\n *\n * ```typescript\n * // Not recommended (since the `g` flag is used)\n * const controlOne = new FormControl('1', Validators.pattern(/foo/g));\n *\n * // Good\n * const controlTwo = new FormControl('1', Validators.pattern(/foo/));\n * ```\n *\n * @param pattern A regular expression to be used as is to test the values, or a string.\n * If a string is passed, the `^` character is prepended and the `$` character is\n * appended to the provided string (if not already present), and the resulting regular\n * expression is used to test the values.\n *\n * @returns A validator function that returns an error map with the\n * `pattern` property if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static pattern(pattern: string|RegExp): ValidatorFn {\n return patternValidator(pattern);\n }\n\n /**\n * @description\n * Validator that performs no operation.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static nullValidator(control: AbstractControl): ValidationErrors|null {\n return nullValidator(control);\n }\n\n /**\n * @description\n * Compose multiple validators into a single function that returns the union\n * of the individual error maps for the provided control.\n *\n * @returns A validator function that returns an error map with the\n * merged error maps of the validators if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static compose(validators: null): null;\n static compose(validators: (ValidatorFn|null|undefined)[]): ValidatorFn|null;\n static compose(validators: (ValidatorFn|null|undefined)[]|null): ValidatorFn|null {\n return compose(validators);\n }\n\n /**\n * @description\n * Compose multiple async validators into a single function that returns the union\n * of the individual error objects for the provided control.\n *\n * @returns A validator function that returns an error map with the\n * merged error objects of the async validators if the validation check fails, otherwise `null`.\n *\n * @see `updateValueAndValidity()`\n *\n */\n static composeAsync(validators: (AsyncValidatorFn|null)[]): AsyncValidatorFn|null {\n return composeAsync(validators);\n }\n}\n\n/**\n * Validator that requires the control's value to be greater than or equal to the provided number.\n * See `Validators.min` for additional information.\n */\nexport function minValidator(min: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors|null => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min\n return !isNaN(value) && value < min ? {'min': {'min': min, 'actual': control.value}} : null;\n };\n}\n\n/**\n * Validator that requires the control's value to be less than or equal to the provided number.\n * See `Validators.max` for additional information.\n */\nexport function maxValidator(max: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors|null => {\n if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value = parseFloat(control.value);\n // Controls with NaN values after parsing should be treated as not having a\n // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max\n return !isNaN(value) && value > max ? {'max': {'max': max, 'actual': control.value}} : null;\n };\n}\n\n/**\n * Validator that requires the control have a non-empty value.\n * See `Validators.required` for additional information.\n */\nexport function requiredValidator(control: AbstractControl): ValidationErrors|null {\n return isEmptyInputValue(control.value) ? {'required': true} : null;\n}\n\n/**\n * Validator that requires the control's value be true. This validator is commonly\n * used for required checkboxes.\n * See `Validators.requiredTrue` for additional information.\n */\nexport function requiredTrueValidator(control: AbstractControl): ValidationErrors|null {\n return control.value === true ? null : {'required': true};\n}\n\n/**\n * Validator that requires the control's value pass an email validation test.\n * See `Validators.email` for additional information.\n */\nexport function emailValidator(control: AbstractControl): ValidationErrors|null {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n return EMAIL_REGEXP.test(control.value) ? null : {'email': true};\n}\n\n/**\n * Validator that requires the length of the control's value to be greater than or equal\n * to the provided minimum length. See `Validators.minLength` for additional information.\n */\nexport function minLengthValidator(minLength: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors|null => {\n if (isEmptyInputValue(control.value) || !hasValidLength(control.value)) {\n // don't validate empty values to allow optional controls\n // don't validate values without `length` property\n return null;\n }\n\n return control.value.length < minLength ?\n {'minlength': {'requiredLength': minLength, 'actualLength': control.value.length}} :\n null;\n };\n}\n\n/**\n * Validator that requires the length of the control's value to be less than or equal\n * to the provided maximum length. See `Validators.maxLength` for additional information.\n */\nexport function maxLengthValidator(maxLength: number): ValidatorFn {\n return (control: AbstractControl): ValidationErrors|null => {\n return hasValidLength(control.value) && control.value.length > maxLength ?\n {'maxlength': {'requiredLength': maxLength, 'actualLength': control.value.length}} :\n null;\n };\n}\n\n/**\n * Validator that requires the control's value to match a regex pattern.\n * See `Validators.pattern` for additional information.\n */\nexport function patternValidator(pattern: string|RegExp): ValidatorFn {\n if (!pattern) return nullValidator;\n let regex: RegExp;\n let regexStr: string;\n if (typeof pattern === 'string') {\n regexStr = '';\n\n if (pattern.charAt(0) !== '^') regexStr += '^';\n\n regexStr += pattern;\n\n if (pattern.charAt(pattern.length - 1) !== '$') regexStr += '$';\n\n regex = new RegExp(regexStr);\n } else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return (control: AbstractControl): ValidationErrors|null => {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n const value: string = control.value;\n return regex.test(value) ? null :\n {'pattern': {'requiredPattern': regexStr, 'actualValue': value}};\n };\n}\n\n/**\n * Function that has `ValidatorFn` shape, but performs no operation.\n */\nexport function nullValidator(control: AbstractControl): ValidationErrors|null {\n return null;\n}\n\nfunction isPresent(o: any): boolean {\n return o != null;\n}\n\nexport function toObservable(value: any): Observable<any> {\n const obs = isPromise(value) ? from(value) : value;\n if (NG_DEV_MODE && !(isObservable(obs))) {\n let errorMessage = `Expected async validator to return Promise or Observable.`;\n // A synchronous validator will return object or null.\n if (typeof value === 'object') {\n errorMessage +=\n ' Are you using a synchronous validator where an async validator is expected?';\n }\n throw new RuntimeError(RuntimeErrorCode.WRONG_VALIDATOR_RETURN_TYPE, errorMessage);\n }\n return obs;\n}\n\nfunction mergeErrors(arrayOfErrors: (ValidationErrors|null)[]): ValidationErrors|null {\n let res: {[key: string]: any} = {};\n arrayOfErrors.forEach((errors: ValidationErrors|null) => {\n res = errors != null ? {...res!, ...errors} : res!;\n });\n\n return Object.keys(res).length === 0 ? null : res;\n}\n\ntype GenericValidatorFn = (control: AbstractControl) => any;\n\nfunction executeValidators<V extends GenericValidatorFn>(\n control: AbstractControl, validators: V[]): ReturnType<V>[] {\n return validators.map(validator => validator(control));\n}\n\nfunction isValidatorFn<V>(validator: V|Validator|AsyncValidator): validator is V {\n return !(validator as Validator).validate;\n}\n\n/**\n * Given the list of validators that may contain both functions as well as classes, return the list\n * of validator functions (convert validator classes into validator functions). This is needed to\n * have consistent structure in validators list before composing them.\n *\n * @param validators The set of validators that may contain validators both in plain function form\n * as well as represented as a validator class.\n */\nexport function normalizeValidators<V>(validators: (V|Validator|AsyncValidator)[]): V[] {\n return validators.map(validator => {\n return isValidatorFn<V>(validator) ?\n validator :\n ((c: AbstractControl) => validator.validate(c)) as unknown as V;\n });\n}\n\n/**\n * Merges synchronous validators into a single validator function.\n * See `Validators.compose` for additional information.\n */\nfunction compose(validators: (ValidatorFn|null|undefined)[]|null): ValidatorFn|null {\n if (!validators) return null;\n const presentValidators: ValidatorFn[] = validators.filter(isPresent) as any;\n if (presentValidators.length == 0) return null;\n\n return function(control: AbstractControl) {\n return mergeErrors(executeValidators<ValidatorFn>(control, presentValidators));\n };\n}\n\n/**\n * Accepts a list of validators of different possible shapes (`Validator` and `ValidatorFn`),\n * normalizes the list (converts everything to `ValidatorFn`) and merges them into a single\n * validator function.\n */\nexport function composeValidators(validators: Array<Validator|ValidatorFn>): ValidatorFn|null {\n return validators != null ? compose(normalizeValidators<ValidatorFn>(validators)) : null;\n}\n\n/**\n * Merges asynchronous validators into a single validator function.\n * See `Validators.composeAsync` for additional information.\n */\nfunction composeAsync(validators: (AsyncValidatorFn|null)[]): AsyncValidatorFn|null {\n if (!validators) return null;\n const presentValidators: AsyncValidatorFn[] = validators.filter(isPresent) as any;\n if (presentValidators.length == 0) return null;\n\n return function(control: AbstractControl) {\n const observables =\n executeValidators<AsyncValidatorFn>(control, presentValidators).map(toObservable);\n return forkJoin(observables).pipe(map(mergeErrors));\n };\n}\n\n/**\n * Accepts a list of async validators of different possible shapes (`AsyncValidator` and\n * `AsyncValidatorFn`), normalizes the list (converts everything to `AsyncValidatorFn`) and merges\n * them into a single validator function.\n */\nexport function composeAsyncValidators(validators: Array<AsyncValidator|AsyncValidatorFn>):\n AsyncValidatorFn|null {\n return validators != null ? composeAsync(normalizeValidators<AsyncValidatorFn>(validators)) :\n null;\n}\n\n/**\n * Merges raw control validators with a given directive validator and returns the combined list of\n * validators as an array.\n */\nexport function mergeValidators<V>(controlValidators: V|V[]|null, dirValidator: V): V[] {\n if (controlValidators === null) return [dirValidator];\n return Array.isArray(controlValidators) ? [...controlValidators, dirValidator] :\n [controlValidators, dirValidator];\n}\n\n/**\n * Retrieves the list of raw synchronous validators attached to a given control.\n */\nexport function getControlValidators(control: AbstractControl): ValidatorFn|ValidatorFn[]|null {\n return (control as any)._rawValidators as ValidatorFn | ValidatorFn[] | null;\n}\n\n/**\n * Retrieves the list of raw asynchronous validators attached to a given control.\n */\nexport function getControlAsyncValidators(control: AbstractControl): AsyncValidatorFn|\n AsyncValidatorFn[]|null {\n return (control as any)._rawAsyncValidators as AsyncValidatorFn | AsyncValidatorFn[] | null;\n}\n\n/**\n * Accepts a singleton validator, an array, or null, and returns an array type with the provided\n * validators.\n *\n * @param validators A validator, validators, or null.\n * @returns A validators array.\n */\nexport function makeValidatorsArray<T extends ValidatorFn|AsyncValidatorFn>(validators: T|T[]|\n null): T[] {\n if (!validators) return [];\n return Array.isArray(validators) ? validators : [validators];\n}\n\n/**\n * Determines whether a validator or validators array has a given validator.\n *\n * @param validators The validator or validators to compare against.\n * @param validator The validator to check.\n * @returns Whether the validator is present.\n */\nexport function hasValidator<T extends ValidatorFn|AsyncValidatorFn>(\n validators: T|T[]|null, validator: T): boolean {\n return Array.isArray(validators) ? validators.includes(validator) : validators === validator;\n}\n\n/**\n * Combines two arrays of validators into one. If duplicates are provided, only one will be added.\n *\n * @param validators The new validators.\n * @param currentValidators The base array of current validators.\n * @returns An array of validators.\n */\nexport function addValidators<T extends ValidatorFn|AsyncValidatorFn>(\n validators: T|T[], currentValidators: T|T[]|null): T[] {\n const current = makeValidatorsArray(currentValidators);\n const validatorsToAdd = makeValidatorsArray(validators);\n validatorsToAdd.forEach((v: T) => {\n // Note: if there are duplicate entries in the new validators array,\n // only the first one would be added to the current list of validators.\n // Duplicate ones would be ignored since `hasValidator` would detect\n // the presence of a validator function and we update the current list in place.\n if (!hasValidator(current, v)) {\n current.push(v);\n }\n });\n return current;\n}\n\nexport function removeValidators<T extends ValidatorFn|AsyncValidatorFn>(\n validators: T|T[], currentValidators: T|T[]|null): T[] {\n return makeValidatorsArray(currentValidators).filter(v => !hasValidator(validators, v));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {AbstractControl} from '../model/abstract_model';\nimport {composeAsyncValidators, composeValidators} from '../validators';\n\nimport {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './validators';\n\n\n/**\n * @description\n * Base class for control directives.\n *\n * This class is only used internally in the `ReactiveFormsModule` and the `FormsModule`.\n *\n * @publicApi\n */\nexport abstract class AbstractControlDirective {\n /**\n * @description\n * A reference to the underlying control.\n *\n * @returns the control that backs this directive. Most properties fall through to that instance.\n */\n abstract get control(): AbstractControl|null;\n\n /**\n * @description\n * Reports the value of the control if it is present, otherwise null.\n */\n get value(): any {\n return this.control ? this.control.value : null;\n }\n\n /**\n * @description\n * Reports whether the control is valid. A control is considered valid if no\n * validation errors exist with the current value.\n * If the control is not present, null is returned.\n */\n get valid(): boolean|null {\n return this.control ? this.control.valid : null;\n }\n\n /**\n * @description\n * Reports whether the control is invalid, meaning that an error exists in the input value.\n * If the control is not present, null is returned.\n */\n get invalid(): boolean|null {\n return this.control ? this.control.invalid : null;\n }\n\n /**\n * @description\n * Reports whether a control is pending, meaning that that async validation is occurring and\n * errors are not yet available for the input value. If the control is not present, null is\n * returned.\n */\n get pending(): boolean|null {\n return this.control ? this.control.pending : null;\n }\n\n /**\n * @description\n * Reports whether the control is disabled, meaning that the control is disabled\n * in the UI and is exempt from validation checks and excluded from aggregate\n * values of ancestor controls. If the control is not present, null is returned.\n */\n get disabled(): boolean|null {\n return this.control ? this.control.disabled : null;\n }\n\n /**\n * @description\n * Reports whether the control is enabled, meaning that the control is included in ancestor\n * calculations of validity or value. If the control is not present, null is returned.\n */\n get enabled(): boolean|null {\n return this.control ? this.control.enabled : null;\n }\n\n /**\n * @description\n * Reports the control's validation errors. If the control is not present, null is returned.\n */\n get errors(): ValidationErrors|null {\n return this.control ? this.control.errors : null;\n }\n\n /**\n * @description\n * Reports whether the control is pristine, meaning that the user has not yet changed\n * the value in the UI. If the control is not present, null is returned.\n */\n get pristine(): boolean|null {\n return this.control ? this.control.pristine : null;\n }\n\n /**\n * @description\n * Reports whether the control is dirty, meaning that the user has changed\n * the value in the UI. If the control is not present, null is returned.\n */\n get dirty(): boolean|null {\n return this.control ? this.control.dirty : null;\n }\n\n /**\n * @description\n * Reports whether the control is touched, meaning that the user has triggered\n * a `blur` event on it. If the control is not present, null is returned.\n */\n get touched(): boolean|null {\n return this.control ? this.control.touched : null;\n }\n\n /**\n * @description\n * Reports the validation status of the control. Possible values include:\n * 'VALID', 'INVALID', 'DISABLED', and 'PENDING'.\n * If the control is not present, null is returned.\n */\n get status(): string|null {\n return this.control ? this.control.status : null;\n }\n\n /**\n * @description\n * Reports whether the control is untouched, meaning that the user has not yet triggered\n * a `blur` event on it. If the control is not present, null is returned.\n */\n get untouched(): boolean|null {\n return this.control ? this.control.untouched : null;\n }\n\n /**\n * @description\n * Returns a multicasting observable that emits a validation status whenever it is\n * calculated for the control. If the control is not present, null is returned.\n */\n get statusChanges(): Observable<any>|null {\n return this.control ? this.control.statusChanges : null;\n }\n\n /**\n * @description\n * Returns a multicasting observable of value changes for the control that emits every time the\n * value of the control changes in the UI or programmatically.\n * If the control is not present, null is returned.\n */\n get valueChanges(): Observable<any>|null {\n return this.control ? this.control.valueChanges : null;\n }\n\n /**\n * @description\n * Returns an array that represents the path from the top-level form to this control.\n * Each index is the string name of the control on that level.\n */\n get path(): string[]|null {\n return null;\n }\n\n /**\n * Contains the result of merging synchronous validators into a single validator function\n * (combined using `Validators.compose`).\n */\n private _composedValidatorFn: ValidatorFn|null|undefined;\n\n /**\n * Contains the result of merging asynchronous validators into a single validator function\n * (combined using `Validators.composeAsync`).\n */\n private _composedAsyncValidatorFn: AsyncValidatorFn|null|undefined;\n\n /**\n * Set of synchronous validators as they were provided while calling `setValidators` function.\n * @internal\n */\n _rawValidators: Array<Validator|ValidatorFn> = [];\n\n /**\n * Set of asynchronous validators as they were provided while calling `setAsyncValidators`\n * function.\n * @internal\n */\n _rawAsyncValidators: Array<AsyncValidator|AsyncValidatorFn> = [];\n\n /**\n * Sets synchronous validators for this directive.\n * @internal\n */\n _setValidators(validators: Array<Validator|ValidatorFn>|undefined): void {\n this._rawValidators = validators || [];\n this._composedValidatorFn = composeValidators(this._rawValidators);\n }\n\n /**\n * Sets asynchronous validators for this directive.\n * @internal\n */\n _setAsyncValidators(validators: Array<AsyncValidator|AsyncValidatorFn>|undefined): void {\n this._rawAsyncValidators = validators || [];\n this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);\n }\n\n /**\n * @description\n * Synchronous validator function composed of all the synchronous validators registered with this\n * directive.\n */\n get validator(): ValidatorFn|null {\n return this._composedValidatorFn || null;\n }\n\n /**\n * @description\n * Asynchronous validator function composed of all the asynchronous validators registered with\n * this directive.\n */\n get asyncValidator(): AsyncValidatorFn|null {\n return this._composedAsyncValidatorFn || null;\n }\n\n /*\n * The set of callbacks to be invoked when directive instance is being destroyed.\n */\n private _onDestroyCallbacks: (() => void)[] = [];\n\n /**\n * Internal function to register callbacks that should be invoked\n * when directive instance is being destroyed.\n * @internal\n */\n _registerOnDestroy(fn: () => void): void {\n this._onDestroyCallbacks.push(fn);\n }\n\n /**\n * Internal function to invoke all registered \"on destroy\" callbacks.\n * Note: calling this function also clears the list of callbacks.\n * @internal\n */\n _invokeOnDestroyCallbacks(): void {\n this._onDestroyCallbacks.forEach(fn => fn());\n this._onDestroyCallbacks = [];\n }\n\n /**\n * @description\n * Resets the control with the provided value if the control is present.\n */\n reset(value: any = undefined): void {\n if (this.control) this.control.reset(value);\n }\n\n /**\n * @description\n * Reports whether the control with the given path has the error specified.\n *\n * @param errorCode The code of the error to check\n * @param path A list of control names that designates how to move from the current control\n * to the control that should be queried for errors.\n *\n * @usageNotes\n * For example, for the following `FormGroup`:\n *\n * ```\n * form = new FormGroup({\n * address: new FormGroup({ street: new FormControl() })\n * });\n * ```\n *\n * The path to the 'street' control from the root form would be 'address' -> 'street'.\n *\n * It can be provided to this method in one of two formats:\n *\n * 1. An array of string control names, e.g. `['address', 'street']`\n * 1. A period-delimited list of control names in one string, e.g. `'address.street'`\n *\n * If no path is given, this method checks for the error on the current control.\n *\n * @returns whether the given error is present in the control at the given path.\n *\n * If the control is not present, false is returned.\n */\n hasError(errorCode: string, path?: Array<string|number>|string): boolean {\n return this.control ? this.control.hasError(errorCode, path) : false;\n }\n\n /**\n * @description\n * Reports error data for the control with the given path.\n *\n * @param errorCode The code of the error to check\n * @param path A list of control names that designates how to move from the current control\n * to the control that should be queried for errors.\n *\n * @usageNotes\n * For example, for the following `FormGroup`:\n *\n * ```\n * form = new FormGroup({\n * address: new FormGroup({ street: new FormControl() })\n * });\n * ```\n *\n * The path to the 'street' control from the root form would be 'address' -> 'street'.\n *\n * It can be provided to this method in one of two formats:\n *\n * 1. An array of string control names, e.g. `['address', 'street']`\n * 1. A period-delimited list of control names in one string, e.g. `'address.street'`\n *\n * @returns error data for that particular error. If the control or error is not present,\n * null is returned.\n */\n getError(errorCode: string, path?: Array<string|number>|string): any {\n return this.control ? this.control.getError(errorCode, path) : null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AbstractControlDirective} from './abstract_control_directive';\nimport {Form} from './form_interface';\n\n\n/**\n * @description\n * A base class for directives that contain multiple registered instances of `NgControl`.\n * Only used by the forms module.\n *\n * @publicApi\n */\nexport abstract class ControlContainer extends AbstractControlDirective {\n /**\n * @description\n * The name for the control\n */\n // TODO(issue/24571): remove '!'.\n name!: string|number|null;\n\n /**\n * @description\n * The top-level form directive for the control.\n */\n get formDirective(): Form|null {\n return null;\n }\n\n /**\n * @description\n * The path to this group.\n */\n override get path(): string[]|null {\n return null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AbstractControlDirective} from './abstract_control_directive';\nimport {ControlContainer} from './control_container';\nimport {ControlValueAccessor} from './control_value_accessor';\n\n\n/**\n * @description\n * A base class that all `FormControl`-based directives extend. It binds a `FormControl`\n * object to a DOM element.\n *\n * @publicApi\n */\nexport abstract class NgControl extends AbstractControlDirective {\n /**\n * @description\n * The parent form for the control.\n *\n * @internal\n */\n _parent: ControlContainer|null = null;\n\n /**\n * @description\n * The name for the control\n */\n name: string|number|null = null;\n\n /**\n * @description\n * The value accessor for the control\n */\n valueAccessor: ControlValueAccessor|null = null;\n\n /**\n * @description\n * The callback method to update the model from the view when requested\n *\n * @param newValue The new value for the view\n */\n abstract viewToModelUpdate(newValue: any): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, Optional, Self} from '@angular/core';\n\nimport {AbstractControlDirective} from './abstract_control_directive';\nimport {ControlContainer} from './control_container';\nimport {NgControl} from './ng_control';\n\n// DO NOT REFACTOR!\n// Each status is represented by a separate function to make sure that\n// advanced Closure Compiler optimizations related to property renaming\n// can work correctly.\nexport class AbstractControlStatus {\n private _cd: AbstractControlDirective|null;\n\n constructor(cd: AbstractControlDirective|null) {\n this._cd = cd;\n }\n\n protected get isTouched() {\n return !!this._cd?.control?.touched;\n }\n\n protected get isUntouched() {\n return !!this._cd?.control?.untouched;\n }\n\n protected get isPristine() {\n return !!this._cd?.control?.pristine;\n }\n\n protected get isDirty() {\n return !!this._cd?.control?.dirty;\n }\n\n protected get isValid() {\n return !!this._cd?.control?.valid;\n }\n\n protected get isInvalid() {\n return !!this._cd?.control?.invalid;\n }\n\n protected get isPending() {\n return !!this._cd?.control?.pending;\n }\n\n protected get isSubmitted() {\n // We check for the `submitted` field from `NgForm` and `FormGroupDirective` classes, but\n // we avoid instanceof checks to prevent non-tree-shakable references to those types.\n return !!(this._cd as unknown as {submitted: boolean} | null)?.submitted;\n }\n}\n\nexport const ngControlStatusHost = {\n '[class.ng-untouched]': 'isUntouched',\n '[class.ng-touched]': 'isTouched',\n '[class.ng-pristine]': 'isPristine',\n '[class.ng-dirty]': 'isDirty',\n '[class.ng-valid]': 'isValid',\n '[class.ng-invalid]': 'isInvalid',\n '[class.ng-pending]': 'isPending',\n};\n\nexport const ngGroupStatusHost = {\n ...ngControlStatusHost,\n '[class.ng-submitted]': 'isSubmitted',\n};\n\n/**\n * @description\n * Directive automatically applied to Angular form controls that sets CSS classes\n * based on control status.\n *\n * @usageNotes\n *\n * ### CSS classes applied\n *\n * The following classes are applied as the properties become true:\n *\n * * ng-valid\n * * ng-invalid\n * * ng-pending\n * * ng-pristine\n * * ng-dirty\n * * ng-untouched\n * * ng-touched\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost})\nexport class NgControlStatus extends AbstractControlStatus {\n constructor(@Self() cd: NgControl) {\n super(cd);\n }\n}\n\n/**\n * @description\n * Directive automatically applied to Angular form groups that sets CSS classes\n * based on control status (valid/invalid/dirty/etc). On groups, this includes the additional\n * class ng-submitted.\n *\n * @see `NgControlStatus`\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]',\n host: ngGroupStatusHost\n})\nexport class NgControlStatusGroup extends AbstractControlStatus {\n constructor(@Optional() @Self() cd: ControlContainer) {\n super(cd);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nimport {formArrayNameExample, formControlNameExample, formGroupNameExample, ngModelGroupExample} from './error_examples';\n\n\nexport function controlParentException(): Error {\n return new RuntimeError(\n RuntimeErrorCode.FORM_CONTROL_NAME_MISSING_PARENT,\n `formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n ${formControlNameExample}`);\n}\n\nexport function ngModelGroupException(): Error {\n return new RuntimeError(\n RuntimeErrorCode.FORM_CONTROL_NAME_INSIDE_MODEL_GROUP,\n `formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a \"form\" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n ${formGroupNameExample}\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n ${ngModelGroupExample}`);\n}\n\nexport function missingFormException(): Error {\n return new RuntimeError(\n RuntimeErrorCode.FORM_GROUP_MISSING_INSTANCE,\n `formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n ${formControlNameExample}`);\n}\n\nexport function groupParentException(): Error {\n return new RuntimeError(\n RuntimeErrorCode.FORM_GROUP_NAME_MISSING_PARENT,\n `formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n ${formGroupNameExample}`);\n}\n\nexport function arrayParentException(): Error {\n return new RuntimeError(\n RuntimeErrorCode.FORM_ARRAY_NAME_MISSING_PARENT,\n `formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n ${formArrayNameExample}`);\n}\n\nexport const disabledAttrWarning = `\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n\n Example:\n // Specify the \\`disabled\\` property at control creation time:\n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n\n // Controls can also be enabled/disabled after creation:\n form.get('first')?.enable();\n form.get('last')?.disable();\n`;\n\nexport const asyncValidatorsDroppedWithOptsWarning = `\n It looks like you're constructing using a FormControl with both an options argument and an\n async validators argument. Mixing these arguments will cause your async validators to be dropped.\n You should either put all your validators in the options object, or in separate validators\n arguments. For example:\n\n // Using validators arguments\n fc = new FormControl(42, Validators.required, myAsyncValidator);\n\n // Using AbstractControlOptions\n fc = new FormControl(42, {validators: Validators.required, asyncValidators: myAV});\n\n // Do NOT mix them: async validators will be dropped!\n fc = new FormControl(42, {validators: Validators.required}, /* Oops! */ myAsyncValidator);\n`;\n\nexport function ngModelWarning(directiveName: string): string {\n return `\n It looks like you're using ngModel on the same form field as ${directiveName}.\n Support for using the ngModel input property and ngModelChange event with\n reactive form directives has been deprecated in Angular v6 and will be removed\n in a future version of Angular.\n\n For more information on this, see our API docs here:\n https://angular.io/api/forms/${\n directiveName === 'formControl' ? 'FormControlDirective' : 'FormControlName'}#use-with-ngmodel\n `;\n}\n\nfunction describeKey(isFormGroup: boolean, key: string|number): string {\n return isFormGroup ? `with name: '${key}'` : `at index: ${key}`;\n}\n\nexport function noControlsError(isFormGroup: boolean): string {\n return `\n There are no form controls registered with this ${\n isFormGroup ? 'group' : 'array'} yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n `;\n}\n\nexport function missingControlError(isFormGroup: boolean, key: string|number): string {\n return `Cannot find form control ${describeKey(isFormGroup, key)}`;\n}\n\nexport function missingControlValueError(isFormGroup: boolean, key: string|number): string {\n return `Must supply a value for form control ${describeKey(isFormGroup, key)}`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter, ɵRuntimeError as RuntimeError} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {asyncValidatorsDroppedWithOptsWarning, missingControlError, missingControlValueError, noControlsError} from '../directives/reactive_errors';\nimport {AsyncValidatorFn, ValidationErrors, ValidatorFn} from '../directives/validators';\nimport {RuntimeErrorCode} from '../errors';\nimport {FormArray, FormGroup} from '../forms';\nimport {addValidators, composeAsyncValidators, composeValidators, hasValidator, removeValidators, toObservable} from '../validators';\n\nconst NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;\n\n/**\n * Reports that a control is valid, meaning that no errors exist in the input value.\n *\n * @see `status`\n */\nexport const VALID = 'VALID';\n\n/**\n * Reports that a control is invalid, meaning that an error exists in the input value.\n *\n * @see `status`\n */\nexport const INVALID = 'INVALID';\n\n/**\n * Reports that a control is pending, meaning that that async validation is occurring and\n * errors are not yet available for the input value.\n *\n * @see `markAsPending`\n * @see `status`\n */\nexport const PENDING = 'PENDING';\n\n/**\n * Reports that a control is disabled, meaning that the control is exempt from ancestor\n * calculations of validity or value.\n *\n * @see `markAsDisabled`\n * @see `status`\n */\nexport const DISABLED = 'DISABLED';\n\n/**\n * A form can have several different statuses. Each\n * possible status is returned as a string literal.\n *\n * * **VALID**: Reports that a control is valid, meaning that no errors exist in the input\n * value.\n * * **INVALID**: Reports that a control is invalid, meaning that an error exists in the input\n * value.\n * * **PENDING**: Reports that a control is pending, meaning that that async validation is\n * occurring and errors are not yet available for the input value.\n * * **DISABLED**: Reports that a control is\n * disabled, meaning that the control is exempt from ancestor calculations of validity or value.\n *\n * @publicApi\n */\nexport type FormControlStatus = 'VALID'|'INVALID'|'PENDING'|'DISABLED';\n\n/**\n * Gets validators from either an options object or given validators.\n */\nexport function pickValidators(validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|\n null): ValidatorFn|ValidatorFn[]|null {\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;\n}\n\n/**\n * Creates validator function by combining provided validators.\n */\nfunction coerceToValidator(validator: ValidatorFn|ValidatorFn[]|null): ValidatorFn|null {\n return Array.isArray(validator) ? composeValidators(validator) : validator || null;\n}\n\n/**\n * Gets async validators from either an options object or given validators.\n */\nexport function pickAsyncValidators(\n asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null,\n validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null): AsyncValidatorFn|\n AsyncValidatorFn[]|null {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (isOptionsObj(validatorOrOpts) && asyncValidator) {\n console.warn(asyncValidatorsDroppedWithOptsWarning);\n }\n }\n return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null;\n}\n\n/**\n * Creates async validator function by combining provided async validators.\n */\nfunction coerceToAsyncValidator(asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|\n null): AsyncValidatorFn|null {\n return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) :\n asyncValidator || null;\n}\n\nexport type FormHooks = 'change'|'blur'|'submit';\n\n/**\n * Interface for options provided to an `AbstractControl`.\n *\n * @publicApi\n */\nexport interface AbstractControlOptions {\n /**\n * @description\n * The list of validators applied to a control.\n */\n validators?: ValidatorFn|ValidatorFn[]|null;\n /**\n * @description\n * The list of async validators applied to control.\n */\n asyncValidators?: AsyncValidatorFn|AsyncValidatorFn[]|null;\n /**\n * @description\n * The event name for control to update upon.\n */\n updateOn?: 'change'|'blur'|'submit';\n}\n\nexport function isOptionsObj(validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|\n null): validatorOrOpts is AbstractControlOptions {\n return validatorOrOpts != null && !Array.isArray(validatorOrOpts) &&\n typeof validatorOrOpts === 'object';\n}\n\nexport function assertControlPresent(parent: any, isGroup: boolean, key: string|number): void {\n const controls = parent.controls as {[key: string|number]: unknown};\n const collection = isGroup ? Object.keys(controls) : controls;\n if (!collection.length) {\n throw new RuntimeError(\n RuntimeErrorCode.NO_CONTROLS, NG_DEV_MODE ? noControlsError(isGroup) : '');\n }\n if (!controls[key]) {\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_CONTROL, NG_DEV_MODE ? missingControlError(isGroup, key) : '');\n }\n}\n\nexport function assertAllValuesPresent(control: any, isGroup: boolean, value: any): void {\n control._forEachChild((_: unknown, key: string|number) => {\n if (value[key] === undefined) {\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_CONTROL_VALUE,\n NG_DEV_MODE ? missingControlValueError(isGroup, key) : '');\n }\n });\n}\n\n// IsAny checks if T is `any`, by checking a condition that couldn't possibly be true otherwise.\nexport type ɵIsAny<T, Y, N> = 0 extends(1&T) ? Y : N;\n\n/**\n * `TypedOrUntyped` allows one of two different types to be selected, depending on whether the Forms\n * class it's applied to is typed or not.\n *\n * This is for internal Angular usage to support typed forms; do not directly use it.\n */\nexport type ɵTypedOrUntyped<T, Typed, Untyped> = ɵIsAny<T, Untyped, Typed>;\n\n/**\n * Value gives the value type corresponding to a control type.\n *\n * Note that the resulting type will follow the same rules as `.value` on your control, group, or\n * array, including `undefined` for each group element which might be disabled.\n *\n * If you are trying to extract a value type for a data model, you probably want {@link RawValue},\n * which will not have `undefined` in group keys.\n *\n * @usageNotes\n *\n * ### `FormControl` value type\n *\n * You can extract the value type of a single control:\n *\n * ```ts\n * type NameControl = FormControl<string>;\n * type NameValue = Value<NameControl>;\n * ```\n *\n * The resulting type is `string`.\n *\n * ### `FormGroup` value type\n *\n * Imagine you have an interface defining the controls in your group. You can extract the shape of\n * the values as follows:\n *\n * ```ts\n * interface PartyFormControls {\n * address: FormControl<string>;\n * }\n *\n * // Value operates on controls; the object must be wrapped in a FormGroup.\n * type PartyFormValues = Value<FormGroup<PartyFormControls>>;\n * ```\n *\n * The resulting type is `{address: string|undefined}`.\n *\n * ### `FormArray` value type\n *\n * You can extract values from FormArrays as well:\n *\n * ```ts\n * type GuestNamesControls = FormArray<FormControl<string>>;\n *\n * type NamesValues = Value<GuestNamesControls>;\n * ```\n *\n * The resulting type is `string[]`.\n *\n * **Internal: not for public use.**\n */\nexport type ɵValue<T extends AbstractControl|undefined> =\n T extends AbstractControl<any, any>? T['value'] : never;\n\n/**\n * RawValue gives the raw value type corresponding to a control type.\n *\n * Note that the resulting type will follow the same rules as `.getRawValue()` on your control,\n * group, or array. This means that all controls inside a group will be required, not optional,\n * regardless of their disabled state.\n *\n * You may also wish to use {@link ɵValue}, which will have `undefined` in group keys (which can be\n * disabled).\n *\n * @usageNotes\n *\n * ### `FormGroup` raw value type\n *\n * Imagine you have an interface defining the controls in your group. You can extract the shape of\n * the raw values as follows:\n *\n * ```ts\n * interface PartyFormControls {\n * address: FormControl<string>;\n * }\n *\n * // RawValue operates on controls; the object must be wrapped in a FormGroup.\n * type PartyFormValues = RawValue<FormGroup<PartyFormControls>>;\n * ```\n *\n * The resulting type is `{address: string}`. (Note the absence of `undefined`.)\n *\n * **Internal: not for public use.**\n */\nexport type ɵRawValue<T extends AbstractControl|undefined> = T extends AbstractControl<any, any>?\n (T['setValue'] extends((v: infer R) => void) ? R : never) :\n never;\n\n// Disable clang-format to produce clearer formatting for these multiline types.\n// clang-format off\n\n/**\n * Tokenize splits a string literal S by a delimiter D.\n */\nexport type ɵTokenize<S extends string, D extends string> =\n string extends S ? string[] : /* S must be a literal */\n S extends `${infer T}${D}${infer U}` ? [T, ...ɵTokenize<U, D>] :\n [S] /* Base case */\n ;\n\n/**\n * CoerceStrArrToNumArr accepts an array of strings, and converts any numeric string to a number.\n */\nexport type ɵCoerceStrArrToNumArr<S> =\n// Extract the head of the array.\n S extends [infer Head, ...infer Tail] ?\n // Using a template literal type, coerce the head to `number` if possible.\n // Then, recurse on the tail.\n Head extends `${number}` ?\n [number, ...ɵCoerceStrArrToNumArr<Tail>] :\n [Head, ...ɵCoerceStrArrToNumArr<Tail>] :\n [];\n\n/**\n * Navigate takes a type T and an array K, and returns the type of T[K[0]][K[1]][K[2]]...\n */\nexport type ɵNavigate<T, K extends(Array<string|number>)> =\n T extends object ? /* T must be indexable (object or array) */\n (K extends [infer Head, ...infer Tail] ? /* Split K into head and tail */\n (Head extends keyof T ? /* head(K) must index T */\n (Tail extends(string|number)[] ? /* tail(K) must be an array */\n [] extends Tail ? T[Head] : /* base case: K can be split, but Tail is empty */\n (ɵNavigate<T[Head], Tail>) /* explore T[head(K)] by tail(K) */ :\n any) /* tail(K) was not an array, give up */ :\n never) /* head(K) does not index T, give up */ :\n any) /* K cannot be split, give up */ :\n any /* T is not indexable, give up */\n ;\n\n/**\n * ɵWriteable removes readonly from all keys.\n */\nexport type ɵWriteable<T> = {\n -readonly[P in keyof T]: T[P]\n};\n\n/**\n * GetProperty takes a type T and some property names or indices K.\n * If K is a dot-separated string, it is tokenized into an array before proceeding.\n * Then, the type of the nested property at K is computed: T[K[0]][K[1]][K[2]]...\n * This works with both objects, which are indexed by property name, and arrays, which are indexed\n * numerically.\n *\n * For internal use only.\n */\nexport type ɵGetProperty<T, K> =\n // K is a string\n K extends string ? ɵGetProperty<T, ɵCoerceStrArrToNumArr<ɵTokenize<K, '.'>>> :\n // Is is an array\n ɵWriteable<K> extends Array<string|number> ? ɵNavigate<T, ɵWriteable<K>> :\n // Fall through permissively if we can't calculate the type of K.\n any;\n\n// clang-format on\n\n/**\n * This is the base class for `FormControl`, `FormGroup`, and `FormArray`.\n *\n * It provides some of the shared behavior that all controls and groups of controls have, like\n * running validators, calculating status, and resetting state. It also defines the properties\n * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be\n * instantiated directly.\n *\n * The first type parameter TValue represents the value type of the control (`control.value`).\n * The optional type parameter TRawValue represents the raw value type (`control.getRawValue()`).\n *\n * @see [Forms Guide](/guide/forms)\n * @see [Reactive Forms Guide](/guide/reactive-forms)\n * @see [Dynamic Forms Guide](/guide/dynamic-form)\n *\n * @publicApi\n */\nexport abstract class AbstractControl<TValue = any, TRawValue extends TValue = TValue> {\n /** @internal */\n _pendingDirty = false;\n\n /**\n * Indicates that a control has its own pending asynchronous validation in progress.\n *\n * @internal\n */\n _hasOwnPendingAsyncValidator = false;\n\n /** @internal */\n _pendingTouched = false;\n\n /** @internal */\n _onCollectionChange = () => {};\n\n /** @internal */\n _updateOn?: FormHooks;\n\n private _parent: FormGroup|FormArray|null = null;\n private _asyncValidationSubscription: any;\n\n /**\n * Contains the result of merging synchronous validators into a single validator function\n * (combined using `Validators.compose`).\n *\n * @internal\n */\n private _composedValidatorFn!: ValidatorFn|null;\n\n /**\n * Contains the result of merging asynchronous validators into a single validator function\n * (combined using `Validators.composeAsync`).\n *\n * @internal\n */\n private _composedAsyncValidatorFn!: AsyncValidatorFn|null;\n\n /**\n * Synchronous validators as they were provided:\n * - in `AbstractControl` constructor\n * - as an argument while calling `setValidators` function\n * - while calling the setter on the `validator` field (e.g. `control.validator = validatorFn`)\n *\n * @internal\n */\n private _rawValidators!: ValidatorFn|ValidatorFn[]|null;\n\n /**\n * Asynchronous validators as they were provided:\n * - in `AbstractControl` constructor\n * - as an argument while calling `setAsyncValidators` function\n * - while calling the setter on the `asyncValidator` field (e.g. `control.asyncValidator =\n * asyncValidatorFn`)\n *\n * @internal\n */\n private _rawAsyncValidators!: AsyncValidatorFn|AsyncValidatorFn[]|null;\n\n /**\n * The current value of the control.\n *\n * * For a `FormControl`, the current value.\n * * For an enabled `FormGroup`, the values of enabled controls as an object\n * with a key-value pair for each member of the group.\n * * For a disabled `FormGroup`, the values of all controls as an object\n * with a key-value pair for each member of the group.\n * * For a `FormArray`, the values of enabled controls as an array.\n *\n */\n public readonly value!: TValue;\n\n /**\n * Initialize the AbstractControl instance.\n *\n * @param validators The function or array of functions that is used to determine the validity of\n * this control synchronously.\n * @param asyncValidators The function or array of functions that is used to determine validity of\n * this control asynchronously.\n */\n constructor(\n validators: ValidatorFn|ValidatorFn[]|null,\n asyncValidators: AsyncValidatorFn|AsyncValidatorFn[]|null) {\n this._assignValidators(validators);\n this._assignAsyncValidators(asyncValidators);\n }\n\n /**\n * Returns the function that is used to determine the validity of this control synchronously.\n * If multiple validators have been added, this will be a single composed function.\n * See `Validators.compose()` for additional information.\n */\n get validator(): ValidatorFn|null {\n return this._composedValidatorFn;\n }\n set validator(validatorFn: ValidatorFn|null) {\n this._rawValidators = this._composedValidatorFn = validatorFn;\n }\n\n /**\n * Returns the function that is used to determine the validity of this control asynchronously.\n * If multiple validators have been added, this will be a single composed function.\n * See `Validators.compose()` for additional information.\n */\n get asyncValidator(): AsyncValidatorFn|null {\n return this._composedAsyncValidatorFn;\n }\n set asyncValidator(asyncValidatorFn: AsyncValidatorFn|null) {\n this._rawAsyncValidators = this._composedAsyncValidatorFn = asyncValidatorFn;\n }\n\n /**\n * The parent control.\n */\n get parent(): FormGroup|FormArray|null {\n return this._parent;\n }\n\n /**\n * The validation status of the control.\n *\n * @see `FormControlStatus`\n *\n * These status values are mutually exclusive, so a control cannot be\n * both valid AND invalid or invalid AND disabled.\n */\n public readonly status!: FormControlStatus;\n\n /**\n * A control is `valid` when its `status` is `VALID`.\n *\n * @see {@link AbstractControl.status}\n *\n * @returns True if the control has passed all of its validation tests,\n * false otherwise.\n */\n get valid(): boolean {\n return this.status === VALID;\n }\n\n /**\n * A control is `invalid` when its `status` is `INVALID`.\n *\n * @see {@link AbstractControl.status}\n *\n * @returns True if this control has failed one or more of its validation checks,\n * false otherwise.\n */\n get invalid(): boolean {\n return this.status === INVALID;\n }\n\n /**\n * A control is `pending` when its `status` is `PENDING`.\n *\n * @see {@link AbstractControl.status}\n *\n * @returns True if this control is in the process of conducting a validation check,\n * false otherwise.\n */\n get pending(): boolean {\n return this.status == PENDING;\n }\n\n /**\n * A control is `disabled` when its `status` is `DISABLED`.\n *\n * Disabled controls are exempt from validation checks and\n * are not included in the aggregate value of their ancestor\n * controls.\n *\n * @see {@link AbstractControl.status}\n *\n * @returns True if the control is disabled, false otherwise.\n */\n get disabled(): boolean {\n return this.status === DISABLED;\n }\n\n /**\n * A control is `enabled` as long as its `status` is not `DISABLED`.\n *\n * @returns True if the control has any status other than 'DISABLED',\n * false if the status is 'DISABLED'.\n *\n * @see {@link AbstractControl.status}\n *\n */\n get enabled(): boolean {\n return this.status !== DISABLED;\n }\n\n /**\n * An object containing any errors generated by failing validation,\n * or null if there are no errors.\n */\n public readonly errors!: ValidationErrors|null;\n\n /**\n * A control is `pristine` if the user has not yet changed\n * the value in the UI.\n *\n * @returns True if the user has not yet changed the value in the UI; compare `dirty`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n public readonly pristine: boolean = true;\n\n /**\n * A control is `dirty` if the user has changed the value\n * in the UI.\n *\n * @returns True if the user has changed the value of this control in the UI; compare `pristine`.\n * Programmatic changes to a control's value do not mark it dirty.\n */\n get dirty(): boolean {\n return !this.pristine;\n }\n\n /**\n * True if the control is marked as `touched`.\n *\n * A control is marked `touched` once the user has triggered\n * a `blur` event on it.\n */\n public readonly touched: boolean = false;\n\n /**\n * True if the control has not been marked as touched\n *\n * A control is `untouched` if the user has not yet triggered\n * a `blur` event on it.\n */\n get untouched(): boolean {\n return !this.touched;\n }\n\n /**\n * A multicasting observable that emits an event every time the value of the control changes, in\n * the UI or programmatically. It also emits an event each time you call enable() or disable()\n * without passing along {emitEvent: false} as a function argument.\n */\n public readonly valueChanges!: Observable<TValue>;\n\n /**\n * A multicasting observable that emits an event every time the validation `status` of the control\n * recalculates.\n *\n * @see `FormControlStatus`\n * @see {@link AbstractControl.status}\n *\n */\n public readonly statusChanges!: Observable<FormControlStatus>;\n\n /**\n * Reports the update strategy of the `AbstractControl` (meaning\n * the event on which the control updates itself).\n * Possible values: `'change'` | `'blur'` | `'submit'`\n * Default value: `'change'`\n */\n get updateOn(): FormHooks {\n return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change');\n }\n\n /**\n * Sets the synchronous validators that are active on this control. Calling\n * this overwrites any existing synchronous validators.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n * If you want to add a new validator without affecting existing ones, consider\n * using `addValidators()` method instead.\n */\n setValidators(validators: ValidatorFn|ValidatorFn[]|null): void {\n this._assignValidators(validators);\n }\n\n /**\n * Sets the asynchronous validators that are active on this control. Calling this\n * overwrites any existing asynchronous validators.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n * If you want to add a new validator without affecting existing ones, consider\n * using `addAsyncValidators()` method instead.\n */\n setAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]|null): void {\n this._assignAsyncValidators(validators);\n }\n\n /**\n * Add a synchronous validator or validators to this control, without affecting other validators.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n * Adding a validator that already exists will have no effect. If duplicate validator functions\n * are present in the `validators` array, only the first instance would be added to a form\n * control.\n *\n * @param validators The new validator function or functions to add to this control.\n */\n addValidators(validators: ValidatorFn|ValidatorFn[]): void {\n this.setValidators(addValidators(validators, this._rawValidators));\n }\n\n /**\n * Add an asynchronous validator or validators to this control, without affecting other\n * validators.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n * Adding a validator that already exists will have no effect.\n *\n * @param validators The new asynchronous validator function or functions to add to this control.\n */\n addAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]): void {\n this.setAsyncValidators(addValidators(validators, this._rawAsyncValidators));\n }\n\n /**\n * Remove a synchronous validator from this control, without affecting other validators.\n * Validators are compared by function reference; you must pass a reference to the exact same\n * validator function as the one that was originally set. If a provided validator is not found,\n * it is ignored.\n *\n * @usageNotes\n *\n * ### Reference to a ValidatorFn\n *\n * ```\n * // Reference to the RequiredValidator\n * const ctrl = new FormControl<string | null>('', Validators.required);\n * ctrl.removeValidators(Validators.required);\n *\n * // Reference to anonymous function inside MinValidator\n * const minValidator = Validators.min(3);\n * const ctrl = new FormControl<string | null>('', minValidator);\n * expect(ctrl.hasValidator(minValidator)).toEqual(true)\n * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false)\n *\n * ctrl.removeValidators(minValidator);\n * ```\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n * @param validators The validator or validators to remove.\n */\n removeValidators(validators: ValidatorFn|ValidatorFn[]): void {\n this.setValidators(removeValidators(validators, this._rawValidators));\n }\n\n /**\n * Remove an asynchronous validator from this control, without affecting other validators.\n * Validators are compared by function reference; you must pass a reference to the exact same\n * validator function as the one that was originally set. If a provided validator is not found, it\n * is ignored.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n * @param validators The asynchronous validator or validators to remove.\n */\n removeAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]): void {\n this.setAsyncValidators(removeValidators(validators, this._rawAsyncValidators));\n }\n\n /**\n * Check whether a synchronous validator function is present on this control. The provided\n * validator must be a reference to the exact same function that was provided.\n *\n * @usageNotes\n *\n * ### Reference to a ValidatorFn\n *\n * ```\n * // Reference to the RequiredValidator\n * const ctrl = new FormControl<number | null>(0, Validators.required);\n * expect(ctrl.hasValidator(Validators.required)).toEqual(true)\n *\n * // Reference to anonymous function inside MinValidator\n * const minValidator = Validators.min(3);\n * const ctrl = new FormControl<number | null>(0, minValidator);\n * expect(ctrl.hasValidator(minValidator)).toEqual(true)\n * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false)\n * ```\n *\n * @param validator The validator to check for presence. Compared by function reference.\n * @returns Whether the provided validator was found on this control.\n */\n hasValidator(validator: ValidatorFn): boolean {\n return hasValidator(this._rawValidators, validator);\n }\n\n /**\n * Check whether an asynchronous validator function is present on this control. The provided\n * validator must be a reference to the exact same function that was provided.\n *\n * @param validator The asynchronous validator to check for presence. Compared by function\n * reference.\n * @returns Whether the provided asynchronous validator was found on this control.\n */\n hasAsyncValidator(validator: AsyncValidatorFn): boolean {\n return hasValidator(this._rawAsyncValidators, validator);\n }\n\n /**\n * Empties out the synchronous validator list.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n */\n clearValidators(): void {\n this.validator = null;\n }\n\n /**\n * Empties out the async validator list.\n *\n * When you add or remove a validator at run time, you must call\n * `updateValueAndValidity()` for the new validation to take effect.\n *\n */\n clearAsyncValidators(): void {\n this.asyncValidator = null;\n }\n\n /**\n * Marks the control as `touched`. A control is touched by focus and\n * blur events that do not change the value.\n *\n * @see `markAsUntouched()`\n * @see `markAsDirty()`\n * @see `markAsPristine()`\n *\n * @param opts Configuration options that determine how the control propagates changes\n * and emits events after marking is applied.\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n */\n markAsTouched(opts: {onlySelf?: boolean} = {}): void {\n (this as {touched: boolean}).touched = true;\n\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsTouched(opts);\n }\n }\n\n /**\n * Marks the control and all its descendant controls as `touched`.\n * @see `markAsTouched()`\n */\n markAllAsTouched(): void {\n this.markAsTouched({onlySelf: true});\n\n this._forEachChild((control: AbstractControl) => control.markAllAsTouched());\n }\n\n /**\n * Marks the control as `untouched`.\n *\n * If the control has any children, also marks all children as `untouched`\n * and recalculates the `touched` status of all parent controls.\n *\n * @see `markAsTouched()`\n * @see `markAsDirty()`\n * @see `markAsPristine()`\n *\n * @param opts Configuration options that determine how the control propagates changes\n * and emits events after the marking is applied.\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n */\n markAsUntouched(opts: {onlySelf?: boolean} = {}): void {\n (this as {touched: boolean}).touched = false;\n this._pendingTouched = false;\n\n this._forEachChild((control: AbstractControl) => {\n control.markAsUntouched({onlySelf: true});\n });\n\n if (this._parent && !opts.onlySelf) {\n this._parent._updateTouched(opts);\n }\n }\n\n /**\n * Marks the control as `dirty`. A control becomes dirty when\n * the control's value is changed through the UI; compare `markAsTouched`.\n *\n * @see `markAsTouched()`\n * @see `markAsUntouched()`\n * @see `markAsPristine()`\n *\n * @param opts Configuration options that determine how the control propagates changes\n * and emits events after marking is applied.\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n */\n markAsDirty(opts: {onlySelf?: boolean} = {}): void {\n (this as {pristine: boolean}).pristine = false;\n\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsDirty(opts);\n }\n }\n\n /**\n * Marks the control as `pristine`.\n *\n * If the control has any children, marks all children as `pristine`,\n * and recalculates the `pristine` status of all parent\n * controls.\n *\n * @see `markAsTouched()`\n * @see `markAsUntouched()`\n * @see `markAsDirty()`\n *\n * @param opts Configuration options that determine how the control emits events after\n * marking is applied.\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n */\n markAsPristine(opts: {onlySelf?: boolean} = {}): void {\n (this as {pristine: boolean}).pristine = true;\n this._pendingDirty = false;\n\n this._forEachChild((control: AbstractControl) => {\n control.markAsPristine({onlySelf: true});\n });\n\n if (this._parent && !opts.onlySelf) {\n this._parent._updatePristine(opts);\n }\n }\n\n /**\n * Marks the control as `pending`.\n *\n * A control is pending while the control performs async validation.\n *\n * @see {@link AbstractControl.status}\n *\n * @param opts Configuration options that determine how the control propagates changes and\n * emits events after marking is applied.\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n * * `emitEvent`: When true or not supplied (the default), the `statusChanges`\n * observable emits an event with the latest status the control is marked pending.\n * When false, no events are emitted.\n *\n */\n markAsPending(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {\n (this as {status: FormControlStatus}).status = PENDING;\n\n if (opts.emitEvent !== false) {\n (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status);\n }\n\n if (this._parent && !opts.onlySelf) {\n this._parent.markAsPending(opts);\n }\n }\n\n /**\n * Disables the control. This means the control is exempt from validation checks and\n * excluded from the aggregate value of any parent. Its status is `DISABLED`.\n *\n * If the control has children, all children are also disabled.\n *\n * @see {@link AbstractControl.status}\n *\n * @param opts Configuration options that determine how the control propagates\n * changes and emits events after the control is disabled.\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control is disabled.\n * When false, no events are emitted.\n */\n disable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {\n // If parent has been marked artificially dirty we don't want to re-calculate the\n // parent's dirtiness based on the children.\n const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);\n\n (this as {status: FormControlStatus}).status = DISABLED;\n (this as {errors: ValidationErrors | null}).errors = null;\n this._forEachChild((control: AbstractControl) => {\n control.disable({...opts, onlySelf: true});\n });\n this._updateValue();\n\n if (opts.emitEvent !== false) {\n (this.valueChanges as EventEmitter<TValue>).emit(this.value);\n (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status);\n }\n\n this._updateAncestors({...opts, skipPristineCheck});\n this._onDisabledChange.forEach((changeFn) => changeFn(true));\n }\n\n /**\n * Enables the control. This means the control is included in validation checks and\n * the aggregate value of its parent. Its status recalculates based on its value and\n * its validators.\n *\n * By default, if the control has children, all children are enabled.\n *\n * @see {@link AbstractControl.status}\n *\n * @param opts Configure options that control how the control propagates changes and\n * emits events when marked as untouched\n * * `onlySelf`: When true, mark only this control. When false or not supplied,\n * marks all direct ancestors. Default is false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control is enabled.\n * When false, no events are emitted.\n */\n enable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {\n // If parent has been marked artificially dirty we don't want to re-calculate the\n // parent's dirtiness based on the children.\n const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);\n\n (this as {status: FormControlStatus}).status = VALID;\n this._forEachChild((control: AbstractControl) => {\n control.enable({...opts, onlySelf: true});\n });\n this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent});\n\n this._updateAncestors({...opts, skipPristineCheck});\n this._onDisabledChange.forEach((changeFn) => changeFn(false));\n }\n\n private _updateAncestors(\n opts: {onlySelf?: boolean, emitEvent?: boolean, skipPristineCheck?: boolean}): void {\n if (this._parent && !opts.onlySelf) {\n this._parent.updateValueAndValidity(opts);\n if (!opts.skipPristineCheck) {\n this._parent._updatePristine();\n }\n this._parent._updateTouched();\n }\n }\n\n /**\n * Sets the parent of the control\n *\n * @param parent The new parent.\n */\n setParent(parent: FormGroup|FormArray|null): void {\n this._parent = parent;\n }\n\n /**\n * Sets the value of the control. Abstract method (implemented in sub-classes).\n */\n abstract setValue(value: TRawValue, options?: Object): void;\n\n /**\n * Patches the value of the control. Abstract method (implemented in sub-classes).\n */\n abstract patchValue(value: TValue, options?: Object): void;\n\n /**\n * Resets the control. Abstract method (implemented in sub-classes).\n */\n abstract reset(value?: TValue, options?: Object): void;\n\n /**\n * The raw value of this control. For most control implementations, the raw value will include\n * disabled children.\n */\n getRawValue(): any {\n return this.value;\n }\n\n /**\n * Recalculates the value and validation status of the control.\n *\n * By default, it also updates the value and validity of its ancestors.\n *\n * @param opts Configuration options determine how the control propagates changes and emits events\n * after updates and validity checks are applied.\n * * `onlySelf`: When true, only update this control. When false or not supplied,\n * update all direct ancestors. Default is false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control is updated.\n * When false, no events are emitted.\n */\n updateValueAndValidity(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {\n this._setInitialStatus();\n this._updateValue();\n\n if (this.enabled) {\n this._cancelExistingSubscription();\n (this as {errors: ValidationErrors | null}).errors = this._runValidator();\n (this as {status: FormControlStatus}).status = this._calculateStatus();\n\n if (this.status === VALID || this.status === PENDING) {\n this._runAsyncValidator(opts.emitEvent);\n }\n }\n\n if (opts.emitEvent !== false) {\n (this.valueChanges as EventEmitter<TValue>).emit(this.value);\n (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status);\n }\n\n if (this._parent && !opts.onlySelf) {\n this._parent.updateValueAndValidity(opts);\n }\n }\n\n /** @internal */\n _updateTreeValidity(opts: {emitEvent?: boolean} = {emitEvent: true}): void {\n this._forEachChild((ctrl: AbstractControl) => ctrl._updateTreeValidity(opts));\n this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent});\n }\n\n private _setInitialStatus() {\n (this as {status: FormControlStatus}).status = this._allControlsDisabled() ? DISABLED : VALID;\n }\n\n private _runValidator(): ValidationErrors|null {\n return this.validator ? this.validator(this) : null;\n }\n\n private _runAsyncValidator(emitEvent?: boolean): void {\n if (this.asyncValidator) {\n (this as {status: FormControlStatus}).status = PENDING;\n this._hasOwnPendingAsyncValidator = true;\n const obs = toObservable(this.asyncValidator(this));\n this._asyncValidationSubscription = obs.subscribe((errors: ValidationErrors|null) => {\n this._hasOwnPendingAsyncValidator = false;\n // This will trigger the recalculation of the validation status, which depends on\n // the state of the asynchronous validation (whether it is in progress or not). So, it is\n // necessary that we have updated the `_hasOwnPendingAsyncValidator` boolean flag first.\n this.setErrors(errors, {emitEvent});\n });\n }\n }\n\n private _cancelExistingSubscription(): void {\n if (this._asyncValidationSubscription) {\n this._asyncValidationSubscription.unsubscribe();\n this._hasOwnPendingAsyncValidator = false;\n }\n }\n\n /**\n * Sets errors on a form control when running validations manually, rather than automatically.\n *\n * Calling `setErrors` also updates the validity of the parent control.\n *\n * @param opts Configuration options that determine how the control propagates\n * changes and emits events after the control errors are set.\n * * `emitEvent`: When true or not supplied (the default), the `statusChanges`\n * observable emits an event after the errors are set.\n *\n * @usageNotes\n *\n * ### Manually set the errors for a control\n *\n * ```\n * const login = new FormControl('someLogin');\n * login.setErrors({\n * notUnique: true\n * });\n *\n * expect(login.valid).toEqual(false);\n * expect(login.errors).toEqual({ notUnique: true });\n *\n * login.setValue('someOtherLogin');\n *\n * expect(login.valid).toEqual(true);\n * ```\n */\n setErrors(errors: ValidationErrors|null, opts: {emitEvent?: boolean} = {}): void {\n (this as {errors: ValidationErrors | null}).errors = errors;\n this._updateControlsErrors(opts.emitEvent !== false);\n }\n\n /**\n * Retrieves a child control given the control's name or path.\n *\n * This signature for get supports strings and `const` arrays (`.get(['foo', 'bar'] as const)`).\n */\n get<P extends string|(readonly(string|number)[])>(path: P):\n AbstractControl<ɵGetProperty<TRawValue, P>>|null;\n\n /**\n * Retrieves a child control given the control's name or path.\n *\n * This signature for `get` supports non-const (mutable) arrays. Inferred type\n * information will not be as robust, so prefer to pass a `readonly` array if possible.\n */\n get<P extends string|Array<string|number>>(path: P):\n AbstractControl<ɵGetProperty<TRawValue, P>>|null;\n\n /**\n * Retrieves a child control given the control's name or path.\n *\n * @param path A dot-delimited string or array of string/number values that define the path to the\n * control. If a string is provided, passing it as a string literal will result in improved type\n * information. Likewise, if an array is provided, passing it `as const` will cause improved type\n * information to be available.\n *\n * @usageNotes\n * ### Retrieve a nested control\n *\n * For example, to get a `name` control nested within a `person` sub-group:\n *\n * * `this.form.get('person.name');`\n *\n * -OR-\n *\n * * `this.form.get(['person', 'name'] as const);` // `as const` gives improved typings\n *\n * ### Retrieve a control in a FormArray\n *\n * When accessing an element inside a FormArray, you can use an element index.\n * For example, to get a `price` control from the first element in an `items` array you can use:\n *\n * * `this.form.get('items.0.price');`\n *\n * -OR-\n *\n * * `this.form.get(['items', 0, 'price']);`\n */\n get<P extends string|((string | number)[])>(path: P):\n AbstractControl<ɵGetProperty<TRawValue, P>>|null {\n let currPath: Array<string|number>|string = path;\n if (currPath == null) return null;\n if (!Array.isArray(currPath)) currPath = currPath.split('.');\n if (currPath.length === 0) return null;\n return currPath.reduce(\n (control: AbstractControl|null, name) => control && control._find(name), this);\n }\n\n /**\n * @description\n * Reports error data for the control with the given path.\n *\n * @param errorCode The code of the error to check\n * @param path A list of control names that designates how to move from the current control\n * to the control that should be queried for errors.\n *\n * @usageNotes\n * For example, for the following `FormGroup`:\n *\n * ```\n * form = new FormGroup({\n * address: new FormGroup({ street: new FormControl() })\n * });\n * ```\n *\n * The path to the 'street' control from the root form would be 'address' -> 'street'.\n *\n * It can be provided to this method in one of two formats:\n *\n * 1. An array of string control names, e.g. `['address', 'street']`\n * 1. A period-delimited list of control names in one string, e.g. `'address.street'`\n *\n * @returns error data for that particular error. If the control or error is not present,\n * null is returned.\n */\n getError(errorCode: string, path?: Array<string|number>|string): any {\n const control = path ? this.get(path) : this;\n return control && control.errors ? control.errors[errorCode] : null;\n }\n\n /**\n * @description\n * Reports whether the control with the given path has the error specified.\n *\n * @param errorCode The code of the error to check\n * @param path A list of control names that designates how to move from the current control\n * to the control that should be queried for errors.\n *\n * @usageNotes\n * For example, for the following `FormGroup`:\n *\n * ```\n * form = new FormGroup({\n * address: new FormGroup({ street: new FormControl() })\n * });\n * ```\n *\n * The path to the 'street' control from the root form would be 'address' -> 'street'.\n *\n * It can be provided to this method in one of two formats:\n *\n * 1. An array of string control names, e.g. `['address', 'street']`\n * 1. A period-delimited list of control names in one string, e.g. `'address.street'`\n *\n * If no path is given, this method checks for the error on the current control.\n *\n * @returns whether the given error is present in the control at the given path.\n *\n * If the control is not present, false is returned.\n */\n hasError(errorCode: string, path?: Array<string|number>|string): boolean {\n return !!this.getError(errorCode, path);\n }\n\n /**\n * Retrieves the top-level ancestor of this control.\n */\n get root(): AbstractControl {\n let x: AbstractControl = this;\n\n while (x._parent) {\n x = x._parent;\n }\n\n return x;\n }\n\n /** @internal */\n _updateControlsErrors(emitEvent: boolean): void {\n (this as {status: FormControlStatus}).status = this._calculateStatus();\n\n if (emitEvent) {\n (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status);\n }\n\n if (this._parent) {\n this._parent._updateControlsErrors(emitEvent);\n }\n }\n\n /** @internal */\n _initObservables() {\n (this as {valueChanges: Observable<TValue>}).valueChanges = new EventEmitter();\n (this as {statusChanges: Observable<FormControlStatus>}).statusChanges = new EventEmitter();\n }\n\n\n private _calculateStatus(): FormControlStatus {\n if (this._allControlsDisabled()) return DISABLED;\n if (this.errors) return INVALID;\n if (this._hasOwnPendingAsyncValidator || this._anyControlsHaveStatus(PENDING)) return PENDING;\n if (this._anyControlsHaveStatus(INVALID)) return INVALID;\n return VALID;\n }\n\n /** @internal */\n abstract _updateValue(): void;\n\n /** @internal */\n abstract _forEachChild(cb: (c: AbstractControl) => void): void;\n\n /** @internal */\n abstract _anyControls(condition: (c: AbstractControl) => boolean): boolean;\n\n /** @internal */\n abstract _allControlsDisabled(): boolean;\n\n /** @internal */\n abstract _syncPendingControls(): boolean;\n\n /** @internal */\n _anyControlsHaveStatus(status: FormControlStatus): boolean {\n return this._anyControls((control: AbstractControl) => control.status === status);\n }\n\n /** @internal */\n _anyControlsDirty(): boolean {\n return this._anyControls((control: AbstractControl) => control.dirty);\n }\n\n /** @internal */\n _anyControlsTouched(): boolean {\n return this._anyControls((control: AbstractControl) => control.touched);\n }\n\n /** @internal */\n _updatePristine(opts: {onlySelf?: boolean} = {}): void {\n (this as {pristine: boolean}).pristine = !this._anyControlsDirty();\n\n if (this._parent && !opts.onlySelf) {\n this._parent._updatePristine(opts);\n }\n }\n\n /** @internal */\n _updateTouched(opts: {onlySelf?: boolean} = {}): void {\n (this as {touched: boolean}).touched = this._anyControlsTouched();\n\n if (this._parent && !opts.onlySelf) {\n this._parent._updateTouched(opts);\n }\n }\n\n /** @internal */\n _onDisabledChange: Array<(isDisabled: boolean) => void> = [];\n\n /** @internal */\n _registerOnCollectionChange(fn: () => void): void {\n this._onCollectionChange = fn;\n }\n\n /** @internal */\n _setUpdateStrategy(opts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null): void {\n if (isOptionsObj(opts) && opts.updateOn != null) {\n this._updateOn = opts.updateOn!;\n }\n }\n /**\n * Check to see if parent has been marked artificially dirty.\n *\n * @internal\n */\n private _parentMarkedDirty(onlySelf?: boolean): boolean {\n const parentDirty = this._parent && this._parent.dirty;\n return !onlySelf && !!parentDirty && !this._parent!._anyControlsDirty();\n }\n\n /** @internal */\n _find(name: string|number): AbstractControl|null {\n return null;\n }\n\n /**\n * Internal implementation of the `setValidators` method. Needs to be separated out into a\n * different method, because it is called in the constructor and it can break cases where\n * a control is extended.\n */\n private _assignValidators(validators: ValidatorFn|ValidatorFn[]|null): void {\n this._rawValidators = Array.isArray(validators) ? validators.slice() : validators;\n this._composedValidatorFn = coerceToValidator(this._rawValidators);\n }\n\n /**\n * Internal implementation of the `setAsyncValidators` method. Needs to be separated out into a\n * different method, because it is called in the constructor and it can break cases where\n * a control is extended.\n */\n private _assignAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]|null): void {\n this._rawAsyncValidators = Array.isArray(validators) ? validators.slice() : validators;\n this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AsyncValidatorFn, ValidatorFn} from '../directives/validators';\n\nimport {AbstractControl, AbstractControlOptions, assertAllValuesPresent, assertControlPresent, pickAsyncValidators, pickValidators, ɵRawValue, ɵTypedOrUntyped, ɵValue} from './abstract_model';\n\n/**\n * FormGroupValue extracts the type of `.value` from a FormGroup's inner object type. The untyped\n * case falls back to {[key: string]: any}.\n *\n * Angular uses this type internally to support Typed Forms; do not use it directly.\n *\n * For internal use only.\n */\nexport type ɵFormGroupValue<T extends {[K in keyof T]?: AbstractControl<any>}> =\n ɵTypedOrUntyped<T, Partial<{[K in keyof T]: ɵValue<T[K]>}>, {[key: string]: any}>;\n\n/**\n * FormGroupRawValue extracts the type of `.getRawValue()` from a FormGroup's inner object type. The\n * untyped case falls back to {[key: string]: any}.\n *\n * Angular uses this type internally to support Typed Forms; do not use it directly.\n *\n * For internal use only.\n */\nexport type ɵFormGroupRawValue<T extends {[K in keyof T]?: AbstractControl<any>}> =\n ɵTypedOrUntyped<T, {[K in keyof T]: ɵRawValue<T[K]>}, {[key: string]: any}>;\n\n/**\n * OptionalKeys returns the union of all optional keys in the object.\n *\n * Angular uses this type internally to support Typed Forms; do not use it directly.\n */\nexport type ɵOptionalKeys<T> = {\n [K in keyof T] -?: undefined extends T[K] ? K : never\n}[keyof T];\n\n/**\n * Tracks the value and validity state of a group of `FormControl` instances.\n *\n * A `FormGroup` aggregates the values of each child `FormControl` into one object,\n * with each control name as the key. It calculates its status by reducing the status values\n * of its children. For example, if one of the controls in a group is invalid, the entire\n * group becomes invalid.\n *\n * `FormGroup` is one of the four fundamental building blocks used to define forms in Angular,\n * along with `FormControl`, `FormArray`, and `FormRecord`.\n *\n * When instantiating a `FormGroup`, pass in a collection of child controls as the first\n * argument. The key for each child registers the name for the control.\n *\n * `FormGroup` is intended for use cases where the keys are known ahead of time.\n * If you need to dynamically add and remove controls, use {@link FormRecord} instead.\n *\n * `FormGroup` accepts an optional type parameter `TControl`, which is an object type with inner\n * control types as values.\n *\n * @usageNotes\n *\n * ### Create a form group with 2 controls\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl('Nancy', Validators.minLength(2)),\n * last: new FormControl('Drew'),\n * });\n *\n * console.log(form.value); // {first: 'Nancy', last; 'Drew'}\n * console.log(form.status); // 'VALID'\n * ```\n *\n * ### The type argument, and optional controls\n *\n * `FormGroup` accepts one generic argument, which is an object containing its inner controls.\n * This type will usually be inferred automatically, but you can always specify it explicitly if you\n * wish.\n *\n * If you have controls that are optional (i.e. they can be removed, you can use the `?` in the\n * type):\n *\n * ```\n * const form = new FormGroup<{\n * first: FormControl<string|null>,\n * middle?: FormControl<string|null>, // Middle name is optional.\n * last: FormControl<string|null>,\n * }>({\n * first: new FormControl('Nancy'),\n * last: new FormControl('Drew'),\n * });\n * ```\n *\n * ### Create a form group with a group-level validator\n *\n * You include group-level validators as the second arg, or group-level async\n * validators as the third arg. These come in handy when you want to perform validation\n * that considers the value of more than one child control.\n *\n * ```\n * const form = new FormGroup({\n * password: new FormControl('', Validators.minLength(2)),\n * passwordConfirm: new FormControl('', Validators.minLength(2)),\n * }, passwordMatchValidator);\n *\n *\n * function passwordMatchValidator(g: FormGroup) {\n * return g.get('password').value === g.get('passwordConfirm').value\n * ? null : {'mismatch': true};\n * }\n * ```\n *\n * Like `FormControl` instances, you choose to pass in\n * validators and async validators as part of an options object.\n *\n * ```\n * const form = new FormGroup({\n * password: new FormControl('')\n * passwordConfirm: new FormControl('')\n * }, { validators: passwordMatchValidator, asyncValidators: otherValidator });\n * ```\n *\n * ### Set the updateOn property for all controls in a form group\n *\n * The options object is used to set a default value for each child\n * control's `updateOn` property. If you set `updateOn` to `'blur'` at the\n * group level, all child controls default to 'blur', unless the child\n * has explicitly specified a different `updateOn` value.\n *\n * ```ts\n * const c = new FormGroup({\n * one: new FormControl()\n * }, { updateOn: 'blur' });\n * ```\n *\n * ### Using a FormGroup with optional controls\n *\n * It is possible to have optional controls in a FormGroup. An optional control can be removed later\n * using `removeControl`, and can be omitted when calling `reset`. Optional controls must be\n * declared optional in the group's type.\n *\n * ```ts\n * const c = new FormGroup<{one?: FormControl<string>}>({\n * one: new FormControl('')\n * });\n * ```\n *\n * Notice that `c.value.one` has type `string|null|undefined`. This is because calling `c.reset({})`\n * without providing the optional key `one` will cause it to become `null`.\n *\n * @publicApi\n */\nexport class FormGroup<TControl extends {[K in keyof TControl]: AbstractControl<any>} = any> extends\n AbstractControl<\n ɵTypedOrUntyped<TControl, ɵFormGroupValue<TControl>, any>,\n ɵTypedOrUntyped<TControl, ɵFormGroupRawValue<TControl>, any>> {\n /**\n * Creates a new `FormGroup` instance.\n *\n * @param controls A collection of child controls. The key for each child is the name\n * under which it is registered.\n *\n * @param validatorOrOpts A synchronous validator function, or an array of\n * such functions, or an `AbstractControlOptions` object that contains validation functions\n * and a validation trigger.\n *\n * @param asyncValidator A single async validator or array of async validator functions\n *\n */\n constructor(\n controls: TControl, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null,\n asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) {\n super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this.controls = controls;\n this._initObservables();\n this._setUpdateStrategy(validatorOrOpts);\n this._setUpControls();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,\n // so we set `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!this.asyncValidator\n });\n }\n\n public controls: ɵTypedOrUntyped<TControl, TControl, {[key: string]: AbstractControl<any>}>;\n\n /**\n * Registers a control with the group's list of controls. In a strongly-typed group, the control\n * must be in the group's type (possibly as an optional key).\n *\n * This method does not update the value or validity of the control.\n * Use {@link FormGroup#addControl addControl} instead.\n *\n * @param name The control name to register in the collection\n * @param control Provides the control for the given name\n */\n registerControl<K extends string&keyof TControl>(name: K, control: TControl[K]): TControl[K];\n registerControl(\n this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string,\n control: AbstractControl<any>): AbstractControl<any>;\n\n registerControl<K extends string&keyof TControl>(name: K, control: TControl[K]): TControl[K] {\n if (this.controls[name]) return (this.controls as any)[name];\n this.controls[name] = control;\n control.setParent(this as FormGroup);\n control._registerOnCollectionChange(this._onCollectionChange);\n return control;\n }\n\n /**\n * Add a control to this group. In a strongly-typed group, the control must be in the group's type\n * (possibly as an optional key).\n *\n * If a control with a given name already exists, it would *not* be replaced with a new one.\n * If you want to replace an existing control, use the {@link FormGroup#setControl setControl}\n * method instead. This method also updates the value and validity of the control.\n *\n * @param name The control name to add to the collection\n * @param control Provides the control for the given name\n * @param options Specifies whether this FormGroup instance should emit events after a new\n * control is added.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges` observables emit events with the latest status and value when the control is\n * added. When false, no events are emitted.\n */\n addControl(\n this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string,\n control: AbstractControl, options?: {emitEvent?: boolean}): void;\n addControl<K extends string&keyof TControl>(name: K, control: Required<TControl>[K], options?: {\n emitEvent?: boolean\n }): void;\n\n addControl<K extends string&keyof TControl>(name: K, control: Required<TControl>[K], options: {\n emitEvent?: boolean\n } = {}): void {\n this.registerControl(name, control);\n this.updateValueAndValidity({emitEvent: options.emitEvent});\n this._onCollectionChange();\n }\n\n removeControl(this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, options?: {\n emitEvent?: boolean;\n }): void;\n removeControl<S extends string>(name: ɵOptionalKeys<TControl>&S, options?: {\n emitEvent?: boolean;\n }): void;\n\n /**\n * Remove a control from this group. In a strongly-typed group, required controls cannot be\n * removed.\n *\n * This method also updates the value and validity of the control.\n *\n * @param name The control name to remove from the collection\n * @param options Specifies whether this FormGroup instance should emit events after a\n * control is removed.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges` observables emit events with the latest status and value when the control is\n * removed. When false, no events are emitted.\n */\n removeControl(name: string, options: {emitEvent?: boolean;} = {}): void {\n if ((this.controls as any)[name])\n (this.controls as any)[name]._registerOnCollectionChange(() => {});\n delete ((this.controls as any)[name]);\n this.updateValueAndValidity({emitEvent: options.emitEvent});\n this._onCollectionChange();\n }\n\n /**\n * Replace an existing control. In a strongly-typed group, the control must be in the group's type\n * (possibly as an optional key).\n *\n * If a control with a given name does not exist in this `FormGroup`, it will be added.\n *\n * @param name The control name to replace in the collection\n * @param control Provides the control for the given name\n * @param options Specifies whether this FormGroup instance should emit events after an\n * existing control is replaced.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges` observables emit events with the latest status and value when the control is\n * replaced with a new one. When false, no events are emitted.\n */\n setControl<K extends string&keyof TControl>(name: K, control: TControl[K], options?: {\n emitEvent?: boolean\n }): void;\n setControl(\n this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string,\n control: AbstractControl, options?: {emitEvent?: boolean}): void;\n\n setControl<K extends string&keyof TControl>(name: K, control: TControl[K], options: {\n emitEvent?: boolean\n } = {}): void {\n if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {});\n delete (this.controls[name]);\n if (control) this.registerControl(name, control);\n this.updateValueAndValidity({emitEvent: options.emitEvent});\n this._onCollectionChange();\n }\n\n /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * Reports false for disabled controls. If you'd like to check for existence in the group\n * only, use {@link AbstractControl#get get} instead.\n *\n * @param controlName The control name to check for existence in the collection\n *\n * @returns false for disabled controls, true otherwise.\n */\n contains<K extends string>(controlName: K): boolean;\n contains(this: FormGroup<{[key: string]: AbstractControl<any>}>, controlName: string): boolean;\n\n contains<K extends string&keyof TControl>(controlName: K): boolean {\n return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;\n }\n\n /**\n * Sets the value of the `FormGroup`. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * @usageNotes\n * ### Set the complete value for the form group\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n *\n * console.log(form.value); // {first: null, last: null}\n *\n * form.setValue({first: 'Nancy', last: 'Drew'});\n * console.log(form.value); // {first: 'Nancy', last: 'Drew'}\n * ```\n *\n * @throws When strict checks fail, such as setting the value of a control\n * that doesn't exist or if you exclude a value of a control that does exist.\n *\n * @param value The new value for the control that matches the structure of the group.\n * @param options Configuration options that determine how the control propagates changes\n * and emits events after the value changes.\n * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity\n * updateValueAndValidity} method.\n *\n * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is\n * false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control value is updated.\n * When false, no events are emitted.\n */\n override setValue(value: ɵFormGroupRawValue<TControl>, options: {\n onlySelf?: boolean,\n emitEvent?: boolean\n } = {}): void {\n assertAllValuesPresent(this, true, value);\n (Object.keys(value) as Array<keyof TControl>).forEach(name => {\n assertControlPresent(this, true, name as any);\n (this.controls as any)[name].setValue(\n (value as any)[name], {onlySelf: true, emitEvent: options.emitEvent});\n });\n this.updateValueAndValidity(options);\n }\n\n /**\n * Patches the value of the `FormGroup`. It accepts an object with control\n * names as keys, and does its best to match the values to the correct controls\n * in the group.\n *\n * It accepts both super-sets and sub-sets of the group without throwing an error.\n *\n * @usageNotes\n * ### Patch the value for a form group\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl(),\n * last: new FormControl()\n * });\n * console.log(form.value); // {first: null, last: null}\n *\n * form.patchValue({first: 'Nancy'});\n * console.log(form.value); // {first: 'Nancy', last: null}\n * ```\n *\n * @param value The object that matches the structure of the group.\n * @param options Configuration options that determine how the control propagates changes and\n * emits events after the value is patched.\n * * `onlySelf`: When true, each change only affects this control and not its parent. Default is\n * true.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges` observables emit events with the latest status and value when the control value\n * is updated. When false, no events are emitted. The configuration options are passed to\n * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.\n */\n override patchValue(value: ɵFormGroupValue<TControl>, options: {\n onlySelf?: boolean,\n emitEvent?: boolean\n } = {}): void {\n // Even though the `value` argument type doesn't allow `null` and `undefined` values, the\n // `patchValue` can be called recursively and inner data structures might have these values, so\n // we just ignore such cases when a field containing FormGroup instance receives `null` or\n // `undefined` as a value.\n if (value == null /* both `null` and `undefined` */) return;\n (Object.keys(value) as Array<keyof TControl>).forEach(name => {\n // The compiler cannot see through the uninstantiated conditional type of `this.controls`, so\n // `as any` is required.\n const control = (this.controls as any)[name];\n if (control) {\n control.patchValue(\n /* Guaranteed to be present, due to the outer forEach. */ value\n [name as keyof ɵFormGroupValue<TControl>]!,\n {onlySelf: true, emitEvent: options.emitEvent});\n }\n });\n this.updateValueAndValidity(options);\n }\n\n /**\n * Resets the `FormGroup`, marks all descendants `pristine` and `untouched` and sets\n * the value of all descendants to their default values, or null if no defaults were provided.\n *\n * You reset to a specific form state by passing in a map of states\n * that matches the structure of your form, with control names as keys. The state\n * is a standalone value or a form state object with both a value and a disabled\n * status.\n *\n * @param value Resets the control with an initial value,\n * or an object that defines the initial value and disabled state.\n *\n * @param options Configuration options that determine how the control propagates changes\n * and emits events when the group is reset.\n * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is\n * false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control is reset.\n * When false, no events are emitted.\n * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity\n * updateValueAndValidity} method.\n *\n * @usageNotes\n *\n * ### Reset the form group values\n *\n * ```ts\n * const form = new FormGroup({\n * first: new FormControl('first name'),\n * last: new FormControl('last name')\n * });\n *\n * console.log(form.value); // {first: 'first name', last: 'last name'}\n *\n * form.reset({ first: 'name', last: 'last name' });\n *\n * console.log(form.value); // {first: 'name', last: 'last name'}\n * ```\n *\n * ### Reset the form group values and disabled status\n *\n * ```\n * const form = new FormGroup({\n * first: new FormControl('first name'),\n * last: new FormControl('last name')\n * });\n *\n * form.reset({\n * first: {value: 'name', disabled: true},\n * last: 'last'\n * });\n *\n * console.log(form.value); // {last: 'last'}\n * console.log(form.get('first').status); // 'DISABLED'\n * ```\n */\n override reset(\n value: ɵTypedOrUntyped<TControl, ɵFormGroupValue<TControl>, any> = {} as unknown as\n ɵFormGroupValue<TControl>,\n options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {\n this._forEachChild((control, name) => {\n control.reset((value as any)[name], {onlySelf: true, emitEvent: options.emitEvent});\n });\n this._updatePristine(options);\n this._updateTouched(options);\n this.updateValueAndValidity(options);\n }\n\n /**\n * The aggregate value of the `FormGroup`, including any disabled controls.\n *\n * Retrieves all values regardless of disabled status.\n */\n override getRawValue(): ɵTypedOrUntyped<TControl, ɵFormGroupRawValue<TControl>, any> {\n return this._reduceChildren({}, (acc, control, name) => {\n (acc as any)[name] = (control as any).getRawValue();\n return acc;\n }) as any;\n }\n\n /** @internal */\n override _syncPendingControls(): boolean {\n let subtreeUpdated = this._reduceChildren(false, (updated: boolean, child) => {\n return child._syncPendingControls() ? true : updated;\n });\n if (subtreeUpdated) this.updateValueAndValidity({onlySelf: true});\n return subtreeUpdated;\n }\n\n /** @internal */\n override _forEachChild(cb: (v: any, k: any) => void): void {\n Object.keys(this.controls).forEach(key => {\n // The list of controls can change (for ex. controls might be removed) while the loop\n // is running (as a result of invoking Forms API in `valueChanges` subscription), so we\n // have to null check before invoking the callback.\n const control = (this.controls as any)[key];\n control && cb(control, key);\n });\n }\n\n /** @internal */\n _setUpControls(): void {\n this._forEachChild((control) => {\n control.setParent(this);\n control._registerOnCollectionChange(this._onCollectionChange);\n });\n }\n\n /** @internal */\n override _updateValue(): void {\n (this as {value: any}).value = this._reduceValue();\n }\n\n /** @internal */\n override _anyControls(condition: (c: AbstractControl) => boolean): boolean {\n for (const [controlName, control] of Object.entries(this.controls)) {\n if (this.contains(controlName as any) && condition(control as any)) {\n return true;\n }\n }\n return false;\n }\n\n /** @internal */\n _reduceValue(): Partial<TControl> {\n let acc: Partial<TControl> = {};\n return this._reduceChildren(acc, (acc, control, name) => {\n if (control.enabled || this.disabled) {\n acc[name] = control.value;\n }\n return acc;\n });\n }\n\n /** @internal */\n _reduceChildren<T, K extends keyof TControl>(\n initValue: T, fn: (acc: T, control: TControl[K], name: K) => T): T {\n let res = initValue;\n this._forEachChild((control: TControl[K], name: K) => {\n res = fn(res, control, name);\n });\n return res;\n }\n\n /** @internal */\n override _allControlsDisabled(): boolean {\n for (const controlName of (Object.keys(this.controls) as Array<keyof TControl>)) {\n if ((this.controls as any)[controlName].enabled) {\n return false;\n }\n }\n return Object.keys(this.controls).length > 0 || this.disabled;\n }\n\n /** @internal */\n override _find(name: string|number): AbstractControl|null {\n return this.controls.hasOwnProperty(name as string) ?\n (this.controls as any)[name as keyof TControl] :\n null;\n }\n}\n\ninterface UntypedFormGroupCtor {\n new(controls: {[key: string]: AbstractControl},\n validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null,\n asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormGroup;\n\n /**\n * The presence of an explicit `prototype` property provides backwards-compatibility for apps that\n * manually inspect the prototype chain.\n */\n prototype: FormGroup<any>;\n}\n\n/**\n * UntypedFormGroup is a non-strongly-typed version of `FormGroup`.\n */\nexport type UntypedFormGroup = FormGroup<any>;\n\nexport const UntypedFormGroup: UntypedFormGroupCtor = FormGroup;\n\n/**\n * @description\n * Asserts that the given control is an instance of `FormGroup`\n *\n * @publicApi\n */\nexport const isFormGroup = (control: unknown): control is FormGroup => control instanceof FormGroup;\n\n/**\n * Tracks the value and validity state of a collection of `FormControl` instances, each of which has\n * the same value type.\n *\n * `FormRecord` is very similar to {@link FormGroup}, except it can be used with a dynamic keys,\n * with controls added and removed as needed.\n *\n * `FormRecord` accepts one generic argument, which describes the type of the controls it contains.\n *\n * @usageNotes\n *\n * ```\n * let numbers = new FormRecord({bill: new FormControl('415-123-456')});\n * numbers.addControl('bob', new FormControl('415-234-567'));\n * numbers.removeControl('bill');\n * ```\n *\n * @publicApi\n */\nexport class FormRecord<TControl extends AbstractControl = AbstractControl> extends\n FormGroup<{[key: string]: TControl}> {}\n\nexport interface FormRecord<TControl> {\n /**\n * Registers a control with the records's list of controls.\n *\n * See `FormGroup#registerControl` for additional information.\n */\n registerControl(name: string, control: TControl): TControl;\n\n /**\n * Add a control to this group.\n *\n * See `FormGroup#addControl` for additional information.\n */\n addControl(name: string, control: TControl, options?: {emitEvent?: boolean}): void;\n\n /**\n * Remove a control from this group.\n *\n * See `FormGroup#removeControl` for additional information.\n */\n removeControl(name: string, options?: {emitEvent?: boolean}): void;\n\n /**\n * Replace an existing control.\n *\n * See `FormGroup#setControl` for additional information.\n */\n setControl(name: string, control: TControl, options?: {emitEvent?: boolean}): void;\n\n /**\n * Check whether there is an enabled control with the given name in the group.\n *\n * See `FormGroup#contains` for additional information.\n */\n contains(controlName: string): boolean;\n\n /**\n * Sets the value of the `FormRecord`. It accepts an object that matches\n * the structure of the group, with control names as keys.\n *\n * See `FormGroup#setValue` for additional information.\n */\n setValue(value: {[key: string]: ɵValue<TControl>}, options?: {\n onlySelf?: boolean,\n emitEvent?: boolean\n }): void;\n\n /**\n * Patches the value of the `FormRecord`. It accepts an object with control\n * names as keys, and does its best to match the values to the correct controls\n * in the group.\n *\n * See `FormGroup#patchValue` for additional information.\n */\n patchValue(value: {[key: string]: ɵValue<TControl>}, options?: {\n onlySelf?: boolean,\n emitEvent?: boolean\n }): void;\n\n /**\n * Resets the `FormRecord`, marks all descendants `pristine` and `untouched` and sets\n * the value of all descendants to null.\n *\n * See `FormGroup#reset` for additional information.\n */\n reset(value?: {[key: string]: ɵValue<TControl>}, options?: {\n onlySelf?: boolean,\n emitEvent?: boolean\n }): void;\n\n /**\n * The aggregate value of the `FormRecord`, including any disabled controls.\n *\n * See `FormGroup#getRawValue` for additional information.\n */\n getRawValue(): {[key: string]: ɵRawValue<TControl>};\n}\n\n/**\n * @description\n * Asserts that the given control is an instance of `FormRecord`\n *\n * @publicApi\n */\nexport const isFormRecord = (control: unknown): control is FormRecord =>\n control instanceof FormRecord;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Inject, InjectionToken, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\nimport {AbstractControl} from '../model/abstract_model';\nimport {FormArray} from '../model/form_array';\nimport {FormControl} from '../model/form_control';\nimport {FormGroup} from '../model/form_group';\nimport {getControlAsyncValidators, getControlValidators, mergeValidators} from '../validators';\n\nimport {AbstractControlDirective} from './abstract_control_directive';\nimport {AbstractFormGroupDirective} from './abstract_form_group_directive';\nimport {ControlContainer} from './control_container';\nimport {BuiltInControlValueAccessor, ControlValueAccessor} from './control_value_accessor';\nimport {DefaultValueAccessor} from './default_value_accessor';\nimport {NgControl} from './ng_control';\nimport {FormArrayName} from './reactive_directives/form_group_name';\nimport {ngModelWarning} from './reactive_errors';\nimport {AsyncValidatorFn, Validator, ValidatorFn} from './validators';\n\n/**\n * Token to provide to allow SetDisabledState to always be called when a CVA is added, regardless of\n * whether the control is disabled or enabled.\n *\n * @see `FormsModule.withConfig`\n */\nexport const CALL_SET_DISABLED_STATE = new InjectionToken(\n 'CallSetDisabledState', {providedIn: 'root', factory: () => setDisabledStateDefault});\n\n/**\n * The type for CALL_SET_DISABLED_STATE. If `always`, then ControlValueAccessor will always call\n * `setDisabledState` when attached, which is the most correct behavior. Otherwise, it will only be\n * called when disabled, which is the legacy behavior for compatibility.\n *\n * @publicApi\n * @see `FormsModule.withConfig`\n */\nexport type SetDisabledStateOption = 'whenDisabledForLegacyCode'|'always';\n\n/**\n * Whether to use the fixed setDisabledState behavior by default.\n */\nexport const setDisabledStateDefault: SetDisabledStateOption = 'always';\n\nexport function controlPath(name: string|null, parent: ControlContainer): string[] {\n return [...parent.path!, name!];\n}\n\n/**\n * Links a Form control and a Form directive by setting up callbacks (such as `onChange`) on both\n * instances. This function is typically invoked when form directive is being initialized.\n *\n * @param control Form control instance that should be linked.\n * @param dir Directive that should be linked with a given control.\n */\nexport function setUpControl(\n control: FormControl, dir: NgControl,\n callSetDisabledState: SetDisabledStateOption = setDisabledStateDefault): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!control) _throwError(dir, 'Cannot find control with');\n if (!dir.valueAccessor) _throwMissingValueAccessorError(dir);\n }\n\n setUpValidators(control, dir);\n\n dir.valueAccessor!.writeValue(control.value);\n\n // The legacy behavior only calls the CVA's `setDisabledState` if the control is disabled.\n // If the `callSetDisabledState` option is set to `always`, then this bug is fixed and\n // the method is always called.\n if (control.disabled || callSetDisabledState === 'always') {\n dir.valueAccessor!.setDisabledState?.(control.disabled);\n }\n\n setUpViewChangePipeline(control, dir);\n setUpModelChangePipeline(control, dir);\n\n setUpBlurPipeline(control, dir);\n\n setUpDisabledChangeHandler(control, dir);\n}\n\n/**\n * Reverts configuration performed by the `setUpControl` control function.\n * Effectively disconnects form control with a given form directive.\n * This function is typically invoked when corresponding form directive is being destroyed.\n *\n * @param control Form control which should be cleaned up.\n * @param dir Directive that should be disconnected from a given control.\n * @param validateControlPresenceOnChange Flag that indicates whether onChange handler should\n * contain asserts to verify that it's not called once directive is destroyed. We need this flag\n * to avoid potentially breaking changes caused by better control cleanup introduced in #39235.\n */\nexport function cleanUpControl(\n control: FormControl|null, dir: NgControl,\n validateControlPresenceOnChange: boolean = true): void {\n const noop = () => {\n if (validateControlPresenceOnChange && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n _noControlError(dir);\n }\n };\n\n // The `valueAccessor` field is typically defined on FromControl and FormControlName directive\n // instances and there is a logic in `selectValueAccessor` function that throws if it's not the\n // case. We still check the presence of `valueAccessor` before invoking its methods to make sure\n // that cleanup works correctly if app code or tests are setup to ignore the error thrown from\n // `selectValueAccessor`. See https://github.com/angular/angular/issues/40521.\n if (dir.valueAccessor) {\n dir.valueAccessor.registerOnChange(noop);\n dir.valueAccessor.registerOnTouched(noop);\n }\n\n cleanUpValidators(control, dir);\n\n if (control) {\n dir._invokeOnDestroyCallbacks();\n control._registerOnCollectionChange(() => {});\n }\n}\n\nfunction registerOnValidatorChange<V>(validators: (V|Validator)[], onChange: () => void): void {\n validators.forEach((validator: V|Validator) => {\n if ((<Validator>validator).registerOnValidatorChange)\n (<Validator>validator).registerOnValidatorChange!(onChange);\n });\n}\n\n/**\n * Sets up disabled change handler function on a given form control if ControlValueAccessor\n * associated with a given directive instance supports the `setDisabledState` call.\n *\n * @param control Form control where disabled change handler should be setup.\n * @param dir Corresponding directive instance associated with this control.\n */\nexport function setUpDisabledChangeHandler(control: FormControl, dir: NgControl): void {\n if (dir.valueAccessor!.setDisabledState) {\n const onDisabledChange = (isDisabled: boolean) => {\n dir.valueAccessor!.setDisabledState!(isDisabled);\n };\n control.registerOnDisabledChange(onDisabledChange);\n\n // Register a callback function to cleanup disabled change handler\n // from a control instance when a directive is destroyed.\n dir._registerOnDestroy(() => {\n control._unregisterOnDisabledChange(onDisabledChange);\n });\n }\n}\n\n/**\n * Sets up sync and async directive validators on provided form control.\n * This function merges validators from the directive into the validators of the control.\n *\n * @param control Form control where directive validators should be setup.\n * @param dir Directive instance that contains validators to be setup.\n */\nexport function setUpValidators(control: AbstractControl, dir: AbstractControlDirective): void {\n const validators = getControlValidators(control);\n if (dir.validator !== null) {\n control.setValidators(mergeValidators<ValidatorFn>(validators, dir.validator));\n } else if (typeof validators === 'function') {\n // If sync validators are represented by a single validator function, we force the\n // `Validators.compose` call to happen by executing the `setValidators` function with\n // an array that contains that function. We need this to avoid possible discrepancies in\n // validators behavior, so sync validators are always processed by the `Validators.compose`.\n // Note: we should consider moving this logic inside the `setValidators` function itself, so we\n // have consistent behavior on AbstractControl API level. The same applies to the async\n // validators logic below.\n control.setValidators([validators]);\n }\n\n const asyncValidators = getControlAsyncValidators(control);\n if (dir.asyncValidator !== null) {\n control.setAsyncValidators(\n mergeValidators<AsyncValidatorFn>(asyncValidators, dir.asyncValidator));\n } else if (typeof asyncValidators === 'function') {\n control.setAsyncValidators([asyncValidators]);\n }\n\n // Re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4\n const onValidatorChange = () => control.updateValueAndValidity();\n registerOnValidatorChange<ValidatorFn>(dir._rawValidators, onValidatorChange);\n registerOnValidatorChange<AsyncValidatorFn>(dir._rawAsyncValidators, onValidatorChange);\n}\n\n/**\n * Cleans up sync and async directive validators on provided form control.\n * This function reverts the setup performed by the `setUpValidators` function, i.e.\n * removes directive-specific validators from a given control instance.\n *\n * @param control Form control from where directive validators should be removed.\n * @param dir Directive instance that contains validators to be removed.\n * @returns true if a control was updated as a result of this action.\n */\nexport function cleanUpValidators(\n control: AbstractControl|null, dir: AbstractControlDirective): boolean {\n let isControlUpdated = false;\n if (control !== null) {\n if (dir.validator !== null) {\n const validators = getControlValidators(control);\n if (Array.isArray(validators) && validators.length > 0) {\n // Filter out directive validator function.\n const updatedValidators = validators.filter((validator) => validator !== dir.validator);\n if (updatedValidators.length !== validators.length) {\n isControlUpdated = true;\n control.setValidators(updatedValidators);\n }\n }\n }\n\n if (dir.asyncValidator !== null) {\n const asyncValidators = getControlAsyncValidators(control);\n if (Array.isArray(asyncValidators) && asyncValidators.length > 0) {\n // Filter out directive async validator function.\n const updatedAsyncValidators =\n asyncValidators.filter((asyncValidator) => asyncValidator !== dir.asyncValidator);\n if (updatedAsyncValidators.length !== asyncValidators.length) {\n isControlUpdated = true;\n control.setAsyncValidators(updatedAsyncValidators);\n }\n }\n }\n }\n\n // Clear onValidatorChange callbacks by providing a noop function.\n const noop = () => {};\n registerOnValidatorChange<ValidatorFn>(dir._rawValidators, noop);\n registerOnValidatorChange<AsyncValidatorFn>(dir._rawAsyncValidators, noop);\n\n return isControlUpdated;\n}\n\nfunction setUpViewChangePipeline(control: FormControl, dir: NgControl): void {\n dir.valueAccessor!.registerOnChange((newValue: any) => {\n control._pendingValue = newValue;\n control._pendingChange = true;\n control._pendingDirty = true;\n\n if (control.updateOn === 'change') updateControl(control, dir);\n });\n}\n\nfunction setUpBlurPipeline(control: FormControl, dir: NgControl): void {\n dir.valueAccessor!.registerOnTouched(() => {\n control._pendingTouched = true;\n\n if (control.updateOn === 'blur' && control._pendingChange) updateControl(control, dir);\n if (control.updateOn !== 'submit') control.markAsTouched();\n });\n}\n\nfunction updateControl(control: FormControl, dir: NgControl): void {\n if (control._pendingDirty) control.markAsDirty();\n control.setValue(control._pendingValue, {emitModelToViewChange: false});\n dir.viewToModelUpdate(control._pendingValue);\n control._pendingChange = false;\n}\n\nfunction setUpModelChangePipeline(control: FormControl, dir: NgControl): void {\n const onChange = (newValue?: any, emitModelEvent?: boolean) => {\n // control -> view\n dir.valueAccessor!.writeValue(newValue);\n\n // control -> ngModel\n if (emitModelEvent) dir.viewToModelUpdate(newValue);\n };\n control.registerOnChange(onChange);\n\n // Register a callback function to cleanup onChange handler\n // from a control instance when a directive is destroyed.\n dir._registerOnDestroy(() => {\n control._unregisterOnChange(onChange);\n });\n}\n\n/**\n * Links a FormGroup or FormArray instance and corresponding Form directive by setting up validators\n * present in the view.\n *\n * @param control FormGroup or FormArray instance that should be linked.\n * @param dir Directive that provides view validators.\n */\nexport function setUpFormContainer(\n control: FormGroup|FormArray, dir: AbstractFormGroupDirective|FormArrayName) {\n if (control == null && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'Cannot find control with');\n setUpValidators(control, dir);\n}\n\n/**\n * Reverts the setup performed by the `setUpFormContainer` function.\n *\n * @param control FormGroup or FormArray instance that should be cleaned up.\n * @param dir Directive that provided view validators.\n * @returns true if a control was updated as a result of this action.\n */\nexport function cleanUpFormContainer(\n control: FormGroup|FormArray, dir: AbstractFormGroupDirective|FormArrayName): boolean {\n return cleanUpValidators(control, dir);\n}\n\nfunction _noControlError(dir: NgControl) {\n return _throwError(dir, 'There is no FormControl instance attached to form control element with');\n}\n\nfunction _throwError(dir: AbstractControlDirective, message: string): void {\n const messageEnd = _describeControlLocation(dir);\n throw new Error(`${message} ${messageEnd}`);\n}\n\nfunction _describeControlLocation(dir: AbstractControlDirective): string {\n const path = dir.path;\n if (path && path.length > 1) return `path: '${path.join(' -> ')}'`;\n if (path?.[0]) return `name: '${path}'`;\n return 'unspecified name attribute';\n}\n\nfunction _throwMissingValueAccessorError(dir: AbstractControlDirective) {\n const loc = _describeControlLocation(dir);\n throw new RuntimeError(\n RuntimeErrorCode.NG_MISSING_VALUE_ACCESSOR, `No value accessor for form control ${loc}.`);\n}\n\nfunction _throwInvalidValueAccessorError(dir: AbstractControlDirective) {\n const loc = _describeControlLocation(dir);\n throw new RuntimeError(\n RuntimeErrorCode.NG_VALUE_ACCESSOR_NOT_PROVIDED,\n `Value accessor was not provided as an array for form control with ${loc}. ` +\n `Check that the \\`NG_VALUE_ACCESSOR\\` token is configured as a \\`multi: true\\` provider.`);\n}\n\nexport function isPropertyUpdated(changes: {[key: string]: any}, viewModel: any): boolean {\n if (!changes.hasOwnProperty('model')) return false;\n const change = changes['model'];\n\n if (change.isFirstChange()) return true;\n return !Object.is(viewModel, change.currentValue);\n}\n\nexport function isBuiltInAccessor(valueAccessor: ControlValueAccessor): boolean {\n // Check if a given value accessor is an instance of a class that directly extends\n // `BuiltInControlValueAccessor` one.\n return Object.getPrototypeOf(valueAccessor.constructor) === BuiltInControlValueAccessor;\n}\n\nexport function syncPendingControls(form: FormGroup, directives: Set<NgControl>|NgControl[]): void {\n form._syncPendingControls();\n directives.forEach((dir: NgControl) => {\n const control = dir.control as FormControl;\n if (control.updateOn === 'submit' && control._pendingChange) {\n dir.viewToModelUpdate(control._pendingValue);\n control._pendingChange = false;\n }\n });\n}\n\n// TODO: vsavkin remove it once https://github.com/angular/angular/issues/3011 is implemented\nexport function selectValueAccessor(\n dir: NgControl, valueAccessors: ControlValueAccessor[]): ControlValueAccessor|null {\n if (!valueAccessors) return null;\n\n if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwInvalidValueAccessorError(dir);\n\n let defaultAccessor: ControlValueAccessor|undefined = undefined;\n let builtinAccessor: ControlValueAccessor|undefined = undefined;\n let customAccessor: ControlValueAccessor|undefined = undefined;\n\n valueAccessors.forEach((v: ControlValueAccessor) => {\n if (v.constructor === DefaultValueAccessor) {\n defaultAccessor = v;\n } else if (isBuiltInAccessor(v)) {\n if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one built-in value accessor matches form control with');\n builtinAccessor = v;\n } else {\n if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode))\n _throwError(dir, 'More than one custom value accessor matches form control with');\n customAccessor = v;\n }\n });\n\n if (customAccessor) return customAccessor;\n if (builtinAccessor) return builtinAccessor;\n if (defaultAccessor) return defaultAccessor;\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _throwError(dir, 'No valid value accessor for form control with');\n }\n return null;\n}\n\nexport function removeListItem<T>(list: T[], el: T): void {\n const index = list.indexOf(el);\n if (index > -1) list.splice(index, 1);\n}\n\n// TODO(kara): remove after deprecation period\nexport function _ngModelWarning(\n name: string, type: {_ngModelWarningSentOnce: boolean},\n instance: {_ngModelWarningSent: boolean}, warningConfig: string|null) {\n if (warningConfig === 'never') return;\n\n if (((warningConfig === null || warningConfig === 'once') && !type._ngModelWarningSentOnce) ||\n (warningConfig === 'always' && !instance._ngModelWarningSent)) {\n console.warn(ngModelWarning(name));\n type._ngModelWarningSentOnce = true;\n instance._ngModelWarningSent = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AfterViewInit, Directive, EventEmitter, forwardRef, Inject, Input, Optional, Provider, Self} from '@angular/core';\n\nimport {AbstractControl, FormHooks} from '../model/abstract_model';\nimport {FormControl} from '../model/form_control';\nimport {FormGroup} from '../model/form_group';\nimport {composeAsyncValidators, composeValidators, NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators';\n\nimport {ControlContainer} from './control_container';\nimport {Form} from './form_interface';\nimport {NgControl} from './ng_control';\nimport {NgModel} from './ng_model';\nimport {NgModelGroup} from './ng_model_group';\nimport {CALL_SET_DISABLED_STATE, SetDisabledStateOption, setUpControl, setUpFormContainer, syncPendingControls} from './shared';\nimport {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators';\n\nconst formDirectiveProvider: Provider = {\n provide: ControlContainer,\n useExisting: forwardRef(() => NgForm)\n};\n\nconst resolvedPromise = (() => Promise.resolve())();\n\n/**\n * @description\n * Creates a top-level `FormGroup` instance and binds it to a form\n * to track aggregate form value and validation status.\n *\n * As soon as you import the `FormsModule`, this directive becomes active by default on\n * all `<form>` tags. You don't need to add a special selector.\n *\n * You optionally export the directive into a local template variable using `ngForm` as the key\n * (ex: `#myForm=\"ngForm\"`). This is optional, but useful. Many properties from the underlying\n * `FormGroup` instance are duplicated on the directive itself, so a reference to it\n * gives you access to the aggregate value and validity status of the form, as well as\n * user interaction properties like `dirty` and `touched`.\n *\n * To register child controls with the form, use `NgModel` with a `name`\n * attribute. You may use `NgModelGroup` to create sub-groups within the form.\n *\n * If necessary, listen to the directive's `ngSubmit` event to be notified when the user has\n * triggered a form submission. The `ngSubmit` event emits the original form\n * submission event.\n *\n * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`.\n * To import the `FormsModule` but skip its usage in some forms,\n * for example, to use native HTML5 validation, add the `ngNoForm` and the `<form>`\n * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is\n * unnecessary because the `<form>` tags are inert. In that case, you would\n * refrain from using the `formGroup` directive.\n *\n * @usageNotes\n *\n * ### Listening for form submission\n *\n * The following example shows how to capture the form values from the \"ngSubmit\" event.\n *\n * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'}\n *\n * ### Setting the update options\n *\n * The following example shows you how to change the \"updateOn\" option from its default using\n * ngFormOptions.\n *\n * ```html\n * <form [ngFormOptions]=\"{updateOn: 'blur'}\">\n * <input name=\"one\" ngModel> <!-- this ngModel will update on blur -->\n * </form>\n * ```\n *\n * ### Native DOM validation UI\n *\n * In order to prevent the native DOM form validation UI from interfering with Angular's form\n * validation, Angular automatically adds the `novalidate` attribute on any `<form>` whenever\n * `FormModule` or `ReactiveFormModule` are imported into the application.\n * If you want to explicitly enable native DOM validation UI with Angular forms, you can add the\n * `ngNativeValidate` attribute to the `<form>` element:\n *\n * ```html\n * <form ngNativeValidate>\n * ...\n * </form>\n * ```\n *\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector: 'form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]',\n providers: [formDirectiveProvider],\n host: {'(submit)': 'onSubmit($event)', '(reset)': 'onReset()'},\n outputs: ['ngSubmit'],\n exportAs: 'ngForm'\n})\nexport class NgForm extends ControlContainer implements Form, AfterViewInit {\n /**\n * @description\n * Returns whether the form submission has been triggered.\n */\n public readonly submitted: boolean = false;\n\n private _directives = new Set<NgModel>();\n\n /**\n * @description\n * The `FormGroup` instance created for this form.\n */\n form: FormGroup;\n\n /**\n * @description\n * Event emitter for the \"ngSubmit\" event\n */\n ngSubmit = new EventEmitter();\n\n /**\n * @description\n * Tracks options for the `NgForm` instance.\n *\n * **updateOn**: Sets the default `updateOn` value for all child `NgModels` below it\n * unless explicitly set by a child `NgModel` using `ngModelOptions`). Defaults to 'change'.\n * Possible values: `'change'` | `'blur'` | `'submit'`.\n *\n */\n // TODO(issue/24571): remove '!'.\n @Input('ngFormOptions') options!: {updateOn?: FormHooks};\n\n constructor(\n @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[],\n @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators:\n (AsyncValidator|AsyncValidatorFn)[],\n @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?:\n SetDisabledStateOption) {\n super();\n this.form =\n new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));\n }\n\n /** @nodoc */\n ngAfterViewInit() {\n this._setUpdateStrategy();\n }\n\n /**\n * @description\n * The directive instance.\n */\n override get formDirective(): Form {\n return this;\n }\n\n /**\n * @description\n * The internal `FormGroup` instance.\n */\n override get control(): FormGroup {\n return this.form;\n }\n\n /**\n * @description\n * Returns an array representing the path to this group. Because this directive\n * always lives at the top level of a form, it is always an empty array.\n */\n override get path(): string[] {\n return [];\n }\n\n /**\n * @description\n * Returns a map of the controls in this group.\n */\n get controls(): {[key: string]: AbstractControl} {\n return this.form.controls;\n }\n\n /**\n * @description\n * Method that sets up the control directive in this group, re-calculates its value\n * and validity, and adds the instance to the internal list of directives.\n *\n * @param dir The `NgModel` directive instance.\n */\n addControl(dir: NgModel): void {\n resolvedPromise.then(() => {\n const container = this._findContainer(dir.path);\n (dir as {control: FormControl}).control =\n <FormControl>container.registerControl(dir.name, dir.control);\n setUpControl(dir.control, dir, this.callSetDisabledState);\n dir.control.updateValueAndValidity({emitEvent: false});\n this._directives.add(dir);\n });\n }\n\n /**\n * @description\n * Retrieves the `FormControl` instance from the provided `NgModel` directive.\n *\n * @param dir The `NgModel` directive instance.\n */\n getControl(dir: NgModel): FormControl {\n return <FormControl>this.form.get(dir.path);\n }\n\n /**\n * @description\n * Removes the `NgModel` instance from the internal list of directives\n *\n * @param dir The `NgModel` directive instance.\n */\n removeControl(dir: NgModel): void {\n resolvedPromise.then(() => {\n const container = this._findContainer(dir.path);\n if (container) {\n container.removeControl(dir.name);\n }\n this._directives.delete(dir);\n });\n }\n\n /**\n * @description\n * Adds a new `NgModelGroup` directive instance to the form.\n *\n * @param dir The `NgModelGroup` directive instance.\n */\n addFormGroup(dir: NgModelGroup): void {\n resolvedPromise.then(() => {\n const container = this._findContainer(dir.path);\n const group = new FormGroup({});\n setUpFormContainer(group, dir);\n container.registerControl(dir.name, group);\n group.updateValueAndValidity({emitEvent: false});\n });\n }\n\n /**\n * @description\n * Removes the `NgModelGroup` directive instance from the form.\n *\n * @param dir The `NgModelGroup` directive instance.\n */\n removeFormGroup(dir: NgModelGroup): void {\n resolvedPromise.then(() => {\n const container = this._findContainer(dir.path);\n if (container) {\n container.removeControl(dir.name);\n }\n });\n }\n\n /**\n * @description\n * Retrieves the `FormGroup` for a provided `NgModelGroup` directive instance\n *\n * @param dir The `NgModelGroup` directive instance.\n */\n getFormGroup(dir: NgModelGroup): FormGroup {\n return <FormGroup>this.form.get(dir.path);\n }\n\n /**\n * Sets the new value for the provided `NgControl` directive.\n *\n * @param dir The `NgControl` directive instance.\n * @param value The new value for the directive's control.\n */\n updateModel(dir: NgControl, value: any): void {\n resolvedPromise.then(() => {\n const ctrl = <FormControl>this.form.get(dir.path!);\n ctrl.setValue(value);\n });\n }\n\n /**\n * @description\n * Sets the value for this `FormGroup`.\n *\n * @param value The new value\n */\n setValue(value: {[key: string]: any}): void {\n this.control.setValue(value);\n }\n\n /**\n * @description\n * Method called when the \"submit\" event is triggered on the form.\n * Triggers the `ngSubmit` emitter to emit the \"submit\" event as its payload.\n *\n * @param $event The \"submit\" event object\n */\n onSubmit($event: Event): boolean {\n (this as {submitted: boolean}).submitted = true;\n syncPendingControls(this.form, this._directives);\n this.ngSubmit.emit($event);\n // Forms with `method=\"dialog\"` have some special behavior\n // that won't reload the page and that shouldn't be prevented.\n return ($event?.target as HTMLFormElement | null)?.method === 'dialog';\n }\n\n /**\n * @description\n * Method called when the \"reset\" event is triggered on the form.\n */\n onReset(): void {\n this.resetForm();\n }\n\n /**\n * @description\n * Resets the form to an initial value and resets its submitted status.\n *\n * @param value The new value for the form.\n */\n resetForm(value: any = undefined): void {\n this.form.reset(value);\n (this as {submitted: boolean}).submitted = false;\n }\n\n private _setUpdateStrategy() {\n if (this.options && this.options.updateOn != null) {\n this.form._updateOn = this.options.updateOn;\n }\n }\n\n private _findContainer(path: string[]): FormGroup {\n path.pop();\n return path.length ? <FormGroup>this.form.get(path) : this.form;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function removeListItem<T>(list: T[], el: T): void {\n const index = list.indexOf(el);\n if (index > -1) list.splice(index, 1);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AsyncValidatorFn, ValidatorFn} from '../directives/validators';\nimport {removeListItem} from '../util';\n\nimport {AbstractControl, AbstractControlOptions, isOptionsObj, pickAsyncValidators, pickValidators} from './abstract_model';\n\n/**\n * FormControlState is a boxed form value. It is an object with a `value` key and a `disabled` key.\n *\n * @publicApi\n */\nexport interface FormControlState<T> {\n value: T;\n disabled: boolean;\n}\n\n/**\n * Interface for options provided to a `FormControl`.\n *\n * This interface extends all options from {@link AbstractControlOptions}, plus some options\n * unique to `FormControl`.\n *\n * @publicApi\n */\nexport interface FormControlOptions extends AbstractControlOptions {\n /**\n * @description\n * Whether to use the initial value used to construct the `FormControl` as its default value\n * as well. If this option is false or not provided, the default value of a FormControl is `null`.\n * When a FormControl is reset without an explicit value, its value reverts to\n * its default value.\n */\n nonNullable?: boolean;\n\n /**\n * @deprecated Use `nonNullable` instead.\n */\n initialValueIsDefault?: boolean;\n}\n\n/**\n * Tracks the value and validation status of an individual form control.\n *\n * This is one of the four fundamental building blocks of Angular forms, along with\n * `FormGroup`, `FormArray` and `FormRecord`. It extends the `AbstractControl` class that\n * implements most of the base functionality for accessing the value, validation status,\n * user interactions and events.\n *\n * `FormControl` takes a single generic argument, which describes the type of its value. This\n * argument always implicitly includes `null` because the control can be reset. To change this\n * behavior, set `nonNullable` or see the usage notes below.\n *\n * See [usage examples below](#usage-notes).\n *\n * @see `AbstractControl`\n * @see [Reactive Forms Guide](guide/reactive-forms)\n * @see [Usage Notes](#usage-notes)\n *\n * @publicApi\n *\n * @overriddenImplementation ɵFormControlCtor\n *\n * @usageNotes\n *\n * ### Initializing Form Controls\n *\n * Instantiate a `FormControl`, with an initial value.\n *\n * ```ts\n * const control = new FormControl('some value');\n * console.log(control.value); // 'some value'\n * ```\n *\n * The following example initializes the control with a form state object. The `value`\n * and `disabled` keys are required in this case.\n *\n * ```ts\n * const control = new FormControl({ value: 'n/a', disabled: true });\n * console.log(control.value); // 'n/a'\n * console.log(control.status); // 'DISABLED'\n * ```\n *\n * The following example initializes the control with a synchronous validator.\n *\n * ```ts\n * const control = new FormControl('', Validators.required);\n * console.log(control.value); // ''\n * console.log(control.status); // 'INVALID'\n * ```\n *\n * The following example initializes the control using an options object.\n *\n * ```ts\n * const control = new FormControl('', {\n * validators: Validators.required,\n * asyncValidators: myAsyncValidator\n * });\n * ```\n *\n * ### The single type argument\n *\n * `FormControl` accepts a generic argument, which describes the type of its value.\n * In most cases, this argument will be inferred.\n *\n * If you are initializing the control to `null`, or you otherwise wish to provide a\n * wider type, you may specify the argument explicitly:\n *\n * ```\n * let fc = new FormControl<string|null>(null);\n * fc.setValue('foo');\n * ```\n *\n * You might notice that `null` is always added to the type of the control.\n * This is because the control will become `null` if you call `reset`. You can change\n * this behavior by setting `{nonNullable: true}`.\n *\n * ### Configure the control to update on a blur event\n *\n * Set the `updateOn` option to `'blur'` to update on the blur `event`.\n *\n * ```ts\n * const control = new FormControl('', { updateOn: 'blur' });\n * ```\n *\n * ### Configure the control to update on a submit event\n *\n * Set the `updateOn` option to `'submit'` to update on a submit `event`.\n *\n * ```ts\n * const control = new FormControl('', { updateOn: 'submit' });\n * ```\n *\n * ### Reset the control back to a specific value\n *\n * You reset to a specific form state by passing through a standalone\n * value or a form state object that contains both a value and a disabled state\n * (these are the only two properties that cannot be calculated).\n *\n * ```ts\n * const control = new FormControl('Nancy');\n *\n * console.log(control.value); // 'Nancy'\n *\n * control.reset('Drew');\n *\n * console.log(control.value); // 'Drew'\n * ```\n *\n * ### Reset the control to its initial value\n *\n * If you wish to always reset the control to its initial value (instead of null),\n * you can pass the `nonNullable` option:\n *\n * ```\n * const control = new FormControl('Nancy', {nonNullable: true});\n *\n * console.log(control.value); // 'Nancy'\n *\n * control.reset();\n *\n * console.log(control.value); // 'Nancy'\n * ```\n *\n * ### Reset the control back to an initial value and disabled\n *\n * ```\n * const control = new FormControl('Nancy');\n *\n * console.log(control.value); // 'Nancy'\n * console.log(control.status); // 'VALID'\n *\n * control.reset({ value: 'Drew', disabled: true });\n *\n * console.log(control.value); // 'Drew'\n * console.log(control.status); // 'DISABLED'\n * ```\n */\nexport interface FormControl<TValue = any> extends AbstractControl<TValue> {\n /**\n * The default value of this FormControl, used whenever the control is reset without an explicit\n * value. See {@link FormControlOptions#nonNullable} for more information on configuring\n * a default value.\n */\n readonly defaultValue: TValue;\n\n /** @internal */\n _onChange: Function[];\n\n /**\n * This field holds a pending value that has not yet been applied to the form's value.\n * @internal\n */\n _pendingValue: TValue;\n\n /** @internal */\n _pendingChange: boolean;\n\n /**\n * Sets a new value for the form control.\n *\n * @param value The new value for the control.\n * @param options Configuration options that determine how the control propagates changes\n * and emits events when the value changes.\n * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity\n * updateValueAndValidity} method.\n *\n * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is\n * false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control value is updated.\n * When false, no events are emitted.\n * * `emitModelToViewChange`: When true or not supplied (the default), each change triggers an\n * `onChange` event to\n * update the view.\n * * `emitViewToModelChange`: When true or not supplied (the default), each change triggers an\n * `ngModelChange`\n * event to update the model.\n *\n */\n setValue(value: TValue, options?: {\n onlySelf?: boolean,\n emitEvent?: boolean,\n emitModelToViewChange?: boolean,\n emitViewToModelChange?: boolean\n }): void;\n\n /**\n * Patches the value of a control.\n *\n * This function is functionally the same as {@link FormControl#setValue setValue} at this level.\n * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and\n * `FormArrays`, where it does behave differently.\n *\n * @see `setValue` for options\n */\n patchValue(value: TValue, options?: {\n onlySelf?: boolean,\n emitEvent?: boolean,\n emitModelToViewChange?: boolean,\n emitViewToModelChange?: boolean\n }): void;\n\n /**\n * Resets the form control, marking it `pristine` and `untouched`, and resetting\n * the value. The new value will be the provided value (if passed), `null`, or the initial value\n * if `nonNullable` was set in the constructor via {@link FormControlOptions}.\n *\n * ```ts\n * // By default, the control will reset to null.\n * const dog = new FormControl('spot');\n * dog.reset(); // dog.value is null\n *\n * // If this flag is set, the control will instead reset to the initial value.\n * const cat = new FormControl('tabby', {nonNullable: true});\n * cat.reset(); // cat.value is \"tabby\"\n *\n * // A value passed to reset always takes precedence.\n * const fish = new FormControl('finn', {nonNullable: true});\n * fish.reset('bubble'); // fish.value is \"bubble\"\n * ```\n *\n * @param formState Resets the control with an initial value,\n * or an object that defines the initial value and disabled state.\n *\n * @param options Configuration options that determine how the control propagates changes\n * and emits events after the value changes.\n *\n * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is\n * false.\n * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and\n * `valueChanges`\n * observables emit events with the latest status and value when the control is reset.\n * When false, no events are emitted.\n *\n */\n reset(formState?: TValue|FormControlState<TValue>, options?: {\n onlySelf?: boolean,\n emitEvent?: boolean\n }): void;\n\n /**\n * For a simple FormControl, the raw value is equivalent to the value.\n */\n getRawValue(): TValue;\n\n /**\n * @internal\n */\n _updateValue(): void;\n\n /**\n * @internal\n */\n _anyControls(condition: (c: AbstractControl) => boolean): boolean;\n\n /**\n * @internal\n */\n _allControlsDisabled(): boolean;\n\n\n /**\n * Register a listener for change events.\n *\n * @param fn The method that is called when the value changes\n */\n registerOnChange(fn: Function): void;\n\n\n /**\n * Internal function to unregister a change events listener.\n * @internal\n */\n _unregisterOnChange(fn: (value?: any, emitModelEvent?: boolean) => void): void;\n\n /**\n * Register a listener for disabled events.\n *\n * @param fn The method that is called when the disabled status changes.\n */\n registerOnDisabledChange(fn: (isDisabled: boolean) => void): void;\n\n /**\n * Internal function to unregister a disabled event listener.\n * @internal\n */\n _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void;\n\n /**\n * @internal\n */\n _forEachChild(cb: (c: AbstractControl) => void): void;\n\n /** @internal */\n _syncPendingControls(): boolean;\n}\n\n// This internal interface is present to avoid a naming clash, resulting in the wrong `FormControl`\n// symbol being used.\ntype FormControlInterface<TValue = any> = FormControl<TValue>;\n\n/**\n * Various available constructors for `FormControl`.\n * Do not use this interface directly. Instead, use `FormControl`:\n * ```\n * const fc = new FormControl('foo');\n * ```\n * This symbol is prefixed with ɵ to make plain that it is an internal symbol.\n */\nexport interface ɵFormControlCtor {\n /**\n * Construct a FormControl with no initial value or validators.\n */\n new(): FormControl<any>;\n\n /**\n * Creates a new `FormControl` instance.\n *\n * @param formState Initializes the control with an initial value,\n * or an object that defines the initial value and disabled state.\n *\n * @param validatorOrOpts A synchronous validator function, or an array of\n * such functions, or a `FormControlOptions` object that contains validation functions\n * and a validation trigger.\n *\n * @param asyncValidator A single async validator or array of async validator functions\n */\n new<T = any>(value: FormControlState<T>|T, opts: FormControlOptions&{nonNullable: true}):\n FormControl<T>;\n\n /**\n * @deprecated Use `nonNullable` instead.\n */\n new<T = any>(value: FormControlState<T>|T, opts: FormControlOptions&{\n initialValueIsDefault: true\n }): FormControl<T>;\n\n /**\n * @deprecated When passing an `options` argument, the `asyncValidator` argument has no effect.\n */\n new<T = any>(\n value: FormControlState<T>|T, opts: FormControlOptions,\n asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]): FormControl<T|null>;\n\n new<T = any>(\n value: FormControlState<T>|T,\n validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null,\n asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T|null>;\n\n /**\n * The presence of an explicit `prototype` property provides backwards-compatibility for apps that\n * manually inspect the prototype chain.\n */\n prototype: FormControl<any>;\n}\n\nfunction isFormControlState(formState: unknown): formState is FormControlState<unknown> {\n return typeof formState === 'object' && formState !== null &&\n Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState;\n}\n\nexport const FormControl: ɵFormControlCtor =\n (class FormControl<TValue = any> extends AbstractControl<\n TValue> implements FormControlInterface<TValue> {\n /** @publicApi */\n public readonly defaultValue: TValue = null as unknown as TValue;\n\n /** @internal */\n _onChange: Array<Function> = [];\n\n /** @internal */\n _pendingValue!: TValue;\n\n /** @internal */\n _pendingChange: boolean = false;\n\n constructor(\n // formState and defaultValue will only be null if T is nullable\n formState: FormControlState<TValue>|TValue = null as unknown as TValue,\n validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null,\n asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) {\n super(\n pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));\n this._applyFormState(formState);\n this._setUpdateStrategy(validatorOrOpts);\n this._initObservables();\n this.updateValueAndValidity({\n onlySelf: true,\n // If `asyncValidator` is present, it will trigger control status change from `PENDING` to\n // `VALID` or `INVALID`.\n // The status should be broadcasted via the `statusChanges` observable, so we set\n // `emitEvent` to `true` to allow that during the control creation process.\n emitEvent: !!this.asyncValidator\n });\n if (isOptionsObj(validatorOrOpts) &&\n (validatorOrOpts.nonNullable || validatorOrOpts.initialValueIsDefault)) {\n if (isFormControlState(formState)) {\n this.defaultValue = formState.value;\n } else {\n this.defaultValue = formState;\n }\n }\n }\n\n override setValue(value: TValue, options: {\n onlySelf?: boolean,\n emitEvent?: boolean,\n emitModelToViewChange?: boolean,\n emitViewToModelChange?: boolean\n } = {}): void {\n (this as {value: TValue}).value = this._pendingValue = value;\n if (this._onChange.length && options.emitModelToViewChange !== false) {\n this._onChange.forEach(\n (changeFn) => changeFn(this.value, options.emitViewToModelChange !== false));\n }\n this.updateValueAndValidity(options);\n }\n\n override patchValue(value: TValue, options: {\n onlySelf?: boolean,\n emitEvent?: boolean,\n emitModelToViewChange?: boolean,\n emitViewToModelChange?: boolean\n } = {}): void {\n this.setValue(value, options);\n }\n\n override reset(\n formState: TValue|FormControlState<TValue> = this.defaultValue,\n options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {\n this._applyFormState(formState);\n this.markAsPristine(options);\n this.markAsUntouched(options);\n this.setValue(this.value, options);\n this._pendingChange = false;\n }\n\n /** @internal */\n override _updateValue(): void {}\n\n /** @internal */\n override _anyControls(condition: (c: AbstractControl) => boolean): boolean {\n return false;\n }\n\n /** @internal */\n override _allControlsDisabled(): boolean {\n return this.disabled;\n }\n\n registerOnChange(fn: Function): void {\n this._onChange.push(fn);\n }\n\n /** @internal */\n _unregisterOnChange(fn: (value?: any, emitModelEvent?: boolean) => void): void {\n removeListItem(this._onChange, fn);\n }\n\n registerOnDisabledChange(fn: (isDisabled: boolean) => void): void {\n this._onDisabledChange.push(fn);\n }\n\n /** @internal */\n _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void {\n removeListItem(this._onDisabledChange, fn);\n }\n\n /** @internal */\n override _forEachChild(cb: (c: AbstractControl) => void): void {}\n\n /** @internal */\n override _syncPendingControls(): boolean {\n if (this.updateOn === 'submit') {\n if (this._pendingDirty) this.markAsDirty();\n if (this._pendingTouched) this.markAsTouched();\n if (this._pendingChange) {\n this.setValue(this._pendingValue, {onlySelf: true, emitModelToViewChange: false});\n return true;\n }\n }\n return false;\n }\n\n private _applyFormState(formState: FormControlState<TValue>|TValue) {\n if (isFormControlState(formState)) {\n (this as {value: TValue}).value = this._pendingValue = formState.value;\n formState.disabled ? this.disable({onlySelf: true, emitEvent: false}) :\n this.enable({onlySelf: true, emitEvent: false});\n } else {\n (this as {value: TValue}).value = this._pendingValue = formState;\n }\n }\n });\n\ninterface UntypedFormControlCtor {\n new(): UntypedFormControl;\n\n new(formState?: any, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null,\n asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormControl;\n\n /**\n * The presence of an explicit `prototype` property provides backwards-compatibility for apps that\n * manually inspect the prototype chain.\n */\n prototype: FormControl<any>;\n}\n\n/**\n * UntypedFormControl is a non-strongly-typed version of `FormControl`.\n */\nexport type UntypedFormControl = FormControl<any>;\n\nexport const UntypedFormControl: UntypedFormControlCtor = FormControl;\n\n/**\n * @description\n * Asserts that the given control is an instance of `FormControl`\n *\n * @publicApi\n */\nexport const isFormControl = (control: unknown): control is FormControl =>\n control instanceof FormControl;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef, Directive, EventEmitter, forwardRef, Host, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core';\n\nimport {FormHooks} from '../model/abstract_model';\nimport {FormControl} from '../model/form_control';\nimport {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators';\n\nimport {AbstractFormGroupDirective} from './abstract_form_group_directive';\nimport {ControlContainer} from './control_container';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';\nimport {NgControl} from './ng_control';\nimport {NgForm} from './ng_form';\nimport {NgModelGroup} from './ng_model_group';\nimport {CALL_SET_DISABLED_STATE, controlPath, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from './shared';\nimport {formGroupNameException, missingNameException, modelParentException} from './template_driven_errors';\nimport {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators';\n\nconst formControlBinding: Provider = {\n provide: NgControl,\n useExisting: forwardRef(() => NgModel)\n};\n\n/**\n * `ngModel` forces an additional change detection run when its inputs change:\n * E.g.:\n * ```\n * <div>{{myModel.valid}}</div>\n * <input [(ngModel)]=\"myValue\" #myModel=\"ngModel\">\n * ```\n * I.e. `ngModel` can export itself on the element and then be used in the template.\n * Normally, this would result in expressions before the `input` that use the exported directive\n * to have an old value as they have been\n * dirty checked before. As this is a very common case for `ngModel`, we added this second change\n * detection run.\n *\n * Notes:\n * - this is just one extra run no matter how many `ngModel`s have been changed.\n * - this is a general problem when using `exportAs` for directives!\n */\nconst resolvedPromise = (() => Promise.resolve())();\n\n/**\n * @description\n * Creates a `FormControl` instance from a domain model and binds it\n * to a form control element.\n *\n * The `FormControl` instance tracks the value, user interaction, and\n * validation status of the control and keeps the view synced with the model. If used\n * within a parent form, the directive also registers itself with the form as a child\n * control.\n *\n * This directive is used by itself or as part of a larger form. Use the\n * `ngModel` selector to activate it.\n *\n * It accepts a domain model as an optional `Input`. If you have a one-way binding\n * to `ngModel` with `[]` syntax, changing the domain model's value in the component\n * class sets the value in the view. If you have a two-way binding with `[()]` syntax\n * (also known as 'banana-in-a-box syntax'), the value in the UI always syncs back to\n * the domain model in your class.\n *\n * To inspect the properties of the associated `FormControl` (like the validity state),\n * export the directive into a local template variable using `ngModel` as the key (ex:\n * `#myVar=\"ngModel\"`). You can then access the control using the directive's `control` property.\n * However, the most commonly used properties (like `valid` and `dirty`) also exist on the control\n * for direct access. See a full list of properties directly available in\n * `AbstractControlDirective`.\n *\n * @see `RadioControlValueAccessor`\n * @see `SelectControlValueAccessor`\n *\n * @usageNotes\n *\n * ### Using ngModel on a standalone control\n *\n * The following examples show a simple standalone control using `ngModel`:\n *\n * {@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'}\n *\n * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute\n * so that the control can be registered with the parent form under that name.\n *\n * In the context of a parent form, it's often unnecessary to include one-way or two-way binding,\n * as the parent form syncs the value for you. You access its properties by exporting it into a\n * local template variable using `ngForm` such as (`#f=\"ngForm\"`). Use the variable where\n * needed on form submission.\n *\n * If you do need to populate initial values into your form, using a one-way binding for\n * `ngModel` tends to be sufficient as long as you use the exported form's value rather\n * than the domain model's value on submit.\n *\n * ### Using ngModel within a form\n *\n * The following example shows controls using `ngModel` within a form:\n *\n * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'}\n *\n * ### Using a standalone ngModel within a group\n *\n * The following example shows you how to use a standalone ngModel control\n * within a form. This controls the display of the form, but doesn't contain form data.\n *\n * ```html\n * <form>\n * <input name=\"login\" ngModel placeholder=\"Login\">\n * <input type=\"checkbox\" ngModel [ngModelOptions]=\"{standalone: true}\"> Show more options?\n * </form>\n * <!-- form value: {login: ''} -->\n * ```\n *\n * ### Setting the ngModel `name` attribute through options\n *\n * The following example shows you an alternate way to set the name attribute. Here,\n * an attribute identified as name is used within a custom form control component. To still be able\n * to specify the NgModel's name, you must specify it using the `ngModelOptions` input instead.\n *\n * ```html\n * <form>\n * <my-custom-form-control name=\"Nancy\" ngModel [ngModelOptions]=\"{name: 'user'}\">\n * </my-custom-form-control>\n * </form>\n * <!-- form value: {user: ''} -->\n * ```\n *\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector: '[ngModel]:not([formControlName]):not([formControl])',\n providers: [formControlBinding],\n exportAs: 'ngModel'\n})\nexport class NgModel extends NgControl implements OnChanges, OnDestroy {\n public override readonly control: FormControl = new FormControl();\n\n // At runtime we coerce arbitrary values assigned to the \"disabled\" input to a \"boolean\".\n // This is not reflected in the type of the property because outside of templates, consumers\n // should only deal with booleans. In templates, a string is allowed for convenience and to\n // match the native \"disabled attribute\" semantics which can be observed on input elements.\n // This static member tells the compiler that values of type \"string\" can also be assigned\n // to the input in a template.\n /** @nodoc */\n static ngAcceptInputType_isDisabled: boolean|string;\n\n /** @internal */\n _registered = false;\n\n /**\n * Internal reference to the view model value.\n * @nodoc\n */\n viewModel: any;\n\n /**\n * @description\n * Tracks the name bound to the directive. If a parent form exists, it\n * uses this name as a key to retrieve this control's value.\n */\n // TODO(issue/24571): remove '!'.\n @Input() override name!: string;\n\n /**\n * @description\n * Tracks whether the control is disabled.\n */\n // TODO(issue/24571): remove '!'.\n @Input('disabled') isDisabled!: boolean;\n\n /**\n * @description\n * Tracks the value bound to this directive.\n */\n @Input('ngModel') model: any;\n\n /**\n * @description\n * Tracks the configuration options for this `ngModel` instance.\n *\n * **name**: An alternative to setting the name attribute on the form control element. See\n * the [example](api/forms/NgModel#using-ngmodel-on-a-standalone-control) for using `NgModel`\n * as a standalone control.\n *\n * **standalone**: When set to true, the `ngModel` will not register itself with its parent form,\n * and acts as if it's not in the form. Defaults to false. If no parent form exists, this option\n * has no effect.\n *\n * **updateOn**: Defines the event upon which the form control value and validity update.\n * Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`.\n *\n */\n // TODO(issue/24571): remove '!'.\n @Input('ngModelOptions') options!: {name?: string, standalone?: boolean, updateOn?: FormHooks};\n\n /**\n * @description\n * Event emitter for producing the `ngModelChange` event after\n * the view model updates.\n */\n @Output('ngModelChange') update = new EventEmitter();\n\n constructor(\n @Optional() @Host() parent: ControlContainer,\n @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[],\n @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators:\n (AsyncValidator|AsyncValidatorFn)[],\n @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[],\n @Optional() @Inject(ChangeDetectorRef) private _changeDetectorRef?: ChangeDetectorRef|null,\n @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?:\n SetDisabledStateOption) {\n super();\n this._parent = parent;\n this._setValidators(validators);\n this._setAsyncValidators(asyncValidators);\n this.valueAccessor = selectValueAccessor(this, valueAccessors);\n }\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges) {\n this._checkForErrors();\n if (!this._registered || 'name' in changes) {\n if (this._registered) {\n this._checkName();\n if (this.formDirective) {\n // We can't call `formDirective.removeControl(this)`, because the `name` has already been\n // changed. We also can't reset the name temporarily since the logic in `removeControl`\n // is inside a promise and it won't run immediately. We work around it by giving it an\n // object with the same shape instead.\n const oldName = changes['name'].previousValue;\n this.formDirective.removeControl({name: oldName, path: this._getPath(oldName)});\n }\n }\n this._setUpControl();\n }\n if ('isDisabled' in changes) {\n this._updateDisabled(changes);\n }\n\n if (isPropertyUpdated(changes, this.viewModel)) {\n this._updateValue(this.model);\n this.viewModel = this.model;\n }\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n this.formDirective && this.formDirective.removeControl(this);\n }\n\n /**\n * @description\n * Returns an array that represents the path from the top-level form to this control.\n * Each index is the string name of the control on that level.\n */\n override get path(): string[] {\n return this._getPath(this.name);\n }\n\n /**\n * @description\n * The top-level directive for this control if present, otherwise null.\n */\n get formDirective(): any {\n return this._parent ? this._parent.formDirective : null;\n }\n\n /**\n * @description\n * Sets the new value for the view model and emits an `ngModelChange` event.\n *\n * @param newValue The new value emitted by `ngModelChange`.\n */\n override viewToModelUpdate(newValue: any): void {\n this.viewModel = newValue;\n this.update.emit(newValue);\n }\n\n private _setUpControl(): void {\n this._setUpdateStrategy();\n this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this);\n this._registered = true;\n }\n\n private _setUpdateStrategy(): void {\n if (this.options && this.options.updateOn != null) {\n this.control._updateOn = this.options.updateOn;\n }\n }\n\n private _isStandalone(): boolean {\n return !this._parent || !!(this.options && this.options.standalone);\n }\n\n private _setUpStandalone(): void {\n setUpControl(this.control, this, this.callSetDisabledState);\n this.control.updateValueAndValidity({emitEvent: false});\n }\n\n private _checkForErrors(): void {\n if (!this._isStandalone()) {\n this._checkParentType();\n }\n this._checkName();\n }\n\n private _checkParentType(): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!(this._parent instanceof NgModelGroup) &&\n this._parent instanceof AbstractFormGroupDirective) {\n throw formGroupNameException();\n } else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {\n throw modelParentException();\n }\n }\n }\n\n private _checkName(): void {\n if (this.options && this.options.name) this.name = this.options.name;\n\n if (!this._isStandalone() && !this.name && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw missingNameException();\n }\n }\n\n private _updateValue(value: any): void {\n resolvedPromise.then(() => {\n this.control.setValue(value, {emitViewToModelChange: false});\n this._changeDetectorRef?.markForCheck();\n });\n }\n\n private _updateDisabled(changes: SimpleChanges) {\n const disabledValue = changes['isDisabled'].currentValue;\n // checking for 0 to avoid breaking change\n const isDisabled = disabledValue !== 0 && coerceToBoolean(disabledValue);\n\n resolvedPromise.then(() => {\n if (isDisabled && !this.control.disabled) {\n this.control.disable();\n } else if (!isDisabled && this.control.disabled) {\n this.control.enable();\n }\n\n this._changeDetectorRef?.markForCheck();\n });\n }\n\n private _getPath(controlName: string): string[] {\n return this._parent ? controlPath(controlName, this._parent) : [controlName];\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive} from '@angular/core';\n\n/**\n * @description\n *\n * Adds `novalidate` attribute to all forms by default.\n *\n * `novalidate` is used to disable browser's native form validation.\n *\n * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:\n *\n * ```\n * <form ngNativeValidate></form>\n * ```\n *\n * @publicApi\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n */\n@Directive({\n selector: 'form:not([ngNoForm]):not([ngNativeValidate])',\n host: {'novalidate': ''},\n})\nexport class ɵNgNoValidate {\n}\n\nexport {ɵNgNoValidate as NgNoValidate};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, forwardRef, Provider} from '@angular/core';\n\nimport {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';\n\nconst NUMBER_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumberValueAccessor),\n multi: true\n};\n\n/**\n * @description\n * The `ControlValueAccessor` for writing a number value and listening to number input changes.\n * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel`\n * directives.\n *\n * @usageNotes\n *\n * ### Using a number input with a reactive form.\n *\n * The following example shows how to use a number input with a reactive form.\n *\n * ```ts\n * const totalCountControl = new FormControl();\n * ```\n *\n * ```\n * <input type=\"number\" [formControl]=\"totalCountControl\">\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',\n host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'},\n providers: [NUMBER_VALUE_ACCESSOR]\n})\nexport class NumberValueAccessor extends BuiltInControlValueAccessor implements\n ControlValueAccessor {\n /**\n * Sets the \"value\" property on the input element.\n * @nodoc\n */\n writeValue(value: number): void {\n // The value needs to be normalized for IE9, otherwise it is set to 'null' when null\n const normalizedValue = value == null ? '' : value;\n this.setProperty('value', normalizedValue);\n }\n\n /**\n * Registers a function called when the control value changes.\n * @nodoc\n */\n override registerOnChange(fn: (_: number|null) => void): void {\n this.onChange = (value) => {\n fn(value == '' ? null : parseFloat(value));\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, forwardRef, inject, Injectable, Injector, Input, NgModule, OnDestroy, OnInit, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nimport {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';\nimport {NgControl} from './ng_control';\nimport {CALL_SET_DISABLED_STATE, setDisabledStateDefault, SetDisabledStateOption} from './shared';\n\nconst RADIO_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioControlValueAccessor),\n multi: true\n};\n\nfunction throwNameError() {\n throw new RuntimeError(RuntimeErrorCode.NAME_AND_FORM_CONTROL_NAME_MUST_MATCH, `\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type=\"radio\" formControlName=\"food\" name=\"food\">\n `);\n}\n\n/**\n * Internal-only NgModule that works as a host for the `RadioControlRegistry` tree-shakable\n * provider. Note: the `InternalFormsSharedModule` can not be used here directly, since it's\n * declared *after* the `RadioControlRegistry` class and the `providedIn` doesn't support\n * `forwardRef` logic.\n */\n@NgModule()\nexport class RadioControlRegistryModule {\n}\n\n/**\n * @description\n * Class used by Angular to track radio buttons. For internal use only.\n */\n@Injectable({providedIn: RadioControlRegistryModule})\nexport class RadioControlRegistry {\n private _accessors: any[] = [];\n\n /**\n * @description\n * Adds a control to the internal registry. For internal use only.\n */\n add(control: NgControl, accessor: RadioControlValueAccessor) {\n this._accessors.push([control, accessor]);\n }\n\n /**\n * @description\n * Removes a control from the internal registry. For internal use only.\n */\n remove(accessor: RadioControlValueAccessor) {\n for (let i = this._accessors.length - 1; i >= 0; --i) {\n if (this._accessors[i][1] === accessor) {\n this._accessors.splice(i, 1);\n return;\n }\n }\n }\n\n /**\n * @description\n * Selects a radio button. For internal use only.\n */\n select(accessor: RadioControlValueAccessor) {\n this._accessors.forEach((c) => {\n if (this._isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].fireUncheck(accessor.value);\n }\n });\n }\n\n private _isSameGroup(\n controlPair: [NgControl, RadioControlValueAccessor],\n accessor: RadioControlValueAccessor): boolean {\n if (!controlPair[0].control) return false;\n return controlPair[0]._parent === accessor._control._parent &&\n controlPair[1].name === accessor.name;\n }\n}\n\n/**\n * @description\n * The `ControlValueAccessor` for writing radio control values and listening to radio control\n * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and\n * `NgModel` directives.\n *\n * @usageNotes\n *\n * ### Using radio buttons with reactive form directives\n *\n * The follow example shows how to use radio buttons in a reactive form. When using radio buttons in\n * a reactive form, radio buttons in the same group should have the same `formControlName`.\n * Providing a `name` attribute is optional.\n *\n * {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'}\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',\n host: {'(change)': 'onChange()', '(blur)': 'onTouched()'},\n providers: [RADIO_VALUE_ACCESSOR]\n})\nexport class RadioControlValueAccessor extends BuiltInControlValueAccessor implements\n ControlValueAccessor, OnDestroy, OnInit {\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _state!: boolean;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _control!: NgControl;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _fn!: Function;\n\n private setDisabledStateFired = false;\n\n /**\n * The registered callback function called when a change event occurs on the input element.\n * Note: we declare `onChange` here (also used as host listener) as a function with no arguments\n * to override the `onChange` function (which expects 1 argument) in the parent\n * `BaseControlValueAccessor` class.\n * @nodoc\n */\n override onChange = () => {};\n\n /**\n * @description\n * Tracks the name of the radio input element.\n */\n // TODO(issue/24571): remove '!'.\n @Input() name!: string;\n\n /**\n * @description\n * Tracks the name of the `FormControl` bound to the directive. The name corresponds\n * to a key in the parent `FormGroup` or `FormArray`.\n */\n // TODO(issue/24571): remove '!'.\n @Input() formControlName!: string;\n\n /**\n * @description\n * Tracks the value of the radio input element\n */\n @Input() value: any;\n\n private callSetDisabledState =\n inject(CALL_SET_DISABLED_STATE, {optional: true}) ?? setDisabledStateDefault;\n\n constructor(\n renderer: Renderer2, elementRef: ElementRef, private _registry: RadioControlRegistry,\n private _injector: Injector) {\n super(renderer, elementRef);\n }\n\n /** @nodoc */\n ngOnInit(): void {\n this._control = this._injector.get(NgControl);\n this._checkName();\n this._registry.add(this._control, this);\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n this._registry.remove(this);\n }\n\n /**\n * Sets the \"checked\" property value on the radio input element.\n * @nodoc\n */\n writeValue(value: any): void {\n this._state = value === this.value;\n this.setProperty('checked', this._state);\n }\n\n /**\n * Registers a function called when the control value changes.\n * @nodoc\n */\n override registerOnChange(fn: (_: any) => {}): void {\n this._fn = fn;\n this.onChange = () => {\n fn(this.value);\n this._registry.select(this);\n };\n }\n\n /** @nodoc */\n override setDisabledState(isDisabled: boolean): void {\n /**\n * `setDisabledState` is supposed to be called whenever the disabled state of a control changes,\n * including upon control creation. However, a longstanding bug caused the method to not fire\n * when an *enabled* control was attached. This bug was fixed in v15 in #47576.\n *\n * This had a side effect: previously, it was possible to instantiate a reactive form control\n * with `[attr.disabled]=true`, even though the the corresponding control was enabled in the\n * model. This resulted in a mismatch between the model and the DOM. Now, because\n * `setDisabledState` is always called, the value in the DOM will be immediately overwritten\n * with the \"correct\" enabled value.\n *\n * However, the fix also created an exceptional case: radio buttons. Because Reactive Forms\n * models the entire group of radio buttons as a single `FormControl`, there is no way to\n * control the disabled state for individual radios, so they can no longer be configured as\n * disabled. Thus, we keep the old behavior for radio buttons, so that `[attr.disabled]`\n * continues to work. Specifically, we drop the first call to `setDisabledState` if `disabled`\n * is `false`, and we are not in legacy mode.\n */\n if (this.setDisabledStateFired || isDisabled ||\n this.callSetDisabledState === 'whenDisabledForLegacyCode') {\n this.setProperty('disabled', isDisabled);\n }\n this.setDisabledStateFired = true;\n }\n\n /**\n * Sets the \"value\" on the radio input element and unchecks it.\n *\n * @param value\n */\n fireUncheck(value: any): void {\n this.writeValue(value);\n }\n\n private _checkName(): void {\n if (this.name && this.formControlName && this.name !== this.formControlName &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throwNameError();\n }\n if (!this.name && this.formControlName) this.name = this.formControlName;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, EventEmitter, forwardRef, Inject, InjectionToken, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges} from '@angular/core';\n\nimport {FormControl} from '../../model/form_control';\nimport {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '../control_value_accessor';\nimport {NgControl} from '../ng_control';\nimport {disabledAttrWarning} from '../reactive_errors';\nimport {_ngModelWarning, CALL_SET_DISABLED_STATE, cleanUpControl, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from '../shared';\nimport {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators';\n\n\n/**\n * Token to provide to turn off the ngModel warning on formControl and formControlName.\n */\nexport const NG_MODEL_WITH_FORM_CONTROL_WARNING =\n new InjectionToken('NgModelWithFormControlWarning');\n\nconst formControlBinding: Provider = {\n provide: NgControl,\n useExisting: forwardRef(() => FormControlDirective)\n};\n\n/**\n * @description\n * Synchronizes a standalone `FormControl` instance to a form control element.\n *\n * Note that support for using the `ngModel` input property and `ngModelChange` event with reactive\n * form directives was deprecated in Angular v6 and is scheduled for removal in\n * a future version of Angular.\n * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms).\n *\n * @see [Reactive Forms Guide](guide/reactive-forms)\n * @see `FormControl`\n * @see `AbstractControl`\n *\n * @usageNotes\n *\n * The following example shows how to register a standalone control and set its value.\n *\n * {@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'}\n *\n * @ngModule ReactiveFormsModule\n * @publicApi\n */\n@Directive({selector: '[formControl]', providers: [formControlBinding], exportAs: 'ngForm'})\nexport class FormControlDirective extends NgControl implements OnChanges, OnDestroy {\n /**\n * Internal reference to the view model value.\n * @nodoc\n */\n viewModel: any;\n\n /**\n * @description\n * Tracks the `FormControl` instance bound to the directive.\n */\n // TODO(issue/24571): remove '!'.\n @Input('formControl') form!: FormControl;\n\n /**\n * @description\n * Triggers a warning in dev mode that this input should not be used with reactive forms.\n */\n @Input('disabled')\n set isDisabled(isDisabled: boolean) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(disabledAttrWarning);\n }\n }\n\n // TODO(kara): remove next 4 properties once deprecation period is over\n\n /** @deprecated as of v6 */\n @Input('ngModel') model: any;\n\n /** @deprecated as of v6 */\n @Output('ngModelChange') update = new EventEmitter();\n\n /**\n * @description\n * Static property used to track whether any ngModel warnings have been sent across\n * all instances of FormControlDirective. Used to support warning config of \"once\".\n *\n * @internal\n */\n static _ngModelWarningSentOnce = false;\n\n /**\n * @description\n * Instance property used to track whether an ngModel warning has been sent out for this\n * particular `FormControlDirective` instance. Used to support warning config of \"always\".\n *\n * @internal\n */\n _ngModelWarningSent = false;\n\n constructor(\n @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[],\n @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators:\n (AsyncValidator|AsyncValidatorFn)[],\n @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[],\n @Optional() @Inject(NG_MODEL_WITH_FORM_CONTROL_WARNING) private _ngModelWarningConfig: string|\n null,\n @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?:\n SetDisabledStateOption) {\n super();\n this._setValidators(validators);\n this._setAsyncValidators(asyncValidators);\n this.valueAccessor = selectValueAccessor(this, valueAccessors);\n }\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges): void {\n if (this._isControlChanged(changes)) {\n const previousForm = changes['form'].previousValue;\n if (previousForm) {\n cleanUpControl(previousForm, this, /* validateControlPresenceOnChange */ false);\n }\n setUpControl(this.form, this, this.callSetDisabledState);\n this.form.updateValueAndValidity({emitEvent: false});\n }\n if (isPropertyUpdated(changes, this.viewModel)) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n _ngModelWarning('formControl', FormControlDirective, this, this._ngModelWarningConfig);\n }\n this.form.setValue(this.model);\n this.viewModel = this.model;\n }\n }\n\n /** @nodoc */\n ngOnDestroy() {\n if (this.form) {\n cleanUpControl(this.form, this, /* validateControlPresenceOnChange */ false);\n }\n }\n\n /**\n * @description\n * Returns an array that represents the path from the top-level form to this control.\n * Each index is the string name of the control on that level.\n */\n override get path(): string[] {\n return [];\n }\n\n /**\n * @description\n * The `FormControl` bound to this directive.\n */\n override get control(): FormControl {\n return this.form;\n }\n\n /**\n * @description\n * Sets the new value for the view model and emits an `ngModelChange` event.\n *\n * @param newValue The new value for the view model.\n */\n override viewToModelUpdate(newValue: any): void {\n this.viewModel = newValue;\n this.update.emit(newValue);\n }\n\n private _isControlChanged(changes: {[key: string]: any}): boolean {\n return changes.hasOwnProperty('form');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef, forwardRef, Host, Input, OnDestroy, Optional, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../errors';\n\nimport {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';\n\nconst SELECT_MULTIPLE_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectMultipleControlValueAccessor),\n multi: true\n};\n\nfunction _buildValueString(id: string, value: any): string {\n if (id == null) return `${value}`;\n if (typeof value === 'string') value = `'${value}'`;\n if (value && typeof value === 'object') value = 'Object';\n return `${id}: ${value}`.slice(0, 50);\n}\n\nfunction _extractId(valueString: string): string {\n return valueString.split(':')[0];\n}\n\n/** Mock interface for HTML Options */\ninterface HTMLOption {\n value: string;\n selected: boolean;\n}\n\n/** Mock interface for HTMLCollection */\nabstract class HTMLCollection {\n // TODO(issue/24571): remove '!'.\n length!: number;\n abstract item(_: number): HTMLOption;\n}\n\n/**\n * @description\n * The `ControlValueAccessor` for writing multi-select control values and listening to multi-select\n * control changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and\n * `NgModel` directives.\n *\n * @see `SelectControlValueAccessor`\n *\n * @usageNotes\n *\n * ### Using a multi-select control\n *\n * The follow example shows you how to use a multi-select control with a reactive form.\n *\n * ```ts\n * const countryControl = new FormControl();\n * ```\n *\n * ```\n * <select multiple name=\"countries\" [formControl]=\"countryControl\">\n * <option *ngFor=\"let country of countries\" [ngValue]=\"country\">\n * {{ country.name }}\n * </option>\n * </select>\n * ```\n *\n * ### Customizing option selection\n *\n * To customize the default option comparison algorithm, `<select>` supports `compareWith` input.\n * See the `SelectControlValueAccessor` for usage.\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',\n host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'},\n providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]\n})\nexport class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor implements\n ControlValueAccessor {\n /**\n * The current value.\n * @nodoc\n */\n value: any;\n\n /** @internal */\n _optionMap: Map<string, ɵNgSelectMultipleOption> = new Map<string, ɵNgSelectMultipleOption>();\n\n /** @internal */\n _idCounter: number = 0;\n\n /**\n * @description\n * Tracks the option comparison algorithm for tracking identities when\n * checking for changes.\n */\n @Input()\n set compareWith(fn: (o1: any, o2: any) => boolean) {\n if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new RuntimeError(\n RuntimeErrorCode.COMPAREWITH_NOT_A_FN,\n `compareWith must be a function, but received ${JSON.stringify(fn)}`);\n }\n this._compareWith = fn;\n }\n\n private _compareWith: (o1: any, o2: any) => boolean = Object.is;\n\n /**\n * Sets the \"value\" property on one or of more of the select's options.\n * @nodoc\n */\n writeValue(value: any): void {\n this.value = value;\n let optionSelectedStateSetter: (opt: ɵNgSelectMultipleOption, o: any) => void;\n if (Array.isArray(value)) {\n // convert values to ids\n const ids = value.map((v) => this._getOptionId(v));\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(ids.indexOf(o.toString()) > -1);\n };\n } else {\n optionSelectedStateSetter = (opt, o) => {\n opt._setSelected(false);\n };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n }\n\n /**\n * Registers a function called when the control value changes\n * and writes an array of the selected options.\n * @nodoc\n */\n override registerOnChange(fn: (value: any) => any): void {\n this.onChange = (element: HTMLSelectElement) => {\n const selected: Array<any> = [];\n const selectedOptions = element.selectedOptions;\n if (selectedOptions !== undefined) {\n const options = selectedOptions;\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n // Degrade to use `options` when `selectedOptions` property is not available.\n // Note: the `selectedOptions` is available in all supported browsers, but the Domino lib\n // doesn't have it currently, see https://github.com/fgnass/domino/issues/177.\n else {\n const options = element.options;\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n if (opt.selected) {\n const val = this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n this.value = selected;\n fn(selected);\n };\n }\n\n /** @internal */\n _registerOption(value: ɵNgSelectMultipleOption): string {\n const id: string = (this._idCounter++).toString();\n this._optionMap.set(id, value);\n return id;\n }\n\n /** @internal */\n _getOptionId(value: any): string|null {\n for (const id of Array.from(this._optionMap.keys())) {\n if (this._compareWith(this._optionMap.get(id)!._value, value)) return id;\n }\n return null;\n }\n\n /** @internal */\n _getOptionValue(valueString: string): any {\n const id: string = _extractId(valueString);\n return this._optionMap.has(id) ? this._optionMap.get(id)!._value : valueString;\n }\n}\n\n/**\n * @description\n * Marks `<option>` as dynamic, so Angular can be notified when options change.\n *\n * @see `SelectMultipleControlValueAccessor`\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({selector: 'option'})\nexport class ɵNgSelectMultipleOption implements OnDestroy {\n // TODO(issue/24571): remove '!'.\n id!: string;\n /** @internal */\n _value: any;\n\n constructor(\n private _element: ElementRef, private _renderer: Renderer2,\n @Optional() @Host() private _select: SelectMultipleControlValueAccessor) {\n if (this._select) {\n this.id = this._select._registerOption(this);\n }\n }\n\n /**\n * @description\n * Tracks the value bound to the option element. Unlike the value binding,\n * ngValue supports binding to objects.\n */\n @Input('ngValue')\n set ngValue(value: any) {\n if (this._select == null) return;\n this._value = value;\n this._setElementValue(_buildValueString(this.id, value));\n this._select.writeValue(this._select.value);\n }\n\n /**\n * @description\n * Tracks simple string values bound to the option element.\n * For objects, use the `ngValue` input binding.\n */\n @Input('value')\n set value(value: any) {\n if (this._select) {\n this._value = value;\n this._setElementValue(_buildValueString(this.id, value));\n this._select.writeValue(this._select.value);\n } else {\n this._setElementValue(value);\n }\n }\n\n /** @internal */\n _setElementValue(value: string): void {\n this._renderer.setProperty(this._element.nativeElement, 'value', value);\n }\n\n /** @internal */\n _setSelected(selected: boolean) {\n this._renderer.setProperty(this._element.nativeElement, 'selected', selected);\n }\n\n /** @nodoc */\n ngOnDestroy(): void {\n if (this._select) {\n this._select._optionMap.delete(this.id);\n this._select.writeValue(this._select.value);\n }\n }\n}\n\nexport {ɵNgSelectMultipleOption as NgSelectMultipleOption};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, forwardRef, Input, OnChanges, Provider, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {AbstractControl} from '../model/abstract_model';\nimport {emailValidator, maxLengthValidator, maxValidator, minLengthValidator, minValidator, NG_VALIDATORS, nullValidator, patternValidator, requiredTrueValidator, requiredValidator} from '../validators';\n\n/**\n * Method that updates string to integer if not already a number\n *\n * @param value The value to convert to integer.\n * @returns value of parameter converted to number or integer.\n */\nfunction toInteger(value: string|number): number {\n return typeof value === 'number' ? value : parseInt(value, 10);\n}\n\n/**\n * Method that ensures that provided value is a float (and converts it to float if needed).\n *\n * @param value The value to convert to float.\n * @returns value of parameter converted to number or float.\n */\nfunction toFloat(value: string|number): number {\n return typeof value === 'number' ? value : parseFloat(value);\n}\n\n/**\n * @description\n * Defines the map of errors returned from failed validation checks.\n *\n * @publicApi\n */\nexport type ValidationErrors = {\n [key: string]: any\n};\n\n/**\n * @description\n * An interface implemented by classes that perform synchronous validation.\n *\n * @usageNotes\n *\n * ### Provide a custom validator\n *\n * The following example implements the `Validator` interface to create a\n * validator directive with a custom error key.\n *\n * ```typescript\n * @Directive({\n * selector: '[customValidator]',\n * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]\n * })\n * class CustomValidatorDirective implements Validator {\n * validate(control: AbstractControl): ValidationErrors|null {\n * return {'custom': true};\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport interface Validator {\n /**\n * @description\n * Method that performs synchronous validation against the provided control.\n *\n * @param control The control to validate against.\n *\n * @returns A map of validation errors if validation fails,\n * otherwise null.\n */\n validate(control: AbstractControl): ValidationErrors|null;\n\n /**\n * @description\n * Registers a callback function to call when the validator inputs change.\n *\n * @param fn The callback function\n */\n registerOnValidatorChange?(fn: () => void): void;\n}\n\n/**\n * A base class for Validator-based Directives. The class contains common logic shared across such\n * Directives.\n *\n * For internal use only, this class is not intended for use outside of the Forms package.\n */\n@Directive()\nabstract class AbstractValidatorDirective implements Validator, OnChanges {\n private _validator: ValidatorFn = nullValidator;\n private _onChange!: () => void;\n\n /**\n * A flag that tracks whether this validator is enabled.\n *\n * Marking it `internal` (vs `protected`), so that this flag can be used in host bindings of\n * directive classes that extend this base class.\n * @internal\n */\n _enabled?: boolean;\n\n /**\n * Name of an input that matches directive selector attribute (e.g. `minlength` for\n * `MinLengthDirective`). An input with a given name might contain configuration information (like\n * `minlength='10'`) or a flag that indicates whether validator should be enabled (like\n * `[required]='false'`).\n *\n * @internal\n */\n abstract inputName: string;\n\n /**\n * Creates an instance of a validator (specific to a directive that extends this base class).\n *\n * @internal\n */\n abstract createValidator(input: unknown): ValidatorFn;\n\n /**\n * Performs the necessary input normalization based on a specific logic of a Directive.\n * For example, the function might be used to convert string-based representation of the\n * `minlength` input to an integer value that can later be used in the `Validators.minLength`\n * validator.\n *\n * @internal\n */\n abstract normalizeInput(input: unknown): unknown;\n\n /** @nodoc */\n ngOnChanges(changes: SimpleChanges): void {\n if (this.inputName in changes) {\n const input = this.normalizeInput(changes[this.inputName].currentValue);\n this._enabled = this.enabled(input);\n this._validator = this._enabled ? this.createValidator(input) : nullValidator;\n if (this._onChange) {\n this._onChange();\n }\n }\n }\n\n /** @nodoc */\n validate(control: AbstractControl): ValidationErrors|null {\n return this._validator(control);\n }\n\n /** @nodoc */\n registerOnValidatorChange(fn: () => void): void {\n this._onChange = fn;\n }\n\n /**\n * @description\n * Determines whether this validator should be active or not based on an input.\n * Base class implementation checks whether an input is defined (if the value is different from\n * `null` and `undefined`). Validator classes that extend this base class can override this\n * function with the logic specific to a particular validator directive.\n */\n enabled(input: unknown): boolean {\n return input != null /* both `null` and `undefined` */;\n }\n}\n\n/**\n * @description\n * Provider which adds `MaxValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const MAX_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MaxValidator),\n multi: true\n};\n\n/**\n * A directive which installs the {@link MaxValidator} for any `formControlName`,\n * `formControl`, or control with `ngModel` that also has a `max` attribute.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a max validator\n *\n * The following example shows how to add a max validator to an input attached to an\n * ngModel binding.\n *\n * ```html\n * <input type=\"number\" ngModel max=\"4\">\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n 'input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]',\n providers: [MAX_VALIDATOR],\n host: {'[attr.max]': '_enabled ? max : null'}\n})\nexport class MaxValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the max bound to this directive.\n */\n @Input() max!: string|number|null;\n /** @internal */\n override inputName = 'max';\n /** @internal */\n override normalizeInput = (input: string|number): number => toFloat(input);\n /** @internal */\n override createValidator = (max: number): ValidatorFn => maxValidator(max);\n}\n\n/**\n * @description\n * Provider which adds `MinValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const MIN_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MinValidator),\n multi: true\n};\n\n/**\n * A directive which installs the {@link MinValidator} for any `formControlName`,\n * `formControl`, or control with `ngModel` that also has a `min` attribute.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a min validator\n *\n * The following example shows how to add a min validator to an input attached to an\n * ngModel binding.\n *\n * ```html\n * <input type=\"number\" ngModel min=\"4\">\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector:\n 'input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]',\n providers: [MIN_VALIDATOR],\n host: {'[attr.min]': '_enabled ? min : null'}\n})\nexport class MinValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the min bound to this directive.\n */\n @Input() min!: string|number|null;\n /** @internal */\n override inputName = 'min';\n /** @internal */\n override normalizeInput = (input: string|number): number => toFloat(input);\n /** @internal */\n override createValidator = (min: number): ValidatorFn => minValidator(min);\n}\n\n/**\n * @description\n * An interface implemented by classes that perform asynchronous validation.\n *\n * @usageNotes\n *\n * ### Provide a custom async validator directive\n *\n * The following example implements the `AsyncValidator` interface to create an\n * async validator directive with a custom error key.\n *\n * ```typescript\n * import { of } from 'rxjs';\n *\n * @Directive({\n * selector: '[customAsyncValidator]',\n * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi:\n * true}]\n * })\n * class CustomAsyncValidatorDirective implements AsyncValidator {\n * validate(control: AbstractControl): Observable<ValidationErrors|null> {\n * return of({'custom': true});\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport interface AsyncValidator extends Validator {\n /**\n * @description\n * Method that performs async validation against the provided control.\n *\n * @param control The control to validate against.\n *\n * @returns A promise or observable that resolves a map of validation errors\n * if validation fails, otherwise null.\n */\n validate(control: AbstractControl):\n Promise<ValidationErrors|null>|Observable<ValidationErrors|null>;\n}\n\n/**\n * @description\n * Provider which adds `RequiredValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const REQUIRED_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => RequiredValidator),\n multi: true\n};\n\n/**\n * @description\n * Provider which adds `CheckboxRequiredValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const CHECKBOX_REQUIRED_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => CheckboxRequiredValidator),\n multi: true\n};\n\n\n/**\n * @description\n * A directive that adds the `required` validator to any controls marked with the\n * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a required validator using template-driven forms\n *\n * ```\n * <input name=\"fullName\" ngModel required>\n * ```\n *\n * @ngModule FormsModule\n * @ngModule ReactiveFormsModule\n * @publicApi\n */\n@Directive({\n selector:\n ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',\n providers: [REQUIRED_VALIDATOR],\n host: {'[attr.required]': '_enabled ? \"\" : null'}\n})\nexport class RequiredValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the required attribute bound to this directive.\n */\n @Input() required!: boolean|string;\n\n /** @internal */\n override inputName = 'required';\n\n /** @internal */\n override normalizeInput = coerceToBoolean;\n\n /** @internal */\n override createValidator = (input: boolean): ValidatorFn => requiredValidator;\n\n /** @nodoc */\n override enabled(input: boolean): boolean {\n return input;\n }\n}\n\n\n/**\n * A Directive that adds the `required` validator to checkbox controls marked with the\n * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a required checkbox validator using template-driven forms\n *\n * The following example shows how to add a checkbox required validator to an input attached to an\n * ngModel binding.\n *\n * ```\n * <input type=\"checkbox\" name=\"active\" ngModel required>\n * ```\n *\n * @publicApi\n * @ngModule FormsModule\n * @ngModule ReactiveFormsModule\n */\n@Directive({\n selector:\n 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',\n providers: [CHECKBOX_REQUIRED_VALIDATOR],\n host: {'[attr.required]': '_enabled ? \"\" : null'}\n})\nexport class CheckboxRequiredValidator extends RequiredValidator {\n /** @internal */\n override createValidator = (input: unknown): ValidatorFn => requiredTrueValidator;\n}\n\n/**\n * @description\n * Provider which adds `EmailValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const EMAIL_VALIDATOR: any = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => EmailValidator),\n multi: true\n};\n\n/**\n * A directive that adds the `email` validator to controls marked with the\n * `email` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list.\n *\n * The email validation is based on the WHATWG HTML specification with some enhancements to\n * incorporate more RFC rules. More information can be found on the [Validators.email\n * page](api/forms/Validators#email).\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding an email validator\n *\n * The following example shows how to add an email validator to an input attached to an ngModel\n * binding.\n *\n * ```\n * <input type=\"email\" name=\"email\" ngModel email>\n * <input type=\"email\" name=\"email\" ngModel email=\"true\">\n * <input type=\"email\" name=\"email\" ngModel [email]=\"true\">\n * ```\n *\n * @publicApi\n * @ngModule FormsModule\n * @ngModule ReactiveFormsModule\n */\n@Directive({\n selector: '[email][formControlName],[email][formControl],[email][ngModel]',\n providers: [EMAIL_VALIDATOR]\n})\nexport class EmailValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the email attribute bound to this directive.\n */\n @Input() email!: boolean|string;\n\n /** @internal */\n override inputName = 'email';\n\n /** @internal */\n override normalizeInput = coerceToBoolean;\n\n /** @internal */\n override createValidator = (input: number): ValidatorFn => emailValidator;\n\n /** @nodoc */\n override enabled(input: boolean): boolean {\n return input;\n }\n}\n\n/**\n * @description\n * A function that receives a control and synchronously returns a map of\n * validation errors if present, otherwise null.\n *\n * @publicApi\n */\nexport interface ValidatorFn {\n (control: AbstractControl): ValidationErrors|null;\n}\n\n/**\n * @description\n * A function that receives a control and returns a Promise or observable\n * that emits validation errors if present, otherwise null.\n *\n * @publicApi\n */\nexport interface AsyncValidatorFn {\n (control: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>;\n}\n\n/**\n * @description\n * Provider which adds `MinLengthValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const MIN_LENGTH_VALIDATOR: any = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MinLengthValidator),\n multi: true\n};\n\n/**\n * A directive that adds minimum length validation to controls marked with the\n * `minlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a minimum length validator\n *\n * The following example shows how to add a minimum length validator to an input attached to an\n * ngModel binding.\n *\n * ```html\n * <input name=\"firstName\" ngModel minlength=\"4\">\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',\n providers: [MIN_LENGTH_VALIDATOR],\n host: {'[attr.minlength]': '_enabled ? minlength : null'}\n})\nexport class MinLengthValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the minimum length bound to this directive.\n */\n @Input() minlength!: string|number|null;\n\n /** @internal */\n override inputName = 'minlength';\n\n /** @internal */\n override normalizeInput = (input: string|number): number => toInteger(input);\n\n /** @internal */\n override createValidator = (minlength: number): ValidatorFn => minLengthValidator(minlength);\n}\n\n/**\n * @description\n * Provider which adds `MaxLengthValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const MAX_LENGTH_VALIDATOR: any = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MaxLengthValidator),\n multi: true\n};\n\n/**\n * A directive that adds max length validation to controls marked with the\n * `maxlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a maximum length validator\n *\n * The following example shows how to add a maximum length validator to an input attached to an\n * ngModel binding.\n *\n * ```html\n * <input name=\"firstName\" ngModel maxlength=\"25\">\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',\n providers: [MAX_LENGTH_VALIDATOR],\n host: {'[attr.maxlength]': '_enabled ? maxlength : null'}\n})\nexport class MaxLengthValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the minimum length bound to this directive.\n */\n @Input() maxlength!: string|number|null;\n\n /** @internal */\n override inputName = 'maxlength';\n\n /** @internal */\n override normalizeInput = (input: string|number): number => toInteger(input);\n\n /** @internal */\n override createValidator = (maxlength: number): ValidatorFn => maxLengthValidator(maxlength);\n}\n\n/**\n * @description\n * Provider which adds `PatternValidator` to the `NG_VALIDATORS` multi-provider list.\n */\nexport const PATTERN_VALIDATOR: any = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => PatternValidator),\n multi: true\n};\n\n\n/**\n * @description\n * A directive that adds regex pattern validation to controls marked with the\n * `pattern` attribute. The regex must match the entire control value.\n * The directive is provided with the `NG_VALIDATORS` multi-provider list.\n *\n * @see [Form Validation](guide/form-validation)\n *\n * @usageNotes\n *\n * ### Adding a pattern validator\n *\n * The following example shows how to add a pattern validator to an input attached to an\n * ngModel binding.\n *\n * ```html\n * <input name=\"firstName\" ngModel pattern=\"[a-zA-Z ]*\">\n * ```\n *\n * @ngModule ReactiveFormsModule\n * @ngModule FormsModule\n * @publicApi\n */\n@Directive({\n selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',\n providers: [PATTERN_VALIDATOR],\n host: {'[attr.pattern]': '_enabled ? pattern : null'}\n})\nexport class PatternValidator extends AbstractValidatorDirective {\n /**\n * @description\n * Tracks changes to the pattern bound to this directive.\n */\n @Input()\n pattern!: string|RegExp; // This input is always defined, since the name matches selector.\n\n /** @internal */\n override inputName = 'pattern';\n\n /** @internal */\n override normalizeInput = (input: string|RegExp): string|RegExp => input;\n\n /** @internal */\n override createValidator = (input: string|RegExp): ValidatorFn => patternValidator(input);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule, Type} from '@angular/core';\n\nimport {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor';\nimport {DefaultValueAccessor} from './directives/default_value_accessor';\nimport {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status';\nimport {NgForm} from './directives/ng_form';\nimport {NgModel} from './directives/ng_model';\nimport {NgModelGroup} from './directives/ng_model_group';\nimport {NgNoValidate} from './directives/ng_no_validate_directive';\nimport {NumberValueAccessor} from './directives/number_value_accessor';\nimport {RadioControlRegistryModule, RadioControlValueAccessor} from './directives/radio_control_value_accessor';\nimport {RangeValueAccessor} from './directives/range_value_accessor';\nimport {FormControlDirective} from './directives/reactive_directives/form_control_directive';\nimport {FormControlName} from './directives/reactive_directives/form_control_name';\nimport {FormGroupDirective} from './directives/reactive_directives/form_group_directive';\nimport {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name';\nimport {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor';\nimport {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor';\nimport {CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, PatternValidator, RequiredValidator} from './directives/validators';\n\nexport {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor';\nexport {ControlValueAccessor} from './directives/control_value_accessor';\nexport {DefaultValueAccessor} from './directives/default_value_accessor';\nexport {NgControl} from './directives/ng_control';\nexport {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status';\nexport {NgForm} from './directives/ng_form';\nexport {NgModel} from './directives/ng_model';\nexport {NgModelGroup} from './directives/ng_model_group';\nexport {NumberValueAccessor} from './directives/number_value_accessor';\nexport {RadioControlValueAccessor} from './directives/radio_control_value_accessor';\nexport {RangeValueAccessor} from './directives/range_value_accessor';\nexport {FormControlDirective, NG_MODEL_WITH_FORM_CONTROL_WARNING} from './directives/reactive_directives/form_control_directive';\nexport {FormControlName} from './directives/reactive_directives/form_control_name';\nexport {FormGroupDirective} from './directives/reactive_directives/form_group_directive';\nexport {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name';\nexport {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor';\nexport {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor';\nexport {CALL_SET_DISABLED_STATE} from './directives/shared';\n\nexport const SHARED_FORM_DIRECTIVES: Type<any>[] = [\n NgNoValidate,\n NgSelectOption,\n NgSelectMultipleOption,\n DefaultValueAccessor,\n NumberValueAccessor,\n RangeValueAccessor,\n CheckboxControlValueAccessor,\n SelectControlValueAccessor,\n SelectMultipleControlValueAccessor,\n RadioControlValueAccessor,\n NgControlStatus,\n NgControlStatusGroup,\n RequiredValidator,\n MinLengthValidator,\n MaxLengthValidator,\n PatternValidator,\n CheckboxRequiredValidator,\n EmailValidator,\n MinValidator,\n MaxValidator,\n];\n\nexport const TEMPLATE_DRIVEN_DIRECTIVES: Type<any>[] = [NgModel, NgModelGroup, NgForm];\n\nexport const REACTIVE_DRIVEN_DIRECTIVES: Type<any>[] =\n [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];\n\n/**\n * Internal module used for sharing directives between FormsModule and ReactiveFormsModule\n */\n@NgModule({\n declarations: SHARED_FORM_DIRECTIVES,\n imports: [RadioControlRegistryModule],\n exports: SHARED_FORM_DIRECTIVES,\n})\nexport class ɵInternalFormsSharedModule {\n}\n\nexport {ɵInternalFormsSharedModule as InternalFormsSharedModule};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ModuleWithProviders, NgModule} from '@angular/core';\n\nimport {InternalFormsSharedModule, NG_MODEL_WITH_FORM_CONTROL_WARNING, REACTIVE_DRIVEN_DIRECTIVES, TEMPLATE_DRIVEN_DIRECTIVES} from './directives';\nimport {CALL_SET_DISABLED_STATE, setDisabledStateDefault, SetDisabledStateOption} from './directives/shared';\n\n/**\n * Exports the required providers and directives for template-driven forms,\n * making them available for import by NgModules that import this module.\n *\n * Providers associated with this module:\n * * `RadioControlRegistry`\n *\n * @see [Forms Overview](/guide/forms-overview)\n * @see [Template-driven Forms Guide](/guide/forms)\n *\n * @publicApi\n */\n@NgModule({\n declarations: TEMPLATE_DRIVEN_DIRECTIVES,\n exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]\n})\nexport class FormsModule {\n /**\n * @description\n * Provides options for configuring the forms module.\n *\n * @param opts An object of configuration options\n * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more\n * correct, or to only call it `whenDisabled`, which is the legacy behavior.\n */\n static withConfig(opts: {\n callSetDisabledState?: SetDisabledStateOption,\n }): ModuleWithProviders<FormsModule> {\n return {\n ngModule: FormsModule,\n providers: [{\n provide: CALL_SET_DISABLED_STATE,\n useValue: opts.callSetDisabledState ?? setDisabledStateDefault\n }]\n };\n }\n}\n\n/**\n * Exports the required infrastructure and directives for reactive forms,\n * making them available for import by NgModules that import this module.\n *\n * Providers associated with this module:\n * * `FormBuilder`\n * * `RadioControlRegistry`\n *\n * @see [Forms Overview](guide/forms-overview)\n * @see [Reactive Forms Guide](guide/reactive-forms)\n *\n * @publicApi\n */\n@NgModule({\n declarations: [REACTIVE_DRIVEN_DIRECTIVES],\n exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]\n})\nexport class ReactiveFormsModule {\n /**\n * @description\n * Provides options for configuring the reactive forms module.\n *\n * @param opts An object of configuration options\n * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel`\n * binding is used with reactive form directives.\n * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more\n * correct, or to only call it `whenDisabled`, which is the legacy behavior.\n */\n static withConfig(opts: {\n /** @deprecated as of v6 */ warnOnNgModelWithFormControl?: 'never'|'once'|\n 'always',\n callSetDisabledState?: SetDisabledStateOption,\n }): ModuleWithProviders<ReactiveFormsModule> {\n return {\n ngModule: ReactiveFormsModule,\n providers: [\n {\n provide: NG_MODEL_WITH_FORM_CONTROL_WARNING,\n useValue: opts.warnOnNgModelWithFormControl ?? 'always'\n },\n {\n provide: CALL_SET_DISABLED_STATE,\n useValue: opts.callSetDisabledState ?? setDisabledStateDefault\n }\n ]\n };\n }\n}\n","import { Observable } from '../Observable';\nimport { SubscribableOrPromise, ObservedValueOf, ObservableInput } from '../types';\nimport { from } from './from'; // lol\nimport { empty } from './empty';\n\n/**\n * Creates an Observable that, on subscribe, calls an Observable factory to\n * make an Observable for each new Observer.\n *\n * <span class=\"informal\">Creates the Observable lazily, that is, only when it\n * is subscribed.\n * </span>\n *\n * \n *\n * `defer` allows you to create the Observable only when the Observer\n * subscribes, and create a fresh Observable for each Observer. It waits until\n * an Observer subscribes to it, and then it generates an Observable,\n * typically with an Observable factory function. It does this afresh for each\n * subscriber, so although each subscriber may think it is subscribing to the\n * same Observable, in fact each subscriber gets its own individual\n * Observable.\n *\n * ## Example\n * ### Subscribe to either an Observable of clicks or an Observable of interval, at random\n * ```ts\n * import { defer, fromEvent, interval } from 'rxjs';\n *\n * const clicksOrInterval = defer(function () {\n * return Math.random() > 0.5\n * ? fromEvent(document, 'click')\n * : interval(1000);\n * });\n * clicksOrInterval.subscribe(x => console.log(x));\n *\n * // Results in the following behavior:\n * // If the result of Math.random() is greater than 0.5 it will listen\n * // for clicks anywhere on the \"document\"; when document is clicked it\n * // will log a MouseEvent object to the console. If the result is less\n * // than 0.5 it will emit ascending numbers, one every second(1000ms).\n * ```\n *\n * @see {@link Observable}\n *\n * @param {function(): SubscribableOrPromise} observableFactory The Observable\n * factory function to invoke for each Observer that subscribes to the output\n * Observable. May also return a Promise, which will be converted on the fly\n * to an Observable.\n * @return {Observable} An Observable whose Observers' subscriptions trigger\n * an invocation of the given Observable factory function.\n * @static true\n * @name defer\n * @owner Observable\n */\nexport function defer<R extends ObservableInput<any> | void>(observableFactory: () => R): Observable<ObservedValueOf<R>> {\n return new Observable<ObservedValueOf<R>>(subscriber => {\n let input: R | void;\n try {\n input = observableFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n const source = input ? from(input as ObservableInput<ObservedValueOf<R>>) : empty();\n return source.subscribe(subscriber);\n });\n}\n","import { mergeMap } from './mergeMap';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function concatMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function concatMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated resultSelector no longer supported, use inner map instead */\nexport function concatMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.</span>\n *\n * \n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * ## Example\n * For each click event, tick every second from 0 to 3, with no concurrency\n *\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { concatMap, take } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(\n * concatMap(ev => interval(1000).pipe(take(4)))\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n * ```\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional deprecated `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nexport function concatMap<T, R, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n resultSelector?: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R\n): OperatorFunction<T, ObservedValueOf<O>|R> {\n return mergeMap(project, resultSelector, 1);\n}\n","import * as i0 from '@angular/core';\nimport { Injectable, EventEmitter, InjectionToken, Inject, Directive, Input, Pipe, NgModule } from '@angular/core';\nimport { of, isObservable, forkJoin, concat, defer } from 'rxjs';\nimport { take, shareReplay, map, concatMap, switchMap } from 'rxjs/operators';\n\nclass TranslateLoader {\r\n}\r\n/**\r\n * This loader is just a placeholder that does nothing, in case you don't need a loader at all\r\n */\r\nclass TranslateFakeLoader extends TranslateLoader {\r\n getTranslation(lang) {\r\n return of({});\r\n }\r\n}\r\nTranslateFakeLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateFakeLoader, deps: null, target: i0.ɵɵFactoryTarget.Injectable });\r\nTranslateFakeLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateFakeLoader });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateFakeLoader, decorators: [{\r\n type: Injectable\r\n }] });\n\nclass MissingTranslationHandler {\r\n}\r\n/**\r\n * This handler is just a placeholder that does nothing, in case you don't need a missing translation handler at all\r\n */\r\nclass FakeMissingTranslationHandler {\r\n handle(params) {\r\n return params.key;\r\n }\r\n}\r\nFakeMissingTranslationHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: FakeMissingTranslationHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });\r\nFakeMissingTranslationHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: FakeMissingTranslationHandler });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: FakeMissingTranslationHandler, decorators: [{\r\n type: Injectable\r\n }] });\n\n/* tslint:disable */\r\n/**\r\n * Determines if two objects or two values are equivalent.\r\n *\r\n * Two objects or values are considered equivalent if at least one of the following is true:\r\n *\r\n * * Both objects or values pass `===` comparison.\r\n * * Both objects or values are of the same type and all of their properties are equal by\r\n * comparing them with `equals`.\r\n *\r\n * @param o1 Object or value to compare.\r\n * @param o2 Object or value to compare.\r\n * @returns true if arguments are equal.\r\n */\r\nfunction equals(o1, o2) {\r\n if (o1 === o2)\r\n return true;\r\n if (o1 === null || o2 === null)\r\n return false;\r\n if (o1 !== o1 && o2 !== o2)\r\n return true; // NaN === NaN\r\n let t1 = typeof o1, t2 = typeof o2, length, key, keySet;\r\n if (t1 == t2 && t1 == 'object') {\r\n if (Array.isArray(o1)) {\r\n if (!Array.isArray(o2))\r\n return false;\r\n if ((length = o1.length) == o2.length) {\r\n for (key = 0; key < length; key++) {\r\n if (!equals(o1[key], o2[key]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n else {\r\n if (Array.isArray(o2)) {\r\n return false;\r\n }\r\n keySet = Object.create(null);\r\n for (key in o1) {\r\n if (!equals(o1[key], o2[key])) {\r\n return false;\r\n }\r\n keySet[key] = true;\r\n }\r\n for (key in o2) {\r\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/* tslint:enable */\r\nfunction isDefined(value) {\r\n return typeof value !== 'undefined' && value !== null;\r\n}\r\nfunction isObject(item) {\r\n return (item && typeof item === 'object' && !Array.isArray(item));\r\n}\r\nfunction mergeDeep(target, source) {\r\n let output = Object.assign({}, target);\r\n if (isObject(target) && isObject(source)) {\r\n Object.keys(source).forEach((key) => {\r\n if (isObject(source[key])) {\r\n if (!(key in target)) {\r\n Object.assign(output, { [key]: source[key] });\r\n }\r\n else {\r\n output[key] = mergeDeep(target[key], source[key]);\r\n }\r\n }\r\n else {\r\n Object.assign(output, { [key]: source[key] });\r\n }\r\n });\r\n }\r\n return output;\r\n}\n\nclass TranslateParser {\r\n}\r\nclass TranslateDefaultParser extends TranslateParser {\r\n constructor() {\r\n super(...arguments);\r\n this.templateMatcher = /{{\\s?([^{}\\s]*)\\s?}}/g;\r\n }\r\n interpolate(expr, params) {\r\n let result;\r\n if (typeof expr === 'string') {\r\n result = this.interpolateString(expr, params);\r\n }\r\n else if (typeof expr === 'function') {\r\n result = this.interpolateFunction(expr, params);\r\n }\r\n else {\r\n // this should not happen, but an unrelated TranslateService test depends on it\r\n result = expr;\r\n }\r\n return result;\r\n }\r\n getValue(target, key) {\r\n let keys = typeof key === 'string' ? key.split('.') : [key];\r\n key = '';\r\n do {\r\n key += keys.shift();\r\n if (isDefined(target) && isDefined(target[key]) && (typeof target[key] === 'object' || !keys.length)) {\r\n target = target[key];\r\n key = '';\r\n }\r\n else if (!keys.length) {\r\n target = undefined;\r\n }\r\n else {\r\n key += '.';\r\n }\r\n } while (keys.length);\r\n return target;\r\n }\r\n interpolateFunction(fn, params) {\r\n return fn(params);\r\n }\r\n interpolateString(expr, params) {\r\n if (!params) {\r\n return expr;\r\n }\r\n return expr.replace(this.templateMatcher, (substring, b) => {\r\n let r = this.getValue(params, b);\r\n return isDefined(r) ? r : substring;\r\n });\r\n }\r\n}\r\nTranslateDefaultParser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateDefaultParser, deps: null, target: i0.ɵɵFactoryTarget.Injectable });\r\nTranslateDefaultParser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateDefaultParser });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateDefaultParser, decorators: [{\r\n type: Injectable\r\n }] });\n\nclass TranslateCompiler {\r\n}\r\n/**\r\n * This compiler is just a placeholder that does nothing, in case you don't need a compiler at all\r\n */\r\nclass TranslateFakeCompiler extends TranslateCompiler {\r\n compile(value, lang) {\r\n return value;\r\n }\r\n compileTranslations(translations, lang) {\r\n return translations;\r\n }\r\n}\r\nTranslateFakeCompiler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateFakeCompiler, deps: null, target: i0.ɵɵFactoryTarget.Injectable });\r\nTranslateFakeCompiler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateFakeCompiler });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateFakeCompiler, decorators: [{\r\n type: Injectable\r\n }] });\n\nclass TranslateStore {\r\n constructor() {\r\n /**\r\n * The lang currently used\r\n */\r\n this.currentLang = this.defaultLang;\r\n /**\r\n * a list of translations per lang\r\n */\r\n this.translations = {};\r\n /**\r\n * an array of langs\r\n */\r\n this.langs = [];\r\n /**\r\n * An EventEmitter to listen to translation change events\r\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\r\n * // do something\r\n * });\r\n */\r\n this.onTranslationChange = new EventEmitter();\r\n /**\r\n * An EventEmitter to listen to lang change events\r\n * onLangChange.subscribe((params: LangChangeEvent) => {\r\n * // do something\r\n * });\r\n */\r\n this.onLangChange = new EventEmitter();\r\n /**\r\n * An EventEmitter to listen to default lang change events\r\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\r\n * // do something\r\n * });\r\n */\r\n this.onDefaultLangChange = new EventEmitter();\r\n }\r\n}\n\nconst USE_STORE = new InjectionToken('USE_STORE');\r\nconst USE_DEFAULT_LANG = new InjectionToken('USE_DEFAULT_LANG');\r\nconst DEFAULT_LANGUAGE = new InjectionToken('DEFAULT_LANGUAGE');\r\nconst USE_EXTEND = new InjectionToken('USE_EXTEND');\r\nclass TranslateService {\r\n /**\r\n *\r\n * @param store an instance of the store (that is supposed to be unique)\r\n * @param currentLoader An instance of the loader currently used\r\n * @param compiler An instance of the compiler currently used\r\n * @param parser An instance of the parser currently used\r\n * @param missingTranslationHandler A handler for missing translations.\r\n * @param useDefaultLang whether we should use default language translation when current language translation is missing.\r\n * @param isolate whether this service should use the store or not\r\n * @param extend To make a child module extend (and use) translations from parent modules.\r\n * @param defaultLanguage Set the default language using configuration\r\n */\r\n constructor(store, currentLoader, compiler, parser, missingTranslationHandler, useDefaultLang = true, isolate = false, extend = false, defaultLanguage) {\r\n this.store = store;\r\n this.currentLoader = currentLoader;\r\n this.compiler = compiler;\r\n this.parser = parser;\r\n this.missingTranslationHandler = missingTranslationHandler;\r\n this.useDefaultLang = useDefaultLang;\r\n this.isolate = isolate;\r\n this.extend = extend;\r\n this.pending = false;\r\n this._onTranslationChange = new EventEmitter();\r\n this._onLangChange = new EventEmitter();\r\n this._onDefaultLangChange = new EventEmitter();\r\n this._langs = [];\r\n this._translations = {};\r\n this._translationRequests = {};\r\n /** set the default language from configuration */\r\n if (defaultLanguage) {\r\n this.setDefaultLang(defaultLanguage);\r\n }\r\n }\r\n /**\r\n * An EventEmitter to listen to translation change events\r\n * onTranslationChange.subscribe((params: TranslationChangeEvent) => {\r\n * // do something\r\n * });\r\n */\r\n get onTranslationChange() {\r\n return this.isolate ? this._onTranslationChange : this.store.onTranslationChange;\r\n }\r\n /**\r\n * An EventEmitter to listen to lang change events\r\n * onLangChange.subscribe((params: LangChangeEvent) => {\r\n * // do something\r\n * });\r\n */\r\n get onLangChange() {\r\n return this.isolate ? this._onLangChange : this.store.onLangChange;\r\n }\r\n /**\r\n * An EventEmitter to listen to default lang change events\r\n * onDefaultLangChange.subscribe((params: DefaultLangChangeEvent) => {\r\n * // do something\r\n * });\r\n */\r\n get onDefaultLangChange() {\r\n return this.isolate ? this._onDefaultLangChange : this.store.onDefaultLangChange;\r\n }\r\n /**\r\n * The default lang to fallback when translations are missing on the current lang\r\n */\r\n get defaultLang() {\r\n return this.isolate ? this._defaultLang : this.store.defaultLang;\r\n }\r\n set defaultLang(defaultLang) {\r\n if (this.isolate) {\r\n this._defaultLang = defaultLang;\r\n }\r\n else {\r\n this.store.defaultLang = defaultLang;\r\n }\r\n }\r\n /**\r\n * The lang currently used\r\n */\r\n get currentLang() {\r\n return this.isolate ? this._currentLang : this.store.currentLang;\r\n }\r\n set currentLang(currentLang) {\r\n if (this.isolate) {\r\n this._currentLang = currentLang;\r\n }\r\n else {\r\n this.store.currentLang = currentLang;\r\n }\r\n }\r\n /**\r\n * an array of langs\r\n */\r\n get langs() {\r\n return this.isolate ? this._langs : this.store.langs;\r\n }\r\n set langs(langs) {\r\n if (this.isolate) {\r\n this._langs = langs;\r\n }\r\n else {\r\n this.store.langs = langs;\r\n }\r\n }\r\n /**\r\n * a list of translations per lang\r\n */\r\n get translations() {\r\n return this.isolate ? this._translations : this.store.translations;\r\n }\r\n set translations(translations) {\r\n if (this.isolate) {\r\n this._translations = translations;\r\n }\r\n else {\r\n this.store.translations = translations;\r\n }\r\n }\r\n /**\r\n * Sets the default language to use as a fallback\r\n */\r\n setDefaultLang(lang) {\r\n if (lang === this.defaultLang) {\r\n return;\r\n }\r\n let pending = this.retrieveTranslations(lang);\r\n if (typeof pending !== \"undefined\") {\r\n // on init set the defaultLang immediately\r\n if (this.defaultLang == null) {\r\n this.defaultLang = lang;\r\n }\r\n pending.pipe(take(1))\r\n .subscribe((res) => {\r\n this.changeDefaultLang(lang);\r\n });\r\n }\r\n else { // we already have this language\r\n this.changeDefaultLang(lang);\r\n }\r\n }\r\n /**\r\n * Gets the default language used\r\n */\r\n getDefaultLang() {\r\n return this.defaultLang;\r\n }\r\n /**\r\n * Changes the lang currently used\r\n */\r\n use(lang) {\r\n // don't change the language if the language given is already selected\r\n if (lang === this.currentLang) {\r\n return of(this.translations[lang]);\r\n }\r\n let pending = this.retrieveTranslations(lang);\r\n if (typeof pending !== \"undefined\") {\r\n // on init set the currentLang immediately\r\n if (!this.currentLang) {\r\n this.currentLang = lang;\r\n }\r\n pending.pipe(take(1))\r\n .subscribe((res) => {\r\n this.changeLang(lang);\r\n });\r\n return pending;\r\n }\r\n else { // we have this language, return an Observable\r\n this.changeLang(lang);\r\n return of(this.translations[lang]);\r\n }\r\n }\r\n /**\r\n * Retrieves the given translations\r\n */\r\n retrieveTranslations(lang) {\r\n let pending;\r\n // if this language is unavailable or extend is true, ask for it\r\n if (typeof this.translations[lang] === \"undefined\" || this.extend) {\r\n this._translationRequests[lang] = this._translationRequests[lang] || this.getTranslation(lang);\r\n pending = this._translationRequests[lang];\r\n }\r\n return pending;\r\n }\r\n /**\r\n * Gets an object of translations for a given language with the current loader\r\n * and passes it through the compiler\r\n */\r\n getTranslation(lang) {\r\n this.pending = true;\r\n const loadingTranslations = this.currentLoader.getTranslation(lang).pipe(shareReplay(1), take(1));\r\n this.loadingTranslations = loadingTranslations.pipe(map((res) => this.compiler.compileTranslations(res, lang)), shareReplay(1), take(1));\r\n this.loadingTranslations\r\n .subscribe({\r\n next: (res) => {\r\n this.translations[lang] = this.extend && this.translations[lang] ? { ...res, ...this.translations[lang] } : res;\r\n this.updateLangs();\r\n this.pending = false;\r\n },\r\n error: (err) => {\r\n this.pending = false;\r\n }\r\n });\r\n return loadingTranslations;\r\n }\r\n /**\r\n * Manually sets an object of translations for a given language\r\n * after passing it through the compiler\r\n */\r\n setTranslation(lang, translations, shouldMerge = false) {\r\n translations = this.compiler.compileTranslations(translations, lang);\r\n if ((shouldMerge || this.extend) && this.translations[lang]) {\r\n this.translations[lang] = mergeDeep(this.translations[lang], translations);\r\n }\r\n else {\r\n this.translations[lang] = translations;\r\n }\r\n this.updateLangs();\r\n this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] });\r\n }\r\n /**\r\n * Returns an array of currently available langs\r\n */\r\n getLangs() {\r\n return this.langs;\r\n }\r\n /**\r\n * Add available langs\r\n */\r\n addLangs(langs) {\r\n langs.forEach((lang) => {\r\n if (this.langs.indexOf(lang) === -1) {\r\n this.langs.push(lang);\r\n }\r\n });\r\n }\r\n /**\r\n * Update the list of available langs\r\n */\r\n updateLangs() {\r\n this.addLangs(Object.keys(this.translations));\r\n }\r\n /**\r\n * Returns the parsed result of the translations\r\n */\r\n getParsedResult(translations, key, interpolateParams) {\r\n let res;\r\n if (key instanceof Array) {\r\n let result = {}, observables = false;\r\n for (let k of key) {\r\n result[k] = this.getParsedResult(translations, k, interpolateParams);\r\n if (isObservable(result[k])) {\r\n observables = true;\r\n }\r\n }\r\n if (observables) {\r\n const sources = key.map(k => isObservable(result[k]) ? result[k] : of(result[k]));\r\n return forkJoin(sources).pipe(map((arr) => {\r\n let obj = {};\r\n arr.forEach((value, index) => {\r\n obj[key[index]] = value;\r\n });\r\n return obj;\r\n }));\r\n }\r\n return result;\r\n }\r\n if (translations) {\r\n res = this.parser.interpolate(this.parser.getValue(translations, key), interpolateParams);\r\n }\r\n if (typeof res === \"undefined\" && this.defaultLang != null && this.defaultLang !== this.currentLang && this.useDefaultLang) {\r\n res = this.parser.interpolate(this.parser.getValue(this.translations[this.defaultLang], key), interpolateParams);\r\n }\r\n if (typeof res === \"undefined\") {\r\n let params = { key, translateService: this };\r\n if (typeof interpolateParams !== 'undefined') {\r\n params.interpolateParams = interpolateParams;\r\n }\r\n res = this.missingTranslationHandler.handle(params);\r\n }\r\n return typeof res !== \"undefined\" ? res : key;\r\n }\r\n /**\r\n * Gets the translated value of a key (or an array of keys)\r\n * @returns the translated key, or an object of translated keys\r\n */\r\n get(key, interpolateParams) {\r\n if (!isDefined(key) || !key.length) {\r\n throw new Error(`Parameter \"key\" required`);\r\n }\r\n // check if we are loading a new translation to use\r\n if (this.pending) {\r\n return this.loadingTranslations.pipe(concatMap((res) => {\r\n res = this.getParsedResult(res, key, interpolateParams);\r\n return isObservable(res) ? res : of(res);\r\n }));\r\n }\r\n else {\r\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\r\n return isObservable(res) ? res : of(res);\r\n }\r\n }\r\n /**\r\n * Returns a stream of translated values of a key (or an array of keys) which updates\r\n * whenever the translation changes.\r\n * @returns A stream of the translated key, or an object of translated keys\r\n */\r\n getStreamOnTranslationChange(key, interpolateParams) {\r\n if (!isDefined(key) || !key.length) {\r\n throw new Error(`Parameter \"key\" required`);\r\n }\r\n return concat(defer(() => this.get(key, interpolateParams)), this.onTranslationChange.pipe(switchMap((event) => {\r\n const res = this.getParsedResult(event.translations, key, interpolateParams);\r\n if (typeof res.subscribe === 'function') {\r\n return res;\r\n }\r\n else {\r\n return of(res);\r\n }\r\n })));\r\n }\r\n /**\r\n * Returns a stream of translated values of a key (or an array of keys) which updates\r\n * whenever the language changes.\r\n * @returns A stream of the translated key, or an object of translated keys\r\n */\r\n stream(key, interpolateParams) {\r\n if (!isDefined(key) || !key.length) {\r\n throw new Error(`Parameter \"key\" required`);\r\n }\r\n return concat(defer(() => this.get(key, interpolateParams)), this.onLangChange.pipe(switchMap((event) => {\r\n const res = this.getParsedResult(event.translations, key, interpolateParams);\r\n return isObservable(res) ? res : of(res);\r\n })));\r\n }\r\n /**\r\n * Returns a translation instantly from the internal state of loaded translation.\r\n * All rules regarding the current language, the preferred language of even fallback languages will be used except any promise handling.\r\n */\r\n instant(key, interpolateParams) {\r\n if (!isDefined(key) || !key.length) {\r\n throw new Error(`Parameter \"key\" required`);\r\n }\r\n let res = this.getParsedResult(this.translations[this.currentLang], key, interpolateParams);\r\n if (isObservable(res)) {\r\n if (key instanceof Array) {\r\n let obj = {};\r\n key.forEach((value, index) => {\r\n obj[key[index]] = key[index];\r\n });\r\n return obj;\r\n }\r\n return key;\r\n }\r\n else {\r\n return res;\r\n }\r\n }\r\n /**\r\n * Sets the translated value of a key, after compiling it\r\n */\r\n set(key, value, lang = this.currentLang) {\r\n this.translations[lang][key] = this.compiler.compile(value, lang);\r\n this.updateLangs();\r\n this.onTranslationChange.emit({ lang: lang, translations: this.translations[lang] });\r\n }\r\n /**\r\n * Changes the current lang\r\n */\r\n changeLang(lang) {\r\n this.currentLang = lang;\r\n this.onLangChange.emit({ lang: lang, translations: this.translations[lang] });\r\n // if there is no default lang, use the one that we just set\r\n if (this.defaultLang == null) {\r\n this.changeDefaultLang(lang);\r\n }\r\n }\r\n /**\r\n * Changes the default lang\r\n */\r\n changeDefaultLang(lang) {\r\n this.defaultLang = lang;\r\n this.onDefaultLangChange.emit({ lang: lang, translations: this.translations[lang] });\r\n }\r\n /**\r\n * Allows to reload the lang file from the file\r\n */\r\n reloadLang(lang) {\r\n this.resetLang(lang);\r\n return this.getTranslation(lang);\r\n }\r\n /**\r\n * Deletes inner translation\r\n */\r\n resetLang(lang) {\r\n this._translationRequests[lang] = undefined;\r\n this.translations[lang] = undefined;\r\n }\r\n /**\r\n * Returns the language code name from the browser, e.g. \"de\"\r\n */\r\n getBrowserLang() {\r\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\r\n return undefined;\r\n }\r\n let browserLang = window.navigator.languages ? window.navigator.languages[0] : null;\r\n browserLang = browserLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\r\n if (typeof browserLang === 'undefined') {\r\n return undefined;\r\n }\r\n if (browserLang.indexOf('-') !== -1) {\r\n browserLang = browserLang.split('-')[0];\r\n }\r\n if (browserLang.indexOf('_') !== -1) {\r\n browserLang = browserLang.split('_')[0];\r\n }\r\n return browserLang;\r\n }\r\n /**\r\n * Returns the culture language code name from the browser, e.g. \"de-DE\"\r\n */\r\n getBrowserCultureLang() {\r\n if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {\r\n return undefined;\r\n }\r\n let browserCultureLang = window.navigator.languages ? window.navigator.languages[0] : null;\r\n browserCultureLang = browserCultureLang || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage;\r\n return browserCultureLang;\r\n }\r\n}\r\nTranslateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateService, deps: [{ token: TranslateStore }, { token: TranslateLoader }, { token: TranslateCompiler }, { token: TranslateParser }, { token: MissingTranslationHandler }, { token: USE_DEFAULT_LANG }, { token: USE_STORE }, { token: USE_EXTEND }, { token: DEFAULT_LANGUAGE }], target: i0.ɵɵFactoryTarget.Injectable });\r\nTranslateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateService });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateService, decorators: [{\r\n type: Injectable\r\n }], ctorParameters: function () { return [{ type: TranslateStore }, { type: TranslateLoader }, { type: TranslateCompiler }, { type: TranslateParser }, { type: MissingTranslationHandler }, { type: undefined, decorators: [{\r\n type: Inject,\r\n args: [USE_DEFAULT_LANG]\r\n }] }, { type: undefined, decorators: [{\r\n type: Inject,\r\n args: [USE_STORE]\r\n }] }, { type: undefined, decorators: [{\r\n type: Inject,\r\n args: [USE_EXTEND]\r\n }] }, { type: undefined, decorators: [{\r\n type: Inject,\r\n args: [DEFAULT_LANGUAGE]\r\n }] }]; } });\n\nclass TranslateDirective {\r\n constructor(translateService, element, _ref) {\r\n this.translateService = translateService;\r\n this.element = element;\r\n this._ref = _ref;\r\n // subscribe to onTranslationChange event, in case the translations of the current lang change\r\n if (!this.onTranslationChangeSub) {\r\n this.onTranslationChangeSub = this.translateService.onTranslationChange.subscribe((event) => {\r\n if (event.lang === this.translateService.currentLang) {\r\n this.checkNodes(true, event.translations);\r\n }\r\n });\r\n }\r\n // subscribe to onLangChange event, in case the language changes\r\n if (!this.onLangChangeSub) {\r\n this.onLangChangeSub = this.translateService.onLangChange.subscribe((event) => {\r\n this.checkNodes(true, event.translations);\r\n });\r\n }\r\n // subscribe to onDefaultLangChange event, in case the default language changes\r\n if (!this.onDefaultLangChangeSub) {\r\n this.onDefaultLangChangeSub = this.translateService.onDefaultLangChange.subscribe((event) => {\r\n this.checkNodes(true);\r\n });\r\n }\r\n }\r\n set translate(key) {\r\n if (key) {\r\n this.key = key;\r\n this.checkNodes();\r\n }\r\n }\r\n set translateParams(params) {\r\n if (!equals(this.currentParams, params)) {\r\n this.currentParams = params;\r\n this.checkNodes(true);\r\n }\r\n }\r\n ngAfterViewChecked() {\r\n this.checkNodes();\r\n }\r\n checkNodes(forceUpdate = false, translations) {\r\n let nodes = this.element.nativeElement.childNodes;\r\n // if the element is empty\r\n if (!nodes.length) {\r\n // we add the key as content\r\n this.setContent(this.element.nativeElement, this.key);\r\n nodes = this.element.nativeElement.childNodes;\r\n }\r\n for (let i = 0; i < nodes.length; ++i) {\r\n let node = nodes[i];\r\n if (node.nodeType === 3) { // node type 3 is a text node\r\n let key;\r\n if (forceUpdate) {\r\n node.lastKey = null;\r\n }\r\n if (isDefined(node.lookupKey)) {\r\n key = node.lookupKey;\r\n }\r\n else if (this.key) {\r\n key = this.key;\r\n }\r\n else {\r\n let content = this.getContent(node);\r\n let trimmedContent = content.trim();\r\n if (trimmedContent.length) {\r\n node.lookupKey = trimmedContent;\r\n // we want to use the content as a key, not the translation value\r\n if (content !== node.currentValue) {\r\n key = trimmedContent;\r\n // the content was changed from the user, we'll use it as a reference if needed\r\n node.originalContent = content || node.originalContent;\r\n }\r\n else if (node.originalContent) { // the content seems ok, but the lang has changed\r\n // the current content is the translation, not the key, use the last real content as key\r\n key = node.originalContent.trim();\r\n }\r\n else if (content !== node.currentValue) {\r\n // we want to use the content as a key, not the translation value\r\n key = trimmedContent;\r\n // the content was changed from the user, we'll use it as a reference if needed\r\n node.originalContent = content || node.originalContent;\r\n }\r\n }\r\n }\r\n this.updateValue(key, node, translations);\r\n }\r\n }\r\n }\r\n updateValue(key, node, translations) {\r\n if (key) {\r\n if (node.lastKey === key && this.lastParams === this.currentParams) {\r\n return;\r\n }\r\n this.lastParams = this.currentParams;\r\n let onTranslation = (res) => {\r\n if (res !== key) {\r\n node.lastKey = key;\r\n }\r\n if (!node.originalContent) {\r\n node.originalContent = this.getContent(node);\r\n }\r\n node.currentValue = isDefined(res) ? res : (node.originalContent || key);\r\n // we replace in the original content to preserve spaces that we might have trimmed\r\n this.setContent(node, this.key ? node.currentValue : node.originalContent.replace(key, node.currentValue));\r\n this._ref.markForCheck();\r\n };\r\n if (isDefined(translations)) {\r\n let res = this.translateService.getParsedResult(translations, key, this.currentParams);\r\n if (isObservable(res)) {\r\n res.subscribe({ next: onTranslation });\r\n }\r\n else {\r\n onTranslation(res);\r\n }\r\n }\r\n else {\r\n this.translateService.get(key, this.currentParams).subscribe(onTranslation);\r\n }\r\n }\r\n }\r\n getContent(node) {\r\n return isDefined(node.textContent) ? node.textContent : node.data;\r\n }\r\n setContent(node, content) {\r\n if (isDefined(node.textContent)) {\r\n node.textContent = content;\r\n }\r\n else {\r\n node.data = content;\r\n }\r\n }\r\n ngOnDestroy() {\r\n if (this.onLangChangeSub) {\r\n this.onLangChangeSub.unsubscribe();\r\n }\r\n if (this.onDefaultLangChangeSub) {\r\n this.onDefaultLangChangeSub.unsubscribe();\r\n }\r\n if (this.onTranslationChangeSub) {\r\n this.onTranslationChangeSub.unsubscribe();\r\n }\r\n }\r\n}\r\nTranslateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateDirective, deps: [{ token: TranslateService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });\r\nTranslateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"12.0.0\", version: \"13.0.0\", type: TranslateDirective, selector: \"[translate],[ngx-translate]\", inputs: { translate: \"translate\", translateParams: \"translateParams\" }, ngImport: i0 });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateDirective, decorators: [{\r\n type: Directive,\r\n args: [{\r\n selector: '[translate],[ngx-translate]'\r\n }]\r\n }], ctorParameters: function () { return [{ type: TranslateService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { translate: [{\r\n type: Input\r\n }], translateParams: [{\r\n type: Input\r\n }] } });\n\nclass TranslatePipe {\r\n constructor(translate, _ref) {\r\n this.translate = translate;\r\n this._ref = _ref;\r\n this.value = '';\r\n this.lastKey = null;\r\n this.lastParams = [];\r\n }\r\n updateValue(key, interpolateParams, translations) {\r\n let onTranslation = (res) => {\r\n this.value = res !== undefined ? res : key;\r\n this.lastKey = key;\r\n this._ref.markForCheck();\r\n };\r\n if (translations) {\r\n let res = this.translate.getParsedResult(translations, key, interpolateParams);\r\n if (isObservable(res.subscribe)) {\r\n res.subscribe(onTranslation);\r\n }\r\n else {\r\n onTranslation(res);\r\n }\r\n }\r\n this.translate.get(key, interpolateParams).subscribe(onTranslation);\r\n }\r\n transform(query, ...args) {\r\n if (!query || !query.length) {\r\n return query;\r\n }\r\n // if we ask another time for the same key, return the last value\r\n if (equals(query, this.lastKey) && equals(args, this.lastParams)) {\r\n return this.value;\r\n }\r\n let interpolateParams = undefined;\r\n if (isDefined(args[0]) && args.length) {\r\n if (typeof args[0] === 'string' && args[0].length) {\r\n // we accept objects written in the template such as {n:1}, {'n':1}, {n:'v'}\r\n // which is why we might need to change it to real JSON objects such as {\"n\":1} or {\"n\":\"v\"}\r\n let validArgs = args[0]\r\n .replace(/(\\')?([a-zA-Z0-9_]+)(\\')?(\\s)?:/g, '\"$2\":')\r\n .replace(/:(\\s)?(\\')(.*?)(\\')/g, ':\"$3\"');\r\n try {\r\n interpolateParams = JSON.parse(validArgs);\r\n }\r\n catch (e) {\r\n throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${args[0]}`);\r\n }\r\n }\r\n else if (typeof args[0] === 'object' && !Array.isArray(args[0])) {\r\n interpolateParams = args[0];\r\n }\r\n }\r\n // store the query, in case it changes\r\n this.lastKey = query;\r\n // store the params, in case they change\r\n this.lastParams = args;\r\n // set the value\r\n this.updateValue(query, interpolateParams);\r\n // if there is a subscription to onLangChange, clean it\r\n this._dispose();\r\n // subscribe to onTranslationChange event, in case the translations change\r\n if (!this.onTranslationChange) {\r\n this.onTranslationChange = this.translate.onTranslationChange.subscribe((event) => {\r\n if (this.lastKey && event.lang === this.translate.currentLang) {\r\n this.lastKey = null;\r\n this.updateValue(query, interpolateParams, event.translations);\r\n }\r\n });\r\n }\r\n // subscribe to onLangChange event, in case the language changes\r\n if (!this.onLangChange) {\r\n this.onLangChange = this.translate.onLangChange.subscribe((event) => {\r\n if (this.lastKey) {\r\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\r\n this.updateValue(query, interpolateParams, event.translations);\r\n }\r\n });\r\n }\r\n // subscribe to onDefaultLangChange event, in case the default language changes\r\n if (!this.onDefaultLangChange) {\r\n this.onDefaultLangChange = this.translate.onDefaultLangChange.subscribe(() => {\r\n if (this.lastKey) {\r\n this.lastKey = null; // we want to make sure it doesn't return the same value until it's been updated\r\n this.updateValue(query, interpolateParams);\r\n }\r\n });\r\n }\r\n return this.value;\r\n }\r\n /**\r\n * Clean any existing subscription to change events\r\n */\r\n _dispose() {\r\n if (typeof this.onTranslationChange !== 'undefined') {\r\n this.onTranslationChange.unsubscribe();\r\n this.onTranslationChange = undefined;\r\n }\r\n if (typeof this.onLangChange !== 'undefined') {\r\n this.onLangChange.unsubscribe();\r\n this.onLangChange = undefined;\r\n }\r\n if (typeof this.onDefaultLangChange !== 'undefined') {\r\n this.onDefaultLangChange.unsubscribe();\r\n this.onDefaultLangChange = undefined;\r\n }\r\n }\r\n ngOnDestroy() {\r\n this._dispose();\r\n }\r\n}\r\nTranslatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslatePipe, deps: [{ token: TranslateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });\r\nTranslatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslatePipe, name: \"translate\", pure: false });\r\nTranslatePipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslatePipe });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslatePipe, decorators: [{\r\n type: Injectable\r\n }, {\r\n type: Pipe,\r\n args: [{\r\n name: 'translate',\r\n pure: false // required to update the value when the promise is resolved\r\n }]\r\n }], ctorParameters: function () { return [{ type: TranslateService }, { type: i0.ChangeDetectorRef }]; } });\n\nclass TranslateModule {\r\n /**\r\n * Use this method in your root module to provide the TranslateService\r\n */\r\n static forRoot(config = {}) {\r\n return {\r\n ngModule: TranslateModule,\r\n providers: [\r\n config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader },\r\n config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler },\r\n config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser },\r\n config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler },\r\n TranslateStore,\r\n { provide: USE_STORE, useValue: config.isolate },\r\n { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang },\r\n { provide: USE_EXTEND, useValue: config.extend },\r\n { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage },\r\n TranslateService\r\n ]\r\n };\r\n }\r\n /**\r\n * Use this method in your other (non root) modules to import the directive/pipe\r\n */\r\n static forChild(config = {}) {\r\n return {\r\n ngModule: TranslateModule,\r\n providers: [\r\n config.loader || { provide: TranslateLoader, useClass: TranslateFakeLoader },\r\n config.compiler || { provide: TranslateCompiler, useClass: TranslateFakeCompiler },\r\n config.parser || { provide: TranslateParser, useClass: TranslateDefaultParser },\r\n config.missingTranslationHandler || { provide: MissingTranslationHandler, useClass: FakeMissingTranslationHandler },\r\n { provide: USE_STORE, useValue: config.isolate },\r\n { provide: USE_DEFAULT_LANG, useValue: config.useDefaultLang },\r\n { provide: USE_EXTEND, useValue: config.extend },\r\n { provide: DEFAULT_LANGUAGE, useValue: config.defaultLanguage },\r\n TranslateService\r\n ]\r\n };\r\n }\r\n}\r\nTranslateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\r\nTranslateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateModule, declarations: [TranslatePipe,\r\n TranslateDirective], exports: [TranslatePipe,\r\n TranslateDirective] });\r\nTranslateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateModule });\r\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"13.0.0\", ngImport: i0, type: TranslateModule, decorators: [{\r\n type: NgModule,\r\n args: [{\r\n declarations: [\r\n TranslatePipe,\r\n TranslateDirective\r\n ],\r\n exports: [\r\n TranslatePipe,\r\n TranslateDirective\r\n ]\r\n }]\r\n }] });\n\n/**\r\n * Generated bundle index. Do not edit.\r\n */\n\nexport { DEFAULT_LANGUAGE, FakeMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateDirective, TranslateFakeCompiler, TranslateFakeLoader, TranslateLoader, TranslateModule, TranslateParser, TranslatePipe, TranslateService, TranslateStore, USE_DEFAULT_LANG, USE_EXTEND, USE_STORE };\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OperatorFunction } from '../types';\n\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * \n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * ## Example\n * Map every click to the string 'Hi'\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { mapTo } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const greetings = clicks.pipe(mapTo('Hi'));\n * greetings.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nexport function mapTo<T, R>(value: R): OperatorFunction<T, R> {\n return (source: Observable<T>) => source.lift(new MapToOperator(value));\n}\n\nclass MapToOperator<T, R> implements Operator<T, R> {\n\n value: R;\n\n constructor(value: R) {\n this.value = value;\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass MapToSubscriber<T, R> extends Subscriber<T> {\n\n value: R;\n\n constructor(destination: Subscriber<R>, value: R) {\n super(destination);\n this.value = value;\n }\n\n protected _next(x: T) {\n this.destination.next(this.value);\n }\n}\n","/**\n * Copyright (c) 2017-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst getTinymce = () => {\n const w = typeof window !== 'undefined' ? (window as any) : undefined;\n return w && w.tinymce ? w.tinymce : null;\n};\n\nexport { getTinymce };\n","import { Output, EventEmitter, Directive } from '@angular/core';\nimport { Editor as TinyMCEEditor } from 'tinymce';\n\nexport interface EventObj<T> {\n event: T;\n editor: TinyMCEEditor;\n}\n\n@Directive()\nexport class Events {\n @Output() public onBeforePaste: EventEmitter<EventObj<ClipboardEvent>> = new EventEmitter();\n @Output() public onBlur: EventEmitter<EventObj<FocusEvent>> = new EventEmitter();\n @Output() public onClick: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onContextMenu: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onCopy: EventEmitter<EventObj<ClipboardEvent>> = new EventEmitter();\n @Output() public onCut: EventEmitter<EventObj<ClipboardEvent>> = new EventEmitter();\n @Output() public onDblclick: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onDrag: EventEmitter<EventObj<DragEvent>> = new EventEmitter();\n @Output() public onDragDrop: EventEmitter<EventObj<DragEvent>> = new EventEmitter();\n @Output() public onDragEnd: EventEmitter<EventObj<DragEvent>> = new EventEmitter();\n @Output() public onDragGesture: EventEmitter<EventObj<DragEvent>> = new EventEmitter();\n @Output() public onDragOver: EventEmitter<EventObj<DragEvent>> = new EventEmitter();\n @Output() public onDrop: EventEmitter<EventObj<DragEvent>> = new EventEmitter();\n @Output() public onFocus: EventEmitter<EventObj<FocusEvent>> = new EventEmitter();\n @Output() public onFocusIn: EventEmitter<EventObj<FocusEvent>> = new EventEmitter();\n @Output() public onFocusOut: EventEmitter<EventObj<FocusEvent>> = new EventEmitter();\n @Output() public onKeyDown: EventEmitter<EventObj<KeyboardEvent>> = new EventEmitter();\n @Output() public onKeyPress: EventEmitter<EventObj<KeyboardEvent>> = new EventEmitter();\n @Output() public onKeyUp: EventEmitter<EventObj<KeyboardEvent>> = new EventEmitter();\n @Output() public onMouseDown: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onMouseEnter: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onMouseLeave: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onMouseMove: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onMouseOut: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onMouseOver: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onMouseUp: EventEmitter<EventObj<MouseEvent>> = new EventEmitter();\n @Output() public onPaste: EventEmitter<EventObj<ClipboardEvent>> = new EventEmitter();\n @Output() public onSelectionChange: EventEmitter<EventObj<Event>> = new EventEmitter();\n @Output() public onActivate: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onAddUndo: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onBeforeAddUndo: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onBeforeExecCommand: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onBeforeGetContent: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onBeforeRenderUI: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onBeforeSetContent: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onChange: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onClearUndos: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onDeactivate: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onDirty: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onExecCommand: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onGetContent: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onHide: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onInit: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onInitNgModel: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onLoadContent: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onNodeChange: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onPostProcess: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onPostRender: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onPreInit: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onPreProcess: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onProgressState: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onRedo: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onRemove: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onReset: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onResizeEditor: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onSaveContent: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onSetAttrib: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onObjectResizeStart: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onObjectResized: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onObjectSelected: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onSetContent: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onShow: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onSubmit: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onUndo: EventEmitter<EventObj<any>> = new EventEmitter();\n @Output() public onVisualAid: EventEmitter<EventObj<any>> = new EventEmitter();\n}\n\nexport const validEvents: (keyof Events)[] = [\n 'onActivate',\n 'onAddUndo',\n 'onBeforeAddUndo',\n 'onBeforeExecCommand',\n 'onBeforeGetContent',\n 'onBeforeRenderUI',\n 'onBeforeSetContent',\n 'onBeforePaste',\n 'onBlur',\n 'onChange',\n 'onClearUndos',\n 'onClick',\n 'onContextMenu',\n 'onCopy',\n 'onCut',\n 'onDblclick',\n 'onDeactivate',\n 'onDirty',\n 'onDrag',\n 'onDragDrop',\n 'onDragEnd',\n 'onDragGesture',\n 'onDragOver',\n 'onDrop',\n 'onExecCommand',\n 'onFocus',\n 'onFocusIn',\n 'onFocusOut',\n 'onGetContent',\n 'onHide',\n 'onInit',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onLoadContent',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onNodeChange',\n 'onObjectResizeStart',\n 'onObjectResized',\n 'onObjectSelected',\n 'onPaste',\n 'onPostProcess',\n 'onPostRender',\n 'onPreProcess',\n 'onProgressState',\n 'onRedo',\n 'onRemove',\n 'onReset',\n 'onResizeEditor',\n 'onSaveContent',\n 'onSelectionChange',\n 'onSetAttrib',\n 'onSetContent',\n 'onShow',\n 'onSubmit',\n 'onUndo',\n 'onVisualAid'\n];\n","/**\n * Copyright (c) 2017-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { EventEmitter } from '@angular/core';\nimport { fromEvent, Subject } from 'rxjs';\nimport { HasEventTargetAddRemove } from 'rxjs/internal/observable/fromEvent';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { EditorComponent } from '../editor/editor.component';\nimport { validEvents, Events } from '../editor/Events';\n\n// Caretaker note: `fromEvent` supports passing JQuery-style event targets, the editor has `on` and `off` methods which\n// will be invoked upon subscription and teardown.\nconst listenTinyMCEEvent = (\n editor: any,\n eventName: string,\n destroy$: Subject<void>\n) => fromEvent(editor as HasEventTargetAddRemove<unknown> | ArrayLike<HasEventTargetAddRemove<unknown>>, eventName).pipe(takeUntil(destroy$));\n\nconst bindHandlers = (ctx: EditorComponent, editor: any, destroy$: Subject<void>): void => {\n const allowedEvents = getValidEvents(ctx);\n allowedEvents.forEach((eventName) => {\n const eventEmitter: EventEmitter<any> = ctx[eventName];\n\n listenTinyMCEEvent(editor, eventName.substring(2), destroy$).subscribe((event) => {\n // Caretaker note: `ngZone.run()` runs change detection since it notifies the forked Angular zone that it's\n // being re-entered. We don't want to run `ApplicationRef.tick()` if anyone listens to the specific event\n // within the template. E.g. if the `onSelectionChange` is not listened within the template like:\n // `<editor (onSelectionChange)=\"...\"></editor>`\n // then its `observers` array will be empty, and we won't run \"dead\" change detection.\n if (eventEmitter.observers.length > 0) {\n ctx.ngZone.run(() => eventEmitter.emit({ event, editor }));\n }\n });\n });\n};\n\nconst getValidEvents = (ctx: EditorComponent): (keyof Events)[] => {\n const ignoredEvents = parseStringProperty(ctx.ignoreEvents, []);\n const allowedEvents = parseStringProperty(ctx.allowedEvents, validEvents).filter(\n (event) => validEvents.includes(event as (keyof Events)) && !ignoredEvents.includes(event)) as (keyof Events)[];\n return allowedEvents;\n};\n\nconst parseStringProperty = (property: string | string[] | undefined, defaultValue: (keyof Events)[]): string[] => {\n if ( typeof property === 'string') {\n return property.split(',').map((value) => value.trim());\n }\n if ( Array.isArray(property)) {\n return property;\n }\n return defaultValue;\n};\n\nlet unique = 0;\n\nconst uuid = (prefix: string): string => {\n const date = new Date();\n const time = date.getTime();\n const random = Math.floor(Math.random() * 1000000000);\n\n unique++;\n\n return prefix + '_' + random + unique + String(time);\n};\n\nconst isTextarea = (element?: Element): element is HTMLTextAreaElement => typeof element !== 'undefined' && element.tagName.toLowerCase() === 'textarea';\n\nconst normalizePluginArray = (plugins?: string | string[]): string[] => {\n if (typeof plugins === 'undefined' || plugins === '') {\n return [];\n }\n\n return Array.isArray(plugins) ? plugins : plugins.split(' ');\n};\n\nconst mergePlugins = (initPlugins: string | string[], inputPlugins?: string | string[]) =>\n normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop: (...args: any[]) => void = () => { };\n\nconst isNullOrUndefined = (value: any): value is null | undefined => value === null || value === undefined;\n\nexport {\n listenTinyMCEEvent,\n bindHandlers,\n uuid,\n isTextarea,\n normalizePluginArray,\n mergePlugins,\n noop,\n isNullOrUndefined\n};\n","/**\n * Copyright (c) 2017-present, Ephox, Inc.\n *\n * This source code is licensed under the Apache 2 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { defer, fromEvent, Observable, OperatorFunction } from 'rxjs';\nimport { mapTo, shareReplay, take } from 'rxjs/operators';\n\nexport interface IStateObj {\n script$: Observable<void> | null;\n}\n\nconst createState = (): IStateObj => ({\n script$: null,\n});\n\ninterface ScriptLoader {\n load: (doc: Document, url: string) => Observable<void>;\n reinitialize: () => void;\n}\n\nconst CreateScriptLoader = (): ScriptLoader => {\n let state = createState();\n\n const load = (doc: Document, url: string) => (\n state.script$ ||\n // Caretaker note: the `script$` is a multicast observable since it's piped with `shareReplay`,\n // so if there're multiple editor components simultaneously on the page, they'll subscribe to the internal\n // `ReplaySubject`. The script will be loaded only once, and `ReplaySubject` will cache the result.\n (state.script$ = defer(() => {\n const scriptTag = doc.createElement('script');\n scriptTag.referrerPolicy = 'origin';\n scriptTag.type = 'application/javascript';\n scriptTag.src = url;\n doc.head.appendChild(scriptTag);\n return fromEvent(scriptTag, 'load').pipe(take(1), mapTo(undefined) as OperatorFunction<Event, undefined>);\n }).pipe(shareReplay({ bufferSize: 1, refCount: true })))\n );\n\n // Only to be used by tests.\n const reinitialize = () => {\n state = createState();\n };\n\n return {\n load,\n reinitialize,\n };\n};\n\nconst ScriptLoader = CreateScriptLoader();\n\nexport { ScriptLoader };\n","/* eslint-disable @typescript-eslint/no-parameter-properties */\nimport { isPlatformBrowser, CommonModule } from '@angular/common';\nimport { AfterViewInit, Component, ElementRef, forwardRef, Inject, Input, NgZone, OnDestroy, PLATFORM_ID, InjectionToken, Optional } from '@angular/core';\nimport { FormsModule, ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { getTinymce } from '../TinyMCE';\nimport { listenTinyMCEEvent, bindHandlers, isTextarea, mergePlugins, uuid, noop, isNullOrUndefined } from '../utils/Utils';\nimport { EventObj, Events } from './Events';\nimport { ScriptLoader } from '../utils/ScriptLoader';\nimport { Editor as TinyMCEEditor, TinyMCE } from 'tinymce';\n\ntype EditorOptions = Parameters<TinyMCE['init']>[0];\n\nexport const TINYMCE_SCRIPT_SRC = new InjectionToken<string>('TINYMCE_SCRIPT_SRC');\n\nconst EDITOR_COMPONENT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => EditorComponent),\n multi: true\n};\n\n@Component({\n selector: 'editor',\n template: '<ng-template></ng-template>',\n styles: [ ':host { display: block; }' ],\n providers: [ EDITOR_COMPONENT_VALUE_ACCESSOR ],\n standalone: true,\n imports: [ CommonModule, FormsModule ]\n})\nexport class EditorComponent extends Events implements AfterViewInit, ControlValueAccessor, OnDestroy {\n\n @Input() public cloudChannel = '6';\n @Input() public apiKey = 'no-api-key';\n @Input() public init: EditorOptions | undefined;\n @Input() public id = '';\n @Input() public initialValue: string | undefined;\n @Input() public outputFormat: 'html' | 'text' | undefined;\n @Input() public inline: boolean | undefined;\n @Input() public tagName: string | undefined;\n @Input() public plugins: string | undefined;\n @Input() public toolbar: string | string[] | undefined;\n @Input() public modelEvents = 'change input undo redo';\n @Input() public allowedEvents: string | string[] | undefined;\n @Input() public ignoreEvents: string | string[] | undefined;\n @Input()\n public set disabled(val) {\n this._disabled = val;\n if (this._editor && this._editor.initialized) {\n if (typeof this._editor.mode?.set === 'function') {\n this._editor.mode.set(val ? 'readonly' : 'design');\n } else {\n this._editor.setMode(val ? 'readonly' : 'design');\n }\n }\n }\n\n public get disabled() {\n return this._disabled;\n }\n\n public get editor() {\n return this._editor;\n }\n\n public ngZone: NgZone;\n\n private _elementRef: ElementRef;\n private _element: HTMLElement | undefined;\n private _disabled: boolean | undefined;\n private _editor: TinyMCEEditor | undefined;\n\n private onTouchedCallback = noop;\n private onChangeCallback: any;\n\n private destroy$ = new Subject<void>();\n\n public constructor(\n elementRef: ElementRef,\n ngZone: NgZone,\n @Inject(PLATFORM_ID) private platformId: Object,\n @Optional() @Inject(TINYMCE_SCRIPT_SRC) private tinymceScriptSrc?: string\n ) {\n super();\n this._elementRef = elementRef;\n this.ngZone = ngZone;\n }\n\n public writeValue(value: string | null): void {\n if (this._editor && this._editor.initialized) {\n this._editor.setContent(isNullOrUndefined(value) ? '' : value);\n } else {\n this.initialValue = value === null ? undefined : value;\n }\n }\n\n public registerOnChange(fn: (_: any) => void): void {\n this.onChangeCallback = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouchedCallback = fn;\n }\n\n public setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n public ngAfterViewInit() {\n if (isPlatformBrowser(this.platformId)) {\n this.id = this.id || uuid('tiny-angular');\n this.inline = this.inline !== undefined ? this.inline !== false : !!(this.init?.inline);\n this.createElement();\n if (getTinymce() !== null) {\n this.initialise();\n } else if (this._element && this._element.ownerDocument) {\n // Caretaker note: the component might be destroyed before the script is loaded and its code is executed.\n // This will lead to runtime exceptions if `initialise` will be called when the component has been destroyed.\n ScriptLoader.load(this._element.ownerDocument, this.getScriptSrc())\n .pipe(takeUntil(this.destroy$))\n .subscribe(this.initialise);\n }\n }\n }\n\n public ngOnDestroy() {\n this.destroy$.next();\n\n if (getTinymce() !== null) {\n getTinymce().remove(this._editor);\n }\n }\n\n public createElement() {\n const tagName = typeof this.tagName === 'string' ? this.tagName : 'div';\n this._element = document.createElement(this.inline ? tagName : 'textarea');\n if (this._element) {\n if (document.getElementById(this.id)) {\n /* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n console.warn(`TinyMCE-Angular: an element with id [${this.id}] already exists. Editors with duplicate Id will not be able to mount`);\n }\n this._element.id = this.id;\n if (isTextarea(this._element)) {\n this._element.style.visibility = 'hidden';\n }\n this._elementRef.nativeElement.appendChild(this._element);\n }\n }\n\n public initialise = (): void => {\n const finalInit: EditorOptions = {\n ...this.init,\n selector: undefined,\n target: this._element,\n inline: this.inline,\n readonly: this.disabled,\n plugins: mergePlugins((this.init && this.init.plugins) as string, this.plugins),\n toolbar: this.toolbar || (this.init && this.init.toolbar),\n setup: (editor: TinyMCEEditor) => {\n this._editor = editor;\n\n listenTinyMCEEvent(editor, 'init', this.destroy$).subscribe(() => {\n this.initEditor(editor);\n });\n\n bindHandlers(this, editor, this.destroy$);\n\n if (this.init && typeof this.init.setup === 'function') {\n this.init.setup(editor);\n }\n }\n };\n\n if (isTextarea(this._element)) {\n this._element.style.visibility = '';\n }\n\n this.ngZone.runOutsideAngular(() => {\n getTinymce().init(finalInit);\n });\n };\n\n private getScriptSrc() {\n return isNullOrUndefined(this.tinymceScriptSrc) ?\n `https://cdn.tiny.cloud/1/${this.apiKey}/tinymce/${this.cloudChannel}/tinymce.min.js` :\n this.tinymceScriptSrc;\n }\n\n private initEditor(editor: TinyMCEEditor) {\n listenTinyMCEEvent(editor, 'blur', this.destroy$).subscribe(() => {\n this.ngZone.run(() => this.onTouchedCallback());\n });\n\n listenTinyMCEEvent(editor, this.modelEvents, this.destroy$).subscribe(() => {\n this.ngZone.run(() => this.emitOnChange(editor));\n });\n\n if (typeof this.initialValue === 'string') {\n this.ngZone.run(() => {\n editor.setContent(this.initialValue as string);\n if (editor.getContent() !== this.initialValue) {\n this.emitOnChange(editor);\n }\n if (this.onInitNgModel !== undefined) {\n this.onInitNgModel.emit(editor as unknown as EventObj<any>);\n }\n });\n }\n }\n\n private emitOnChange(editor: TinyMCEEditor) {\n if (this.onChangeCallback) {\n this.onChangeCallback(editor.getContent({ format: this.outputFormat }));\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { EditorComponent } from './editor.component';\n\n@NgModule({\n imports: [ EditorComponent ],\n exports: [ EditorComponent ]\n})\nexport class EditorModule {}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/**\n * @copyright Valor Software\n * @copyright Angular ng-bootstrap team\n */\n\nexport class Trigger {\n open: string;\n close?: string;\n\n constructor(open: string, close?: string) {\n this.open = open;\n this.close = close || open;\n }\n\n isManual(): boolean {\n return this.open === 'manual' || this.close === 'manual';\n }\n}\n","/**\n * @copyright Valor Software\n * @copyright Angular ng-bootstrap team\n */\nimport { Renderer2 } from '@angular/core';\nimport { Trigger } from './trigger.class';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type BsEventCallback = (event?: any) => boolean | void;\n\nexport interface ListenOptions {\n target?: HTMLElement;\n targets?: HTMLElement[];\n triggers?: string;\n outsideClick?: boolean;\n outsideEsc?: boolean;\n show?: BsEventCallback;\n hide?: BsEventCallback;\n toggle?: BsEventCallback;\n}\n\nconst DEFAULT_ALIASES = {\n hover: ['mouseover', 'mouseout'],\n focus: ['focusin', 'focusout']\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function parseTriggers(triggers?: string, aliases: any = DEFAULT_ALIASES): Trigger[] {\n const trimmedTriggers = (triggers || '').trim();\n\n if (trimmedTriggers.length === 0) {\n return [];\n }\n\n const parsedTriggers = trimmedTriggers\n .split(/\\s+/)\n .map((trigger: string) => trigger.split(':'))\n .map((triggerPair: string[]) => {\n const alias = aliases[triggerPair[0]] || triggerPair;\n\n return new Trigger(alias[0], alias[1]);\n });\n\n const manualTriggers = parsedTriggers.filter((triggerPair: Trigger) =>\n triggerPair.isManual()\n );\n\n if (manualTriggers.length > 1) {\n throw new Error('Triggers parse error: only one manual trigger is allowed');\n }\n\n if (manualTriggers.length === 1 && parsedTriggers.length > 1) {\n throw new Error('Triggers parse error: manual trigger can\\'t be mixed with other triggers');\n }\n\n return parsedTriggers;\n}\n\nexport function listenToTriggers(renderer: Renderer2,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target: any,\n triggers: string,\n showFn: BsEventCallback,\n hideFn: BsEventCallback,\n toggleFn: BsEventCallback): () => void {\n const parsedTriggers = parseTriggers(triggers);\n const listeners: Array<() => void> = [];\n\n if (parsedTriggers.length === 1 && parsedTriggers[0].isManual()) {\n return Function.prototype as () => void;\n }\n\n parsedTriggers.forEach((trigger: Trigger) => {\n if (trigger.open === trigger.close) {\n listeners.push(renderer.listen(target, trigger.open, toggleFn));\n\n return;\n }\n\n listeners.push(renderer.listen(target, trigger.open, showFn));\n if (trigger.close) {\n listeners.push(renderer.listen(target, trigger.close, hideFn));\n }\n });\n\n return () => {\n listeners.forEach((unsubscribeFn) => unsubscribeFn());\n };\n}\n\nexport function listenToTriggersV2(renderer: Renderer2,\n options: ListenOptions): () => void {\n const parsedTriggers = parseTriggers(options.triggers);\n const target = options.target;\n // do nothing\n if (parsedTriggers.length === 1 && parsedTriggers[0].isManual()) {\n return Function.prototype as () => void;\n }\n\n // all listeners\n const listeners: Array<() => void> = [];\n\n // lazy listeners registration\n const _registerHide: Array<() => () => void> = [];\n const registerHide = () => {\n // add hide listeners to unregister array\n _registerHide.forEach((fn) => listeners.push(fn()));\n // register hide events only once\n _registerHide.length = 0;\n };\n\n // register open\\close\\toggle listeners\n parsedTriggers.forEach((trigger: Trigger) => {\n const useToggle = trigger.open === trigger.close;\n const showFn = useToggle ? options.toggle : options.show;\n\n if (!useToggle && trigger.close && options.hide) {\n const _hide = renderer.listen(target, trigger.close, options.hide);\n _registerHide.push(() => _hide);\n }\n\n if (showFn) {\n listeners.push(renderer.listen(target, trigger.open, () => showFn(registerHide)));\n }\n });\n\n return () => {\n listeners.forEach((unsubscribeFn: () => void) => unsubscribeFn());\n };\n}\n\nexport function registerOutsideClick(renderer: Renderer2,\n options: ListenOptions) {\n if (!options.outsideClick) {\n return Function.prototype;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return renderer.listen('document', 'click', (event: any) => {\n if (options.target && options.target.contains(event.target)) {\n return;\n }\n if (\n options.targets &&\n options.targets.some(target => target.contains(event.target))\n ) {\n return;\n }\n\n if (options.hide) {\n options.hide();\n }\n });\n}\n\nexport function registerEscClick(renderer: Renderer2,\n options: ListenOptions) {\n if (!options.outsideEsc) {\n return Function.prototype;\n }\n\n return renderer.listen('document', 'keyup.esc', (event) => {\n if (options.target && options.target.contains(event.target)) {\n return;\n }\n if (\n options.targets &&\n options.targets.some(target => target.contains(event.target))\n ) {\n return;\n }\n\n if (options.hide) {\n options.hide();\n }\n });\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * JS version of browser APIs. This library can only run in the browser.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst win = (typeof window !== 'undefined' && window) || {} as any;\n\nexport { win as window };\nexport const document = win.document;\nexport const location = win.location;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const gc = win.gc ? () => win.gc() : (): any => null;\nexport const performance = win.performance ? win.performance : null;\nexport const Event = win.Event;\nexport const MouseEvent = win.MouseEvent;\nexport const KeyboardEvent = win.KeyboardEvent;\nexport const EventTarget = win.EventTarget;\nexport const History = win.History;\nexport const Location = win.Location;\nexport const EventListener = win.EventListener;\n","import { window } from './facade/browser';\n\nexport type AvailableBsVersions = 'bs3' | 'bs4' | 'bs5';\n\ninterface IObjectKeys {\n [key: string]: boolean;\n}\n\nexport interface IBsVersion extends IObjectKeys{\n isBs3: boolean;\n isBs4: boolean;\n isBs5: boolean;\n}\n\nexport enum BsVerions {\n isBs3 = 'bs3',\n isBs4 = 'bs4',\n isBs5 = 'bs5'\n}\n\nlet guessedVersion: AvailableBsVersions;\n\nfunction _guessBsVersion(): AvailableBsVersions {\n if (typeof window.document === 'undefined') {\n return 'bs4';\n }\n const spanEl = window.document.createElement('span');\n spanEl.innerText = 'testing bs version';\n spanEl.classList.add('d-none');\n spanEl.classList.add('pl-1');\n window.document.head.appendChild(spanEl);\n const rect = spanEl.getBoundingClientRect();\n const checkPadding = window.getComputedStyle(spanEl).paddingLeft;\n if (!rect || (rect && rect.top !== 0)) {\n window.document.head.removeChild(spanEl);\n return 'bs3';\n }\n\n if (checkPadding && parseFloat(checkPadding)) {\n window.document.head.removeChild(spanEl);\n return 'bs4';\n }\n\n window.document.head.removeChild(spanEl);\n return 'bs5';\n}\n\nexport function setTheme(theme: AvailableBsVersions): void {\n guessedVersion = theme;\n}\n\n// todo: in ngx-bootstrap, bs4 will became a default one\nexport function isBs3(): boolean {\n if (typeof window === 'undefined') {\n return true;\n }\n\n if (typeof window.__theme === 'undefined') {\n if (guessedVersion) {\n return guessedVersion === 'bs3';\n }\n guessedVersion = _guessBsVersion();\n\n return guessedVersion === 'bs3';\n }\n\n return window.__theme === 'bs3';\n}\n\nexport function isBs4(): boolean {\n if (isBs3()) return false;\n\n if (guessedVersion) return guessedVersion === 'bs4';\n\n guessedVersion = _guessBsVersion();\n return guessedVersion === 'bs4';\n}\n\nexport function isBs5(): boolean {\n if (isBs3() || isBs4()) return false;\n\n if (guessedVersion) return guessedVersion === 'bs5';\n\n guessedVersion = _guessBsVersion();\n return guessedVersion === 'bs5';\n}\n\nexport function getBsVer(): IBsVersion {\n return {\n isBs3: isBs3(),\n isBs4: isBs4(),\n isBs5: isBs5()\n };\n}\n\nexport function currentBsVersion(): AvailableBsVersions {\n const bsVer = getBsVer();\n const resVersion = Object.keys(bsVer).find(key => bsVer[key]);\n return BsVerions[resVersion as keyof typeof BsVerions];\n}\n\n\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function OnChange(): any {\n const sufix = 'Change';\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function OnChangeHandler(target: any, propertyKey: string): void {\n const _key = ` __${propertyKey}Value`;\n Object.defineProperty(target, propertyKey, {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(): any {\n return this[_key];\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(value: any): void {\n const prevValue = this[_key];\n this[_key] = value;\n if (prevValue !== value && this[propertyKey + sufix]) {\n this[propertyKey + sufix].emit(value);\n }\n }\n });\n };\n}\n","import { window } from './facade/browser';\nimport { currentBsVersion } from './theme-provider';\n\nexport class Utils {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static reflow(element: any): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((bs: any): void => bs)(element.offsetHeight);\n }\n\n // source: https://github.com/jquery/jquery/blob/master/src/css/var/getStyles.js\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static getStyles(elem: any): any {\n // Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n // IE throws on elements created in popups\n // FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n let view = elem.ownerDocument.defaultView;\n\n if (!view || !view.opener) {\n view = window;\n }\n\n return view.getComputedStyle(elem);\n }\n\n static stackOverflowConfig(): { crossorigin?: string, integrity?: string, cdnLink: string } {\n const bsVer = currentBsVersion();\n return {\n crossorigin: bsVer !== 'bs3' ? \"anonymous\" : undefined,\n integrity: bsVer === 'bs5' ? 'sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We' : bsVer === 'bs4' ? 'sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2' : undefined,\n cdnLink: bsVer === 'bs5' ? 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css' : bsVer === 'bs4' ? 'https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css' : 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',\n };\n }\n}\n","<ng-template [ngIf]=\"isOpen\">\n <div [class]=\"'alert alert-' + type\" role=\"alert\" [ngClass]=\"classes\">\n <ng-template [ngIf]=\"dismissible\">\n <button type=\"button\" class=\"close btn-close\" aria-label=\"Close\" (click)=\"close()\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n <span class=\"sr-only visually-hidden\">Close</span>\n </button>\n </ng-template>\n <ng-content></ng-content>\n </div>\n</ng-template>\n","import { isDevMode } from '@angular/core';\nconst _messagesHash: { [key: string]: boolean } = {};\nconst _hideMsg = typeof console === 'undefined' || !('warn' in console);\n\nexport function warnOnce(msg: string): void {\n if (!isDevMode() || _hideMsg || msg in _messagesHash) {\n return;\n }\n\n _messagesHash[msg] = true;\n console.warn(msg);\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AlertConfig {\n /** default alert type */\n type = 'warning';\n\n /** is alerts are dismissible by default */\n dismissible = false;\n\n /** default time before alert will dismiss */\n dismissOnTimeout?: number = undefined;\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport { AlertConfig } from './alert.config';\nimport { OnChange } from 'ngx-bootstrap/utils';\n\n@Component({\n selector: 'alert,bs-alert',\n templateUrl: './alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AlertComponent implements OnInit {\n /** Alert type.\n * Provides one of four bootstrap supported contextual classes:\n * `success`, `info`, `warning` and `danger`\n */\n @Input() type = 'warning';\n /** If set, displays an inline \"Close\" button */\n @OnChange() @Input() dismissible = false;\n /** Number in milliseconds, after which alert will be closed */\n @Input() dismissOnTimeout?: number | string;\n\n /** Is alert visible */\n @Input() isOpen = true;\n\n /** This event fires immediately after close instance method is called,\n * $event is an instance of Alert component.\n */\n @Output() onClose = new EventEmitter<AlertComponent>();\n /** This event fires when alert closed, $event is an instance of Alert component */\n @Output() onClosed = new EventEmitter<AlertComponent>();\n\n\n classes = '';\n dismissibleChange = new EventEmitter<boolean>();\n\n constructor(_config: AlertConfig, private changeDetection: ChangeDetectorRef) {\n Object.assign(this, _config);\n this.dismissibleChange.subscribe((/*dismissible: boolean*/) => {\n this.classes = this.dismissible ? 'alert-dismissible' : '';\n this.changeDetection.markForCheck();\n });\n }\n\n ngOnInit(): void {\n if (this.dismissOnTimeout) {\n // if dismissOnTimeout used as attr without binding, it will be a string\n setTimeout(\n () => this.close(),\n parseInt(this.dismissOnTimeout as string, 10)\n );\n }\n }\n\n // todo: animation ` If the .fade and .in classes are present on the element,\n // the alert will fade out before it is removed`\n /**\n * Closes an alert by removing it from the DOM.\n */\n close(): void {\n if (!this.isOpen) {\n return;\n }\n\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule, ModuleWithProviders } from '@angular/core';\nimport { AlertComponent } from './alert.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [AlertComponent],\n exports: [AlertComponent]\n})\nexport class AlertModule {\n static forRoot(): ModuleWithProviders<AlertModule> {\n return { ngModule: AlertModule, providers: [] };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationMetadata, AnimationOptions} from './animation_metadata';\nimport {AnimationPlayer} from './players/animation_player';\n\n/**\n * An injectable service that produces an animation sequence programmatically within an\n * Angular component or directive.\n * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`.\n *\n * @usageNotes\n *\n * To use this service, add it to your component or directive as a dependency.\n * The service is instantiated along with your component.\n *\n * Apps do not typically need to create their own animation players, but if you\n * do need to, follow these steps:\n *\n * 1. Use the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> method\n * to create a programmatic animation. The method returns an `AnimationFactory` instance.\n *\n * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element.\n *\n * 3. Use the player object to control the animation programmatically.\n *\n * For example:\n *\n * ```ts\n * // import the service from BrowserAnimationsModule\n * import {AnimationBuilder} from '@angular/animations';\n * // require the service as a dependency\n * class MyCmp {\n * constructor(private _builder: AnimationBuilder) {}\n *\n * makeAnimation(element: any) {\n * // first define a reusable animation\n * const myAnimation = this._builder.build([\n * style({ width: 0 }),\n * animate(1000, style({ width: '100px' }))\n * ]);\n *\n * // use the returned factory object to create a player\n * const player = myAnimation.create(element);\n *\n * player.play();\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport abstract class AnimationBuilder {\n /**\n * Builds a factory for producing a defined animation.\n * @param animation A reusable animation definition.\n * @returns A factory object that can create a player for the defined animation.\n * @see `animate()`\n */\n abstract build(animation: AnimationMetadata|AnimationMetadata[]): AnimationFactory;\n}\n\n/**\n * A factory object returned from the\n * <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method.\n *\n * @publicApi\n */\nexport abstract class AnimationFactory {\n /**\n * Creates an `AnimationPlayer` instance for the reusable animation defined by\n * the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method that created this factory and attaches the new player a DOM element.\n *\n * @param element The DOM element to which to attach the player.\n * @param options A set of options that can include a time delay and\n * additional developer-defined parameters.\n */\n abstract create(element: any, options?: AnimationOptions): AnimationPlayer;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Represents a set of CSS styles for use in an animation style as a generic.\n */\nexport interface ɵStyleData {\n [key: string]: string|number;\n}\n\n/**\n * Represents a set of CSS styles for use in an animation style as a Map.\n */\nexport type ɵStyleDataMap = Map<string, string|number>;\n\n/**\n * Represents animation-step timing parameters for an animation step.\n * @see `animate()`\n *\n * @publicApi\n */\nexport declare type AnimateTimings = {\n /**\n * The full duration of an animation step. A number and optional time unit,\n * such as \"1s\" or \"10ms\" for one second and 10 milliseconds, respectively.\n * The default unit is milliseconds.\n */\n duration: number,\n /**\n * The delay in applying an animation step. A number and optional time unit.\n * The default unit is milliseconds.\n */\n delay: number,\n /**\n * An easing style that controls how an animations step accelerates\n * and decelerates during its run time. An easing function such as `cubic-bezier()`,\n * or one of the following constants:\n * - `ease-in`\n * - `ease-out`\n * - `ease-in-and-out`\n */\n easing: string | null\n};\n\n/**\n * @description Options that control animation styling and timing.\n *\n * The following animation functions accept `AnimationOptions` data:\n *\n * - `transition()`\n * - `sequence()`\n * - `{@link animations/group group()}`\n * - `query()`\n * - `animation()`\n * - `useAnimation()`\n * - `animateChild()`\n *\n * Programmatic animations built using the `AnimationBuilder` service also\n * make use of `AnimationOptions`.\n *\n * @publicApi\n */\nexport declare interface AnimationOptions {\n /**\n * Sets a time-delay for initiating an animation action.\n * A number and optional time unit, such as \"1s\" or \"10ms\" for one second\n * and 10 milliseconds, respectively.The default unit is milliseconds.\n * Default value is 0, meaning no delay.\n */\n delay?: number|string;\n /**\n * A set of developer-defined parameters that modify styling and timing\n * when an animation action starts. An array of key-value pairs, where the provided value\n * is used as a default.\n */\n params?: {[name: string]: any};\n}\n\n/**\n * Adds duration options to control animation styling and timing for a child animation.\n *\n * @see `animateChild()`\n *\n * @publicApi\n */\nexport declare interface AnimateChildOptions extends AnimationOptions {\n duration?: number|string;\n}\n\n/**\n * @description Constants for the categories of parameters that can be defined for animations.\n *\n * A corresponding function defines a set of parameters for each category, and\n * collects them into a corresponding `AnimationMetadata` object.\n *\n * @publicApi\n */\nexport const enum AnimationMetadataType {\n /**\n * Associates a named animation state with a set of CSS styles.\n * See [`state()`](api/animations/state)\n */\n State = 0,\n /**\n * Data for a transition from one animation state to another.\n * See `transition()`\n */\n Transition = 1,\n /**\n * Contains a set of animation steps.\n * See `sequence()`\n */\n Sequence = 2,\n /**\n * Contains a set of animation steps.\n * See `{@link animations/group group()}`\n */\n Group = 3,\n /**\n * Contains an animation step.\n * See `animate()`\n */\n Animate = 4,\n /**\n * Contains a set of animation steps.\n * See `keyframes()`\n */\n Keyframes = 5,\n /**\n * Contains a set of CSS property-value pairs into a named style.\n * See `style()`\n */\n Style = 6,\n /**\n * Associates an animation with an entry trigger that can be attached to an element.\n * See `trigger()`\n */\n Trigger = 7,\n /**\n * Contains a re-usable animation.\n * See `animation()`\n */\n Reference = 8,\n /**\n * Contains data to use in executing child animations returned by a query.\n * See `animateChild()`\n */\n AnimateChild = 9,\n /**\n * Contains animation parameters for a re-usable animation.\n * See `useAnimation()`\n */\n AnimateRef = 10,\n /**\n * Contains child-animation query data.\n * See `query()`\n */\n Query = 11,\n /**\n * Contains data for staggering an animation sequence.\n * See `stagger()`\n */\n Stagger = 12\n}\n\n/**\n * Specifies automatic styling.\n *\n * @publicApi\n */\nexport const AUTO_STYLE = '*';\n\n/**\n * Base for animation data structures.\n *\n * @publicApi\n */\nexport interface AnimationMetadata {\n type: AnimationMetadataType;\n}\n\n/**\n * Contains an animation trigger. Instantiated and returned by the\n * `trigger()` function.\n *\n * @publicApi\n */\nexport interface AnimationTriggerMetadata extends AnimationMetadata {\n /**\n * The trigger name, used to associate it with an element. Unique within the component.\n */\n name: string;\n /**\n * An animation definition object, containing an array of state and transition declarations.\n */\n definitions: AnimationMetadata[];\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: {params?: {[name: string]: any}}|null;\n}\n\n/**\n * Encapsulates an animation state by associating a state name with a set of CSS styles.\n * Instantiated and returned by the [`state()`](api/animations/state) function.\n *\n * @publicApi\n */\nexport interface AnimationStateMetadata extends AnimationMetadata {\n /**\n * The state name, unique within the component.\n */\n name: string;\n /**\n * The CSS styles associated with this state.\n */\n styles: AnimationStyleMetadata;\n /**\n * An options object containing\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation.\n */\n options?: {params: {[name: string]: any}};\n}\n\n/**\n * Encapsulates an animation transition. Instantiated and returned by the\n * `transition()` function.\n *\n * @publicApi\n */\nexport interface AnimationTransitionMetadata extends AnimationMetadata {\n /**\n * An expression that describes a state change.\n */\n expr: string|\n ((fromState: string, toState: string, element?: any,\n params?: {[key: string]: any}) => boolean);\n /**\n * One or more animation objects to which this transition applies.\n */\n animation: AnimationMetadata|AnimationMetadata[];\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: AnimationOptions|null;\n}\n\n/**\n * Encapsulates a reusable animation, which is a collection of individual animation steps.\n * Instantiated and returned by the `animation()` function, and\n * passed to the `useAnimation()` function.\n *\n * @publicApi\n */\nexport interface AnimationReferenceMetadata extends AnimationMetadata {\n /**\n * One or more animation step objects.\n */\n animation: AnimationMetadata|AnimationMetadata[];\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: AnimationOptions|null;\n}\n\n/**\n * Encapsulates an animation query. Instantiated and returned by\n * the `query()` function.\n *\n * @publicApi\n */\nexport interface AnimationQueryMetadata extends AnimationMetadata {\n /**\n * The CSS selector for this query.\n */\n selector: string;\n /**\n * One or more animation step objects.\n */\n animation: AnimationMetadata|AnimationMetadata[];\n /**\n * A query options object.\n */\n options: AnimationQueryOptions|null;\n}\n\n/**\n * Encapsulates a keyframes sequence. Instantiated and returned by\n * the `keyframes()` function.\n *\n * @publicApi\n */\nexport interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {\n /**\n * An array of animation styles.\n */\n steps: AnimationStyleMetadata[];\n}\n\n/**\n * Encapsulates an animation style. Instantiated and returned by\n * the `style()` function.\n *\n * @publicApi\n */\nexport interface AnimationStyleMetadata extends AnimationMetadata {\n /**\n * A set of CSS style properties.\n */\n styles: '*'|{[key: string]: string | number}|Array<{[key: string]: string | number}|'*'>;\n /**\n * A percentage of the total animate time at which the style is to be applied.\n */\n offset: number|null;\n}\n\n/**\n * Encapsulates an animation step. Instantiated and returned by\n * the `animate()` function.\n *\n * @publicApi\n */\nexport interface AnimationAnimateMetadata extends AnimationMetadata {\n /**\n * The timing data for the step.\n */\n timings: string|number|AnimateTimings;\n /**\n * A set of styles used in the step.\n */\n styles: AnimationStyleMetadata|AnimationKeyframesSequenceMetadata|null;\n}\n\n/**\n * Encapsulates a child animation, that can be run explicitly when the parent is run.\n * Instantiated and returned by the `animateChild` function.\n *\n * @publicApi\n */\nexport interface AnimationAnimateChildMetadata extends AnimationMetadata {\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: AnimationOptions|null;\n}\n\n/**\n * Encapsulates a reusable animation.\n * Instantiated and returned by the `useAnimation()` function.\n *\n * @publicApi\n */\nexport interface AnimationAnimateRefMetadata extends AnimationMetadata {\n /**\n * An animation reference object.\n */\n animation: AnimationReferenceMetadata;\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: AnimationOptions|null;\n}\n\n/**\n * Encapsulates an animation sequence.\n * Instantiated and returned by the `sequence()` function.\n *\n * @publicApi\n */\nexport interface AnimationSequenceMetadata extends AnimationMetadata {\n /**\n * An array of animation step objects.\n */\n steps: AnimationMetadata[];\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: AnimationOptions|null;\n}\n\n/**\n * Encapsulates an animation group.\n * Instantiated and returned by the `{@link animations/group group()}` function.\n *\n * @publicApi\n */\nexport interface AnimationGroupMetadata extends AnimationMetadata {\n /**\n * One or more animation or style steps that form this group.\n */\n steps: AnimationMetadata[];\n /**\n * An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation. Default delay is 0.\n */\n options: AnimationOptions|null;\n}\n\n/**\n * Encapsulates animation query options.\n * Passed to the `query()` function.\n *\n * @publicApi\n */\nexport declare interface AnimationQueryOptions extends AnimationOptions {\n /**\n * True if this query is optional, false if it is required. Default is false.\n * A required query throws an error if no elements are retrieved when\n * the query is executed. An optional query does not.\n *\n */\n optional?: boolean;\n /**\n * A maximum total number of results to return from the query.\n * If negative, results are limited from the end of the query list towards the beginning.\n * By default, results are not limited.\n */\n limit?: number;\n}\n\n/**\n * Encapsulates parameters for staggering the start times of a set of animation steps.\n * Instantiated and returned by the `stagger()` function.\n *\n * @publicApi\n **/\nexport interface AnimationStaggerMetadata extends AnimationMetadata {\n /**\n * The timing data for the steps.\n */\n timings: string|number;\n /**\n * One or more animation steps.\n */\n animation: AnimationMetadata|AnimationMetadata[];\n}\n\n/**\n * Creates a named animation trigger, containing a list of [`state()`](api/animations/state)\n * and `transition()` entries to be evaluated when the expression\n * bound to the trigger changes.\n *\n * @param name An identifying string.\n * @param definitions An animation definition object, containing an array of\n * [`state()`](api/animations/state) and `transition()` declarations.\n *\n * @return An object that encapsulates the trigger data.\n *\n * @usageNotes\n * Define an animation trigger in the `animations` section of `@Component` metadata.\n * In the template, reference the trigger by name and bind it to a trigger expression that\n * evaluates to a defined animation state, using the following format:\n *\n * `[@triggerName]=\"expression\"`\n *\n * Animation trigger bindings convert all values to strings, and then match the\n * previous and current values against any linked transitions.\n * Booleans can be specified as `1` or `true` and `0` or `false`.\n *\n * ### Usage Example\n *\n * The following example creates an animation trigger reference based on the provided\n * name value.\n * The provided animation value is expected to be an array consisting of state and\n * transition declarations.\n *\n * ```typescript\n * @Component({\n * selector: \"my-component\",\n * templateUrl: \"my-component-tpl.html\",\n * animations: [\n * trigger(\"myAnimationTrigger\", [\n * state(...),\n * state(...),\n * transition(...),\n * transition(...)\n * ])\n * ]\n * })\n * class MyComponent {\n * myStatusExp = \"something\";\n * }\n * ```\n *\n * The template associated with this component makes use of the defined trigger\n * by binding to an element within its template code.\n *\n * ```html\n * <!-- somewhere inside of my-component-tpl.html -->\n * <div [@myAnimationTrigger]=\"myStatusExp\">...</div>\n * ```\n *\n * ### Using an inline function\n * The `transition` animation method also supports reading an inline function which can decide\n * if its associated animation should be run.\n *\n * ```typescript\n * // this method is run each time the `myAnimationTrigger` trigger value changes.\n * function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key:\n string]: any}): boolean {\n * // notice that `element` and `params` are also available here\n * return toState == 'yes-please-animate';\n * }\n *\n * @Component({\n * selector: 'my-component',\n * templateUrl: 'my-component-tpl.html',\n * animations: [\n * trigger('myAnimationTrigger', [\n * transition(myInlineMatcherFn, [\n * // the animation sequence code\n * ]),\n * ])\n * ]\n * })\n * class MyComponent {\n * myStatusExp = \"yes-please-animate\";\n * }\n * ```\n *\n * ### Disabling Animations\n * When true, the special animation control binding `@.disabled` binding prevents\n * all animations from rendering.\n * Place the `@.disabled` binding on an element to disable\n * animations on the element itself, as well as any inner animation triggers\n * within the element.\n *\n * The following example shows how to use this feature:\n *\n * ```typescript\n * @Component({\n * selector: 'my-component',\n * template: `\n * <div [@.disabled]=\"isDisabled\">\n * <div [@childAnimation]=\"exp\"></div>\n * </div>\n * `,\n * animations: [\n * trigger(\"childAnimation\", [\n * // ...\n * ])\n * ]\n * })\n * class MyComponent {\n * isDisabled = true;\n * exp = '...';\n * }\n * ```\n *\n * When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating,\n * along with any inner animations.\n *\n * ### Disable animations application-wide\n * When an area of the template is set to have animations disabled,\n * **all** inner components have their animations disabled as well.\n * This means that you can disable all animations for an app\n * by placing a host binding set on `@.disabled` on the topmost Angular component.\n *\n * ```typescript\n * import {Component, HostBinding} from '@angular/core';\n *\n * @Component({\n * selector: 'app-component',\n * templateUrl: 'app.component.html',\n * })\n * class AppComponent {\n * @HostBinding('@.disabled')\n * public animationsDisabled = true;\n * }\n * ```\n *\n * ### Overriding disablement of inner animations\n * Despite inner animations being disabled, a parent animation can `query()`\n * for inner elements located in disabled areas of the template and still animate\n * them if needed. This is also the case for when a sub animation is\n * queried by a parent and then later animated using `animateChild()`.\n *\n * ### Detecting when an animation is disabled\n * If a region of the DOM (or the entire application) has its animations disabled, the animation\n * trigger callbacks still fire, but for zero seconds. When the callback fires, it provides\n * an instance of an `AnimationEvent`. If animations are disabled,\n * the `.disabled` flag on the event is true.\n *\n * @publicApi\n */\nexport function trigger(name: string, definitions: AnimationMetadata[]): AnimationTriggerMetadata {\n return {type: AnimationMetadataType.Trigger, name, definitions, options: {}};\n}\n\n/**\n * Defines an animation step that combines styling information with timing information.\n *\n * @param timings Sets `AnimateTimings` for the parent animation.\n * A string in the format \"duration [delay] [easing]\".\n * - Duration and delay are expressed as a number and optional time unit,\n * such as \"1s\" or \"10ms\" for one second and 10 milliseconds, respectively.\n * The default unit is milliseconds.\n * - The easing value controls how the animation accelerates and decelerates\n * during its runtime. Value is one of `ease`, `ease-in`, `ease-out`,\n * `ease-in-out`, or a `cubic-bezier()` function call.\n * If not supplied, no easing is applied.\n *\n * For example, the string \"1s 100ms ease-out\" specifies a duration of\n * 1000 milliseconds, and delay of 100 ms, and the \"ease-out\" easing style,\n * which decelerates near the end of the duration.\n * @param styles Sets AnimationStyles for the parent animation.\n * A function call to either `style()` or `keyframes()`\n * that returns a collection of CSS style entries to be applied to the parent animation.\n * When null, uses the styles from the destination state.\n * This is useful when describing an animation step that will complete an animation;\n * see \"Animating to the final state\" in `transitions()`.\n * @returns An object that encapsulates the animation step.\n *\n * @usageNotes\n * Call within an animation `sequence()`, `{@link animations/group group()}`, or\n * `transition()` call to specify an animation step\n * that applies given style data to the parent animation for a given amount of time.\n *\n * ### Syntax Examples\n * **Timing examples**\n *\n * The following examples show various `timings` specifications.\n * - `animate(500)` : Duration is 500 milliseconds.\n * - `animate(\"1s\")` : Duration is 1000 milliseconds.\n * - `animate(\"100ms 0.5s\")` : Duration is 100 milliseconds, delay is 500 milliseconds.\n * - `animate(\"5s ease-in\")` : Duration is 5000 milliseconds, easing in.\n * - `animate(\"5s 10ms cubic-bezier(.17,.67,.88,.1)\")` : Duration is 5000 milliseconds, delay is 10\n * milliseconds, easing according to a bezier curve.\n *\n * **Style examples**\n *\n * The following example calls `style()` to set a single CSS style.\n * ```typescript\n * animate(500, style({ background: \"red\" }))\n * ```\n * The following example calls `keyframes()` to set a CSS style\n * to different values for successive keyframes.\n * ```typescript\n * animate(500, keyframes(\n * [\n * style({ background: \"blue\" }),\n * style({ background: \"red\" })\n * ])\n * ```\n *\n * @publicApi\n */\nexport function animate(\n timings: string|number,\n styles: AnimationStyleMetadata|AnimationKeyframesSequenceMetadata|null =\n null): AnimationAnimateMetadata {\n return {type: AnimationMetadataType.Animate, styles, timings};\n}\n\n/**\n * @description Defines a list of animation steps to be run in parallel.\n *\n * @param steps An array of animation step objects.\n * - When steps are defined by `style()` or `animate()`\n * function calls, each call within the group is executed instantly.\n * - To specify offset styles to be applied at a later time, define steps with\n * `keyframes()`, or use `animate()` calls with a delay value.\n * For example:\n *\n * ```typescript\n * group([\n * animate(\"1s\", style({ background: \"black\" })),\n * animate(\"2s\", style({ color: \"white\" }))\n * ])\n * ```\n *\n * @param options An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation.\n *\n * @return An object that encapsulates the group data.\n *\n * @usageNotes\n * Grouped animations are useful when a series of styles must be\n * animated at different starting times and closed off at different ending times.\n *\n * When called within a `sequence()` or a\n * `transition()` call, does not continue to the next\n * instruction until all of the inner animation steps have completed.\n *\n * @publicApi\n */\nexport function group(\n steps: AnimationMetadata[], options: AnimationOptions|null = null): AnimationGroupMetadata {\n return {type: AnimationMetadataType.Group, steps, options};\n}\n\n/**\n * Defines a list of animation steps to be run sequentially, one by one.\n *\n * @param steps An array of animation step objects.\n * - Steps defined by `style()` calls apply the styling data immediately.\n * - Steps defined by `animate()` calls apply the styling data over time\n * as specified by the timing data.\n *\n * ```typescript\n * sequence([\n * style({ opacity: 0 }),\n * animate(\"1s\", style({ opacity: 1 }))\n * ])\n * ```\n *\n * @param options An options object containing a delay and\n * developer-defined parameters that provide styling defaults and\n * can be overridden on invocation.\n *\n * @return An object that encapsulates the sequence data.\n *\n * @usageNotes\n * When you pass an array of steps to a\n * `transition()` call, the steps run sequentially by default.\n * Compare this to the `{@link animations/group group()}` call, which runs animation steps in\n *parallel.\n *\n * When a sequence is used within a `{@link animations/group group()}` or a `transition()` call,\n * execution continues to the next instruction only after each of the inner animation\n * steps have completed.\n *\n * @publicApi\n **/\nexport function sequence(\n steps: AnimationMetadata[], options: AnimationOptions|null = null): AnimationSequenceMetadata {\n return {type: AnimationMetadataType.Sequence, steps, options};\n}\n\n/**\n * Declares a key/value object containing CSS properties/styles that\n * can then be used for an animation [`state`](api/animations/state), within an animation\n *`sequence`, or as styling data for calls to `animate()` and `keyframes()`.\n *\n * @param tokens A set of CSS styles or HTML styles associated with an animation state.\n * The value can be any of the following:\n * - A key-value style pair associating a CSS property with a value.\n * - An array of key-value style pairs.\n * - An asterisk (*), to use auto-styling, where styles are derived from the element\n * being animated and applied to the animation when it starts.\n *\n * Auto-styling can be used to define a state that depends on layout or other\n * environmental factors.\n *\n * @return An object that encapsulates the style data.\n *\n * @usageNotes\n * The following examples create animation styles that collect a set of\n * CSS property values:\n *\n * ```typescript\n * // string values for CSS properties\n * style({ background: \"red\", color: \"blue\" })\n *\n * // numerical pixel values\n * style({ width: 100, height: 0 })\n * ```\n *\n * The following example uses auto-styling to allow an element to animate from\n * a height of 0 up to its full height:\n *\n * ```\n * style({ height: 0 }),\n * animate(\"1s\", style({ height: \"*\" }))\n * ```\n *\n * @publicApi\n **/\nexport function style(tokens: '*'|{[key: string]: string | number}|\n Array<'*'|{[key: string]: string | number}>): AnimationStyleMetadata {\n return {type: AnimationMetadataType.Style, styles: tokens, offset: null};\n}\n\n/**\n * Declares an animation state within a trigger attached to an element.\n *\n * @param name One or more names for the defined state in a comma-separated string.\n * The following reserved state names can be supplied to define a style for specific use\n * cases:\n *\n * - `void` You can associate styles with this name to be used when\n * the element is detached from the application. For example, when an `ngIf` evaluates\n * to false, the state of the associated element is void.\n * - `*` (asterisk) Indicates the default state. You can associate styles with this name\n * to be used as the fallback when the state that is being animated is not declared\n * within the trigger.\n *\n * @param styles A set of CSS styles associated with this state, created using the\n * `style()` function.\n * This set of styles persists on the element once the state has been reached.\n * @param options Parameters that can be passed to the state when it is invoked.\n * 0 or more key-value pairs.\n * @return An object that encapsulates the new state data.\n *\n * @usageNotes\n * Use the `trigger()` function to register states to an animation trigger.\n * Use the `transition()` function to animate between states.\n * When a state is active within a component, its associated styles persist on the element,\n * even when the animation ends.\n *\n * @publicApi\n **/\nexport function state(\n name: string, styles: AnimationStyleMetadata,\n options?: {params: {[name: string]: any}}): AnimationStateMetadata {\n return {type: AnimationMetadataType.State, name, styles, options};\n}\n\n/**\n * Defines a set of animation styles, associating each style with an optional `offset` value.\n *\n * @param steps A set of animation styles with optional offset data.\n * The optional `offset` value for a style specifies a percentage of the total animation\n * time at which that style is applied.\n * @returns An object that encapsulates the keyframes data.\n *\n * @usageNotes\n * Use with the `animate()` call. Instead of applying animations\n * from the current state\n * to the destination state, keyframes describe how each style entry is applied and at what point\n * within the animation arc.\n * Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp).\n *\n * ### Usage\n *\n * In the following example, the offset values describe\n * when each `backgroundColor` value is applied. The color is red at the start, and changes to\n * blue when 20% of the total time has elapsed.\n *\n * ```typescript\n * // the provided offset values\n * animate(\"5s\", keyframes([\n * style({ backgroundColor: \"red\", offset: 0 }),\n * style({ backgroundColor: \"blue\", offset: 0.2 }),\n * style({ backgroundColor: \"orange\", offset: 0.3 }),\n * style({ backgroundColor: \"black\", offset: 1 })\n * ]))\n * ```\n *\n * If there are no `offset` values specified in the style entries, the offsets\n * are calculated automatically.\n *\n * ```typescript\n * animate(\"5s\", keyframes([\n * style({ backgroundColor: \"red\" }) // offset = 0\n * style({ backgroundColor: \"blue\" }) // offset = 0.33\n * style({ backgroundColor: \"orange\" }) // offset = 0.66\n * style({ backgroundColor: \"black\" }) // offset = 1\n * ]))\n *```\n\n * @publicApi\n */\nexport function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata {\n return {type: AnimationMetadataType.Keyframes, steps};\n}\n\n/**\n * Declares an animation transition which is played when a certain specified condition is met.\n *\n * @param stateChangeExpr A string with a specific format or a function that specifies when the\n * animation transition should occur (see [State Change Expression](#state-change-expression)).\n *\n * @param steps One or more animation objects that represent the animation's instructions.\n *\n * @param options An options object that can be used to specify a delay for the animation or provide\n * custom parameters for it.\n *\n * @returns An object that encapsulates the transition data.\n *\n * @usageNotes\n *\n * ### State Change Expression\n *\n * The State Change Expression instructs Angular when to run the transition's animations, it can\n *either be\n * - a string with a specific syntax\n * - or a function that compares the previous and current state (value of the expression bound to\n * the element's trigger) and returns `true` if the transition should occur or `false` otherwise\n *\n * The string format can be:\n * - `fromState => toState`, which indicates that the transition's animations should occur then the\n * expression bound to the trigger's element goes from `fromState` to `toState`\n *\n * _Example:_\n * ```typescript\n * transition('open => closed', animate('.5s ease-out', style({ height: 0 }) ))\n * ```\n *\n * - `fromState <=> toState`, which indicates that the transition's animations should occur then\n * the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa\n *\n * _Example:_\n * ```typescript\n * transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)'))\n * ```\n *\n * - `:enter`/`:leave`, which indicates that the transition's animations should occur when the\n * element enters or exists the DOM\n *\n * _Example:_\n * ```typescript\n * transition(':enter', [\n * style({ opacity: 0 }),\n * animate('500ms', style({ opacity: 1 }))\n * ])\n * ```\n *\n * - `:increment`/`:decrement`, which indicates that the transition's animations should occur when\n * the numerical expression bound to the trigger's element has increased in value or decreased\n *\n * _Example:_\n * ```typescript\n * transition(':increment', query('@counter', animateChild()))\n * ```\n *\n * - a sequence of any of the above divided by commas, which indicates that transition's animations\n * should occur whenever one of the state change expressions matches\n *\n * _Example:_\n * ```typescript\n * transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([\n * style({ transform: 'scale(1)', offset: 0}),\n * style({ transform: 'scale(1.1)', offset: 0.7}),\n * style({ transform: 'scale(1)', offset: 1})\n * ]))),\n * ```\n *\n * Also note that in such context:\n * - `void` can be used to indicate the absence of the element\n * - asterisks can be used as wildcards that match any state\n * - (as a consequence of the above, `void => *` is equivalent to `:enter` and `* => void` is\n * equivalent to `:leave`)\n * - `true` and `false` also match expression values of `1` and `0` respectively (but do not match\n * _truthy_ and _falsy_ values)\n *\n * <div class=\"alert is-helpful\">\n *\n * Be careful about entering end leaving elements as their transitions present a common\n * pitfall for developers.\n *\n * Note that when an element with a trigger enters the DOM its `:enter` transition always\n * gets executed, but its `:leave` transition will not be executed if the element is removed\n * alongside its parent (as it will be removed \"without warning\" before its transition has\n * a chance to be executed, the only way that such transition can occur is if the element\n * is exiting the DOM on its own).\n *\n *\n * </div>\n *\n * ### Animating to a Final State\n *\n * If the final step in a transition is a call to `animate()` that uses a timing value\n * with no `style` data, that step is automatically considered the final animation arc,\n * for the element to reach the final state, in such case Angular automatically adds or removes\n * CSS styles to ensure that the element is in the correct final state.\n *\n *\n * ### Usage Examples\n *\n * - Transition animations applied based on\n * the trigger's expression value\n *\n * ```HTML\n * <div [@myAnimationTrigger]=\"myStatusExp\">\n * ...\n * </div>\n * ```\n *\n * ```typescript\n * trigger(\"myAnimationTrigger\", [\n * ..., // states\n * transition(\"on => off, open => closed\", animate(500)),\n * transition(\"* <=> error\", query('.indicator', animateChild()))\n * ])\n * ```\n *\n * - Transition animations applied based on custom logic dependent\n * on the trigger's expression value and provided parameters\n *\n * ```HTML\n * <div [@myAnimationTrigger]=\"{\n * value: stepName,\n * params: { target: currentTarget }\n * }\">\n * ...\n * </div>\n * ```\n *\n * ```typescript\n * trigger(\"myAnimationTrigger\", [\n * ..., // states\n * transition(\n * (fromState, toState, _element, params) =>\n * ['firststep', 'laststep'].includes(fromState.toLowerCase())\n * && toState === params?.['target'],\n * animate('1s')\n * )\n * ])\n * ```\n *\n * @publicApi\n **/\nexport function transition(\n stateChangeExpr: string|\n ((fromState: string, toState: string, element?: any, params?: {[key: string]: any}) => boolean),\n steps: AnimationMetadata|AnimationMetadata[],\n options: AnimationOptions|null = null): AnimationTransitionMetadata {\n return {type: AnimationMetadataType.Transition, expr: stateChangeExpr, animation: steps, options};\n}\n\n/**\n * Produces a reusable animation that can be invoked in another animation or sequence,\n * by calling the `useAnimation()` function.\n *\n * @param steps One or more animation objects, as returned by the `animate()`\n * or `sequence()` function, that form a transformation from one state to another.\n * A sequence is used by default when you pass an array.\n * @param options An options object that can contain a delay value for the start of the\n * animation, and additional developer-defined parameters.\n * Provided values for additional parameters are used as defaults,\n * and override values can be passed to the caller on invocation.\n * @returns An object that encapsulates the animation data.\n *\n * @usageNotes\n * The following example defines a reusable animation, providing some default parameter\n * values.\n *\n * ```typescript\n * var fadeAnimation = animation([\n * style({ opacity: '{{ start }}' }),\n * animate('{{ time }}',\n * style({ opacity: '{{ end }}'}))\n * ],\n * { params: { time: '1000ms', start: 0, end: 1 }});\n * ```\n *\n * The following invokes the defined animation with a call to `useAnimation()`,\n * passing in override parameter values.\n *\n * ```js\n * useAnimation(fadeAnimation, {\n * params: {\n * time: '2s',\n * start: 1,\n * end: 0\n * }\n * })\n * ```\n *\n * If any of the passed-in parameter values are missing from this call,\n * the default values are used. If one or more parameter values are missing before a step is\n * animated, `useAnimation()` throws an error.\n *\n * @publicApi\n */\nexport function animation(\n steps: AnimationMetadata|AnimationMetadata[],\n options: AnimationOptions|null = null): AnimationReferenceMetadata {\n return {type: AnimationMetadataType.Reference, animation: steps, options};\n}\n\n/**\n * Executes a queried inner animation element within an animation sequence.\n *\n * @param options An options object that can contain a delay value for the start of the\n * animation, and additional override values for developer-defined parameters.\n * @return An object that encapsulates the child animation data.\n *\n * @usageNotes\n * Each time an animation is triggered in Angular, the parent animation\n * has priority and any child animations are blocked. In order\n * for a child animation to run, the parent animation must query each of the elements\n * containing child animations, and run them using this function.\n *\n * Note that this feature is designed to be used with `query()` and it will only work\n * with animations that are assigned using the Angular animation library. CSS keyframes\n * and transitions are not handled by this API.\n *\n * @publicApi\n */\nexport function animateChild(options: AnimateChildOptions|null = null):\n AnimationAnimateChildMetadata {\n return {type: AnimationMetadataType.AnimateChild, options};\n}\n\n/**\n * Starts a reusable animation that is created using the `animation()` function.\n *\n * @param animation The reusable animation to start.\n * @param options An options object that can contain a delay value for the start of\n * the animation, and additional override values for developer-defined parameters.\n * @return An object that contains the animation parameters.\n *\n * @publicApi\n */\nexport function useAnimation(\n animation: AnimationReferenceMetadata,\n options: AnimationOptions|null = null): AnimationAnimateRefMetadata {\n return {type: AnimationMetadataType.AnimateRef, animation, options};\n}\n\n/**\n * Finds one or more inner elements within the current element that is\n * being animated within a sequence. Use with `animate()`.\n *\n * @param selector The element to query, or a set of elements that contain Angular-specific\n * characteristics, specified with one or more of the following tokens.\n * - `query(\":enter\")` or `query(\":leave\")` : Query for newly inserted/removed elements (not\n * all elements can be queried via these tokens, see\n * [Entering and Leaving Elements](#entering-and-leaving-elements))\n * - `query(\":animating\")` : Query all currently animating elements.\n * - `query(\"@triggerName\")` : Query elements that contain an animation trigger.\n * - `query(\"@*\")` : Query all elements that contain an animation triggers.\n * - `query(\":self\")` : Include the current element into the animation sequence.\n *\n * @param animation One or more animation steps to apply to the queried element or elements.\n * An array is treated as an animation sequence.\n * @param options An options object. Use the 'limit' field to limit the total number of\n * items to collect.\n * @return An object that encapsulates the query data.\n *\n * @usageNotes\n *\n * ### Multiple Tokens\n *\n * Tokens can be merged into a combined query selector string. For example:\n *\n * ```typescript\n * query(':self, .record:enter, .record:leave, @subTrigger', [...])\n * ```\n *\n * The `query()` function collects multiple elements and works internally by using\n * `element.querySelectorAll`. Use the `limit` field of an options object to limit\n * the total number of items to be collected. For example:\n *\n * ```js\n * query('div', [\n * animate(...),\n * animate(...)\n * ], { limit: 1 })\n * ```\n *\n * By default, throws an error when zero items are found. Set the\n * `optional` flag to ignore this error. For example:\n *\n * ```js\n * query('.some-element-that-may-not-be-there', [\n * animate(...),\n * animate(...)\n * ], { optional: true })\n * ```\n *\n * ### Entering and Leaving Elements\n *\n * Not all elements can be queried via the `:enter` and `:leave` tokens, the only ones\n * that can are those that Angular assumes can enter/leave based on their own logic\n * (if their insertion/removal is simply a consequence of that of their parent they\n * should be queried via a different token in their parent's `:enter`/`:leave` transitions).\n *\n * The only elements Angular assumes can enter/leave based on their own logic (thus the only\n * ones that can be queried via the `:enter` and `:leave` tokens) are:\n * - Those inserted dynamically (via `ViewContainerRef`)\n * - Those that have a structural directive (which, under the hood, are a subset of the above ones)\n *\n * <div class=\"alert is-helpful\">\n *\n * Note that elements will be successfully queried via `:enter`/`:leave` even if their\n * insertion/removal is not done manually via `ViewContainerRef`or caused by their structural\n * directive (e.g. they enter/exit alongside their parent).\n *\n * </div>\n *\n * <div class=\"alert is-important\">\n *\n * There is an exception to what previously mentioned, besides elements entering/leaving based on\n * their own logic, elements with an animation trigger can always be queried via `:leave` when\n * their parent is also leaving.\n *\n * </div>\n *\n * ### Usage Example\n *\n * The following example queries for inner elements and animates them\n * individually using `animate()`.\n *\n * ```typescript\n * @Component({\n * selector: 'inner',\n * template: `\n * <div [@queryAnimation]=\"exp\">\n * <h1>Title</h1>\n * <div class=\"content\">\n * Blah blah blah\n * </div>\n * </div>\n * `,\n * animations: [\n * trigger('queryAnimation', [\n * transition('* => goAnimate', [\n * // hide the inner elements\n * query('h1', style({ opacity: 0 })),\n * query('.content', style({ opacity: 0 })),\n *\n * // animate the inner elements in, one by one\n * query('h1', animate(1000, style({ opacity: 1 }))),\n * query('.content', animate(1000, style({ opacity: 1 }))),\n * ])\n * ])\n * ]\n * })\n * class Cmp {\n * exp = '';\n *\n * goAnimate() {\n * this.exp = 'goAnimate';\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport function query(\n selector: string, animation: AnimationMetadata|AnimationMetadata[],\n options: AnimationQueryOptions|null = null): AnimationQueryMetadata {\n return {type: AnimationMetadataType.Query, selector, animation, options};\n}\n\n/**\n * Use within an animation `query()` call to issue a timing gap after\n * each queried item is animated.\n *\n * @param timings A delay value.\n * @param animation One ore more animation steps.\n * @returns An object that encapsulates the stagger data.\n *\n * @usageNotes\n * In the following example, a container element wraps a list of items stamped out\n * by an `ngFor`. The container element contains an animation trigger that will later be set\n * to query for each of the inner items.\n *\n * Each time items are added, the opacity fade-in animation runs,\n * and each removed item is faded out.\n * When either of these animations occur, the stagger effect is\n * applied after each item's animation is started.\n *\n * ```html\n * <!-- list.component.html -->\n * <button (click)=\"toggle()\">Show / Hide Items</button>\n * <hr />\n * <div [@listAnimation]=\"items.length\">\n * <div *ngFor=\"let item of items\">\n * {{ item }}\n * </div>\n * </div>\n * ```\n *\n * Here is the component code:\n *\n * ```typescript\n * import {trigger, transition, style, animate, query, stagger} from '@angular/animations';\n * @Component({\n * templateUrl: 'list.component.html',\n * animations: [\n * trigger('listAnimation', [\n * ...\n * ])\n * ]\n * })\n * class ListComponent {\n * items = [];\n *\n * showItems() {\n * this.items = [0,1,2,3,4];\n * }\n *\n * hideItems() {\n * this.items = [];\n * }\n *\n * toggle() {\n * this.items.length ? this.hideItems() : this.showItems();\n * }\n * }\n * ```\n *\n * Here is the animation trigger code:\n *\n * ```typescript\n * trigger('listAnimation', [\n * transition('* => *', [ // each time the binding value changes\n * query(':leave', [\n * stagger(100, [\n * animate('0.5s', style({ opacity: 0 }))\n * ])\n * ]),\n * query(':enter', [\n * style({ opacity: 0 }),\n * stagger(100, [\n * animate('0.5s', style({ opacity: 1 }))\n * ])\n * ])\n * ])\n * ])\n * ```\n *\n * @publicApi\n */\nexport function stagger(timings: string|number, animation: AnimationMetadata|AnimationMetadata[]):\n AnimationStaggerMetadata {\n return {type: AnimationMetadataType.Stagger, timings, animation};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport function scheduleMicroTask(cb: () => any) {\n Promise.resolve().then(cb);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {scheduleMicroTask} from '../util';\n\n/**\n * Provides programmatic control of a reusable animation sequence,\n * built using the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method which returns an `AnimationFactory`, whose\n * <code>[create](api/animations/AnimationFactory#create)()</code> method instantiates and\n * initializes this interface.\n *\n * @see `AnimationBuilder`\n * @see `AnimationFactory`\n * @see `animate()`\n *\n * @publicApi\n */\nexport interface AnimationPlayer {\n /**\n * Provides a callback to invoke when the animation finishes.\n * @param fn The callback function.\n * @see `finish()`\n */\n onDone(fn: () => void): void;\n /**\n * Provides a callback to invoke when the animation starts.\n * @param fn The callback function.\n * @see `run()`\n */\n onStart(fn: () => void): void;\n /**\n * Provides a callback to invoke after the animation is destroyed.\n * @param fn The callback function.\n * @see `destroy()`\n * @see `beforeDestroy()`\n */\n onDestroy(fn: () => void): void;\n /**\n * Initializes the animation.\n */\n init(): void;\n /**\n * Reports whether the animation has started.\n * @returns True if the animation has started, false otherwise.\n */\n hasStarted(): boolean;\n /**\n * Runs the animation, invoking the `onStart()` callback.\n */\n play(): void;\n /**\n * Pauses the animation.\n */\n pause(): void;\n /**\n * Restarts the paused animation.\n */\n restart(): void;\n /**\n * Ends the animation, invoking the `onDone()` callback.\n */\n finish(): void;\n /**\n * Destroys the animation, after invoking the `beforeDestroy()` callback.\n * Calls the `onDestroy()` callback when destruction is completed.\n */\n destroy(): void;\n /**\n * Resets the animation to its initial state.\n */\n reset(): void;\n /**\n * Sets the position of the animation.\n * @param position A 0-based offset into the duration, in milliseconds.\n */\n setPosition(position: any /** TODO #9100 */): void;\n /**\n * Reports the current position of the animation.\n * @returns A 0-based offset into the duration, in milliseconds.\n */\n getPosition(): number;\n /**\n * The parent of this player, if any.\n */\n parentPlayer: AnimationPlayer|null;\n /**\n * The total run time of the animation, in milliseconds.\n */\n readonly totalTime: number;\n /**\n * Provides a callback to invoke before the animation is destroyed.\n */\n beforeDestroy?: () => any;\n /**\n * @internal\n * Internal\n */\n triggerCallback?: (phaseName: string) => void;\n /**\n * @internal\n * Internal\n */\n disabled?: boolean;\n}\n\n/**\n * An empty programmatic controller for reusable animations.\n * Used internally when animations are disabled, to avoid\n * checking for the null case when an animation player is expected.\n *\n * @see `animate()`\n * @see `AnimationPlayer`\n * @see `GroupPlayer`\n *\n * @publicApi\n */\nexport class NoopAnimationPlayer implements AnimationPlayer {\n private _onDoneFns: Function[] = [];\n private _onStartFns: Function[] = [];\n private _onDestroyFns: Function[] = [];\n private _originalOnDoneFns: Function[] = [];\n private _originalOnStartFns: Function[] = [];\n private _started = false;\n private _destroyed = false;\n private _finished = false;\n private _position = 0;\n public parentPlayer: AnimationPlayer|null = null;\n public readonly totalTime: number;\n constructor(duration: number = 0, delay: number = 0) {\n this.totalTime = duration + delay;\n }\n private _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n onStart(fn: () => void): void {\n this._originalOnStartFns.push(fn);\n this._onStartFns.push(fn);\n }\n onDone(fn: () => void): void {\n this._originalOnDoneFns.push(fn);\n this._onDoneFns.push(fn);\n }\n onDestroy(fn: () => void): void {\n this._onDestroyFns.push(fn);\n }\n hasStarted(): boolean {\n return this._started;\n }\n init(): void {}\n play(): void {\n if (!this.hasStarted()) {\n this._onStart();\n this.triggerMicrotask();\n }\n this._started = true;\n }\n\n /** @internal */\n triggerMicrotask() {\n scheduleMicroTask(() => this._onFinish());\n }\n\n private _onStart() {\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n }\n\n pause(): void {}\n restart(): void {}\n finish(): void {\n this._onFinish();\n }\n destroy(): void {\n if (!this._destroyed) {\n this._destroyed = true;\n if (!this.hasStarted()) {\n this._onStart();\n }\n this.finish();\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n reset(): void {\n this._started = false;\n this._finished = false;\n this._onStartFns = this._originalOnStartFns;\n this._onDoneFns = this._originalOnDoneFns;\n }\n setPosition(position: number): void {\n this._position = this.totalTime ? position * this.totalTime : 1;\n }\n getPosition(): number {\n return this.totalTime ? this._position / this.totalTime : 1;\n }\n\n /** @internal */\n triggerCallback(phaseName: string): void {\n const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;\n methods.forEach(fn => fn());\n methods.length = 0;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {scheduleMicroTask} from '../util';\nimport {AnimationPlayer} from './animation_player';\n\n/**\n * A programmatic controller for a group of reusable animations.\n * Used internally to control animations.\n *\n * @see `AnimationPlayer`\n * @see `{@link animations/group group()}`\n *\n */\nexport class AnimationGroupPlayer implements AnimationPlayer {\n private _onDoneFns: Function[] = [];\n private _onStartFns: Function[] = [];\n private _finished = false;\n private _started = false;\n private _destroyed = false;\n private _onDestroyFns: Function[] = [];\n\n public parentPlayer: AnimationPlayer|null = null;\n public totalTime: number = 0;\n public readonly players: AnimationPlayer[];\n\n constructor(_players: AnimationPlayer[]) {\n this.players = _players;\n let doneCount = 0;\n let destroyCount = 0;\n let startCount = 0;\n const total = this.players.length;\n\n if (total == 0) {\n scheduleMicroTask(() => this._onFinish());\n } else {\n this.players.forEach(player => {\n player.onDone(() => {\n if (++doneCount == total) {\n this._onFinish();\n }\n });\n player.onDestroy(() => {\n if (++destroyCount == total) {\n this._onDestroy();\n }\n });\n player.onStart(() => {\n if (++startCount == total) {\n this._onStart();\n }\n });\n });\n }\n\n this.totalTime = this.players.reduce((time, player) => Math.max(time, player.totalTime), 0);\n }\n\n private _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n\n init(): void {\n this.players.forEach(player => player.init());\n }\n\n onStart(fn: () => void): void {\n this._onStartFns.push(fn);\n }\n\n private _onStart() {\n if (!this.hasStarted()) {\n this._started = true;\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n }\n }\n\n onDone(fn: () => void): void {\n this._onDoneFns.push(fn);\n }\n\n onDestroy(fn: () => void): void {\n this._onDestroyFns.push(fn);\n }\n\n hasStarted() {\n return this._started;\n }\n\n play() {\n if (!this.parentPlayer) {\n this.init();\n }\n this._onStart();\n this.players.forEach(player => player.play());\n }\n\n pause(): void {\n this.players.forEach(player => player.pause());\n }\n\n restart(): void {\n this.players.forEach(player => player.restart());\n }\n\n finish(): void {\n this._onFinish();\n this.players.forEach(player => player.finish());\n }\n\n destroy(): void {\n this._onDestroy();\n }\n\n private _onDestroy() {\n if (!this._destroyed) {\n this._destroyed = true;\n this._onFinish();\n this.players.forEach(player => player.destroy());\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n\n reset(): void {\n this.players.forEach(player => player.reset());\n this._destroyed = false;\n this._finished = false;\n this._started = false;\n }\n\n setPosition(p: number): void {\n const timeAtPosition = p * this.totalTime;\n this.players.forEach(player => {\n const position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1;\n player.setPosition(position);\n });\n }\n\n getPosition(): number {\n const longestPlayer =\n this.players.reduce((longestSoFar: AnimationPlayer|null, player: AnimationPlayer) => {\n const newPlayerIsLongest =\n longestSoFar === null || player.totalTime > longestSoFar.totalTime;\n return newPlayerIsLongest ? player : longestSoFar;\n }, null);\n return longestPlayer != null ? longestPlayer.getPosition() : 0;\n }\n\n beforeDestroy(): void {\n this.players.forEach(player => {\n if (player.beforeDestroy) {\n player.beforeDestroy();\n }\n });\n }\n\n /** @internal */\n triggerCallback(phaseName: string): void {\n const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;\n methods.forEach(fn => fn());\n methods.length = 0;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport {AnimationGroupPlayer as ɵAnimationGroupPlayer} from './players/animation_group_player';\nexport const ɵPRE_STYLE = '!';\n","import {\n animate,\n style,\n AnimationMetadata\n} from '@angular/animations';\n\nexport const COLLAPSE_ANIMATION_TIMING = '400ms cubic-bezier(0.4,0.0,0.2,1)';\n\nexport const expandAnimation: AnimationMetadata[] = [\n style({ height: 0, visibility: 'hidden' }),\n animate(\n COLLAPSE_ANIMATION_TIMING,\n style({ height: '*', visibility: 'visible' })\n )\n];\n\nexport const collapseAnimation: AnimationMetadata[] = [\n style({ height: '*', visibility: 'visible' }),\n animate(\n COLLAPSE_ANIMATION_TIMING,\n style({ height: 0, visibility: 'hidden' })\n )\n];\n","import { NgModule, ModuleWithProviders } from '@angular/core';\n\nimport { CollapseDirective } from './collapse.directive';\n\n@NgModule({\n declarations: [CollapseDirective],\n exports: [CollapseDirective]\n})\nexport class CollapseModule {\n static forRoot(): ModuleWithProviders<CollapseModule> {\n return { ngModule: CollapseModule, providers: [] };\n }\n}\n","\n\nexport function mod(n: number, x: number): number {\n return (n % x + x) % x;\n}\n\nexport function absFloor(num: number): number {\n return num < 0 ? Math.ceil(num) || 0 : Math.floor(num);\n}\n\n","import { absFloor } from '../utils';\n\nexport function isString(str: any): str is string {\n return typeof str === 'string';\n}\n\nexport function isDate(value: any): value is Date {\n return value instanceof Date || Object.prototype.toString.call(value) === '[object Date]';\n}\n\nexport function isBoolean(value: any): value is boolean {\n return value === true || value === false;\n}\n\nexport function isDateValid(date: Date): boolean {\n return date && date.getTime && !isNaN(date.getTime());\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isFunction(fn: any): fn is Function {\n return (\n fn instanceof Function ||\n Object.prototype.toString.call(fn) === '[object Function]'\n );\n}\n\nexport function isNumber(value?: any): value is number {\n return typeof value === 'number' || Object.prototype.toString.call(value) === '[object Number]';\n}\n\nexport function isArray<T>(input?: any): input is T[] {\n return (\n input instanceof Array ||\n Object.prototype.toString.call(input) === '[object Array]'\n );\n}\n\nexport function hasOwnProp<T>(a: T /*object*/, b: string): b is Extract<keyof T, string> {\n return Object.prototype.hasOwnProperty.call(a, b);\n}\n\nexport function isObject<T>(input: any /*object*/): input is T {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return (\n input != null && Object.prototype.toString.call(input) === '[object Object]'\n );\n}\n\nexport function isObjectEmpty(obj: any): boolean {\n if (Object.getOwnPropertyNames) {\n return (Object.getOwnPropertyNames(obj).length === 0);\n }\n let k;\n for (k in obj) {\n // eslint-disable-next-line no-prototype-builtins\n if (obj.hasOwnProperty(k)) {\n return false;\n }\n }\n\n return true;\n}\n\n\nexport function isUndefined(input: any): boolean {\n return input === void 0;\n}\n\nexport function toInt<T>(argumentForCoercion: string | number | T): number {\n const coercedNumber = +argumentForCoercion;\n let value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n}\n","import { hasOwnProp, isString } from '../utils/type-checks';\nimport { DateObject, UnitOfTime } from '../types';\n\nconst aliases: { [key: string]: string } = {};\n\nexport type ExtendedUnitOfTime = UnitOfTime | 'date' | 'week' | 'isoWeek' | 'dayOfYear' |\n 'weekday' | 'isoWeekday' | 'second' | 'millisecond' | 'minute' | 'hour' | 'quarter' | 'weekYear' | 'isoWeekYear';\n\nconst _mapUnits: { [key: string]: UnitOfTime } = {\n date: 'day',\n hour: 'hours',\n minute: 'minutes',\n second: 'seconds',\n millisecond: 'milliseconds'\n};\n\nexport function addUnitAlias(unit: ExtendedUnitOfTime, shorthand: string): void {\n const lowerCase = unit.toLowerCase();\n let _unit = unit;\n if (lowerCase in _mapUnits) {\n _unit = _mapUnits[lowerCase];\n }\n aliases[lowerCase] = aliases[`${lowerCase}s`] = aliases[shorthand] = _unit;\n}\n\nexport function normalizeUnits(units: string | string[]): string {\n return isString(units) ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n}\n\nexport function normalizeObjectUnits(inputObject: Record<string, unknown>): DateObject {\n const normalizedInput: Record<string, unknown> = {};\n let normalizedProp;\n let prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n}\n","// place in new Date([array])\nexport const YEAR = 0;\nexport const MONTH = 1;\nexport const DATE = 2;\nexport const HOUR = 3;\nexport const MINUTE = 4;\nexport const SECOND = 5;\nexport const MILLISECOND = 6;\nexport const WEEK = 7;\nexport const WEEKDAY = 8;\n","export function zeroFill(num: number,\n targetLength: number,\n forceSign?: boolean): string {\n const absNumber = `${Math.abs(num)}`;\n const zerosToFill = targetLength - absNumber.length;\n const sign = num >= 0;\n const _sign = sign ? (forceSign ? '+' : '') : '-';\n // todo: this is crazy slow\n const _zeros = Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1);\n\n return (_sign + _zeros + absNumber);\n}\n","import { Locale } from '../locale/locale.class';\nimport { zeroFill } from '../utils/zero-fill';\nimport { isFunction } from '../utils/type-checks';\nimport { DateFormatterOptions, DateFormatterFn } from '../types';\n\nexport const formatFunctions: {\n [key: string]: (date: Date, locale: Locale, isUTC?: boolean, offset?: number) => string;\n} = {};\nexport const formatTokenFunctions: { [key: string]: DateFormatterFn } = {};\n\nexport const formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;\n\n// token: 'M'\n// padded: ['MM', 2]\n// ordinal: 'Mo'\n// callback: function () { this.month() + 1 }\nexport function addFormatToken(token: string,\n padded: [string, number, boolean],\n ordinal: string,\n callback: DateFormatterFn): void {\n\n if (token) {\n formatTokenFunctions[token] = callback;\n }\n\n if (padded) {\n formatTokenFunctions[padded[0]] = function (): string {\n return zeroFill(callback.apply(null, arguments), padded[1], padded[2]);\n };\n }\n\n if (ordinal) {\n formatTokenFunctions[ordinal] = function (date: Date, opts: DateFormatterOptions): string {\n return opts.locale.ordinal(callback.apply(null, arguments), token);\n };\n }\n}\n\nexport function makeFormatFunction(format: string):\n (date: Date, locale: Locale, isUTC?: boolean, offset?: number) => string {\n\n const array: string[] = format.match(formattingTokens);\n const length = array.length;\n\n const formatArr: string[] | DateFormatterFn[] = new Array(length);\n\n for (let i = 0; i < length; i++) {\n formatArr[i] = formatTokenFunctions[array[i]]\n ? formatTokenFunctions[array[i]]\n : removeFormattingTokens(array[i]);\n }\n\n return function (date: Date, locale: Locale, isUTC: boolean, offset = 0): string {\n\n let output = '';\n for (let j = 0; j < length; j++) {\n output += isFunction(formatArr[j])\n ? (formatArr[j] as DateFormatterFn).call(null, date, {format, locale, isUTC, offset})\n : formatArr[j];\n }\n\n return output;\n };\n}\n\nfunction removeFormattingTokens(input: string): string {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n\n return input.replace(/\\\\/g, '');\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function createUTCDate(y?: number, m?: number, d?: number): Date {\n // eslint-disable-next-line prefer-rest-params\n const date = new Date(Date.UTC.apply(null, arguments));\n\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n\n return date;\n}\n\nexport function createDate(y?: number,\n m = 0,\n d = 1,\n h = 0,\n M = 0,\n s = 0,\n ms = 0): Date {\n const date = new Date(y, m, d, h, M, s, ms);\n\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n\n return date;\n}\n","import { createDate } from '../create/date-from-array';\n\nexport function getHours(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCHours() : date.getHours();\n}\n\nexport function getMinutes(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCMinutes() : date.getMinutes();\n}\n\nexport function getSeconds(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCSeconds() : date.getSeconds();\n}\n\nexport function getMilliseconds(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCMilliseconds() : date.getMilliseconds();\n}\nexport function getTime(date: Date): number {\n return date.getTime();\n}\n\nexport function getDay(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCDay() : date.getDay();\n}\n\nexport function getDate(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCDate() : date.getDate();\n}\n\nexport function getMonth(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCMonth() : date.getMonth();\n}\n\nexport function getFullYear(date: Date, isUTC = false): number {\n return isUTC ? date.getUTCFullYear() : date.getFullYear();\n}\n\nexport function getUnixTime(date: Date): number {\n return Math.floor(date.valueOf() / 1000);\n}\n\nexport function unix(date: Date): number {\n return Math.floor(date.valueOf() / 1000);\n}\n\nexport function getFirstDayOfMonth(date: Date): Date {\n return createDate(\n date.getFullYear(),\n date.getMonth(),\n 1,\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n );\n}\n\nexport function daysInMonth(date: Date): number {\n return _daysInMonth(date.getFullYear(), date.getMonth());\n}\n\nexport function _daysInMonth(year: number, month: number): number {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n}\n\nexport function isFirstDayOfWeek(date: Date, firstDayOfWeek?: number): boolean {\n return date.getDay() === Number(firstDayOfWeek);\n}\n\nexport function isSameMonth(date1?: Date, date2?: Date) {\n if (!date1 || !date2) {\n return false;\n }\n\n return isSameYear(date1, date2) && getMonth(date1) === getMonth(date2);\n}\n\nexport function isSameYear(date1?: Date, date2?: Date) {\n if (!date1 || !date2) {\n return false;\n }\n\n return getFullYear(date1) === getFullYear(date2);\n}\n\nexport function isSameDay(date1?: Date, date2?: Date): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n return (\n isSameYear(date1, date2) &&\n isSameMonth(date1, date2) &&\n getDate(date1) === getDate(date2)\n );\n}\n","import { hasOwnProp, isFunction } from '../utils/type-checks';\nimport { Locale } from '../locale/locale.class';\n\nexport const match1 = /\\d/; // 0 - 9\nexport const match2 = /\\d\\d/; // 00 - 99\nexport const match3 = /\\d{3}/; // 000 - 999\nexport const match4 = /\\d{4}/; // 0000 - 9999\nexport const match6 = /[+-]?\\d{6}/; // -999999 - 999999\nexport const match1to2 = /\\d\\d?/; // 0 - 99\nexport const match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\nexport const match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\nexport const match1to3 = /\\d{1,3}/; // 0 - 999\nexport const match1to4 = /\\d{1,4}/; // 0 - 9999\nexport const match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\nexport const matchUnsigned = /\\d+/; // 0 - inf\nexport const matchSigned = /[+-]?\\d+/; // -inf - inf\n\nexport const matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\nexport const matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\nexport const matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n// any word (or two) characters or numbers including two/three word month in arabic.\n// includes scottish gaelic two word and hyphenated months\nexport const matchWord = /[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i;\n\nexport type RegExpTokenFn = (isStrict: boolean, locale: Locale) => RegExp;\nconst regexes: {[key: string]: RegExpTokenFn} = {};\n\n\nexport function addRegexToken(token: string, regex: RegExp | RegExpTokenFn, strictRegex?: RegExp): void {\n if (isFunction(regex)) {\n regexes[token] = regex;\n\n return;\n }\n\n regexes[token] = function (isStrict: boolean, locale: Locale) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n}\n\nexport function getParseRegexForToken(token: string, locale: Locale): RegExp {\n const _strict = false;\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](_strict, locale);\n}\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\nfunction unescapeFormat(str: string): string {\n return regexEscape(str\n .replace('\\\\', '')\n .replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, (matched, p1, p2, p3, p4) => p1 || p2 || p3 || p4)\n );\n}\n\nexport function regexEscape(str: string): string {\n return str.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n","import { hasOwnProp, isArray, isFunction, isNumber, isString, toInt } from '../utils/type-checks';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { DateArray, DateParseTokenFn } from '../types';\n\nconst tokens: {[key: string]: DateParseTokenFn} = {};\n\nexport function addParseToken(token: string | string[], callback: DateParseTokenFn | number) {\n const _token = isString(token) ? [token] : token;\n let func = callback;\n\n if (isNumber(callback)) {\n func = function (input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n array[callback] = toInt(input);\n\n return config;\n };\n }\n\n if (isArray<string>(_token) && isFunction(func)) {\n let i;\n for (i = 0; i < _token.length; i++) {\n tokens[_token[i]] = func;\n }\n }\n}\n\nexport function addWeekParseToken(token: string[], callback: DateParseTokenFn): void {\n addParseToken(token, function (input: string, array: DateArray, config: DateParsingConfig, _token: string): DateParsingConfig {\n config._w = config._w || {};\n\n return callback(input, config._w, config, _token);\n });\n}\n\n\nexport function addTimeToArrayFromToken(token: string, input: string, config: DateParsingConfig): DateParsingConfig {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n\n return config;\n}\n","const priorities: {[key: string]: number} = {};\n\nexport function addUnitPriority(unit: string, priority: number): void {\n priorities[unit] = priority;\n}\n\n/*\nexport function getPrioritizedUnits(unitsObj) {\n const units = [];\n let unit;\n for (unit in unitsObj) {\n if (unitsObj.hasOwnProperty(unit)) {\n units.push({ unit, priority: priorities[unit] });\n }\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n\n return units;\n}\n*/\n","import { DateParsingConfig, DateParsingFlags } from './parsing.types';\n\nfunction defaultParsingFlags(): DateParsingFlags {\n // We need to deep clone this object.\n return {\n empty: false,\n unusedTokens: [],\n unusedInput: [],\n overflow: -2,\n charsLeftOver: 0,\n nullInput: false,\n invalidMonth: null,\n invalidFormat: false,\n userInvalidated: false,\n iso: false,\n parsedDateParts: [],\n meridiem: null,\n rfc2822: false,\n weekdayMismatch: false\n };\n}\n\nexport function getParsingFlags(config: DateParsingConfig): DateParsingFlags {\n if (config._pf == null) {\n config._pf = defaultParsingFlags();\n }\n\n return config._pf;\n}\n","import { addFormatToken } from '../format/format';\nimport { getFullYear } from '../utils/date-getters';\nimport { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { YEAR } from './constants';\nimport { toInt } from '../utils/type-checks';\nimport { addUnitPriority } from './priorities';\nimport { addUnitAlias } from './aliases';\nimport { DateFormatterOptions } from '../types';\n\n// FORMATTING\n\nfunction getYear(date: Date, opts: DateFormatterOptions): string {\n if (opts.locale.getFullYear) {\n return opts.locale.getFullYear(date, opts.isUTC).toString();\n }\n return getFullYear(date, opts.isUTC).toString();\n}\n\nexport function initYear() {\n addFormatToken('Y', null, null,\n function (date: Date, opts: DateFormatterOptions): string {\n const y = getFullYear(date, opts.isUTC);\n\n return y <= 9999 ? y.toString(10) : `+${y}`;\n });\n\n addFormatToken(null, ['YY', 2, false], null,\n function (date: Date, opts: DateFormatterOptions): string {\n return (getFullYear(date, opts.isUTC) % 100).toString(10);\n });\n\n addFormatToken(null, ['YYYY', 4, false], null, getYear);\n addFormatToken(null, ['YYYYY', 5, false], null, getYear);\n addFormatToken(null, ['YYYYYY', 6, true], null, getYear);\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PRIORITIES\n\n addUnitPriority('year', 1);\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array, config) {\n array[YEAR] = input.length === 2 ? parseTwoDigitYear(input) : toInt(input);\n\n return config;\n });\n addParseToken('YY', function (input, array, config) {\n array[YEAR] = parseTwoDigitYear(input);\n\n return config;\n });\n addParseToken('Y', function (input, array, config) {\n array[YEAR] = parseInt(input, 10);\n\n return config;\n });\n}\n\nexport function parseTwoDigitYear(input: string): number {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n}\n\nexport function daysInYear(year: number): number {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function isLeapYear(year: number): boolean {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n","import { addFormatToken } from '../format/format';\nimport { isLeapYear } from './year';\nimport { mod } from '../utils';\nimport { getMonth } from '../utils/date-getters';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { MONTH } from './constants';\nimport { toInt } from '../utils/type-checks';\nimport { addUnitPriority } from './priorities';\nimport { addUnitAlias } from './aliases';\nimport { getParsingFlags } from '../create/parsing-flags';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { DateArray, DateFormatterOptions } from '../types';\n\n// todo: this is duplicate, source in date-getters.ts\nexport function daysInMonth(year: number, month: number): number {\n if (isNaN(year) || isNaN(month)) {\n return NaN;\n }\n const modMonth = mod(month, 12);\n const _year = year + (month - modMonth) / 12;\n\n return modMonth === 1\n ? isLeapYear(_year) ? 29 : 28\n : (31 - modMonth % 7 % 2);\n}\n\nexport function initMonth() {\n// FORMATTING\n\n addFormatToken('M', ['MM', 2, false], 'Mo',\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMonth(date, opts.isUTC) + 1).toString(10);\n }\n );\n\n addFormatToken('MMM', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.locale.monthsShort(date, opts.format, opts.isUTC);\n }\n );\n\n addFormatToken('MMMM', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.locale.months(date, opts.format, opts.isUTC);\n }\n );\n\n\n// ALIASES\n\n addUnitAlias('month', 'M');\n\n// PRIORITY\n\n addUnitPriority('month', 8);\n\n// PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function(isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function(isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n array[MONTH] = toInt(input) - 1;\n\n return config;\n });\n\n addParseToken(\n ['MMM', 'MMMM'],\n function(input: string, array: DateArray, config: DateParsingConfig, token: string): DateParsingConfig {\n const month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = !!input;\n }\n\n return config;\n }\n );\n}\n","import { TimeUnit } from '../types';\nimport { daysInMonth } from '../units/month';\nimport { isNumber } from './type-checks';\nimport { getDate, getFullYear, getMonth } from './date-getters';\nimport { isLeapYear } from '../units/year';\nimport { createDate } from '../create/date-from-array';\n\nconst defaultTimeUnit: TimeUnit = {\n year: 0,\n month: 0,\n day: 0,\n hour: 0,\n minute: 0,\n seconds: 0\n};\n\nexport function shiftDate(date: Date, unit: TimeUnit): Date {\n const _unit = Object.assign({}, defaultTimeUnit, unit);\n const year = date.getFullYear() + (_unit.year || 0);\n const month = date.getMonth() + (_unit.month || 0);\n let day = date.getDate() + (_unit.day || 0);\n if (_unit.month && !_unit.day) {\n day = Math.min(day, daysInMonth(year, month));\n }\n\n return createDate(\n year,\n month,\n day,\n date.getHours() + (_unit.hour || 0),\n date.getMinutes() + (_unit.minute || 0),\n date.getSeconds() + (_unit.seconds || 0)\n );\n}\n\nexport function setFullDate(date: Date, unit: TimeUnit): Date {\n return createDate(\n getNum(date.getFullYear(), unit.year),\n getNum(date.getMonth(), unit.month),\n 1, // day, to avoid issue with wrong months selection at the end of current month (#5371)\n getNum(date.getHours(), unit.hour),\n getNum(date.getMinutes(), unit.minute),\n getNum(date.getSeconds(), unit.seconds),\n getNum(date.getMilliseconds(), unit.milliseconds)\n );\n}\n\nfunction getNum(def: number, num?: number): number {\n return isNumber(num) ? num : def;\n}\n\nexport function setFullYear(date: Date, value: number, isUTC?: boolean): Date {\n const _month = getMonth(date, isUTC);\n const _date = getDate(date, isUTC);\n const _year = getFullYear(date, isUTC);\n if (isLeapYear(_year) && _month === 1 && _date === 29) {\n const _daysInMonth = daysInMonth(value, _month);\n isUTC ? date.setUTCFullYear(value, _month, _daysInMonth) : date.setFullYear(value, _month, _daysInMonth);\n }\n\n isUTC ? date.setUTCFullYear(value) : date.setFullYear(value);\n\n return date;\n}\n\nexport function setMonth(date: Date, value: number, isUTC?: boolean): Date {\n const dayOfMonth = Math.min(getDate(date), daysInMonth(getFullYear(date), value));\n isUTC ? date.setUTCMonth(value, dayOfMonth) : date.setMonth(value, dayOfMonth);\n\n return date;\n}\n\nexport function setDay(date: Date, value: number, isUTC?: boolean): Date {\n isUTC ? date.setUTCDate(value) : date.setDate(value);\n\n return date;\n}\n\nexport function setHours(date: Date, value: number, isUTC?: boolean): Date {\n isUTC ? date.setUTCHours(value) : date.setHours(value);\n\n return date;\n}\n\nexport function setMinutes(date: Date, value: number, isUTC?: boolean): Date {\n isUTC ? date.setUTCMinutes(value) : date.setMinutes(value);\n\n return date;\n}\n\nexport function setSeconds(date: Date, value: number, isUTC?: boolean): Date {\n isUTC ? date.setUTCSeconds(value) : date.setSeconds(value);\n\n return date;\n}\n\nexport function setMilliseconds(date: Date, value: number, isUTC?: boolean): Date {\n isUTC ? date.setUTCMilliseconds(value) : date.setMilliseconds(value);\n\n return date;\n}\n\nexport function setDate(date: Date, value: number, isUTC?: boolean): Date {\n isUTC ? date.setUTCDate(value) : date.setDate(value);\n\n return date;\n}\n\nexport function setTime(date: Date, value: number): Date {\n date.setTime(value);\n\n return date;\n}\n","// fastest way to clone date\n// https://jsperf.com/clone-date-object2\nexport function cloneDate(date: Date): Date {\n return new Date(date.getTime());\n}\n","import { TimeUnit, UnitOfTime } from '../types';\nimport {\n setDate, setFullDate, setHours, setMilliseconds, setMinutes, setMonth, setSeconds,\n shiftDate\n} from './date-setters';\nimport { cloneDate } from '../create/clone';\nimport { setISODayOfWeek, setLocaleDayOfWeek } from '../units/day-of-week';\nimport { getMonth } from './date-getters';\nimport { add, subtract } from '../moment/add-subtract';\n\nexport function startOf(date: Date, unit: UnitOfTime, isUTC?: boolean): Date {\n const _date = cloneDate(date);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (unit) {\n case 'year':\n setMonth(_date, 0, isUTC);\n /* falls through */\n case 'quarter':\n case 'month':\n setDate(_date, 1, isUTC);\n /* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n case 'date':\n setHours(_date, 0, isUTC);\n /* falls through */\n case 'hours':\n setMinutes(_date, 0, isUTC);\n /* falls through */\n case 'minutes':\n setSeconds(_date, 0, isUTC);\n /* falls through */\n case 'seconds':\n setMilliseconds(_date, 0, isUTC);\n }\n\n // weeks are a special case\n if (unit === 'week') {\n setLocaleDayOfWeek(_date, 0, {isUTC});\n }\n if (unit === 'isoWeek') {\n setISODayOfWeek(_date, 1);\n }\n\n // quarters are also special\n if (unit === 'quarter') {\n setMonth(_date, Math.floor(getMonth(_date, isUTC) / 3) * 3, isUTC);\n }\n\n return _date;\n}\n\nexport function endOf(date: Date, unit: UnitOfTime, isUTC?: boolean): Date {\n let _unit = unit;\n // 'date' is an alias for 'day', so it should be considered as such.\n if (_unit === 'date') {\n _unit = 'day';\n }\n\n const start = startOf(date, _unit, isUTC);\n const _step = add(start, 1, _unit === 'isoWeek' ? 'week' : _unit, isUTC);\n const res = subtract(_step, 1, 'milliseconds', isUTC);\n\n return res;\n}\n","import { addFormatToken } from '../format/format';\nimport { Locale } from '../locale/locale.class';\nimport { getDay } from '../utils/date-getters';\nimport { addRegexToken, match1to2 } from '../parse/regex';\nimport { addUnitAlias } from './aliases';\nimport { addUnitPriority } from './priorities';\nimport { addWeekParseToken } from '../parse/token';\nimport { getParsingFlags } from '../create/parsing-flags';\nimport { isNumber, isString, toInt } from '../utils/type-checks';\nimport { DateFormatterOptions, WeekParsing } from '../types';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { add } from '../moment/add-subtract';\nimport { getLocale } from '../locale/locales';\n\n\nexport function initDayOfWeek() {\n// FORMATTING\n\n addFormatToken('d', null, 'do',\n function(date: Date, opts: DateFormatterOptions): string {\n return getDay(date, opts.isUTC)\n .toString(10);\n }\n );\n\n addFormatToken('dd', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.locale.weekdaysMin(date, opts.format, opts.isUTC);\n }\n );\n\n addFormatToken('ddd', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.locale.weekdaysShort(date, opts.format, opts.isUTC);\n }\n );\n\n addFormatToken('dddd', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.locale.weekdays(date, opts.format, opts.isUTC);\n }\n );\n\n addFormatToken('e', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return getLocaleDayOfWeek(date, opts.locale, opts.isUTC)\n .toString(10);\n // return getDay(date, opts.isUTC).toString(10);\n }\n );\n addFormatToken('E', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return getISODayOfWeek(date, opts.isUTC)\n .toString(10);\n }\n );\n\n// ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n// PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n// PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n\n addRegexToken('dd', function(isStrict: boolean, locale: Locale): RegExp {\n return locale.weekdaysMinRegex(isStrict);\n });\n\n addRegexToken('ddd', function(isStrict: boolean, locale: Locale): RegExp {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function(isStrict: boolean, locale: Locale): RegExp {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(\n ['dd', 'ddd', 'dddd'],\n function(input: string, week: WeekParsing, config: DateParsingConfig, token) {\n const weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week[\"d\"] = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = !!input;\n }\n\n return config;\n }\n );\n\n addWeekParseToken(\n ['d', 'e', 'E'],\n function(input: string, week: WeekParsing, config: DateParsingConfig, token: string): DateParsingConfig {\n week[token] = toInt(input);\n\n return config;\n }\n );\n}\n\n// HELPERS\n\nexport function parseWeekday(input: string | number, locale: Locale): number {\n if (!isString(input)) {\n return input;\n }\n\n const _num = parseInt(input, 10);\n if (!isNaN(_num)) {\n return _num;\n }\n\n const _weekDay = locale.weekdaysParse(input);\n if (isNumber(_weekDay)) {\n return _weekDay;\n }\n\n return null;\n}\n\nexport function parseIsoWeekday(input: string | number, locale: Locale = getLocale()): number {\n if (isString(input)) {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n\n return isNumber(input) && isNaN(input) ? null : input;\n}\n\n// MOMENTS\n\nexport function getSetDayOfWeek(date: Date, input: number, opts: { isUTC?: boolean; locale: Locale }): Date | number {\n if (!input) {\n return getDayOfWeek(date, opts.isUTC);\n }\n\n return setDayOfWeek(date, input, opts.locale, opts.isUTC);\n}\n\nexport function setDayOfWeek(date: Date, input: number, locale = getLocale(), isUTC?: boolean): Date {\n const day = getDay(date, isUTC);\n const _input = parseWeekday(input, locale);\n\n return add(date, _input - day, 'day');\n}\n\nexport function getDayOfWeek(date: Date, isUTC?: boolean): number {\n return getDay(date, isUTC);\n}\n\n/********************************************/\n\n// todo: utc\n// getSetLocaleDayOfWeek\nexport function getLocaleDayOfWeek(date: Date, locale = getLocale(), isUTC?: boolean): number {\n return (getDay(date, isUTC) + 7 - locale.firstDayOfWeek()) % 7;\n}\n\nexport function setLocaleDayOfWeek(date: Date, input: number, opts: { locale?: Locale; isUTC?: boolean } = {}): Date {\n const weekday = getLocaleDayOfWeek(date, opts.locale, opts.isUTC);\n\n return add(date, input - weekday, 'day');\n}\n\n\n// getSetISODayOfWeek\nexport function getISODayOfWeek(date: Date, isUTC?: boolean): number {\n return getDay(date, isUTC) || 7;\n}\n\nexport function setISODayOfWeek(date: Date, input: number | string, opts: { locale?: Locale } = {}): Date {\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n const weekday = parseIsoWeekday(input, opts.locale);\n\n return setDayOfWeek(date, getDayOfWeek(date) % 7 ? weekday : weekday - 7);\n}\n","import { createDuration } from '../duration/create';\nimport { absRound } from '../utils/abs-round';\nimport { Duration } from '../duration/constructor';\nimport { getDate, getMonth, getTime } from '../utils/date-getters';\nimport { setDate, setMonth, setTime } from '../utils/date-setters';\nimport { cloneDate } from '../create/clone';\nimport { UnitOfTime } from '../types';\n\nexport function add(date: Date, val: number, period: UnitOfTime, isUTC?: boolean): Date {\n const dur = createDuration(val, period);\n\n return addSubtract(date, dur, 1, isUTC);\n}\n\nexport function subtract(date: Date, val: number, period: UnitOfTime, isUTC?: boolean): Date {\n const dur = createDuration(val, period);\n\n return addSubtract(date, dur, -1, isUTC);\n}\n\nexport function addSubtract(date: Date, duration: Duration, isAdding: number, isUTC?: boolean): Date {\n const milliseconds = duration._milliseconds;\n const days = absRound(duration._days);\n const months = absRound(duration._months);\n\n // todo: add timezones support\n // const _updateOffset = updateOffset == null ? true : updateOffset;\n\n if (months) {\n setMonth(date, getMonth(date, isUTC) + months * isAdding, isUTC);\n }\n if (days) {\n setDate(date, getDate(date, isUTC) + days * isAdding, isUTC);\n }\n if (milliseconds) {\n setTime(date, getTime(date) + milliseconds * isAdding);\n }\n\n return cloneDate(date);\n // todo: add timezones support\n // if (_updateOffset) {\n // hooks.updateOffset(date, days || months);\n // }\n}\n","import { addFormatToken } from '../format/format';\nimport { startOf } from '../utils/start-end-of';\nimport { addRegexToken, match1to3, match3 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { addUnitPriority } from './priorities';\nimport { addUnitAlias } from './aliases';\nimport { DateArray, DateFormatterOptions } from '../types';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { toInt } from '../utils/type-checks';\nimport { add } from '../moment/add-subtract';\n\n\nexport function initDayOfYear() {\n// FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3, false], 'DDDo',\n function(date: Date): string {\n return getDayOfYear(date)\n .toString(10);\n }\n );\n\n\n// ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n// PRIORITY\n\n addUnitPriority('dayOfYear', 4);\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(\n ['DDD', 'DDDD'],\n function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n config._dayOfYear = toInt(input);\n\n return config;\n }\n );\n}\n\nexport function getDayOfYear(date: Date, isUTC?: boolean): number {\n const date1 = +startOf(date, 'day', isUTC);\n const date2 = +startOf(date, 'year', isUTC);\n const someDate = date1 - date2;\n const oneDay = 1000 * 60 * 60 * 24;\n\n return Math.round(someDate / oneDay) + 1;\n}\n\nexport function setDayOfYear(date: Date, input: number): Date {\n const dayOfYear = getDayOfYear(date);\n\n return add(date, (input - dayOfYear), 'day');\n}\n","/**\n *\n * @param {number} year\n * @param {number} dow - start-of-first-week\n * @param {number} doy - start-of-year\n * @returns {number}\n */\nimport { createUTCDate } from '../create/date-from-array';\nimport { daysInYear } from './year';\nimport { getDayOfYear } from './day-of-year';\nimport { getFullYear } from '../utils/date-getters';\n\nfunction firstWeekOffset(year: number, dow: number, doy: number): number {\n // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n const fwd = dow - doy + 7;\n // first-week day local weekday -- which local weekday is fwd\n const fwdlw = (createUTCDate(year, 0, fwd).getUTCDay() - dow + 7) % 7;\n\n return -fwdlw + fwd - 1;\n}\n\n// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\nexport function dayOfYearFromWeeks(\n year: number,\n week: number,\n weekday: number,\n dow: number,\n doy: number\n): { year: number; dayOfYear: number } {\n const localWeekday = (7 + weekday - dow) % 7;\n const weekOffset = firstWeekOffset(year, dow, doy);\n const dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset;\n let resYear: number;\n let resDayOfYear: number;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n}\n\nexport function weekOfYear(date: Date, dow: number, doy: number, isUTC?: boolean): { week: number; year: number } {\n const weekOffset = firstWeekOffset(getFullYear(date, isUTC), dow, doy);\n const week = Math.floor((getDayOfYear(date, isUTC) - weekOffset - 1) / 7) + 1;\n let resWeek: number;\n let resYear: number;\n\n if (week < 1) {\n resYear = getFullYear(date, isUTC) - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(getFullYear(date, isUTC), dow, doy)) {\n resWeek = week - weeksInYear(getFullYear(date, isUTC), dow, doy);\n resYear = getFullYear(date, isUTC) + 1;\n } else {\n resYear = getFullYear(date, isUTC);\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n}\n\nexport function weeksInYear(year: number, dow: number, doy: number): number {\n const weekOffset = firstWeekOffset(year, dow, doy);\n const weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n}\n","import { weekOfYear } from '../units/week-calendar-utils';\nimport { hasOwnProp, isArray, isFunction } from '../utils/type-checks';\nimport { getDay, getMonth, getFullYear } from '../utils/date-getters';\nimport { matchWord, regexEscape } from '../parse/regex';\nimport { setDayOfWeek } from '../units/day-of-week';\n\nexport interface LocaleOptionsFormat {\n format: string[];\n standalone: string[];\n isFormat?: RegExp;\n}\n\nexport type LocaleOptions = string[] | LocaleOptionsFormat;\n\nconst MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\nexport const defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n);\nexport const defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(\n '_'\n);\nexport const defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n);\nexport const defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split(\n '_'\n);\nexport const defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\nexport const defaultLongDateFormat: { [index: string]: string } = {\n LTS: 'h:mm:ss A',\n LT: 'h:mm A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A'\n};\n\nexport const defaultOrdinal = '%d';\nexport const defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\nconst defaultMonthsShortRegex = matchWord;\nconst defaultMonthsRegex = matchWord;\n\nexport type OrdinalDateFn = (num: number, token?: string) => string;\nexport type PluralizeDateFn = (num: number, withoutSuffix: boolean,\n key?: string, isFuture?: boolean) => string;\n\nexport interface LocaleData {\n abbr?: string;\n parentLocale?: string;\n\n months?: LocaleOptions | ((date: Date, format: string, isUTC?: boolean) => string | string[]);\n monthsShort?: LocaleOptions | ((date: Date, format: string, isUTC?: boolean) => string | string[]);\n monthsParseExact?: boolean;\n\n weekdays?: LocaleOptions | ((date: Date, format: string, isUTC?: boolean) => string | string[]);\n weekdaysShort?: string[] | ((date: Date, format: string, isUTC?: boolean) => string | string[]);\n weekdaysMin?: string[] | ((date: Date, format: string, isUTC?: boolean) => string | string[]);\n weekdaysParseExact?: boolean;\n\n longDateFormat?: { [index: string]: string };\n calendar?: {\n [key: string]: (string\n | ((date: Date, now?: Date) => string)\n | ((dayOfWeek: number, isNextWeek: boolean) => string))\n };\n relativeTime?: { [key: string]: string | PluralizeDateFn };\n dayOfMonthOrdinalParse?: RegExp;\n ordinal?: string | OrdinalDateFn;\n\n week?: { dow?: number; doy?: number };\n\n invalidDate?: string;\n\n monthsRegex?: RegExp;\n monthsParse?: RegExp[];\n monthsShortRegex?: RegExp;\n monthsStrictRegex?: RegExp;\n monthsShortStrictRegex?: RegExp;\n longMonthsParse?: RegExp[];\n shortMonthsParse?: RegExp[];\n\n meridiemParse?: RegExp;\n\n meridiemHour?(hour: number, meridiem: string): number;\n\n preparse?(str: string, format?: string | string[]): string;\n\n postformat?(str: string | number): string;\n\n meridiem?(hour: number, minute?: number, isLower?: boolean): string;\n\n isPM?(input: string): boolean;\n\n getFullYear?(date: Date, isUTC: boolean): number;\n}\n\nexport class Locale {\n parentLocale?: Locale;\n _abbr: string;\n _config: LocaleData;\n meridiemHour: (hour: number, meridiem: string) => number;\n\n _invalidDate: string;\n _week: { dow: number; doy: number };\n _dayOfMonthOrdinalParse: RegExp;\n _ordinalParse: RegExp;\n _meridiemParse: RegExp;\n\n private _calendar: { [key: string]: string };\n private _relativeTime: { future: string; past: string };\n private _months: LocaleOptions;\n private _monthsShort: LocaleOptions;\n private _monthsRegex: RegExp;\n private _monthsShortRegex: RegExp;\n private _monthsStrictRegex: RegExp;\n private _monthsShortStrictRegex: RegExp;\n private _monthsParse: RegExp[];\n private _longMonthsParse: string[] | RegExp[];\n private _shortMonthsParse: string[] | RegExp[];\n private _monthsParseExact: RegExp;\n private _weekdaysParseExact: boolean;\n private _weekdaysRegex: RegExp;\n private _weekdaysShortRegex: RegExp;\n private _weekdaysMinRegex: RegExp;\n\n private _weekdaysStrictRegex: RegExp;\n private _weekdaysShortStrictRegex: RegExp;\n private _weekdaysMinStrictRegex: RegExp;\n\n private _weekdays: LocaleOptions;\n private _weekdaysShort: string[];\n private _weekdaysMin: string[];\n private _weekdaysParse: string[] | RegExp[];\n private _minWeekdaysParse: string[] | RegExp[];\n private _shortWeekdaysParse: string[] | RegExp[];\n private _fullWeekdaysParse: RegExp[];\n private _longDateFormat: { [key: string]: string };\n\n private _ordinal: string;\n\n constructor(config: LocaleData) {\n if (config) {\n this.set(config);\n }\n }\n\n set(config: LocaleData): void {\n let confKey;\n for (confKey in config) {\n // eslint-disable-next-line no-prototype-builtins\n if (!config.hasOwnProperty(confKey)) {\n continue;\n }\n const prop = config[confKey as keyof LocaleData];\n const key = (isFunction(prop) ? confKey : `_${confKey}`) as keyof Locale;\n\n this[key] = prop as any;\n }\n\n this._config = config;\n }\n\n calendar(key: string, date: Date, now: Date): string {\n const output = this._calendar[key] || this._calendar[\"sameElse\"];\n\n return isFunction(output) ? output.call(null, date, now) : output;\n }\n\n longDateFormat(key: string) {\n const format = this._longDateFormat[key];\n const formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val: string) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n get invalidDate(): string {\n return this._invalidDate;\n }\n\n set invalidDate(val: string) {\n this._invalidDate = val;\n }\n\n ordinal(num: number, token?: string): string {\n return this._ordinal.replace('%d', num.toString(10));\n }\n\n preparse(str: string, format?: string | string[]) {\n return str;\n }\n\n\n getFullYear(date: Date, isUTC = false): number {\n return getFullYear(date, isUTC);\n }\n\n postformat(str: string) {\n return str;\n }\n\n relativeTime(num: number, withoutSuffix: boolean, str: 'future' | 'past', isFuture: boolean): string {\n const output = this._relativeTime[str];\n\n return (isFunction(output)) ?\n output(num, withoutSuffix, str, isFuture) :\n output.replace(/%d/i, num.toString(10));\n }\n\n pastFuture(diff: number, output: string): string {\n const format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n /** Months */\n months(): string[];\n months(date: Date, format?: string, isUTC?: boolean): string;\n months(date?: Date, format?: string, isUTC = false): string | string[] {\n if (!date) {\n return isArray<string>(this._months)\n ? this._months\n : this._months.standalone;\n }\n\n if (isArray<string>(this._months)) {\n return this._months[getMonth(date, isUTC)];\n }\n\n const key = (this._months.isFormat || MONTHS_IN_FORMAT).test(format)\n ? 'format'\n : 'standalone';\n\n return this._months[key][getMonth(date, isUTC)];\n }\n\n monthsShort(): string[];\n monthsShort(date?: Date, format?: string, isUTC?: boolean): string;\n monthsShort(date?: Date, format?: string, isUTC = false): string | string[] {\n if (!date) {\n return isArray<string>(this._monthsShort)\n ? this._monthsShort\n : this._monthsShort.standalone;\n }\n\n if (isArray<string>(this._monthsShort)) {\n return this._monthsShort[getMonth(date, isUTC)];\n }\n const key = MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone';\n\n return this._monthsShort[key][getMonth(date, isUTC)];\n }\n\n monthsParse(monthName: string, format?: string, strict?: boolean): number {\n let date;\n let regex;\n\n if (this._monthsParseExact) {\n return this.handleMonthStrictParse(monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n let i;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n date = new Date(Date.UTC(2000, i));\n if (strict && !this._longMonthsParse[i]) {\n const _months = this.months(date, '', true).replace('.', '');\n const _shortMonths = this.monthsShort(date, '', true).replace('.', '');\n this._longMonthsParse[i] = new RegExp(`^${_months}$`, 'i');\n this._shortMonthsParse[i] = new RegExp(`^${_shortMonths}$`, 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = `^${this.months(date, '', true)}|^${this.monthsShort(date, '', true)}`;\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // testing the regex\n if (strict && format === 'MMMM' && (this._longMonthsParse[i] as RegExp).test(monthName)) {\n return i;\n }\n\n if (strict && format === 'MMM' && (this._shortMonthsParse[i] as RegExp).test(monthName)) {\n return i;\n }\n\n if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n monthsRegex(isStrict: boolean): RegExp {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this.computeMonthsParse();\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n }\n\n return this._monthsRegex;\n }\n\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n\n monthsShortRegex(isStrict: boolean): RegExp {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this.computeMonthsParse();\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n }\n\n return this._monthsShortRegex;\n }\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n\n /** Week */\n week(date: Date, isUTC?: boolean): number {\n return weekOfYear(date, this._week.dow, this._week.doy, isUTC).week;\n }\n\n firstDayOfWeek(): number {\n return this._week.dow;\n }\n\n firstDayOfYear(): number {\n return this._week.doy;\n }\n\n /** Day of Week */\n weekdays(): string[];\n weekdays(date: Date, format?: string, isUTC?: boolean): string;\n weekdays(date?: Date, format?: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return isArray<string>(this._weekdays)\n ? this._weekdays\n : this._weekdays.standalone;\n }\n\n if (isArray<string>(this._weekdays)) {\n return this._weekdays[getDay(date, isUTC)];\n }\n\n const _key = this._weekdays.isFormat.test(format)\n ? 'format'\n : 'standalone';\n\n return this._weekdays[_key][getDay(date, isUTC)];\n }\n\n weekdaysMin(): string[];\n weekdaysMin(date: Date, format?: string, isUTC?: boolean): string;\n weekdaysMin(date?: Date, format?: string, isUTC?: boolean): string | string[] {\n return date ? this._weekdaysMin[getDay(date, isUTC)] : this._weekdaysMin;\n }\n\n weekdaysShort(): string[];\n weekdaysShort(date: Date, format?: string, isUTC?: boolean): string;\n weekdaysShort(date?: Date, format?: string, isUTC?: boolean): string | string[] {\n return date ? this._weekdaysShort[getDay(date, isUTC)] : this._weekdaysShort;\n }\n\n\n // proto.weekdaysParse = localeWeekdaysParse;\n weekdaysParse(weekdayName?: string, format?: string, strict?: boolean): number {\n let i;\n let regex;\n\n if (this._weekdaysParseExact) {\n return this.handleWeekStrictParse(weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n // fix: here is the issue\n const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp(`^${this.weekdays(date, '', true).replace('.', '\\.?')}$`, 'i');\n this._shortWeekdaysParse[i] = new RegExp(`^${this.weekdaysShort(date, '', true).replace('.', '\\.?')}$`, 'i');\n this._minWeekdaysParse[i] = new RegExp(`^${this.weekdaysMin(date, '', true).replace('.', '\\.?')}$`, 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = `^${this.weekdays(date, '', true)}|^${this.weekdaysShort(date, '', true)}|^${this.weekdaysMin(date, '', true)}`;\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n\n if (!isArray<RegExp>(this._fullWeekdaysParse)\n || !isArray<RegExp>(this._shortWeekdaysParse)\n || !isArray<RegExp>(this._minWeekdaysParse)\n || !isArray<RegExp>(this._weekdaysParse)) {\n return;\n }\n\n // testing the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // proto.weekdaysRegex = weekdaysRegex;\n weekdaysRegex(isStrict: boolean) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this.computeWeekdaysParse();\n }\n\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = matchWord;\n }\n\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n // proto.weekdaysShortRegex = weekdaysShortRegex;\n // proto.weekdaysMinRegex = weekdaysMinRegex;\n\n\n weekdaysShortRegex(isStrict?: boolean): RegExp {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this.computeWeekdaysParse();\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = matchWord;\n }\n\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n weekdaysMinRegex(isStrict?: boolean): RegExp {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this.computeWeekdaysParse();\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = matchWord;\n }\n\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n isPM(input: string): boolean {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return input.toLowerCase().charAt(0) === 'p';\n }\n\n meridiem(hours: number, minutes: number, isLower: boolean): string {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n }\n\n return isLower ? 'am' : 'AM';\n }\n\n formatLongDate(key: string) {\n this._longDateFormat = this._longDateFormat ? this._longDateFormat : defaultLongDateFormat;\n const format = this._longDateFormat[key];\n const formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[\n key\n ] = formatUpper.replace(/MMMM|MM|DD|dddd/g, (val: string) => {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n private handleMonthStrictParse(monthName: string, format: string, strict?: boolean) {\n const llc = monthName.toLocaleLowerCase();\n let i;\n let ii;\n let mom;\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = new Date(2000, i);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = (this._shortMonthsParse as string[]).indexOf(llc);\n\n return ii !== -1 ? ii : null;\n }\n ii = (this._longMonthsParse as string[]).indexOf(llc);\n\n return ii !== -1 ? ii : null;\n }\n\n if (format === 'MMM') {\n ii = (this._shortMonthsParse as string[]).indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n\n ii = (this._longMonthsParse as string[]).indexOf(llc);\n\n return ii !== -1 ? ii : null;\n }\n\n ii = (this._longMonthsParse as string[]).indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = (this._shortMonthsParse as string[]).indexOf(llc);\n\n return ii !== -1 ? ii : null;\n }\n\n private handleWeekStrictParse(weekdayName: string, format: string, strict: boolean): number {\n let ii;\n const llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n let i;\n for (i = 0; i < 7; ++i) {\n const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);\n this._minWeekdaysParse[i] = this.weekdaysMin(date).toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(date).toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(date, '').toLocaleLowerCase();\n }\n }\n\n if (!isArray<string>(this._weekdaysParse)\n || !isArray<string>(this._shortWeekdaysParse)\n || !isArray<string>(this._minWeekdaysParse)) {\n return;\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = this._weekdaysParse.indexOf(llc);\n\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = this._shortWeekdaysParse.indexOf(llc);\n\n return ii !== -1 ? ii : null;\n } else {\n ii = this._minWeekdaysParse.indexOf(llc);\n\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = this._weekdaysParse.indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = this._shortWeekdaysParse.indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = this._minWeekdaysParse.indexOf(llc);\n\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = this._shortWeekdaysParse.indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = this._weekdaysParse.indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = this._minWeekdaysParse.indexOf(llc);\n\n return ii !== -1 ? ii : null;\n } else {\n ii = this._minWeekdaysParse.indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = this._weekdaysParse.indexOf(llc);\n if (ii !== -1) {\n return ii;\n }\n ii = this._shortWeekdaysParse.indexOf(llc);\n\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n private computeMonthsParse() {\n const shortPieces: string[] = [];\n const longPieces: string[] = [];\n const mixedPieces: string[] = [];\n let date;\n\n let i;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n date = new Date(2000, i);\n shortPieces.push(this.monthsShort(date, ''));\n longPieces.push(this.months(date, ''));\n mixedPieces.push(this.months(date, ''));\n mixedPieces.push(this.monthsShort(date, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp(`^(${mixedPieces.join('|')})`, 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp(`^(${longPieces.join('|')})`, 'i');\n this._monthsShortStrictRegex = new RegExp(`^(${shortPieces.join('|')})`, 'i');\n }\n\n private computeWeekdaysParse() {\n const minPieces = [];\n const shortPieces = [];\n const longPieces = [];\n const mixedPieces = [];\n\n let i;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n // let mom = createUTC([2000, 1]).day(i);\n const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);\n const minp = this.weekdaysMin(date);\n const shortp = this.weekdaysShort(date);\n const longp = this.weekdays(date);\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp(`^(${mixedPieces.join('|')})`, 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp(`^(${longPieces.join('|')})`, 'i');\n this._weekdaysShortStrictRegex = new RegExp(`^(${shortPieces.join('|')})`, 'i');\n this._weekdaysMinStrictRegex = new RegExp(`^(${minPieces.join('|')})`, 'i');\n }\n}\n\nfunction cmpLenRev(a: string, b: string): number {\n return b.length - a.length;\n}\n","import {\n defaultDayOfMonthOrdinalParse,\n defaultLocaleMonths,\n defaultLocaleMonthsShort,\n defaultLocaleWeekdays,\n defaultLocaleWeekdaysMin,\n defaultLocaleWeekdaysShort, defaultLongDateFormat, defaultOrdinal,\n LocaleData\n} from './locale.class';\nimport { defaultCalendar } from './calendar';\n\nexport const defaultInvalidDate = 'Invalid date';\n\nexport const defaultLocaleWeek = {\n dow: 0, // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 1st is the first week of the year.\n};\n\nexport const defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n\nexport const defaultRelativeTime: {[key: string]: string} = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n ss : '%d seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n};\n\nexport const baseConfig: LocaleData = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse\n};\n","export const defaultCalendar = {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L'\n};\n","// compare two arrays, return the number of differences\nimport { toInt } from './type-checks';\n\nexport function compareArrays<T>(array1: T[], array2: T[], dontConvert: boolean) {\n const len = Math.min(array1.length, array2.length);\n const lengthDiff = Math.abs(array1.length - array2.length);\n let diffs = 0;\n let i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i])\n || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n\n return diffs + lengthDiff;\n}\n","import { addFormatToken } from '../format/format';\nimport { addUnitAlias } from './aliases';\nimport { addUnitPriority } from './priorities';\nimport { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex';\nimport { addWeekParseToken } from '../parse/token';\nimport { toInt } from '../utils/type-checks';\nimport { parseTwoDigitYear } from './year';\nimport { dayOfYearFromWeeks, weekOfYear, weeksInYear } from './week-calendar-utils';\nimport { createUTCDate } from '../create/date-from-array';\nimport { getISOWeek, getWeek } from './week';\nimport { getISODayOfWeek, getLocaleDayOfWeek } from './day-of-week';\nimport { getLocale } from '../locale/locales';\nimport { setDate, setFullYear, setMonth } from '../utils/date-setters';\nimport { getDate, getFullYear, getMonth } from '../utils/date-getters';\nimport { Locale } from '../locale/locale.class';\nimport { DateFormatterFn, DateFormatterOptions, WeekParsing } from '../types';\n\n// FORMATTING\n\nexport function initWeekYear() {\n addFormatToken(null, ['gg', 2, false], null,\n function (date: Date, opts: DateFormatterOptions): string {\n // return this.weekYear() % 100;\n return (getWeekYear(date, opts.locale) % 100).toString();\n }\n );\n\n addFormatToken(null, ['GG', 2, false], null,\n function (date: Date): string {\n // return this.isoWeekYear() % 100;\n return (getISOWeekYear(date) % 100).toString();\n }\n );\n\n addWeekYearFormatToken('gggg', _getWeekYearFormatCb);\n addWeekYearFormatToken('ggggg', _getWeekYearFormatCb);\n addWeekYearFormatToken('GGGG', _getISOWeekYearFormatCb);\n addWeekYearFormatToken('GGGGG', _getISOWeekYearFormatCb);\n\n// ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n// PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n\n// PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'],\n function (input, week: WeekParsing, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n\n return config;\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week: WeekParsing, config, token) {\n week[token] = parseTwoDigitYear(input);\n\n return config;\n });\n}\n\nfunction addWeekYearFormatToken(token: string, getter: DateFormatterFn): void {\n addFormatToken(null, [token, token.length, false], null, getter);\n}\n\nfunction _getWeekYearFormatCb(date: Date, opts: DateFormatterOptions): string {\n return getWeekYear(date, opts.locale).toString();\n}\n\nfunction _getISOWeekYearFormatCb(date: Date): string {\n return getISOWeekYear(date).toString();\n}\n\n// MOMENTS\n\nexport function getSetWeekYear(date: Date, input: number, locale = getLocale(), isUTC?: boolean): number | Date {\n return getSetWeekYearHelper(date,\n input,\n // this.week(),\n getWeek(date, locale, isUTC),\n // this.weekday(),\n getLocaleDayOfWeek(date, locale, isUTC),\n locale.firstDayOfWeek(),\n locale.firstDayOfYear(),\n isUTC);\n}\n\nexport function getWeekYear(date: Date, locale = getLocale(), isUTC?: boolean): number {\n return weekOfYear(date, locale.firstDayOfWeek(), locale.firstDayOfYear(), isUTC).year;\n}\n\nexport function getSetISOWeekYear(date: Date, input: number, isUTC?: boolean): number | Date {\n return getSetWeekYearHelper(date, input, getISOWeek(date, isUTC), getISODayOfWeek(date, isUTC), 1, 4);\n}\n\nexport function getISOWeekYear(date: Date, isUTC?: boolean): number {\n return weekOfYear(date, 1, 4, isUTC).year;\n}\n\nexport function getISOWeeksInYear(date: Date, isUTC?: boolean) {\n return weeksInYear(getFullYear(date, isUTC), 1, 4);\n}\n\nexport function getWeeksInYear(date: Date, isUTC?: boolean, locale: Locale = getLocale()): number {\n return weeksInYear(getFullYear(date, isUTC), locale.firstDayOfWeek(), locale.firstDayOfYear());\n}\n\nfunction getSetWeekYearHelper(date: Date, input: number, week: number,\n weekday: number, dow: number, doy: number, isUTC?: boolean): number | Date {\n if (!input) {\n return getWeekYear(date, void 0, isUTC);\n }\n\n const weeksTarget = weeksInYear(input, dow, doy);\n const _week = week > weeksTarget ? weeksTarget : week;\n\n return setWeekAll(date, input, _week, weekday, dow, doy);\n}\n\nfunction setWeekAll(date: Date, weekYear: number, week: number,\n weekday: number, dow: number, doy: number): Date {\n const dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n const _date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n setFullYear(date, getFullYear(_date, true), true);\n setMonth(date, getMonth(_date, true), true);\n setDate(date, getDate(_date, true), true);\n\n return date;\n}\n","// FORMATTING\n\nimport { addFormatToken } from '../format/format';\nimport { zeroFill } from '../utils/zero-fill';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { isNumber, isString, toInt } from '../utils/type-checks';\nimport { addRegexToken, matchOffset, matchShortOffset } from '../parse/regex';\nimport { add } from '../moment/add-subtract';\nimport { addParseToken } from '../parse/token';\nimport { DateArray } from '../types';\nimport { cloneDate } from '../create/clone';\nimport { setMonth } from '../utils/date-setters';\n\nfunction addOffsetFormatToken(token: string, separator: string): void {\n addFormatToken(token, null, null, function (date: Date, config): string {\n let offset = getUTCOffset(date, {_isUTC: config.isUTC, _offset: config.offset});\n let sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n}\n\nexport function initOffset() {\n addOffsetFormatToken('Z', ':');\n addOffsetFormatToken('ZZ', '');\n\n// PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n\n return config;\n });\n}\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10', '00']\n// '-1530' > ['-15', '30']\nconst chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\nfunction offsetFromString(matcher: RegExp, str: string): number {\n const matches = (str || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n const chunk = matches[matches.length - 1];\n const parts = chunk.match(chunkOffset) || ['-', '0', '0'];\n const minutes = parseInt(parts[1], 10) * 60 + toInt(parts[2]);\n const _min = parts[0] === '+' ? minutes : -minutes;\n\n return minutes === 0 ? 0 : _min;\n}\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\nexport function cloneWithOffset(input: Date, date: Date,\n config: DateParsingConfig = {}): Date {\n if (!config._isUTC) {\n return input;\n }\n\n const res = cloneDate(date);\n // todo: input._d - res._d + ((res._offset || 0) - (input._offset || 0))*60000\n const offsetDiff = (config._offset || 0) * 60000;\n const diff = input.valueOf() - res.valueOf() + offsetDiff;\n // Use low-level api, because this fn is low-level api.\n res.setTime(res.valueOf() + diff);\n // todo: add timezone handling\n // hooks.updateOffset(res, false);\n\n return res;\n}\n\nexport function getDateOffset(date: Date): number {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(date.getTimezoneOffset() / 15) * 15;\n}\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\n// todo: it's from moment timezones\n// hooks.updateOffset = function () {\n// };\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\nexport function getUTCOffset(date: Date, config: DateParsingConfig = {}): number {\n const _offset = config._offset || 0;\n\n return config._isUTC ? _offset : getDateOffset(date);\n}\n\nexport function setUTCOffset(date: Date, input: number | string, keepLocalTime?: boolean, keepMinutes?: boolean, config: DateParsingConfig = {}): Date {\n const offset = config._offset || 0;\n let localAdjust;\n let _input = input;\n let _date = date;\n\n if (isString(_input)) {\n _input = offsetFromString(matchShortOffset, _input);\n if (_input === null) {\n return _date;\n }\n } else if (isNumber(_input) && Math.abs(_input) < 16 && !keepMinutes) {\n _input = _input * 60;\n }\n\n if (!config._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(_date);\n }\n config._offset = _input;\n config._isUTC = true;\n if (localAdjust != null) {\n _date = add(_date, localAdjust, 'minutes');\n }\n if (offset !== _input) {\n if (!keepLocalTime || config._changeInProgress) {\n _date = add(_date, _input - offset, 'minutes', config._isUTC);\n // addSubtract(this, createDuration(_input - offset, 'm'), 1, false);\n } else if (!config._changeInProgress) {\n config._changeInProgress = true;\n // todo: add timezone handling\n // hooks.updateOffset(this, true);\n config._changeInProgress = null;\n }\n }\n\n return _date;\n}\n\n/*\nexport function getSetZone(input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n}\n*/\n\nexport function setOffsetToUTC(date: Date, keepLocalTime?: boolean): Date {\n return setUTCOffset(date, 0, keepLocalTime);\n}\n\nexport function isDaylightSavingTime(date: Date): boolean {\n\n return (getUTCOffset(date) > getUTCOffset(setMonth(cloneDate(date), 0))\n || getUTCOffset(date) > getUTCOffset(setMonth(cloneDate(date), 5)));\n}\n\n/*export function setOffsetToLocal(date: Date, isUTC?: boolean, keepLocalTime?: boolean) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n}*/\n\nexport function setOffsetToParsedOffset(date: Date, input: string, config: DateParsingConfig = {}): Date {\n if (config._tzm != null) {\n return setUTCOffset(date, config._tzm, false, true, config);\n }\n\n if (isString(input)) {\n const tZone = offsetFromString(matchOffset, input);\n if (tZone != null) {\n return setUTCOffset(date, tZone, false, false, config);\n }\n\n return setUTCOffset(date, 0, true, false, config);\n }\n\n return date;\n}\n\nexport function hasAlignedHourOffset(date: Date, input?: Date) {\n const _input = input ? getUTCOffset(input, { _isUTC: false }) : 0;\n\n return (getUTCOffset(date) - _input) % 60 === 0;\n}\n\n\n// DEPRECATED\n/*export function isDaylightSavingTimeShifted() {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n const c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n const other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n}*/\n\n// in Khronos\n/*export function isLocal() {\n return this.isValid() ? !this._isUTC : false;\n}\n\nexport function isUtcOffset() {\n return this.isValid() ? this._isUTC : false;\n}\n\nexport function isUtc() {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n}*/\n","// internal storage for locale config files\nimport { Locale, LocaleData } from './locale.class';\nimport { baseConfig } from './locale.defaults';\nimport { hasOwnProp, isArray, isObject, isString, isUndefined, toInt } from '../utils/type-checks';\nimport { compareArrays } from '../utils/compare-arrays';\n\nimport { initWeek } from '../units/week';\nimport { initWeekYear } from '../units/week-year';\nimport { initYear } from '../units/year';\nimport { initTimezone } from '../units/timezone';\nimport { initTimestamp } from '../units/timestamp';\nimport { initSecond } from '../units/second';\nimport { initQuarter } from '../units/quarter';\nimport { initOffset } from '../units/offset';\nimport { initMinute } from '../units/minute';\nimport { initMillisecond } from '../units/millisecond';\nimport { initMonth } from '../units/month';\nimport { initHour } from '../units/hour';\nimport { initDayOfYear } from '../units/day-of-year';\nimport { initDayOfWeek } from '../units/day-of-week';\nimport { initDayOfMonth } from '../units/day-of-month';\n\nconst locales: { [key: string]: Locale } = {};\nconst localeFamilies: { [key: string]: {name: string; config: LocaleData}[] } = {};\nlet globalLocale: Locale;\n\nfunction normalizeLocale(key: string): string {\n return key ? key.toLowerCase().replace('_', '-') : key;\n}\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least,\n// but move to the next array item if it's a more specific variant than the current root\nfunction chooseLocale(names: string[]): Locale {\n let next;\n let locale;\n let i = 0;\n\n while (i < names.length) {\n const split = normalizeLocale(names[i]).split('-');\n let j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n // the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n\n return null;\n}\n\nexport function mergeConfigs(parentConfig: LocaleData,\n childConfig: LocaleData) {\n const res: LocaleData = Object.assign({}, parentConfig);\n\n for (const childProp in childConfig) {\n if (!hasOwnProp(childConfig, childProp)) {\n continue;\n }\n\n if (isObject(parentConfig[childProp]) && isObject(childConfig[childProp])) {\n res[childProp as any] = {};\n Object.assign(res[childProp], parentConfig[childProp]);\n Object.assign(res[childProp], childConfig[childProp]);\n } else if (childConfig[childProp] != null) {\n res[childProp as any] = childConfig[childProp];\n } else {\n delete res[childProp as any];\n }\n }\n for (const parentProp in parentConfig) {\n if (\n hasOwnProp(parentConfig, parentProp) &&\n !hasOwnProp(childConfig, parentProp) &&\n isObject(parentConfig[parentProp as keyof LocaleData])\n ) {\n // make sure changes to properties don't modify parent config\n res[parentProp as any] = Object.assign({}, res[parentProp as keyof LocaleData]);\n }\n }\n\n return res;\n}\n\n\nfunction loadLocale(name: string): Locale {\n // no way!\n /* var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n var aliasedRequire = require;\n aliasedRequire('./locale/' + name);\n getSetGlobalLocale(oldLocale);\n } catch (e) {}\n }*/\n if (!locales[name]) {\n console.error(`Khronos locale error: please load locale \"${name}\" before using it`);\n // throw new Error(`Khronos locale error: please load locale \"${name}\" before using it`);\n }\n\n return locales[name];\n}\n\n// This function will load locale and then set the global locale. If\n// no arguments are passed in, it will simply return the current global\n// locale key.\nexport function getSetGlobalLocale(key?: string | string[], values?: LocaleData): string {\n let data: Locale;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else if (isString(key)) {\n data = defineLocale(key, values);\n }\n\n if (data) {\n globalLocale = data;\n }\n }\n\n return globalLocale && globalLocale._abbr;\n}\n\nexport function defineLocale(name: string, config?: LocaleData): Locale {\n if (config === null) {\n // useful for testing\n delete locales[name];\n globalLocale = getLocale('en');\n\n return null;\n }\n\n if (!config) {\n return;\n }\n\n let parentConfig = baseConfig;\n config.abbr = name;\n if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({ name, config });\n\n return null;\n }\n }\n\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n\n return locales[name];\n}\n\nexport function updateLocale(name: string, config?: LocaleData): Locale {\n let _config = config;\n\n if (_config != null) {\n let parentConfig = baseConfig;\n // MERGE\n const tmpLocale = loadLocale(name);\n if (tmpLocale != null) {\n parentConfig = tmpLocale._config;\n }\n _config = mergeConfigs(parentConfig, _config);\n const locale = new Locale(_config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n\n return locales[name];\n}\n\n// returns locale data\nexport function getLocale(key?: string | string[]): Locale {\n setDefaultLocale();\n\n if (!key) {\n return globalLocale;\n }\n // let locale;\n const _key = isArray(key) ? key : [key];\n\n return chooseLocale(_key);\n}\n\nexport function listLocales(): string[] {\n return Object.keys(locales);\n}\n\nfunction setDefaultLocale(): void {\n if (locales[`en`]) {\n\n return undefined;\n }\n\n getSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal(num: number): string {\n const b = num % 10;\n const output =\n toInt((num % 100) / 10) === 1\n ? 'th'\n : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';\n\n return num + output;\n }\n });\n\n initWeek();\n initWeekYear();\n initYear();\n initTimezone();\n initTimestamp();\n initSecond();\n initQuarter();\n initOffset();\n initMonth();\n initMinute();\n initMillisecond();\n initHour();\n initDayOfYear();\n initDayOfWeek();\n initDayOfMonth();\n}\n","import { addFormatToken } from '../format/format';\nimport { Locale } from '../locale/locale.class';\nimport { weekOfYear } from './week-calendar-utils';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addUnitAlias } from './aliases';\nimport { addUnitPriority } from './priorities';\nimport { addWeekParseToken } from '../parse/token';\nimport { toInt } from '../utils/type-checks';\nimport { DateFormatterOptions, WeekParsing } from '../types';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { getLocale } from '../locale/locales';\nimport { add } from '../moment/add-subtract';\n\n// FORMATTING\n\nexport function initWeek() {\n addFormatToken('w', ['ww', 2, false], 'wo',\n function(date: Date, opts: DateFormatterOptions): string {\n return getWeek(date, opts.locale)\n .toString(10);\n }\n );\n\n addFormatToken('W', ['WW', 2, false], 'Wo',\n function(date: Date): string {\n return getISOWeek(date)\n .toString(10);\n }\n );\n\n// ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n// PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n// PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(\n ['w', 'ww', 'W', 'WW'],\n function(input: string, week: WeekParsing, config: DateParsingConfig, token: string): DateParsingConfig {\n week[token.substr(0, 1)] = toInt(input);\n\n return config;\n }\n );\n\n// export function getSetWeek (input) {\n// var week = this.localeData().week(this);\n// return input == null ? week : this.add((input - week) * 7, 'd');\n// }\n}\n\nexport function setWeek(date: Date, input: number, locale = getLocale()): Date {\n const week = getWeek(date, locale);\n\n return add(date, (input - week) * 7, 'day');\n}\n\nexport function getWeek(date: Date, locale = getLocale(), isUTC?: boolean): number {\n return locale.week(date, isUTC);\n}\n\n// export function getSetISOWeek (input) {\n// var week = weekOfYear(this, 1, 4).week;\n// return input == null ? week : this.add((input - week) * 7, 'd');\n// }\n\nexport function setISOWeek(date: Date, input: number): Date {\n const week = getISOWeek(date);\n\n return add(date, (input - week) * 7, 'day');\n}\n\nexport function getISOWeek(date: Date, isUTC?: boolean): number {\n return weekOfYear(date, 1, 4, isUTC).week;\n}\n\n","import { addFormatToken } from '../format/format';\nimport { DateFormatterOptions } from '../types';\n\n// todo: add support for timezones\n\nexport function initTimezone() {\n // FORMATTING\n addFormatToken('z', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.isUTC ? 'UTC' : '';\n }\n );\n addFormatToken('zz', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.isUTC ? 'Coordinated Universal Time' : '';\n }\n );\n}\n\n// MOMENTS\n\nexport function getZoneAbbr(isUTC: boolean) {\n return isUTC ? 'UTC' : '';\n}\n\nexport function getZoneName(isUTC: boolean) {\n return isUTC ? 'Coordinated Universal Time' : '';\n}\n","import { addFormatToken } from '../format/format';\nimport { unix } from '../utils/date-getters';\nimport { addRegexToken, matchSigned, matchTimestamp } from '../parse/regex';\nimport { addParseToken} from '../parse/token';\nimport { toInt } from '../utils/type-checks';\nimport { DateArray } from '../types';\nimport { DateParsingConfig } from '../create/parsing.types';\n\n\nexport function initTimestamp() {\n// FORMATTING\n\n addFormatToken('X', null, null, function(date: Date): string {\n return unix(date)\n .toString(10);\n });\n addFormatToken('x', null, null, function(date: Date): string {\n return date.valueOf()\n .toString(10);\n });\n\n// PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n\n addParseToken('X', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n config._d = new Date(parseFloat(input) * 1000);\n\n return config;\n });\n addParseToken('x', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n config._d = new Date(toInt(input));\n\n return config;\n });\n}\n","import { addFormatToken } from '../format/format';\nimport { getSeconds } from '../utils/date-getters';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { SECOND } from './constants';\nimport { addUnitAlias } from './aliases';\nimport { addUnitPriority } from './priorities';\nimport { DateFormatterOptions } from '../types';\n\n\nexport function initSecond() {\n// FORMATTING\n\n addFormatToken('s', ['ss', 2, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return getSeconds(date, opts.isUTC)\n .toString(10);\n }\n );\n\n// ALIASES\n\n addUnitAlias('second', 's');\n\n// PRIORITY\n\n addUnitPriority('second', 15);\n\n// PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n}\n","import { addFormatToken } from '../format/format';\nimport { addRegexToken, match1 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { MONTH } from './constants';\nimport { toInt } from '../utils/type-checks';\nimport { getMonth } from '../utils/date-getters';\nimport { DateArray, DateFormatterOptions } from '../types';\nimport { addUnitPriority } from './priorities';\nimport { addUnitAlias } from './aliases';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { setMonth } from '../utils/date-setters';\n\n\nexport function initQuarter() {\n// FORMATTING\n\n addFormatToken('Q', null, 'Qo',\n function(date: Date, opts: DateFormatterOptions): string {\n return getQuarter(date, opts.isUTC)\n .toString(10);\n }\n );\n\n// ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n// PRIORITY\n\n addUnitPriority('quarter', 7);\n\n// PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n array[MONTH] = (toInt(input) - 1) * 3;\n\n return config;\n });\n}\n\n// MOMENTS\n\nexport function getQuarter(date: Date, isUTC = false): number {\n return Math.ceil((getMonth(date, isUTC) + 1) / 3);\n}\n\nexport function setQuarter(date: Date, quarter: number, isUTC?: boolean): Date {\n return setMonth(date, (quarter - 1) * 3 + getMonth(date, isUTC) % 3, isUTC);\n}\n\n// export function getSetQuarter(input) {\n// return input == null\n// ? Math.ceil((this.month() + 1) / 3)\n// : this.month((input - 1) * 3 + this.month() % 3);\n// }\n","import { addFormatToken } from '../format/format';\nimport { getMinutes } from '../utils/date-getters';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { MINUTE } from './constants';\nimport { addUnitPriority } from './priorities';\nimport { addUnitAlias } from './aliases';\nimport { DateFormatterOptions } from '../types';\n\n\nexport function initMinute() {\n// FORMATTING\n\n addFormatToken('m', ['mm', 2, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return getMinutes(date, opts.isUTC)\n .toString(10);\n }\n );\n\n// ALIASES\n\n addUnitAlias('minute', 'm');\n\n// PRIORITY\n\n addUnitPriority('minute', 14);\n\n// PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n}\n","// FORMATTING\n\nimport { addFormatToken } from '../format/format';\nimport { addRegexToken, match1, match1to3, match2, match3, matchUnsigned } from '../parse/regex';\nimport { MILLISECOND } from './constants';\nimport { toInt } from '../utils/type-checks';\nimport { addParseToken } from '../parse/token';\nimport { DateArray, DateFormatterOptions, WeekParsing } from '../types';\nimport { addUnitAlias } from './aliases';\nimport { addUnitPriority } from './priorities';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { getMilliseconds } from '../utils/date-getters';\n\n\nexport function initMillisecond() {\n addFormatToken('S', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (~~(getMilliseconds(date, opts.isUTC) / 100)).toString(10);\n }\n );\n\n addFormatToken(null, ['SS', 2, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (~~(getMilliseconds(date, opts.isUTC) / 10)).toString(10);\n }\n );\n\n addFormatToken(null, ['SSS', 3, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC)).toString(10);\n }\n );\n addFormatToken(null, ['SSSS', 4, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC) * 10).toString(10);\n }\n );\n addFormatToken(null, ['SSSSS', 5, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC) * 100).toString(10);\n }\n );\n addFormatToken(null, ['SSSSSS', 6, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC) * 1000).toString(10);\n }\n );\n addFormatToken(null, ['SSSSSSS', 7, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC) * 10000).toString(10);\n }\n );\n addFormatToken(null, ['SSSSSSSS', 8, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC) * 100000).toString(10);\n }\n );\n addFormatToken(null, ['SSSSSSSSS', 9, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return (getMilliseconds(date, opts.isUTC) * 1000000).toString(10);\n }\n );\n\n\n// ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n// PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n// PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n let token;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n array[MILLISECOND] = toInt(parseFloat(`0.${input}`) * 1000);\n\n return config;\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n// MOMENTS\n}\n","import { getHours, getMinutes, getSeconds } from '../utils/date-getters';\nimport { addFormatToken } from '../format/format';\nimport { zeroFill } from '../utils/zero-fill';\nimport { Locale } from '../locale/locale.class';\nimport { addRegexToken, match1to2, match2, match3to4, match5to6 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { HOUR, MINUTE, SECOND } from './constants';\nimport { toInt } from '../utils/type-checks';\nimport { DateArray, DateFormatterOptions } from '../types';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { getParsingFlags } from '../create/parsing-flags';\nimport { addUnitPriority } from './priorities';\nimport { addUnitAlias } from './aliases';\n\n\nexport function initHour() {\n// FORMATTING\n\n function hFormat(date: Date, isUTC: boolean): number {\n return getHours(date, isUTC) % 12 || 12;\n }\n\n function kFormat(date: Date, isUTC: boolean): number {\n return getHours(date, isUTC) || 24;\n }\n\n addFormatToken('H', ['HH', 2, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return getHours(date, opts.isUTC)\n .toString(10);\n }\n );\n addFormatToken('h', ['hh', 2, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return hFormat(date, opts.isUTC)\n .toString(10);\n }\n );\n addFormatToken('k', ['kk', 2, false], null,\n function(date: Date, opts: DateFormatterOptions): string {\n return kFormat(date, opts.isUTC)\n .toString(10);\n }\n );\n\n addFormatToken('hmm', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n const _h = hFormat(date, opts.isUTC);\n const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);\n\n return `${_h}${_mm}`;\n }\n );\n\n addFormatToken('hmmss', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n const _h = hFormat(date, opts.isUTC);\n const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);\n const _ss = zeroFill(getSeconds(date, opts.isUTC), 2);\n\n return `${_h}${_mm}${_ss}`;\n }\n );\n\n addFormatToken('Hmm', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n const _H = getHours(date, opts.isUTC);\n const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);\n\n return `${_H}${_mm}`;\n }\n );\n\n addFormatToken('Hmmss', null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n const _H = getHours(date, opts.isUTC);\n const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);\n const _ss = zeroFill(getSeconds(date, opts.isUTC), 2);\n\n return `${_H}${_mm}${_ss}`;\n }\n );\n\n function meridiem(token: string, lowercase: boolean): void {\n addFormatToken(token, null, null,\n function(date: Date, opts: DateFormatterOptions): string {\n return opts.locale.meridiem(getHours(date, opts.isUTC), getMinutes(date, opts.isUTC), lowercase);\n }\n );\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n// ALIASES\n\n addUnitAlias('hour', 'h');\n\n// PRIORITY\n addUnitPriority('hour', 13);\n\n\n// PARSING\n\n function matchMeridiem(isStrict: boolean, locale: Locale): RegExp {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(\n ['k', 'kk'],\n function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n const kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n\n return config;\n }\n );\n addParseToken(['a', 'A'], function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n\n return config;\n });\n addParseToken(['h', 'hh'], function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n\n return config;\n });\n addParseToken('hmm', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n const pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n\n return config;\n });\n addParseToken('hmmss', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n const pos1 = input.length - 4;\n const pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n\n return config;\n });\n addParseToken('Hmm', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n const pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n\n return config;\n });\n addParseToken('Hmmss', function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n const pos1 = input.length - 4;\n const pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n\n return config;\n });\n\n}\n","import { addFormatToken } from '../format/format';\nimport { getDate } from '../utils/date-getters';\nimport { addRegexToken, match1to2, match2 } from '../parse/regex';\nimport { addParseToken } from '../parse/token';\nimport { DATE } from './constants';\nimport { toInt } from '../utils/type-checks';\nimport { DateArray, DateFormatterOptions } from '../types';\nimport { addUnitAlias } from './aliases';\nimport { addUnitPriority } from './priorities';\nimport { DateParsingConfig } from '../create/parsing.types';\n\n\nexport function initDayOfMonth() {\n// FORMATTING\n\n addFormatToken('D', ['DD', 2, false], 'Do',\n function(date: Date, opts: DateFormatterOptions): string {\n return getDate(date, opts.isUTC)\n .toString(10);\n }\n );\n\n// ALIASES\n\n addUnitAlias('date', 'D');\n\n// PRIOROITY\n addUnitPriority('date', 9);\n\n// PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function(isStrict, locale) {\n return locale._dayOfMonthOrdinalParse || locale._ordinalParse;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken(\n 'Do',\n function(input: string, array: DateArray, config: DateParsingConfig): DateParsingConfig {\n array[DATE] = toInt(input.match(match1to2)[0]);\n\n return config;\n }\n );\n}\n","import { toInt } from '../utils/type-checks';\nimport { createDuration } from './create';\nimport { Duration } from './constructor';\nimport { DateObject } from '../types';\n\nconst ordering: (keyof DateObject)[] = ['year', 'quarter', 'month', 'week', 'day', 'hours', 'minutes', 'seconds', 'milliseconds'];\nconst orderingHash = ordering.reduce((mem: { [key: string]: boolean }, order) => {\n mem[order] = true;\n\n return mem;\n}, {});\n\nexport function isDurationValid(duration: Partial<DateObject>): boolean {\n const durationKeys = Object.keys(duration);\n if (durationKeys\n .some((key: keyof DateObject) => {\n return (key in orderingHash)\n && duration[key] === null\n || isNaN(duration[key]);\n })) {\n return false;\n }\n // for (let key in duration) {\n // if (!(indexOf.call(ordering, key) !== -1 && (duration[key] == null || !isNaN(duration[key])))) {\n // return false;\n // }\n // }\n\n let unitHasDecimal = false;\n for (let i = 0; i < ordering.length; ++i) {\n if (duration[ordering[i]]) {\n // only allow non-integers for smallest unit\n if (unitHasDecimal) {\n return false;\n }\n if (duration[ordering[i]] !== toInt(duration[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n}\n\n// export function isValid() {\n// return this._isValid;\n// }\n//\n// export function createInvalid(): Duration {\n// return createDuration(NaN);\n// }\n","export function absCeil (number: number): number {\n return number < 0 ? Math.floor(number) : Math.ceil(number);\n}\n","import { Duration } from './constructor';\nimport { absFloor } from '../utils';\nimport { absCeil } from '../utils/abs-ceil';\n\nexport function bubble(dur: Duration): Duration {\n let milliseconds = dur._milliseconds;\n let days = dur._days;\n let months = dur._months;\n const data = dur._data;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n const seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n const minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n const hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n const monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n const years = absFloor(months / 12);\n months %= 12;\n\n data.day = days;\n data.month = months;\n data.year = years;\n\n return dur;\n}\n\nexport function daysToMonths(day: number): number {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return day * 4800 / 146097;\n}\n\nexport function monthsToDays(month: number): number {\n // the reverse of daysToMonths\n return month * 146097 / 4800;\n}\n","import { createDuration } from './create';\nimport { Locale } from '../locale/locale.class';\nimport { Duration } from './constructor';\n\nlet round = Math.round;\nconst thresholds: { [key: string]: number } = {\n ss: 44, // a few seconds to seconds\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month\n M: 11 // months to year\n};\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\nfunction substituteTimeAgo(str: 'future' | 'past', num: number,\n withoutSuffix: boolean, isFuture: boolean,\n locale: Locale): string {\n return locale.relativeTime(num || 1, !!withoutSuffix, str, isFuture);\n}\n\nexport function relativeTime(posNegDuration: Duration, withoutSuffix: boolean, locale: Locale): string {\n const duration = createDuration(posNegDuration).abs();\n const seconds = round(duration.as('s'));\n const minutes = round(duration.as('m'));\n const hours = round(duration.as('h'));\n const days = round(duration.as('d'));\n const months = round(duration.as('M'));\n const years = round(duration.as('y'));\n\n const a: [string] | [string, number] =\n seconds <= thresholds[\"ss\"] && ['s', seconds] ||\n seconds < thresholds[\"s\"] && ['ss', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds[\"m\"] && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds[\"h\"] && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds[\"d\"] && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds[\"M\"] && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n const b: [string, number | string, boolean, boolean, Locale] =\n [a[0], a[1], withoutSuffix, +posNegDuration > 0, locale];\n // a[2] = withoutSuffix;\n // a[3] = +posNegDuration > 0;\n // a[4] = locale;\n\n return substituteTimeAgo.apply(null, b);\n}\n\n// This function allows you to set the rounding function for relative time strings\nexport function getSetRelativeTimeRounding(roundingFunction: any): boolean | ((x: number) => number) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n\n return true;\n }\n\n return false;\n}\n\n// This function allows you to set a threshold for relative time strings\nexport function getSetRelativeTimeThreshold(threshold: string, limit: number): boolean | number {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds[\"ss\"] = limit - 1;\n }\n\n return true;\n}\n\n// export function humanize(withSuffix) {\n// if (!this.isValid()) {\n// return this.localeData().invalidDate();\n// }\n//\n// const locale = this.localeData();\n// let output = relativeTime(this, !withSuffix, locale);\n//\n// if (withSuffix) {\n// output = locale.pastFuture(+this, output);\n// }\n//\n// return locale.postformat(output);\n// }\n","import { getLocale } from '../locale/locales';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { isDurationValid } from './valid';\nimport { bubble, daysToMonths, monthsToDays } from './bubble';\nimport { DateObject } from '../types';\nimport { Locale } from '../locale/locale.class';\nimport { normalizeUnits } from '../units/aliases';\nimport { relativeTime } from './humanize';\nimport { toInt } from '../utils/type-checks';\n\nexport class Duration {\n _milliseconds: number;\n _days: number;\n _months: number;\n _data: Partial<DateObject> = {};\n _locale: Locale = getLocale();\n _isValid: boolean;\n\n constructor(duration: Partial<DateObject>, config: DateParsingConfig = {}) {\n this._locale = config && config._locale || getLocale();\n // const normalizedInput = normalizeObjectUnits(duration);\n const normalizedInput = duration;\n const years = normalizedInput.year || 0;\n const quarters = normalizedInput.quarter || 0;\n const months = normalizedInput.month || 0;\n const weeks = normalizedInput.week || 0;\n const days = normalizedInput.day || 0;\n const hours = normalizedInput.hours || 0;\n const minutes = normalizedInput.minutes || 0;\n const seconds = normalizedInput.seconds || 0;\n const milliseconds = normalizedInput.milliseconds || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1000 +\n minutes * 60 * 1000 + // 1000 * 60\n hours * 1000 * 60 * 60; // using 1000 * 60 * 60\n // instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible to translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n // this._data = {};\n\n // this._locale = getLocale();\n\n // this._bubble();\n return bubble(this);\n }\n\n isValid(): boolean {\n return this._isValid;\n }\n\n humanize(withSuffix?: boolean): string {\n // throw new Error(`TODO: implement`);\n\n if (!this.isValid()) {\n return this.localeData().invalidDate;\n }\n\n const locale = this.localeData();\n let output = relativeTime(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n localeData(): Locale {\n return this._locale;\n }\n\n locale(): string;\n locale(localeKey: string): Duration;\n locale(localeKey?: string): Duration | string {\n if (!localeKey) {\n return this._locale._abbr;\n }\n\n this._locale = getLocale(localeKey) || this._locale;\n\n return this;\n }\n\n\n abs(): Duration {\n const mathAbs = Math.abs;\n\n const data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.month = mathAbs(data.month);\n data.year = mathAbs(data.year);\n\n return this;\n }\n\n as(_units: string): number {\n if (!this.isValid()) {\n return NaN;\n }\n let days;\n let months;\n const milliseconds = this._milliseconds;\n\n const units = normalizeUnits(_units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n\n return units === 'month' ? months : months / 12;\n }\n\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' :\n return days / 7 + milliseconds / 6048e5;\n case 'day' :\n return days + milliseconds / 864e5;\n case 'hours' :\n return days * 24 + milliseconds / 36e5;\n case 'minutes' :\n return days * 1440 + milliseconds / 6e4;\n case 'seconds' :\n return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'milliseconds':\n return Math.floor(days * 864e5) + milliseconds;\n default:\n throw new Error(`Unknown unit ${units}`);\n }\n }\n\n valueOf () {\n if (!this.isValid()) {\n return NaN;\n }\n\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n}\n\nexport function isDuration(obj: any): obj is Duration {\n return obj instanceof Duration;\n}\n","import { DateParsingConfig } from './parsing.types';\nimport { getParsingFlags } from './parsing-flags';\n\nexport function isValid(config: DateParsingConfig): boolean {\n if (config._isValid == null) {\n const flags = getParsingFlags(config);\n const parsedParts = Array.prototype.some.call(flags.parsedDateParts, function (i: number) {\n return i != null;\n });\n let isNowValid = !isNaN(config._d && config._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.weekdayMismatch &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (config._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(config)) {\n config._isValid = isNowValid;\n } else {\n return isNowValid;\n }\n }\n\n return config._isValid;\n}\n\nexport function createInvalid(config: DateParsingConfig, flags?: { nullInput: boolean }): DateParsingConfig {\n config._d = new Date(NaN);\n Object.assign(getParsingFlags(config), flags || { userInvalidated: true });\n\n return config;\n}\n\nexport function markInvalid(config: DateParsingConfig): DateParsingConfig {\n config._isValid = false;\n\n return config;\n}\n","import { defaultLocaleMonthsShort, defaultLocaleWeekdaysShort } from '../locale/locale.class';\nimport { DateArray } from '../types';\nimport { DateParsingConfig } from './parsing.types';\nimport { isString } from '../utils/type-checks';\nimport { configFromStringAndFormat } from './from-string-and-format';\nimport { createUTCDate } from './date-from-array';\nimport { createInvalid, markInvalid } from './valid';\nimport { getParsingFlags } from './parsing-flags';\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\nconst extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\nconst basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\nconst tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\nconst isoDates: [string, RegExp, boolean][] = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/, true],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/, true],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/, true],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/, true],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/, true],\n ['YYYYMMDD', /\\d{8}/, true],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/, true],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/, true]\n];\n\n// iso time formats and regexes\nconst isoTimes: [string, RegExp][] = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n];\n\nconst aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\nconst obsOffsets: { [key: string]: number } = {\n UT: 0,\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60\n};\n\n// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\nconst rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;\n\n// date from iso format\nexport function configFromISO(config: DateParsingConfig): DateParsingConfig {\n if (!isString(config._i)) {\n return config;\n }\n\n const input = config._i;\n const match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);\n\n\n let allowTime;\n let dateFormat;\n let timeFormat;\n let tzFormat;\n\n if (!match) {\n config._isValid = false;\n\n return config;\n }\n\n // getParsingFlags(config).iso = true;\n let i;\n let l;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n\n if (dateFormat == null) {\n config._isValid = false;\n\n return config;\n }\n\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n\n if (timeFormat == null) {\n config._isValid = false;\n\n return config;\n }\n\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n\n return config;\n }\n\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n\n return config;\n }\n }\n\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n\n return configFromStringAndFormat(config);\n}\n\nfunction extractFromRFC2822Strings(yearStr: string, monthStr: string, dayStr: string, hourStr: string, minuteStr: string, secondStr: string): DateArray {\n const result = [\n untruncateYear(yearStr),\n defaultLocaleMonthsShort.indexOf(monthStr),\n parseInt(dayStr, 10),\n parseInt(hourStr, 10),\n parseInt(minuteStr, 10)\n ];\n\n if (secondStr) {\n result.push(parseInt(secondStr, 10));\n }\n\n return result;\n}\n\nfunction untruncateYear(yearStr: string): number {\n const year = parseInt(yearStr, 10);\n\n return year <= 49 ? year + 2000 : year;\n}\n\nfunction preprocessRFC2822(str: string): string {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return str\n .replace(/\\([^)]*\\)|[\\n\\t]/g, ' ')\n .replace(/(\\s\\s+)/g, ' ').trim();\n}\n\nfunction checkWeekday(weekdayStr: string, parsedInput: DateArray, config: DateParsingConfig): boolean {\n if (weekdayStr) {\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n const weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr);\n const weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();\n if (weekdayProvided !== weekdayActual) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n\n return false;\n }\n }\n\n return true;\n}\n\nfunction calculateOffset(obsOffset: string, militaryOffset: string, numOffset: string) {\n if (obsOffset) {\n return obsOffsets[obsOffset];\n } else if (militaryOffset) {\n // the only allowed military tz is Z\n return 0;\n } else {\n const hm = parseInt(numOffset, 10);\n const m = hm % 100;\n const h = (hm - m) / 100;\n\n return h * 60 + m;\n }\n}\n\n// date and time from ref 2822 format\nexport function configFromRFC2822(config: DateParsingConfig): DateParsingConfig {\n if (!isString(config._i)) {\n return config;\n }\n\n const match = rfc2822.exec(preprocessRFC2822(config._i));\n\n if (!match) {\n return markInvalid(config);\n }\n\n const parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);\n if (!checkWeekday(match[1], parsedArray, config)) {\n return config;\n }\n\n config._a = parsedArray;\n config._tzm = calculateOffset(match[8], match[9], match[10]);\n\n config._d = createUTCDate.apply(null, config._a);\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n\n getParsingFlags(config).rfc2822 = true;\n\n return config;\n}\n\n// date from iso format or fallback\nexport function configFromString(config: DateParsingConfig): DateParsingConfig {\n if (!isString(config._i)) {\n return config;\n }\n\n const matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n\n return config;\n }\n\n // todo: update logic processing\n // isISO -> configFromISO\n // isRFC -> configFromRFC\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return config;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return config;\n }\n\n // Final attempt, use Input Fallback\n // hooks.createFromInputFallback(config);\n return createInvalid(config);\n}\n\n// hooks.createFromInputFallback = deprecate(\n// 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n// 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n// 'discouraged and will be removed in an upcoming major release. Please refer to ' +\n// 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n// function (config) {\n// config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n// }\n// );\n","// moment.js\n// version : 2.18.1\n// authors : Tim Wood, Iskren Chernev, Moment.js contributors\n// license : MIT\n// momentjs.com\n\nimport './units/index';\nimport { formatFunctions, makeFormatFunction } from './format/format';\nimport { Locale } from './locale/locale.class';\nimport { getLocale } from './locale/locales';\nimport { isDateValid } from './utils/type-checks';\n\nexport function formatDate(date: Date, format?: string, locale?: string, isUTC?: boolean, offset = 0): string {\n const _locale = getLocale(locale || 'en');\n if (!_locale) {\n throw new Error(\n `Locale \"${locale}\" is not defined, please add it with \"defineLocale(...)\"`\n );\n }\n\n const _format = format || (isUTC ? 'YYYY-MM-DDTHH:mm:ss[Z]' : 'YYYY-MM-DDTHH:mm:ssZ');\n\n const output = formatMoment(date, _format, _locale, isUTC, offset);\n\n if (!output) {\n return output;\n }\n\n return _locale.postformat(output);\n}\n\n// format date using native date object\nexport function formatMoment(date: Date, _format: string, locale: Locale, isUTC?: boolean, offset = 0): string {\n if (!isDateValid(date)) {\n return locale.invalidDate;\n }\n\n const format = expandFormat(_format, locale);\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](date, locale, isUTC, offset);\n}\n\nexport function expandFormat(_format: string, locale: Locale): string {\n let format = _format;\n let i = 5;\n const localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n const replaceLongDateFormatTokens = (input: any) => {\n return locale.formatLongDate(input) || input;\n };\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n}\n","// Pick the first defined of two or three arguments.\nexport function defaults<T>(a?: T, b?: T, c?: T): T {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n\n return c;\n}\n","import { DateParsingConfig } from './parsing.types';\nimport { DateArray } from '../types';\nimport { DATE, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, YEAR } from '../units/constants';\nimport { daysInYear } from '../units/year';\nimport { getParsingFlags } from './parsing-flags';\nimport { createUTCDate } from './date-from-array';\nimport { createDate } from './date-from-array';\nimport { dayOfYearFromWeeks, weekOfYear, weeksInYear } from '../units/week-calendar-utils';\nimport { defaults } from '../utils/defaults';\n\nfunction currentDateArray(config: DateParsingConfig): DateArray {\n const nowValue = new Date();\n\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n}\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\nexport function configFromArray(config: DateParsingConfig): DateParsingConfig {\n const input = [];\n let i;\n let date;\n let yearToUse;\n\n if (config._d) {\n return config;\n }\n\n const currentDate = currentDateArray(config);\n\n // compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n // if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = new Date(Date.UTC(yearToUse, 0, config._dayOfYear));\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n // eslint-disable-next-line prefer-spread\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n const expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w[\"d\"] !== 'undefined' && config._w[\"d\"] !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n\n return config;\n}\n\nfunction dayOfYearFromWeekInfo(config: DateParsingConfig): DateParsingConfig {\n let weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n const w = config._w;\n if (w[\"GG\"] != null || w[\"W\"] != null || w[\"E\"] != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w[\"GG\"], config._a[YEAR], weekOfYear(new Date(), 1, 4).year);\n week = defaults(w[\"W\"], 1);\n weekday = defaults(w[\"E\"], 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n const curWeek = weekOfYear(new Date(), dow, doy);\n\n weekYear = defaults(w[\"gg\"], config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w[\"w\"], curWeek.week);\n\n if (w[\"d\"] != null) {\n // weekday -- low day numbers are considered next week\n weekday = w[\"d\"];\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w[\"e\"] != null) {\n // local weekday -- counting starts from beginning of week\n weekday = w[\"e\"] + dow;\n if (w[\"e\"] < 0 || w[\"e\"] > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to beginning of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n\n return config;\n}\n","import { getParsingFlags } from './parsing-flags';\nimport { DATE, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, WEEK, WEEKDAY, YEAR } from '../units/constants';\nimport { daysInMonth } from '../units/month';\nimport { DateParsingConfig } from './parsing.types';\n\nexport function checkOverflow(config: DateParsingConfig): DateParsingConfig {\n let overflow;\n const a = config._a;\n\n if (a && getParsingFlags(config).overflow === -2) {\n // todo: fix this sh*t\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(config)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(config)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(config)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(config).overflow = overflow;\n }\n\n return config;\n}\n\n","import { DateParsingConfig } from './parsing.types';\nimport { configFromISO, configFromRFC2822 } from './from-string';\nimport { expandFormat } from '../format';\nimport { formattingTokens, formatTokenFunctions } from '../format/format';\nimport { isArray, isString } from '../utils/type-checks';\nimport { getParseRegexForToken } from '../parse/regex';\nimport { addTimeToArrayFromToken } from '../parse/token';\nimport { HOUR } from '../units/constants';\nimport { configFromArray } from './from-array';\nimport { getParsingFlags } from './parsing-flags';\nimport { checkOverflow } from './check-overflow';\nimport { Locale } from '../locale/locale.class';\n\n// constant that refers to the ISO standard\n// hooks.ISO_8601 = function () {};\nexport const ISO_8601 = 'ISO_8601';\n\n// constant that refers to the RFC 2822 form\n// hooks.RFC_2822 = function () {};\nexport const RFC_2822 = 'RFC_2822';\n\n// date from string and format string\nexport function configFromStringAndFormat(config: DateParsingConfig): DateParsingConfig {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === ISO_8601) {\n return configFromISO(config);\n }\n if (config._f === RFC_2822) {\n return configFromRFC2822(config);\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n if (isArray(config._f) || (!config._i && config._i !== 0)) {\n return config;\n }\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n let input = config._i.toString();\n let totalParsedInputLength = 0;\n const inputLength = input.length;\n const tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n let i;\n let token;\n let parsedInput;\n let skipped;\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (input.match(getParseRegexForToken(token, config._locale)) || [])[0];\n if (parsedInput) {\n skipped = input.substr(0, input.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n input = input.slice(input.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = inputLength - totalParsedInputLength;\n if (input.length > 0) {\n getParsingFlags(config).unusedInput.push(input);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = void 0;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n\n return checkOverflow(config);\n}\n\n\nfunction meridiemFixWrap(locale: Locale, _hour: number, meridiem: string): number {\n let hour = _hour;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n }\n\n if (locale.isPM == null) {\n // this is not supposed to happen\n return hour;\n }\n // Fallback\n const isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n\n if (!isPm && hour === 12) {\n hour = 0;\n }\n\n return hour;\n}\n","import { isArray, isDate, isNumber, isObject, isObjectEmpty, isString, isUndefined } from '../utils/type-checks';\nimport { DateParsingConfig } from './parsing.types';\nimport { getLocale } from '../locale/locales';\nimport { createInvalid, isValid } from './valid';\nimport { configFromStringAndArray } from './from-string-and-array';\nimport { configFromStringAndFormat } from './from-string-and-format';\nimport { cloneDate } from './clone';\nimport { configFromString } from './from-string';\nimport { configFromArray } from './from-array';\nimport { configFromObject } from './from-object';\nimport { checkOverflow } from './check-overflow';\nimport { DateInput } from '../testing/chain';\n\nfunction createFromConfig(config: DateParsingConfig): DateParsingConfig {\n const res = checkOverflow(prepareConfig(config));\n // todo: remove, in moment.js it's never called cuz of moment constructor\n res._d = new Date(res._d != null ? res._d.getTime() : NaN);\n if (!isValid(Object.assign({}, res, {_isValid: null}))) {\n res._d = new Date(NaN);\n }\n // todo: update offset\n /*if (res._nextDay) {\n // Adding is smart enough around DST\n res._d = add(res._d, 1, 'day');\n res._nextDay = undefined;\n }*/\n\n return res;\n}\n\nexport function prepareConfig(config: DateParsingConfig): DateParsingConfig {\n let input = config._i;\n const format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid(config, { nullInput: true });\n }\n\n if (isString(input)) {\n config._i = input = config._locale.preparse(input, format);\n }\n\n if (isDate(input)) {\n config._d = cloneDate(input);\n\n return config;\n }\n\n // todo: add check for recursion\n\n if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n}\n\nfunction configFromInput(config: DateParsingConfig): DateParsingConfig {\n const input = config._i;\n if (isUndefined(input)) {\n config._d = new Date();\n } else if (isDate(input)) {\n config._d = cloneDate(input);\n } else if (isString(input)) {\n configFromString(config);\n } else if (isArray<string | number>(input) && input.length) {\n const _arr: (string | number)[] = input.slice(0);\n config._a = _arr.map(obj => isString(obj) ? parseInt(obj, 10) : obj);\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n // hooks.createFromInputFallback(config);\n return createInvalid(config);\n }\n\n return config;\n}\n\nexport function createLocalOrUTC(input: DateInput, format?: string | string[], localeKey?: string, strict?: boolean, isUTC?: boolean): DateParsingConfig {\n const config: DateParsingConfig = {};\n let _input = input;\n\n // params switch -> skip; testing it well\n // if (localeKey === true || localeKey === false) {\n // strict = localeKey;\n // localeKey = undefined;\n // }\n\n // todo: fail fast and return not valid date\n if ((isObject(_input) && isObjectEmpty(_input)) || (isArray(_input) && _input.length === 0)) {\n _input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n // config._isAMomentObject = true;\n config._useUTC = config._isUTC = isUTC;\n config._l = localeKey;\n config._i = _input;\n config._f = format;\n config._strict = strict;\n\n return createFromConfig(config);\n}\n","import { DateParsingConfig } from './parsing.types';\nimport { createInvalid, isValid } from './valid';\nimport { getParsingFlags } from './parsing-flags';\nimport { configFromStringAndFormat } from './from-string-and-format';\n\n// date from string and array of format strings\nexport function configFromStringAndArray(config: DateParsingConfig): DateParsingConfig {\n let tempConfig;\n let bestMoment;\n let scoreToBeat;\n let currentScore;\n\n if (!config._f || config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n\n return createInvalid(config);\n }\n\n let i;\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = Object.assign({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n // or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n return Object.assign(config, bestMoment || tempConfig);\n}\n","import { normalizeObjectUnits } from '../units/aliases';\nimport { configFromArray } from './from-array';\nimport { DateParsingConfig } from './parsing.types';\nimport { isObject, isString } from '../utils/type-checks';\n\nexport function configFromObject(config: DateParsingConfig): DateParsingConfig {\n if (config._d) {\n return config;\n }\n\n const input = config._i;\n if (isObject(input)) {\n const i = normalizeObjectUnits(input as Record<string, unknown>);\n config._a = [i.year, i.month, i.day, i.hours, i.minutes, i.seconds, i.milliseconds]\n // todo: obsolete -> remove it\n .map(obj => isString(obj) ? parseInt(obj, 10) : obj);\n }\n\n return configFromArray(config);\n}\n","import { createLocalOrUTC } from './from-anything';\nimport { DateInput } from '../testing/chain';\nimport { isDate } from '../utils/type-checks';\n\nexport function parseDate(input: DateInput, format?: string | string[],\n localeKey?: string, strict?: boolean, isUTC?: boolean): Date {\n if (isDate(input)) {\n return input;\n }\n\n const config = createLocalOrUTC(input, format, localeKey, strict, isUTC);\n\n return config._d;\n}\n\nexport function utcAsLocal(date) {\n if (!(date instanceof Date)) {\n return null;\n }\n\n return new Date(\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds()\n );\n}\n","export function absRound(num: number): number {\n return num < 0 ? Math.round(num * -1) * -1 : Math.round(num);\n}\n","import { UnitOfTime } from '../types';\nimport { endOf, startOf } from './start-end-of';\n\nexport function isAfter(\n date1?: Date,\n date2?: Date,\n units: UnitOfTime = 'milliseconds'\n): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n if (units === 'milliseconds') {\n return date1.valueOf() > date2.valueOf();\n }\n\n return date2.valueOf() < startOf(date1, units).valueOf();\n}\n\nexport function isBefore(\n date1?: Date,\n date2?: Date,\n units: UnitOfTime = 'milliseconds'\n): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n if (units === 'milliseconds') {\n return date1.valueOf() < date2.valueOf();\n }\n\n return endOf(date1, units).valueOf() < date2.valueOf();\n}\n\nexport function isDisabledDay(date?: Date, daysDisabled?: number[]): boolean {\n if (typeof daysDisabled === 'undefined' || !daysDisabled || !daysDisabled.length) {\n return false;\n }\n\n return daysDisabled.some((day: number) => day === date.getDay());\n}\n\nexport function isBetween(\n date: Date,\n from: Date,\n to: Date,\n units: UnitOfTime,\n inclusivity = '()'\n): boolean {\n const leftBound =\n inclusivity[0] === '('\n ? isAfter(date, from, units)\n : !isBefore(date, from, units);\n const rightBound =\n inclusivity[1] === ')'\n ? isBefore(date, to, units)\n : !isAfter(date, to, units);\n\n return leftBound && rightBound;\n}\n\nexport function isSame(\n date1?: Date,\n date2?: Date,\n units: UnitOfTime = 'milliseconds'\n): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n if (units === 'milliseconds') {\n return date1.valueOf() === date2.valueOf();\n }\n\n const inputMs = date2.valueOf();\n\n return (\n startOf(date1, units).valueOf() <= inputMs &&\n inputMs <= endOf(date1, units).valueOf()\n );\n}\n\nexport function isSameDay(date1: Date, date2: Date):boolean{\n return (date1.getDay() == date2.getDay());\n}\n\nexport function isSameOrAfter(\n date1: Date,\n date2: Date,\n units?: UnitOfTime\n): boolean {\n return isSame(date1, date2, units) || isAfter(date1, date2, units);\n}\n\nexport function isSameOrBefore(\n date1: Date,\n date2: Date,\n units?: UnitOfTime\n): boolean {\n return isSame(date1, date2, units) || isBefore(date1, date2, units);\n}\n","// ASP.NET json date format regex\nimport { Duration, isDuration } from './constructor';\nimport { isDateValid, isNumber, isObject, isString, toInt } from '../utils/type-checks';\nimport { DATE, HOUR, MILLISECOND, MINUTE, SECOND } from '../units/constants';\nimport { parseDate } from '../create/local';\nimport { absRound } from '../utils/abs-round';\nimport { DateObject } from '../types';\nimport { DateParsingConfig } from '../create/parsing.types';\nimport { cloneWithOffset } from '../units/offset';\nimport { isAfter, isBefore } from '../utils/date-compare';\nimport { getFullYear, getMonth } from '../utils/date-getters';\nimport { add } from '../moment/add-subtract';\nimport { cloneDate } from '../create/clone';\n\nconst aspNetRegex = /^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/;\n\n// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n// and further modified to allow for strings containing both week and day\nconst isoRegex = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n\nexport type DurationInput = string | number | Duration | Partial<DateObject> | { from: Date; to: Date };\n\nexport function createDuration(input?: DurationInput, key?: string, config: DateParsingConfig = {}) {\n const duration = convertDuration(input, key);\n // matching against regexp is expensive, do it on demand\n\n return new Duration(duration, config);\n}\n\nfunction convertDuration(input: any, key: string): Partial<DateObject> {\n // checks for null or undefined\n if (input == null) {\n return {};\n }\n\n if (isDuration(input)) {\n return {\n milliseconds: input._milliseconds,\n day: input._days,\n month: input._months\n };\n }\n if (isNumber(input)) {\n // duration = {};\n return key ? { [key]: input } : { milliseconds: input };\n }\n\n if (isString(input)) {\n let match = aspNetRegex.exec(input);\n\n if (match) {\n const sign = (match[1] === '-') ? -1 : 1;\n\n return {\n year: 0,\n day: toInt(match[DATE]) * sign,\n hours: toInt(match[HOUR]) * sign,\n minutes: toInt(match[MINUTE]) * sign,\n seconds: toInt(match[SECOND]) * sign,\n // the millisecond decimal point is included in the match\n milliseconds: toInt(absRound(toInt(match[MILLISECOND]) * 1000)) * sign\n };\n }\n\n match = isoRegex.exec(input);\n if (match) {\n const sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;\n\n return {\n year: parseIso(match[2], sign),\n month: parseIso(match[3], sign),\n week: parseIso(match[4], sign),\n day: parseIso(match[5], sign),\n hours: parseIso(match[6], sign),\n minutes: parseIso(match[7], sign),\n seconds: parseIso(match[8], sign)\n };\n }\n\n }\n\n if (isObject<{from: any; to: any}>(input) && ('from' in input || 'to' in input)) {\n const diffRes = momentsDifference(parseDate(input.from), parseDate(input.to));\n\n return {\n milliseconds: diffRes.milliseconds,\n month: diffRes.months\n };\n }\n\n return input;\n}\n\n// createDuration.fn = Duration.prototype;\n// createDuration.invalid = invalid;\n\nfunction parseIso(inp: string, sign: number): number {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n const res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n\n return (isNaN(res) ? 0 : res) * sign;\n}\n\nfunction positiveMomentsDifference(base: Date, other: Date): { milliseconds: number; months: number } {\n const res = { milliseconds: 0, months: 0 };\n\n res.months = getMonth(other) - getMonth(base) +\n (getFullYear(other) - getFullYear(base)) * 12;\n const _basePlus = add(cloneDate(base), res.months, 'month');\n if (isAfter(_basePlus, other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(add(cloneDate(base), res.months, 'month'));\n\n return res;\n}\n\nfunction momentsDifference(base: Date, other: Date): { milliseconds: number; months: number } {\n if (!(isDateValid(base) && isDateValid(other))) {\n return { milliseconds: 0, months: 0 };\n }\n\n let res;\n const _other = cloneWithOffset(other, base, {_offset: base.getTimezoneOffset()});\n if (isBefore(base, _other)) {\n res = positiveMomentsDifference(base, _other);\n } else {\n res = positiveMomentsDifference(_other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n}\n","//! moment.js locale configuration\n//! locale : Arabic [ar]\n//! author : Abdel Said: https://github.com/abdelsaid\n//! author : Ahmed Elkhatib\n//! author : forabi https://github.com/forabi\n\nimport { LocaleData } from '../locale/locale.class';\n\nconst symbolMap: {[key: string]: string} = {\n 1: 'Ù¡',\n 2: 'Ù¢',\n 3: 'Ù£',\n 4: 'Ù¤',\n 5: 'Ù¥',\n 6: 'Ù¦',\n 7: 'Ù§',\n 8: 'Ù¨',\n 9: 'Ù©',\n 0: 'Ù '\n};\nconst numberMap: {[key: string]: string} = {\n 'Ù¡': '1',\n 'Ù¢': '2',\n 'Ù£': '3',\n 'Ù¤': '4',\n 'Ù¥': '5',\n 'Ù¦': '6',\n 'Ù§': '7',\n 'Ù¨': '8',\n 'Ù©': '9',\n 'Ù ': '0'\n};\nconst pluralForm = function (num: number): number {\n return num === 0 ? 0 : num === 1 ? 1 : num === 2 ? 2 : num % 100 >= 3 && num % 100 <= 10 ? 3 : num % 100 >= 11 ? 4 : 5;\n};\nconst plurals: {[key: string]: [string, string, [string, string], string, string, string]} = {\n s: ['أقل من ثانية', 'ثانية واØدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],\n m: ['أقل من دقيقة', 'دقيقة واØدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],\n h: ['أقل من ساعة', 'ساعة واØدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],\n d: ['أقل من يوم', 'يوم واØد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],\n M: ['أقل من شهر', 'شهر واØد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],\n y: ['أقل من عام', 'عام واØد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']\n};\nconst pluralize = function (u: string) {\n return function (num: number, withoutSuffix: boolean): string {\n const f = pluralForm(num);\n let str = plurals[u][pluralForm(num)];\n if (f === 2) {\n str = str[withoutSuffix ? 0 : 1];\n }\n\n return (str as string).replace(/%d/i, num.toString());\n };\n};\nconst months: string[] = [\n 'يناير',\n 'Ùبراير',\n 'مارس',\n 'أبريل',\n 'مايو',\n 'يونيو',\n 'يوليو',\n 'أغسطس',\n 'سبتمبر',\n 'أكتوبر',\n 'نوÙمبر',\n 'ديسمبر'\n];\n\nexport const arLocale: LocaleData = {\n abbr: 'ar',\n months,\n monthsShort: months,\n weekdays: 'الأØد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort: 'Ø£Øد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin: 'Ø_Ù†_Ø«_ر_Ø®_ج_س'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'D/\\u200FM/\\u200FYYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm'\n },\n meridiemParse: /ص|Ù…/,\n isPM(input) {\n return 'Ù…' === input;\n },\n meridiem(hour, minute, isLower) {\n if (hour < 12) {\n return 'ص';\n } else {\n return 'Ù…';\n }\n },\n calendar: {\n sameDay: '[اليوم عند الساعة] LT',\n nextDay: '[غدًا عند الساعة] LT',\n nextWeek: 'dddd [عند الساعة] LT',\n lastDay: '[أمس عند الساعة] LT',\n lastWeek: 'dddd [عند الساعة] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'بعد %s',\n past: 'منذ %s',\n s: pluralize('s'),\n ss: pluralize('s'),\n m: pluralize('m'),\n mm: pluralize('m'),\n h: pluralize('h'),\n hh: pluralize('h'),\n d: pluralize('d'),\n dd: pluralize('d'),\n M: pluralize('M'),\n MM: pluralize('M'),\n y: pluralize('y'),\n yy: pluralize('y')\n },\n preparse(str: string): string {\n return str.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n return numberMap[match];\n }).replace(/ØŒ/g, ',');\n },\n postformat(str: string) {\n return str.replace(/\\d/g, function (match) {\n return symbolMap[match];\n }).replace(/,/g, 'ØŒ');\n },\n week: {\n dow: 6, // Saturday is the first day of the week.\n doy: 12 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { Khronos } from '../testing/chain';\n\n//! moment.js locale configuration\n//! locale : Bulgarian [bg]\n//! author : Iskren Ivov Chernev : https://github.com/ichernev\n//! author : Kunal Marwaha : https://github.com/marwahaha\n//! author : Matt Grande : https://github.com/mattgrande\n//! author : Isaac Cambron : https://github.com/icambron\n//! author : Venelin Manchev : https://github.com/vmanchev\n\nexport const bgLocale: LocaleData = {\n abbr: 'bg',\n months: 'Ñнуари_февруари_март_април_май_юни_юли_авгуÑÑ‚_Ñептември_октомври_ноември_декември'.split('_'),\n monthsShort: 'Ñнр_фев_мар_апр_май_юни_юли_авг_Ñеп_окт_ное_дек'.split('_'),\n weekdays: 'неделÑ_понеделник_вторник_ÑÑ€Ñда_четвъртък_петък_Ñъбота'.split('_'),\n weekdaysShort: 'нед_пон_вто_ÑÑ€Ñ_чет_пет_Ñъб'.split('_'),\n weekdaysMin: 'нд_пн_вт_ÑÑ€_чт_пт_Ñб'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'D.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY H:mm',\n LLLL: 'dddd, D MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[Ð”Ð½ÐµÑ Ð²] LT',\n nextDay: '[Утре в] LT',\n nextWeek: 'dddd [в] LT',\n lastDay: '[Вчера в] LT',\n lastWeek: function (d: any) {\n\n switch (d) {\n case 0:\n case 3:\n case 6:\n return '[Ð’ изминалата] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[Ð’ изминалиÑ] dddd [в] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'Ñлед %s',\n past: 'преди %s',\n s: 'нÑколко Ñекунди',\n ss: '%d Ñекунди',\n m: 'минута',\n mm: '%d минути',\n h: 'чаÑ',\n hh: '%d чаÑа',\n d: 'ден',\n dd: '%d дни',\n M: 'меÑец',\n MM: '%d меÑеца',\n y: 'година',\n yy: '%d години'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n ordinal: function (_num: number): string {\n\n const number = Number(_num);\n\n let lastDigit = number % 10,\n last2Digits = number % 100;\n\n if (number === 0) {\n return number + '-ев';\n } else if (last2Digits === 0) {\n return number + '-ен';\n } else if (last2Digits > 10 && last2Digits < 20) {\n return number + '-ти';\n } else if (lastDigit === 1) {\n return number + '-ви';\n } else if (lastDigit === 2) {\n return number + '-ри';\n } else if (lastDigit === 7 || lastDigit === 8) {\n return number + '-ми';\n } else {\n return number + '-ти';\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours, getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Catalan [ca]\n//! author : Xavier Arbat : https://github.com/XavisaurusRex\n\nlet monthsShortDot = 'gen._feb._mar._abr._mai._jun._jul._ago._set._oct._nov._des.'.split('_'),\n monthsShort = 'ene_feb_mar_abr_mai_jun_jul_ago_set_oct_nov_des'.split('_');\n\nlet monthsParse = [/^gen/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^jun/i, /^jul/i, /^ago/i, /^set/i, /^oct/i, /^nov/i, /^des/i];\nlet monthsRegex = /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre|gen\\.?|feb\\.?|mar\\.?|abr\\.?|mai\\.?|jun\\.?|jul\\.?|ago\\.?|set\\.?|oct\\.?|nov\\.?|des\\.?)/i;\n\nexport const caLocale: LocaleData = {\n abbr: 'ca',\n months: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortDot;\n }\n\n if (/-MMM-/.test(format)) {\n return monthsShort[getMonth(date, isUTC)];\n }\n\n return monthsShortDot[getMonth(date, isUTC)];\n },\n monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i,\n monthsShortStrictRegex: /^(gen\\.?|feb\\.?|mar\\.?|abr\\.?|mai\\.?|jun\\.?|jul\\.?|ago\\.?|set\\.?|oct\\.?|nov\\.?|des\\.?)/i,\n monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),\n weekdaysShort: 'diu._dil._dim._dix._dij._div._dis.'.split('_'),\n weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY H:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'\n },\n calendar: {\n sameDay(date: Date) {\n return '[avui a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';\n },\n nextDay(date: Date) {\n return '[dema a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';\n },\n nextWeek(date: Date) {\n return 'dddd [a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';\n },\n lastDay(date: Date) {\n return '[ahir a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';\n },\n lastWeek(date: Date) {\n return '[el] dddd [' + ('passada la ' + (getHours(date) !== 1) ? 'passades les' : '') + '] LT';\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'en %s',\n past: 'fa %s',\n s: 'uns segons',\n ss: '%d segons',\n m: 'un minut',\n mm: '%d minuts',\n h: 'una hora',\n hh: '%d hores',\n d: 'un dia',\n dd: '%d dies',\n M: 'un mes',\n MM: '%d mesos',\n y: 'un any',\n yy: '%d anys'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|on|er|rt|é)/,\n ordinal(_num: number): string {\n const num = Number(_num);\n const output = (num > 4) ? 'é' :\n (num === 1 || num === 3) ? 'r' :\n (num === 2) ? 'n' :\n (num === 4) ? 't' : 'é';\n return num + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Czech [cs]\n//! author : petrbela : https://github.com/petrbela\n\nconst months: string[] = 'leden_únor_bÅ™ezen_duben_kvÄ›ten_Äerven_Äervenec_srpen_zářÃ_Å™Ãjen_listopad_prosinec'.split('_');\nconst monthsShort: string[] = 'led_úno_bÅ™e_dub_kvÄ›_Ävn_Ävc_srp_zář_Å™Ãj_lis_pro'.split('_');\n\nfunction plural(num: number): boolean {\n return (num > 1) && (num < 5) && (~~(num / 10) !== 1);\n}\n\nfunction translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {\n const result = num + ' ';\n\n switch (key) {\n case 's': // a few seconds / in a few seconds / a few seconds ago\n return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';\n case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'sekundy' : 'sekund');\n } else {\n return result + 'sekundami';\n }\n // break;\n case 'm': // a minute / in a minute / a minute ago\n return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');\n case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'minuty' : 'minut');\n } else {\n return result + 'minutami';\n }\n // break;\n case 'h': // an hour / in an hour / an hour ago\n return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n case 'hh': // 9 hours / in 9 hours / 9 hours ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'hodiny' : 'hodin');\n } else {\n return result + 'hodinami';\n }\n // break;\n case 'd': // a day / in a day / a day ago\n return (withoutSuffix || isFuture) ? 'den' : 'dnem';\n case 'dd': // 9 days / in 9 days / 9 days ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'dny' : 'dnÃ');\n } else {\n return result + 'dny';\n }\n // break;\n case 'M': // a month / in a month / a month ago\n return (withoutSuffix || isFuture) ? 'mÄ›sÃc' : 'mÄ›sÃcem';\n case 'MM': // 9 months / in 9 months / 9 months ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'mÄ›sÃce' : 'mÄ›sÃců');\n } else {\n return result + 'mÄ›sÃci';\n }\n // break;\n case 'y': // a year / in a year / a year ago\n return (withoutSuffix || isFuture) ? 'rok' : 'rokem';\n case 'yy': // 9 years / in 9 years / 9 years ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'roky' : 'let');\n } else {\n return result + 'lety';\n }\n // break;\n }\n}\n\nexport const csLocale: LocaleData = {\n abbr: 'cs',\n months,\n monthsShort,\n monthsParse: (function (months, monthsShort) {\n let i, _monthsParse = [];\n for (i = 0; i < 12; i++) {\n // use custom parser to solve problem with July (Äervenec)\n _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n }\n return _monthsParse;\n }(months, monthsShort)),\n shortMonthsParse: (function (monthsShort) {\n let i, _shortMonthsParse = [];\n for (i = 0; i < 12; i++) {\n _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');\n }\n return _shortMonthsParse;\n }(monthsShort)),\n longMonthsParse: (function (months) {\n let i, _longMonthsParse = [];\n for (i = 0; i < 12; i++) {\n _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');\n }\n return _longMonthsParse;\n }(months)),\n weekdays: 'nedÄ›le_pondÄ›lÃ_úterý_stÅ™eda_Ätvrtek_pátek_sobota'.split('_'),\n weekdaysShort: 'ne_po_út_st_Ät_pá_so'.split('_'),\n weekdaysMin: 'ne_po_út_st_Ät_pá_so'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd D. MMMM YYYY H:mm',\n l: 'D. M. YYYY'\n },\n calendar: {\n sameDay: '[dnes v] LT',\n nextDay: '[zÃtra v] LT',\n nextWeek(date: Date): string {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[v nedÄ›li v] LT';\n case 1:\n case 2:\n return '[v] dddd [v] LT';\n case 3:\n return '[ve stÅ™edu v] LT';\n case 4:\n return '[ve Ätvrtek v] LT';\n case 5:\n return '[v pátek v] LT';\n case 6:\n return '[v sobotu v] LT';\n }\n },\n lastDay: '[vÄera v] LT',\n lastWeek(date: Date): string {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[minulou nedÄ›li v] LT';\n case 1:\n case 2:\n return '[minulé] dddd [v] LT';\n case 3:\n return '[minulou stÅ™edu v] LT';\n case 4:\n case 5:\n return '[minulý] dddd [v] LT';\n case 6:\n return '[minulou sobotu v] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'za %s',\n past: 'pÅ™ed %s',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Danish (Denmark) [da]\n//! author : Per Hansen : https://github.com/perhp\n\nexport const daLocale: LocaleData = {\n abbr: 'da',\n months : 'Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec'.split('_'),\n weekdays : 'Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag'.split('_'),\n weekdaysShort : 'Søn_Man_Tir_Ons_Tor_Fre_Lør'.split('_'),\n weekdaysMin : 'Sø_Ma_Ti_On_To_Fr_Lø'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY HH:mm',\n LLLL : 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'\n },\n calendar : {\n sameDay : '[i dag kl.] LT',\n nextDay : '[i morgen kl.] LT',\n nextWeek : 'pÃ¥ dddd [kl.] LT',\n lastDay : '[i gÃ¥r kl.] LT',\n lastWeek : '[i] dddd[s kl.] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'om %s',\n past : '%s siden',\n s : 'fÃ¥ sekunder',\n m : 'et minut',\n mm : '%d minutter',\n h : 'en time',\n hh : '%d timer',\n d : 'en dag',\n dd : '%d dage',\n M : 'en mÃ¥ned',\n MM : '%d mÃ¥neder',\n y : 'et Ã¥r',\n yy : '%d Ã¥r'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : German [de]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\nfunction processRelativeTime(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {\n const format: { [key: string]: [string, string] } = {\n 'm': ['eine Minute', 'einer Minute'],\n 'h': ['eine Stunde', 'einer Stunde'],\n 'd': ['ein Tag', 'einem Tag'],\n 'dd': [num + ' Tage', num + ' Tagen'],\n 'M': ['ein Monat', 'einem Monat'],\n 'MM': [num + ' Monate', num + ' Monaten'],\n 'y': ['ein Jahr', 'einem Jahr'],\n 'yy': [num + ' Jahre', num + ' Jahren']\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n}\n\nexport const deLocale: LocaleData = {\n abbr: 'de',\n months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),\n monthsParseExact: true,\n weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY HH:mm',\n LLLL: 'dddd, D. MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]'\n },\n relativeTime: {\n future: 'in %s',\n past: 'vor %s',\n s: 'ein paar Sekunden',\n ss: '%d Sekunden',\n m: processRelativeTime,\n mm: '%d Minuten',\n h: processRelativeTime,\n hh: '%d Stunden',\n d: processRelativeTime,\n dd: processRelativeTime,\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : English (United Kingdom) [en-gb]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\nexport const enGbLocale: LocaleData = {\n abbr: 'en-gb',\n months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n ss : '%d seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal(_num: number): string {\n const num = Number(_num);\n const b = num % 10,\n output = (~~(num % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return num + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours, getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Spanish (Dominican Republic) [es-do]\n\nlet monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\nlet monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];\nlet monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\nexport const esDoLocale: LocaleData = {\n abbr: 'es-do',\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[getMonth(date, isUTC)];\n } else {\n return monthsShortDot[getMonth(date, isUTC)];\n }\n },\n monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex: /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY h:mm A',\n LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'\n },\n calendar: {\n sameDay(date: Date): string {\n return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextDay(date: Date): string {\n return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextWeek(date: Date): string {\n return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastDay(date: Date): string {\n return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastWeek(date: Date): string {\n return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un dÃa',\n dd: '%d dÃas',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours, getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Spanish [es]\n//! author : Julio Napurà : https://github.com/julionc\n\nlet monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\nlet monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];\nlet monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\nexport const esLocale: LocaleData = {\n abbr: 'es',\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortDot;\n }\n\n if (/-MMM-/.test(format)) {\n return monthsShort[getMonth(date, isUTC)];\n }\n\n return monthsShortDot[getMonth(date, isUTC)];\n },\n monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex: /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY H:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'\n },\n calendar: {\n sameDay(date: Date) {\n return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextDay(date: Date) {\n return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextWeek(date: Date) {\n return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastDay(date: Date) {\n return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastWeek(date: Date) {\n return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un dÃa',\n dd: '%d dÃas',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours, getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Spanish (Puerto Rico) [es-pr]\n\nlet monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');\nlet monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\nexport const esPrLocale: LocaleData = {\n abbr: 'es-pr',\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[getMonth(date, isUTC)];\n } else {\n return monthsShortDot[getMonth(date, isUTC)];\n }\n },\n monthsParseExact: true,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'MM/DD/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY h:mm A',\n LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'\n },\n calendar: {\n sameDay(date: Date): string {\n return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextDay(date: Date): string {\n return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextWeek(date: Date): string {\n return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastDay(date: Date): string {\n return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastWeek(date: Date): string {\n return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un dÃa',\n dd: '%d dÃas',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours, getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Spanish (United States) [es-us]\n//! author : bustta : https://github.com/bustta\n\nlet monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');\nlet monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\nexport const esUsLocale: LocaleData = {\n abbr: 'es-us',\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[getMonth(date, isUTC)];\n } else {\n return monthsShortDot[getMonth(date, isUTC)];\n }\n },\n monthsParseExact: true,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'MM/DD/YYYY',\n LL: 'MMMM [de] D [de] YYYY',\n LLL: 'MMMM [de] D [de] YYYY h:mm A',\n LLLL: 'dddd, MMMM [de] D [de] YYYY h:mm A'\n },\n calendar: {\n sameDay(date: Date): string {\n return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextDay(date: Date): string {\n return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextWeek(date: Date): string {\n return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastDay(date: Date): string {\n return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastWeek(date: Date): string {\n return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un dÃa',\n dd: '%d dÃas',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Estonian [et]\n//! author : Chris Gedrim : https://github.com/a90machado\n\nconst processRelativeTime = function (num: number, withoutSuffix: boolean, key: string, isFuture: boolean) {\n const format = {\n s : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n ss: [num + 'sekundi', num + 'sekundit'],\n m : ['ühe minuti', 'üks minut'],\n mm: [num + ' minuti', num + ' minutit'],\n h : ['ühe tunni', 'tund aega', 'üks tund'],\n hh: [num + ' tunni', num + ' tundi'],\n d : ['ühe päeva', 'üks päev'],\n M : ['kuu aja', 'kuu aega', 'üks kuu'],\n MM: [num + ' kuu', num + ' kuud'],\n y : ['ühe aasta', 'aasta', 'üks aasta'],\n yy: [num + ' aasta', num + ' aastat']\n };\n if (withoutSuffix) {\n return format[key][2] ? format[key][2] : format[key][1];\n }\n return isFuture ? format[key][0] : format[key][1];\n};\n\nexport const etLocale: LocaleData = {\n abbr: 'et',\n months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),\n monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),\n weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),\n weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd, D. MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[Täna,] LT',\n nextDay: '[Homme,] LT',\n nextWeek: '[Järgmine] dddd LT',\n lastDay: '[Eile,] LT',\n lastWeek: '[Eelmine] dddd LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : '%s pärast',\n past : '%s tagasi',\n s : processRelativeTime,\n ss : processRelativeTime,\n m : processRelativeTime,\n mm : processRelativeTime,\n h : processRelativeTime,\n hh : processRelativeTime,\n d : processRelativeTime,\n dd : '%d päeva',\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n dayOfMonthOrdinalParse : /\\d{1,2}./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n// https://github.com/moment/moment/blob/develop/locale/fi.js\n\nvar numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),\n numbersFuture = [\n 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',\n numbersPast[7], numbersPast[8], numbersPast[9]\n ];\n\nfunction translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {\n var result = '';\n switch (key) {\n case 's':\n return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n case 'ss':\n return isFuture ? 'sekunnin' : 'sekuntia';\n case 'm':\n return isFuture ? 'minuutin' : 'minuutti';\n case 'mm':\n result = isFuture ? 'minuutin' : 'minuuttia';\n break;\n case 'h':\n return isFuture ? 'tunnin' : 'tunti';\n case 'hh':\n result = isFuture ? 'tunnin' : 'tuntia';\n break;\n case 'd':\n return isFuture ? 'päivän' : 'päivä';\n case 'dd':\n result = isFuture ? 'päivän' : 'päivää';\n break;\n case 'M':\n return isFuture ? 'kuukauden' : 'kuukausi';\n case 'MM':\n result = isFuture ? 'kuukauden' : 'kuukautta';\n break;\n case 'y':\n return isFuture ? 'vuoden' : 'vuosi';\n case 'yy':\n result = isFuture ? 'vuoden' : 'vuotta';\n break;\n }\n result = verbalNumber(num, isFuture) + ' ' + result;\n return result;\n}\n\nfunction verbalNumber(num: number, isFuture: boolean) {\n return num < 10 ? (isFuture ? numbersFuture[num] : numbersPast[num]) : num;\n}\n\nexport const fiLocale: LocaleData = {\n abbr: 'fi',\n months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),\n monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),\n weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),\n weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),\n weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),\n longDateFormat: {\n LT: 'HH.mm',\n LTS: 'HH.mm.ss',\n L: 'DD.MM.YYYY',\n LL: 'Do MMMM[ta] YYYY',\n LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',\n LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',\n l: 'D.M.YYYY',\n ll: 'Do MMM YYYY',\n lll: 'Do MMM YYYY, [klo] HH.mm',\n llll: 'ddd, Do MMM YYYY, [klo] HH.mm'\n },\n calendar: {\n sameDay: '[tänään] [klo] LT',\n nextDay: '[huomenna] [klo] LT',\n nextWeek: 'dddd [klo] LT',\n lastDay: '[eilen] [klo] LT',\n lastWeek: '[viime] dddd[na] [klo] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: '%s päästä',\n past: '%s sitten',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : French [fr]\n//! author : John Fischer : https://github.com/jfroffice\n\nexport const frLocale: LocaleData = {\n abbr: 'fr',\n months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n monthsParseExact: true,\n weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[Aujourd’hui à ] LT',\n nextDay: '[Demain à ] LT',\n nextWeek: 'dddd [à ] LT',\n lastDay: '[Hier à ] LT',\n lastWeek: 'dddd [dernier à ] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'dans %s',\n past: 'il y a %s',\n s: 'quelques secondes',\n ss: '%d secondes',\n m: 'une minute',\n mm: '%d minutes',\n h: 'une heure',\n hh: '%d heures',\n d: 'un jour',\n dd: '%d jours',\n M: 'un mois',\n MM: '%d mois',\n y: 'un an',\n yy: '%d ans'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|)/,\n ordinal(_num: number, period: string): string {\n const num = Number(_num);\n switch (period) {\n // TODO: Return 'e' when day of month > 1. Move this case inside\n // block for masculine words below.\n // See https://github.com/moment/moment/issues/3375\n case 'D':\n return num + (num === 1 ? 'er' : '');\n\n // Words with masculine grammatical gender: mois, trimestre, jour\n default:\n case 'M':\n case 'Q':\n case 'DDD':\n case 'd':\n return num + (num === 1 ? 'er' : 'e');\n\n // Words with feminine grammatical gender: semaine\n case 'w':\n case 'W':\n return num + (num === 1 ? 're' : 'e');\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours, getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Galician [gl]\n//! author : DarÃo Beiró : https://github.com/quinobravo\n\nlet monthsShortDot = 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),\n monthsShort = 'xan_feb_mar_abr_mai_xuñ_xul_ago_set_out_nov_dec'.split('_');\n\nlet monthsParse = [/^xan/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^xuñ/i, /^xul/i, /^ago/i, /^set/i, /^out/i, /^nov/i, /^dec/i];\nlet monthsRegex = /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro|xan\\.?|feb\\.?|mar\\.?|abr\\.?|mai\\.?|xuñ\\.?|xul\\.?|ago\\.?|set\\.?|out\\.?|nov\\.?|dec\\.?)/i;\n\nexport const glLocale: LocaleData = {\n abbr: 'gl',\n months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortDot;\n }\n\n if (/-MMM-/.test(format)) {\n return monthsShort[getMonth(date, isUTC)];\n }\n\n return monthsShortDot[getMonth(date, isUTC)];\n },\n monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i,\n monthsShortStrictRegex: /^(xan\\.?|feb\\.?|mar\\.?|abr\\.?|mai\\.?|xuñ\\.?|xul\\.?|ago\\.?|set\\.?|out\\.?|nov\\.?|dec\\.?)/i,\n monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY H:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'\n },\n calendar: {\n sameDay(date: Date) {\n return '[hoxe á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextDay(date: Date) {\n return '[mañan á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n nextWeek(date: Date) {\n return 'dddd [á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastDay(date: Date) {\n return '[onte á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n lastWeek(date: Date) {\n return '[o] dddd [pasado á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'en %s',\n past: 'fai %s',\n s: 'uns segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'unha hora',\n hh: '%d horas',\n d: 'un dÃa',\n dd: '%d dÃas',\n M: 'un mes',\n MM: '%d meses',\n y: 'un ano',\n yy: '%d anos'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Hebrew [he]\n//! author : Tomer Cohen : https://github.com/tomer\n//! author : Moshe Simantov : https://github.com/DevelopmentIL\n//! author : Tal Ater : https://github.com/TalAter\n\nexport const heLocale: LocaleData = {\n abbr: 'he',\n months: '×™× ×•×ר_פברו×ר_מרץ_×פריל_מ××™_×™×•× ×™_יולי_×וגוסט_ספטמבר_×וקטובר_× ×•×‘×ž×‘×¨_דצמבר'.split('_'),\n monthsShort: '×™× ×•×³_פבר׳_מרץ_×פר׳_מ××™_×™×•× ×™_יולי_×וג׳_ספט׳_×וק׳_× ×•×‘×³_דצמ׳'.split('_'),\n weekdays: 'ר×שון_×©× ×™_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n weekdaysShort: '×׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n weekdaysMin: '×_ב_×’_ד_×”_ו_ש'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [ב]MMMM YYYY',\n LLL: 'D [ב]MMMM YYYY HH:mm',\n LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',\n l: 'D/M/YYYY',\n ll: 'D MMM YYYY',\n lll: 'D MMM YYYY HH:mm',\n llll: 'ddd, D MMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[×”×™×•× ×‘Ö¾]LT',\n nextDay: '[מחר ב־]LT',\n nextWeek: 'dddd [בשעה] LT',\n lastDay: '[×תמול ב־]LT',\n lastWeek: '[ביו×] dddd [×”×חרון בשעה] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'בעוד %s',\n past: '×œ×¤× ×™ %s',\n s: 'מספר ×©× ×™×•×ª',\n ss: '%d ×©× ×™×•×ª',\n m: 'דקה',\n mm: '%d דקות',\n h: 'שעה',\n hh(num: number): string {\n if (num === 2) {\n return 'שעתיי×';\n }\n return num + ' שעות';\n },\n d: 'יו×',\n dd(num: number): string {\n if (num === 2) {\n return 'יומיי×';\n }\n return num + ' ימי×';\n },\n M: 'חודש',\n MM(num: number): string {\n if (num === 2) {\n return 'חודשיי×';\n }\n return num + ' חודשי×';\n },\n y: '×©× ×”',\n yy(num: number): string {\n if (num === 2) {\n return '×©× ×ª×™×™×';\n } else if (num % 10 === 0 && num !== 10) {\n return num + ' ×©× ×”';\n }\n return num + ' ×©× ×™×';\n }\n },\n meridiemParse: /××—×”\"צ|×œ×¤× ×”\"צ|×חרי הצהריי×|×œ×¤× ×™ הצהריי×|×œ×¤× ×•×ª בוקר|בבוקר|בערב/i,\n isPM(input) {\n return /^(××—×”\"צ|×חרי הצהריי×|בערב)$/.test(input);\n },\n meridiem(hour, minute, isLower) {\n if (hour < 5) {\n return '×œ×¤× ×•×ª בוקר';\n } else if (hour < 10) {\n return 'בבוקר';\n } else if (hour < 12) {\n return isLower ? '×œ×¤× ×”\"צ' : '×œ×¤× ×™ הצהריי×';\n } else if (hour < 18) {\n return isLower ? '××—×”\"צ' : '×חרי הצהריי×';\n } else {\n return 'בערב';\n }\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Hindi [hi]\n//! author : Mayank Singhal : https://github.com/mayanksinghal\n\nlet symbolMap: {[key: string]: string} = {\n 1: '१',\n 2: '२',\n 3: '३',\n 4: '४',\n 5: '५',\n 6: '६',\n 7: 'à¥',\n 8: '८',\n 9: '९',\n 0: '०'\n },\n numberMap: {[key: string]: string} = {\n '१': '1',\n '२': '2',\n '३': '3',\n '४': '4',\n '५': '5',\n '६': '6',\n 'à¥': '7',\n '८': '8',\n '९': '9',\n '०': '0'\n };\n\nexport const hiLocale: LocaleData = {\n abbr: 'hi',\n months: 'जनवरी_फ़रवरी_मारà¥à¤š_अपà¥à¤°à¥ˆà¤²_मई_जून_जà¥à¤²à¤¾à¤ˆ_अगसà¥à¤¤_सितमà¥à¤¬à¤°_अकà¥à¤Ÿà¥‚बर_नवमà¥à¤¬à¤°_दिसमà¥à¤¬à¤°'.split('_'),\n monthsShort: 'जन._फ़र._मारà¥à¤š_अपà¥à¤°à¥ˆ._मई_जून_जà¥à¤²._अग._सित._अकà¥à¤Ÿà¥‚._नव._दिस.'.split('_'),\n monthsParseExact: true,\n weekdays: 'रविवार_सोमवार_मंगलवार_बà¥à¤§à¤µà¤¾à¤°_गà¥à¤°à¥‚वार_शà¥à¤•à¥à¤°à¤µà¤¾à¤°_शनिवार'.split('_'),\n weekdaysShort: 'रवि_सोम_मंगल_बà¥à¤§_गà¥à¤°à¥‚_शà¥à¤•à¥à¤°_शनि'.split('_'),\n weekdaysMin: 'र_सो_मं_बà¥_गà¥_शà¥_श'.split('_'),\n longDateFormat: {\n LT: 'A h:mm बजे',\n LTS: 'A h:mm:ss बजे',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY, A h:mm बजे',\n LLLL: 'dddd, D MMMM YYYY, A h:mm बजे'\n },\n calendar: {\n sameDay: '[आज] LT',\n nextDay: '[कल] LT',\n nextWeek: 'dddd, LT',\n lastDay: '[कल] LT',\n lastWeek: '[पिछले] dddd, LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: '%s में',\n past: '%s पहले',\n s: 'कà¥à¤› ही कà¥à¤·à¤£',\n ss: '%d सेकंड',\n m: 'à¤à¤• मिनट',\n mm: '%d मिनट',\n h: 'à¤à¤• घंटा',\n hh: '%d घंटे',\n d: 'à¤à¤• दिन',\n dd: '%d दिन',\n M: 'à¤à¤• महीने',\n MM: '%d महीने',\n y: 'à¤à¤• वरà¥à¤·',\n yy: '%d वरà¥à¤·'\n },\n preparse(str: string): string {\n return str.replace(/[१२३४५६à¥à¥®à¥¯à¥¦]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat(str: string): string {\n return str.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n meridiemParse: /रात|सà¥à¤¬à¤¹|दोपहर|शाम/,\n meridiemHour(hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'रात') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'सà¥à¤¬à¤¹') {\n return hour;\n } else if (meridiem === 'दोपहर') {\n return hour >= 10 ? hour : hour + 12;\n } else if (meridiem === 'शाम') {\n return hour + 12;\n }\n },\n meridiem(hour, minute, isLower) {\n if (hour < 4) {\n return 'रात';\n } else if (hour < 10) {\n return 'सà¥à¤¬à¤¹';\n } else if (hour < 17) {\n return 'दोपहर';\n } else if (hour < 20) {\n return 'शाम';\n } else {\n return 'रात';\n }\n },\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Hungarian [hu]\n//! author : Adam Brunner : https://github.com/adambrunner\n\nlet weekEndings = 'vasárnap hétfÅ‘n kedden szerdán csütörtökön pénteken szombaton'.split(' ');\nfunction translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {\n switch (key) {\n case 's':\n return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';\n case 'ss':\n return num + ((isFuture || withoutSuffix) ? ' másodperc' : ' másodperce');\n case 'm':\n return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n case 'mm':\n return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n case 'h':\n return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n case 'hh':\n return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n case 'd':\n return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n case 'dd':\n return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n case 'M':\n return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n case 'MM':\n return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n case 'y':\n return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n case 'yy':\n return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n }\n return '';\n}\nfunction week(date: Date, isFuture: boolean) {\n return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[getDayOfWeek(date)] + '] LT[-kor]';\n}\n\nexport const huLocale: LocaleData = {\n abbr: 'hu',\n months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),\n monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),\n weekdays : 'vasárnap_hétfÅ‘_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'YYYY.MM.DD.',\n LL : 'YYYY. MMMM D.',\n LLL : 'YYYY. MMMM D. H:mm',\n LLLL : 'YYYY. MMMM D., dddd H:mm'\n },\n meridiemParse: /de|du/i,\n isPM (input) {\n return input.charAt(1).toLowerCase() === 'u';\n },\n meridiem (hours, minutes, isLower) {\n if (hours < 12) {\n return isLower === true ? 'de' : 'DE';\n } else {\n return isLower === true ? 'du' : 'DU';\n }\n },\n calendar : {\n sameDay : '[ma] LT[-kor]',\n nextDay : '[holnap] LT[-kor]',\n nextWeek (date: Date) {\n return week(date, true);\n },\n lastDay : '[tegnap] LT[-kor]',\n lastWeek (date: Date) {\n return week(date, false);\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s múlva',\n past : '%s',\n s : translate,\n ss : translate,\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : translate,\n dd : translate,\n M : translate,\n MM : translate,\n y : translate,\n yy : translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Croatian [hr]\n//! author : Danijel Grmec : https://github.com/cobaltsis\n\nexport const hrLocale: LocaleData = {\n abbr: 'hr',\n months: 'SijeÄanj_VeljaÄa_Ožujak_Travanj_Svibanj_Lipanj_Srpanj_Kolovoz_Rujan_Listopad_Studeni_Prosinac'.split('_'),\n monthsShort: 'Sij_Velj_Ožu_Tra_Svi_Lip_Srp_Kol_Ruj_Lis_Stu_Pro'.split('_'),\n weekdays: 'Nedjelja_Ponedjeljak_Utorak_Srijeda_ÄŒetvrtak_Petak_Subota'.split('_'),\n weekdaysShort: 'Ned_Pon_Uto_Sri_ÄŒet_Pet_Sub'.split('_'),\n weekdaysMin: 'Ne_Po_Ut_Sr_ÄŒe_Pe_Su'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[Danas u] LT',\n nextDay: '[Sutra u] LT',\n nextWeek: 'dddd [u] LT',\n lastDay: '[JuÄer u] LT',\n lastWeek: '[Zadnji] dddd [u] LT',\n sameElse: 'L'\n },\n invalidDate: 'Neispravan datum',\n relativeTime: {\n future: 'za %s',\n past: '%s prije',\n s: 'nekoliko sekundi',\n ss: '%d sekundi',\n m: 'minuta',\n mm: '%d minuta',\n h: 'sat',\n hh: '%d sati',\n d: 'dan',\n dd: '%d dana',\n M: 'mjesec',\n MM: '%d mjeseci',\n y: 'godina',\n yy: '%d godina'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal(_num: number): string {\n const num = Number(_num);\n const b = num % 10,\n output = (~~(num % 100 / 10) === 1) ? '.' :\n (b === 1) ? '.' :\n (b === 2) ? '.' :\n (b === 3) ? '.' : '.';\n return num + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Indonesia [id]\n//! author : Romy Kusuma : https://github.com/rkusuma\n//! reference: https://github.com/moment/moment/blob/develop/locale/id.js\n\nexport const idLocale: LocaleData = {\n abbr: 'id',\n months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),\n weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY [pukul] HH.mm',\n LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'\n },\n meridiemParse: /pagi|siang|sore|malam/,\n meridiemHour(hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'pagi') {\n return hour;\n } else if (meridiem === 'siang') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === 'sore' || meridiem === 'malam') {\n return hour + 12;\n }\n },\n meridiem(hours, minutes, isLower) {\n if (hours < 11) {\n return 'pagi';\n } else if (hours < 15) {\n return 'siang';\n } else if (hours < 19) {\n return 'sore';\n } else {\n return 'malam';\n }\n },\n calendar : {\n sameDay : '[Hari ini pukul] LT',\n nextDay : '[Besok pukul] LT',\n nextWeek : 'dddd [pukul] LT',\n lastDay : '[Kemarin pukul] LT',\n lastWeek : 'dddd [lalu pukul] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'dalam %s',\n past : '%s yang lalu',\n s : 'beberapa detik',\n ss : '%d detik',\n m : 'semenit',\n mm : '%d menit',\n h : 'sejam',\n hh : '%d jam',\n d : 'sehari',\n dd : '%d hari',\n M : 'sebulan',\n MM : '%d bulan',\n y : 'setahun',\n yy : '%d tahun'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Italian [it]\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n\nexport const itLocale: LocaleData = {\n abbr: 'it',\n months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),\n weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),\n weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[Oggi alle] LT',\n nextDay: '[Domani alle] LT',\n nextWeek: 'dddd [alle] LT',\n lastDay: '[Ieri alle] LT',\n lastWeek(date: Date) {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[la scorsa] dddd [alle] LT';\n default:\n return '[lo scorso] dddd [alle] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future(num: number): string {\n return ((/^[0-9].+$/).test(num.toString(10)) ? 'tra' : 'in') + ' ' + num;\n },\n past: '%s fa',\n s: 'alcuni secondi',\n ss: '%d secondi',\n m: 'un minuto',\n mm: '%d minuti',\n h: 'un\\'ora',\n hh: '%d ore',\n d: 'un giorno',\n dd: '%d giorni',\n M: 'un mese',\n MM: '%d mesi',\n y: 'un anno',\n yy: '%d anni'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Japanese [ja]\n//! author : LI Long : https://github.com/baryon\n\nexport const jaLocale: LocaleData = {\n abbr: 'ja',\n months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n weekdays : '日曜日_月曜日_ç«æ›œæ—¥_水曜日_木曜日_金曜日_土曜日'.split('_'),\n weekdaysShort : 'æ—¥_月_ç«_æ°´_木_金_土'.split('_'),\n weekdaysMin : 'æ—¥_月_ç«_æ°´_木_金_土'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY/MM/DD',\n LL : 'YYYYå¹´M月Dæ—¥',\n LLL : 'YYYYå¹´M月Dæ—¥ HH:mm',\n LLLL : 'YYYYå¹´M月Dæ—¥ HH:mm dddd',\n l : 'YYYY/MM/DD',\n ll : 'YYYYå¹´M月Dæ—¥',\n lll : 'YYYYå¹´M月Dæ—¥ HH:mm',\n llll : 'YYYYå¹´M月Dæ—¥ HH:mm dddd'\n },\n meridiemParse: /åˆå‰|åˆå¾Œ/i,\n isPM (input) {\n return input === 'åˆå¾Œ';\n },\n meridiem (hour, minute, isLower) {\n if (hour < 12) {\n return 'åˆå‰';\n } else {\n return 'åˆå¾Œ';\n }\n },\n calendar : {\n sameDay : '[今日] LT',\n nextDay : '[明日] LT',\n nextWeek : '[æ¥é€±]dddd LT',\n lastDay : '[昨日] LT',\n lastWeek : '[å‰é€±]dddd LT',\n sameElse : 'L'\n },\n dayOfMonthOrdinalParse : /\\d{1,2}æ—¥/,\n ordinal (num: number, period: string): string {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return num + 'æ—¥';\n default:\n return num.toString(10);\n }\n },\n relativeTime : {\n future : '%s後',\n past : '%så‰',\n s : '数秒',\n ss : '%d秒',\n m : '1分',\n mm : '%d分',\n h : '1時間',\n hh : '%d時間',\n d : '1æ—¥',\n dd : '%dæ—¥',\n M : '1ヶ月',\n MM : '%dヶ月',\n y : '1å¹´',\n yy : '%då¹´'\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Georgian [ka]\n//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili\n//! author : Levan Tskipuri : https://github.com/tskipa\n\nexport const kaLocale: LocaleData = {\n abbr: 'ka',\n months : {\n format: 'იáƒáƒœáƒ•áƒáƒ ს_თებერვáƒáƒšáƒ¡_მáƒáƒ ტს_áƒáƒžáƒ ილის_მáƒáƒ˜áƒ¡áƒ¡_ივნისს_ივლისს_áƒáƒ’ვისტს_სექტემბერს_áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერს_ნáƒáƒ”მბერს_დეკემბერს'.split('_'),\n standalone: 'იáƒáƒœáƒ•áƒáƒ ი_თებერვáƒáƒšáƒ˜_მáƒáƒ ტი_áƒáƒžáƒ ილი_მáƒáƒ˜áƒ¡áƒ˜_ივნისი_ივლისი_áƒáƒ’ვისტáƒ_სექტემბერი_áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერი_ნáƒáƒ”მბერი_დეკემბერი'.split('_')\n },\n monthsShort : 'იáƒáƒœ_თებ_მáƒáƒ _áƒáƒžáƒ _მáƒáƒ˜_ივნ_ივლ_áƒáƒ’ვ_სექ_áƒáƒ¥áƒ¢_ნáƒáƒ”_დეკ'.split('_'),\n weekdays : {\n standalone: 'კვირáƒ_áƒáƒ შáƒáƒ‘áƒáƒ—ი_სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ი_áƒáƒ—ხშáƒáƒ‘áƒáƒ—ი_ხუთშáƒáƒ‘áƒáƒ—ი_პáƒáƒ áƒáƒ¡áƒ™áƒ”ვი_შáƒáƒ‘áƒáƒ—ი'.split('_'),\n format: 'კვირáƒáƒ¡_áƒáƒ შáƒáƒ‘áƒáƒ—ს_სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ს_áƒáƒ—ხშáƒáƒ‘áƒáƒ—ს_ხუთშáƒáƒ‘áƒáƒ—ს_პáƒáƒ áƒáƒ¡áƒ™áƒ”ვს_შáƒáƒ‘áƒáƒ—ს'.split('_'),\n isFormat: /(წინáƒ|შემდეგ)/\n },\n weekdaysShort : 'კვი_áƒáƒ შ_სáƒáƒ›_áƒáƒ—ხ_ხუთ_პáƒáƒ _შáƒáƒ‘'.split('_'),\n weekdaysMin : 'კვ_áƒáƒ _სáƒ_áƒáƒ—_ხუ_პáƒ_შáƒ'.split('_'),\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY h:mm A',\n LLLL : 'dddd, D MMMM YYYY h:mm A'\n },\n calendar : {\n sameDay : '[დღეს] LT[-ზე]',\n nextDay : '[ხვáƒáƒš] LT[-ზე]',\n lastDay : '[გუშინ] LT[-ზე]',\n nextWeek : '[შემდეგ] dddd LT[-ზე]',\n lastWeek : '[წინáƒ] dddd LT-ზე',\n sameElse : 'L'\n },\n relativeTime : {\n future(s: number): string {\n var st = s.toString();\n return (/(წáƒáƒ›áƒ˜|წუთი|სáƒáƒáƒ—ი|წელი)/).test(st) ?\n st.replace(/ი$/, 'ში') :\n st + 'ში';\n },\n past(s: number): string {\n var st = s.toString();\n if ((/(წáƒáƒ›áƒ˜|წუთი|სáƒáƒáƒ—ი|დღე|თვე)/).test(st)) {\n return st.replace(/(ი|ე)$/, 'ის წინ');\n }\n if ((/წელი/).test(st)) {\n return st.replace(/წელი$/, 'წლის წინ');\n }\n },\n s : 'რáƒáƒ›áƒ“ენიმე წáƒáƒ›áƒ˜',\n ss : '%d წáƒáƒ›áƒ˜',\n m : 'წუთი',\n mm : '%d წუთი',\n h : 'სáƒáƒáƒ—ი',\n hh : '%d სáƒáƒáƒ—ი',\n d : 'დღე',\n dd : '%d დღე',\n M : 'თვე',\n MM : '%d თვე',\n y : 'წელი',\n yy : '%d წელი'\n },\n dayOfMonthOrdinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n ordinal(_num: number, _period: string): string {\n const num = Number(_num);\n if (num === 0) {\n return num.toString();\n }\n if (num === 1) {\n return num + '-ლი';\n }\n if ((num < 20) || (num <= 100 && (num % 20 === 0)) || (num % 100 === 0)) {\n return 'მე-' + num;\n }\n return num + '-ე';\n },\n week : {\n dow : 1,\n doy : 4\n }\n};\n","// ! moment.js locale configuration\n// ! locale : Kazakh [kk]\n// ! authors : Nurlan Rakhimzhanov : https://github.com/nurlan\n\nimport { LocaleData } from '..';\n\nconst suffixes = {\n 0: '-ші',\n 1: '-ші',\n 2: '-ші',\n 3: '-ші',\n 4: '-ші',\n 5: '-ші',\n 6: '-шы',\n 7: '-ші',\n 8: '-ші',\n 9: '-шы',\n 10: '-шы',\n 20: '-шы',\n 30: '-шы',\n 40: '-шы',\n 50: '-ші',\n 60: '-шы',\n 70: '-ші',\n 80: '-ші',\n 90: '-шы',\n 100: '-ші'\n};\n\nexport const kkLocale: LocaleData = {\n abbr: 'kk',\n months : 'қаңтар_ақпан_наурыз_Ñәуір_мамыр_мауÑым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқÑан'.split('_'),\n monthsShort : 'қаң_ақп_нау_Ñәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),\n weekdays : 'жекÑенбі_дүйÑенбі_ÑейÑенбі_ÑәрÑенбі_бейÑенбі_жұма_Ñенбі'.split('_'),\n weekdaysShort : 'жек_дүй_Ñей_Ñәр_бей_жұм_Ñен'.split('_'),\n weekdaysMin : 'жк_дй_Ñй_ÑÑ€_бй_жм_Ñн'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Бүгін Ñағат] LT',\n nextDay : '[Ертең Ñағат] LT',\n nextWeek : 'dddd [Ñағат] LT',\n lastDay : '[Кеше Ñағат] LT',\n lastWeek : '[Өткен аптаның] dddd [Ñағат] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s ішінде',\n past : '%s бұрын',\n s : 'бірнеше Ñекунд',\n ss : '%d Ñекунд',\n m : 'бір минут',\n mm : '%d минут',\n h : 'бір Ñағат',\n hh : '%d Ñағат',\n d : 'бір күн',\n dd : '%d күн',\n M : 'бір ай',\n MM : '%d ай',\n y : 'бір жыл',\n yy : '%d жыл'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(ші|шы)/,\n ordinal(_num: number): string {\n const a = _num % 10;\n const b = _num >= 100 ? 100 : null;\n\n return _num + (suffixes[_num] || suffixes[a] || suffixes[b]);\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 7th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Korean [ko]\n//! author : Kyungwook, Park : https://github.com/kyungw00k\n//! author : Jeeeyul Lee <jeeeyul@gmail.com>\n\nexport const koLocale: LocaleData = {\n abbr: 'ko',\n months : '1ì›”_2ì›”_3ì›”_4ì›”_5ì›”_6ì›”_7ì›”_8ì›”_9ì›”_10ì›”_11ì›”_12ì›”'.split('_'),\n monthsShort : '1ì›”_2ì›”_3ì›”_4ì›”_5ì›”_6ì›”_7ì›”_8ì›”_9ì›”_10ì›”_11ì›”_12ì›”'.split('_'),\n weekdays : 'ì¼ìš”ì¼_월요ì¼_화요ì¼_수요ì¼_목요ì¼_금요ì¼_í† ìš”ì¼'.split('_'),\n weekdaysShort : 'ì¼_ì›”_í™”_수_목_금_í† '.split('_'),\n weekdaysMin : 'ì¼_ì›”_í™”_수_목_금_í† '.split('_'),\n longDateFormat : {\n LT : 'A h:mm',\n LTS : 'A h:mm:ss',\n L : 'YYYY.MM.DD',\n LL : 'YYYYë…„ MMMM Dì¼',\n LLL : 'YYYYë…„ MMMM Dì¼ A h:mm',\n LLLL : 'YYYYë…„ MMMM Dì¼ dddd A h:mm',\n l : 'YYYY.MM.DD',\n ll : 'YYYYë…„ MMMM Dì¼',\n lll : 'YYYYë…„ MMMM Dì¼ A h:mm',\n llll : 'YYYYë…„ MMMM Dì¼ dddd A h:mm'\n },\n calendar : {\n sameDay : '오늘 LT',\n nextDay : 'ë‚´ì¼ LT',\n nextWeek : 'dddd LT',\n lastDay : 'ì–´ì œ LT',\n lastWeek : '지난주 dddd LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s 후',\n past : '%s ì „',\n s : '몇 ì´ˆ',\n ss : '%dì´ˆ',\n m : '1분',\n mm : '%d분',\n h : 'í•œ 시간',\n hh : '%d시간',\n d : '하루',\n dd : '%dì¼',\n M : 'í•œ 달',\n MM : '%d달',\n y : 'ì¼ ë…„',\n yy : '%dë…„'\n },\n dayOfMonthOrdinalParse : /\\d{1,2}(ì¼|ì›”|주)/,\n ordinal : function (num: number, period: string): string {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return num + 'ì¼';\n case 'M':\n return num + 'ì›”';\n case 'w':\n case 'W':\n return num + '주';\n default:\n return num.toString(10);\n }\n },\n meridiemParse : /ì˜¤ì „|오후/,\n isPM : function (token) {\n return token === '오후';\n },\n meridiem : function (hour, minute, isUpper) {\n return hour < 12 ? 'ì˜¤ì „' : '오후';\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Lithuanian [lt]\n//! author : Stanislavas Guk : https://github.com/ixoster\n\nconst units = {\n ss : 'sekundÄ—_sekundžių_sekundes',\n m : 'minutÄ—_minutÄ—s_minutÄ™',\n mm: 'minutÄ—s_minuÄių_minutes',\n h : 'valanda_valandos_valandÄ…',\n hh: 'valandos_valandų_valandas',\n d : 'diena_dienos_dienÄ…',\n dd: 'dienos_dienų_dienas',\n M : 'mÄ—nuo_mÄ—nesio_mÄ—nesį',\n MM: 'mÄ—nesiai_mÄ—nesių_mÄ—nesius',\n y : 'metai_metų_metus',\n yy: 'metai_metų_metus'\n};\nfunction translateSeconds(num: number, withoutSuffix: boolean, key: string, isFuture: boolean) {\n if (withoutSuffix) {\n return 'kelios sekundÄ—s';\n } else {\n return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n }\n}\nfunction translateSingular(num: number, withoutSuffix: boolean, key: string, isFuture: boolean) {\n return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);\n}\nfunction special(num: number) {\n return num % 10 === 0 || (num > 10 && num < 20);\n}\nfunction forms(key: string) {\n return (units as any)[key].split('_');\n}\nfunction translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean) {\n let result = num + ' ';\n if (num === 1) {\n return result + translateSingular(num, withoutSuffix, key[0], isFuture);\n } else if (withoutSuffix) {\n return result + (special(num) ? forms(key)[1] : forms(key)[0]);\n } else {\n if (isFuture) {\n return result + forms(key)[1];\n } else {\n return result + (special(num) ? forms(key)[1] : forms(key)[2]);\n }\n }\n}\n\nexport const ltLocale: LocaleData = {\n abbr: 'lt',\n months : {\n format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjÅ«Äio_rugsÄ—jo_spalio_lapkriÄio_gruodžio'.split('_'),\n standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjÅ«tis_rugsÄ—jis_spalis_lapkritis_gruodis'.split('_'),\n isFormat: /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?|MMMM?(\\[[^\\[\\]]*\\]|\\s)+D[oD]?/\n },\n monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n weekdays : {\n format: 'sekmadienį_pirmadienį_antradienį_treÄiadienį_ketvirtadienį_penktadienį_Å¡eÅ¡tadienį'.split('_'),\n standalone: 'sekmadienis_pirmadienis_antradienis_treÄiadienis_ketvirtadienis_penktadienis_Å¡eÅ¡tadienis'.split('_'),\n isFormat: /dddd HH:mm/\n },\n weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Å eÅ¡'.split('_'),\n weekdaysMin : 'S_P_A_T_K_Pn_Å '.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY-MM-DD',\n LL : 'YYYY [m.] MMMM D [d.]',\n LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',\n l : 'YYYY-MM-DD',\n ll : 'YYYY [m.] MMMM D [d.]',\n lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'\n },\n calendar : {\n sameDay : '[Å iandien] LT',\n nextDay : '[Rytoj] LT',\n nextWeek : 'dddd LT',\n lastDay : '[Vakar] LT',\n lastWeek : '[PraÄ—jusį] dddd LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'po %s',\n past : 'prieÅ¡ %s',\n s : translateSeconds,\n ss : translate,\n m : translateSingular,\n mm : translate,\n h : translateSingular,\n hh : translate,\n d : translateSingular,\n dd : translate,\n M : translateSingular,\n MM : translate,\n y : translateSingular,\n yy : translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-oji/,\n ordinal(num) {\n return num + '-oji';\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Latvian [lv]\n//! author : Matiss Janis Aboltins : https://github.com/matissjanis\n\nexport const lvLocale: LocaleData = {\n abbr: 'lv',\n months : 'JanvÄris_FebruÄris_Marts_AprÄ«lis_Maijs_JÅ«nijs_JÅ«lijs_Augusts_Septembris_Oktobris_Novembris_Decembris'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_Mai_JÅ«n_JÅ«l_Aug_Sep_Okt_Nov_Dec'.split('_'),\n weekdays : 'SvÄ“tdiena_Pirmdiena_Otrdiena_TreÅ¡diena_Ceturtdiena_Piektdiena_Sestdiena'.split('_'),\n weekdaysShort : 'SvÄ“td_Pirmd_Otrd_TreÅ¡d_Ceturtd_Piektd_Sestd'.split('_'),\n weekdaysMin : 'Sv_Pi_Ot_Tr_Ce_Pk_Se'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'pÄ“c %s',\n past : 'pirms %s',\n s : 'dažÄm sekundÄ“m',\n ss : '%d sekundÄ“m',\n m : 'minÅ«tes',\n mm : '%d minÅ«tÄ“m',\n h : 'stundas',\n hh : '%d stundÄm',\n d : 'dienas',\n dd : '%d dienÄm',\n M : 'mÄ“neÅ¡a',\n MM : '%d mÄ“neÅ¡iem',\n y : 'gada',\n yy : '%d gadiem'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal(num) {\n return num + '.';\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Mongolian [mn]\n//! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7\n\nfunction translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean) {\n switch (key) {\n case 's':\n return withoutSuffix ? 'Ñ…ÑдхÑн Ñекунд' : 'Ñ…ÑдхÑн Ñекундын';\n case 'ss':\n return num + (withoutSuffix ? ' Ñекунд' : ' Ñекундын');\n case 'm':\n case 'mm':\n return num + (withoutSuffix ? ' минут' : ' минутын');\n case 'h':\n case 'hh':\n return num + (withoutSuffix ? ' цаг' : ' цагийн');\n case 'd':\n case 'dd':\n return num + (withoutSuffix ? ' өдөр' : ' өдрийн');\n case 'M':\n case 'MM':\n return num + (withoutSuffix ? ' Ñар' : ' Ñарын');\n case 'y':\n case 'yy':\n return num + (withoutSuffix ? ' жил' : ' жилийн');\n default:\n return num.toString(10);\n }\n}\n\nexport const mnLocale: LocaleData = {\n abbr: 'mn',\n months: 'ÐÑгдүгÑÑÑ€ Ñар_Хоёрдугаар Ñар_Гуравдугаар Ñар_ДөрөвдүгÑÑÑ€ Ñар_Тавдугаар Ñар_Зургадугаар Ñар_Долдугаар Ñар_Ðаймдугаар Ñар_ЕÑдүгÑÑÑ€ Ñар_Ðравдугаар Ñар_Ðрван нÑгдүгÑÑÑ€ Ñар_Ðрван хоёрдугаар Ñар'.split('_'),\n monthsShort: '1 Ñар_2 Ñар_3 Ñар_4 Ñар_5 Ñар_6 Ñар_7 Ñар_8 Ñар_9 Ñар_10 Ñар_11 Ñар_12 Ñар'.split('_'),\n monthsParseExact: true,\n weekdays: 'ÐÑм_Даваа_ÐœÑгмар_Лхагва_ПүрÑв_БааÑан_БÑмба'.split('_'),\n weekdaysShort: 'ÐÑм_Дав_ÐœÑг_Лха_Пүр_Баа_БÑм'.split('_'),\n weekdaysMin: 'ÐÑ_Да_ÐœÑ_Лх_Пү_Ба_БÑ'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY-MM-DD',\n LL: 'YYYY оны MMMMын D',\n LLL: 'YYYY оны MMMMын D HH:mm',\n LLLL: 'dddd, YYYY оны MMMMын D HH:mm'\n },\n meridiemParse: /Ò®Ó¨|ҮХ/i,\n isPM: function (input) {\n return input === 'ҮХ';\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return 'Ò®Ó¨';\n } else {\n return 'ҮХ';\n }\n },\n calendar: {\n sameDay: '[Өнөөдөр] LT',\n nextDay: '[Маргааш] LT',\n nextWeek: '[ИрÑÑ…] dddd LT',\n lastDay: '[Өчигдөр] LT',\n lastWeek: '[ӨнгөрÑөн] dddd LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: '%s дараа',\n past: '%s өмнө',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2} өдөр/,\n ordinal: function (num: number, period: string): string {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return num + ' өдөр';\n default:\n return num.toString(10);\n }\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Norwegian BokmÃ¥l [nb]\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//! Sigurd Gartmann : https://github.com/sigurdga\n\nexport const nbLocale: LocaleData = {\n abbr: 'nb',\n months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n monthsShort: 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),\n monthsParseExact: true,\n weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),\n weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY [kl.] HH:mm',\n LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'\n },\n calendar: {\n sameDay: '[i dag kl.] LT',\n nextDay: '[i morgen kl.] LT',\n nextWeek: 'dddd [kl.] LT',\n lastDay: '[i gÃ¥r kl.] LT',\n lastWeek: '[forrige] dddd [kl.] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'om %s',\n past: '%s siden',\n s: 'noen sekunder',\n ss: '%d sekunder',\n m: 'ett minutt',\n mm: '%d minutter',\n h: 'en time',\n hh: '%d timer',\n d: 'en dag',\n dd: '%d dager',\n M: 'en mÃ¥ned',\n MM: '%d mÃ¥neder',\n y: 'ett Ã¥r',\n yy: '%d Ã¥r'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Dutch (Belgium) [nl-be]\n//! author : Joris Röling : https://github.com/jorisroling\n//! author : Jacob Middag : https://github.com/middagj\n\nlet monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');\nlet monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\nlet monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];\nlet monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\nexport const nlBeLocale: LocaleData = {\n abbr: 'nl-be',\n months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n monthsShort(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortWithDots;\n } else if (/-MMM-/.test(format)) {\n return monthsShortWithoutDots[getMonth(date, isUTC)];\n } else {\n return monthsShortWithDots[getMonth(date, isUTC)];\n }\n },\n\n monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,\n monthsShortStrictRegex: /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n\n weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),\n weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[vandaag om] LT',\n nextDay: '[morgen om] LT',\n nextWeek: 'dddd [om] LT',\n lastDay: '[gisteren om] LT',\n lastWeek: '[afgelopen] dddd [om] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'over %s',\n past: '%s geleden',\n s: 'een paar seconden',\n ss: '%d seconden',\n m: 'één minuut',\n mm: '%d minuten',\n h: 'één uur',\n hh: '%d uur',\n d: 'één dag',\n dd: '%d dagen',\n M: 'één maand',\n MM: '%d maanden',\n y: 'één jaar',\n yy: '%d jaar'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n ordinal(_num: number): string {\n const num = Number(_num);\n return num + ((num === 1 || num === 8 || num >= 20) ? 'ste' : 'de');\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getMonth } from '../utils/date-getters';\n\n//! moment.js locale configuration\n//! locale : Dutch [nl]\n//! author : Joris Röling : https://github.com/jorisroling\n//! author : Jacob Middag : https://github.com/middagj\n\nlet monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\nlet monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];\nlet monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\\.?|feb\\.?|mrt\\.?|apr\\.?|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i;\n\nexport const nlLocale: LocaleData = {\n abbr: 'nl',\n months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n monthsShort (date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsShortWithDots;\n } else if (/-MMM-/.test(format)) {\n return monthsShortWithoutDots[getMonth(date, isUTC)];\n } else {\n return monthsShortWithDots[getMonth(date, isUTC)];\n }\n },\n\n monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,\n monthsShortStrictRegex: /^(jan\\.?|feb\\.?|mrt\\.?|apr\\.?|mei|ju[nl]\\.?|aug\\.?|sep\\.?|okt\\.?|nov\\.?|dec\\.?)/i,\n\n monthsParse,\n longMonthsParse : monthsParse,\n shortMonthsParse : monthsParse,\n\n weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD-MM-YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[vandaag om] LT',\n nextDay: '[morgen om] LT',\n nextWeek: 'dddd [om] LT',\n lastDay: '[gisteren om] LT',\n lastWeek: '[afgelopen] dddd [om] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'over %s',\n past : '%s geleden',\n s : 'een paar seconden',\n ss : '%d seconden',\n m : 'één minuut',\n mm : '%d minuten',\n h : 'één uur',\n hh : '%d uur',\n d : 'één dag',\n dd : '%d dagen',\n M : 'één maand',\n MM : '%d maanden',\n y : 'één jaar',\n yy : '%d jaar'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(ste|de)/,\n ordinal (_num: number): string {\n const num = Number(_num);\n return num + ((num === 1 || num === 8 || num >= 20) ? 'ste' : 'de');\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getMonth } from '../utils/date-getters';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Polish [pl]\n//! author : Rafal Hirsz : https://github.com/evoL\n\nlet monthsNominative = 'styczeÅ„_luty_marzec_kwiecieÅ„_maj_czerwiec_lipiec_sierpieÅ„_wrzesieÅ„_październik_listopad_grudzieÅ„'.split('_');\nlet monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_wrzeÅ›nia_października_listopada_grudnia'.split('_');\n\nfunction plural(num: number): boolean {\n return (num % 10 < 5) && (num % 10 > 1) && ((~~(num / 10) % 10) !== 1);\n}\n\nfunction translate(num: number, withoutSuffix: boolean, key: string): string {\n let result = num + ' ';\n switch (key) {\n case 'ss':\n return result + (plural(num) ? 'sekundy' : 'sekund');\n case 'm':\n return withoutSuffix ? 'minuta' : 'minutÄ™';\n case 'mm':\n return result + (plural(num) ? 'minuty' : 'minut');\n case 'h':\n return withoutSuffix ? 'godzina' : 'godzinÄ™';\n case 'hh':\n return result + (plural(num) ? 'godziny' : 'godzin');\n case 'MM':\n return result + (plural(num) ? 'miesiÄ…ce' : 'miesiÄ™cy');\n case 'yy':\n return result + (plural(num) ? 'lata' : 'lat');\n }\n}\n\nexport const plLocale: LocaleData = {\n abbr: 'pl',\n months(date: Date, format: string, isUTC?: boolean): string | string[] {\n if (!date) {\n return monthsNominative;\n } else if (format === '') {\n // Hack: if format empty we know this is used to generate\n // RegExp by moment. Give then back both valid forms of months\n // in RegExp ready format.\n return '(' + monthsSubjective[getMonth(date, isUTC)] + '|' + monthsNominative[getMonth(date, isUTC)] + ')';\n } else if (/D MMMM/.test(format)) {\n return monthsSubjective[getMonth(date, isUTC)];\n } else {\n return monthsNominative[getMonth(date, isUTC)];\n }\n },\n monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n weekdays: 'niedziela_poniedziaÅ‚ek_wtorek_Å›roda_czwartek_piÄ…tek_sobota'.split('_'),\n weekdaysShort: 'ndz_pon_wt_Å›r_czw_pt_sob'.split('_'),\n weekdaysMin: 'Nd_Pn_Wt_Åšr_Cz_Pt_So'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[DziÅ› o] LT',\n nextDay: '[Jutro o] LT',\n nextWeek(date: Date): string {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[W niedzielÄ™ o] LT';\n\n case 2:\n return '[We wtorek o] LT';\n\n case 3:\n return '[W Å›rodÄ™ o] LT';\n\n case 5:\n return '[W piÄ…tek o] LT';\n\n case 6:\n return '[W sobotÄ™ o] LT';\n\n default:\n return '[W] dddd [o] LT';\n }\n },\n lastDay: '[Wczoraj o] LT',\n lastWeek(date: Date): string {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[W zeszÅ‚Ä… niedzielÄ™ o] LT';\n case 3:\n return '[W zeszÅ‚Ä… Å›rodÄ™ o] LT';\n case 4:\n return '[W zeszÅ‚Ä… czwartek o] LT';\n case 5:\n return '[W zeszÅ‚Ä… piÄ…tek o] LT';\n case 6:\n return '[W zeszÅ‚Ä… sobotÄ™ o] LT';\n default:\n return '[W zeszÅ‚y] dddd [o] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'za %s',\n past: '%s temu',\n s: 'kilka sekund',\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: '1 dzieÅ„',\n dd: '%d dni',\n M: 'miesiÄ…c',\n MM: translate,\n y: 'rok',\n yy: translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Portuguese (Brazil) [pt-br]\n//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\nexport const ptBrLocale: LocaleData = {\n abbr: 'pt-br',\n months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),\n monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),\n weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),\n weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),\n weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY [à s] HH:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY [à s] HH:mm'\n },\n calendar: {\n sameDay: '[Hoje à s] LT',\n nextDay: '[Amanhã à s] LT',\n nextWeek: 'dddd [à s] LT',\n lastDay: '[Ontem à s] LT',\n lastWeek(date: Date) {\n return (getDayOfWeek(date) === 0 || getDayOfWeek(date) === 6) ?\n '[Último] dddd [à s] LT' : // Saturday + Sunday\n '[Última] dddd [à s] LT'; // Monday - Friday\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'em %s',\n past: '%s atrás',\n s: 'poucos segundos',\n ss: '%d segundos',\n m: 'um minuto',\n mm: '%d minutos',\n h: 'uma hora',\n hh: '%d horas',\n d: 'um dia',\n dd: '%d dias',\n M: 'um mês',\n MM: '%d meses',\n y: 'um ano',\n yy: '%d anos'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº'\n};\n","import { LocaleData } from '../locale/locale.class';\n\n// ! moment.js locale configuration\n// ! locale : Romanian [ro]\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n// ! author : Earle white: https://github.com/5earle\n\nfunction relativeTimeWithPlural(num: number, withoutSuffix: boolean, key: string): string {\n let format: {[key:string]: string} = {\n ss: 'secunde',\n mm: 'minute',\n hh: 'ore',\n dd: 'zile',\n MM: 'luni',\n yy: 'ani'\n };\n\n let separator = ' ';\n if (num % 100 >= 20 || (num >= 100 && num % 100 === 0)) {\n separator = ' de ';\n }\n return num + separator + format[key];\n}\n\n\nexport const roLocale: LocaleData = {\n abbr: 'ro',\n months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),\n monthsShort: 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),\n monthsParseExact: true,\n weekdays: 'duminică_luni_marÈ›i_miercuri_joi_vineri_sâmbătă'.split('_'),\n weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY H:mm',\n LLLL: 'dddd, D MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[azi la] LT',\n nextDay: '[mâine la] LT',\n nextWeek: 'dddd [la] LT',\n lastDay: '[ieri la] LT',\n lastWeek: '[fosta] dddd [la] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'peste %s',\n past: '%s în urmă',\n s: 'câteva secunde',\n ss: relativeTimeWithPlural,\n m: 'un minut',\n mm: relativeTimeWithPlural,\n h: 'o oră',\n hh: relativeTimeWithPlural,\n d: 'o zi',\n dd: relativeTimeWithPlural,\n M: 'o lună',\n MM: relativeTimeWithPlural,\n y: 'un an',\n yy: relativeTimeWithPlural\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getWeek } from '../units/week';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\n\nfunction plural(word: string, num: number): string {\n let forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n}\n\nfunction relativeTimeWithPlural(num: number, withoutSuffix: boolean, key: string): string {\n let format: {[key: string]: string} = {\n ss: withoutSuffix ? 'Ñекунда_Ñекунды_Ñекунд' : 'Ñекунду_Ñекунды_Ñекунд',\n mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n hh: 'чаÑ_чаÑа_чаÑов',\n dd: 'день_днÑ_дней',\n MM: 'меÑÑц_меÑÑца_меÑÑцев',\n yy: 'год_года_лет'\n };\n if (key === 'm') {\n return withoutSuffix ? 'минута' : 'минуту';\n }\n return num + ' ' + plural(format[key], +num);\n}\n\nlet monthsParse = [/^Ñнв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йÑ]/i, /^июн/i, /^июл/i, /^авг/i, /^Ñен/i, /^окт/i, /^ноÑ/i, /^дек/i];\n\n// http://new.gramota.ru/spravka/rules/139-prop : § 103\n// Ð¡Ð¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ð¼ÐµÑÑцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637\n// CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753\nexport const ruLocale: LocaleData = {\n abbr: 'ru',\n months: {\n format: 'ÑнварÑ_февралÑ_марта_апрелÑ_маÑ_июнÑ_июлÑ_авгуÑта_ÑентÑбрÑ_октÑбрÑ_ноÑбрÑ_декабрÑ'.split('_'),\n standalone: 'Ñнварь_февраль_март_апрель_май_июнь_июль_авгуÑÑ‚_ÑентÑбрь_октÑбрь_ноÑбрь_декабрь'.split('_')\n },\n monthsShort: {\n // по CLDR именно \"июл.\" и \"июн.\", но какой ÑмыÑл менÑÑ‚ÑŒ букву на точку ?\n format: 'Ñнв._февр._мар._апр._маÑ_июнÑ_июлÑ_авг._Ñент._окт._ноÑб._дек.'.split('_'),\n standalone: 'Ñнв._февр._март_апр._май_июнь_июль_авг._Ñент._окт._ноÑб._дек.'.split('_')\n },\n weekdays: {\n standalone: 'воÑкреÑенье_понедельник_вторник_Ñреда_четверг_пÑтница_Ñуббота'.split('_'),\n format: 'воÑкреÑенье_понедельник_вторник_Ñреду_четверг_пÑтницу_Ñубботу'.split('_'),\n isFormat: /\\[ ?[Вв] ?(?:прошлую|Ñледующую|Ñту)? ?\\] ?dddd/\n },\n weekdaysShort: 'вÑ_пн_вт_ÑÑ€_чт_пт_Ñб'.split('_'),\n weekdaysMin: 'вÑ_пн_вт_ÑÑ€_чт_пт_Ñб'.split('_'),\n monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n\n // полные Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ñ Ð¿Ð°Ð´ÐµÐ¶Ð°Ð¼Ð¸, по три буквы, Ð´Ð»Ñ Ð½ÐµÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ…, по 4 буквы, ÑÐ¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ñ Ñ‚Ð¾Ñ‡ÐºÐ¾Ð¹ и без точки\n monthsRegex: /^(Ñнвар[ÑŒÑ]|Ñнв\\.?|феврал[ÑŒÑ]|февр?\\.?|марта?|мар\\.?|апрел[ÑŒÑ]|апр\\.?|ма[йÑ]|июн[ÑŒÑ]|июн\\.?|июл[ÑŒÑ]|июл\\.?|авгуÑта?|авг\\.?|ÑентÑбр[ÑŒÑ]|Ñент?\\.?|октÑбр[ÑŒÑ]|окт\\.?|ноÑбр[ÑŒÑ]|ноÑб?\\.?|декабр[ÑŒÑ]|дек\\.?)/i,\n\n // ÐºÐ¾Ð¿Ð¸Ñ Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰ÐµÐ³Ð¾\n monthsShortRegex: /^(Ñнвар[ÑŒÑ]|Ñнв\\.?|феврал[ÑŒÑ]|февр?\\.?|марта?|мар\\.?|апрел[ÑŒÑ]|апр\\.?|ма[йÑ]|июн[ÑŒÑ]|июн\\.?|июл[ÑŒÑ]|июл\\.?|авгуÑта?|авг\\.?|ÑентÑбр[ÑŒÑ]|Ñент?\\.?|октÑбр[ÑŒÑ]|окт\\.?|ноÑбр[ÑŒÑ]|ноÑб?\\.?|декабр[ÑŒÑ]|дек\\.?)/i,\n\n // полные Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ñ Ð¿Ð°Ð´ÐµÐ¶Ð°Ð¼Ð¸\n monthsStrictRegex: /^(Ñнвар[ÑÑŒ]|феврал[ÑÑŒ]|марта?|апрел[ÑÑŒ]|ма[Ñй]|июн[ÑÑŒ]|июл[ÑÑŒ]|авгуÑта?|ÑентÑбр[ÑÑŒ]|октÑбр[ÑÑŒ]|ноÑбр[ÑÑŒ]|декабр[ÑÑŒ])/i,\n\n // Выражение, которое ÑоотвеÑтвует только Ñокращённым формам\n monthsShortStrictRegex: /^(Ñнв\\.|февр?\\.|мар[Ñ‚.]|апр\\.|ма[Ñй]|июн[ÑŒÑ.]|июл[ÑŒÑ.]|авг\\.|Ñент?\\.|окт\\.|ноÑб?\\.|дек\\.)/i,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY г.',\n LLL: 'D MMMM YYYY г., H:mm',\n LLLL: 'dddd, D MMMM YYYY г., H:mm'\n },\n calendar: {\n sameDay: '[Ð¡ÐµÐ³Ð¾Ð´Ð½Ñ Ð²] LT',\n nextDay: '[Завтра в] LT',\n lastDay: '[Вчера в] LT',\n nextWeek(date: Date, now: Date) {\n if (getWeek(now) !== getWeek(date)) {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[Ð’ Ñледующее] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n return '[Ð’ Ñледующий] dddd [в] LT';\n case 3:\n case 5:\n case 6:\n return '[Ð’ Ñледующую] dddd [в] LT';\n }\n } else {\n if (getDayOfWeek(date) === 2) {\n return '[Во] dddd [в] LT';\n } else {\n return '[Ð’] dddd [в] LT';\n }\n }\n },\n lastWeek(date: Date, now: Date) {\n if (getWeek(now) !== getWeek(date)) {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[Ð’ прошлое] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n return '[Ð’ прошлый] dddd [в] LT';\n case 3:\n case 5:\n case 6:\n return '[Ð’ прошлую] dddd [в] LT';\n }\n } else {\n if (getDayOfWeek(date) === 2) {\n return '[Во] dddd [в] LT';\n } else {\n return '[Ð’] dddd [в] LT';\n }\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'через %s',\n past: '%s назад',\n s: 'неÑколько Ñекунд',\n ss: relativeTimeWithPlural,\n m: relativeTimeWithPlural,\n mm: relativeTimeWithPlural,\n h: 'чаÑ',\n hh: relativeTimeWithPlural,\n d: 'день',\n dd: relativeTimeWithPlural,\n M: 'меÑÑц',\n MM: relativeTimeWithPlural,\n y: 'год',\n yy: relativeTimeWithPlural\n },\n meridiemParse: /ночи|утра|днÑ|вечера/i,\n isPM(input) {\n return /^(днÑ|вечера)$/.test(input);\n },\n meridiem(hour, minute, isLower) {\n if (hour < 4) {\n return 'ночи';\n } else if (hour < 12) {\n return 'утра';\n } else if (hour < 17) {\n return 'днÑ';\n } else {\n return 'вечера';\n }\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(й|го|Ñ)/,\n ordinal(_num: number, period: string): string {\n const num = Number(_num);\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n return num + '-й';\n case 'D':\n return num + '-го';\n case 'w':\n case 'W':\n return num + '-Ñ';\n default:\n return num.toString(10);\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Slovak [sk]\n//! author : Jozef Pažin : https://github.com/atiris\n\nconst months = 'január_február_marec_aprÃl_máj_jún_júl_august_september_október_november_december'.split('_');\nconst monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n\nfunction plural(num: number): boolean {\n return (num > 1) && (num < 5) && (~~(num / 10) !== 1);\n}\n\nfunction translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {\n const result = num + ' ';\n\n switch (key) {\n case 's':// a few seconds / in a few seconds / a few seconds ago\n return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';\n case 'ss':// 9 seconds / in 9 seconds / 9 seconds ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'sekundy' : 'sekúnd');\n }\n else {\n return result + 'sekundami';\n }\n // break;\n case 'm':// a minute / in a minute / a minute ago\n return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');\n case 'mm':// 9 minutes / in 9 minutes / 9 minutes ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'minúty' : 'minút');\n }\n else {\n return result + 'minútami';\n }\n // break;\n case 'h':// an hour / in an hour / an hour ago\n return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n case 'hh':// 9 hours / in 9 hours / 9 hours ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'hodiny' : 'hodÃn');\n }\n else {\n return result + 'hodinami';\n }\n // break;\n case 'd':// a day / in a day / a day ago\n return (withoutSuffix || isFuture) ? 'deň' : 'dňom';\n case 'dd':// 9 days / in 9 days / 9 days ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'dni' : 'dnÃ');\n }\n else {\n return result + 'dňami';\n }\n // break;\n case 'M':// a month / in a month / a month ago\n return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';\n case 'MM':// 9 months / in 9 months / 9 months ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'mesiace' : 'mesiacov');\n }\n else {\n return result + 'mesiacmi';\n }\n // break;\n case 'y':// a year / in a year / a year ago\n return (withoutSuffix || isFuture) ? 'rok' : 'rokom';\n case 'yy':// 9 years / in 9 years / 9 years ago\n if (withoutSuffix || isFuture) {\n return result + (plural(num) ? 'roky' : 'rokov');\n }\n else {\n return result + 'rokmi';\n }\n // break;\n }\n}\n\nexport const skLocale: LocaleData = {\n abbr: 'sk',\n months,\n monthsShort,\n weekdays: 'nedeľa_pondelok_utorok_streda_Å¡tvrtok_piatok_sobota'.split('_'),\n weekdaysShort: 'ne_po_ut_st_Å¡t_pi_so'.split('_'),\n weekdaysMin: 'ne_po_ut_st_Å¡t_pi_so'.split('_'),\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd D. MMMM YYYY H:mm',\n l: 'D. M. YYYY'\n },\n calendar: {\n sameDay: '[dnes o] LT',\n nextDay: '[zajtra o] LT',\n nextWeek(date: Date): string {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[v nedeľu o] LT';\n case 1:\n case 2:\n return '[v] dddd [o] LT';\n case 3:\n return '[v stredu o] LT';\n case 4:\n return '[vo Å¡tvrtok o] LT';\n case 5:\n return '[v piatok o] LT';\n case 6:\n return '[v sobotu o] LT';\n }\n },\n lastDay: '[vÄera o] LT',\n lastWeek(date: Date): string {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[minulú nedeľu o] LT';\n case 1:\n case 2:\n return '[minulý] dddd [o] LT';\n case 3:\n return '[minulú stredu o] LT';\n case 4:\n case 5:\n return '[minulý] dddd [o] LT';\n case 6:\n return '[minulú sobotu o] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'o %s',\n past: 'pred %s',\n s: translate,\n ss: translate,\n m: translate,\n mm: translate,\n h: translate,\n hh: translate,\n d: translate,\n dd: translate,\n M: translate,\n MM: translate,\n y: translate,\n yy: translate\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Slovenian [sl]\n//! author : mihan : https://github.com/mihan\n\nfunction processRelativeTime(number: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n case 'ss':\n if (number === 1) {\n result += withoutSuffix ? 'sekundo' : 'sekundi';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';\n } else {\n result += withoutSuffix || isFuture ? 'sekund' : 'sekund';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n}\n\nexport const slLocale: LocaleData = {\n abbr: 'sl',\n months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),\n monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),\n monthsParseExact: true,\n weekdays: 'nedelja_ponedeljek_torek_sreda_Äetrtek_petek_sobota'.split('_'),\n weekdaysShort: 'ned._pon._tor._sre._Äet._pet._sob.'.split('_'),\n weekdaysMin: 'ne_po_to_sr_Äe_pe_so'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd, D. MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[danes ob] LT',\n nextDay: '[jutri ob] LT',\n\n nextWeek(date: Date) {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[v] [nedeljo] [ob] LT';\n case 3:\n return '[v] [sredo] [ob] LT';\n case 6:\n return '[v] [soboto] [ob] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[v] dddd [ob] LT';\n }\n },\n lastDay: '[vÄeraj ob] LT',\n lastWeek(date: Date) {\n switch (getDayOfWeek(date)) {\n case 0:\n return '[prejÅ¡njo] [nedeljo] [ob] LT';\n case 3:\n return '[prejÅ¡njo] [sredo] [ob] LT';\n case 6:\n return '[prejÅ¡njo] [soboto] [ob] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[prejÅ¡nji] dddd [ob] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'Äez %s',\n past: 'pred %s',\n s: processRelativeTime,\n ss: processRelativeTime,\n m: processRelativeTime,\n mm: processRelativeTime,\n h: processRelativeTime,\n hh: processRelativeTime,\n d: processRelativeTime,\n dd: processRelativeTime,\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Albanian [sq]\n//! author : Agon Cecelia : https://github.com/agoncecelia\n\nexport const sqLocale: LocaleData = {\n abbr: 'sq',\n months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),\n monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n weekdays : 'E Dielë_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),\n weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n weekdaysMin : 'Di_He_Ma_Me_En_Pr_Sh'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Sot në] LT',\n nextDay : '[Nesër në] LT',\n nextWeek : 'dddd [në] LT',\n lastDay : '[Dje në] LT',\n lastWeek : 'dddd [e kaluar në] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'në %s',\n past : 'para %sve',\n s : 'disa sekonda',\n ss : '%d sekonda',\n m : 'një minut',\n mm : '%d minuta',\n h : 'një orë',\n hh : '%d orë',\n d : 'një ditë',\n dd : '%d ditë',\n M : 'një muaj',\n MM : '%d muaj',\n y : 'një vit',\n yy : '%d vite'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./, // need clarification\n ordinal : '%d.', // need clarification\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Swedish [sv]\n//! author : Jens Alm : https://github.com/ulmus\n\nexport const svLocale: LocaleData = {\n abbr: 'sv',\n months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),\n monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n weekdays: 'söndag_mÃ¥ndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n weekdaysShort: 'sön_mÃ¥n_tis_ons_tor_fre_lör'.split('_'),\n weekdaysMin: 'sö_mÃ¥_ti_on_to_fr_lö'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY-MM-DD',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY [kl.] HH:mm',\n LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',\n lll: 'D MMM YYYY HH:mm',\n llll: 'ddd D MMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[Idag] LT',\n nextDay: '[Imorgon] LT',\n lastDay: '[IgÃ¥r] LT',\n nextWeek: '[PÃ¥] dddd LT',\n lastWeek: '[I] dddd[s] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'om %s',\n past: 'för %s sedan',\n s: 'nÃ¥gra sekunder',\n ss: '%d sekunder',\n m: 'en minut',\n mm: '%d minuter',\n h: 'en timme',\n hh: '%d timmar',\n d: 'en dag',\n dd: '%d dagar',\n M: 'en mÃ¥nad',\n MM: '%d mÃ¥nader',\n y: 'ett Ã¥r',\n yy: '%d Ã¥r'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(e|a)/,\n ordinal(_num: number): string {\n const num = Number(_num);\n let b = num % 10,\n output = (~~(num % 100 / 10) === 1) ? 'e' :\n (b === 1) ? 'a' :\n (b === 2) ? 'a' :\n (b === 3) ? 'e' : 'e';\n return num + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","// moment.js locale configuration\n// locale : Thai [th]\n// author : Watcharapol Sanitwong : https://github.com/tumit\n\nimport { LocaleData } from '../locale/locale.class';\n\nexport const thLocale: LocaleData = {\n abbr: 'th',\n months: 'มà¸à¸£à¸²à¸„ม_à¸à¸¸à¸¡à¸ าพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_à¸à¸£à¸à¸Žà¸²à¸„ม_สิงหาคม_à¸à¸±à¸™à¸¢à¸²à¸¢à¸™_ตุลาคม_พฤศจิà¸à¸²à¸¢à¸™_ธันวาคม'.split('_'),\n monthsShort: 'ม.ค._à¸.พ._มี.ค._เม.ย._พ.ค._มิ.ย._à¸.ค._ส.ค._à¸.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),\n monthsParseExact: true,\n weekdays: 'à¸à¸²à¸—ิตย์_จันทร์_à¸à¸±à¸‡à¸„าร_พุธ_พฤหัสบดี_ศุà¸à¸£à¹Œ_เสาร์'.split('_'),\n weekdaysShort: 'à¸à¸²._จ._à¸._พ._พฤ._ศ._ส.'.split('_'), // yes, three characters difference\n weekdaysMin: 'à¸à¸²._จ._à¸._พ._พฤ._ศ._ส.'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY เวลา H:mm',\n LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'\n },\n meridiemParse: /à¸à¹ˆà¸à¸™à¹€à¸—ี่ยง|หลังเที่ยง/,\n isPM(input) {\n return input === 'หลังเที่ยง';\n },\n meridiem(hour, minute, isLower) {\n if (hour < 12) {\n return 'à¸à¹ˆà¸à¸™à¹€à¸—ี่ยง';\n } else {\n return 'หลังเที่ยง';\n }\n },\n calendar: {\n sameDay: '[วันนี้ เวลา] LT',\n nextDay: '[พรุ่งนี้ เวลา] LT',\n nextWeek: 'dddd[หน้า เวลา] LT',\n lastDay: '[เมื่à¸à¸§à¸²à¸™à¸™à¸µà¹‰ เวลา] LT',\n lastWeek: '[วัน]dddd[ที่à¹à¸¥à¹‰à¸§ เวลา] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'à¸à¸µà¸ %s',\n past: '%sที่à¹à¸¥à¹‰à¸§',\n s: 'ไม่à¸à¸µà¹ˆà¸§à¸´à¸™à¸²à¸—ี',\n ss: '%d วินาที',\n m: '1 นาที',\n mm: '%d นาที',\n h: '1 ชั่วโมง',\n hh: '%d ชั่วโมง',\n d: '1 วัน',\n dd: '%d วัน',\n M: '1 เดืà¸à¸™',\n MM: '%d เดืà¸à¸™',\n y: '1 ปี',\n yy: '%d ปี'\n }\n};\n","// moment.js locale configuration\n// locale : Thai-Buddhist Era [th-be]\n// author : Watcharapol Sanitwong : https://github.com/tumit\n\nimport { LocaleData } from '../locale/locale.class';\n\nexport const thBeLocale: LocaleData = {\n abbr: 'th-be',\n months: 'มà¸à¸£à¸²à¸„ม_à¸à¸¸à¸¡à¸ าพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_à¸à¸£à¸à¸Žà¸²à¸„ม_สิงหาคม_à¸à¸±à¸™à¸¢à¸²à¸¢à¸™_ตุลาคม_พฤศจิà¸à¸²à¸¢à¸™_ธันวาคม'.split('_'),\n monthsShort: 'ม.ค._à¸.พ._มี.ค._เม.ย._พ.ค._มิ.ย._à¸.ค._ส.ค._à¸.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),\n monthsParseExact: true,\n weekdays: 'à¸à¸²à¸—ิตย์_จันทร์_à¸à¸±à¸‡à¸„าร_พุธ_พฤหัสบดี_ศุà¸à¸£à¹Œ_เสาร์'.split('_'),\n weekdaysShort: 'à¸à¸²._จ._à¸._พ._พฤ._ศ._ส.'.split('_'),\n weekdaysMin: 'à¸à¸²._จ._à¸._พ._พฤ._ศ._ส.'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY เวลา H:mm',\n LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'\n },\n meridiemParse: /à¸à¹ˆà¸à¸™à¹€à¸—ี่ยง|หลังเที่ยง/,\n isPM(input) {\n return input === 'หลังเที่ยง';\n },\n meridiem(hour, minute, isLower) {\n if (hour < 12) {\n return 'à¸à¹ˆà¸à¸™à¹€à¸—ี่ยง';\n } else {\n return 'หลังเที่ยง';\n }\n },\n calendar: {\n sameDay: '[วันนี้ เวลา] LT',\n nextDay: '[พรุ่งนี้ เวลา] LT',\n nextWeek: 'dddd[หน้า เวลา] LT',\n lastDay: '[เมื่à¸à¸§à¸²à¸™à¸™à¸µà¹‰ เวลา] LT',\n lastWeek: '[วัน]dddd[ที่à¹à¸¥à¹‰à¸§ เวลา] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'à¸à¸µà¸ %s',\n past: '%sที่à¹à¸¥à¹‰à¸§',\n s: 'ไม่à¸à¸µà¹ˆà¸§à¸´à¸™à¸²à¸—ี',\n ss: '%d วินาที',\n m: '1 นาที',\n mm: '%d นาที',\n h: '1 ชั่วโมง',\n hh: '%d ชั่วโมง',\n d: '1 วัน',\n dd: '%d วัน',\n M: '1 เดืà¸à¸™',\n MM: '%d เดืà¸à¸™',\n y: '1 ปี',\n yy: '%d ปี'\n },\n\n preparse(str: string, format?: string): string {\n\n const _format = thBeLocale.longDateFormat[format]\n ? thBeLocale.longDateFormat[format]\n : format;\n\n // endsWith('YYYY')\n if (_format.indexOf('YYYY', _format.length - 'YYYY'.length) !== -1 ) {\n const ddMM = str.substr(0, str.length - 4);\n const yyyy = parseInt(str.substr(str.length - 4), 10) - 543;\n return ddMM + yyyy;\n }\n\n return str;\n },\n\n getFullYear(date: Date, isUTC = false): number {\n return 543 + (isUTC ? date.getUTCFullYear() : date.getFullYear());\n }\n};\n","import { LocaleData } from '../locale/locale.class';\nimport { getHours } from '../utils/date-getters';\nimport { getDayOfWeek } from '../units/day-of-week';\n\n//! moment.js locale configuration\n//! locale : Ukrainian [uk]\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\n\nfunction plural(word, num) {\n let forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n}\n\nfunction relativeTimeWithPlural(num: number, withoutSuffix, key): string {\n let format: { [key: string]: string } = {\n ss: withoutSuffix ? 'Ñекунда_Ñекунди_Ñекунд' : 'Ñекунду_Ñекунди_Ñекунд',\n mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',\n hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',\n dd: 'день_дні_днів',\n MM: 'міÑÑць_міÑÑці_міÑÑців',\n yy: 'рік_роки_років'\n };\n\n if (key === 'm') {\n return withoutSuffix ? 'хвилина' : 'хвилину';\n }\n\n if (key === 'h') {\n return withoutSuffix ? 'година' : 'годину';\n }\n return num + ' ' + plural(format[key], +num);\n}\n\nfunction weekdaysCaseReplace(date: Date, format: string, isUTC?: boolean): string | string[] {\n let weekdays = {\n nominative: 'неділÑ_понеділок_вівторок_Ñереда_четвер_п’ÑтницÑ_Ñубота'.split('_'),\n accusative: 'неділю_понеділок_вівторок_Ñереду_четвер_п’Ñтницю_Ñуботу'.split('_'),\n genitive: 'неділі_понеділка_вівторка_Ñереди_четверга_п’Ñтниці_Ñуботи'.split('_')\n };\n\n if (!date) {\n return weekdays.nominative;\n }\n\n let nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n 'accusative' :\n ((/\\[?(?:минулої|наÑтупної)? ?\\] ?dddd/).test(format) ?\n 'genitive' :\n 'nominative');\n return weekdays[nounCase][getDayOfWeek(date, isUTC)];\n}\n\nfunction processHoursFunction(str: string) {\n return function (date: Date): string {\n return str + 'о' + (getHours(date) === 11 ? 'б' : '') + '] LT';\n };\n}\n\nexport const ukLocale: LocaleData = {\n abbr: 'uk',\n months: {\n format: 'ÑічнÑ_лютого_березнÑ_квітнÑ_травнÑ_червнÑ_липнÑ_ÑерпнÑ_вереÑнÑ_жовтнÑ_лиÑтопада_груднÑ'.split('_'),\n standalone: 'Ñічень_лютий_березень_квітень_травень_червень_липень_Ñерпень_вереÑень_жовтень_лиÑтопад_грудень'.split('_')\n },\n monthsShort: 'Ñіч_лют_бер_квіт_трав_черв_лип_Ñерп_вер_жовт_лиÑÑ‚_груд'.split('_'),\n weekdays: weekdaysCaseReplace,\n weekdaysShort: 'нд_пн_вт_ÑÑ€_чт_пт_Ñб'.split('_'),\n weekdaysMin: 'нд_пн_вт_ÑÑ€_чт_пт_Ñб'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY Ñ€.',\n LLL: 'D MMMM YYYY Ñ€., HH:mm',\n LLLL: 'dddd, D MMMM YYYY Ñ€., HH:mm'\n },\n calendar: {\n sameDay: processHoursFunction('[Сьогодні '),\n nextDay: processHoursFunction('[Завтра '),\n lastDay: processHoursFunction('[Вчора '),\n nextWeek: processHoursFunction('[У] dddd ['),\n lastWeek(date: Date) {\n switch (getDayOfWeek(date)) {\n case 0:\n case 3:\n case 5:\n case 6:\n return processHoursFunction('[Минулої] dddd [')(date);\n case 1:\n case 2:\n case 4:\n return processHoursFunction('[Минулого] dddd [')(date);\n }\n },\n sameElse: 'L'\n },\n relativeTime: {\n future: 'за %s',\n past: '%s тому',\n s: 'декілька Ñекунд',\n ss: relativeTimeWithPlural,\n m: relativeTimeWithPlural,\n mm: relativeTimeWithPlural,\n h: 'годину',\n hh: relativeTimeWithPlural,\n d: 'день',\n dd: relativeTimeWithPlural,\n M: 'міÑÑць',\n MM: relativeTimeWithPlural,\n y: 'рік',\n yy: relativeTimeWithPlural\n },\n // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n meridiemParse: /ночі|ранку|днÑ|вечора/,\n isPM(input) {\n return /^(днÑ|вечора)$/.test(input);\n },\n meridiem(hour, minute, isLower) {\n if (hour < 4) {\n return 'ночі';\n } else if (hour < 12) {\n return 'ранку';\n } else if (hour < 17) {\n return 'днÑ';\n } else {\n return 'вечора';\n }\n },\n dayOfMonthOrdinalParse: /\\d{1,2}-(й|го)/,\n ordinal(_num: number, period: string): string {\n const num = Number(_num);\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n case 'w':\n case 'W':\n return num + '-й';\n case 'D':\n return num + '-го';\n default:\n return num.toString();\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Turkish [tr]\n//! authors : Erhan Gundogan : https://github.com/erhangundogan,\n//! Burak YiÄŸit Kaya: https://github.com/BYK\n\nlet suffixes: { [key: string]: string } = {\n 1: '\\'inci',\n 5: '\\'inci',\n 8: '\\'inci',\n 70: '\\'inci',\n 80: '\\'inci',\n 2: '\\'nci',\n 7: '\\'nci',\n 20: '\\'nci',\n 50: '\\'nci',\n 3: '\\'üncü',\n 4: '\\'üncü',\n 100: '\\'üncü',\n 6: '\\'ncı',\n 9: '\\'uncu',\n 10: '\\'uncu',\n 30: '\\'uncu',\n 60: '\\'ıncı',\n 90: '\\'ıncı'\n};\n\nexport const trLocale: LocaleData = {\n abbr: 'tr',\n months: 'Ocak_Åžubat_Mart_Nisan_Mayıs_Haziran_Temmuz_AÄŸustos_Eylül_Ekim_Kasım_Aralık'.split('_'),\n monthsShort: 'Oca_Åžub_Mar_Nis_May_Haz_Tem_AÄŸu_Eyl_Eki_Kas_Ara'.split('_'),\n weekdays: 'Pazar_Pazartesi_Salı_ÇarÅŸamba_PerÅŸembe_Cuma_Cumartesi'.split('_'),\n weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),\n weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[bugün saat] LT',\n nextDay: '[yarın saat] LT',\n nextWeek: '[gelecek] dddd [saat] LT',\n lastDay: '[dün] LT',\n lastWeek: '[geçen] dddd [saat] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: '%s sonra',\n past: '%s önce',\n s: 'birkaç saniye',\n ss: '%d saniye',\n m: 'bir dakika',\n mm: '%d dakika',\n h: 'bir saat',\n hh: '%d saat',\n d: 'bir gün',\n dd: '%d gün',\n M: 'bir ay',\n MM: '%d ay',\n y: 'bir yıl',\n yy: '%d yıl'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,\n ordinal(_num: number): string {\n const num = Number(_num);\n if (num === 0) { // special case for zero\n return num + '\\'ıncı';\n }\n let a = num % 10,\n b = num % 100 - a,\n c = num >= 100 ? 100 : null;\n return num + (suffixes[a] || suffixes[b] || suffixes[c]);\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 7 // The week that contains Jan 1st is the first week of the year.\n }\n};\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Việt Nam [vi]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\nexport const viLocale: LocaleData = {\n abbr: 'vi',\n months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),\n monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),\n monthsParseExact: true,\n weekdays : 'chủ nháºt_thứ hai_thứ ba_thứ tÆ°_thứ năm_thứ sáu_thứ bảy'.split('_'),\n weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n weekdaysParseExact : true,\n meridiemParse: /sa|ch/i,\n isPM(input: string): boolean {\n return /^ch$/i.test(input);\n },\n meridiem(hours: number, minutes: number, isLower: boolean): string {\n if (hours < 12) {\n return isLower ? 'sa' : 'SA';\n } else {\n return isLower ? 'ch' : 'CH';\n }\n },\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM [năm] YYYY',\n LLL : 'D MMMM [năm] YYYY HH:mm',\n LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',\n l : 'DD/M/YYYY',\n ll : 'D MMM YYYY',\n lll : 'D MMM YYYY HH:mm',\n llll : 'ddd, D MMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Hôm nay lúc] LT',\n nextDay: '[Ngà y mai lúc] LT',\n nextWeek: 'dddd [tuần tá»›i lúc] LT',\n lastDay: '[Hôm qua lúc] LT',\n lastWeek: 'dddd [tuần trÆ°á»›c lúc] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : '%s tá»›i',\n past : '%s trÆ°á»›c',\n s : 'và i giây',\n ss : '%d giây' ,\n m : 'má»™t phút',\n mm : '%d phút',\n h : 'má»™t giá»',\n hh : '%d giá»',\n d : 'má»™t ngà y',\n dd : '%d ngà y',\n M : 'má»™t tháng',\n MM : '%d tháng',\n y : 'má»™t năm',\n yy : '%d năm'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}/,\n ordinal(_num: number): string {\n return '' + _num;\n },\n week : {\n dow : 1, // Thứ Hai là ngà y đầu tuần.\n doy : 4 // Tuần chứa ngà y 4 tháng 1 là tuần đầu tiên trong năm.\n }\n};\n\n","import { LocaleData } from '../locale/locale.class';\n\n//! moment.js locale configuration\n//! locale : Chinese (China) [zh-cn]\n//! author : suupic : https://github.com/suupic\n//! author : Zeno Zeng : https://github.com/zenozeng\n\nexport const zhCnLocale: LocaleData = {\n abbr: 'zh-cn',\n months: '一月_二月_三月_四月_五月_å…月_七月_八月_ä¹æœˆ_å月_å一月_å二月'.split('_'),\n monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期å…'.split('_'),\n weekdaysShort: '周日_周一_周二_周三_周四_周五_周å…'.split('_'),\n weekdaysMin: 'æ—¥_一_二_三_å››_五_å…'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY/MM/DD',\n LL: 'YYYYå¹´M月Dæ—¥',\n LLL: 'YYYYå¹´M月Dæ—¥Ah点mm分',\n LLLL: 'YYYYå¹´M月Dæ—¥ddddAh点mm分',\n l: 'YYYY/M/D',\n ll: 'YYYYå¹´M月Dæ—¥',\n lll: 'YYYYå¹´M月Dæ—¥ HH:mm',\n llll: 'YYYYå¹´M月Dæ—¥dddd HH:mm'\n },\n meridiemParse: /凌晨|早上|上åˆ|ä¸åˆ|下åˆ|晚上/,\n meridiemHour(hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === '凌晨' || meridiem === '早上' ||\n meridiem === '上åˆ') {\n return hour;\n } else if (meridiem === '下åˆ' || meridiem === '晚上') {\n return hour + 12;\n } else {\n // 'ä¸åˆ'\n return hour >= 11 ? hour : hour + 12;\n }\n },\n meridiem(hour, minute, isLower) {\n let hm = hour * 100 + minute;\n if (hm < 600) {\n return '凌晨';\n } else if (hm < 900) {\n return '早上';\n } else if (hm < 1130) {\n return '上åˆ';\n } else if (hm < 1230) {\n return 'ä¸åˆ';\n } else if (hm < 1800) {\n return '下åˆ';\n } else {\n return '晚上';\n }\n },\n calendar: {\n sameDay: '[今天]LT',\n nextDay: '[明天]LT',\n nextWeek: '[下]ddddLT',\n lastDay: '[昨天]LT',\n lastWeek: '[上]ddddLT',\n sameElse: 'L'\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(æ—¥|月|周)/,\n ordinal(_num: number, period) {\n const num = Number(_num);\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return num + 'æ—¥';\n case 'M':\n return num + '月';\n case 'w':\n case 'W':\n return num + '周';\n default:\n return num.toString();\n }\n },\n relativeTime: {\n future: '%s内',\n past: '%så‰',\n s: 'å‡ ç§’',\n ss: '%d 秒',\n m: '1 分钟',\n mm: '%d 分钟',\n h: '1 å°æ—¶',\n hh: '%d å°æ—¶',\n d: '1 天',\n dd: '%d 天',\n M: '1 个月',\n MM: '%d 个月',\n y: '1 å¹´',\n yy: '%d å¹´'\n },\n week: {\n // GB/T 7408-1994《数æ®å…ƒå’Œäº¤æ¢æ ¼å¼Â·ä¿¡æ¯äº¤æ¢Â·æ—¥æœŸå’Œæ—¶é—´è¡¨ç¤ºæ³•ã€‹ä¸ŽISO 8601:1988ç‰æ•ˆ\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n};\n","export interface Offsets {\n width: number;\n height: number;\n bottom?: number;\n left?: number;\n right?: number;\n top?: number;\n marginTop?: number;\n marginLeft?: number;\n}\n\nexport interface Data {\n options: Options;\n instance: {\n target: HTMLElement;\n host: HTMLElement;\n arrow?: HTMLElement;\n };\n offsets: {\n target: Offsets;\n host: Offsets;\n arrow?: Record<string, string | number | HTMLElement>;\n };\n positionFixed: boolean;\n placement: string;\n placementAuto: boolean;\n}\n\nexport interface Options {\n placement?: string;\n modifiers: {\n flip?: {\n enabled: boolean;\n };\n preventOverflow?: {\n enabled: boolean;\n boundariesElement?: string;\n };\n };\n allowedPositions?: string[];\n}\n\nexport enum MapPlacementInToRL {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n auto = 'auto',\n end = 'right',\n start = 'left',\n 'top left' = 'top left',\n 'top right' = 'top right',\n 'right top' = 'right top',\n 'right bottom' = 'right bottom',\n 'bottom right' = 'bottom right',\n 'bottom left' = 'bottom left',\n 'left bottom' = 'left bottom',\n 'left top' = 'left top',\n 'top start' = 'top left',\n 'top end' = 'top right',\n 'end top' = 'right top',\n 'end bottom' = 'right bottom',\n 'bottom end' = 'bottom right',\n 'bottom start' = 'bottom left',\n 'start bottom' = 'start bottom',\n 'start top' = 'left top',\n}\n\nexport enum PlacementForBs5 {\n top = 'top',\n bottom = 'bottom',\n left = 'start',\n right = 'end',\n auto = 'auto',\n end = 'end',\n start = 'start',\n 'top left' = 'top start',\n 'top right' = 'top end',\n 'right top' = 'end top',\n 'right bottom' = 'end bottom',\n 'bottom right' = 'bottom end',\n 'bottom left' = 'bottom start',\n 'left bottom' = 'start bottom',\n 'left top' = 'start top',\n 'top start' = 'top start',\n 'top end' = 'top end',\n 'end top' = 'end top',\n 'end bottom' = 'end bottom',\n 'bottom end' = 'bottom end',\n 'bottom start' = 'bottom start',\n 'start bottom' = 'start bottom',\n 'start top' = 'start top',\n}\n\nexport type AvailbleBSPositions = 'top' | 'bottom' | 'left' | 'right' | 'auto' | 'top left' | 'top right' | 'right top' | 'right bottom' | 'bottom right' | 'bottom left' | 'left bottom' | 'left top' | 'start' | 'end' | 'top start' | 'top end' | 'end top' | 'end bottom' | 'bottom end' | 'bottom start' | 'start bottom' | 'start top';\n\n","/**\n * Get CSS computed property of the given element\n */\nexport function getStyleComputedProperty(element: Element): CSSStyleDeclaration;\nexport function getStyleComputedProperty(element: Element, property?: string): string | string[];\nexport function getStyleComputedProperty(element: Element, property?: string): string | string[] | CSSStyleDeclaration {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n const css = window?.getComputedStyle(element, null);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return property ? css && css[property] : css;\n}\n","/**\n * Returns the offset parent of the given element\n */\nimport { getStyleComputedProperty } from './getStyleComputedProperty';\n\nexport function getOffsetParent(element: HTMLElement): HTMLElement {\n if (!element) {\n return document.documentElement;\n }\n\n const noOffsetParent = null;\n\n // NOTE: 1 DOM access here\n let offsetParent = element?.offsetParent;\n\n // Skip hidden elements which don't have an offsetParent\n let sibling: HTMLElement | undefined = void 0;\n\n while (offsetParent === noOffsetParent\n && element.nextElementSibling\n && sibling !== element.nextElementSibling) {\n\n // todo: valorkin fix\n sibling = element.nextElementSibling as HTMLElement;\n offsetParent = sibling.offsetParent;\n }\n\n const nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return sibling ? sibling.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n if (\n offsetParent &&\n ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n getStyleComputedProperty(offsetParent, 'position') === 'static'\n ) {\n return getOffsetParent(offsetParent as HTMLElement);\n }\n\n return offsetParent as HTMLElement;\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n */\nexport function getRoot(node: Node|ShadowRoot): Node|ShadowRoot {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n","/**\n * Finds the offset parent common to the two provided nodes\n */\nimport { isOffsetContainer } from './isOffsetContainer';\nimport { getRoot } from './getRoot';\nimport { getOffsetParent } from './getOffsetParent';\n\nexport function findCommonOffsetParent(element1: HTMLElement, element2: HTMLElement): HTMLElement {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n const order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n\n const start = order ? element1 : element2;\n const end = order ? element2 : element1;\n\n // Get common ancestor container\n const range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n\n // todo: valorkin fix\n const commonAncestorContainer = range.commonAncestorContainer as unknown as HTMLElement;\n\n // Both nodes are inside #document\n if (\n (element1 !== commonAncestorContainer &&\n element2 !== commonAncestorContainer) ||\n start.contains(end)\n ) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n const element1root = getRoot(element1) as ShadowRoot;\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host as HTMLElement, element2);\n } else {\n return findCommonOffsetParent(element1, (getRoot(element2) as ShadowRoot).host as HTMLElement);\n }\n}\n","import { getOffsetParent } from './getOffsetParent';\n\n// todo: valorkin fix\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isOffsetContainer(element: any) {\n const { nodeName } = element;\n if (nodeName === 'BODY') {\n return false;\n }\n\n return (\n nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n );\n}\n","/**\n * Finds the first parent of an element that has a transformed property defined\n */\n\nimport { getStyleComputedProperty } from './getStyleComputedProperty';\n\nexport function getFixedPositionOffsetParent(element: HTMLElement): HTMLElement {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement) {\n return document.documentElement;\n }\n\n let el = element.parentElement;\n\n while (el?.parentElement && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n\n return el || document.documentElement;\n}\n","/**\n * Helper to detect borders of a given element\n */\n\nexport function getBordersSize(styles: CSSStyleDeclaration, axis: string): number {\n const sideA = axis === 'x' ? 'Left' : 'Top';\n const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return (\n parseFloat((styles as never)[`border${sideA}Width`]) +\n parseFloat((styles as never)[`border${sideB}Width`])\n );\n}\n","function getSize(axis: string, body: HTMLElement, html: HTMLElement, computedStyle?: CSSStyleDeclaration) {\n const _body = body as unknown as Record<string, number>;\n const _html = html as never;\n const _computedStyle = computedStyle as unknown as Record<string, string>;\n\n return Math.max(\n _body[`offset${axis}`],\n _body[`scroll${axis}`],\n _html[`client${axis}`],\n _html[`offset${axis}`],\n _html[`scroll${axis}`],\n 0\n );\n}\n\nexport function getWindowSizes(document: Document) {\n const body = document.body;\n const html = document.documentElement;\n const computedStyle = void 0;\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n */\nimport { Offsets } from '../models';\n\nexport function getClientRect(offsets: Offsets): Offsets {\n return {\n ...offsets,\n right: (offsets.left || 0) + offsets.width,\n bottom: (offsets.top || 0) + offsets.height\n };\n}\n","/**\n * Tells if a given input is a number\n */\nexport function isNumeric(n: string): boolean {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(Number(n));\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isNumber(value?: any): value is number {\n return typeof value === 'number' || Object.prototype.toString.call(value) === '[object Number]';\n}\n","/**\n * Get bounding client rect of given element\n */\nimport { getStyleComputedProperty } from './getStyleComputedProperty';\nimport { getBordersSize } from './getBordersSize';\nimport { getWindowSizes } from './getWindowSizes';\nimport { getClientRect } from './getClientRect';\nimport { Offsets } from '../models';\nimport { isNumber } from './isNumeric';\n\nexport function getBoundingClientRect(element: HTMLElement): Offsets {\n const rect: Offsets = element.getBoundingClientRect();\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n // try {\n // if (isIE(10)) {\n // const scrollTop = getScroll(element, 'top');\n // const scrollLeft = getScroll(element, 'left');\n // if (rect && isNumber(rect.top) && isNumber(rect.left) && isNumber(rect.bottom) && isNumber(rect.right)) {\n // rect.top += scrollTop;\n // rect.left += scrollLeft;\n // rect.bottom += scrollTop;\n // rect.right += scrollLeft;\n // }\n // }\n // } catch (e) {\n // return rect;\n // }\n\n if (!(rect && isNumber(rect.top) && isNumber(rect.left) && isNumber(rect.bottom) && isNumber(rect.right))) {\n return rect;\n }\n\n const result: Offsets = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : undefined;\n const width = sizes?.width || element.clientWidth\n || isNumber(rect.right) && isNumber(result.left) && rect.right - result.left || 0;\n const height = sizes?.height || element.clientHeight\n || isNumber(rect.bottom) && isNumber(result.top) && rect.bottom - result.top || 0;\n\n let horizScrollbar = element.offsetWidth - width;\n let vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n const styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n","/**\n * Returns the parentNode or the host of the element\n */\n// todo: valorkin fix\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getParentNode(element: any): any {\n if (element.nodeName === 'HTML') {\n return element;\n }\n\n return element.parentNode || element.host;\n}\n","/**\n * Returns the scrolling parent of the given element\n */\nimport { getStyleComputedProperty } from './getStyleComputedProperty';\nimport { getParentNode } from './getParentNode';\n\n// todo: valorkin fix\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getScrollParent(element: any): any {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n default:\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n if (/(auto|scroll|overlay)/.test(String(overflow) + String(overflowY) + String(overflowX))) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n","import { getBoundingClientRect } from './getBoundingClientRect';\nimport { getClientRect } from './getClientRect';\nimport { getScrollParent } from './getScrollParent';\nimport { getStyleComputedProperty } from './getStyleComputedProperty';\nimport { includeScroll } from './includeScroll';\nimport { Offsets } from '../models';\nimport { isNumber } from './isNumeric';\n\nexport function getOffsetRectRelativeToArbitraryNode(\n children: HTMLElement,\n parent: HTMLElement,\n fixedPosition = false\n): Offsets {\n const isHTML = parent.nodeName === 'HTML';\n const childrenRect = getBoundingClientRect(children);\n const parentRect = getBoundingClientRect(parent);\n const scrollParent = getScrollParent(children);\n\n const styles = getStyleComputedProperty(parent);\n const borderTopWidth = parseFloat(styles.borderTopWidth);\n const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top ?? 0, 0);\n parentRect.left = Math.max(parentRect.left ?? 0, 0);\n }\n\n const offsets: Offsets = getClientRect({\n top: (childrenRect.top ?? 0) - (parentRect.top ?? 0) - borderTopWidth,\n left: (childrenRect.left ?? 0) - (parentRect.left ?? 0) - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (isHTML) {\n const marginTop = parseFloat(styles.marginTop);\n const marginLeft = parseFloat(styles.marginLeft);\n\n if (isNumber(offsets.top)) {\n offsets.top -= borderTopWidth - marginTop;\n }\n if (isNumber(offsets.bottom)) {\n offsets.bottom -= borderTopWidth - marginTop;\n }\n if (isNumber(offsets.left)) {\n offsets.left -= borderLeftWidth - marginLeft;\n }\n if (isNumber(offsets.right)) {\n offsets.right -= borderLeftWidth - marginLeft;\n }\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n return offsets;\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n */\nexport function getScroll(element: HTMLElement, side = 'top') {\n const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n const nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n const html = element.ownerDocument.documentElement;\n const scrollingElement = element.ownerDocument.scrollingElement || html;\n\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n","/**\n * Check if the given element is fixed or is inside a fixed parent\n */\nimport { getStyleComputedProperty } from './getStyleComputedProperty';\nimport { getParentNode } from './getParentNode';\n\nexport function isFixed(element: HTMLElement): boolean {\n const nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n\n return isFixed(getParentNode(element));\n}\n","/**\n * Computed the boundaries limits and return them\n */\nimport { Offsets } from '../models';\nimport { findCommonOffsetParent } from './findCommonOffsetParent';\nimport { getFixedPositionOffsetParent } from './getFixedPositionOffsetParent';\nimport { getOffsetRectRelativeToArbitraryNode } from './getOffsetRectRelativeToArbitraryNode';\nimport { getParentNode } from './getParentNode';\nimport { getScrollParent } from './getScrollParent';\nimport { getViewportOffsetRectRelativeToArtbitraryNode } from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport { getWindowSizes } from './getWindowSizes';\nimport { isFixed } from './isFixed';\nimport { isNumber } from './isNumeric';\n\nexport function getBoundaries(\n target: HTMLElement,\n host: HTMLElement,\n padding = 0,\n boundariesElement: string,\n fixedPosition = false\n): Partial<Offsets> {\n // NOTE: 1 DOM access here\n\n let boundaries: Partial<Offsets> = { top: 0, left: 0 };\n const offsetParent = fixedPosition ? getFixedPositionOffsetParent(target) : findCommonOffsetParent(target, host);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n let boundariesNode;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(host));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = target.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = target.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n const offsets = getOffsetRectRelativeToArbitraryNode(\n boundariesNode,\n offsetParent,\n fixedPosition\n );\n\n // In case of HTML, we need a different computation\n if (offsets && boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n const { height, width } = getWindowSizes(target.ownerDocument);\n if (isNumber(boundaries.top) && isNumber(offsets.top) && isNumber(offsets.marginTop)) {\n boundaries.top += offsets.top - offsets.marginTop;\n }\n if (isNumber(boundaries.top)) {\n boundaries.bottom = Number(height) + Number(offsets.top);\n }\n if (isNumber(boundaries.left) && isNumber(offsets.left) && isNumber(offsets.marginLeft)) {\n boundaries.left += offsets.left - offsets.marginLeft;\n }\n if (isNumber(boundaries.top)) {\n boundaries.right = Number(width) + Number(offsets.left);\n }\n } else if (offsets) {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n if (isNumber(boundaries.left)) {\n boundaries.left += padding;\n }\n if (isNumber(boundaries.top)) {\n boundaries.top += padding;\n }\n if (isNumber(boundaries.right)) {\n boundaries.right -= padding;\n }\n if (isNumber(boundaries.bottom)) {\n boundaries.bottom -= padding;\n }\n\n return boundaries;\n}\n","import { getClientRect } from './getClientRect';\nimport { getOffsetRectRelativeToArbitraryNode } from './getOffsetRectRelativeToArbitraryNode';\nimport { getScroll } from './getScroll';\nimport { Offsets } from '../models';\n\nexport function getViewportOffsetRectRelativeToArtbitraryNode(element: HTMLElement, excludeScroll = false): Offsets {\n const html = element.ownerDocument.documentElement;\n const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n const width = Math.max(html.clientWidth, window.innerWidth || 0);\n const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n const scrollTop = !excludeScroll ? getScroll(html) : 0;\n const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n const offset = {\n top: scrollTop - Number(relativeOffset?.top) + Number(relativeOffset?.marginTop),\n left: scrollLeft - Number(relativeOffset?.left) + Number(relativeOffset?.marginLeft),\n width,\n height\n };\n\n return getClientRect(offset);\n}\n","/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n */\nimport { getBoundaries } from './getBoundaries';\nimport { Offsets, PlacementForBs5 } from '../models';\nimport { getBsVer } from 'ngx-bootstrap/utils';\n\nfunction getArea({ width, height }: { width: number; height: number }) {\n return width * height;\n}\n\nexport function computeAutoPlacement(\n placement: string,\n refRect: Offsets,\n target: HTMLElement,\n host: HTMLElement,\n allowedPositions = ['top', 'bottom', 'right', 'left'],\n boundariesElement = 'viewport',\n padding = 0\n) {\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n const boundaries = getBoundaries(target, host, padding, boundariesElement);\n\n type Rects = { top: Offsets; right: Offsets; bottom: Offsets; left: Offsets };\n const rects: Rects = {\n top: {\n width: boundaries?.width ?? 0,\n height: (refRect?.top ?? 0) - (boundaries?.top ?? 0)\n },\n right: {\n width: (boundaries?.right ?? 0) - (refRect?.right ?? 0),\n height: boundaries?.height ?? 0\n },\n bottom: {\n width: boundaries?.width ?? 0,\n height: (boundaries?.bottom ?? 0) - (refRect?.bottom ?? 0)\n },\n left: {\n width: (refRect.left ?? 0) - (boundaries?.left ?? 0),\n height: boundaries?.height ?? 0\n }\n };\n\n const sortedAreas = Object.keys(rects)\n .map((key) => ({\n position: key,\n ...rects[key as keyof Rects],\n area: getArea(rects[key as keyof Rects] as { width: number; height: number })\n }))\n .sort((a, b) => b.area - a.area);\n\n let filteredAreas = sortedAreas.filter(({ width, height }) => {\n return width >= target.clientWidth && height >= target.clientHeight;\n });\n\n filteredAreas = filteredAreas.filter(({ position }) => {\n return allowedPositions.some((allowedPosition: string) => {\n return allowedPosition === position;\n });\n });\n\n const computedPlacement: string = filteredAreas.length > 0 ? filteredAreas[0].position : sortedAreas[0].position;\n\n const variation = placement.split(' ')[1];\n // for tooltip on auto position\n target.className = target.className.replace(\n /bs-tooltip-auto/g,\n `bs-tooltip-${\n getBsVer().isBs5 ? PlacementForBs5[computedPlacement as keyof typeof PlacementForBs5] : computedPlacement\n }`\n );\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n */\nimport { Offsets } from '../models';\n\nconst parse = (value?: string, def = 0) => value ? parseFloat(value) : def;\nexport function getOuterSizes(element: HTMLElement): Offsets {\n const window = element.ownerDocument.defaultView;\n const styles = window?.getComputedStyle(element);\n const x = parse(styles?.marginTop) + parse(styles?.marginBottom);\n const y = parse(styles?.marginLeft) + parse(styles?.marginRight);\n\n return {\n width: Number(element.offsetWidth) + y,\n height: Number(element.offsetHeight) + x\n };\n}\n","/**\n * Get offsets to the reference element\n */\nimport { findCommonOffsetParent } from './findCommonOffsetParent';\nimport { getOffsetRectRelativeToArbitraryNode } from './getOffsetRectRelativeToArbitraryNode';\nimport { getFixedPositionOffsetParent } from './getFixedPositionOffsetParent';\nimport { Offsets } from '../models';\n\nexport function getReferenceOffsets(\n target: HTMLElement,\n host: HTMLElement,\n fixedPosition?: boolean\n): Offsets {\n const commonOffsetParent = fixedPosition\n ? getFixedPositionOffsetParent(target)\n : findCommonOffsetParent(target, host);\n\n return getOffsetRectRelativeToArbitraryNode(host, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get offsets to the target\n */\nimport { getOppositePlacement } from './getOppositePlacement';\nimport { getOuterSizes } from './getOuterSizes';\nimport { Offsets } from '../models';\n\n\nexport function getTargetOffsets(\n target: HTMLElement,\n hostOffsets: Offsets,\n position: string\n): Offsets {\n const placement = position.split(' ')[0];\n // Get target node sizes\n const targetRect = getOuterSizes(target);\n\n // Add position, width and height to our offsets object\n const targetOffsets = {\n width: targetRect.width,\n height: targetRect.height\n };\n\n // depending by the target placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n targetOffsets[mainSide as keyof typeof targetOffsets] =\n (hostOffsets[mainSide] ?? 0) +\n hostOffsets[measurement] / 2 -\n targetRect[measurement] / 2;\n\n targetOffsets[secondarySide as keyof typeof targetOffsets] = placement === secondarySide\n ? (hostOffsets[secondarySide] ?? 0)- targetRect[secondaryMeasurement]\n : hostOffsets[getOppositePlacement(secondarySide) as keyof typeof hostOffsets] ?? 0;\n\n return targetOffsets;\n}\n","/**\n * Get the opposite placement of the given one\n */\nexport function getOppositePlacement(placement: string): string {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched as keyof typeof hash]);\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n */\nimport { Options } from '../models';\n\nexport function isModifierEnabled(options: Options, modifierName: string): boolean {\n return !!options.modifiers[modifierName as keyof typeof options.modifiers]?.enabled;\n}\n","import { getBsVer } from 'ngx-bootstrap/utils';\nimport { AvailbleBSPositions } from '../models';\n\nconst availablePositions = {\n top: ['top', 'top start', 'top end'],\n bottom: ['bottom', 'bottom start', 'bottom end'],\n start: ['start', 'start top', 'start bottom'],\n end: ['end', 'end top', 'end bottom']\n};\n\nexport function checkPopoverMargin(placement: AvailbleBSPositions, checkPosition: 'top' | 'bottom' | 'start' | 'end'): boolean {\n if (!getBsVer().isBs5) {\n return false;\n }\n\n return availablePositions[checkPosition].includes(placement);\n}\n\nexport function checkMargins(placement: any): string {\n if (!getBsVer().isBs5) {\n return '';\n }\n\n if (checkPopoverMargin(placement, 'end')) {\n return 'ms-2';\n }\n\n if (checkPopoverMargin(placement, 'start')) {\n return 'me-2';\n }\n\n if (checkPopoverMargin(placement, 'top')) {\n return 'mb-2';\n }\n\n if (checkPopoverMargin(placement, 'bottom')) {\n return 'mt-2';\n }\n\n return '';\n}\n","/**\n * Set the style to the given popper\n */\nimport { Renderer2 } from '@angular/core';\n\nimport { isNumeric } from './isNumeric';\n\nexport function setStyles(element: HTMLElement | null, styles?: Record<string, string|number|HTMLElement>, renderer?: Renderer2) {\n if (!element || !styles) {\n return;\n }\n Object.keys(styles).forEach((prop) => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 &&\n isNumeric(styles[prop] as string)) {\n unit = 'px';\n }\n\n if (renderer) {\n renderer.setStyle(element, prop, `${String(styles[prop])}${unit}`);\n\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (element.style as any)[prop] = String(styles[prop]) + unit;\n });\n}\n","import { getClientRect, getOuterSizes, getStyleComputedProperty } from '../utils';\nimport { Data } from '../models';\n\nexport function arrow(data: Data) {\n let targetOffsets = data.offsets.target;\n // if arrowElement is a string, suppose it's a CSS selector\n const arrowElement: HTMLElement | null = data.instance.target.querySelector('.arrow');\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n\n const isVertical = ['left', 'right'].indexOf(data.placement.split(' ')[0]) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase() as keyof typeof targetOffsets;\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n const placementVariation = data.placement.split(' ')[1];\n\n // top/left side\n if ((data.offsets.host[opSide] ?? 0) - arrowElementSize < (targetOffsets[side] ?? 0)) {\n (targetOffsets)[side] -=\n (targetOffsets[side] ?? 0) - ((data.offsets.host[opSide] ?? 0) - arrowElementSize);\n }\n // bottom/right side\n if (Number((data).offsets.host[side]) + Number(arrowElementSize) > (targetOffsets[opSide] ?? 0)) {\n (targetOffsets)[side] +=\n Number((data).offsets.host[side]) + Number(arrowElementSize) - Number((targetOffsets)[opSide]);\n }\n targetOffsets = getClientRect(targetOffsets);\n\n // Compute the sideValue using the updated target offsets\n // take target margin in account because we don't have this info available\n const css = getStyleComputedProperty(data.instance.target) as unknown as Record<string, string>;\n const targetMarginSide = parseFloat(css[`margin${sideCapitalized}`]) || 0;\n const targetBorderSide = parseFloat(css[`border${sideCapitalized}Width`]) || 0;\n\n // compute center of the target\n let center: number;\n if (!placementVariation) {\n center = Number((data).offsets.host[side]) + Number(data.offsets.host[len] / 2 - arrowElementSize / 2);\n } else {\n const targetBorderRadius = parseFloat(css[\"borderRadius\"]) || 0;\n const targetSideArrowOffset = Number(targetMarginSide + targetBorderSide + targetBorderRadius);\n center = side === placementVariation ?\n Number((data).offsets.host[side]) + targetSideArrowOffset :\n Number((data).offsets.host[side]) + Number(data.offsets.host[len] - targetSideArrowOffset);\n }\n\n let sideValue =\n center - (targetOffsets[side] ?? 0) - targetMarginSide - targetBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its target\n sideValue = Math.max(Math.min(targetOffsets[len] - (arrowElementSize + 5), sideValue), 0);\n data.offsets.arrow = {\n [side]: Math.round(sideValue),\n [altSide]: '' // make sure to unset any eventual altSide value from the DOM node\n };\n\n data.instance.arrow = arrowElement;\n\n return data;\n}\n","import { Data } from '../models';\nimport {\n computeAutoPlacement,\n getBoundaries,\n getClientRect,\n getOppositeVariation,\n getTargetOffsets,\n isModifierEnabled\n} from '../utils';\n\nexport function flip(data: Data): Data {\n data.offsets.target = getClientRect(data.offsets.target);\n\n if (!isModifierEnabled(data.options, 'flip')) {\n\n data.offsets.target = {\n ...data.offsets.target,\n ...getTargetOffsets(\n data.instance.target,\n data.offsets.host,\n data.placement\n )\n };\n\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.target,\n data.instance.host,\n 0, // padding\n 'viewport',\n false // positionFixed\n );\n\n let placement = data.placement.split(' ')[0];\n let variation = data.placement.split(' ')[1] || '';\n\n const offsetsHost = data.offsets.host;\n const target = data.instance.target;\n const host = data.instance.host;\n\n const adaptivePosition = computeAutoPlacement('auto', offsetsHost, target, host, data.options.allowedPositions);\n const flipOrder = [placement, adaptivePosition];\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return;\n }\n\n placement = data.placement.split(' ')[0];\n\n // using floor because the host offsets may contain decimals we are not going to consider here\n const overlapsRef =\n (placement === 'left' &&\n Math.floor(data.offsets.target.right ?? 0) > Math.floor(data.offsets.host.left ?? 0)) ||\n (placement === 'right' &&\n Math.floor(data.offsets.target.left ?? 0) < Math.floor(data.offsets.host.right ?? 0)) ||\n (placement === 'top' &&\n Math.floor(data.offsets.target.bottom ?? 0) > Math.floor(data.offsets.host.top ?? 0)) ||\n (placement === 'bottom' &&\n Math.floor(data.offsets.target.top ?? 0) < Math.floor(data.offsets.host.bottom ?? 0));\n\n const overflowsLeft = Math.floor(data.offsets.target.left ?? 0) < Math.floor(boundaries.left ?? 0);\n const overflowsRight = Math.floor(data.offsets.target.right ?? 0) > Math.floor(boundaries.right ?? 0);\n const overflowsTop = Math.floor(data.offsets.target.top ?? 0) < Math.floor(boundaries.top ?? 0);\n const overflowsBottom = Math.floor(data.offsets.target.bottom ?? 0) > Math.floor(boundaries.bottom ?? 0);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const flippedVariation =\n ((isVertical && variation === 'left' && overflowsLeft) ||\n (isVertical && variation === 'right' && overflowsRight) ||\n (!isVertical && variation === 'left' && overflowsTop) ||\n (!isVertical && variation === 'right' && overflowsBottom));\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? ` ${variation}` : '');\n\n data.offsets.target = {\n ...data.offsets.target,\n ...getTargetOffsets(\n data.instance.target,\n data.offsets.host,\n data.placement\n )\n };\n }\n });\n\n return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n */\nexport function getOppositeVariation(variation: string) {\n if (variation === 'right') {\n return 'left';\n } else if (variation === 'left') {\n return 'right';\n }\n\n return variation;\n}\n","import { getBoundaries, isModifierEnabled } from '../utils';\nimport { Data, Offsets } from '../models';\n\nexport function preventOverflow(data: Data) {\n if (!isModifierEnabled(data.options, 'preventOverflow')) {\n return data;\n }\n\n // NOTE: DOM access here\n // resets the target Offsets's position so that the document size can be calculated excluding\n // the size of the targetOffsets element itself\n const transformProp = 'transform';\n const targetStyles = data.instance.target.style; // assignment to help minification\n const { top, left, [transformProp]: transform } = targetStyles;\n targetStyles.top = '';\n targetStyles.left = '';\n targetStyles[transformProp] = '';\n\n const boundaries = getBoundaries(\n data.instance.target,\n data.instance.host,\n 0, // padding\n data.options.modifiers.preventOverflow?.boundariesElement || 'scrollParent',\n false // positionFixed\n );\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n targetStyles.top = top;\n targetStyles.left = left;\n targetStyles[transformProp] = transform;\n\n const order = ['left', 'right', 'top', 'bottom'];\n\n const check = {\n primary(placement: keyof Offsets) {\n let value = data.offsets.target[placement];\n // options.escapeWithReference\n if ((data.offsets.target[placement] ?? 0) < (boundaries[placement] ?? 0)) {\n value = Math.max(data.offsets.target[placement] ?? 0, boundaries[placement] ?? 0);\n }\n\n return { [placement]: value };\n },\n secondary(placement: keyof Offsets) {\n const isPlacementHorizontal = placement === 'right';\n const mainSide = isPlacementHorizontal ? 'left' : 'top';\n const measurement = isPlacementHorizontal ? 'width' : 'height';\n let value = data.offsets.target[mainSide];\n\n // escapeWithReference\n if ((data.offsets.target[placement] ?? 0) > (boundaries[placement] ?? 0)) {\n value = Math.min(\n data.offsets.target[mainSide] ?? 0,\n (boundaries[placement] ?? 0) - data.offsets.target[measurement]\n );\n }\n\n return { [mainSide]: value };\n }\n };\n\n order.forEach((placement) => {\n const side = ['left', 'top', 'start'].indexOf(placement) !== -1 ? check['primary'] : check['secondary'];\n\n data.offsets.target = {\n ...data.offsets.target,\n ...side(placement as keyof Offsets)\n };\n });\n\n return data;\n}\n","import { Data } from '../models';\n\nexport function shift(data: Data): Data {\n const placement = data.placement;\n const basePlacement = placement.split(' ')[0];\n const shiftVariation = placement.split(' ')[1];\n\n if (shiftVariation) {\n const { host, target } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: host[side] },\n end: {\n [side]: (host[side] ?? 0) + host[measurement] - target[measurement]\n }\n };\n\n data.offsets.target = {\n ...target, ...{\n [side]: (side === shiftVariation ? shiftOffsets.start[side] : shiftOffsets.end[side])\n }\n };\n }\n\n return data;\n}\n","/**\n * @copyright Valor Software\n * @copyright Federico Zivolo and contributors\n */\nimport { Renderer2 } from '@angular/core';\nimport { Data, Offsets, Options, MapPlacementInToRL } from './models';\n\nimport { arrow, flip, initData, preventOverflow, shift } from './modifiers';\n\nimport { getOffsets, getReferenceOffsets, setStyles, updateContainerClass } from './utils';\n\n\nexport class Positioning {\n position(hostElement: HTMLElement, targetElement: HTMLElement/*, round = true*/): Offsets | undefined {\n return this.offset(hostElement, targetElement/*, false*/);\n }\n\n offset(hostElement: HTMLElement, targetElement: HTMLElement/*, round = true*/): Offsets | undefined {\n return getReferenceOffsets(targetElement, hostElement);\n }\n\n positionElements(\n hostElement: HTMLElement | null,\n targetElement: HTMLElement | null,\n position: string,\n appendToBody?: boolean,\n options?: Options\n ): Data | undefined {\n const chainOfModifiers = [flip, shift, preventOverflow, arrow];\n const _position = MapPlacementInToRL[position as keyof typeof MapPlacementInToRL];\n const data = initData(targetElement, hostElement, _position, options);\n if (!data) {\n return;\n }\n\n return chainOfModifiers.reduce(\n (modifiedData, modifier) => modifier(modifiedData),\n data\n );\n }\n}\n\nconst positionService = new Positioning();\n\nexport function positionElements(\n hostElement: HTMLElement | null,\n targetElement: HTMLElement | null,\n placement: string,\n appendToBody?: boolean,\n options?: Options,\n renderer?: Renderer2\n): void {\n\n const data = positionService.positionElements(\n hostElement,\n targetElement,\n placement,\n appendToBody,\n options\n );\n\n if (!data) {\n return;\n }\n\n const offsets = getOffsets(data);\n\n setStyles(targetElement, {\n 'will-change': 'transform',\n top: '0px',\n left: '0px',\n transform: `translate3d(${offsets.left}px, ${offsets.top}px, 0px)`\n }, renderer);\n\n if (data.instance.arrow) {\n setStyles(data.instance.arrow, data.offsets.arrow, renderer);\n }\n\n updateContainerClass(data, renderer);\n}\n","import {\n computeAutoPlacement,\n getReferenceOffsets,\n getTargetOffsets\n} from '../utils';\n\nimport { Data, Options } from '../models';\n\nexport function initData(\n targetElement: HTMLElement|null, hostElement: HTMLElement|null, position: string, options?: Options\n): Data|undefined {\n\n if (!targetElement || !hostElement) {\n return ;\n }\n\n const hostElPosition = getReferenceOffsets(targetElement, hostElement);\n\n if (!position.match(/^(auto)*\\s*(left|right|top|bottom|start|end)*$/)\n && !position.match(/^(left|right|top|bottom|start|end)*(?: (left|right|top|bottom|start|end))*$/)) {\n position = 'auto';\n }\n\n const placementAuto = !!position.match(/auto/g);\n\n // support old placements 'auto left|right|top|bottom'\n let placement = position.match(/auto\\s(left|right|top|bottom|start|end)/)\n ? position.split(' ')[1] || 'auto'\n : position;\n\n // Normalize placements that have identical main placement and variation (\"right right\" => \"right\").\n const matches = placement.match(/^(left|right|top|bottom|start|end)* ?(?!\\1)(left|right|top|bottom|start|end)?/);\n if (matches) {\n placement = matches[1] + (matches[2] ? ` ${matches[2]}` : '');\n }\n\n // \"left right\", \"top bottom\" etc. placements also considered incorrect.\n if (['left right', 'right left', 'top bottom', 'bottom top'].indexOf(placement) !== -1) {\n placement = 'auto';\n }\n\n placement = computeAutoPlacement(\n placement,\n hostElPosition,\n targetElement,\n hostElement,\n options ? options.allowedPositions : undefined\n );\n\n const targetOffset = getTargetOffsets(targetElement, hostElPosition, placement);\n\n return {\n options: options || {modifiers: {}},\n instance: {\n target: targetElement,\n host: hostElement,\n arrow: void 0\n },\n offsets: {\n target: targetOffset,\n host: hostElPosition,\n arrow: void 0\n },\n positionFixed: false,\n placement,\n placementAuto\n };\n}\n","import { Data, Offsets } from '../models';\n\nexport function getOffsets(data: Data): Offsets {\n return {\n width: data.offsets.target.width,\n height: data.offsets.target.height,\n left: Math.floor(data.offsets.target.left ?? 0),\n top: Math.round(data.offsets.target.top ?? 0),\n bottom: Math.round(data.offsets.target.bottom ?? 0),\n right: Math.floor(data.offsets.target.right ?? 0)\n };\n}\n","/**\n * Update class for the given popper\n */\nimport { Renderer2 } from '@angular/core';\nimport { Data, PlacementForBs5 } from '../models';\nimport { checkMargins } from './checkMargin';\nimport { getBsVer } from 'ngx-bootstrap/utils';\n\nexport function updateContainerClass(data: Data, renderer?: Renderer2): void {\n const target = data.instance.target;\n\n let containerClass = target.className;\n\n const dataPlacement = getBsVer().isBs5 ? PlacementForBs5[data.placement as keyof typeof PlacementForBs5] : data.placement;\n if (data.placementAuto) {\n containerClass = containerClass.replace(/bs-popover-auto/g, `bs-popover-${dataPlacement}`);\n containerClass = containerClass.replace(/ms-2|me-2|mb-2|mt-2/g, '');\n containerClass = containerClass.replace(/bs-tooltip-auto/g, `bs-tooltip-${dataPlacement}`);\n containerClass = containerClass.replace(/\\sauto/g, ` ${dataPlacement}`);\n\n if (containerClass.indexOf('popover') !== -1) {\n containerClass = containerClass + ' ' + checkMargins(dataPlacement);\n }\n\n if (containerClass.indexOf('popover') !== -1 && containerClass.indexOf('popover-auto') === -1) {\n containerClass += ' popover-auto';\n }\n\n if (containerClass.indexOf('tooltip') !== -1 && containerClass.indexOf('tooltip-auto') === -1) {\n containerClass += ' tooltip-auto';\n }\n }\n containerClass = containerClass.replace(/left|right|top|bottom|end|start/g, `${dataPlacement.split(' ')[0]}`);\n\n if (renderer) {\n renderer.setAttribute(target, 'class', containerClass);\n\n return;\n }\n\n target.className = containerClass;\n}\n","import { Injectable, ElementRef, RendererFactory2, Inject, PLATFORM_ID, NgZone } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport { positionElements } from './ng-positioning';\n\nimport { fromEvent, merge, of, animationFrameScheduler, Subject, Observable } from 'rxjs';\nimport { Options } from './models';\n\n\nexport interface PositioningOptions {\n /** The DOM element, ElementRef, or a selector string of an element which will be moved */\n element?: HTMLElement | ElementRef | string;\n\n /** The DOM element, ElementRef, or a selector string of an element which the element will be attached to */\n target?: HTMLElement | ElementRef | string;\n\n /**\n * A string of the form 'vert-attachment horiz-attachment' or 'placement'\n * - placement can be \"top\", \"bottom\", \"left\", \"right\"\n * not yet supported:\n * - vert-attachment can be any of 'top', 'middle', 'bottom'\n * - horiz-attachment can be any of 'left', 'center', 'right'\n */\n attachment?: string;\n\n /** A string similar to `attachment`. The one difference is that, if it's not provided,\n * `targetAttachment` will assume the mirror image of `attachment`.\n */\n targetAttachment?: string;\n\n /** A string of the form 'vert-offset horiz-offset'\n * - vert-offset and horiz-offset can be of the form \"20px\" or \"55%\"\n */\n offset?: string;\n\n /** A string similar to `offset`, but referring to the offset of the target */\n targetOffset?: string;\n\n /** If true component will be attached to body */\n appendToBody?: boolean;\n}\n\n\n@Injectable({providedIn: 'root'})\nexport class PositioningService {\n private options?: Options;\n private update$$ = new Subject<null>();\n private positionElements = new Map();\n private triggerEvent$?: Observable<number|Event|null>;\n private isDisabled = false;\n\n constructor(\n ngZone: NgZone,\n rendererFactory: RendererFactory2,\n @Inject(PLATFORM_ID) platformId: number\n ) {\n\n if (isPlatformBrowser(platformId)) {\n ngZone.runOutsideAngular(() => {\n this.triggerEvent$ = merge(\n fromEvent(window, 'scroll', { passive: true }),\n fromEvent(window, 'resize', { passive: true }),\n of(0, animationFrameScheduler),\n this.update$$\n );\n\n this.triggerEvent$.subscribe(() => {\n if (this.isDisabled) {\n return;\n }\n\n this.positionElements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .forEach((positionElement: any) => {\n positionElements(\n _getHtmlElement(positionElement.target),\n _getHtmlElement(positionElement.element),\n positionElement.attachment,\n positionElement.appendToBody,\n this.options,\n rendererFactory.createRenderer(null, null)\n );\n });\n });\n });\n }\n }\n\n position(options: PositioningOptions): void {\n this.addPositionElement(options);\n }\n\n get event$(): Observable<number|Event|null>|undefined {\n return this.triggerEvent$;\n }\n\n disable(): void {\n this.isDisabled = true;\n }\n\n enable(): void {\n this.isDisabled = false;\n }\n\n addPositionElement(options: PositioningOptions): void {\n this.positionElements.set(_getHtmlElement(options.element), options);\n }\n\n calcPosition(): void {\n this.update$$.next(null);\n }\n\n deletePositionElement(elRef: ElementRef): void {\n this.positionElements.delete(_getHtmlElement(elRef));\n }\n\n setOptions(options: Options) {\n this.options = options;\n }\n}\n\nfunction _getHtmlElement(element?: HTMLElement | ElementRef | string): HTMLElement | null {\n // it means that we got a selector\n if (typeof element === 'string') {\n return document.querySelector(element);\n }\n\n if (element instanceof ElementRef) {\n return element.nativeElement;\n }\n\n return element ?? null;\n}\n","import { Operator } from '../Operator';\nimport { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction, MonoTypeOperatorFunction } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function scan<T, R>(accumulator: (acc: R, value: T, index: number) => R, seed: R): OperatorFunction<T, R>;\nexport function scan<T>(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction<T>;\nexport function scan<T, R>(accumulator: (acc: R, value: T, index: number) => R): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Applies an accumulator function over the source Observable, and returns each\n * intermediate result, with an optional seed value.\n *\n * <span class=\"informal\">It's like {@link reduce}, but emits the current\n * accumulation whenever the source emits a value.</span>\n *\n * \n *\n * Combines together all values emitted on the source, using an accumulator\n * function that knows how to join a new source value into the accumulation from\n * the past. Is similar to {@link reduce}, but emits the intermediate\n * accumulations.\n *\n * Returns an Observable that applies a specified `accumulator` function to each\n * item emitted by the source Observable. If a `seed` value is specified, then\n * that value will be used as the initial value for the accumulator. If no seed\n * value is specified, the first item of the source is used as the seed.\n *\n * ## Example\n * Count the number of click events\n * ```ts\n * import { fromEvent } from 'rxjs';\n * import { scan, mapTo } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const ones = clicks.pipe(mapTo(1));\n * const seed = 0;\n * const count = ones.pipe(scan((acc, one) => acc + one, seed));\n * count.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link expand}\n * @see {@link mergeScan}\n * @see {@link reduce}\n *\n * @param {function(acc: R, value: T, index: number): R} accumulator\n * The accumulator function called on each source value.\n * @param {T|R} [seed] The initial accumulation value.\n * @return {Observable<R>} An observable of the accumulated values.\n * @method scan\n * @owner Observable\n */\nexport function scan<T, R>(accumulator: (acc: R, value: T, index: number) => R, seed?: T | R): OperatorFunction<T, R> {\n let hasSeed = false;\n // providing a seed of `undefined` *should* be valid and trigger\n // hasSeed! so don't use `seed !== undefined` checks!\n // For this reason, we have to check it here at the original call site\n // otherwise inside Operator/Subscriber we won't know if `undefined`\n // means they didn't provide anything or if they literally provided `undefined`\n if (arguments.length >= 2) {\n hasSeed = true;\n }\n\n return function scanOperatorFunction(source: Observable<T>): Observable<R> {\n return source.lift(new ScanOperator(accumulator, seed, hasSeed));\n };\n}\n\nclass ScanOperator<T, R> implements Operator<T, R> {\n constructor(private accumulator: (acc: R, value: T, index: number) => R, private seed?: T | R, private hasSeed: boolean = false) {}\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass ScanSubscriber<T, R> extends Subscriber<T> {\n private index: number = 0;\n\n get seed(): T | R {\n return this._seed;\n }\n\n set seed(value: T | R) {\n this.hasSeed = true;\n this._seed = value;\n }\n\n constructor(destination: Subscriber<R>, private accumulator: (acc: R, value: T, index: number) => R, private _seed: T | R,\n private hasSeed: boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n if (!this.hasSeed) {\n this.seed = value;\n this.destination.next(value);\n } else {\n return this._tryNext(value);\n }\n }\n\n private _tryNext(value: T): void {\n const index = this.index++;\n let result: any;\n try {\n result = this.accumulator(<R>this.seed, value, index);\n } catch (err) {\n this.destination.error(err);\n }\n this.seed = result;\n this.destination.next(result);\n }\n}\n","/**\n * @copyright ngrx\n */\nimport { Action, ActionReducer } from './index';\nimport { BehaviorSubject, Observable, queueScheduler } from 'rxjs';\nimport { observeOn, scan } from 'rxjs/operators';\n\n\nexport class MiniState<T> extends BehaviorSubject<T> {\n constructor(\n _initialState: T,\n actionsDispatcher$: Observable<Action>,\n reducer: ActionReducer<T>\n ) {\n super(_initialState);\n\n const actionInQueue$ = actionsDispatcher$.pipe(\n observeOn(queueScheduler)\n );\n const state$ = actionInQueue$.pipe(\n scan((state: T, action: Action) => {\n if (!action) {\n return state;\n }\n\n return reducer(state, action);\n },\n _initialState\n ));\n\n state$.subscribe((value: T) => this.next(value));\n }\n}\n","/**\n * @copyright ngrx\n */\nimport { Observable, Observer, Operator } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { Action, ActionReducer } from './index';\n\nexport class MiniStore<T> extends Observable<T> implements Observer<Action> {\n constructor(\n private _dispatcher: Observer<Action>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _reducer: ActionReducer<any>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n state$: Observable<any>\n ) {\n super();\n\n this.source = state$;\n }\n\n select<R>(pathOrMapFn: (state: T) => R): Observable<R> {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const mapped$: Observable<R> = this.source?.pipe(map(pathOrMapFn)) || new Observable().pipe(map(pathOrMapFn));\n return mapped$.pipe(distinctUntilChanged());\n }\n\n override lift<R>(operator: Operator<T, R>): MiniStore<R> {\n const store = new MiniStore<R>(this._dispatcher, this._reducer, this);\n store.operator = operator;\n\n return store;\n }\n\n dispatch(action: Action) {\n this._dispatcher.next(action);\n }\n\n next(action: Action) {\n this._dispatcher.next(action);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error(err: any) {\n this._dispatcher.error(err);\n }\n\n complete() {\n /*noop*/\n }\n}\n","<table>\n <tbody>\n <tr class=\"text-center\" [hidden]=\"!showSpinners\">\n <!-- increment hours button-->\n <td>\n <a class=\"btn btn-link\" [class.disabled]=\"!canIncrementHours || !isEditable\"\n (click)=\"changeHours(hourStep)\"\n ><span class=\"bs-chevron bs-chevron-up\"></span></a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showMinutes\"> </td>\n <!-- increment minutes button -->\n <td *ngIf=\"showMinutes\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canIncrementMinutes || !isEditable\"\n (click)=\"changeMinutes(minuteStep)\"\n ><span class=\"bs-chevron bs-chevron-up\"></span></a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showSeconds\"> </td>\n <!-- increment seconds button -->\n <td *ngIf=\"showSeconds\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canIncrementSeconds || !isEditable\"\n (click)=\"changeSeconds(secondsStep)\">\n <span class=\"bs-chevron bs-chevron-up\"></span>\n </a>\n </td>\n <!-- space between -->\n <td *ngIf=\"showMeridian\"> </td>\n <!-- meridian placeholder-->\n <td *ngIf=\"showMeridian\"></td>\n </tr>\n <tr>\n <!-- hours -->\n <td class=\"form-group mb-3\" [class.has-error]=\"invalidHours\">\n <input type=\"text\" [class.is-invalid]=\"invalidHours\"\n class=\"form-control text-center bs-timepicker-field\"\n [placeholder]=\"hoursPlaceholder\"\n maxlength=\"2\"\n [readonly]=\"readonlyInput\"\n [disabled]=\"disabled\"\n [value]=\"hours\"\n (wheel)=\"prevDef($event);changeHours(hourStep * wheelSign($event), 'wheel')\"\n (keydown.ArrowUp)=\"changeHours(hourStep, 'key')\"\n (keydown.ArrowDown)=\"changeHours(-hourStep, 'key')\"\n (change)=\"updateHours($event.target)\" [attr.aria-label]=\"labelHours\"></td>\n <!-- divider -->\n <td *ngIf=\"showMinutes\"> : </td>\n <!-- minutes -->\n <td class=\"form-group mb-3\" *ngIf=\"showMinutes\" [class.has-error]=\"invalidMinutes\">\n <input type=\"text\" [class.is-invalid]=\"invalidMinutes\"\n class=\"form-control text-center bs-timepicker-field\"\n [placeholder]=\"minutesPlaceholder\"\n maxlength=\"2\"\n [readonly]=\"readonlyInput\"\n [disabled]=\"disabled\"\n [value]=\"minutes\"\n (wheel)=\"prevDef($event);changeMinutes(minuteStep * wheelSign($event), 'wheel')\"\n (keydown.ArrowUp)=\"changeMinutes(minuteStep, 'key')\"\n (keydown.ArrowDown)=\"changeMinutes(-minuteStep, 'key')\"\n (change)=\"updateMinutes($event.target)\" [attr.aria-label]=\"labelMinutes\">\n </td>\n <!-- divider -->\n <td *ngIf=\"showSeconds\"> : </td>\n <!-- seconds -->\n <td class=\"form-group mb-3\" *ngIf=\"showSeconds\" [class.has-error]=\"invalidSeconds\">\n <input type=\"text\" [class.is-invalid]=\"invalidSeconds\"\n class=\"form-control text-center bs-timepicker-field\"\n [placeholder]=\"secondsPlaceholder\"\n maxlength=\"2\"\n [readonly]=\"readonlyInput\"\n [disabled]=\"disabled\"\n [value]=\"seconds\"\n (wheel)=\"prevDef($event);changeSeconds(secondsStep * wheelSign($event), 'wheel')\"\n (keydown.ArrowUp)=\"changeSeconds(secondsStep, 'key')\"\n (keydown.ArrowDown)=\"changeSeconds(-secondsStep, 'key')\"\n (change)=\"updateSeconds($event.target)\" [attr.aria-label]=\"labelSeconds\">\n </td>\n <!-- space between -->\n <td *ngIf=\"showMeridian\"> </td>\n <!-- meridian -->\n <td *ngIf=\"showMeridian\">\n <button type=\"button\" class=\"btn btn-default text-center\"\n [disabled]=\"!isEditable || !canToggleMeridian\"\n [class.disabled]=\"!isEditable || !canToggleMeridian\"\n (click)=\"toggleMeridian()\"\n >{{ meridian }}\n </button>\n </td>\n </tr>\n <tr class=\"text-center\" [hidden]=\"!showSpinners\">\n <!-- decrement hours button-->\n <td>\n <a class=\"btn btn-link\" [class.disabled]=\"!canDecrementHours || !isEditable\"\n (click)=\"changeHours(-hourStep)\">\n <span class=\"bs-chevron bs-chevron-down\"></span>\n </a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showMinutes\"> </td>\n <!-- decrement minutes button-->\n <td *ngIf=\"showMinutes\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canDecrementMinutes || !isEditable\"\n (click)=\"changeMinutes(-minuteStep)\">\n <span class=\"bs-chevron bs-chevron-down\"></span>\n </a>\n </td>\n <!-- divider -->\n <td *ngIf=\"showSeconds\"> </td>\n <!-- decrement seconds button-->\n <td *ngIf=\"showSeconds\">\n <a class=\"btn btn-link\" [class.disabled]=\"!canDecrementSeconds || !isEditable\"\n (click)=\"changeSeconds(-secondsStep)\">\n <span class=\"bs-chevron bs-chevron-down\"></span>\n </a>\n </td>\n <!-- space between -->\n <td *ngIf=\"showMeridian\"> </td>\n <!-- meridian placeholder-->\n <td *ngIf=\"showMeridian\"></td>\n </tr>\n </tbody>\n</table>\n","import { Injectable } from '@angular/core';\nimport { Action } from 'ngx-bootstrap/mini-ngrx';\nimport {\n TimeChangeEvent,\n TimepickerComponentState,\n Time\n} from '../timepicker.models';\n\n@Injectable({providedIn: 'platform'})\nexport class TimepickerActions {\n static readonly WRITE_VALUE = '[timepicker] write value from ng model';\n static readonly CHANGE_HOURS = '[timepicker] change hours';\n static readonly CHANGE_MINUTES = '[timepicker] change minutes';\n static readonly CHANGE_SECONDS = '[timepicker] change seconds';\n static readonly SET_TIME_UNIT = '[timepicker] set time unit';\n static readonly UPDATE_CONTROLS = '[timepicker] update controls';\n\n writeValue(value?: Date | string) {\n return {\n type: TimepickerActions.WRITE_VALUE,\n payload: value\n };\n }\n\n changeHours(event: TimeChangeEvent) {\n return {\n type: TimepickerActions.CHANGE_HOURS,\n payload: event\n };\n }\n\n changeMinutes(event: TimeChangeEvent) {\n return {\n type: TimepickerActions.CHANGE_MINUTES,\n payload: event\n };\n }\n\n changeSeconds(event: TimeChangeEvent): Action {\n return {\n type: TimepickerActions.CHANGE_SECONDS,\n payload: event\n };\n }\n\n setTime(value: Time): Action {\n return {\n type: TimepickerActions.SET_TIME_UNIT,\n payload: value\n };\n }\n\n updateControls(value: TimepickerComponentState): Action {\n return {\n type: TimepickerActions.UPDATE_CONTROLS,\n payload: value\n };\n }\n}\n","import { Time, TimepickerComponentState } from './timepicker.models';\n\nconst dex = 10;\nconst hoursPerDay = 24;\nconst hoursPerDayHalf = 12;\nconst minutesPerHour = 60;\nconst secondsPerMinute = 60;\n\nexport function isValidDate(value?: string | Date): boolean {\n if (!value) {\n return false;\n }\n\n if (value instanceof Date && isNaN(value.getHours())) {\n return false;\n }\n\n if (typeof value === 'string') {\n return isValidDate(new Date(value));\n }\n\n return true;\n}\n\nexport function isValidLimit(controls: TimepickerComponentState, newDate: Date): boolean {\n if (controls.min && newDate < controls.min) {\n return false;\n }\n\n if (controls.max && newDate > controls.max) {\n return false;\n }\n\n return true;\n}\n\nexport function toNumber(value?: string | number): number {\n if (typeof value === 'undefined') {\n return NaN;\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n return parseInt(value, dex);\n}\n\nexport function isNumber(value: string | number): value is number {\n return !isNaN(toNumber(value));\n}\n\nexport function parseHours(\n value?: string | number,\n isPM = false\n): number {\n const hour = toNumber(value);\n if (\n isNaN(hour) ||\n hour < 0 ||\n hour > (isPM ? hoursPerDayHalf : hoursPerDay)\n ) {\n return NaN;\n }\n\n return hour;\n}\n\nexport function parseMinutes(value?: string | number): number {\n const minute = toNumber(value);\n if (isNaN(minute) || minute < 0 || minute > minutesPerHour) {\n return NaN;\n }\n\n return minute;\n}\n\nexport function parseSeconds(value?: string | number): number {\n const seconds = toNumber(value);\n if (isNaN(seconds) || seconds < 0 || seconds > secondsPerMinute) {\n return NaN;\n }\n\n return seconds;\n}\n\nexport function parseTime(value?: string | Date): Date | undefined {\n if (typeof value === 'string') {\n return new Date(value);\n }\n\n return value;\n}\n\nexport function changeTime(value?: Date, diff?: Time): Date {\n if (!value) {\n return changeTime(createDate(new Date(), 0, 0, 0), diff);\n }\n\n if (!diff) {\n return value;\n }\n\n let hour = value.getHours();\n let minutes = value.getMinutes();\n let seconds = value.getSeconds();\n\n if (diff.hour) {\n hour = hour + toNumber(diff.hour);\n }\n\n if (diff.minute) {\n minutes = minutes + toNumber(diff.minute);\n }\n\n if (diff.seconds) {\n seconds = seconds + toNumber(diff.seconds);\n }\n\n return createDate(value, hour, minutes, seconds);\n}\n\nexport function setTime(value: Date | undefined, opts: Time): Date | undefined {\n let hour = parseHours(opts.hour);\n const minute = parseMinutes(opts.minute);\n const seconds = parseSeconds(opts.seconds) || 0;\n\n if (opts.isPM && hour !== 12) {\n hour += hoursPerDayHalf;\n }\n\n if (!value) {\n if (!isNaN(hour) && !isNaN(minute)) {\n return createDate(new Date(), hour, minute, seconds);\n }\n\n return value;\n }\n\n if (isNaN(hour) || isNaN(minute)) {\n return value;\n }\n\n return createDate(value, hour, minute, seconds);\n}\n\nexport function createDate(\n value: Date,\n hours: number,\n minutes: number,\n seconds: number\n): Date {\n const newValue = new Date(\n value.getFullYear(),\n value.getMonth(),\n value.getDate(),\n hours,\n minutes,\n seconds,\n value.getMilliseconds()\n );\n // #3139 ensure date part remains unchanged\n newValue.setFullYear(value.getFullYear());\n newValue.setMonth(value.getMonth());\n newValue.setDate(value.getDate());\n\n return newValue;\n}\n\nexport function padNumber(value: number): string {\n const _value = value.toString();\n if (_value.length > 1) {\n return _value;\n }\n\n return `0${_value}`;\n}\n\nexport function isHourInputValid(hours: string, isPM: boolean): boolean {\n return !isNaN(parseHours(hours, isPM));\n}\n\nexport function isMinuteInputValid(minutes: string): boolean {\n return !isNaN(parseMinutes(minutes));\n}\n\nexport function isSecondInputValid(seconds: string): boolean {\n return !isNaN(parseSeconds(seconds));\n}\n\nexport function isInputLimitValid(diff: Time, max?: Date, min?: Date): boolean {\n const newDate = setTime(new Date(), diff);\n\n if (!newDate) {\n return false;\n }\n\n if (max && newDate > max) {\n return false;\n }\n\n if (min && newDate < min) {\n return false;\n }\n\n return true;\n}\n\nexport function isOneOfDatesEmpty(hours: string, minutes: string, seconds: string): boolean {\n return hours.length === 0 || minutes.length === 0 || seconds.length === 0;\n}\n\nexport function isInputValid(\n hours: string,\n minutes = '0',\n seconds = '0',\n isPM: boolean\n): boolean {\n return isHourInputValid(hours, isPM)\n && isMinuteInputValid(minutes)\n && isSecondInputValid(seconds);\n}\n","import { changeTime } from './timepicker.utils';\nimport {\n TimeChangeEvent,\n TimepickerComponentState,\n TimepickerControls\n} from './timepicker.models';\n\nexport function canChangeValue(\n state: TimepickerComponentState,\n event?: TimeChangeEvent\n): boolean {\n if (state.readonlyInput || state.disabled) {\n return false;\n }\n\n if (event) {\n if (event.source === 'wheel' && !state.mousewheel) {\n return false;\n }\n\n if (event.source === 'key' && !state.arrowkeys) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function canChangeHours(\n event: TimeChangeEvent,\n controls: TimepickerControls\n): boolean {\n if (!event.step) {\n return false;\n }\n\n if (event.step > 0 && !controls.canIncrementHours) {\n return false;\n }\n\n if (event.step < 0 && !controls.canDecrementHours) {\n return false;\n }\n\n return true;\n}\n\nexport function canChangeMinutes(\n event: TimeChangeEvent,\n controls: TimepickerControls\n): boolean {\n if (!event.step) {\n return false;\n }\n if (event.step > 0 && !controls.canIncrementMinutes) {\n return false;\n }\n if (event.step < 0 && !controls.canDecrementMinutes) {\n return false;\n }\n\n return true;\n}\n\nexport function canChangeSeconds(\n event: TimeChangeEvent,\n controls: TimepickerControls\n): boolean {\n if (!event.step) {\n return false;\n }\n if (event.step > 0 && !controls.canIncrementSeconds) {\n return false;\n }\n if (event.step < 0 && !controls.canDecrementSeconds) {\n return false;\n }\n\n return true;\n}\n\nexport function getControlsValue(\n state: TimepickerComponentState\n): TimepickerComponentState {\n const {\n hourStep,\n minuteStep,\n secondsStep,\n readonlyInput,\n disabled,\n mousewheel,\n arrowkeys,\n showSpinners,\n showMeridian,\n showSeconds,\n meridians,\n min,\n max\n } = state;\n\n return {\n hourStep,\n minuteStep,\n secondsStep,\n readonlyInput,\n disabled,\n mousewheel,\n arrowkeys,\n showSpinners,\n showMeridian,\n showSeconds,\n meridians,\n min,\n max\n };\n}\n\nexport function timepickerControls(value: Date | undefined, state: TimepickerComponentState): TimepickerControls {\n const hoursPerDay = 24;\n const hoursPerDayHalf = 12;\n const { min, max, hourStep, minuteStep, secondsStep, showSeconds } = state;\n const res: TimepickerControls = {\n canIncrementHours: true,\n canIncrementMinutes: true,\n canIncrementSeconds: true,\n\n canDecrementHours: true,\n canDecrementMinutes: true,\n canDecrementSeconds: true,\n\n canToggleMeridian: true\n };\n\n if (!value) {\n return res;\n }\n\n // compare dates\n if (max) {\n const _newHour = changeTime(value, { hour: hourStep });\n res.canIncrementHours = max > _newHour && (value.getHours() + hourStep) < hoursPerDay;\n\n if (!res.canIncrementHours) {\n const _newMinutes = changeTime(value, { minute: minuteStep });\n res.canIncrementMinutes = showSeconds\n ? max > _newMinutes\n : max >= _newMinutes;\n }\n\n if (!res.canIncrementMinutes) {\n const _newSeconds = changeTime(value, { seconds: secondsStep });\n res.canIncrementSeconds = max >= _newSeconds;\n }\n\n if (value.getHours() < hoursPerDayHalf) {\n res.canToggleMeridian = changeTime(value, { hour: hoursPerDayHalf }) < max;\n }\n }\n\n if (min) {\n const _newHour = changeTime(value, { hour: -hourStep });\n res.canDecrementHours = min < _newHour;\n\n if (!res.canDecrementHours) {\n const _newMinutes = changeTime(value, { minute: -minuteStep });\n res.canDecrementMinutes = showSeconds\n ? min < _newMinutes\n : min <= _newMinutes;\n }\n\n if (!res.canDecrementMinutes) {\n const _newSeconds = changeTime(value, { seconds: -secondsStep });\n res.canDecrementSeconds = min <= _newSeconds;\n }\n\n if (value.getHours() >= hoursPerDayHalf) {\n res.canToggleMeridian = changeTime(value, { hour: -hoursPerDayHalf }) > min;\n }\n }\n\n return res;\n}\n","import { Injectable } from '@angular/core';\n\n/** Provides default configuration values for timepicker */\n@Injectable({\n providedIn: 'root'\n})\nexport class TimepickerConfig {\n /** hours change step */\n hourStep = 1;\n /** minutes change step */\n minuteStep = 5;\n /** seconds changes step */\n secondsStep = 10;\n /** if true works in 12H mode and displays AM/PM. If false works in 24H mode and hides AM/PM */\n showMeridian = true;\n /** meridian labels based on locale */\n meridians = ['AM', 'PM'];\n /** if true hours and minutes fields will be readonly */\n readonlyInput = false;\n /** if true hours and minutes fields will be disabled */\n disabled = false;\n /** if true emptyTime is not marked as invalid */\n allowEmptyTime = false;\n /** if true scroll inside hours and minutes inputs will change time */\n mousewheel = true;\n /** if true the values of hours and minutes can be changed using the up/down arrow keys on the keyboard */\n arrowkeys = true;\n /** if true spinner arrows above and below the inputs will be shown */\n showSpinners = true;\n /** show seconds in timepicker */\n showSeconds = false;\n /** show minutes in timepicker */\n showMinutes = true;\n /** minimum time user can select */\n min?: Date;\n /** maximum time user can select */\n max?: Date;\n /** placeholder for hours field in timepicker */\n hoursPlaceholder = 'HH';\n /** placeholder for minutes field in timepicker */\n minutesPlaceholder = 'MM';\n /** placeholder for seconds field in timepicker */\n secondsPlaceholder = 'SS';\n /** hours aria label */\n ariaLabelHours = 'hours';\n /** minutes aria label */\n ariaLabelMinutes = 'minutes';\n /** seconds aria label */\n ariaLabelSeconds = 'seconds';\n}\n","import { Action } from 'ngx-bootstrap/mini-ngrx';\nimport {\n canChangeHours,\n canChangeMinutes,\n canChangeSeconds,\n canChangeValue,\n timepickerControls\n} from '../timepicker-controls.util';\nimport { TimepickerConfig } from '../timepicker.config';\nimport {\n TimepickerComponentState,\n TimepickerControls\n} from '../timepicker.models';\nimport { changeTime, setTime, isValidLimit } from '../timepicker.utils';\nimport { TimepickerActions } from './timepicker.actions';\n\nexport interface TimepickerState {\n value?: Date;\n config: TimepickerComponentState;\n controls: TimepickerControls;\n}\n\nexport const initialState: TimepickerState = {\n value: void 0,\n config: new TimepickerConfig(),\n controls: {\n canIncrementHours: true,\n canIncrementMinutes: true,\n canIncrementSeconds: true,\n\n canDecrementHours: true,\n canDecrementMinutes: true,\n canDecrementSeconds: true,\n\n canToggleMeridian: true\n }\n};\n\nexport function timepickerReducer(state = initialState, action: Action) {\n switch (action.type) {\n case TimepickerActions.WRITE_VALUE: {\n return Object.assign({}, state, { value: action.payload });\n }\n\n case TimepickerActions.CHANGE_HOURS: {\n if (\n !canChangeValue(state.config, action.payload) ||\n !canChangeHours(action.payload, state.controls)\n ) {\n return state;\n }\n\n const _newTime = changeTime(state.value, { hour: action.payload.step });\n\n if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {\n return state;\n }\n\n return Object.assign({}, state, { value: _newTime });\n }\n\n case TimepickerActions.CHANGE_MINUTES: {\n if (\n !canChangeValue(state.config, action.payload) ||\n !canChangeMinutes(action.payload, state.controls)\n ) {\n return state;\n }\n\n const _newTime = changeTime(state.value, { minute: action.payload.step });\n\n if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {\n return state;\n }\n\n return Object.assign({}, state, { value: _newTime });\n }\n\n case TimepickerActions.CHANGE_SECONDS: {\n if (\n !canChangeValue(state.config, action.payload) ||\n !canChangeSeconds(action.payload, state.controls)\n ) {\n return state;\n }\n\n const _newTime = changeTime(state.value, {\n seconds: action.payload.step\n });\n\n if ((state.config.max || state.config.min) && !isValidLimit(state.config, _newTime)) {\n return state;\n }\n\n return Object.assign({}, state, { value: _newTime });\n }\n\n case TimepickerActions.SET_TIME_UNIT: {\n if (!canChangeValue(state.config)) {\n return state;\n }\n\n const _newTime = setTime(state.value, action.payload);\n\n return Object.assign({}, state, { value: _newTime });\n }\n\n case TimepickerActions.UPDATE_CONTROLS: {\n const _newControlsState = timepickerControls(state.value, action.payload);\n const _newState: TimepickerState = {\n value: state.value,\n config: action.payload,\n controls: _newControlsState\n };\n\n if (state.config.showMeridian !== _newState.config.showMeridian) {\n if (state.value) {\n _newState.value = new Date(state.value);\n }\n }\n\n return Object.assign({}, state, _newState);\n }\n\n default:\n return state;\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n timepickerReducer,\n TimepickerState,\n initialState\n} from './timepicker.reducer';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { Action, MiniStore, MiniState } from 'ngx-bootstrap/mini-ngrx';\n\n@Injectable({providedIn: 'platform'})\nexport class TimepickerStore extends MiniStore<TimepickerState> {\n constructor() {\n const _dispatcher = new BehaviorSubject<Action>({\n type: '[mini-ngrx] dispatcher init'\n });\n const state = new MiniState<TimepickerState>(\n initialState,\n _dispatcher,\n timepickerReducer\n );\n super(_dispatcher, timepickerReducer, state);\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { Subscription } from 'rxjs';\n\nimport { ControlValueAccessorModel } from './models';\n\nimport { TimepickerActions } from './reducer/timepicker.actions';\nimport { TimepickerStore } from './reducer/timepicker.store';\nimport { getControlsValue } from './timepicker-controls.util';\nimport { TimepickerConfig } from './timepicker.config';\n\nimport { TimeChangeSource, TimepickerComponentState, TimepickerControls } from './timepicker.models';\n\nimport {\n isHourInputValid,\n isInputLimitValid,\n isInputValid,\n isMinuteInputValid,\n isOneOfDatesEmpty,\n isSecondInputValid,\n isValidDate,\n padNumber,\n parseTime\n} from './timepicker.utils';\n\nexport const TIMEPICKER_CONTROL_VALUE_ACCESSOR: ControlValueAccessorModel = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TimepickerComponent),\n multi: true\n};\n\n@Component({\n selector: 'timepicker',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TIMEPICKER_CONTROL_VALUE_ACCESSOR, TimepickerStore],\n templateUrl: './timepicker.component.html',\n styles: [`\n .bs-chevron {\n border-style: solid;\n display: block;\n width: 9px;\n height: 9px;\n position: relative;\n border-width: 3px 0px 0 3px;\n }\n\n .bs-chevron-up {\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n top: 2px;\n }\n\n .bs-chevron-down {\n -webkit-transform: rotate(-135deg);\n transform: rotate(-135deg);\n top: -2px;\n }\n\n .bs-timepicker-field {\n width: 65px;\n padding: .375rem .55rem;\n }\n `],\n encapsulation: ViewEncapsulation.None\n})\nexport class TimepickerComponent\n implements ControlValueAccessor,\n TimepickerComponentState,\n TimepickerControls,\n OnChanges,\n OnDestroy {\n /** hours change step */\n @Input() hourStep = 1;\n /** minutes change step */\n @Input() minuteStep = 5;\n /** seconds change step */\n @Input() secondsStep = 10;\n /** if true hours and minutes fields will be readonly */\n @Input() readonlyInput = false;\n /** if true hours and minutes fields will be disabled */\n @Input() disabled = false;\n /** if true scroll inside hours and minutes inputs will change time */\n @Input() mousewheel = true;\n /** if true the values of hours and minutes can be changed using the up/down arrow keys on the keyboard */\n @Input() arrowkeys = true;\n /** if true spinner arrows above and below the inputs will be shown */\n @Input() showSpinners = true;\n /** if true meridian button will be shown */\n @Input() showMeridian = true;\n /** show minutes in timepicker */\n @Input() showMinutes = true;\n /** show seconds in timepicker */\n @Input() showSeconds = false;\n /** meridian labels based on locale */\n @Input() meridians: string[] = ['AM', 'PM'];\n /** minimum time user can select */\n @Input() min?: Date;\n /** maximum time user can select */\n @Input() max?: Date;\n /** placeholder for hours field in timepicker */\n @Input() hoursPlaceholder = 'HH';\n /** placeholder for minutes field in timepicker */\n @Input() minutesPlaceholder = 'MM';\n /** placeholder for seconds field in timepicker */\n @Input() secondsPlaceholder = 'SS';\n /** emits true if value is a valid date */\n @Output() isValid = new EventEmitter<boolean>();\n /** emits value of meridian*/\n @Output() meridianChange = new EventEmitter<string>();\n // ui variables\n hours = '';\n minutes = '';\n seconds = '';\n meridian = '';\n // min\\max validation for input fields\n invalidHours = false;\n invalidMinutes = false;\n invalidSeconds = false;\n // aria-label variables\n labelHours = 'hours';\n labelMinutes = 'minutes';\n labelSeconds = 'seconds';\n // time picker controls state\n canIncrementHours = true;\n canIncrementMinutes = true;\n canIncrementSeconds = true;\n canDecrementHours = true;\n canDecrementMinutes = true;\n canDecrementSeconds = true;\n canToggleMeridian = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange = Function.prototype;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onTouched = Function.prototype;\n\n config: TimepickerConfig;\n\n // control value accessor methods\n timepickerSub?: Subscription;\n constructor(\n _config: TimepickerConfig,\n private _cd: ChangeDetectorRef,\n private _store: TimepickerStore,\n private _timepickerActions: TimepickerActions\n ) {\n this.config = _config;\n Object.assign(this, this.config);\n this.timepickerSub = _store.select(state => state.value)\n .subscribe((value: Date | undefined) => {\n // update UI values if date changed\n this._renderTime(value);\n this.onChange(value);\n\n this._store.dispatch(\n this._timepickerActions.updateControls(getControlsValue(this))\n );\n });\n\n _store.select(state => state.controls)\n .subscribe((controlsState: TimepickerControls) => {\n const isTimepickerInputValid = isInputValid(this.hours, this.minutes, this.seconds, this.isPM());\n const isValid = this.config.allowEmptyTime?\n this.isOneOfDatesIsEmpty() || isTimepickerInputValid\n : isTimepickerInputValid;\n this.isValid.emit(isValid);\n Object.assign(this, controlsState);\n _cd.markForCheck();\n });\n }\n\n /** @deprecated - please use `isEditable` instead */\n get isSpinnersVisible(): boolean {\n return this.showSpinners && !this.readonlyInput;\n }\n\n get isEditable(): boolean {\n return !(this.readonlyInput || this.disabled);\n }\n\n resetValidation(): void {\n this.invalidHours = false;\n this.invalidMinutes = false;\n this.invalidSeconds = false;\n }\n\n isPM(): boolean {\n return this.showMeridian && this.meridian === this.meridians[1];\n }\n\n prevDef($event: Event) {\n $event.preventDefault();\n }\n\n wheelSign($event: WheelEventInit): number {\n return Math.sign($event.deltaY || 0) * -1;\n }\n\n ngOnChanges(): void {\n this._store.dispatch(\n this._timepickerActions.updateControls(getControlsValue(this))\n );\n }\n\n changeHours(step: number, source: TimeChangeSource = ''): void {\n this.resetValidation();\n this._store.dispatch(this._timepickerActions.changeHours({ step, source }));\n }\n\n changeMinutes(step: number, source: TimeChangeSource = ''): void {\n this.resetValidation();\n this._store.dispatch(\n this._timepickerActions.changeMinutes({ step, source })\n );\n }\n\n changeSeconds(step: number, source: TimeChangeSource = ''): void {\n this.resetValidation();\n this._store.dispatch(\n this._timepickerActions.changeSeconds({ step, source })\n );\n }\n\n updateHours(target?: Partial<EventTarget> | null): void {\n this.resetValidation();\n this.hours = (target as HTMLInputElement).value;\n\n const isTimepickerInputValid = isHourInputValid(this.hours, this.isPM()) && this.isValidLimit();\n const isValid = this.config.allowEmptyTime ?\n this.isOneOfDatesIsEmpty() || isTimepickerInputValid\n : isTimepickerInputValid;\n\n if (!isValid) {\n this.invalidHours = true;\n this.isValid.emit(false);\n this.onChange(null);\n\n return;\n }\n\n this._updateTime();\n }\n\n updateMinutes(target: Partial<EventTarget> | null) {\n this.resetValidation();\n this.minutes = (target as HTMLInputElement).value;\n\n const isTimepickerInputValid = isMinuteInputValid(this.minutes) && this.isValidLimit();\n const isValid = this.config.allowEmptyTime ?\n this.isOneOfDatesIsEmpty() || isTimepickerInputValid\n : isTimepickerInputValid;\n\n if (!isValid) {\n this.invalidMinutes = true;\n this.isValid.emit(false);\n this.onChange(null);\n\n return;\n }\n\n this._updateTime();\n }\n\n updateSeconds(target: Partial<EventTarget> | null) {\n this.resetValidation();\n this.seconds = (target as HTMLInputElement).value;\n\n const isTimepickerInputValid = isSecondInputValid(this.seconds) && this.isValidLimit();\n const isValid = this.config.allowEmptyTime ?\n this.isOneOfDatesIsEmpty() || isTimepickerInputValid\n : isTimepickerInputValid;\n\n if (!isValid) {\n this.invalidSeconds = true;\n this.isValid.emit(false);\n this.onChange(null);\n\n return;\n }\n\n this._updateTime();\n }\n\n isValidLimit(): boolean {\n return isInputLimitValid({\n hour: this.hours,\n minute: this.minutes,\n seconds: this.seconds,\n isPM: this.isPM()\n }, this.max, this.min);\n }\n\n isOneOfDatesIsEmpty(): boolean {\n return isOneOfDatesEmpty(\n this.hours,\n this.minutes,\n this.seconds);\n }\n\n _updateTime() {\n const _seconds = this.showSeconds ? this.seconds : void 0;\n const _minutes = this.showMinutes ? this.minutes : void 0;\n const isTimepickerInputValid = isInputValid(this.hours, _minutes, _seconds, this.isPM());\n const isValid = this.config.allowEmptyTime ?\n this.isOneOfDatesIsEmpty() || isTimepickerInputValid\n : isTimepickerInputValid;\n if (!isValid) {\n this.isValid.emit(false);\n this.onChange(null);\n\n return;\n }\n\n this._store.dispatch(\n this._timepickerActions.setTime({\n hour: this.hours,\n minute: this.minutes,\n seconds: this.seconds,\n isPM: this.isPM()\n })\n );\n }\n\n toggleMeridian(): void {\n if (!this.showMeridian || !this.isEditable) {\n return;\n }\n\n const _hoursPerDayHalf = 12;\n this._store.dispatch(\n this._timepickerActions.changeHours({\n step: _hoursPerDayHalf,\n source: ''\n })\n );\n }\n\n /**\n * Write a new value to the element.\n */\n writeValue(obj?: string | Date): void {\n if (isValidDate(obj)) {\n this.resetValidation();\n this._store.dispatch(this._timepickerActions.writeValue(parseTime(obj)));\n } else if (obj == null) {\n this._store.dispatch(this._timepickerActions.writeValue());\n }\n }\n\n /**\n * Set the function to be called when the control receives a change event.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n registerOnChange(fn: (_: any) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Set the function to be called when the control receives a touch event.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * This function is called when the control status changes to or from \"disabled\".\n * Depending on the value, it will enable or disable the appropriate DOM element.\n *\n * @param isDisabled\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this._cd.markForCheck();\n }\n\n ngOnDestroy(): void {\n this.timepickerSub?.unsubscribe();\n }\n\n private _renderTime(value?: string | Date): void {\n if (!value || !isValidDate(value)) {\n this.hours = '';\n this.minutes = '';\n this.seconds = '';\n this.meridian = this.meridians[0];\n this.meridianChange.emit(this.meridian);\n return;\n }\n\n const _value = parseTime(value);\n if (!_value) {\n return;\n }\n\n const _hoursPerDayHalf = 12;\n let _hours = _value.getHours();\n\n if (this.showMeridian) {\n this.meridian = this.meridians[_hours >= _hoursPerDayHalf ? 1 : 0];\n this.meridianChange.emit(this.meridian);\n _hours = _hours % _hoursPerDayHalf;\n // should be 12 PM, not 00 PM\n if (_hours === 0) {\n _hours = _hoursPerDayHalf;\n }\n }\n\n this.hours = padNumber(_hours);\n this.minutes = padNumber(_value.getMinutes());\n this.seconds = padNumber(_value.getUTCSeconds());\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { TimepickerComponent } from './timepicker.component';\nimport { TimepickerActions } from './reducer/timepicker.actions';\nimport { TimepickerStore } from './reducer/timepicker.store';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TimepickerComponent],\n exports: [TimepickerComponent],\n providers:[TimepickerStore]\n})\nexport class TimepickerModule {\n static forRoot(): ModuleWithProviders<TimepickerModule> {\n return {\n ngModule: TimepickerModule,\n providers: [TimepickerActions, TimepickerStore]\n };\n }\n}\n","/**\n * @copyright Valor Software\n * @copyright Angular ng-bootstrap team\n */\n\nimport { ComponentRef, ViewRef } from '@angular/core';\n\nexport class ContentRef {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n nodes: any[];\n viewRef?: ViewRef;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentRef?: ComponentRef<any>;\n\n constructor(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n nodes: any[],\n viewRef?: ViewRef,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentRef?: ComponentRef<any>\n ) {\n this.nodes = nodes;\n this.viewRef = viewRef;\n this.componentRef = componentRef;\n }\n}\n","// todo: add delay support\n// todo: merge events onShow, onShown, etc...\n// todo: add global positioning configuration?\nimport {\n ApplicationRef,\n ComponentFactory,\n ComponentFactoryResolver,\n ComponentRef,\n ElementRef,\n EmbeddedViewRef,\n EventEmitter,\n Injector,\n NgZone,\n Renderer2,\n StaticProvider,\n TemplateRef,\n Type,\n ViewContainerRef\n} from '@angular/core';\n\nimport { PositioningOptions, PositioningService } from 'ngx-bootstrap/positioning';\n\nimport { listenToTriggersV2, registerEscClick, registerOutsideClick } from 'ngx-bootstrap/utils';\nimport { Subscription } from 'rxjs';\n\nimport { ContentRef } from './content-ref.class';\nimport { ListenOptions } from './listen-options.model';\n\nexport class ComponentLoader<T> {\n onBeforeShow = new EventEmitter();\n onShown = new EventEmitter();\n onBeforeHide = new EventEmitter();\n onHidden = new EventEmitter();\n\n instance?: T;\n _componentRef?: ComponentRef<T>;\n _inlineViewRef?: EmbeddedViewRef<T>;\n\n private _providers: StaticProvider[] = [];\n private _componentFactory?: ComponentFactory<T>;\n private _zoneSubscription?: Subscription;\n private _contentRef?: ContentRef;\n private _innerComponent?: ComponentRef<T>;\n\n private _unregisterListenersFn?: () => void;\n private _isHiding = false;\n /**\n * Placement of a component. Accepts: \"top\", \"bottom\", \"left\", \"right\"\n */\n private attachment?: string;\n /**\n * A selector specifying the element the popover should be appended to.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private container: string | ElementRef | any;\n /**\n * A selector used if container element was not found\n */\n private containerDefaultSelector = 'body';\n /**\n * Specifies events that should trigger. Supports a space separated list of\n * event names.\n */\n private triggers?: string;\n private _listenOpts: ListenOptions = {};\n private _globalListener = Function.prototype;\n\n /**\n * Do not use this directly, it should be instanced via\n * `ComponentLoadFactory.attach`\n * @internal\n */\n public constructor(\n private _viewContainerRef: ViewContainerRef | undefined,\n private _renderer: Renderer2 | undefined,\n private _elementRef: ElementRef | undefined,\n private _injector: Injector,\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _ngZone: NgZone,\n private _applicationRef: ApplicationRef,\n private _posService: PositioningService,\n private _document: Document,\n ) {\n }\n\n get isShown(): boolean {\n if (this._isHiding) {\n return false;\n }\n\n return !!this._componentRef;\n }\n\n attach(compType: Type<T>): ComponentLoader<T> {\n this._componentFactory = this._componentFactoryResolver\n .resolveComponentFactory<T>(compType);\n\n return this;\n }\n\n // todo: add behaviour: to target element, `body`, custom element\n to(container?: string | ElementRef): ComponentLoader<T> {\n this.container = container || this.container;\n\n return this;\n }\n\n position(opts?: PositioningOptions): ComponentLoader<T> {\n if (!opts) {\n return this;\n }\n\n this.attachment = opts.attachment || this.attachment;\n this._elementRef = (opts.target as ElementRef) || this._elementRef;\n\n return this;\n }\n\n provide(provider: StaticProvider): ComponentLoader<T> {\n this._providers.push(provider);\n\n return this;\n }\n\n // todo: appendChild to element or document.querySelector(this.container)\n\n show(opts: {\n content?: string | TemplateRef<unknown>;\n context?: unknown;\n initialState?: unknown;\n [key: string]: unknown;\n id?: number | string;\n } = {}\n ): ComponentRef<T> | undefined {\n\n this._subscribePositioning();\n this._innerComponent = void 0;\n\n if (!this._componentRef) {\n this.onBeforeShow.emit();\n this._contentRef = this._getContentRef(opts.content, opts.context, opts.initialState);\n\n const injector = Injector.create({\n providers: this._providers,\n parent: this._injector\n });\n\n if (!this._componentFactory) {\n return;\n }\n\n this._componentRef = this._componentFactory.create(injector, this._contentRef.nodes);\n\n this._applicationRef.attachView(this._componentRef.hostView);\n // this._componentRef = this._viewContainerRef\n // .createComponent(this._componentFactory, 0, injector, this._contentRef.nodes);\n this.instance = this._componentRef.instance;\n\n Object.assign(this._componentRef.instance, opts);\n\n if (this.container instanceof ElementRef) {\n this.container.nativeElement.appendChild(\n this._componentRef.location.nativeElement\n );\n }\n\n if (typeof this.container === 'string' && typeof this._document !== 'undefined') {\n const selectedElement = this._document.querySelector(this.container) ||\n this._document.querySelector(this.containerDefaultSelector);\n\n if (!selectedElement) {\n return;\n }\n\n selectedElement.appendChild(this._componentRef.location.nativeElement);\n }\n\n if (\n !this.container &&\n this._elementRef &&\n this._elementRef.nativeElement.parentElement\n ) {\n this._elementRef.nativeElement.parentElement.appendChild(\n this._componentRef.location.nativeElement\n );\n }\n\n // we need to manually invoke change detection since events registered\n // via\n // Renderer::listen() are not picked up by change detection with the\n // OnPush strategy\n if (this._contentRef.componentRef) {\n this._innerComponent = this._contentRef.componentRef.instance;\n this._contentRef.componentRef.changeDetectorRef.markForCheck();\n this._contentRef.componentRef.changeDetectorRef.detectChanges();\n }\n this._componentRef.changeDetectorRef.markForCheck();\n this._componentRef.changeDetectorRef.detectChanges();\n\n\n this.onShown.emit(opts.id ? { id: opts.id } : this._componentRef.instance);\n }\n\n this._registerOutsideClick();\n\n return this._componentRef;\n }\n\n hide(id?: number | string): ComponentLoader<T> {\n if (!this._componentRef) {\n return this;\n }\n\n this._posService.deletePositionElement(this._componentRef.location);\n\n this.onBeforeHide.emit(this._componentRef.instance);\n\n const componentEl = this._componentRef.location.nativeElement;\n componentEl.parentNode?.removeChild(componentEl);\n\n this._contentRef?.componentRef?.destroy();\n\n if (this._viewContainerRef && this._contentRef?.viewRef) {\n this._viewContainerRef.remove(\n this._viewContainerRef.indexOf(this._contentRef.viewRef)\n );\n }\n this._contentRef?.viewRef?.destroy();\n\n this._contentRef = void 0;\n this._componentRef = void 0;\n this._removeGlobalListener();\n\n this.onHidden.emit(id ? { id } : null);\n\n return this;\n }\n\n toggle(): void {\n if (this.isShown) {\n this.hide();\n\n return;\n }\n\n this.show();\n }\n\n dispose(): void {\n if (this.isShown) {\n this.hide();\n }\n\n this._unsubscribePositioning();\n\n if (this._unregisterListenersFn) {\n this._unregisterListenersFn();\n }\n }\n\n listen(listenOpts: ListenOptions): ComponentLoader<T> {\n this.triggers = listenOpts.triggers || this.triggers;\n this._listenOpts.outsideClick = listenOpts.outsideClick;\n this._listenOpts.outsideEsc = listenOpts.outsideEsc;\n listenOpts.target = listenOpts.target || this._elementRef?.nativeElement;\n\n const hide = (this._listenOpts.hide = () =>\n listenOpts.hide ? listenOpts.hide() : void this.hide());\n const show = (this._listenOpts.show = (registerHide) => {\n listenOpts.show ? listenOpts.show(registerHide) : this.show(registerHide);\n registerHide();\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const toggle = (registerHide: any) => {\n this.isShown ? hide() : show(registerHide);\n };\n\n if (this._renderer) {\n this._unregisterListenersFn = listenToTriggersV2(this._renderer, {\n target: listenOpts.target,\n triggers: listenOpts.triggers,\n show,\n hide,\n toggle\n });\n }\n\n return this;\n }\n\n _removeGlobalListener() {\n if (this._globalListener) {\n this._globalListener();\n this._globalListener = Function.prototype;\n }\n }\n\n attachInline(\n vRef: ViewContainerRef | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n template: TemplateRef<any> | undefined\n ): ComponentLoader<T> {\n if (vRef && template) {\n this._inlineViewRef = vRef.createEmbeddedView(template);\n }\n\n return this;\n }\n\n _registerOutsideClick(): void {\n if (!this._componentRef || !this._componentRef.location) {\n return;\n }\n // why: should run after first event bubble\n if (this._listenOpts.outsideClick) {\n const target = this._componentRef.location.nativeElement;\n setTimeout(() => {\n if (this._renderer && this._elementRef) {\n this._globalListener = registerOutsideClick(this._renderer, {\n targets: [target, this._elementRef.nativeElement],\n outsideClick: this._listenOpts.outsideClick,\n hide: () => this._listenOpts.hide && this._listenOpts.hide()\n });\n }\n });\n }\n if (this._listenOpts.outsideEsc && this._renderer && this._elementRef) {\n const target = this._componentRef.location.nativeElement;\n this._globalListener = registerEscClick(this._renderer, {\n targets: [target, this._elementRef.nativeElement],\n outsideEsc: this._listenOpts.outsideEsc,\n hide: () => this._listenOpts.hide && this._listenOpts.hide()\n });\n }\n }\n\n getInnerComponent(): ComponentRef<T> | undefined {\n return this._innerComponent;\n }\n\n private _subscribePositioning(): void {\n if (this._zoneSubscription || !this.attachment) {\n return;\n }\n\n this.onShown.subscribe(() => {\n this._posService.position({\n element: this._componentRef?.location,\n target: this._elementRef,\n attachment: this.attachment,\n appendToBody: this.container === 'body'\n });\n });\n\n this._zoneSubscription = this._ngZone.onStable.subscribe(() => {\n if (!this._componentRef) {\n return;\n }\n\n this._posService.calcPosition();\n });\n }\n\n private _unsubscribePositioning(): void {\n if (!this._zoneSubscription) {\n return;\n }\n\n this._zoneSubscription.unsubscribe();\n this._zoneSubscription = void 0;\n }\n\n private _getContentRef(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n content: string | TemplateRef<any> | any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context?: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n initialState?: any\n ): ContentRef {\n if (!content) {\n return new ContentRef([]);\n }\n\n if (content instanceof TemplateRef) {\n if (this._viewContainerRef) {\n const _viewRef = this._viewContainerRef\n .createEmbeddedView<TemplateRef<T>>(content, context);\n _viewRef.markForCheck();\n\n return new ContentRef([_viewRef.rootNodes], _viewRef);\n }\n const viewRef = content.createEmbeddedView({});\n this._applicationRef.attachView(viewRef);\n\n return new ContentRef([viewRef.rootNodes], viewRef);\n }\n\n if (typeof content === 'function') {\n const contentCmptFactory = this._componentFactoryResolver.resolveComponentFactory(\n content\n );\n\n const modalContentInjector = Injector.create({\n providers: this._providers,\n parent: this._injector\n });\n\n const componentRef = contentCmptFactory.create(modalContentInjector);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Object.assign(componentRef.instance, initialState);\n this._applicationRef.attachView(componentRef.hostView);\n\n return new ContentRef(\n [[componentRef.location.nativeElement]],\n componentRef.hostView,\n componentRef\n );\n }\n\n const nodes = this._renderer\n ? [this._renderer.createText(`${content}`)]\n : [];\n return new ContentRef([nodes]);\n }\n}\n","import {\n ApplicationRef, ComponentFactoryResolver, ElementRef, Inject, Injectable, Injector,\n NgZone, Renderer2, ViewContainerRef\n} from '@angular/core';\nimport { ComponentLoader } from './component-loader.class';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\nimport { DOCUMENT } from '@angular/common';\n\n@Injectable({providedIn: 'root'})\nexport class ComponentLoaderFactory {\n constructor(private _componentFactoryResolver: ComponentFactoryResolver,\n private _ngZone: NgZone,\n private _injector: Injector,\n private _posService: PositioningService,\n private _applicationRef: ApplicationRef,\n @Inject(DOCUMENT) private _document: Document\n ) {}\n\n /**\n *\n * @param _elementRef\n * @param _viewContainerRef\n * @param _renderer\n */\n createLoader<T>(_elementRef?: ElementRef,\n _viewContainerRef?: ViewContainerRef,\n _renderer?: Renderer2,\n ): ComponentLoader<T> {\n return new ComponentLoader<T>(\n _viewContainerRef,\n _renderer,\n _elementRef,\n this._injector,\n this._componentFactoryResolver,\n this._ngZone,\n this._applicationRef,\n this._posService,\n this._document\n );\n }\n}\n","import { Injectable } from '@angular/core';\n\n/** Default values provider for tooltip */\n@Injectable({ providedIn: 'root' })\nexport class TooltipConfig {\n /** sets disable adaptive position */\n adaptivePosition = true;\n /** tooltip placement, supported positions: 'top', 'bottom', 'left', 'right' */\n placement = 'top';\n /** array of event names which triggers tooltip opening */\n triggers = 'hover focus';\n /** a selector specifying the element the tooltip should be appended to. */\n container?: string;\n /** delay before showing the tooltip */\n delay = 0;\n}\n","import {\n AfterViewInit,\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { TooltipConfig } from './tooltip.config';\nimport { getBsVer, IBsVersion } from 'ngx-bootstrap/utils';\nimport { PlacementForBs5 } from 'ngx-bootstrap/positioning';\n\n@Component({\n selector: 'bs-tooltip-container',\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[class]':\n '\"tooltip in tooltip-\" + placement + \" \" + \"bs-tooltip-\" + placement + \" \" + placement + \" \" + containerClass',\n '[class.show]': '!_bsVersions.isBs3',\n '[class.bs3]': '_bsVersions.isBs3',\n '[attr.id]': 'this.id',\n role: 'tooltip'\n },\n styles: [\n `\n :host.tooltip {\n display: block;\n pointer-events: none;\n }\n :host.bs3.tooltip.top>.arrow {\n margin-left: -2px;\n }\n :host.bs3.tooltip.bottom {\n margin-top: 0px;\n }\n :host.bs3.bs-tooltip-left, :host.bs3.bs-tooltip-right{\n margin: 0px;\n }\n :host.bs3.bs-tooltip-right .arrow, :host.bs3.bs-tooltip-left .arrow {\n margin: .3rem 0;\n }\n `\n ],\n template: `\n <div class=\"tooltip-arrow arrow\"></div>\n <div class=\"tooltip-inner\"><ng-content></ng-content></div>\n `\n})\nexport class TooltipContainerComponent implements AfterViewInit {\n classMap?: { [key: string]: boolean };\n placement?: string;\n containerClass?: string;\n animation?: boolean;\n id?: string;\n\n get _bsVersions(): IBsVersion {\n return getBsVer();\n }\n\n constructor(config: TooltipConfig) {\n Object.assign(this, config);\n }\n\n ngAfterViewInit(): void {\n this.classMap = { in: false, fade: false };\n if (this.placement) {\n if (this._bsVersions.isBs5) {\n this.placement = PlacementForBs5[this.placement as keyof typeof PlacementForBs5];\n }\n\n this.classMap[this.placement] = true;\n }\n this.classMap[`tooltip-${this.placement}`] = true;\n\n this.classMap[\"in\"] = true;\n if (this.animation) {\n this.classMap[\"fade\"] = true;\n }\n\n if (this.containerClass) {\n this.classMap[this.containerClass] = true;\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n TemplateRef,\n ViewContainerRef\n} from '@angular/core';\n\nimport { TooltipContainerComponent } from './tooltip-container.component';\nimport { TooltipConfig } from './tooltip.config';\n\nimport { ComponentLoader, ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\nimport { OnChange, warnOnce, parseTriggers, Trigger } from 'ngx-bootstrap/utils';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\n\nimport { timer, Subscription } from 'rxjs';\nimport { AvailbleBSPositions } from 'ngx-bootstrap/positioning';\n\nlet id = 0;\n\n@Directive({\n selector: '[tooltip], [tooltipHtml]',\n exportAs: 'bs-tooltip'\n})\nexport class TooltipDirective implements OnInit, OnDestroy {\n tooltipId = id++;\n /** sets disable adaptive position */\n @Input() adaptivePosition = true;\n /**\n * Content to be displayed as tooltip.\n */\n @OnChange()\n @Input()\n tooltip?: string | TemplateRef<unknown>;\n /** Fired when tooltip content changes */\n @Output()\n tooltipChange: EventEmitter<string | TemplateRef<unknown>> = new EventEmitter();\n\n /**\n * Placement of a tooltip. Accepts: \"top\", \"bottom\", \"left\", \"right\"\n */\n @Input() placement: AvailbleBSPositions = 'top';\n /**\n * Specifies events that should trigger. Supports a space separated list of\n * event names.\n */\n @Input() triggers = 'hover focus';\n /**\n * A selector specifying the element the tooltip should be appended to.\n */\n @Input() container?: string;\n /**\n * Css class for tooltip container\n */\n @Input() containerClass = '';\n @Input() boundariesElement?: ('viewport' | 'scrollParent' | 'window');\n /**\n * Returns whether or not the tooltip is currently being shown\n */\n @Input()\n get isOpen(): boolean {\n return this._tooltip.isShown;\n }\n\n set isOpen(value: boolean) {\n if (value) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Allows to disable tooltip\n */\n @Input() isDisabled = false;\n\n /**\n * Delay before showing the tooltip\n */\n @Input() delay = 0;\n\n /**\n * Emits an event when the tooltip is shown\n */\n @Output() onShown: EventEmitter<unknown>;\n /**\n * Emits an event when the tooltip is hidden\n */\n @Output() onHidden: EventEmitter<unknown>;\n\n /** @deprecated - please use `tooltip` instead */\n @Input('tooltipHtml')\n set htmlContent(value: string | TemplateRef<unknown>) {\n warnOnce('tooltipHtml was deprecated, please use `tooltip` instead');\n this.tooltip = value;\n }\n\n /** @deprecated - please use `placement` instead */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipPlacement')\n set _placement(value: AvailbleBSPositions) {\n warnOnce('tooltipPlacement was deprecated, please use `placement` instead');\n this.placement = value;\n }\n\n /** @deprecated - please use `isOpen` instead */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipIsOpen')\n set _isOpen(value: boolean) {\n warnOnce('tooltipIsOpen was deprecated, please use `isOpen` instead');\n this.isOpen = value;\n }\n\n get _isOpen(): boolean {\n warnOnce('tooltipIsOpen was deprecated, please use `isOpen` instead');\n\n return this.isOpen;\n }\n\n /** @deprecated - please use `isDisabled` instead */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipEnable')\n set _enable(value: boolean) {\n warnOnce('tooltipEnable was deprecated, please use `isDisabled` instead');\n this.isDisabled = !value;\n }\n\n get _enable(): boolean {\n warnOnce('tooltipEnable was deprecated, please use `isDisabled` instead');\n\n return this.isDisabled;\n }\n\n /** @deprecated - please use `container=\"body\"` instead */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipAppendToBody')\n set _appendToBody(value: boolean) {\n warnOnce(\n 'tooltipAppendToBody was deprecated, please use `container=\"body\"` instead'\n );\n this.container = value ? 'body' : this.container;\n }\n\n get _appendToBody(): boolean {\n warnOnce(\n 'tooltipAppendToBody was deprecated, please use `container=\"body\"` instead'\n );\n\n return this.container === 'body';\n }\n\n /** @deprecated - removed, will be added to configuration */\n @Input() tooltipAnimation = true;\n\n /** @deprecated - will replaced with customClass */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipClass')\n set _popupClass(value: string) {\n warnOnce('tooltipClass deprecated');\n }\n\n /** @deprecated - removed */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipContext')\n set _tooltipContext(value: undefined) {\n warnOnce('tooltipContext deprecated');\n }\n\n /** @deprecated */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('tooltipPopupDelay')\n set _tooltipPopupDelay(value: number) {\n warnOnce('tooltipPopupDelay is deprecated, use `delay` instead');\n this.delay = value;\n }\n\n /** @deprecated */\n @Input() tooltipFadeDuration = 150;\n\n /** @deprecated - please use `triggers` instead */\n @Input('tooltipTrigger')\n get _tooltipTrigger(): string | string[] {\n warnOnce('tooltipTrigger was deprecated, please use `triggers` instead');\n\n return this.triggers;\n }\n\n set _tooltipTrigger(value: string | string[]) {\n warnOnce('tooltipTrigger was deprecated, please use `triggers` instead');\n this.triggers = (value || '').toString();\n }\n\n /** @deprecated */\n @Output()\n tooltipStateChanged: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n protected _delayTimeoutId?: number;\n protected _tooltipCancelShowFn?: () => void;\n\n private _tooltip: ComponentLoader<TooltipContainerComponent>;\n private _delaySubscription?: Subscription;\n private _ariaDescribedby?: string;\n constructor(\n _viewContainerRef: ViewContainerRef,\n cis: ComponentLoaderFactory,\n config: TooltipConfig,\n private _elementRef: ElementRef,\n private _renderer: Renderer2,\n private _positionService: PositioningService\n ) {\n\n this._tooltip = cis\n .createLoader<TooltipContainerComponent>(\n this._elementRef,\n _viewContainerRef,\n this._renderer\n )\n .provide({provide: TooltipConfig, useValue: config});\n\n Object.assign(this, config);\n this.onShown = this._tooltip.onShown;\n this.onHidden = this._tooltip.onHidden;\n }\n\n ngOnInit(): void {\n this._tooltip.listen({\n triggers: this.triggers,\n show: () => this.show()\n });\n this.tooltipChange.subscribe((value) => {\n if (!value) {\n this._tooltip.hide();\n }\n });\n\n this.onShown.subscribe(() => {\n this.setAriaDescribedBy();\n });\n\n this.onHidden.subscribe(() => {\n this.setAriaDescribedBy();\n });\n }\n\n setAriaDescribedBy(): void {\n this._ariaDescribedby = this.isOpen ? `tooltip-${this.tooltipId}` : void 0;\n\n if (this._ariaDescribedby) {\n this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ariaDescribedby);\n } else {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n }\n }\n\n /**\n * Toggles an element’s tooltip. This is considered a “manual†triggering of\n * the tooltip.\n */\n toggle(): void {\n if (this.isOpen) {\n return this.hide();\n }\n\n this.show();\n }\n\n /**\n * Opens an element’s tooltip. This is considered a “manual†triggering of\n * the tooltip.\n */\n show(): void {\n this._positionService.setOptions({\n modifiers: {\n flip: {\n enabled: this.adaptivePosition\n },\n preventOverflow: {\n enabled: this.adaptivePosition,\n boundariesElement: this.boundariesElement || 'scrollParent'\n }\n }\n });\n\n if (\n this.isOpen ||\n this.isDisabled ||\n this._delayTimeoutId ||\n !this.tooltip\n ) {\n return;\n }\n\n const showTooltip = () => {\n if (this._delayTimeoutId) {\n this._delayTimeoutId = undefined;\n }\n\n this._tooltip\n .attach(TooltipContainerComponent)\n .to(this.container)\n .position({attachment: this.placement})\n .show({\n content: this.tooltip,\n placement: this.placement,\n containerClass: this.containerClass,\n id: `tooltip-${this.tooltipId}`\n });\n };\n const cancelDelayedTooltipShowing = () => {\n if (this._tooltipCancelShowFn) {\n this._tooltipCancelShowFn();\n }\n };\n\n if (this.delay) {\n if (this._delaySubscription) {\n this._delaySubscription.unsubscribe();\n }\n\n this._delaySubscription = timer(this.delay).subscribe(() => {\n showTooltip();\n cancelDelayedTooltipShowing();\n });\n\n if (this.triggers) {\n parseTriggers(this.triggers)\n .forEach((trigger: Trigger) => {\n if (!trigger.close) {\n return;\n }\n this._tooltipCancelShowFn = this._renderer.listen(\n this._elementRef.nativeElement,\n trigger.close,\n () => {\n this._delaySubscription?.unsubscribe();\n cancelDelayedTooltipShowing();\n }\n );\n });\n }\n } else {\n showTooltip();\n }\n }\n\n /**\n * Closes an element’s tooltip. This is considered a “manual†triggering of\n * the tooltip.\n */\n hide(): void {\n if (this._delayTimeoutId) {\n clearTimeout(this._delayTimeoutId);\n this._delayTimeoutId = undefined;\n }\n\n if (!this._tooltip.isShown) {\n return;\n }\n\n if (this._tooltip.instance?.classMap) {\n this._tooltip.instance.classMap[\"in\"] = false;\n }\n\n setTimeout(() => {\n this._tooltip.hide();\n }, this.tooltipFadeDuration);\n }\n\n ngOnDestroy(): void {\n this._tooltip.dispose();\n this.tooltipChange.unsubscribe();\n if (this._delaySubscription) {\n this._delaySubscription.unsubscribe();\n }\n this.onShown.unsubscribe();\n this.onHidden.unsubscribe();\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule, ModuleWithProviders } from '@angular/core';\nimport { TooltipContainerComponent } from './tooltip-container.component';\nimport { TooltipDirective } from './tooltip.directive';\nimport { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TooltipDirective, TooltipContainerComponent],\n exports: [TooltipDirective]\n})\nexport class TooltipModule {\n static forRoot(): ModuleWithProviders<TooltipModule> {\n return {\n ngModule: TooltipModule,\n providers: [ComponentLoaderFactory, PositioningService]\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n DatepickerRenderOptions,\n BsDatepickerViewMode,\n DatepickerDateCustomClasses,\n DatepickerDateTooltipText\n} from './models';\nimport { BsCustomDates } from './themes/bs/bs-custom-dates-view.component';\n\n\n/**\n * For date range picker there are `BsDaterangepickerConfig` which inherits all properties,\n * except `displayMonths`, for range picker it default to `2`\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class BsDatepickerConfig implements DatepickerRenderOptions {\n /** sets use adaptive position */\n adaptivePosition = false;\n /** sets use UTC date time format */\n useUtc = false;\n /** turn on/off animation */\n isAnimated = false;\n value?: Date | Date[];\n isDisabled?: boolean;\n /**\n * Default min date for all date/range pickers\n */\n minDate?: Date;\n /**\n * Default max date for all date/range pickers\n */\n maxDate?: Date;\n /**\n * The view that the datepicker should start in\n */\n startView: BsDatepickerViewMode = 'day';\n /**\n * Default date custom classes for all date/range pickers\n */\n dateCustomClasses?: DatepickerDateCustomClasses[];\n /**\n * Default tooltip text for all date/range pickers\n */\n dateTooltipTexts?: DatepickerDateTooltipText[];\n /**\n * Disable specific days, e.g. [0,6] will disable all Saturdays and Sundays\n */\n daysDisabled?: number[];\n /**\n * Disable specific dates\n */\n datesDisabled?: Date[];\n /**\n * Show one months for special cases (only for dateRangePicker)\n * 1. maxDate is equal to today's date\n * 2. minDate's month is equal to maxDate's month\n */\n displayOneMonthRange?: boolean;\n /**\n * Enable specific dates\n */\n datesEnabled?: Date[];\n /**\n * Makes dates from other months active\n */\n selectFromOtherMonth?: boolean;\n\n /**\n * Allows select first date of the week by click on week number\n */\n selectWeek?: boolean;\n\n /**\n * Allows select daterange as first and last day of week by click on week number (dateRangePicker only)\n */\n selectWeekDateRange?: boolean;\n\n /**\n * Shows previous and current month, instead of current and next (dateRangePicker only)\n */\n showPreviousMonth?: boolean;\n\n /**\n * Prevents change to next month for right calendar in two calendars view (dateRangePicker only)\n */\n preventChangeToNextMonth?: boolean;\n\n /**\n * Add class to current day\n */\n customTodayClass?: string;\n\n /**\n * Default mode for all date pickers\n */\n minMode?: BsDatepickerViewMode;\n\n /**\n * If true, returns focus to the datepicker / daterangepicker input after date selection\n */\n returnFocusToInput = false;\n\n /** CSS class which will be applied to datepicker container,\n * usually used to set color theme\n */\n containerClass = 'theme-green';\n\n // DatepickerRenderOptions\n displayMonths = 1;\n /**\n * Allows to hide week numbers in datepicker\n */\n showWeekNumbers = true;\n\n dateInputFormat = 'L';\n // range picker\n rangeSeparator = ' - ';\n /**\n * Date format for date range input field\n */\n rangeInputFormat = 'L';\n\n /**\n * Predefined ranges\n */\n ranges?: BsCustomDates[];\n\n /**\n * Max Date Range in days\n */\n maxDateRange?: number;\n\n // DatepickerFormatOptions\n monthTitle = 'MMMM';\n yearTitle = 'YYYY';\n dayLabel = 'D';\n monthLabel = 'MMMM';\n yearLabel = 'YYYY';\n weekNumbers = 'w';\n\n /**\n * Shows 'today' button\n */\n showTodayButton = false;\n\n /**\n * Shows clear button\n */\n showClearButton = false;\n\n /**\n * Positioning of 'today' button\n */\n todayPosition = 'center';\n\n /**\n * Positioning of 'clear' button\n */\n clearPosition = 'right';\n\n /**\n * Label for 'today' button\n */\n todayButtonLabel = 'Today';\n\n /**\n * Label for 'clear' button\n */\n clearButtonLabel = 'Clear';\n\n /**\n * Label for 'custom range' button\n */\n customRangeButtonLabel = 'Custom Range';\n\n /**\n * Shows timepicker under datepicker\n */\n withTimepicker = false;\n /**\n * Set current hours, minutes, seconds and milliseconds for bsValue\n */\n initCurrentTime?: boolean;\n /**\n * Set allowed positions of container.\n */\n allowedPositions = ['top', 'bottom'];\n}\n","<!-- days calendar view mode -->\n<div class=\"bs-datepicker\" [ngClass]=\"containerClass\" *ngIf=\"viewMode | async\">\n <div class=\"bs-datepicker-container\"\n [@datepickerAnimation]=\"animationState\"\n (@datepickerAnimation.done)=\"positionServiceEnable()\">\n <!--calendars-->\n <div class=\"bs-calendar-container\" [ngSwitch]=\"viewMode | async\" role=\"application\">\n <!--days calendar-->\n <ng-container *ngSwitchCase=\"'day'\">\n <div class=\"bs-media-container\">\n <bs-days-calendar-view\n *ngFor=\"let calendar of daysCalendar$ | async\"\n [class.bs-datepicker-multiple]=\"multipleCalendars\"\n [calendar]=\"calendar\"\n [options]=\"options$ | async\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"setViewMode($event)\"\n (onHover)=\"dayHoverHandler($event)\"\n (onHoverWeek)=\"weekHoverHandler($event)\"\n (onSelect)=\"daySelectHandler($event)\">\n </bs-days-calendar-view>\n </div>\n <div *ngIf=\"withTimepicker\" class=\"bs-timepicker-in-datepicker-container\">\n <timepicker #startTP></timepicker>\n <timepicker #endTP *ngIf=\"isRangePicker\"></timepicker>\n </div>\n </ng-container>\n\n <!--months calendar-->\n <div *ngSwitchCase=\"'month'\" class=\"bs-media-container\">\n <bs-month-calendar-view\n *ngFor=\"let calendar of monthsCalendar | async\"\n [class.bs-datepicker-multiple]=\"multipleCalendars\"\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"setViewMode($event)\"\n (onHover)=\"monthHoverHandler($event)\"\n (onSelect)=\"monthSelectHandler($event)\">\n </bs-month-calendar-view>\n </div>\n\n <!--years calendar-->\n <div *ngSwitchCase=\"'year'\" class=\"bs-media-container\">\n <bs-years-calendar-view\n *ngFor=\"let calendar of yearsCalendar | async\"\n [class.bs-datepicker-multiple]=\"multipleCalendars\"\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"setViewMode($event)\"\n (onHover)=\"yearHoverHandler($event)\"\n (onSelect)=\"yearSelectHandler($event)\">\n </bs-years-calendar-view>\n </div>\n </div>\n\n <!--applycancel buttons-->\n <div class=\"bs-datepicker-buttons\" *ngIf=\"false\">\n <button class=\"btn btn-success\" type=\"button\">Apply</button>\n <button class=\"btn btn-default\" type=\"button\">Cancel</button>\n </div>\n\n <div class=\"bs-datepicker-buttons\" *ngIf=\"showTodayBtn || showClearBtn\">\n <div class=\"btn-today-wrapper\"\n [class.today-left]=\"todayPos === 'left'\"\n [class.today-right]=\"todayPos === 'right'\"\n [class.today-center]=\"todayPos === 'center'\"\n *ngIf=\"showTodayBtn\">\n <button class=\"btn btn-success\" (click)=\"setToday()\">{{todayBtnLbl}}</button>\n </div>\n\n <div class=\"btn-clear-wrapper\"\n [class.clear-left]=\"clearPos === 'left'\"\n [class.clear-right]=\"clearPos === 'right'\"\n [class.clear-center]=\"clearPos === 'center'\"\n *ngIf=\"showClearBtn\">\n <button class=\"btn btn-success\" (click)=\"clearDate()\">{{clearBtnLbl}}</button>\n </div>\n </div>\n\n </div>\n\n <!--custom dates or date ranges picker-->\n <div class=\"bs-datepicker-custom-range\" *ngIf=\"customRanges && customRanges.length > 0\">\n <bs-custom-date-view\n [selectedRange]=\"chosenRange\"\n [ranges]=\"customRanges\"\n [customRangeLabel]=\"customRangeBtnLbl\"\n (onSelect)=\"setRangeOnCalendar($event)\">\n </bs-custom-date-view>\n </div>\n</div>\n","import {\n animate,\n style,\n AnimationTriggerMetadata,\n state,\n transition,\n trigger\n} from '@angular/animations';\n\nexport const DATEPICKER_ANIMATION_TIMING = '220ms cubic-bezier(0, 0, 0.2, 1)';\n\nexport const datepickerAnimation: AnimationTriggerMetadata =\n trigger('datepickerAnimation', [\n state('animated-down', style({ height: '*', overflow: 'hidden'})),\n transition('* => animated-down', [\n style({ height: 0, overflow: 'hidden' }),\n animate(DATEPICKER_ANIMATION_TIMING)\n ]),\n state('animated-up', style({ height: '*', overflow: 'hidden'})),\n transition('* => animated-up', [\n style({ height: '*', overflow: 'hidden' }),\n animate(DATEPICKER_ANIMATION_TIMING)\n ]),\n transition('* => unanimated', animate('0s'))\n ]);\n","// datepicker container component\nimport { BsCustomDates } from '../themes/bs/bs-custom-dates-view.component';\nimport { BsDatepickerEffects } from '../reducer/bs-datepicker.effects';\nimport { Observable, Subscription } from 'rxjs';\nimport {\n BsDatepickerViewMode,\n BsNavigationEvent,\n CalendarCellViewModel,\n CellHoverEvent,\n DatepickerRenderOptions,\n DatepickerDateCustomClasses,\n DatepickerDateTooltipText,\n DaysCalendarViewModel,\n DayViewModel,\n MonthsCalendarViewModel,\n WeekViewModel,\n YearsCalendarViewModel\n} from '../models';\n\nexport abstract class BsDatepickerAbstractComponent {\n containerClass = '';\n isOtherMonthsActive?: boolean;\n showTodayBtn?: boolean;\n todayBtnLbl?: string;\n todayPos?: string;\n showClearBtn?: boolean;\n clearBtnLbl?: string;\n clearPos?: string;\n\n _effects?: BsDatepickerEffects;\n customRanges: BsCustomDates[] = [];\n customRangeBtnLbl?: string;\n chosenRange: Date[] = [];\n\n multipleCalendars?: boolean;\n\n isRangePicker?: boolean;\n withTimepicker?: boolean;\n\n set minDate(value: Date|undefined) {\n this._effects?.setMinDate(value);\n }\n\n set maxDate(value: Date|undefined) {\n this._effects?.setMaxDate(value);\n }\n set daysDisabled(value: number[]|undefined) {\n this._effects?.setDaysDisabled(value);\n }\n set datesDisabled(value: Date[]|undefined) {\n this._effects?.setDatesDisabled(value);\n }\n\n set datesEnabled(value: Date[]|undefined) {\n this._effects?.setDatesEnabled(value);\n }\n\n set isDisabled(value: boolean|undefined) {\n this._effects?.setDisabled(value);\n }\n\n set dateCustomClasses(value: DatepickerDateCustomClasses[]|undefined) {\n this._effects?.setDateCustomClasses(value);\n }\n\n set dateTooltipTexts(value: DatepickerDateTooltipText[]|undefined) {\n this._effects?.setDateTooltipTexts(value);\n }\n\n viewMode?: Observable<BsDatepickerViewMode|undefined>;\n monthsCalendar?: Observable<MonthsCalendarViewModel[]|undefined>;\n yearsCalendar?: Observable<YearsCalendarViewModel[]|undefined>;\n options$!: Observable<DatepickerRenderOptions|undefined>;\n\n _daysCalendar$!: Observable<DaysCalendarViewModel[]|undefined>;\n _daysCalendarSub = new Subscription();\n\n set daysCalendar$(value: Observable<DaysCalendarViewModel[]|undefined>) {\n this._daysCalendar$ = value;\n this._daysCalendarSub.unsubscribe();\n this._daysCalendarSub.add(this._daysCalendar$.subscribe(value => {\n this.multipleCalendars = !!value && value.length > 1;\n }));\n }\n\n get daysCalendar$(): Observable<DaysCalendarViewModel[]|undefined> {\n return this._daysCalendar$;\n }\n\n selectedTime?: Observable<Date[]|undefined>;\n selectedTimeSub = new Subscription();\n\n // todo: valorkin fix\n // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function\n setViewMode(event: BsDatepickerViewMode): void {}\n\n // eslint-disable-next-line\n navigateTo(event: BsNavigationEvent): void {}\n\n // eslint-disable-next-line\n dayHoverHandler(event: CellHoverEvent): void {}\n\n // eslint-disable-next-line\n weekHoverHandler(event: WeekViewModel): void {}\n\n // eslint-disable-next-line\n monthHoverHandler(event: CellHoverEvent): void {}\n\n // eslint-disable-next-line\n yearHoverHandler(event: CellHoverEvent): void {}\n\n // eslint-disable-next-line\n timeSelectHandler(date: Date, index: number): void {}\n\n // eslint-disable-next-line\n daySelectHandler(day: DayViewModel): void {}\n\n // eslint-disable-next-line\n monthSelectHandler(event: CalendarCellViewModel): void {}\n\n // eslint-disable-next-line\n yearSelectHandler(event: CalendarCellViewModel): void {}\n\n // eslint-disable-next-line\n setRangeOnCalendar(dates: BsCustomDates): void {}\n\n // eslint-disable-next-line\n setToday(): void {}\n\n // eslint-disable-next-line\n clearDate(): void {}\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _stopPropagation(event: any): void {\n event.stopPropagation();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { TimeUnit } from 'ngx-bootstrap/chronos';\nimport { Action } from 'ngx-bootstrap/mini-ngrx';\nimport {\n BsDatepickerViewMode,\n BsViewNavigationEvent,\n CellHoverEvent,\n DatepickerRenderOptions,\n DatepickerDateCustomClasses,\n DatepickerDateTooltipText\n} from '../models';\n\n@Injectable({providedIn: 'platform'})\nexport class BsDatepickerActions {\n static readonly CALCULATE = '[datepicker] calculate dates matrix';\n static readonly FORMAT = '[datepicker] format datepicker values';\n static readonly FLAG = '[datepicker] set flags';\n static readonly SELECT = '[datepicker] select date';\n static readonly NAVIGATE_OFFSET = '[datepicker] shift view date';\n static readonly NAVIGATE_TO = '[datepicker] change view date';\n static readonly SET_OPTIONS = '[datepicker] update render options';\n static readonly HOVER = '[datepicker] hover date';\n static readonly CHANGE_VIEWMODE = '[datepicker] switch view mode';\n\n static readonly SET_MIN_DATE = '[datepicker] set min date';\n static readonly SET_MAX_DATE = '[datepicker] set max date';\n static readonly SET_DAYSDISABLED = '[datepicker] set days disabled';\n static readonly SET_DATESDISABLED = '[datepicker] set dates disabled';\n static readonly SET_DATESENABLED = '[datepicker] set dates enabled';\n static readonly SET_IS_DISABLED = '[datepicker] set is disabled';\n static readonly SET_DATE_CUSTOM_CLASSES = '[datepicker] set date custom classes';\n static readonly SET_DATE_TOOLTIP_TEXTS = '[datepicker] set date tooltip texts';\n static readonly SET_LOCALE = '[datepicker] set datepicker locale';\n static readonly SELECT_TIME = '[datepicker] select time';\n\n static readonly SELECT_RANGE = '[daterangepicker] select dates range';\n\n calculate(): Action {\n return { type: BsDatepickerActions.CALCULATE };\n }\n\n format(): Action {\n return { type: BsDatepickerActions.FORMAT };\n }\n\n flag(): Action {\n return { type: BsDatepickerActions.FLAG };\n }\n\n select(date?: Date): Action {\n return {\n type: BsDatepickerActions.SELECT,\n payload: date\n };\n }\n\n selectTime(date: Date, index: number): Action {\n return {\n type: BsDatepickerActions.SELECT_TIME,\n payload: { date, index },\n };\n }\n\n changeViewMode(event: BsDatepickerViewMode): Action {\n return {\n type: BsDatepickerActions.CHANGE_VIEWMODE,\n payload: event\n };\n }\n\n navigateTo(event: BsViewNavigationEvent): Action {\n return {\n type: BsDatepickerActions.NAVIGATE_TO,\n payload: event\n };\n }\n\n navigateStep(step?: TimeUnit): Action {\n return {\n type: BsDatepickerActions.NAVIGATE_OFFSET,\n payload: step\n };\n }\n\n setOptions(options: DatepickerRenderOptions): Action {\n return {\n type: BsDatepickerActions.SET_OPTIONS,\n payload: options\n };\n }\n\n // date range picker\n selectRange(value?: (Date|undefined)[] | undefined): Action {\n return {\n type: BsDatepickerActions.SELECT_RANGE,\n payload: value\n };\n }\n\n hoverDay(event: CellHoverEvent): Action {\n return {\n type: BsDatepickerActions.HOVER,\n payload: event.isHovered ? event.cell.date : null\n };\n }\n\n minDate(date?: Date): Action {\n return {\n type: BsDatepickerActions.SET_MIN_DATE,\n payload: date\n };\n }\n\n maxDate(date?: Date): Action {\n return {\n type: BsDatepickerActions.SET_MAX_DATE,\n payload: date\n };\n }\n\n daysDisabled(days?: number[]): Action {\n return {\n type: BsDatepickerActions.SET_DAYSDISABLED,\n payload: days\n };\n }\n\n datesDisabled(dates?: Date[]): Action {\n return {\n type: BsDatepickerActions.SET_DATESDISABLED,\n payload: dates\n };\n }\n\n datesEnabled(dates?: Date[]): Action {\n return {\n type: BsDatepickerActions.SET_DATESENABLED,\n payload: dates\n };\n }\n\n isDisabled(value?: boolean): Action {\n return {\n type: BsDatepickerActions.SET_IS_DISABLED,\n payload: value\n };\n }\n\n setDateCustomClasses(value?: DatepickerDateCustomClasses[]): Action {\n return {\n type: BsDatepickerActions.SET_DATE_CUSTOM_CLASSES,\n payload: value\n };\n }\n\n setDateTooltipTexts(value?: DatepickerDateTooltipText[]): Action {\n return {\n type: BsDatepickerActions.SET_DATE_TOOLTIP_TEXTS,\n payload: value\n };\n }\n\n setLocale(locale: string): Action {\n return {\n type: BsDatepickerActions.SET_LOCALE,\n payload: locale\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n@Injectable({providedIn: 'platform'})\nexport class BsLocaleService {\n private _defaultLocale = 'en';\n private _locale = new BehaviorSubject<string>(this._defaultLocale);\n private _localeChange: Observable<string> = this._locale.asObservable();\n\n get locale(): BehaviorSubject<string> {\n return this._locale;\n }\n\n get localeChange(): Observable<string> {\n return this._localeChange;\n }\n\n get currentLocale(): string {\n return this._locale.getValue();\n }\n\n use(locale: string): void {\n if (locale === this.currentLocale) {\n return;\n }\n\n this._locale.next(locale);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\nimport { BsDatepickerAbstractComponent } from '../base/bs-datepicker-container';\nimport { BsDatepickerConfig } from '../bs-datepicker.config';\nimport { BsLocaleService } from '../bs-locale.service';\n\nimport {\n BsDatepickerViewMode,\n BsNavigationEvent,\n CellHoverEvent,\n DatepickerDateCustomClasses,\n DatepickerDateTooltipText,\n DatepickerRenderOptions,\n DaysCalendarViewModel,\n DayViewModel,\n MonthsCalendarViewModel,\n YearsCalendarViewModel\n} from '../models';\nimport { BsDatepickerActions } from './bs-datepicker.actions';\nimport { BsDatepickerStore } from './bs-datepicker.store';\n\n\n@Injectable({providedIn: 'platform'})\nexport class BsDatepickerEffects {\n viewMode?: Observable<BsDatepickerViewMode>;\n daysCalendar?: Observable<DaysCalendarViewModel[]>;\n monthsCalendar?: Observable<MonthsCalendarViewModel[]>;\n yearsCalendar?: Observable<YearsCalendarViewModel[]>;\n options?: Observable<DatepickerRenderOptions>;\n\n private _store?: BsDatepickerStore;\n private _subs: Subscription[] = [];\n\n constructor(private _actions: BsDatepickerActions,\n private _localeService: BsLocaleService) {\n }\n\n init(_bsDatepickerStore: BsDatepickerStore): BsDatepickerEffects {\n this._store = _bsDatepickerStore;\n\n return this;\n }\n\n /** setters */\n\n setValue(value?: Date): void {\n this._store?.dispatch(this._actions.select(value));\n }\n\n setRangeValue(value?: (Date|undefined)[] | undefined): void {\n this._store?.dispatch(this._actions.selectRange(value));\n }\n\n setMinDate(value?: Date): BsDatepickerEffects {\n this._store?.dispatch(this._actions.minDate(value));\n\n return this;\n }\n\n setMaxDate(value?: Date): BsDatepickerEffects {\n this._store?.dispatch(this._actions.maxDate(value));\n\n return this;\n }\n\n setDaysDisabled(value?: number[]): BsDatepickerEffects {\n this._store?.dispatch(this._actions.daysDisabled(value));\n\n return this;\n }\n\n setDatesDisabled(value?: Date[]): BsDatepickerEffects {\n this._store?.dispatch(this._actions.datesDisabled(value));\n\n return this;\n }\n\n setDatesEnabled(value?: Date[]): BsDatepickerEffects {\n this._store?.dispatch(this._actions.datesEnabled(value));\n\n return this;\n }\n\n setDisabled(value?: boolean): BsDatepickerEffects {\n this._store?.dispatch(this._actions.isDisabled(value));\n\n return this;\n }\n\n setDateCustomClasses(value?: DatepickerDateCustomClasses[]): BsDatepickerEffects {\n this._store?.dispatch(this._actions.setDateCustomClasses(value));\n\n return this;\n }\n\n setDateTooltipTexts(value?: DatepickerDateTooltipText[]): BsDatepickerEffects {\n this._store?.dispatch(this._actions.setDateTooltipTexts(value));\n\n return this;\n }\n\n /* Set rendering options */\n setOptions(_config: BsDatepickerConfig): BsDatepickerEffects {\n const _options = Object.assign({ locale: this._localeService.currentLocale }, _config);\n this._store?.dispatch(this._actions.setOptions(_options));\n\n return this;\n }\n\n /** view to mode bindings */\n setBindings(container: BsDatepickerAbstractComponent): BsDatepickerEffects {\n if (!this._store) {\n return this;\n }\n\n container.selectedTime = this._store.select(state => state.selectedTime)\n .pipe(filter(times => !!times));\n\n container.daysCalendar$ = this._store.select(state => state.flaggedMonths)\n .pipe(filter(months => !!months));\n\n // month calendar\n container.monthsCalendar = this._store.select(state => state.flaggedMonthsCalendar)\n .pipe(filter(months => !!months));\n\n // year calendar\n container.yearsCalendar = this._store.select(state => state.yearsCalendarFlagged)\n .pipe(filter(years => !!years));\n\n container.viewMode = this._store.select(state => state.view?.mode);\n\n container.options$ = combineLatest([\n this._store.select(state => state.showWeekNumbers),\n this._store.select(state => state.displayMonths)\n ])\n .pipe(map((latest) => ({\n showWeekNumbers: latest[0],\n displayMonths: latest[1]\n })\n ));\n\n return this;\n }\n\n /** event handlers */\n setEventHandlers(container: BsDatepickerAbstractComponent): BsDatepickerEffects {\n container.setViewMode = (event: BsDatepickerViewMode): void => {\n this._store?.dispatch(this._actions.changeViewMode(event));\n };\n\n container.navigateTo = (event: BsNavigationEvent): void => {\n this._store?.dispatch(this._actions.navigateStep(event.step));\n };\n\n container.dayHoverHandler = (event: CellHoverEvent): void => {\n const _cell = event.cell as DayViewModel;\n if (_cell.isOtherMonth || _cell.isDisabled) {\n return;\n }\n\n this._store?.dispatch(this._actions.hoverDay(event));\n _cell.isHovered = event.isHovered;\n };\n\n container.monthHoverHandler = (event: CellHoverEvent): void => {\n event.cell.isHovered = event.isHovered;\n };\n\n container.yearHoverHandler = (event: CellHoverEvent): void => {\n event.cell.isHovered = event.isHovered;\n };\n\n return this;\n }\n\n registerDatepickerSideEffects(): BsDatepickerEffects {\n if (!this._store) {\n return this;\n }\n\n this._subs.push(\n this._store.select(state => state.view).subscribe(() => {\n this._store?.dispatch(this._actions.calculate());\n })\n );\n\n // format calendar values on month model change\n this._subs.push(\n this._store\n .select(state => state.monthsModel)\n .pipe(\n filter(monthModel => !!monthModel)\n )\n .subscribe(() => this._store?.dispatch(this._actions.format()))\n );\n\n // flag day values\n this._subs.push(\n this._store\n .select(state => state.formattedMonths)\n .pipe(\n filter(month => !!month)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // flag day values\n this._subs.push(\n this._store\n .select(state => state.selectedDate)\n .pipe(\n filter(selectedDate => !!selectedDate)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // flag for date range picker\n this._subs.push(\n this._store\n .select(state => state.selectedRange)\n .pipe(\n filter(selectedRange => !!selectedRange)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // monthsCalendar\n this._subs.push(\n this._store\n .select(state => state.monthsCalendar)\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // years calendar\n this._subs.push(\n this._store\n .select(state => state.yearsCalendarModel)\n .pipe(\n filter(state => !!state)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // on hover\n this._subs.push(\n this._store\n .select(state => state.hoveredDate)\n .pipe(\n filter(hoveredDate => !!hoveredDate)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // date custom classes\n this._subs.push(\n this._store\n .select(state => state.dateCustomClasses)\n .pipe(\n filter(dateCustomClasses => !!dateCustomClasses)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // date tooltip texts\n this._subs.push(\n this._store\n .select(state => state.dateTooltipTexts)\n .pipe(\n filter(dateTooltipTexts => !!dateTooltipTexts)\n )\n .subscribe(() => this._store?.dispatch(this._actions.flag()))\n );\n\n // on locale change\n this._subs.push(\n this._localeService.localeChange\n .subscribe(locale => this._store?.dispatch(this._actions.setLocale(locale)))\n );\n\n return this;\n }\n\n destroy(): void {\n for (const sub of this._subs) {\n sub.unsubscribe();\n }\n }\n}\n","import {\n BsDatepickerViewMode,\n DatepickerFormatOptions,\n DatepickerRenderOptions,\n DatepickerDateCustomClasses,\n DatepickerDateTooltipText,\n DaysCalendarModel,\n DaysCalendarViewModel,\n MonthsCalendarViewModel,\n MonthViewOptions,\n YearsCalendarViewModel\n} from '../models';\nimport { defaultMonthOptions } from './_defaults';\nimport { BsDatepickerConfig } from '../bs-datepicker.config';\n\nexport interface BsDatepickerViewState {\n date: Date;\n mode: BsDatepickerViewMode;\n}\n\nexport class BsDatepickerState\n implements DatepickerRenderOptions, DatepickerFormatOptions {\n // date picker\n selectedDate?: Date;\n // daterange picker\n selectedRange?: Date[];\n // time picker\n selectedTime?: Date[];\n\n // initial date of calendar, today by default\n view?: BsDatepickerViewState;\n\n isDisabled?: boolean;\n // bounds\n minDate?: Date;\n maxDate?: Date;\n daysDisabled?: number[];\n datesDisabled?: Date[];\n datesEnabled?: Date[];\n minMode?: BsDatepickerViewMode;\n dateCustomClasses?: DatepickerDateCustomClasses[];\n dateTooltipTexts?: DatepickerDateTooltipText[];\n\n hoveredDate?: Date;\n hoveredMonth?: Date;\n hoveredYear?: Date;\n\n // days calendar\n monthsModel?: DaysCalendarModel[];\n formattedMonths?: DaysCalendarViewModel[];\n flaggedMonths?: DaysCalendarViewModel[];\n selectFromOtherMonth?: boolean;\n showPreviousMonth?: boolean; // dateRangePicker only;\n preventChangeToNextMonth?: boolean; // dateRangePicker only;\n displayOneMonthRange?: boolean; // dateRangePicker only;\n\n // months calendar\n monthsCalendar?: MonthsCalendarViewModel[];\n flaggedMonthsCalendar?: MonthsCalendarViewModel[];\n\n // years calendar\n yearsCalendarModel?: YearsCalendarViewModel[];\n yearsCalendarFlagged?: YearsCalendarViewModel[];\n\n // options\n monthViewOptions?: MonthViewOptions;\n\n // DatepickerRenderOptions\n showWeekNumbers = true;\n displayMonths = 1;\n\n // DatepickerFormatOptions\n locale?: string;\n\n monthTitle?: string;\n yearTitle?: string;\n\n dayLabel?: string;\n monthLabel?: string;\n yearLabel?: string;\n\n weekNumbers?: string;\n}\n\nconst _initialView: BsDatepickerViewState = { date: new Date(), mode: 'day' };\n\nexport const initialDatepickerState: BsDatepickerState = Object.assign(\n new BsDatepickerConfig(),\n {\n locale: 'en',\n view: _initialView,\n selectedRange: [],\n selectedTime: [],\n monthViewOptions: defaultMonthOptions\n }\n);\n","import {\n MonthViewOptions\n} from '../models';\n\nexport const defaultMonthOptions: MonthViewOptions = {\n width: 7,\n height: 6\n};\n\nexport const dayInMilliseconds = 24 * 60 * 60 * 1000;\n","import {\n getDay,\n isFirstDayOfWeek,\n isAfter,\n isBefore,\n shiftDate,\n endOf,\n startOf,\n isArray,\n isSame\n} from 'ngx-bootstrap/chronos';\nimport { BsDatepickerState } from '../reducer/bs-datepicker.state';\nimport { BsCustomDates } from '../themes/bs/bs-custom-dates-view.component';\n\nexport function getStartingDayOfCalendar(date: Date,\n options: { firstDayOfWeek?: number }): Date {\n if (isFirstDayOfWeek(date, options.firstDayOfWeek)) {\n return date;\n }\n\n const weekDay = getDay(date);\n const offset = calculateDateOffset(weekDay, options.firstDayOfWeek);\n\n return shiftDate(date, {day: -offset});\n}\n\nexport function calculateDateOffset(weekday: number, startingDayOffset?: number): number {\n const _startingDayOffset = Number(startingDayOffset);\n if (isNaN(_startingDayOffset)) {\n return 0;\n }\n\n if (_startingDayOffset === 0) {\n return weekday;\n }\n\n const offset = weekday - _startingDayOffset % 7;\n\n return offset < 0 ? offset + 7 : offset;\n}\n\nexport function isMonthDisabled(date: Date, min?: Date, max?: Date): boolean {\n const minBound = min && isBefore(endOf(date, 'month'), min, 'day');\n const maxBound = max && isAfter(startOf(date, 'month'), max, 'day');\n\n return minBound || maxBound || false;\n}\n\nexport function isYearDisabled(date: Date, min?: Date, max?: Date): boolean {\n const minBound = min && isBefore(endOf(date, 'year'), min, 'day');\n const maxBound = max && isAfter(startOf(date, 'year'), max, 'day');\n\n return minBound || maxBound || false;\n}\n\nexport function isDisabledDate(date?: Date, datesDisabled?: Date[], unit?: 'year' | 'date' | 'month'): boolean {\n if (!datesDisabled || !isArray(datesDisabled) || !datesDisabled.length) {\n return false;\n }\n\n if (unit && unit === 'year' && !datesDisabled[0].getDate()) {\n return datesDisabled.some((dateDisabled: Date) => isSame(date, dateDisabled, 'year'));\n }\n\n return datesDisabled.some((dateDisabled: Date) => isSame(date, dateDisabled, 'date'));\n}\n\nexport function isEnabledDate(date?: Date, datesEnabled?: Date[], unit?: 'year' | 'date' | 'month'): boolean {\n if (!datesEnabled || !isArray(datesEnabled) || !datesEnabled.length) {\n return false;\n }\n\n return !datesEnabled.some((enabledDate: Date) => isSame(date, enabledDate, unit || 'date'));\n}\n\nexport function getYearsCalendarInitialDate(state: BsDatepickerState, calendarIndex = 0): Date | undefined {\n const model = state && state.yearsCalendarModel && state.yearsCalendarModel[calendarIndex];\n\n return model?.years[0] && model.years[0][0] && model.years[0][0].date;\n}\n\nexport function checkRangesWithMaxDate(ranges?: BsCustomDates[], maxDate?: Date): BsCustomDates[] | undefined {\n if (!ranges) return ranges;\n if (!maxDate) return ranges;\n if (!ranges.length && !ranges[0].value) return ranges;\n\n ranges.forEach((item: BsCustomDates) => {\n if (!item || !item.value) return ranges;\n if (item.value instanceof Date) return ranges;\n if (!(item.value instanceof Array && item.value.length) ) return ranges;\n item.value = compareDateWithMaxDateHelper(item.value, maxDate);\n return ranges;\n });\n return ranges;\n}\n\nexport function checkBsValue(date?: Array<Date> | Date | (Date | undefined)[], maxDate?: Date): Array<Date> | Date | (Date|undefined)[] | undefined {\n if (!date) return date;\n if (!maxDate) return date;\n if (date instanceof Array && !date.length) return date;\n if (date instanceof Date) return date;\n return compareDateWithMaxDateHelper(date, maxDate);\n}\n\nfunction compareDateWithMaxDateHelper <T>(date: T, maxDate: Date): T | Date[] {\n if (date instanceof Array) {\n const editedValues = date.map(item => {\n if (!item) return item;\n if (isAfter(item, maxDate, 'date')) item = maxDate;\n return item;\n });\n return editedValues;\n }\n return date;\n}\n\nexport function setCurrentTimeOnDateSelect(value?: Date): Date | undefined {\n if (!value) return value;\n\n return setCurrentTimeHelper(value);\n}\n\nexport function setDateRangesCurrentTimeOnDateSelect(value?: (Date|undefined)[]): (Date|undefined)[] | undefined {\n if (!value?.length) return value;\n\n value.map((date) => {\n if (!date) {\n return date;\n }\n return setCurrentTimeHelper(date);\n });\n\n return value;\n}\n\nfunction setCurrentTimeHelper(date: Date): Date {\n const now = new Date();\n date.setMilliseconds(now.getMilliseconds());\n date.setSeconds(now.getSeconds());\n date.setMinutes(now.getMinutes());\n date.setHours(now.getHours());\n return date;\n}\n","import { TimeUnit, shiftDate } from 'ngx-bootstrap/chronos';\n\nexport type CreateMatrixCb<T> = (date: Date) => T;\n\nexport interface MatrixOptions {\n height: number;\n width: number;\n initialDate: Date;\n shift: TimeUnit;\n}\n\nexport function createMatrix<T>(\n options: MatrixOptions,\n fn: CreateMatrixCb<T>\n): T[][] {\n let prevValue = options.initialDate;\n const matrix: T[][] = new Array(options.height);\n for (let i = 0; i < options.height; i++) {\n matrix[i] = new Array(options.width);\n for (let j = 0; j < options.width; j++) {\n matrix[i][j] = fn(prevValue);\n prevValue = shiftDate(prevValue, options.shift);\n }\n }\n\n return matrix;\n}\n","// user and model input should handle parsing and validating input values\nimport { getFirstDayOfMonth } from 'ngx-bootstrap/chronos';\n// should accept some options\n// todo: split out formatting\nimport { DaysCalendarModel, MonthViewOptions } from '../models';\nimport { getStartingDayOfCalendar } from '../utils/bs-calendar-utils';\nimport { createMatrix, MatrixOptions } from '../utils/matrix-utils';\n\nexport function calcDaysCalendar(\n startingDate: Date,\n options: MonthViewOptions\n): DaysCalendarModel {\n const firstDay = getFirstDayOfMonth(startingDate);\n const initialDate = getStartingDayOfCalendar(firstDay, options);\n\n // todo test\n const matrixOptions: MatrixOptions = {\n width: options.width || 0,\n height: options.height || 0,\n initialDate,\n shift: { day: 1 }\n };\n const daysMatrix = createMatrix<Date>(matrixOptions, date => date);\n\n return {\n daysMatrix,\n month: firstDay\n };\n}\n","import {\n DatepickerFormatOptions,\n DaysCalendarModel,\n DaysCalendarViewModel\n} from '../models';\nimport { formatDate, getLocale } from 'ngx-bootstrap/chronos';\n\nexport function formatDaysCalendar(daysCalendar: DaysCalendarModel,\n formatOptions: DatepickerFormatOptions,\n monthIndex: number): DaysCalendarViewModel {\n return {\n month: daysCalendar.month,\n monthTitle: formatDate(\n daysCalendar.month,\n formatOptions.monthTitle,\n formatOptions.locale\n ),\n yearTitle: formatDate(\n daysCalendar.month,\n formatOptions.yearTitle,\n formatOptions.locale\n ),\n weekNumbers: getWeekNumbers(\n daysCalendar.daysMatrix,\n formatOptions.weekNumbers,\n formatOptions.locale\n ),\n weekdays: getShiftedWeekdays(formatOptions.locale),\n weeks: daysCalendar.daysMatrix.map((week: Date[], weekIndex: number) => ({\n days: week.map((date: Date, dayIndex: number) => ({\n date,\n label: formatDate(date, formatOptions.dayLabel, formatOptions.locale),\n monthIndex,\n weekIndex,\n dayIndex\n }))\n })),\n hideLeftArrow: false,\n hideRightArrow: false,\n disableLeftArrow: false,\n disableRightArrow: false\n };\n}\n\nexport function getWeekNumbers(daysMatrix: Date[][],\n format?: string,\n locale?: string): string[] {\n return daysMatrix.map(\n (days: Date[]) => (days[0] ? formatDate(days[0], format, locale) : '')\n );\n}\n\nexport function getShiftedWeekdays(locale?: string): string[] {\n const _locale = getLocale(locale);\n const weekdays = _locale.weekdaysShort() as string[];\n const firstDayOfWeek = _locale.firstDayOfWeek();\n\n return [...weekdays.slice(firstDayOfWeek), ...weekdays.slice(0, firstDayOfWeek)];\n}\n","import { BsDatepickerViewMode } from '../models';\n\nexport function canSwitchMode(mode: BsDatepickerViewMode, minMode?: BsDatepickerViewMode): boolean {\n return minMode ? mode >= minMode : true;\n}\n","import {\n DatepickerFormatOptions,\n MonthsCalendarViewModel,\n CalendarCellViewModel\n} from '../models';\nimport { startOf, formatDate } from 'ngx-bootstrap/chronos';\nimport { createMatrix } from '../utils/matrix-utils';\n\nconst height = 4;\nconst width = 3;\nconst shift = { month: 1 };\n\nexport function formatMonthsCalendar(\n viewDate: Date,\n formatOptions: DatepickerFormatOptions\n): MonthsCalendarViewModel {\n const initialDate = startOf(viewDate, 'year');\n const matrixOptions = { width, height, initialDate, shift };\n const monthMatrix = createMatrix<\n CalendarCellViewModel\n >(matrixOptions, date => ({\n date,\n label: formatDate(date, formatOptions.monthLabel, formatOptions.locale)\n }));\n\n return {\n months: monthMatrix,\n monthTitle: '',\n yearTitle: formatDate(\n viewDate,\n formatOptions.yearTitle,\n formatOptions.locale\n ),\n hideRightArrow: false,\n hideLeftArrow: false,\n disableRightArrow: false,\n disableLeftArrow: false\n };\n}\n","import {\n DatepickerFormatOptions,\n YearsCalendarViewModel,\n CalendarCellViewModel\n} from '../models';\nimport { shiftDate, formatDate } from 'ngx-bootstrap/chronos';\nimport { createMatrix } from '../utils/matrix-utils';\n\nconst height = 4;\nconst width = 4;\nexport const yearsPerCalendar = height * width;\nexport const initialYearShift = (Math.floor(yearsPerCalendar / 2) - 1) * -1;\nconst shift = { year: 1 };\n\nexport function formatYearsCalendar(\n viewDate: Date,\n formatOptions: DatepickerFormatOptions,\n previousInitialDate?: Date\n): YearsCalendarViewModel {\n const initialDate = calculateInitialDate(viewDate, previousInitialDate);\n const matrixOptions = { width, height, initialDate, shift };\n const yearsMatrix = createMatrix<\n CalendarCellViewModel\n >(matrixOptions, date => ({\n date,\n label: formatDate(date, formatOptions.yearLabel, formatOptions.locale)\n }));\n const yearTitle = formatYearRangeTitle(yearsMatrix, formatOptions);\n\n return {\n years: yearsMatrix,\n monthTitle: '',\n yearTitle,\n hideLeftArrow: false,\n hideRightArrow: false,\n disableLeftArrow: false,\n disableRightArrow: false\n };\n}\n\nfunction calculateInitialDate(viewDate: Date, previousInitialDate?: Date): Date {\n if (previousInitialDate\n && viewDate.getFullYear() >= previousInitialDate.getFullYear()\n && viewDate.getFullYear() < previousInitialDate.getFullYear() + yearsPerCalendar) {\n return previousInitialDate;\n }\n\n return shiftDate(viewDate, { year: initialYearShift });\n}\n\nfunction formatYearRangeTitle(\n yearsMatrix: CalendarCellViewModel[][],\n formatOptions: DatepickerFormatOptions\n): string {\n const from = formatDate(\n yearsMatrix[0][0].date,\n formatOptions.yearTitle,\n formatOptions.locale\n );\n const to = formatDate(\n yearsMatrix[height - 1][width - 1].date,\n formatOptions.yearTitle,\n formatOptions.locale\n );\n\n return `${from} - ${to}`;\n}\n","export function copyTime(sourceDate: Date, time: Date) {\n if (!sourceDate || !isNaN(sourceDate.getTime())) {\n return;\n }\n\n sourceDate.setHours(time.getHours());\n sourceDate.setMinutes(time.getMinutes());\n sourceDate.setSeconds(time.getSeconds());\n sourceDate.setMilliseconds(time.getMilliseconds());\n}\n","import { BsDatepickerState, BsDatepickerViewState, initialDatepickerState } from './bs-datepicker.state';\nimport { Action } from 'ngx-bootstrap/mini-ngrx';\nimport { BsDatepickerActions } from './bs-datepicker.actions';\nimport { calcDaysCalendar } from '../engine/calc-days-calendar';\nimport { formatDaysCalendar } from '../engine/format-days-calendar';\nimport { flagDaysCalendar } from '../engine/flag-days-calendar';\nimport {\n setFullDate,\n shiftDate,\n isArray,\n isDateValid,\n startOf,\n getLocale,\n isAfter,\n isBefore,\n isSame\n} from 'ngx-bootstrap/chronos';\nimport { canSwitchMode } from '../engine/view-mode';\nimport { formatMonthsCalendar } from '../engine/format-months-calendar';\nimport { flagMonthsCalendar } from '../engine/flag-months-calendar';\nimport { formatYearsCalendar, initialYearShift, yearsPerCalendar } from '../engine/format-years-calendar';\nimport { flagYearsCalendar } from '../engine/flag-years-calendar';\nimport { BsViewNavigationEvent, DatepickerFormatOptions, BsDatepickerViewMode } from '../models';\nimport { getYearsCalendarInitialDate } from '../utils/bs-calendar-utils';\nimport { copyTime } from '../utils/copy-time-utils';\n\n\nexport function bsDatepickerReducer(state: BsDatepickerState = initialDatepickerState,\n action: Action): BsDatepickerState {\n switch (action.type) {\n case BsDatepickerActions.CALCULATE: {\n return calculateReducer(state);\n }\n\n case BsDatepickerActions.FORMAT: {\n return formatReducer(state);\n }\n\n case BsDatepickerActions.FLAG: {\n return flagReducer(state);\n }\n\n case BsDatepickerActions.NAVIGATE_OFFSET: {\n return navigateOffsetReducer(state, action);\n }\n\n case BsDatepickerActions.NAVIGATE_TO: {\n const payload: BsViewNavigationEvent = action.payload;\n if (!state.view || !payload.unit) {\n return state;\n }\n\n const date = setFullDate(state.view.date, payload.unit);\n let newState;\n let mode: BsDatepickerViewMode;\n if (canSwitchMode(payload.viewMode, state.minMode)) {\n mode = payload.viewMode;\n newState = { view: { date, mode } };\n } else {\n mode = state.view.mode;\n newState = { selectedDate: date, view: { date, mode } };\n }\n\n return Object.assign({}, state, newState);\n }\n\n case BsDatepickerActions.CHANGE_VIEWMODE: {\n if (!canSwitchMode(action.payload, state.minMode) || !state.view) {\n return state;\n }\n\n const date = state.view.date;\n const mode = action.payload;\n const newState = { view: { date, mode } };\n\n return Object.assign({}, state, newState);\n }\n\n case BsDatepickerActions.HOVER: {\n return Object.assign({}, state, { hoveredDate: action.payload });\n }\n\n case BsDatepickerActions.SELECT: {\n if (!state.view) {\n return state;\n }\n\n const newState = {\n selectedDate: action.payload,\n view: state.view\n };\n\n if (Array.isArray(state.selectedTime)) {\n const _time = state.selectedTime[0];\n if (newState.selectedDate && _time) {\n copyTime(newState.selectedDate, _time);\n }\n }\n\n const mode = state.view.mode;\n const _date = action.payload || state.view.date;\n const date = getViewDate(_date, state.minDate, state.maxDate);\n newState.view = { mode, date };\n\n return Object.assign({}, state, newState);\n }\n\n case BsDatepickerActions.SELECT_TIME: {\n const {date, index} = action.payload;\n const selectedTime = state.selectedTime ? [...state.selectedTime] : [];\n selectedTime[index] = date;\n return Object.assign({}, state, { selectedTime });\n }\n\n case BsDatepickerActions.SET_OPTIONS: {\n if (!state.view) {\n return state;\n }\n\n const newState = action.payload;\n // preserve view mode\n const mode = newState.minMode ? newState.minMode : state.view.mode;\n const _viewDate = isDateValid(newState.value) && newState.value\n || isArray(newState.value) && isDateValid(newState.value[0]) && newState.value[0]\n || state.view.date;\n const date = getViewDate(_viewDate, newState.minDate, newState.maxDate);\n newState.view = { mode, date };\n // update selected value\n if (newState.value) {\n // if new value is array we work with date range\n if (isArray(newState.value)) {\n newState.selectedRange = newState.value;\n newState.selectedTime = newState.value.map((i: Date) => i);\n }\n\n // if new value is a date -> datepicker\n if (newState.value instanceof Date) {\n newState.selectedDate = newState.value;\n newState.selectedTime = [newState.value];\n }\n\n // provided value is not supported :)\n // need to report it somehow\n }\n\n return Object.assign({}, state, newState);\n }\n\n // date range picker\n case BsDatepickerActions.SELECT_RANGE: {\n if (!state.view) {\n return state;\n }\n\n const newState = {\n selectedRange: action.payload,\n view: state.view\n };\n newState.selectedRange?.forEach((dte: Date, index: number) => {\n if (Array.isArray(state.selectedTime)) {\n const _time = state.selectedTime[index];\n if (_time) {\n copyTime(dte, _time);\n }\n }\n });\n\n const mode = state.view.mode;\n const _date = action.payload && action.payload[0] || state.view.date;\n const date = getViewDate(_date, state.minDate, state.maxDate);\n newState.view = { mode, date };\n\n return Object.assign({}, state, newState);\n }\n\n case BsDatepickerActions.SET_MIN_DATE: {\n return Object.assign({}, state, {\n minDate: action.payload\n });\n }\n case BsDatepickerActions.SET_MAX_DATE: {\n return Object.assign({}, state, {\n maxDate: action.payload\n });\n }\n case BsDatepickerActions.SET_IS_DISABLED: {\n return Object.assign({}, state, {\n isDisabled: action.payload\n });\n }\n case BsDatepickerActions.SET_DATE_CUSTOM_CLASSES: {\n return Object.assign({}, state, {\n dateCustomClasses: action.payload\n });\n }\n case BsDatepickerActions.SET_DATE_TOOLTIP_TEXTS: {\n return Object.assign({}, state, {\n dateTooltipTexts: action.payload\n });\n }\n\n default:\n return state;\n }\n}\n\nfunction calculateReducer(state: BsDatepickerState): BsDatepickerState {\n if (!state.view) {\n return state;\n }\n\n // how many calendars\n let displayMonths: number | undefined;\n if (state.displayOneMonthRange &&\n isDisplayOneMonth(state.view.date, state.minDate, state.maxDate)) {\n displayMonths = 1;\n } else {\n displayMonths = state.displayMonths || 1;\n }\n\n // use selected date on initial rendering if set\n let viewDate = state.view.date;\n\n if (state.view.mode === 'day' && state.monthViewOptions) {\n if (state.showPreviousMonth && state.selectedRange && state.selectedRange.length === 0) {\n viewDate = shiftDate(viewDate, { month: -1 });\n }\n\n state.monthViewOptions.firstDayOfWeek = getLocale(state.locale).firstDayOfWeek();\n let monthsModel = new Array(displayMonths);\n for (let monthIndex = 0; monthIndex < displayMonths; monthIndex++) {\n // todo: for unlinked calendars it will be harder\n monthsModel[monthIndex] = calcDaysCalendar(\n viewDate,\n state.monthViewOptions\n );\n viewDate = shiftDate(viewDate, { month: 1 });\n }\n // Check if parameter enabled and check if it's not months navigation event\n if (state.preventChangeToNextMonth && state.flaggedMonths && state.hoveredDate) {\n const viewMonth = calcDaysCalendar(state.view.date, state.monthViewOptions);\n // Check if viewed right month same as in flaggedMonths state, then override months model with flaggedMonths\n if (state.flaggedMonths.length && state.flaggedMonths[1].month.getMonth() === viewMonth.month.getMonth()) {\n monthsModel = state.flaggedMonths\n .map(item => {\n if (state.monthViewOptions) {\n return calcDaysCalendar(\n item.month,\n state.monthViewOptions\n );\n }\n return null;\n })\n .filter(item => item !== null);\n }\n }\n\n return Object.assign({}, state, { monthsModel });\n }\n\n if (state.view.mode === 'month') {\n const monthsCalendar = new Array(displayMonths);\n for (\n let calendarIndex = 0;\n calendarIndex < displayMonths;\n calendarIndex++\n ) {\n // todo: for unlinked calendars it will be harder\n monthsCalendar[calendarIndex] = formatMonthsCalendar(\n viewDate,\n getFormatOptions(state)\n );\n viewDate = shiftDate(viewDate, { year: 1 });\n }\n\n return Object.assign({}, state, { monthsCalendar });\n }\n\n if (state.view.mode === 'year') {\n const yearsCalendarModel = new Array(displayMonths);\n\n for (\n let calendarIndex = 0;\n calendarIndex < displayMonths;\n calendarIndex++\n ) {\n // todo: for unlinked calendars it will be harder\n yearsCalendarModel[calendarIndex] = formatYearsCalendar(\n viewDate,\n getFormatOptions(state),\n state.minMode === 'year' ? getYearsCalendarInitialDate(state, calendarIndex) : undefined\n );\n viewDate = shiftDate(viewDate, { year: yearsPerCalendar });\n }\n\n return Object.assign({}, state, { yearsCalendarModel });\n }\n\n return state;\n}\n\nfunction formatReducer(state: BsDatepickerState): BsDatepickerState {\n if (!state.view) {\n return state;\n }\n\n if (state.view.mode === 'day' && state.monthsModel) {\n const formattedMonths = state.monthsModel.map((month, monthIndex) =>\n formatDaysCalendar(month, getFormatOptions(state), monthIndex)\n );\n\n return Object.assign({}, state, { formattedMonths });\n }\n\n // how many calendars\n const displayMonths = state.displayMonths || 1;\n // check initial rendering\n // use selected date on initial rendering if set\n let viewDate = state.view.date;\n\n if (state.view.mode === 'month') {\n const monthsCalendar = new Array(displayMonths);\n for (\n let calendarIndex = 0;\n calendarIndex < displayMonths;\n calendarIndex++\n ) {\n // todo: for unlinked calendars it will be harder\n monthsCalendar[calendarIndex] = formatMonthsCalendar(\n viewDate,\n getFormatOptions(state)\n );\n viewDate = shiftDate(viewDate, { year: 1 });\n }\n\n return Object.assign({}, state, { monthsCalendar });\n }\n\n if (state.view.mode === 'year') {\n const yearsCalendarModel = new Array(displayMonths);\n for (\n let calendarIndex = 0;\n calendarIndex < displayMonths;\n calendarIndex++\n ) {\n // todo: for unlinked calendars it will be harder\n yearsCalendarModel[calendarIndex] = formatYearsCalendar(\n viewDate,\n getFormatOptions(state)\n );\n viewDate = shiftDate(viewDate, { year: 16 });\n }\n\n return Object.assign({}, state, { yearsCalendarModel });\n }\n\n return state;\n}\n\nfunction flagReducer(state: BsDatepickerState): BsDatepickerState {\n if (!state.view) {\n return state;\n }\n\n const displayMonths = isDisplayOneMonth(state.view.date, state.minDate, state.maxDate) ? 1 : state.displayMonths;\n if (state.formattedMonths && state.view.mode === 'day') {\n const flaggedMonths = state.formattedMonths.map(\n (formattedMonth, monthIndex) =>\n flagDaysCalendar(formattedMonth, {\n isDisabled: state.isDisabled,\n minDate: state.minDate,\n maxDate: state.maxDate,\n daysDisabled: state.daysDisabled,\n datesDisabled: state.datesDisabled,\n datesEnabled: state.datesEnabled,\n hoveredDate: state.hoveredDate,\n selectedDate: state.selectedDate,\n selectedRange: state.selectedRange,\n displayMonths,\n dateCustomClasses: state.dateCustomClasses,\n dateTooltipTexts: state.dateTooltipTexts,\n monthIndex\n })\n );\n\n return Object.assign({}, state, { flaggedMonths });\n }\n\n if (state.view.mode === 'month' && state.monthsCalendar) {\n const flaggedMonthsCalendar = state.monthsCalendar.map(\n (formattedMonth, monthIndex) =>\n flagMonthsCalendar(formattedMonth, {\n isDisabled: state.isDisabled,\n minDate: state.minDate,\n maxDate: state.maxDate,\n hoveredMonth: state.hoveredMonth,\n selectedDate: state.selectedDate,\n datesDisabled: state.datesDisabled,\n datesEnabled: state.datesEnabled,\n selectedRange: state.selectedRange,\n displayMonths,\n monthIndex\n })\n );\n\n return Object.assign({}, state, { flaggedMonthsCalendar });\n }\n\n if (state.view.mode === 'year' && state.yearsCalendarModel) {\n const yearsCalendarFlagged = state.yearsCalendarModel.map(\n (formattedMonth, yearIndex) =>\n flagYearsCalendar(formattedMonth, {\n isDisabled: state.isDisabled,\n minDate: state.minDate,\n maxDate: state.maxDate,\n hoveredYear: state.hoveredYear,\n selectedDate: state.selectedDate,\n datesDisabled: state.datesDisabled,\n datesEnabled: state.datesEnabled,\n selectedRange: state.selectedRange,\n displayMonths,\n yearIndex\n })\n );\n\n return Object.assign({}, state, { yearsCalendarFlagged });\n }\n\n return state;\n}\n\nfunction navigateOffsetReducer(state: BsDatepickerState, action: Action): BsDatepickerState {\n if (!state.view) {\n return state;\n }\n\n const date = shiftViewDate(state, action);\n if (!date) {\n return state;\n }\n\n const newState: {view: BsDatepickerViewState} = {\n view: {\n mode: state.view.mode,\n date\n }\n };\n\n return Object.assign({}, state, newState);\n}\n\nfunction shiftViewDate(state: BsDatepickerState, action: Action): Date | undefined {\n if (!state.view) {\n return undefined;\n }\n\n if (state.view.mode === 'year' && state.minMode === 'year') {\n const initialDate = getYearsCalendarInitialDate(state, 0);\n if (initialDate) {\n const middleDate = shiftDate(initialDate, { year: -initialYearShift });\n return shiftDate(middleDate, action.payload);\n }\n }\n\n return shiftDate(startOf(state.view.date, 'month'), action.payload);\n}\n\nfunction getFormatOptions(state: BsDatepickerState): DatepickerFormatOptions {\n return {\n locale: state.locale,\n\n monthTitle: state.monthTitle,\n yearTitle: state.yearTitle,\n\n dayLabel: state.dayLabel,\n monthLabel: state.monthLabel,\n yearLabel: state.yearLabel,\n\n weekNumbers: state.weekNumbers\n };\n}\n\n/**\n * if view date is provided (bsValue|ngModel) it should be shown\n * if view date is not provider:\n * if minDate>currentDate (default view value), show minDate\n * if maxDate<currentDate(default view value) show maxDate\n */\nfunction getViewDate(viewDate: Date | Date[], minDate?: Date, maxDate?: Date) {\n const _date = Array.isArray(viewDate) ? viewDate[0] : viewDate;\n\n if (minDate && isAfter(minDate, _date, 'day')) {\n return minDate;\n }\n\n if (maxDate && isBefore(maxDate, _date, 'day')) {\n return maxDate;\n }\n\n return _date;\n}\n\nfunction isDisplayOneMonth(viewDate: Date, minDate?: Date, maxDate?: Date) {\n if (maxDate && isSame(maxDate, viewDate, 'day')) {\n return true;\n }\n\n return minDate && maxDate && minDate.getMonth() === maxDate.getMonth();\n}\n","import {\n DaysCalendarViewModel,\n DayViewModel,\n WeekViewModel,\n DatepickerDateCustomClasses,\n DatepickerDateTooltipText\n} from '../models';\n\nimport {\n isAfter,\n isBefore,\n isDisabledDay,\n isSameDay,\n isSameMonth,\n shiftDate\n} from 'ngx-bootstrap/chronos';\n\nimport { isMonthDisabled, isDisabledDate, isEnabledDate } from '../utils/bs-calendar-utils';\n\nexport interface FlagDaysCalendarOptions {\n isDisabled: boolean;\n minDate: Date;\n maxDate: Date;\n daysDisabled: number[];\n datesDisabled: Date[];\n datesEnabled: Date[];\n hoveredDate: Date;\n selectedDate: Date;\n selectedRange: Date[];\n displayMonths: number;\n monthIndex: number;\n dateCustomClasses: DatepickerDateCustomClasses[];\n dateTooltipTexts: DatepickerDateTooltipText[];\n}\n\nexport function flagDaysCalendar(\n formattedMonth: DaysCalendarViewModel,\n options: Partial<FlagDaysCalendarOptions>\n): DaysCalendarViewModel {\n formattedMonth.weeks.forEach((week: WeekViewModel) => {\n week.days.forEach((day: DayViewModel, dayIndex: number) => {\n // datepicker\n const isOtherMonth = !isSameMonth(day.date, formattedMonth.month);\n\n const isHovered =\n !isOtherMonth && isSameDay(day.date, options.hoveredDate);\n // date range picker\n const isSelectionStart =\n !isOtherMonth &&\n options.selectedRange &&\n isSameDay(day.date, options.selectedRange[0]);\n const isSelectionEnd =\n !isOtherMonth &&\n options.selectedRange &&\n isSameDay(day.date, options.selectedRange[1]);\n\n const isSelected =\n (!isOtherMonth && isSameDay(day.date, options.selectedDate)) ||\n isSelectionStart ||\n isSelectionEnd;\n\n const isInRange =\n !isOtherMonth &&\n options.selectedRange &&\n isDateInRange(day.date, options.selectedRange, options.hoveredDate);\n\n const isDisabled =\n options.isDisabled ||\n isBefore(day.date, options.minDate, 'day') ||\n isAfter(day.date, options.maxDate, 'day') ||\n isDisabledDay(day.date, options.daysDisabled) ||\n isDisabledDate(day.date, options.datesDisabled) ||\n isEnabledDate(day.date, options.datesEnabled);\n\n const currentDate = new Date();\n const isToday = !isOtherMonth && isSameDay(day.date, currentDate);\n\n const customClasses = options.dateCustomClasses && options.dateCustomClasses\n .map(dcc => isSameDay(day.date, dcc.date) ? dcc.classes : [])\n .reduce((previousValue, currentValue) => previousValue.concat(currentValue), [])\n .join(' ')\n || '';\n\n const tooltipText = options.dateTooltipTexts && options.dateTooltipTexts\n .map(tt => isSameDay(day.date, tt.date) ? tt.tooltipText : '')\n .reduce((previousValue, currentValue) => {\n previousValue.push(currentValue);\n return previousValue;\n }, [] as string[])\n .join(' ')\n || '';\n\n // decide update or not\n const newDay = Object.assign({}, day, {\n isOtherMonth,\n isHovered,\n isSelected,\n isSelectionStart,\n isSelectionEnd,\n isInRange,\n isDisabled,\n isToday,\n customClasses,\n tooltipText\n });\n\n if (\n day.isOtherMonth !== newDay.isOtherMonth ||\n day.isHovered !== newDay.isHovered ||\n day.isSelected !== newDay.isSelected ||\n day.isSelectionStart !== newDay.isSelectionStart ||\n day.isSelectionEnd !== newDay.isSelectionEnd ||\n day.isDisabled !== newDay.isDisabled ||\n day.isInRange !== newDay.isInRange ||\n day.customClasses !== newDay.customClasses ||\n day.tooltipText !== newDay.tooltipText\n ) {\n week.days[dayIndex] = newDay;\n }\n });\n });\n\n // todo: add check for linked calendars\n formattedMonth.hideLeftArrow =\n options.isDisabled ||\n (!!options.monthIndex && options.monthIndex > 0 && options.monthIndex !== options.displayMonths);\n formattedMonth.hideRightArrow =\n options.isDisabled ||\n ((!!options.monthIndex || options.monthIndex === 0) && !!options.displayMonths && options.monthIndex < options.displayMonths &&\n options.monthIndex + 1 !== options.displayMonths);\n\n formattedMonth.disableLeftArrow = isMonthDisabled(\n shiftDate(formattedMonth.month, { month: -1 }),\n options.minDate,\n options.maxDate\n );\n formattedMonth.disableRightArrow = isMonthDisabled(\n shiftDate(formattedMonth.month, { month: 1 }),\n options.minDate,\n options.maxDate\n );\n return formattedMonth;\n}\n\nfunction isDateInRange(\n date: Date,\n selectedRange?: Date[],\n hoveredDate?: Date\n): boolean {\n if (!date || !selectedRange || !selectedRange[0]) {\n return false;\n }\n\n if (selectedRange[1]) {\n return date > selectedRange[0] && date <= selectedRange[1];\n }\n\n if (hoveredDate) {\n return date > selectedRange[0] && date <= hoveredDate;\n }\n\n return false;\n}\n","import { isSameMonth, shiftDate } from 'ngx-bootstrap/chronos';\nimport {\n MonthsCalendarViewModel,\n CalendarCellViewModel\n} from '../models';\nimport { isDisabledDate, isEnabledDate, isMonthDisabled, isYearDisabled } from '../utils/bs-calendar-utils';\n\nexport interface FlagMonthCalendarOptions {\n isDisabled: boolean;\n minDate: Date;\n maxDate: Date;\n hoveredMonth: Date;\n selectedDate: Date;\n selectedRange: Date[];\n datesDisabled: Date[];\n datesEnabled: Date[];\n displayMonths: number;\n monthIndex: number;\n}\n\nexport function flagMonthsCalendar(\n monthCalendar: MonthsCalendarViewModel,\n options: Partial<FlagMonthCalendarOptions>\n): MonthsCalendarViewModel {\n monthCalendar.months.forEach(\n (months: CalendarCellViewModel[], rowIndex: number) => {\n months.forEach((month: CalendarCellViewModel, monthIndex: number) => {\n let isSelected: boolean;\n const isHovered = isSameMonth(month.date, options.hoveredMonth);\n const isDisabled =\n options.isDisabled ||\n isDisabledDate(month.date, options.datesDisabled) ||\n isEnabledDate(month.date, options.datesEnabled, 'month') ||\n isMonthDisabled(month.date, options.minDate, options.maxDate);\n\n if (!options.selectedDate && options.selectedRange) {\n isSelected = isSameMonth(month.date, options.selectedRange[0]);\n if (!isSelected) {\n isSelected = isSameMonth(month.date, options.selectedRange[1]);\n }\n } else {\n isSelected = isSameMonth(month.date, options.selectedDate);\n }\n const newMonth = Object.assign(/*{},*/ month, {\n isHovered,\n isDisabled,\n isSelected\n });\n if (\n month.isHovered !== newMonth.isHovered ||\n month.isDisabled !== newMonth.isDisabled ||\n month.isSelected !== newMonth.isSelected\n ) {\n monthCalendar.months[rowIndex][monthIndex] = newMonth;\n }\n });\n }\n );\n\n // todo: add check for linked calendars\n monthCalendar.hideLeftArrow =\n !!options.monthIndex && options.monthIndex > 0 && options.monthIndex !== options.displayMonths;\n\n monthCalendar.hideRightArrow =\n (!!options.monthIndex || options.monthIndex === 0 )\n && (!!options.displayMonths || options.displayMonths === 0)\n && options.monthIndex < options.displayMonths\n && options.monthIndex + 1 !== options.displayMonths;\n\n monthCalendar.disableLeftArrow = isYearDisabled(\n shiftDate(monthCalendar.months[0][0].date, { year: -1 }),\n options.minDate,\n options.maxDate\n );\n monthCalendar.disableRightArrow = isYearDisabled(\n shiftDate(monthCalendar.months[0][0].date, { year: 1 }),\n options.minDate,\n options.maxDate\n );\n\n return monthCalendar;\n}\n","import { isSameYear, shiftDate } from 'ngx-bootstrap/chronos';\nimport { YearsCalendarViewModel, CalendarCellViewModel } from '../models';\nimport { isDisabledDate, isEnabledDate, isYearDisabled } from '../utils/bs-calendar-utils';\n\nexport interface FlagYearsCalendarOptions {\n isDisabled: boolean;\n minDate: Date;\n maxDate: Date;\n hoveredYear: Date;\n selectedDate: Date;\n selectedRange: Date[];\n datesDisabled: Date[];\n datesEnabled: Date[];\n displayMonths: number;\n yearIndex: number;\n}\n\nexport function flagYearsCalendar(\n yearsCalendar: YearsCalendarViewModel,\n options: Partial<FlagYearsCalendarOptions>\n): YearsCalendarViewModel {\n yearsCalendar.years.forEach(\n (years: CalendarCellViewModel[], rowIndex: number) => {\n years.forEach((year: CalendarCellViewModel, yearIndex: number) => {\n let isSelected: boolean;\n const isHovered = isSameYear(year.date, options.hoveredYear);\n const isDisabled =\n options.isDisabled ||\n isDisabledDate(year.date, options.datesDisabled, 'year') ||\n isEnabledDate(year.date, options.datesEnabled, 'year') ||\n isYearDisabled(year.date, options.minDate, options.maxDate);\n\n if (!options.selectedDate && options.selectedRange) {\n isSelected = isSameYear(year.date, options.selectedRange[0]);\n if (!isSelected) {\n isSelected = isSameYear(year.date, options.selectedRange[1]);\n }\n } else {\n isSelected = isSameYear(year.date, options.selectedDate);\n }\n\n const newMonth = Object.assign(/*{},*/ year, { isHovered, isDisabled, isSelected });\n if (\n year.isHovered !== newMonth.isHovered ||\n year.isDisabled !== newMonth.isDisabled ||\n year.isSelected !== newMonth.isSelected\n ) {\n yearsCalendar.years[rowIndex][yearIndex] = newMonth;\n }\n });\n }\n );\n\n // todo: add check for linked calendars\n yearsCalendar.hideLeftArrow =\n !!options.yearIndex && options.yearIndex > 0 && options.yearIndex !== options.displayMonths;\n yearsCalendar.hideRightArrow =\n !!options.yearIndex && !!options.displayMonths &&\n options.yearIndex < options.displayMonths &&\n options.yearIndex + 1 !== options.displayMonths;\n\n yearsCalendar.disableLeftArrow = isYearDisabled(\n shiftDate(yearsCalendar.years[0][0].date, { year: -1 }),\n options.minDate,\n options.maxDate\n );\n const i = yearsCalendar.years.length - 1;\n const j = yearsCalendar.years[i].length - 1;\n yearsCalendar.disableRightArrow = isYearDisabled(\n shiftDate(yearsCalendar.years[i][j].date, { year: 1 }),\n options.minDate,\n options.maxDate\n );\n\n return yearsCalendar;\n}\n","import { Injectable } from '@angular/core';\nimport { MiniStore, Action, MiniState } from 'ngx-bootstrap/mini-ngrx';\nimport { BsDatepickerState, initialDatepickerState } from './bs-datepicker.state';\nimport { BehaviorSubject } from 'rxjs';\nimport { bsDatepickerReducer } from './bs-datepicker.reducer';\n\n@Injectable({providedIn: 'platform'})\nexport class BsDatepickerStore extends MiniStore<BsDatepickerState> {\n constructor() {\n const _dispatcher = new BehaviorSubject<Action>({\n type: '[datepicker] dispatcher init'\n });\n const state = new MiniState<BsDatepickerState>(\n initialDatepickerState,\n _dispatcher,\n bsDatepickerReducer\n );\n super(_dispatcher, bsDatepickerReducer, state);\n }\n}\n","import { Component, ChangeDetectionStrategy, Input, Output, EventEmitter } from '@angular/core';\n\nexport interface BsCustomDates {\n label: string;\n value: Date | Date[];\n}\n\n@Component({\n selector: 'bs-custom-date-view',\n template: `\n <div class=\"bs-datepicker-predefined-btns\">\n <button *ngFor=\"let range of ranges\"\n type=\"button\"\n class=\"btn\"\n (click)=\"selectFromRanges(range)\"\n [class.selected]=\"range.value === selectedRange\">\n {{ range.label }}\n </button>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class BsCustomDatesViewComponent {\n @Input() ranges?: BsCustomDates[];\n @Input() selectedRange?: Date[];\n @Input() customRangeLabel?: string;\n @Output() onSelect = new EventEmitter<BsCustomDates>();\n\n selectFromRanges(range?: BsCustomDates) {\n this.onSelect.emit(range);\n }\n}\n","import { TimeUnit } from 'ngx-bootstrap/chronos';\n\nexport type BsDatepickerViewMode = 'day' | 'month' | 'year';\n\n/** *************** */\n// navigation bar settings\nexport interface NavigationViewModel {\n monthTitle: string;\n yearTitle: string;\n hideLeftArrow: boolean;\n hideRightArrow: boolean;\n disableLeftArrow: boolean;\n disableRightArrow: boolean;\n}\n\nexport interface CalendarCellViewModel {\n date: Date;\n label: string;\n isDisabled?: boolean;\n isHovered?: boolean;\n isSelected?: boolean;\n}\n\n/** *************** */\n// days matrix: day cell view model\nexport interface DayViewModel extends CalendarCellViewModel {\n isOtherMonthHovered?: boolean;\n isOtherMonth?: boolean;\n isInRange?: boolean;\n isSelectionStart?: boolean;\n isSelectionEnd?: boolean;\n isToday?: boolean;\n customClasses?: string;\n tooltipText?: string;\n // day index\n monthIndex?: number;\n weekIndex?: number;\n dayIndex?: number;\n}\n\nexport interface WeekViewModel {\n days: DayViewModel[];\n isHovered?: boolean;\n}\n\n// todo: split navigation settings\nexport interface DaysCalendarViewModel extends NavigationViewModel {\n weeks: WeekViewModel[];\n // additional information\n month: Date;\n weekNumbers: string[];\n weekdays: string[];\n}\n\n/** *************** */\n// months calendar\nexport interface MonthsCalendarViewModel extends NavigationViewModel {\n months: CalendarCellViewModel[][];\n}\n\n/** *************** */\n// years calendar\nexport interface YearsCalendarViewModel extends NavigationViewModel {\n years: CalendarCellViewModel[][];\n}\n\n/** *************** */\n\n// math model\n/** *************** */\n\n// days Date's array\nexport interface DaysCalendarModel {\n daysMatrix: Date[][];\n month: Date;\n}\n\n/** *************** */\n// some func options\nexport interface MonthViewOptions {\n width?: number;\n height?: number;\n firstDayOfWeek?: number;\n}\n\n/** *************** */\n// rendering options\nexport interface DatepickerFormatOptions {\n locale?: string;\n\n monthTitle?: string;\n yearTitle?: string;\n\n dayLabel?: string;\n monthLabel?: string;\n yearLabel?: string;\n\n weekNumbers?: string;\n}\n\nexport interface DatepickerRenderOptions {\n showWeekNumbers: boolean;\n displayMonths: number;\n}\n\nexport interface DatepickerDateCustomClasses {\n date: Date;\n classes: string[];\n}\n\nexport interface DatepickerDateTooltipText {\n date: Date;\n tooltipText: string;\n}\n\n/** *************** */\n// events\n/** *************** */\nexport enum BsNavigationDirection {\n UP,\n DOWN\n}\n\n// used for navigation events, to change view date in state\nexport interface BsNavigationEvent {\n direction?: BsNavigationDirection;\n step?: TimeUnit;\n}\n\nexport interface BsViewNavigationEvent {\n unit?: TimeUnit;\n viewMode: BsDatepickerViewMode;\n}\n\nexport interface CellHoverEvent {\n cell: CalendarCellViewModel;\n isHovered: boolean;\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'bs-current-date',\n template: `<div class=\"current-timedate\"><span>{{ title }}</span></div>`\n})\nexport class BsCurrentDateViewComponent {\n @Input() title?: string;\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'bs-timepicker',\n template: `\n <div class=\"bs-timepicker-container\">\n <div class=\"bs-timepicker-controls\">\n <button class=\"bs-decrease\" type=\"button\">-</button>\n <input type=\"text\" [value]=\"hours\" placeholder=\"00\">\n <button class=\"bs-increase\" type=\"button\">+</button>\n </div>\n <div class=\"bs-timepicker-controls\">\n <button class=\"bs-decrease\" type=\"button\">-</button>\n <input type=\"text\" [value]=\"minutes\" placeholder=\"00\">\n <button class=\"bs-increase\" type=\"button\">+</button>\n </div>\n <button class=\"switch-time-format\" type=\"button\">{{ ampm }}\n <img\n src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAABi8KSDAAABSElEQVQYV3XQPUvDUBQG4HNuagtVqc6KgouCv6GIuIntYBLB9hcIQpLStCAIV7DYmpTcRWcXqZio3Vwc/UCc/QEqfgyKGbr0I7nS1EiHeqYzPO/h5SD0jaxUZjmSLCB+OFb+UFINFwASAEAdpu9gaGXVyAHHFQBkHpKHc6a9dzECvADyY9sqlAMsK9W0jzxDXqeytr3mhQckxSji27TJJ5/rPmIpwJJq3HrtduriYOurv1a4i1p5HnhkG9OFymi0ReoO05cGwb+ayv4dysVygjeFmsP05f8wpZQ8fsdvfmuY9zjWSNqUtgYFVnOVReILYoBFzdQI5/GGFzNHhGbeZnopDGU29sZbscgldmC99w35VOATTycIMMcBXIfpSVGzZhA6C8hh00conln6VQ9TGgV32OEAKQC4DrBq7CJwd0ggR7Vq/rPrfgB+C3sGypY5DAAAAABJRU5ErkJggg==\"\n alt=\"\">\n </button>\n </div>\n `\n})\nexport class BsTimepickerViewComponent {\n ampm = 'ok';\n hours = 0;\n minutes = 0;\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'bs-calendar-layout',\n template: `\n <!-- current date, will be added in nearest releases -->\n <bs-current-date title=\"hey there\" *ngIf=\"false\"></bs-current-date>\n\n <!--navigation-->\n <div class=\"bs-datepicker-head\">\n <ng-content select=\"bs-datepicker-navigation-view\"></ng-content>\n </div>\n\n <div class=\"bs-datepicker-body\">\n <ng-content></ng-content>\n </div>\n\n <!--timepicker-->\n <bs-timepicker *ngIf=\"false\"></bs-timepicker>\n `\n})\nexport class BsCalendarLayoutComponent {}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnInit,\n Renderer2\n} from '@angular/core';\n\nimport { BsDatepickerConfig } from '../../bs-datepicker.config';\nimport { DayViewModel } from '../../models';\n\n@Component({\n selector: '[bsDatepickerDayDecorator]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.disabled]': 'day.isDisabled',\n '[class.is-highlighted]': 'day.isHovered',\n '[class.is-other-month]': 'day.isOtherMonth',\n '[class.is-active-other-month]': 'day.isOtherMonthHovered',\n '[class.in-range]': 'day.isInRange',\n '[class.select-start]': 'day.isSelectionStart',\n '[class.select-end]': 'day.isSelectionEnd',\n '[class.selected]': 'day.isSelected'\n },\n template: `{{ day && day.label || '' }}`\n})\nexport class BsDatepickerDayDecoratorComponent implements OnInit {\n @Input() day: DayViewModel = { date: new Date(), label: '' };\n\n constructor(\n private _config: BsDatepickerConfig,\n private _elRef: ElementRef,\n private _renderer: Renderer2\n ) { }\n\n ngOnInit(): void {\n\n if (this.day?.isToday && this._config && this._config.customTodayClass) {\n this._renderer.addClass(this._elRef.nativeElement, this._config.customTodayClass);\n }\n\n if (typeof this.day?.customClasses === 'string') {\n this.day?.customClasses.split(' ')\n .filter((className: string) => className)\n .forEach((className: string) => {\n this._renderer.addClass(this._elRef.nativeElement, className);\n });\n }\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { BsDatepickerViewMode, BsNavigationDirection, NavigationViewModel } from '../../models';\n\n@Component({\n selector: 'bs-datepicker-navigation-view',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <button class=\"previous\"\n [disabled]=\"calendar.disableLeftArrow\"\n [style.visibility]=\"calendar.hideLeftArrow ? 'hidden' : 'visible'\"\n type=\"button\"\n (click)=\"navTo(true)\">\n <span>‹</span>\n </button>\n\n <ng-container *ngIf=\"calendar && calendar.monthTitle\">\n ​ <!-- zero-width space needed for correct alignment\n with preserveWhitespaces: false in Angular -->\n\n <button class=\"current\"\n type=\"button\"\n (click)=\"view('month')\"\n ><span>{{ calendar.monthTitle }}</span>\n </button>\n </ng-container>\n\n ​ <!-- zero-width space needed for correct alignment\n with preserveWhitespaces: false in Angular -->\n\n <button class=\"current\" (click)=\"view('year')\" type=\"button\">\n <span>{{ calendar.yearTitle }}</span>\n </button>\n\n ​ <!-- zero-width space needed for correct alignment\n with preserveWhitespaces: false in Angular -->\n\n <button class=\"next\"\n [disabled]=\"calendar.disableRightArrow\"\n [style.visibility]=\"calendar.hideRightArrow ? 'hidden' : 'visible'\"\n type=\"button\"\n (click)=\"navTo(false)\"><span>›</span>\n </button>\n `\n})\nexport class BsDatepickerNavigationViewComponent {\n @Input() calendar!: NavigationViewModel;\n\n @Output() onNavigate = new EventEmitter<BsNavigationDirection>();\n @Output() onViewMode = new EventEmitter<BsDatepickerViewMode>();\n\n navTo(down: boolean): void {\n this.onNavigate.emit(\n down ? BsNavigationDirection.DOWN : BsNavigationDirection.UP\n );\n }\n\n view(viewMode: BsDatepickerViewMode): void {\n this.onViewMode.emit(viewMode);\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\n\nimport { isSameDay } from 'ngx-bootstrap/chronos';\n\nimport {\n BsDatepickerViewMode,\n BsNavigationDirection,\n BsNavigationEvent,\n CellHoverEvent, DatepickerDateTooltipText,\n DatepickerRenderOptions,\n DaysCalendarViewModel,\n DayViewModel, WeekViewModel\n} from '../../models';\n\nimport { BsDatepickerConfig } from '../../bs-datepicker.config';\n\n@Component({\n selector: 'bs-days-calendar-view',\n // changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <bs-calendar-layout>\n <bs-datepicker-navigation-view\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"changeViewMode($event)\"\n ></bs-datepicker-navigation-view>\n <!--days matrix-->\n <table role=\"grid\" class=\"days weeks\">\n <thead>\n <tr>\n <!--if show weeks-->\n <th *ngIf=\"options && options.showWeekNumbers\"></th>\n <th *ngFor=\"let weekday of calendar.weekdays; let i = index\"\n aria-label=\"weekday\">{{ calendar.weekdays[i] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let week of calendar.weeks; let i = index\">\n <td class=\"week\" [class.active-week]=\"isWeekHovered\" *ngIf=\"options && options.showWeekNumbers\">\n <span *ngIf=\"isiOS\" (click)=\"selectWeek(week)\">{{ calendar.weekNumbers[i] }}</span>\n <span *ngIf=\"!isiOS\"\n (click)=\"selectWeek(week)\"\n (mouseenter)=\"weekHoverHandler(week, true)\"\n (mouseleave)=\"weekHoverHandler(week, false)\">{{ calendar.weekNumbers[i] }}</span>\n </td>\n <td *ngFor=\"let day of week.days\" role=\"gridcell\">\n\n <!-- When we want to show tooltips for dates -->\n <span *ngIf=\"!isiOS && isShowTooltip\" bsDatepickerDayDecorator\n [day]=\"day\"\n (click)=\"selectDay(day)\"\n tooltip=\"{{day.tooltipText}}\"\n (mouseenter)=\"hoverDay(day, true)\"\n (mouseleave)=\"hoverDay(day, false)\">{{ day.label }} 3</span>\n <!-- When tooltips for dates are disabled -->\n <span *ngIf=\"!isiOS && !isShowTooltip\" bsDatepickerDayDecorator\n [day]=\"day\"\n (click)=\"selectDay(day)\"\n (mouseenter)=\"hoverDay(day, true)\"\n (mouseleave)=\"hoverDay(day, false)\">{{ day.label }} 2</span>\n\n <!-- For mobile iOS view, tooltips are not needed -->\n <span *ngIf=\"isiOS\" bsDatepickerDayDecorator\n [day]=\"day\"\n (click)=\"selectDay(day)\">{{ day.label }} 1</span>\n </td>\n </tr>\n </tbody>\n </table>\n\n </bs-calendar-layout>\n `\n})\nexport class BsDaysCalendarViewComponent {\n @Input() calendar!: DaysCalendarViewModel;\n @Input() options?: DatepickerRenderOptions | null;\n\n @Output() onNavigate = new EventEmitter<BsNavigationEvent>();\n @Output() onViewMode = new EventEmitter<BsDatepickerViewMode>();\n\n @Output() onSelect = new EventEmitter<DayViewModel>();\n @Output() onHover = new EventEmitter<CellHoverEvent>();\n @Output() onHoverWeek = new EventEmitter<WeekViewModel>();\n\n isWeekHovered?: boolean;\n isiOS: boolean;\n isShowTooltip?: boolean;\n\n constructor(private _config: BsDatepickerConfig) {\n this.isiOS = (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\n if (this._config.dateTooltipTexts && this._config.dateTooltipTexts.length > 0) {\n this.isShowTooltip = true;\n }\n }\n\n navigateTo(event: BsNavigationDirection): void {\n const step = BsNavigationDirection.DOWN === event ? -1 : 1;\n this.onNavigate.emit({ step: { month: step } });\n }\n\n changeViewMode(event: BsDatepickerViewMode): void {\n this.onViewMode.emit(event);\n }\n\n selectDay(event: DayViewModel): void {\n this.onSelect.emit(event);\n }\n\n selectWeek(week: WeekViewModel): void {\n if (!this._config.selectWeek && !this._config.selectWeekDateRange) {\n return;\n }\n\n if (week.days.length === 0) {\n return;\n }\n\n if (this._config.selectWeek && week.days[0]\n && !week.days[0].isDisabled\n && this._config.selectFromOtherMonth) {\n\n this.onSelect.emit(week.days[0]);\n\n return;\n }\n\n const selectedDay = week.days.find((day: DayViewModel) => {\n return this._config.selectFromOtherMonth\n ? !day.isDisabled\n : !day.isOtherMonth && !day.isDisabled;\n });\n\n this.onSelect.emit(selectedDay);\n\n if (this._config.selectWeekDateRange) {\n const days = week.days.slice(0);\n const lastDayOfRange = days.reverse().find((day: DayViewModel) => {\n return this._config.selectFromOtherMonth\n ? !day.isDisabled\n : !day.isOtherMonth && !day.isDisabled;\n });\n\n this.onSelect.emit(lastDayOfRange);\n }\n }\n\n weekHoverHandler(cell: WeekViewModel, isHovered: boolean): void {\n if (!this._config.selectWeek && !this._config.selectWeekDateRange) {\n return;\n }\n\n const hasActiveDays = cell.days.find((day: DayViewModel) => {\n return this._config.selectFromOtherMonth\n ? !day.isDisabled\n : !day.isOtherMonth && !day.isDisabled;\n });\n\n if (hasActiveDays) {\n cell.isHovered = isHovered;\n this.isWeekHovered = isHovered;\n this.onHoverWeek.emit(cell);\n }\n }\n\n hoverDay(cell: DayViewModel, isHovered: boolean): void {\n if (this._config.selectFromOtherMonth && cell.isOtherMonth) {\n cell.isOtherMonthHovered = isHovered;\n }\n\n if (this._config.dateTooltipTexts) {\n cell.tooltipText = '';\n this._config.dateTooltipTexts.forEach((dateData: DatepickerDateTooltipText) => {\n\n if (isSameDay(dateData.date, cell.date)) {\n cell.tooltipText = dateData.tooltipText;\n\n return;\n }\n });\n }\n\n this.onHover.emit({ cell, isHovered });\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport {\n BsDatepickerViewMode,\n BsNavigationDirection,\n BsNavigationEvent,\n CellHoverEvent,\n MonthsCalendarViewModel,\n CalendarCellViewModel\n} from '../../models';\n\n@Component({\n selector: 'bs-month-calendar-view',\n template: `\n <bs-calendar-layout>\n <bs-datepicker-navigation-view\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"changeViewMode($event)\"\n ></bs-datepicker-navigation-view>\n\n <table role=\"grid\" class=\"months\">\n <tbody>\n <tr *ngFor=\"let row of calendar?.months\">\n <td *ngFor=\"let month of row\" role=\"gridcell\"\n (click)=\"viewMonth(month)\"\n (mouseenter)=\"hoverMonth(month, true)\"\n (mouseleave)=\"hoverMonth(month, false)\"\n [class.disabled]=\"month.isDisabled\"\n [class.is-highlighted]=\"month.isHovered\">\n <span [class.selected]=\"month.isSelected\">{{ month.label }}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </bs-calendar-layout>\n `\n})\nexport class BsMonthCalendarViewComponent {\n @Input() calendar!: MonthsCalendarViewModel;\n\n @Output() onNavigate = new EventEmitter<BsNavigationEvent>();\n @Output() onViewMode = new EventEmitter<BsDatepickerViewMode>();\n\n @Output() onSelect = new EventEmitter<CalendarCellViewModel>();\n @Output() onHover = new EventEmitter<CellHoverEvent>();\n\n navigateTo(event: BsNavigationDirection): void {\n const step = BsNavigationDirection.DOWN === event ? -1 : 1;\n this.onNavigate.emit({ step: { year: step } });\n }\n\n viewMonth(month: CalendarCellViewModel) {\n this.onSelect.emit(month);\n }\n\n hoverMonth(cell: CalendarCellViewModel, isHovered: boolean) {\n this.onHover.emit({ cell, isHovered });\n }\n\n changeViewMode(event: BsDatepickerViewMode): void {\n this.onViewMode.emit(event as BsDatepickerViewMode);\n }\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { yearsPerCalendar } from '../../engine/format-years-calendar';\nimport {\n BsDatepickerViewMode,\n BsNavigationDirection,\n BsNavigationEvent,\n CalendarCellViewModel,\n CellHoverEvent,\n YearsCalendarViewModel\n} from '../../models';\n\n@Component({\n selector: 'bs-years-calendar-view',\n template: `\n <bs-calendar-layout>\n <bs-datepicker-navigation-view\n [calendar]=\"calendar\"\n (onNavigate)=\"navigateTo($event)\"\n (onViewMode)=\"changeViewMode($event)\"\n ></bs-datepicker-navigation-view>\n\n <table role=\"grid\" class=\"years\">\n <tbody>\n <tr *ngFor=\"let row of calendar?.years\">\n <td *ngFor=\"let year of row\" role=\"gridcell\"\n (click)=\"viewYear(year)\"\n (mouseenter)=\"hoverYear(year, true)\"\n (mouseleave)=\"hoverYear(year, false)\"\n [class.disabled]=\"year.isDisabled\"\n [class.is-highlighted]=\"year.isHovered\">\n <span [class.selected]=\"year.isSelected\">{{ year.label }}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </bs-calendar-layout>\n `\n})\nexport class BsYearsCalendarViewComponent {\n @Input() calendar!: YearsCalendarViewModel;\n\n @Output() onNavigate = new EventEmitter<BsNavigationEvent>();\n @Output() onViewMode = new EventEmitter<BsDatepickerViewMode>();\n\n @Output() onSelect = new EventEmitter<CalendarCellViewModel>();\n @Output() onHover = new EventEmitter<CellHoverEvent>();\n\n navigateTo(event: BsNavigationDirection): void {\n const step = BsNavigationDirection.DOWN === event ? -1 : 1;\n this.onNavigate.emit({ step: { year: step * yearsPerCalendar } });\n }\n\n viewYear(year: CalendarCellViewModel) {\n this.onSelect.emit(year);\n }\n\n hoverYear(cell: CalendarCellViewModel, isHovered: boolean) {\n this.onHover.emit({ cell, isHovered });\n }\n\n changeViewMode(event: BsDatepickerViewMode): void {\n this.onViewMode.emit(event);\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n OnDestroy,\n OnInit,\n Renderer2,\n ViewChild\n} from '@angular/core';\n\nimport { take } from 'rxjs/operators';\nimport { Subscription } from 'rxjs';\n\nimport { getFullYear, getMonth } from 'ngx-bootstrap/chronos';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\nimport { TimepickerComponent } from 'ngx-bootstrap/timepicker';\n\nimport { datepickerAnimation } from '../../datepicker-animations';\nimport { BsDatepickerAbstractComponent } from '../../base/bs-datepicker-container';\nimport { BsDatepickerConfig } from '../../bs-datepicker.config';\nimport { CalendarCellViewModel, DayViewModel } from '../../models';\nimport { BsDatepickerActions } from '../../reducer/bs-datepicker.actions';\nimport { BsDatepickerEffects } from '../../reducer/bs-datepicker.effects';\nimport { BsDatepickerStore } from '../../reducer/bs-datepicker.store';\n\n@Component({\n selector: 'bs-datepicker-container',\n providers: [BsDatepickerStore, BsDatepickerEffects],\n templateUrl: './bs-datepicker-view.html',\n host: {\n class: 'bottom',\n '(click)': '_stopPropagation($event)',\n role: 'dialog',\n 'aria-label': 'calendar'\n },\n animations: [datepickerAnimation]\n})\nexport class BsDatepickerContainerComponent extends BsDatepickerAbstractComponent\n implements OnInit, AfterViewInit, OnDestroy {\n\n set value(value: Date|undefined) {\n this._effects?.setValue(value);\n }\n\n valueChange: EventEmitter<Date> = new EventEmitter<Date>();\n animationState = 'void';\n override isRangePicker = false;\n\n _subs: Subscription[] = [];\n\n @ViewChild('startTP') startTimepicker?: TimepickerComponent;\n\n constructor(\n _renderer: Renderer2,\n private _config: BsDatepickerConfig,\n private _store: BsDatepickerStore,\n private _element: ElementRef,\n private _actions: BsDatepickerActions,\n _effects: BsDatepickerEffects,\n private _positionService: PositioningService\n ) {\n super();\n this._effects = _effects;\n\n _renderer.setStyle(_element.nativeElement, 'display', 'block');\n _renderer.setStyle(_element.nativeElement, 'position', 'absolute');\n }\n\n ngOnInit(): void {\n this._positionService.setOptions({\n modifiers: {\n flip: {\n enabled: this._config.adaptivePosition\n },\n preventOverflow: {\n enabled: this._config.adaptivePosition\n }\n },\n allowedPositions: this._config.allowedPositions\n });\n\n this._positionService.event$?.pipe(take(1))\n .subscribe(() => {\n this._positionService.disable();\n\n if (this._config.isAnimated) {\n this.animationState = this.isTopPosition ? 'animated-up' : 'animated-down';\n\n return;\n }\n\n this.animationState = 'unanimated';\n });\n\n this.isOtherMonthsActive = this._config.selectFromOtherMonth;\n this.containerClass = this._config.containerClass;\n this.showTodayBtn = this._config.showTodayButton;\n this.todayBtnLbl = this._config.todayButtonLabel;\n this.todayPos = this._config.todayPosition;\n this.showClearBtn = this._config.showClearButton;\n this.clearBtnLbl = this._config.clearButtonLabel;\n this.clearPos = this._config.clearPosition;\n this.customRangeBtnLbl = this._config.customRangeButtonLabel;\n this.withTimepicker = this._config.withTimepicker;\n this._effects?.init(this._store)\n // intial state options\n .setOptions(this._config)\n // data binding view --> model\n .setBindings(this)\n // set event handlers\n .setEventHandlers(this)\n .registerDatepickerSideEffects();\n\n let currentDate: Date;\n // todo: move it somewhere else\n // on selected date change\n this._subs.push(\n this._store.select((state: any) => state.selectedDate).subscribe((date: any) => {\n currentDate = date;\n this.valueChange.emit(date);\n })\n );\n this._subs.push(\n this._store.select((state: any) => state.selectedTime).subscribe((time: any) => {\n if (!time[0] || !(time[0] instanceof Date) || time[0] === currentDate) {\n return;\n }\n\n this.valueChange.emit(time[0]);\n })\n );\n\n this._store.dispatch(this._actions.changeViewMode(this._config.startView));\n }\n\n ngAfterViewInit(): void {\n this.selectedTimeSub.add(this.selectedTime?.subscribe((val) => {\n if (Array.isArray(val) && val.length >= 1) {\n this.startTimepicker?.writeValue(val[0]);\n }\n }));\n this.startTimepicker?.registerOnChange((val: any) => {\n this.timeSelectHandler(val, 0);\n });\n }\n\n get isTopPosition(): boolean {\n return this._element.nativeElement.classList.contains('top');\n }\n\n positionServiceEnable(): void {\n this._positionService.enable();\n }\n\n override timeSelectHandler(date: Date, index: number) {\n this._store.dispatch(this._actions.selectTime(date, index));\n }\n\n override daySelectHandler(day: DayViewModel): void {\n if (!day) {\n return;\n }\n\n const isDisabled = this.isOtherMonthsActive ? day.isDisabled : (day.isOtherMonth || day.isDisabled);\n\n if (isDisabled) {\n return;\n }\n\n this._store.dispatch(this._actions.select(day.date));\n }\n\n override monthSelectHandler(day: CalendarCellViewModel): void {\n if (!day || day.isDisabled) {\n return;\n }\n\n this._store.dispatch(\n this._actions.navigateTo({\n unit: {\n month: getMonth(day.date),\n year: getFullYear(day.date)\n },\n viewMode: 'day'\n })\n );\n }\n\n override yearSelectHandler(day: CalendarCellViewModel): void {\n if (!day || day.isDisabled) {\n return;\n }\n\n this._store.dispatch(\n this._actions.navigateTo({\n unit: {\n year: getFullYear(day.date)\n },\n viewMode: 'month'\n })\n );\n }\n\n override setToday(): void {\n this._store.dispatch(this._actions.select(new Date()));\n }\n\n override clearDate(): void {\n this._store.dispatch(this._actions.select(undefined));\n }\n\n ngOnDestroy(): void {\n for (const sub of this._subs) {\n sub.unsubscribe();\n }\n this.selectedTimeSub.unsubscribe();\n this._effects?.destroy();\n }\n}\n","import {\n AfterViewInit,\n ComponentRef,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n SimpleChanges,\n ViewContainerRef\n} from '@angular/core';\nimport { ComponentLoader, ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\nimport { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\nimport { BsDatepickerConfig } from './bs-datepicker.config';\nimport { BsDatepickerViewMode, DatepickerDateCustomClasses, DatepickerDateTooltipText } from './models';\nimport { BsDatepickerContainerComponent } from './themes/bs/bs-datepicker-container.component';\nimport { copyTime } from './utils/copy-time-utils';\nimport { checkBsValue, setCurrentTimeOnDateSelect } from './utils/bs-calendar-utils';\n\n@Directive({\n selector: '[bsDatepicker]',\n exportAs: 'bsDatepicker'\n})\nexport class BsDatepickerDirective implements OnInit, OnDestroy, OnChanges, AfterViewInit {\n /**\n * Placement of a datepicker. Accepts: \"top\", \"bottom\", \"left\", \"right\"\n */\n @Input() placement: 'top' | 'bottom' | 'left' | 'right' = 'bottom';\n /**\n * Specifies events that should trigger. Supports a space separated list of\n * event names.\n */\n @Input() triggers = 'click';\n /**\n * Close datepicker on outside click\n */\n @Input() outsideClick = true;\n /**\n * A selector specifying the element the datepicker should be appended to.\n */\n @Input() container = 'body';\n\n @Input() outsideEsc = true;\n /**\n * Emits an event when the datepicker is shown\n */\n @Output() onShown: EventEmitter<unknown>;\n /**\n * Emits an event when the datepicker is hidden\n */\n @Output() onHidden: EventEmitter<unknown>;\n isOpen$: BehaviorSubject<boolean>;\n isDestroy$ = new Subject();\n /**\n * Indicates whether datepicker's content is enabled or not\n */\n @Input() isDisabled = false;\n /**\n * Minimum date which is available for selection\n */\n @Input() minDate?: Date;\n /**\n * Maximum date which is available for selection\n */\n @Input() maxDate?: Date;\n /**\n * Minimum view mode : day, month, or year\n */\n @Input() minMode?: BsDatepickerViewMode;\n /**\n * Disable Certain days in the week\n */\n @Input() daysDisabled?: number[];\n /**\n * Disable specific dates\n */\n @Input() datesDisabled?: Date[];\n /**\n * Enable specific dates\n */\n @Input() datesEnabled?: Date[];\n /**\n * Date custom classes\n */\n @Input() dateCustomClasses?: DatepickerDateCustomClasses[];\n /**\n * Date tooltip text\n */\n @Input() dateTooltipTexts?: DatepickerDateTooltipText[];\n /**\n * Emits when datepicker value has been changed\n */\n @Output() bsValueChange: EventEmitter<Date> = new EventEmitter();\n protected _subs: Subscription[] = [];\n private _datepicker: ComponentLoader<BsDatepickerContainerComponent>;\n private _datepickerRef?: ComponentRef<BsDatepickerContainerComponent>;\n private readonly _dateInputFormat$ = new Subject<string | undefined>();\n\n constructor(public _config: BsDatepickerConfig,\n private _elementRef: ElementRef,\n private _renderer: Renderer2,\n _viewContainerRef: ViewContainerRef,\n cis: ComponentLoaderFactory) {\n // todo: assign only subset of fields\n Object.assign(this, this._config);\n this._datepicker = cis.createLoader<BsDatepickerContainerComponent>(\n _elementRef,\n _viewContainerRef,\n _renderer\n );\n this.onShown = this._datepicker.onShown;\n this.onHidden = this._datepicker.onHidden;\n this.isOpen$ = new BehaviorSubject(this.isOpen);\n }\n\n /**\n * Returns whether or not the datepicker is currently being shown\n */\n @Input()\n get isOpen(): boolean {\n return this._datepicker.isShown;\n }\n\n set isOpen(value: boolean) {\n this.isOpen$.next(value);\n }\n\n _bsValue?: Date;\n\n /**\n * Initial value of datepicker\n */\n @Input()\n set bsValue(value: Date | undefined) {\n if (this._bsValue && value && this._bsValue.getTime() === value.getTime()) {\n return;\n }\n\n if (!this._bsValue && value && !this._config.withTimepicker) {\n const now = new Date();\n copyTime(value, now);\n }\n\n if (value && this.bsConfig?.initCurrentTime) {\n value = setCurrentTimeOnDateSelect(value);\n }\n\n this._bsValue = value;\n this.bsValueChange.emit(value);\n }\n\n get dateInputFormat$(): Observable<string | undefined> {\n return this._dateInputFormat$;\n }\n\n /**\n * Config object for datepicker\n */\n @Input() bsConfig?: Partial<BsDatepickerConfig>;\n\n ngOnInit(): void {\n this._datepicker.listen({\n outsideClick: this.outsideClick,\n outsideEsc: this.outsideEsc,\n triggers: this.triggers,\n show: () => this.show()\n });\n this.setConfig();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"bsConfig\"]) {\n if (changes[\"bsConfig\"].currentValue?.initCurrentTime && changes[\"bsConfig\"].currentValue?.initCurrentTime !== changes[\"bsConfig\"].previousValue?.initCurrentTime && this._bsValue) {\n this._bsValue = setCurrentTimeOnDateSelect(this._bsValue);\n this.bsValueChange.emit(this._bsValue);\n }\n\n this.setConfig();\n this._dateInputFormat$.next(this.bsConfig && this.bsConfig.dateInputFormat);\n }\n\n if (!this._datepickerRef || !this._datepickerRef.instance) {\n return;\n }\n\n if (changes[\"minDate\"]) {\n this._datepickerRef.instance.minDate = this.minDate;\n }\n\n if (changes[\"maxDate\"]) {\n this._datepickerRef.instance.maxDate = this.maxDate;\n }\n\n if (changes[\"daysDisabled\"]) {\n this._datepickerRef.instance.daysDisabled = this.daysDisabled;\n }\n\n if (changes[\"datesDisabled\"]) {\n this._datepickerRef.instance.datesDisabled = this.datesDisabled;\n }\n\n if (changes[\"datesEnabled\"]) {\n this._datepickerRef.instance.datesEnabled = this.datesEnabled;\n }\n\n if (changes[\"isDisabled\"]) {\n if (this._elementRef?.nativeElement) {\n this._elementRef.nativeElement.setAttribute('readonly', this.isDisabled);\n }\n this._datepickerRef.instance.isDisabled = this.isDisabled;\n }\n\n if (changes[\"dateCustomClasses\"]) {\n this._datepickerRef.instance.dateCustomClasses = this.dateCustomClasses;\n }\n\n if (changes[\"dateTooltipTexts\"]) {\n this._datepickerRef.instance.dateTooltipTexts = this.dateTooltipTexts;\n }\n }\n\n initSubscribes() {\n // if date changes from external source (model -> view)\n this._subs.push(\n this.bsValueChange.subscribe((value: Date) => {\n if (this._datepickerRef) {\n this._datepickerRef.instance.value = value;\n }\n })\n );\n\n // if date changes from picker (view -> model)\n if (this._datepickerRef) {\n this._subs.push(\n this._datepickerRef.instance.valueChange.subscribe((value: Date) => {\n this.bsValue = value;\n this.hide();\n })\n );\n }\n }\n\n ngAfterViewInit(): void {\n this.isOpen$.pipe(\n filter(isOpen => isOpen !== this.isOpen),\n takeUntil(this.isDestroy$)\n )\n .subscribe(() => this.toggle());\n }\n\n /**\n * Opens an element’s datepicker. This is considered a “manual†triggering of\n * the datepicker.\n */\n show(): void {\n if (this._datepicker.isShown) {\n return;\n }\n\n this.setConfig();\n\n this._datepickerRef = this._datepicker\n .provide({ provide: BsDatepickerConfig, useValue: this._config })\n .attach(BsDatepickerContainerComponent)\n .to(this.container)\n .position({ attachment: this.placement })\n .show({ placement: this.placement });\n\n this.initSubscribes();\n }\n\n /**\n * Closes an element’s datepicker. This is considered a “manual†triggering of\n * the datepicker.\n */\n hide(): void {\n if (this.isOpen) {\n this._datepicker.hide();\n }\n for (const sub of this._subs) {\n sub.unsubscribe();\n }\n\n if (this._config.returnFocusToInput) {\n this._renderer.selectRootElement(this._elementRef.nativeElement).focus();\n }\n }\n\n /**\n * Toggles an element’s datepicker. This is considered a “manual†triggering\n * of the datepicker.\n */\n toggle(): void {\n if (this.isOpen) {\n return this.hide();\n }\n\n this.show();\n }\n\n /**\n * Set config for datepicker\n */\n setConfig(): void {\n this._config = Object.assign({}, this._config, this.bsConfig, {\n value: checkBsValue(this._bsValue, this.maxDate || this.bsConfig && this.bsConfig.maxDate),\n isDisabled: this.isDisabled,\n minDate: this.minDate || this.bsConfig && this.bsConfig.minDate,\n maxDate: this.maxDate || this.bsConfig && this.bsConfig.maxDate,\n daysDisabled: this.daysDisabled || this.bsConfig && this.bsConfig.daysDisabled,\n dateCustomClasses: this.dateCustomClasses || this.bsConfig && this.bsConfig.dateCustomClasses,\n dateTooltipTexts: this.dateTooltipTexts || this.bsConfig && this.bsConfig.dateTooltipTexts,\n datesDisabled: this.datesDisabled || this.bsConfig && this.bsConfig.datesDisabled,\n datesEnabled: this.datesEnabled || this.bsConfig && this.bsConfig.datesEnabled,\n minMode: this.minMode || this.bsConfig && this.bsConfig.minMode,\n initCurrentTime: this.bsConfig?.initCurrentTime\n });\n }\n\n unsubscribeSubscriptions() {\n if (this._subs?.length) {\n this._subs.map(sub => sub.unsubscribe());\n this._subs.length = 0;\n }\n }\n\n ngOnDestroy(): void {\n this._datepicker.dispose();\n this.isOpen$.next(false);\n if (this.isDestroy$) {\n this.isDestroy$.next(null);\n this.isDestroy$.complete();\n }\n this.unsubscribeSubscriptions();\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n OnDestroy,\n OnInit,\n Renderer2,\n ViewChild\n} from '@angular/core';\n\nimport { take } from 'rxjs/operators';\nimport { Subscription } from 'rxjs';\n\nimport { getFullYear, getMonth } from 'ngx-bootstrap/chronos';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\nimport { TimepickerComponent } from 'ngx-bootstrap/timepicker';\n\nimport { BsDatepickerAbstractComponent } from '../../base/bs-datepicker-container';\nimport { BsDatepickerConfig } from '../../bs-datepicker.config';\nimport { CalendarCellViewModel, DayViewModel } from '../../models';\nimport { BsDatepickerActions } from '../../reducer/bs-datepicker.actions';\nimport { BsDatepickerEffects } from '../../reducer/bs-datepicker.effects';\nimport { BsDatepickerStore } from '../../reducer/bs-datepicker.store';\nimport { datepickerAnimation } from '../../datepicker-animations';\nimport { BsCustomDates } from './bs-custom-dates-view.component';\nimport { dayInMilliseconds } from '../../reducer/_defaults';\n\n@Component({\n selector: 'bs-daterangepicker-container',\n providers: [BsDatepickerStore, BsDatepickerEffects],\n templateUrl: './bs-datepicker-view.html',\n host: {\n class: 'bottom',\n '(click)': '_stopPropagation($event)',\n role: 'dialog',\n 'aria-label': 'calendar'\n },\n animations: [datepickerAnimation]\n})\nexport class BsDaterangepickerContainerComponent extends BsDatepickerAbstractComponent\n implements OnInit, OnDestroy, AfterViewInit {\n\n set value(value: (Date|undefined)[] | undefined) {\n this._effects?.setRangeValue(value);\n }\n\n valueChange = new EventEmitter<Date[]>();\n animationState = 'void';\n\n _rangeStack: Date[] = [];\n override chosenRange: Date[] = [];\n _subs: Subscription[] = [];\n override isRangePicker = true;\n\n @ViewChild('startTP') startTimepicker?: TimepickerComponent;\n @ViewChild('endTP') endTimepicker?: TimepickerComponent;\n\n constructor(\n _renderer: Renderer2,\n private _config: BsDatepickerConfig,\n private _store: BsDatepickerStore,\n private _element: ElementRef,\n private _actions: BsDatepickerActions,\n _effects: BsDatepickerEffects,\n private _positionService: PositioningService\n ) {\n super();\n this._effects = _effects;\n\n this.customRanges = this._config.ranges || [];\n this.customRangeBtnLbl = this._config.customRangeButtonLabel;\n\n _renderer.setStyle(_element.nativeElement, 'display', 'block');\n _renderer.setStyle(_element.nativeElement, 'position', 'absolute');\n }\n\n ngOnInit(): void {\n this._positionService.setOptions({\n modifiers: {\n flip: {\n enabled: this._config.adaptivePosition\n },\n preventOverflow: {\n enabled: this._config.adaptivePosition\n }\n },\n allowedPositions: this._config.allowedPositions\n });\n\n this._positionService.event$?.pipe(take(1))\n .subscribe(() => {\n this._positionService.disable();\n\n if (this._config.isAnimated) {\n this.animationState = this.isTopPosition ? 'animated-up' : 'animated-down';\n\n return;\n }\n\n this.animationState = 'unanimated';\n });\n this.containerClass = this._config.containerClass;\n this.isOtherMonthsActive = this._config.selectFromOtherMonth;\n this.withTimepicker = this._config.withTimepicker;\n this._effects?.init(this._store)\n // intial state options\n // todo: fix this, split configs\n .setOptions(this._config)\n // data binding view --> model\n .setBindings(this)\n // set event handlers\n .setEventHandlers(this)\n .registerDatepickerSideEffects();\n let currentDate: Date[] | undefined;\n // todo: move it somewhere else\n // on selected date change\n this._subs.push(\n this._store\n .select(state => state.selectedRange)\n .subscribe(dateRange => {\n currentDate = dateRange;\n this.valueChange.emit(dateRange);\n this.chosenRange = dateRange || [];\n })\n );\n\n this._subs.push(\n this._store\n .select(state => state.selectedTime)\n .subscribe((time:any) => {\n if ((!time[0] || !time[1]) ||\n (!(time[0] instanceof Date) || !(time[1] instanceof Date)) ||\n (currentDate && (time[0] === currentDate[0] && time[1] === currentDate[1]))\n ) {\n return;\n }\n\n this.valueChange.emit(time);\n this.chosenRange = time || [];\n })\n );\n }\n\n ngAfterViewInit(): void {\n this.selectedTimeSub.add(this.selectedTime?.subscribe((val) => {\n if (Array.isArray(val) && val.length >= 2) {\n this.startTimepicker?.writeValue(val[0]);\n this.endTimepicker?.writeValue(val[1]);\n }\n }));\n this.startTimepicker?.registerOnChange((val) => {\n this.timeSelectHandler(val, 0);\n });\n this.endTimepicker?.registerOnChange((val) => {\n this.timeSelectHandler(val, 1);\n });\n }\n\n get isTopPosition(): boolean {\n return this._element.nativeElement.classList.contains('top');\n }\n\n positionServiceEnable(): void {\n this._positionService.enable();\n }\n\n override timeSelectHandler(date: Date, index: number): void {\n this._store.dispatch(this._actions.selectTime(date, index));\n }\n\n override daySelectHandler(day: DayViewModel): void {\n if (!day) {\n return;\n }\n const isDisabled = this.isOtherMonthsActive ? day.isDisabled : (day.isOtherMonth || day.isDisabled);\n\n if (isDisabled) {\n return;\n }\n this.rangesProcessing(day);\n }\n\n override monthSelectHandler(day: CalendarCellViewModel): void {\n if (!day || day.isDisabled) {\n return;\n }\n\n day.isSelected = true;\n\n if (this._config.minMode !== 'month') {\n if (day.isDisabled) {\n return;\n }\n this._store.dispatch(\n this._actions.navigateTo({\n unit: {\n month: getMonth(day.date),\n year: getFullYear(day.date)\n },\n viewMode: 'day'\n })\n );\n\n return;\n }\n this.rangesProcessing(day);\n }\n\n override yearSelectHandler(day: CalendarCellViewModel): void {\n if (!day || day.isDisabled) {\n return;\n }\n\n day.isSelected = true;\n\n if (this._config.minMode !== 'year') {\n if (day.isDisabled) {\n return;\n }\n this._store.dispatch(\n this._actions.navigateTo({\n unit: {\n year: getFullYear(day.date)\n },\n viewMode: 'month'\n })\n );\n\n return;\n }\n this.rangesProcessing(day);\n }\n\n rangesProcessing(day: CalendarCellViewModel): void {\n // if only one date is already selected\n // and user clicks on previous date\n // start selection from new date\n // but if new date is after initial one\n // than finish selection\n\n if (this._rangeStack.length === 1) {\n this._rangeStack =\n day.date >= this._rangeStack[0]\n ? [this._rangeStack[0], day.date]\n : [day.date];\n }\n\n if (this._config.maxDateRange) {\n this.setMaxDateRangeOnCalendar(day.date);\n }\n\n if (this._rangeStack.length === 0) {\n this._rangeStack = [day.date];\n\n if (this._config.maxDateRange) {\n this.setMaxDateRangeOnCalendar(day.date);\n }\n }\n\n this._store.dispatch(this._actions.selectRange(this._rangeStack));\n\n if (this._rangeStack.length === 2) {\n this._rangeStack = [];\n }\n }\n\n ngOnDestroy(): void {\n for (const sub of this._subs) {\n sub.unsubscribe();\n }\n this.selectedTimeSub.unsubscribe();\n this._effects?.destroy();\n }\n\n override setRangeOnCalendar(dates: BsCustomDates): void {\n if (dates) {\n this._rangeStack = dates.value instanceof Date ? [dates.value] : dates.value;\n }\n this._store.dispatch(this._actions.selectRange(this._rangeStack));\n }\n\n setMaxDateRangeOnCalendar(currentSelection: Date): void {\n let maxDateRange = new Date(currentSelection);\n\n if (this._config.maxDate) {\n const maxDateValueInMilliseconds = this._config.maxDate.getTime();\n const maxDateRangeInMilliseconds = currentSelection.getTime() + ((this._config.maxDateRange || 0) * dayInMilliseconds );\n maxDateRange = maxDateRangeInMilliseconds > maxDateValueInMilliseconds ?\n new Date(this._config.maxDate) :\n new Date(maxDateRangeInMilliseconds);\n } else {\n maxDateRange.setDate(currentSelection.getDate() + (this._config.maxDateRange || 0));\n }\n\n this._effects?.setMaxDate(maxDateRange);\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n forwardRef,\n Host,\n OnDestroy,\n OnInit,\n Provider,\n Renderer2\n} from '@angular/core';\n\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator\n} from '@angular/forms';\n\nimport {\n formatDate,\n getLocale,\n isAfter,\n isBefore,\n isDate,\n isDateValid,\n parseDate,\n utcAsLocal\n} from 'ngx-bootstrap/chronos';\n\nimport { BsDatepickerDirective } from './bs-datepicker.component';\nimport { BsLocaleService } from './bs-locale.service';\nimport { Subscription } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\n\nconst BS_DATEPICKER_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BsDatepickerInputDirective),\n multi: true\n};\n\nconst BS_DATEPICKER_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => BsDatepickerInputDirective),\n multi: true\n};\n\n@Directive({\n selector: `input[bsDatepicker]`,\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '(change)': 'onChange($event)',\n '(keyup.esc)': 'hide()',\n '(keydown)': 'onKeydownEvent($event)',\n '(blur)': 'onBlur()'\n },\n providers: [BS_DATEPICKER_VALUE_ACCESSOR, BS_DATEPICKER_VALIDATOR]\n})\nexport class BsDatepickerInputDirective\n implements ControlValueAccessor, Validator, OnInit, OnDestroy {\n private _onChange = Function.prototype;\n private _onTouched = Function.prototype;\n private _validatorChange = Function.prototype;\n private _value?: Date;\n private _subs = new Subscription();\n\n constructor(@Host() private _picker: BsDatepickerDirective,\n private _localeService: BsLocaleService,\n private _renderer: Renderer2,\n private _elRef: ElementRef,\n private changeDetection: ChangeDetectorRef) {}\n\n ngOnInit() {\n const setBsValue = (value: Date) => {\n this._setInputValue(value);\n if (this._value !== value) {\n this._value = value;\n this._onChange(value);\n this._onTouched();\n }\n this.changeDetection.markForCheck();\n };\n\n // if value set via [bsValue] it will not get into value change\n if (this._picker._bsValue) {\n setBsValue(this._picker._bsValue);\n }\n\n // update input value on datepicker value update\n this._subs.add(\n this._picker.bsValueChange.subscribe(setBsValue)\n );\n\n // update input value on locale change\n this._subs.add(\n this._localeService.localeChange.subscribe(() => {\n this._setInputValue(this._value);\n })\n );\n\n this._subs.add(\n this._picker.dateInputFormat$.pipe(distinctUntilChanged()).subscribe(() => {\n this._setInputValue(this._value);\n })\n );\n}\n\n ngOnDestroy() {\n this._subs.unsubscribe();\n }\n\n onKeydownEvent(event: KeyboardEvent): void {\n if (event.keyCode === 13 || event.code === 'Enter') {\n this.hide();\n }\n }\n\n _setInputValue(value?: Date): void {\n const initialDate = !value ? ''\n : formatDate(value, this._picker._config.dateInputFormat, this._localeService.currentLocale);\n\n this._renderer.setProperty(this._elRef.nativeElement, 'value', initialDate);\n }\n\n onChange(event: Event) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.writeValue((event.target as any).value);\n this._onChange(this._value);\n if (this._picker._config.returnFocusToInput) {\n this._renderer.selectRootElement(this._elRef.nativeElement).focus();\n }\n this._onTouched();\n }\n\n validate(c: AbstractControl): ValidationErrors | null {\n const _value: Date | string = c.value;\n\n if (_value === null || _value === undefined || _value === '') {\n return null;\n }\n\n if (isDate(_value)) {\n const _isDateValid = isDateValid(_value);\n if (!_isDateValid) {\n return { bsDate: { invalid: _value } };\n }\n\n if (this._picker && this._picker.minDate && isBefore(_value, this._picker.minDate, 'date')) {\n this.writeValue(this._picker.minDate);\n\n return { bsDate: { minDate: this._picker.minDate } };\n }\n\n if (this._picker && this._picker.maxDate && isAfter(_value, this._picker.maxDate, 'date')) {\n this.writeValue(this._picker.maxDate);\n\n return { bsDate: { maxDate: this._picker.maxDate } };\n }\n }\n\n return null;\n }\n\n registerOnValidatorChange(fn: () => void): void {\n this._validatorChange = fn;\n }\n\n writeValue(value: Date | string) {\n if (!value) {\n this._value = void 0;\n } else {\n const _localeKey = this._localeService.currentLocale;\n const _locale = getLocale(_localeKey);\n if (!_locale) {\n throw new Error(\n `Locale \"${_localeKey}\" is not defined, please add it with \"defineLocale(...)\"`\n );\n }\n\n this._value = parseDate(value, this._picker._config.dateInputFormat, this._localeService.currentLocale);\n\n if (this._picker._config.useUtc) {\n this._value = utcAsLocal(this._value);\n }\n }\n\n this._picker.bsValue = this._value;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._picker.isDisabled = isDisabled;\n if (isDisabled) {\n this._renderer.setAttribute(this._elRef.nativeElement, 'disabled', 'disabled');\n\n return;\n }\n this._renderer.removeAttribute(this._elRef.nativeElement, 'disabled');\n }\n\n registerOnChange(fn: () => void): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n onBlur() {\n this._onTouched();\n }\n\n hide() {\n this._picker.hide();\n this._renderer.selectRootElement(this._elRef.nativeElement).blur();\n if (this._picker._config.returnFocusToInput) {\n this._renderer.selectRootElement(this._elRef.nativeElement).focus();\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BsDatepickerConfig } from './bs-datepicker.config';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BsDaterangepickerConfig extends BsDatepickerConfig {\n // DatepickerRenderOptions\n override displayMonths = 2;\n}\n","import { AfterViewInit, ComponentRef,\n Directive, ElementRef, EventEmitter,\n Input, OnChanges, OnDestroy, OnInit,\n Output, Renderer2, SimpleChanges,\n ViewContainerRef\n} from '@angular/core';\nimport { BsDaterangepickerConfig } from './bs-daterangepicker.config';\nimport { BsDaterangepickerContainerComponent } from './themes/bs/bs-daterangepicker-container.component';\nimport { Observable, Subscription, Subject, BehaviorSubject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\nimport { ComponentLoaderFactory, ComponentLoader } from 'ngx-bootstrap/component-loader';\nimport { BsDatepickerConfig } from './bs-datepicker.config';\nimport { DatepickerDateCustomClasses } from './models';\nimport {\n checkBsValue,\n checkRangesWithMaxDate,\n setDateRangesCurrentTimeOnDateSelect\n} from './utils/bs-calendar-utils';\n\n@Directive({\n selector: '[bsDaterangepicker]',\n exportAs: 'bsDaterangepicker'\n})\nexport class BsDaterangepickerDirective\n implements OnInit, OnDestroy, OnChanges, AfterViewInit {\n /**\n * Placement of a daterangepicker. Accepts: \"top\", \"bottom\", \"left\", \"right\"\n */\n @Input() placement: 'top' | 'bottom' | 'left' | 'right' = 'bottom';\n /**\n * Specifies events that should trigger. Supports a space separated list of\n * event names.\n */\n @Input() triggers = 'click';\n /**\n * Close daterangepicker on outside click\n */\n @Input() outsideClick = true;\n /**\n * A selector specifying the element the daterangepicker should be appended to.\n */\n @Input() container = 'body';\n\n @Input() outsideEsc = true;\n\n /**\n * Returns whether or not the daterangepicker is currently being shown\n */\n @Input()\n get isOpen(): boolean {\n return this._datepicker.isShown;\n }\n\n set isOpen(value: boolean) {\n this.isOpen$.next(value);\n }\n\n /**\n * Emits an event when the daterangepicker is shown\n */\n @Output() onShown: EventEmitter<unknown>;\n /**\n * Emits an event when the daterangepicker is hidden\n */\n @Output() onHidden: EventEmitter<unknown>;\n\n _bsValue?: (Date|undefined)[];\n isOpen$: BehaviorSubject<boolean>;\n isDestroy$ = new Subject();\n\n /**\n * Initial value of daterangepicker\n */\n @Input()\n set bsValue(value: (Date|undefined)[] | undefined) {\n if (this._bsValue === value) {\n return;\n }\n\n if (value && this.bsConfig?.initCurrentTime) {\n value = setDateRangesCurrentTimeOnDateSelect(value);\n }\n\n this._bsValue = value;\n this.bsValueChange.emit(value);\n }\n\n /**\n * Config object for daterangepicker\n */\n @Input() bsConfig?: Partial<BsDaterangepickerConfig>;\n /**\n * Indicates whether daterangepicker's content is enabled or not\n */\n @Input() isDisabled = false;\n /**\n * Minimum date which is available for selection\n */\n @Input() minDate?: Date;\n /**\n * Maximum date which is available for selection\n */\n @Input() maxDate?: Date;\n /**\n * Date custom classes\n */\n @Input() dateCustomClasses?: DatepickerDateCustomClasses[];\n /**\n * Disable specific days, e.g. [0,6] will disable all Saturdays and Sundays\n */\n @Input() daysDisabled?: number[];\n /**\n * Disable specific dates\n */\n @Input() datesDisabled?: Date[];\n\n /**\n * Enable specific dates\n */\n @Input() datesEnabled?: Date[];\n /**\n * Emits when daterangepicker value has been changed\n */\n @Output() bsValueChange = new EventEmitter<((Date|undefined)[]|undefined)>();\n\n get rangeInputFormat$(): Observable<string> {\n return this._rangeInputFormat$;\n }\n\n protected _subs: Subscription[] = [];\n private _datepicker: ComponentLoader<BsDaterangepickerContainerComponent>;\n private _datepickerRef?: ComponentRef<BsDaterangepickerContainerComponent>;\n private readonly _rangeInputFormat$ = new Subject<string>();\n\n constructor(public _config: BsDaterangepickerConfig,\n private _elementRef: ElementRef,\n private _renderer: Renderer2,\n _viewContainerRef: ViewContainerRef,\n cis: ComponentLoaderFactory) {\n this._datepicker = cis.createLoader<BsDaterangepickerContainerComponent>(\n _elementRef,\n _viewContainerRef,\n _renderer\n );\n Object.assign(this, _config);\n this.onShown = this._datepicker.onShown;\n this.onHidden = this._datepicker.onHidden;\n this.isOpen$ = new BehaviorSubject(this.isOpen);\n }\n\n ngOnInit(): void {\n this.isDestroy$ = new Subject();\n this._datepicker.listen({\n outsideClick: this.outsideClick,\n outsideEsc: this.outsideEsc,\n triggers: this.triggers,\n show: () => this.show()\n });\n this.setConfig();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"bsConfig\"]) {\n if (changes[\"bsConfig\"].currentValue?.initCurrentTime && changes[\"bsConfig\"].currentValue?.initCurrentTime !== changes[\"bsConfig\"].previousValue?.initCurrentTime && this._bsValue) {\n this._bsValue = setDateRangesCurrentTimeOnDateSelect(this._bsValue);\n this.bsValueChange.emit(this._bsValue);\n }\n\n this.setConfig();\n this._rangeInputFormat$.next(changes[\"bsConfig\"].currentValue && changes[\"bsConfig\"].currentValue.rangeInputFormat);\n }\n\n\n if (!this._datepickerRef || !this._datepickerRef.instance) {\n return;\n }\n if (changes[\"minDate\"]) {\n this._datepickerRef.instance.minDate = this.minDate;\n }\n if (changes[\"maxDate\"]) {\n this._datepickerRef.instance.maxDate = this.maxDate;\n }\n if (changes[\"datesDisabled\"]) {\n this._datepickerRef.instance.datesDisabled = this.datesDisabled;\n }\n if (changes[\"datesEnabled\"]) {\n this._datepickerRef.instance.datesEnabled = this.datesEnabled;\n }\n if (changes[\"daysDisabled\"]) {\n this._datepickerRef.instance.daysDisabled = this.daysDisabled;\n }\n if (changes[\"isDisabled\"]) {\n if (this._elementRef?.nativeElement) {\n this._elementRef.nativeElement.setAttribute('readonly', this.isDisabled);\n }\n this._datepickerRef.instance.isDisabled = this.isDisabled;\n }\n if (changes[\"dateCustomClasses\"]) {\n this._datepickerRef.instance.dateCustomClasses = this.dateCustomClasses;\n }\n }\n\n ngAfterViewInit(): void {\n this.isOpen$.pipe(\n filter(isOpen => isOpen !== this.isOpen),\n takeUntil(this.isDestroy$)\n )\n .subscribe(() => this.toggle());\n }\n\n /**\n * Opens an element’s datepicker. This is considered a “manual†triggering of\n * the datepicker.\n */\n show(): void {\n if (this._datepicker.isShown) {\n return;\n }\n\n this.setConfig();\n\n this._datepickerRef = this._datepicker\n .provide({ provide: BsDatepickerConfig, useValue: this._config })\n .attach(BsDaterangepickerContainerComponent)\n .to(this.container)\n .position({ attachment: this.placement })\n .show({ placement: this.placement });\n\n this.initSubscribes();\n }\n\n initSubscribes() {\n // if date changes from external source (model -> view)\n this._subs.push(\n this.bsValueChange.subscribe((value: Date[]) => {\n if (this._datepickerRef) {\n this._datepickerRef.instance.value = value;\n }\n })\n );\n\n // if date changes from picker (view -> model)\n if (this._datepickerRef) {\n this._subs.push(\n this._datepickerRef.instance.valueChange\n .pipe(\n filter((range: Date[]) => range && range[0] && !!range[1])\n )\n .subscribe((value: Date[]) => {\n this.bsValue = value;\n this.hide();\n })\n );\n }\n }\n\n /**\n * Set config for daterangepicker\n */\n setConfig() {\n this._config = Object.assign(\n {},\n this._config,\n this.bsConfig,\n {\n value: checkBsValue(this._bsValue, this.maxDate || this.bsConfig && this.bsConfig.maxDate),\n isDisabled: this.isDisabled,\n minDate: this.minDate || this.bsConfig && this.bsConfig.minDate,\n maxDate: this.maxDate || this.bsConfig && this.bsConfig.maxDate,\n daysDisabled: this.daysDisabled || this.bsConfig && this.bsConfig.daysDisabled,\n dateCustomClasses: this.dateCustomClasses || this.bsConfig && this.bsConfig.dateCustomClasses,\n datesDisabled: this.datesDisabled || this.bsConfig && this.bsConfig.datesDisabled,\n datesEnabled: this.datesEnabled || this.bsConfig && this.bsConfig.datesEnabled,\n ranges: checkRangesWithMaxDate(this.bsConfig && this.bsConfig.ranges, this.maxDate || this.bsConfig && this.bsConfig.maxDate),\n maxDateRange: this.bsConfig && this.bsConfig.maxDateRange,\n initCurrentTime: this.bsConfig?.initCurrentTime\n }\n );\n }\n\n /**\n * Closes an element’s datepicker. This is considered a “manual†triggering of\n * the datepicker.\n */\n hide(): void {\n if (this.isOpen) {\n this._datepicker.hide();\n }\n for (const sub of this._subs) {\n sub.unsubscribe();\n }\n\n if (this._config.returnFocusToInput) {\n this._renderer.selectRootElement(this._elementRef.nativeElement).focus();\n }\n }\n\n /**\n * Toggles an element’s datepicker. This is considered a “manual†triggering\n * of the datepicker.\n */\n toggle(): void {\n if (this.isOpen) {\n return this.hide();\n }\n\n this.show();\n }\n\n unsubscribeSubscriptions() {\n if (this._subs?.length) {\n this._subs.map(sub => sub.unsubscribe());\n this._subs.length = 0;\n }\n }\n\n ngOnDestroy(): void {\n this._datepicker.dispose();\n this.isOpen$.next(false);\n if (this.isDestroy$) {\n this.isDestroy$.next(null);\n this.isDestroy$.complete();\n }\n\n this.unsubscribeSubscriptions();\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n ElementRef,\n forwardRef,\n Host,\n OnDestroy,\n OnInit,\n Provider,\n Renderer2\n} from '@angular/core';\n\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator\n} from '@angular/forms';\n\nimport {\n parseDate,\n formatDate,\n getLocale,\n isAfter,\n isBefore,\n isArray,\n isDateValid,\n utcAsLocal\n} from 'ngx-bootstrap/chronos';\n\nimport { BsDaterangepickerDirective } from './bs-daterangepicker.component';\nimport { BsLocaleService } from './bs-locale.service';\nimport { Subscription } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\n\nconst BS_DATERANGEPICKER_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BsDaterangepickerInputDirective),\n multi: true\n};\n\nconst BS_DATERANGEPICKER_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => BsDaterangepickerInputDirective),\n multi: true\n};\n\n\n@Directive({\n selector: `input[bsDaterangepicker]`,\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '(change)': 'onChange($event)',\n '(keyup.esc)': 'hide()',\n '(keydown)': 'onKeydownEvent($event)',\n '(blur)': 'onBlur()'\n },\n providers: [BS_DATERANGEPICKER_VALUE_ACCESSOR, BS_DATERANGEPICKER_VALIDATOR]\n})\nexport class BsDaterangepickerInputDirective\n implements ControlValueAccessor, Validator, OnInit, OnDestroy {\n private _onChange = Function.prototype;\n private _onTouched = Function.prototype;\n private _validatorChange = Function.prototype;\n private _value?: (Date|undefined)[];\n private _subs = new Subscription();\n\n constructor(@Host() private _picker: BsDaterangepickerDirective,\n private _localeService: BsLocaleService,\n private _renderer: Renderer2,\n private _elRef: ElementRef,\n private changeDetection: ChangeDetectorRef) {\n }\n\n ngOnInit() {\n const setBsValue = (value: (Date|undefined)[]) => {\n this._setInputValue(value);\n if (this._value !== value) {\n this._value = value;\n this._onChange(value);\n this._onTouched();\n }\n this.changeDetection.markForCheck();\n };\n\n // if value set via [bsValue] it will not get into value change\n if (this._picker._bsValue) {\n setBsValue(this._picker._bsValue);\n }\n\n // update input value on datepicker value update\n this._subs.add(\n this._picker.bsValueChange.subscribe((value: Date[]) => {\n this._setInputValue(value);\n if (this._value !== value) {\n this._value = value;\n this._onChange(value);\n this._onTouched();\n }\n this.changeDetection.markForCheck();\n }));\n\n // update input value on locale change\n this._subs.add(this._localeService.localeChange.subscribe(() => {\n this._setInputValue(this._value);\n }));\n\n this._subs.add(\n // update input value on format change\n this._picker.rangeInputFormat$.pipe(distinctUntilChanged()).subscribe(() => {\n this._setInputValue(this._value);\n }));\n }\n\n ngOnDestroy() {\n this._subs.unsubscribe();\n }\n\n onKeydownEvent(event: KeyboardEvent) {\n if (event.keyCode === 13 || event.code === 'Enter') {\n this.hide();\n }\n }\n\n _setInputValue(date?: (Date|undefined)[]): void {\n let range = '';\n if (date) {\n const start: string = !date[0] ? ''\n : formatDate(date[0],\n this._picker._config.rangeInputFormat,\n this._localeService.currentLocale\n );\n const end: string = !date[1] ? ''\n : formatDate(\n date[1],\n this._picker._config.rangeInputFormat,\n this._localeService.currentLocale\n );\n range = (start && end) ? start + this._picker._config.rangeSeparator + end : '';\n }\n this._renderer.setProperty(this._elRef.nativeElement, 'value', range);\n }\n\n onChange(event: Event) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.writeValue((event.target as any).value);\n this._onChange(this._value);\n if (this._picker._config.returnFocusToInput) {\n this._renderer.selectRootElement(this._elRef.nativeElement).focus();\n }\n this._onTouched();\n }\n\n validate(c: AbstractControl): ValidationErrors | null {\n let _value: [Date, Date] = c.value;\n const errors: Record<string, unknown>[] = [];\n\n if (_value === null || _value === undefined || !isArray(_value)) {\n return null;\n }\n\n _value = _value.slice().sort((a, b) => a.getTime() - b.getTime()) as [Date, Date];\n\n const _isFirstDateValid = isDateValid(_value[0]);\n const _isSecondDateValid = isDateValid(_value[1]);\n\n if (!_isFirstDateValid) {\n return { bsDate: { invalid: _value[0] } };\n }\n\n if (!_isSecondDateValid) {\n return { bsDate: { invalid: _value[1] } };\n }\n\n if (this._picker && this._picker.minDate && isBefore(_value[0], this._picker.minDate, 'date')) {\n _value[0] = this._picker.minDate;\n errors.push({ bsDate: { minDate: this._picker.minDate } });\n }\n\n if (this._picker && this._picker.maxDate && isAfter(_value[1], this._picker.maxDate, 'date')) {\n _value[1] = this._picker.maxDate;\n errors.push({ bsDate: { maxDate: this._picker.maxDate } });\n }\n if (errors.length > 0) {\n this.writeValue(_value);\n\n return errors;\n }\n\n return null;\n }\n\n registerOnValidatorChange(fn: () => void): void {\n this._validatorChange = fn;\n }\n\n writeValue(value: Date[] | string) {\n if (!value) {\n this._value = void 0;\n } else {\n const _localeKey = this._localeService.currentLocale;\n const _locale = getLocale(_localeKey);\n if (!_locale) {\n throw new Error(\n `Locale \"${_localeKey}\" is not defined, please add it with \"defineLocale(...)\"`\n );\n }\n\n let _input: (string | Date)[] = [];\n if (typeof value === 'string') {\n const trimmedSeparator = this._picker._config.rangeSeparator.trim();\n if (value.replace(/[^-]/g, '').length > 1) {\n _input = value.split(this._picker._config.rangeSeparator);\n } else {\n _input = value\n .split(trimmedSeparator.length > 0 ? trimmedSeparator : this._picker._config.rangeSeparator)\n .map(_val => _val.trim());\n }\n }\n\n if (Array.isArray(value)) {\n _input = value;\n }\n\n this._value = _input\n .map((_val: string | Date): Date => {\n if (this._picker._config.useUtc) {\n return utcAsLocal(\n parseDate(_val, this._picker._config.rangeInputFormat, this._localeService.currentLocale)\n );\n }\n\n return parseDate(_val, this._picker._config.rangeInputFormat, this._localeService.currentLocale);\n }\n )\n .map((date: Date) => (isNaN(date.valueOf()) ? void 0 : date));\n }\n\n this._picker.bsValue = this._value;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._picker.isDisabled = isDisabled;\n if (isDisabled) {\n this._renderer.setAttribute(this._elRef.nativeElement, 'disabled', 'disabled');\n\n return;\n }\n this._renderer.removeAttribute(this._elRef.nativeElement, 'disabled');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n registerOnChange(fn: () => void): void {\n this._onChange = fn;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n onBlur() {\n this._onTouched();\n }\n\n hide() {\n this._picker.hide();\n this._renderer.selectRootElement(this._elRef.nativeElement).blur();\n\n if (this._picker._config.returnFocusToInput) {\n this._renderer.selectRootElement(this._elRef.nativeElement).focus();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/* eslint-disable */\n\nimport { Inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({ providedIn: 'root' })\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n constructor(@Inject(PLATFORM_ID) private _platformId: Object) {\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\nimport { PositioningService } from 'ngx-bootstrap/positioning';\n\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { TimepickerModule, TimepickerActions } from 'ngx-bootstrap/timepicker';\n\nimport { BsDatepickerInputDirective } from './bs-datepicker-input.directive';\nimport { BsDatepickerDirective } from './bs-datepicker.component';\nimport { BsDaterangepickerInputDirective } from './bs-daterangepicker-input.directive';\nimport { BsDaterangepickerDirective } from './bs-daterangepicker.component';\n\nimport { BsDatepickerInlineDirective } from './bs-datepicker-inline.component';\n\nimport { BsLocaleService } from './bs-locale.service';\nimport { BsDatepickerActions } from './reducer/bs-datepicker.actions';\nimport { BsDatepickerEffects } from './reducer/bs-datepicker.effects';\nimport { BsDatepickerStore } from './reducer/bs-datepicker.store';\nimport { BsDatepickerContainerComponent } from './themes/bs/bs-datepicker-container.component';\nimport { BsDaterangepickerContainerComponent } from './themes/bs/bs-daterangepicker-container.component';\n\nimport { BsDatepickerInlineContainerComponent } from './themes/bs/bs-datepicker-inline-container.component';\nimport { BsDaterangepickerInlineContainerComponent } from './themes/bs/bs-daterangepicker-inline-container.component';\n\nimport { BsDaterangepickerInlineDirective } from './bs-daterangepicker-inline.component';\n\nimport { BsCalendarLayoutComponent } from './themes/bs/bs-calendar-layout.component';\nimport { BsCurrentDateViewComponent } from './themes/bs/bs-current-date-view.component';\nimport { BsCustomDatesViewComponent } from './themes/bs/bs-custom-dates-view.component';\nimport { BsDatepickerDayDecoratorComponent } from './themes/bs/bs-datepicker-day-decorator.directive';\nimport { BsDatepickerNavigationViewComponent } from './themes/bs/bs-datepicker-navigation-view.component';\nimport { BsDaysCalendarViewComponent } from './themes/bs/bs-days-calendar-view.component';\nimport { BsMonthCalendarViewComponent } from './themes/bs/bs-months-calendar-view.component';\nimport { BsTimepickerViewComponent } from './themes/bs/bs-timepicker-view.component';\nimport { BsYearsCalendarViewComponent } from './themes/bs/bs-years-calendar-view.component';\n\n@NgModule({\n imports: [CommonModule, TooltipModule, TimepickerModule],\n declarations: [\n BsCalendarLayoutComponent,\n BsCurrentDateViewComponent,\n BsCustomDatesViewComponent,\n BsDatepickerDayDecoratorComponent,\n BsDatepickerNavigationViewComponent,\n BsDaysCalendarViewComponent,\n BsMonthCalendarViewComponent,\n BsTimepickerViewComponent,\n BsYearsCalendarViewComponent,\n BsDatepickerContainerComponent,\n BsDatepickerDirective,\n BsDatepickerInlineContainerComponent,\n BsDatepickerInlineDirective,\n BsDatepickerInputDirective,\n BsDaterangepickerContainerComponent,\n BsDaterangepickerDirective,\n BsDaterangepickerInlineContainerComponent,\n BsDaterangepickerInlineDirective,\n BsDaterangepickerInputDirective\n ],\n exports: [\n BsDatepickerContainerComponent,\n BsDatepickerDirective,\n BsDatepickerInlineContainerComponent,\n BsDatepickerInlineDirective,\n BsDatepickerInputDirective,\n BsDaterangepickerContainerComponent,\n BsDaterangepickerDirective,\n BsDaterangepickerInlineContainerComponent,\n BsDaterangepickerInlineDirective,\n BsDaterangepickerInputDirective\n ]\n})\nexport class BsDatepickerModule {\n static forRoot(): ModuleWithProviders<BsDatepickerModule> {\n return {\n ngModule: BsDatepickerModule,\n providers: [\n ComponentLoaderFactory,\n PositioningService,\n BsDatepickerStore,\n BsDatepickerActions,\n BsDatepickerEffects,\n BsLocaleService,\n TimepickerActions\n ]\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/* eslint-disable */\n\nimport { Injectable } from '@angular/core';\n\n/**\n * A FocusTrap managed by FocusTrapManager.\n * Implemented by ConfigurableFocusTrap to avoid circular dependency.\n */\nexport interface ManagedFocusTrap {\n _enable(): void;\n _disable(): void;\n focusInitialElementWhenReady(): Promise<boolean>;\n}\n\n/** Injectable that ensures only the most recently enabled FocusTrap is active. */\n@Injectable({providedIn: 'root'})\nexport class FocusTrapManager {\n // A stack of the FocusTraps on the page. Only the FocusTrap at the\n // top of the stack is active.\n private _focusTrapStack: ManagedFocusTrap[] = [];\n\n /**\n * Disables the FocusTrap at the top of the stack, and then pushes\n * the new FocusTrap onto the stack.\n */\n register(focusTrap: ManagedFocusTrap): void {\n // Dedupe focusTraps that register multiple times.\n this._focusTrapStack = this._focusTrapStack.filter((ft) => ft !== focusTrap);\n\n let stack = this._focusTrapStack;\n\n if (stack.length) {\n stack[stack.length - 1]._disable();\n }\n\n stack.push(focusTrap);\n focusTrap._enable();\n }\n\n /**\n * Removes the FocusTrap from the stack, and activates the\n * FocusTrap that is the new top of the stack.\n */\n deregister(focusTrap: ManagedFocusTrap): void {\n focusTrap._disable();\n\n const stack = this._focusTrapStack;\n\n const i = stack.indexOf(focusTrap);\n if (i !== -1) {\n stack.splice(i, 1);\n if (stack.length) {\n stack[stack.length - 1]._enable();\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/* eslint-disable */\n\nimport { Platform } from './platform';\nimport { Injectable } from '@angular/core';\n\n/**\n * Configuration for the isFocusable method.\n */\nexport class IsFocusableConfig {\n /**\n * Whether to count an element as focusable even if it is not currently visible.\n */\n ignoreVisibility: boolean = false;\n}\n\n// The InteractivityChecker leans heavily on the ally.js accessibility utilities.\n// Methods like `isTabbable` are only covering specific edge-cases for the browsers which are\n// supported.\n\n/**\n * Utility for checking the interactivity of an element, such as whether is is focusable or\n * tabbable.\n */\n@Injectable({ providedIn: 'root' })\nexport class InteractivityChecker {\n\n constructor(private _platform: Platform) {\n }\n\n /**\n * Gets whether an element is disabled.\n *\n * @param element Element to be checked.\n * @returns Whether the element is disabled.\n */\n isDisabled(element: HTMLElement): boolean {\n // This does not capture some cases, such as a non-form control with a disabled attribute or\n // a form control inside of a disabled form, but should capture the most common cases.\n return element.hasAttribute('disabled');\n }\n\n /**\n * Gets whether an element is visible for the purposes of interactivity.\n *\n * This will capture states like `display: none` and `visibility: hidden`, but not things like\n * being clipped by an `overflow: hidden` parent or being outside the viewport.\n *\n * @returns Whether the element is visible.\n */\n isVisible(element: HTMLElement): boolean {\n return hasGeometry(element) && getComputedStyle(element).visibility === 'visible';\n }\n\n /**\n * Gets whether an element can be reached via Tab key.\n * Assumes that the element has already been checked with isFocusable.\n *\n * @param element Element to be checked.\n * @returns Whether the element is tabbable.\n */\n isTabbable(element: HTMLElement): boolean {\n // Nothing is tabbable on the server 😎\n if (!this._platform.isBrowser) {\n return false;\n }\n\n const frameElement = getFrameElement(getWindow(element));\n\n if (frameElement) {\n // Frame elements inherit their tabindex onto all child elements.\n if (getTabIndexValue(frameElement) === -1) {\n return false;\n }\n\n // Browsers disable tabbing to an element inside of an invisible frame.\n if (!this.isVisible(frameElement)) {\n return false;\n }\n }\n\n let nodeName = element.nodeName.toLowerCase();\n let tabIndexValue = getTabIndexValue(element);\n\n if (element.hasAttribute('contenteditable')) {\n return tabIndexValue !== -1;\n }\n\n if (nodeName === 'iframe' || nodeName === 'object') {\n // The frame or object's content may be tabbable depending on the content, but it's\n // not possibly to reliably detect the content of the frames. We always consider such\n // elements as non-tabbable.\n return false;\n }\n\n // In iOS, the browser only considers some specific elements as tabbable.\n if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {\n return false;\n }\n\n if (nodeName === 'audio') {\n // Audio elements without controls enabled are never tabbable, regardless\n // of the tabindex attribute explicitly being set.\n if (!element.hasAttribute('controls')) {\n return false;\n }\n // Audio elements with controls are by default tabbable unless the\n // tabindex attribute is set to `-1` explicitly.\n return tabIndexValue !== -1;\n }\n\n if (nodeName === 'video') {\n // For all video elements, if the tabindex attribute is set to `-1`, the video\n // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`\n // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The\n // tabindex attribute is the source of truth here.\n if (tabIndexValue === -1) {\n return false;\n }\n // If the tabindex is explicitly set, and not `-1` (as per check before), the\n // video element is always tabbable (regardless of whether it has controls or not).\n if (tabIndexValue !== null) {\n return true;\n }\n // Otherwise (when no explicit tabindex is set), a video is only tabbable if it\n // has controls enabled. Firefox is special as videos are always tabbable regardless\n // of whether there are controls or not.\n return this._platform.FIREFOX || element.hasAttribute('controls');\n }\n\n return element.tabIndex >= 0;\n }\n\n /**\n * Gets whether an element can be focused by the user.\n *\n * @param element Element to be checked.\n * @param config The config object with options to customize this method's behavior\n * @returns Whether the element is focusable.\n */\n isFocusable(element: HTMLElement, config?: IsFocusableConfig): boolean {\n // Perform checks in order of left to most expensive.\n // Again, naive approach that does not capture many edge cases and browser quirks.\n return isPotentiallyFocusable(element) && !this.isDisabled(element) &&\n (config?.ignoreVisibility || this.isVisible(element));\n }\n\n}\n\n/**\n * Returns the frame element from a window object. Since browsers like MS Edge throw errors if\n * the frameElement property is being accessed from a different host address, this property\n * should be accessed carefully.\n */\nfunction getFrameElement(window: Window) {\n try {\n return window.frameElement as HTMLElement;\n } catch {\n return null;\n }\n}\n\n/** Checks whether the specified element has any geometry / rectangles. */\nfunction hasGeometry(element: HTMLElement): boolean {\n // Use logic from jQuery to check for an invisible element.\n // See https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js#L12\n return !!(element.offsetWidth || element.offsetHeight ||\n (typeof element.getClientRects === 'function' && element.getClientRects().length));\n}\n\n/** Gets whether an element's */\nfunction isNativeFormElement(element: Node) {\n let nodeName = element.nodeName.toLowerCase();\n return nodeName === 'input' ||\n nodeName === 'select' ||\n nodeName === 'button' ||\n nodeName === 'textarea';\n}\n\n/** Gets whether an element is an `<input type=\"hidden\">`. */\nfunction isHiddenInput(element: HTMLElement): boolean {\n return isInputElement(element) && element.type == 'hidden';\n}\n\n/** Gets whether an element is an anchor that has an href attribute. */\nfunction isAnchorWithHref(element: HTMLElement): boolean {\n return isAnchorElement(element) && element.hasAttribute('href');\n}\n\n/** Gets whether an element is an input element. */\nfunction isInputElement(element: HTMLElement): element is HTMLInputElement {\n return element.nodeName.toLowerCase() == 'input';\n}\n\n/** Gets whether an element is an anchor element. */\nfunction isAnchorElement(element: HTMLElement): element is HTMLAnchorElement {\n return element.nodeName.toLowerCase() == 'a';\n}\n\n/** Gets whether an element has a valid tabindex. */\nfunction hasValidTabIndex(element: HTMLElement): boolean {\n if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n return false;\n }\n\n let tabIndex = element.getAttribute('tabindex');\n\n // IE11 parses tabindex=\"\" as the value \"-32768\"\n if (tabIndex == '-32768') {\n return false;\n }\n\n return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n}\n\n/**\n * Returns the parsed tabindex from the element attributes instead of returning the\n * evaluated tabindex from the browsers defaults.\n */\nfunction getTabIndexValue(element: HTMLElement): number | null {\n if (!hasValidTabIndex(element)) {\n return null;\n }\n\n // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054\n const tabIndex = parseInt(element.getAttribute('tabindex') || '', 10);\n\n return isNaN(tabIndex) ? -1 : tabIndex;\n}\n\n/** Checks whether the specified element is potentially tabbable on iOS */\nfunction isPotentiallyTabbableIOS(element: HTMLElement): boolean {\n let nodeName = element.nodeName.toLowerCase();\n let inputType = nodeName === 'input' && (element as HTMLInputElement).type;\n\n return inputType === 'text'\n || inputType === 'password'\n || nodeName === 'select'\n || nodeName === 'textarea';\n}\n\n/**\n * Gets whether an element is potentially focusable without taking current visible/disabled state\n * into account.\n */\nfunction isPotentiallyFocusable(element: HTMLElement): boolean {\n // Inputs are potentially focusable *unless* they're type=\"hidden\".\n if (isHiddenInput(element)) {\n return false;\n }\n\n return isNativeFormElement(element) ||\n isAnchorWithHref(element) ||\n element.hasAttribute('contenteditable') ||\n hasValidTabIndex(element);\n}\n\n/** Gets the parent window of a DOM node with regards of being inside of an iframe. */\nfunction getWindow(node: HTMLElement): Window {\n // ownerDocument is null if `node` itself *is* a document.\n return node.ownerDocument && node.ownerDocument.defaultView || window;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/* eslint-disable */\n\n/**\n * Type describing the allowed values for a boolean input.\n * @docs-private\n */\nexport type BooleanInput = string | boolean | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nexport function coerceBooleanProperty(value: any): boolean {\n return value != null && `${value}` !== 'false';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/* eslint-disable */\n\nimport { coerceBooleanProperty, BooleanInput } from './boolean-property';\nimport { DOCUMENT } from '@angular/common';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n Inject,\n Injectable,\n Input,\n NgZone,\n OnDestroy,\n DoCheck,\n SimpleChanges,\n OnChanges\n} from '@angular/core';\nimport { take } from 'rxjs/operators';\nimport { InteractivityChecker } from './interactivity-checker';\n\n\n/**\n * Class that allows for trapping focus within a DOM element.\n *\n * This class currently uses a relatively simple approach to focus trapping.\n * It assumes that the tab order is the same as DOM order, which is not necessarily true.\n * Things like `tabIndex > 0`, flex `order`, and shadow roots can cause the two to misalign.\n *\n * @deprecated Use `ConfigurableFocusTrap` instead.\n * @breaking-change for 11.0.0 Remove this class.\n */\nexport class FocusTrap {\n private _startAnchor?: HTMLElement | null;\n private _endAnchor?: HTMLElement | null;\n private _hasAttached = false;\n\n // Event listeners for the anchors. Need to be regular functions so that we can unbind them later.\n protected startAnchorListener = () => this.focusLastTabbableElement();\n protected endAnchorListener = () => this.focusFirstTabbableElement();\n\n /** Whether the focus trap is active. */\n get enabled(): boolean {\n return this._enabled;\n }\n\n set enabled(value: boolean) {\n this._enabled = value;\n\n if (this._startAnchor && this._endAnchor) {\n this._toggleAnchorTabIndex(value, this._startAnchor);\n this._toggleAnchorTabIndex(value, this._endAnchor);\n }\n }\n\n protected _enabled: boolean = true;\n\n constructor(\n readonly _element: HTMLElement,\n private _checker: InteractivityChecker,\n readonly _ngZone: NgZone,\n readonly _document: Document,\n deferAnchors = false) {\n\n if (!deferAnchors) {\n this.attachAnchors();\n }\n }\n\n /** Destroys the focus trap by cleaning up the anchors. */\n destroy() {\n const startAnchor = this._startAnchor;\n const endAnchor = this._endAnchor;\n\n if (startAnchor) {\n startAnchor.removeEventListener('focus', this.startAnchorListener);\n\n if (startAnchor.parentNode) {\n startAnchor.parentNode.removeChild(startAnchor);\n }\n }\n\n if (endAnchor) {\n endAnchor.removeEventListener('focus', this.endAnchorListener);\n\n if (endAnchor.parentNode) {\n endAnchor.parentNode.removeChild(endAnchor);\n }\n }\n\n this._startAnchor = this._endAnchor = null;\n this._hasAttached = false;\n }\n\n /**\n * Inserts the anchors into the DOM. This is usually done automatically\n * in the constructor, but can be deferred for cases like directives with `*ngIf`.\n * @returns Whether the focus trap managed to attach successfuly. This may not be the case\n * if the target element isn't currently in the DOM.\n */\n attachAnchors(): boolean {\n // If we're not on the browser, there can be no focus to trap.\n if (this._hasAttached) {\n return true;\n }\n\n this._ngZone.runOutsideAngular(() => {\n if (!this._startAnchor) {\n this._startAnchor = this._createAnchor();\n this._startAnchor!.addEventListener('focus', this.startAnchorListener);\n }\n\n if (!this._endAnchor) {\n this._endAnchor = this._createAnchor();\n this._endAnchor!.addEventListener('focus', this.endAnchorListener);\n }\n });\n\n if (this._element.parentNode) {\n this._element.parentNode.insertBefore(this._startAnchor!, this._element);\n this._element.parentNode.insertBefore(this._endAnchor!, this._element.nextSibling);\n this._hasAttached = true;\n }\n\n return this._hasAttached;\n }\n\n /**\n * Waits for the zone to stabilize, then either focuses the first element that the\n * user specified, or the first tabbable element.\n * @returns Returns a promise that resolves with a boolean, depending\n * on whether focus was moved successfully.\n */\n focusInitialElementWhenReady(): Promise<boolean> {\n return new Promise<boolean>(resolve => {\n this._executeOnStable(() => resolve(this.focusInitialElement()));\n });\n }\n\n /**\n * Waits for the zone to stabilize, then focuses\n * the first tabbable element within the focus trap region.\n * @returns Returns a promise that resolves with a boolean, depending\n * on whether focus was moved successfully.\n */\n focusFirstTabbableElementWhenReady(): Promise<boolean> {\n return new Promise<boolean>(resolve => {\n this._executeOnStable(() => resolve(this.focusFirstTabbableElement()));\n });\n }\n\n /**\n * Waits for the zone to stabilize, then focuses\n * the last tabbable element within the focus trap region.\n * @returns Returns a promise that resolves with a boolean, depending\n * on whether focus was moved successfully.\n */\n focusLastTabbableElementWhenReady(): Promise<boolean> {\n return new Promise<boolean>(resolve => {\n this._executeOnStable(() => resolve(this.focusLastTabbableElement()));\n });\n }\n\n /**\n * Get the specified boundary element of the trapped region.\n * @param bound The boundary to get (start or end of trapped region).\n * @returns The boundary element.\n */\n private _getRegionBoundary(bound: 'start' | 'end'): HTMLElement | null {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` +\n `[cdkFocusRegion${bound}], ` +\n `[cdk-focus-${bound}]`) as NodeListOf<HTMLElement>;\n\n for (let i = 0; i < markers.length; i++) {\n // @breaking-change 8.0.0\n if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated ` +\n `attribute will be removed in 8.0.0.`, markers[i]);\n } else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +\n `will be removed in 8.0.0.`, markers[i]);\n }\n }\n\n if (bound == 'start') {\n return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);\n }\n return markers.length ?\n markers[markers.length - 1] : this._getLastTabbableElement(this._element);\n }\n\n /**\n * Focuses the element that should be focused when the focus trap is initialized.\n * @returns Whether focus was moved successfully.\n */\n focusInitialElement(): boolean {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n const redirectToElement = this._element.querySelector(`[cdk-focus-initial], ` +\n `[cdkFocusInitial]`) as HTMLElement;\n\n if (redirectToElement) {\n // @breaking-change 8.0.0\n if (redirectToElement.hasAttribute(`cdk-focus-initial`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-initial', ` +\n `use 'cdkFocusInitial' instead. The deprecated attribute ` +\n `will be removed in 8.0.0`, redirectToElement);\n }\n\n // Warn the consumer if the element they've pointed to\n // isn't focusable, when not in production mode.\n\n if (!this._checker.isFocusable(redirectToElement)) {\n const focusableChild = this._getFirstTabbableElement(redirectToElement) as HTMLElement;\n focusableChild?.focus();\n return !!focusableChild;\n }\n\n redirectToElement.focus();\n return true;\n }\n\n return this.focusFirstTabbableElement();\n }\n\n /**\n * Focuses the first tabbable element within the focus trap region.\n * @returns Whether focus was moved successfully.\n */\n focusFirstTabbableElement(): boolean {\n const redirectToElement = this._getRegionBoundary('start');\n\n if (redirectToElement) {\n redirectToElement.focus();\n }\n\n return !!redirectToElement;\n }\n\n /**\n * Focuses the last tabbable element within the focus trap region.\n * @returns Whether focus was moved successfully.\n */\n focusLastTabbableElement(): boolean {\n const redirectToElement = this._getRegionBoundary('end');\n\n if (redirectToElement) {\n redirectToElement.focus();\n }\n\n return !!redirectToElement;\n }\n\n /**\n * Checks whether the focus trap has successfully been attached.\n */\n hasAttached(): boolean {\n return this._hasAttached;\n }\n\n /** Get the first tabbable element from a DOM subtree (inclusive). */\n private _getFirstTabbableElement(root: HTMLElement): HTMLElement | null {\n if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {\n return root;\n }\n\n // Iterate in DOM order. Note that IE doesn't have `children` for SVG so we fall\n // back to `childNodes` which includes text nodes, comments etc.\n let children = root.children || root.childNodes;\n\n for (let i = 0; i < children.length; i++) {\n let tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?\n this._getFirstTabbableElement(children[i] as HTMLElement) :\n null;\n\n if (tabbableChild) {\n return tabbableChild;\n }\n }\n\n return null;\n }\n\n /** Get the last tabbable element from a DOM subtree (inclusive). */\n private _getLastTabbableElement(root: HTMLElement): HTMLElement | null {\n if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {\n return root;\n }\n\n // Iterate in reverse DOM order.\n let children = root.children || root.childNodes;\n\n for (let i = children.length - 1; i >= 0; i--) {\n let tabbableChild = children[i].nodeType === this._document.ELEMENT_NODE ?\n this._getLastTabbableElement(children[i] as HTMLElement) :\n null;\n\n if (tabbableChild) {\n return tabbableChild;\n }\n }\n\n return null;\n }\n\n /** Creates an anchor element. */\n private _createAnchor(): HTMLElement {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }\n\n /**\n * Toggles the `tabindex` of an anchor, based on the enabled state of the focus trap.\n * @param isEnabled Whether the focus trap is enabled.\n * @param anchor Anchor on which to toggle the tabindex.\n */\n private _toggleAnchorTabIndex(isEnabled: boolean, anchor: HTMLElement) {\n // Remove the tabindex completely, rather than setting it to -1, because if the\n // element has a tabindex, the user might still hit it when navigating with the arrow keys.\n isEnabled ? anchor.setAttribute('tabindex', '0') : anchor.removeAttribute('tabindex');\n }\n\n /**\n * Toggles the`tabindex` of both anchors to either trap Tab focus or allow it to escape.\n * @param enabled: Whether the anchors should trap Tab.\n */\n protected toggleAnchors(enabled: boolean) {\n if (this._startAnchor && this._endAnchor) {\n this._toggleAnchorTabIndex(enabled, this._startAnchor);\n this._toggleAnchorTabIndex(enabled, this._endAnchor);\n }\n }\n\n /** Executes a function when the zone is stable. */\n private _executeOnStable(fn: () => any): void {\n if (this._ngZone.isStable) {\n fn();\n } else {\n this._ngZone.onStable.pipe(take(1)).subscribe(fn);\n }\n }\n}\n\n/**\n * Factory that allows easy instantiation of focus traps.\n * @deprecated Use `ConfigurableFocusTrapFactory` instead.\n * @breaking-change for 11.0.0 Remove this class.\n */\n@Injectable({ providedIn: 'root' })\nexport class FocusTrapFactory {\n private _document: Document;\n\n constructor(\n private _checker: InteractivityChecker,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any) {\n\n this._document = _document;\n }\n\n /**\n * Creates a focus-trapped region around the given element.\n * @param element The element around which focus will be trapped.\n * @param deferCaptureElements Defers the creation of focus-capturing elements to be done\n * manually by the user.\n * @returns The created focus trap instance.\n */\n create(element: HTMLElement, deferCaptureElements: boolean = false): FocusTrap {\n return new FocusTrap(\n element, this._checker, this._ngZone, this._document, deferCaptureElements);\n }\n}\n\n/** Directive for trapping focus within a region. */\n@Directive({\n selector: '[focusTrap]',\n exportAs: 'focusTrap'\n})\nexport class FocusTrapDirective implements OnDestroy, AfterContentInit, OnChanges, DoCheck {\n private _document: Document;\n\n /** Underlying FocusTrap instance. */\n focusTrap: FocusTrap;\n\n /** Previously focused element to restore focus to upon destroy when using autoCapture. */\n private _previouslyFocusedElement: HTMLElement | null = null;\n\n /** Whether the focus trap is active. */\n @Input('cdkTrapFocus')\n get enabled(): boolean {\n return this.focusTrap.enabled;\n }\n\n set enabled(value: boolean) {\n this.focusTrap.enabled = coerceBooleanProperty(value);\n }\n\n /**\n * Whether the directive should automatically move focus into the trapped region upon\n * initialization and return focus to the previous activeElement upon destruction.\n */\n @Input('cdkTrapFocusAutoCapture')\n get autoCapture(): boolean {\n return this._autoCapture;\n }\n\n set autoCapture(value: boolean) {\n this._autoCapture = coerceBooleanProperty(value);\n }\n\n private _autoCapture = false;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _focusTrapFactory: FocusTrapFactory,\n @Inject(DOCUMENT) _document: any) {\n\n this._document = _document;\n this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);\n }\n\n ngOnDestroy() {\n this.focusTrap.destroy();\n\n // If we stored a previously focused element when using autoCapture, return focus to that\n // element now that the trapped region is being destroyed.\n if (this._previouslyFocusedElement) {\n this._previouslyFocusedElement.focus();\n this._previouslyFocusedElement = null;\n }\n }\n\n ngAfterContentInit() {\n this.focusTrap.attachAnchors();\n\n if (this.autoCapture) {\n this._captureFocus();\n }\n }\n\n ngDoCheck() {\n if (!this.focusTrap.hasAttached()) {\n this.focusTrap.attachAnchors();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const autoCaptureChange = changes['autoCapture'];\n\n if (autoCaptureChange && !autoCaptureChange.firstChange && this.autoCapture &&\n this.focusTrap.hasAttached()) {\n this._captureFocus();\n }\n }\n\n private _captureFocus() {\n this._previouslyFocusedElement = this._document.activeElement as HTMLElement;\n this.focusTrap.focusInitialElementWhenReady();\n }\n\n static ngAcceptInputType_enabled: BooleanInput;\n static ngAcceptInputType_autoCapture: BooleanInput;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { FocusTrapManager } from './focus-trap-manager';\nimport { InteractivityChecker } from './interactivity-checker';\nimport { FocusTrapDirective } from './focus-trap';\nimport { Platform } from './platform';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [FocusTrapDirective],\n exports: [FocusTrapDirective]\n})\nexport class FocusTrapModule {\n static forRoot(): ModuleWithProviders<FocusTrapModule> {\n return {\n ngModule: FocusTrapModule,\n providers: [\n FocusTrapManager,\n Platform,\n InteractivityChecker\n ]\n };\n }\n}\n","import { Injectable, EventEmitter } from '@angular/core';\n\n@Injectable({providedIn: 'platform'})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class BsModalRef<T = any> {\n /**\n * Event that is fired when the modal behind the ref starts hiding\n */\n onHide?: EventEmitter<unknown>;\n /**\n * Event that is fired when the modal behind the ref finishes hiding\n */\n onHidden?: EventEmitter<unknown>;\n /**\n * Allow user to ID for the modal. Otherwise, a unique number will be given\n */\n id?: number | string;\n\n /**\n * Reference to a component inside the modal. Null if modal's been created with TemplateRef\n */\n content?: T;\n\n /**\n * Hides the modal\n */\n hide: () => void = () => void 0;\n /**\n * Sets new class to modal window\n */\n setClass: (newClass: string) => void = () => void 0;\n}\n","import { Injectable, StaticProvider, InjectionToken } from '@angular/core';\nimport { ClassName, CloseInterceptorFn, DismissReasons, Selector, TransitionDurations } from './models';\n\n@Injectable({providedIn: 'platform'})\nexport class ModalOptions<T = Record<string, unknown>> {\n /**\n * Allow user to ID for the modal. Otherwise, a unique number will be given\n */\n id?: number | string;\n /**\n * Includes a modal-backdrop element. Alternatively,\n * specify static for a backdrop which doesn't close the modal on click.\n */\n backdrop?: boolean | 'static';\n /**\n * Closes the modal when escape key is pressed.\n */\n keyboard?: boolean;\n\n focus?: boolean;\n /**\n * Shows the modal when initialized.\n */\n show?: boolean;\n /**\n * Ignore the backdrop click\n */\n ignoreBackdropClick?: boolean;\n /**\n * Css class for opened modal\n */\n class?: string;\n /**\n * Toggle animation\n */\n animated?: boolean;\n /**\n * Modal data\n */\n initialState?: Partial<T>;\n /**\n * Function to intercept the closure\n */\n closeInterceptor?: CloseInterceptorFn;\n /**\n * Modal providers\n */\n providers?: StaticProvider[];\n /**\n * aria-labelledby attribute value to set on the modal window\n */\n ariaLabelledBy?: string;\n /**\n * aria-describedby attribute value to set on the modal window\n */\n ariaDescribedby?: string;\n}\n\nexport const modalConfigDefaults: ModalOptions = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: false,\n ignoreBackdropClick: false,\n class: '',\n animated: true,\n initialState: {},\n closeInterceptor: void 0\n};\n\nexport const MODAL_CONFIG_DEFAULT_OVERRIDE: InjectionToken<ModalOptions> =\n new InjectionToken<ModalOptions>('override-default-config');\n\nexport const CLASS_NAME: ClassName = {\n SCROLLBAR_MEASURER: 'modal-scrollbar-measure',\n BACKDROP: 'modal-backdrop',\n OPEN: 'modal-open',\n FADE: 'fade',\n IN: 'in', // bs3\n SHOW: 'show' // bs4\n};\n\nexport const SELECTOR: Selector = {\n DIALOG: '.modal-dialog',\n DATA_TOGGLE: '[data-toggle=\"modal\"]',\n DATA_DISMISS: '[data-dismiss=\"modal\"]',\n FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'\n};\n\nexport const TRANSITION_DURATIONS: TransitionDurations = {\n MODAL: 300,\n BACKDROP: 150\n};\n\nexport const DISMISS_REASONS: DismissReasons = {\n BACKRDOP: 'backdrop-click',\n ESC: 'esc',\n BACK: 'browser-back-navigation-clicked'\n};\n","import {\n Component,\n ElementRef,\n HostListener,\n OnDestroy,\n OnInit,\n Renderer2\n} from '@angular/core';\nimport {\n CLASS_NAME,\n DISMISS_REASONS,\n ModalOptions,\n TRANSITION_DURATIONS\n} from './modal-options.class';\nimport { BsModalService } from './bs-modal.service';\nimport { isBs3 } from 'ngx-bootstrap/utils';\n\n@Component({\n selector: 'modal-container',\n template: `\n <div [class]=\"'modal-dialog' + (config.class ? ' ' + config.class : '')\"\n role=\"document\"\n focusTrap>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n </div>\n `,\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n class: 'modal',\n role: 'dialog',\n tabindex: '-1',\n '[attr.aria-modal]': 'true',\n '[attr.aria-labelledby]': 'config.ariaLabelledBy',\n '[attr.aria-describedby]': 'config.ariaDescribedby'\n }\n})\nexport class ModalContainerComponent implements OnInit, OnDestroy {\n config: ModalOptions;\n isShown = false;\n level?: number;\n isAnimated = false;\n bsModalService?: BsModalService;\n private isModalHiding = false;\n private clickStartedInContent = false;\n\n constructor(options: ModalOptions,\n protected _element: ElementRef,\n private _renderer: Renderer2) {\n this.config = Object.assign({}, options);\n }\n\n ngOnInit(): void {\n if (this.isAnimated) {\n this._renderer.addClass(\n this._element.nativeElement,\n CLASS_NAME.FADE\n );\n }\n this._renderer.setStyle(\n this._element.nativeElement,\n 'display',\n 'block'\n );\n setTimeout(() => {\n this.isShown = true;\n this._renderer.addClass(\n this._element.nativeElement,\n isBs3() ? CLASS_NAME.IN : CLASS_NAME.SHOW\n );\n }, this.isAnimated ? TRANSITION_DURATIONS.BACKDROP : 0);\n if (document && document.body) {\n if (this.bsModalService && this.bsModalService.getModalsCount() === 1) {\n this.bsModalService.checkScrollbar();\n this.bsModalService.setScrollbar();\n }\n this._renderer.addClass(document.body, CLASS_NAME.OPEN);\n this._renderer.setStyle(document.body, 'overflow-y', 'hidden');\n }\n if (this._element.nativeElement) {\n this._element.nativeElement.focus();\n }\n }\n\n @HostListener('mousedown', ['$event'])\n onClickStarted(event: MouseEvent): void {\n this.clickStartedInContent = event.target !== this._element.nativeElement;\n }\n\n @HostListener('click', ['$event'])\n onClickStop(event: MouseEvent): void {\n const clickedInBackdrop = event.target === this._element.nativeElement && !this.clickStartedInContent;\n if (\n this.config.ignoreBackdropClick ||\n this.config.backdrop === 'static' ||\n !clickedInBackdrop\n ) {\n this.clickStartedInContent = false;\n\n return;\n }\n this.bsModalService?.setDismissReason(DISMISS_REASONS.BACKRDOP);\n this.hide();\n }\n\n @HostListener('window:popstate')\n onPopState(): void {\n this.bsModalService?.setDismissReason(DISMISS_REASONS.BACK);\n this.hide();\n }\n\n @HostListener('window:keydown.esc', ['$event'])\n onEsc(event: KeyboardEvent): void {\n if (!this.isShown) {\n return;\n }\n\n if (event.keyCode === 27 || event.key === 'Escape') {\n event.preventDefault();\n }\n\n if (\n this.config.keyboard &&\n this.level === this.bsModalService?.getModalsCount()\n ) {\n this.bsModalService?.setDismissReason(DISMISS_REASONS.ESC);\n this.hide();\n }\n }\n\n ngOnDestroy(): void {\n if (this.isShown) {\n this._hide();\n }\n }\n\n hide(): void {\n if (this.isModalHiding || !this.isShown) {\n return;\n }\n\n if (this.config.closeInterceptor) {\n this.config.closeInterceptor().then(\n () => this._hide(),\n () => undefined);\n\n return;\n }\n\n this._hide();\n }\n\n private _hide(): void {\n this.isModalHiding = true;\n this._renderer.removeClass(\n this._element.nativeElement,\n isBs3() ? CLASS_NAME.IN : CLASS_NAME.SHOW\n );\n setTimeout(() => {\n this.isShown = false;\n if (\n document &&\n document.body &&\n this.bsModalService?.getModalsCount() === 1\n ) {\n this._renderer.removeClass(document.body, CLASS_NAME.OPEN);\n this._renderer.setStyle(document.body, 'overflow-y', '');\n }\n this.bsModalService?.hide(this.config.id);\n this.isModalHiding = false;\n }, this.isAnimated ? TRANSITION_DURATIONS.MODAL : 0);\n }\n}\n","import { Component, ElementRef, OnInit, Renderer2 } from '@angular/core';\n\nimport { CLASS_NAME } from './modal-options.class';\nimport { isBs3, Utils } from 'ngx-bootstrap/utils';\n\n\n/** This component will be added as background layout for modals if enabled */\n@Component({\n selector: 'bs-modal-backdrop',\n template: ' ',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: { class: CLASS_NAME.BACKDROP }\n})\nexport class ModalBackdropComponent implements OnInit {\n get isAnimated(): boolean {\n return this._isAnimated;\n }\n\n set isAnimated(value: boolean) {\n this._isAnimated = value;\n }\n\n get isShown(): boolean {\n return this._isShown;\n }\n\n set isShown(value: boolean) {\n this._isShown = value;\n if (value) {\n this.renderer.addClass(\n this.element.nativeElement,\n `${CLASS_NAME.IN}`\n );\n } else {\n this.renderer.removeClass(\n this.element.nativeElement,\n `${CLASS_NAME.IN}`\n );\n }\n if (!isBs3()) {\n if (value) {\n this.renderer.addClass(\n this.element.nativeElement,\n `${CLASS_NAME.SHOW}`\n );\n } else {\n this.renderer.removeClass(\n this.element.nativeElement,\n `${CLASS_NAME.SHOW}`\n );\n }\n }\n }\n\n element: ElementRef;\n renderer: Renderer2;\n\n protected _isAnimated = false;\n protected _isShown = false;\n\n constructor(element: ElementRef, renderer: Renderer2) {\n this.element = element;\n this.renderer = renderer;\n }\n\n ngOnInit(): void {\n if (this.isAnimated) {\n this.renderer.addClass(\n this.element.nativeElement,\n `${CLASS_NAME.FADE}`\n );\n Utils.reflow(this.element.nativeElement);\n }\n this.isShown = true;\n }\n}\n","import {\n ComponentRef,\n Injectable,\n TemplateRef,\n EventEmitter,\n Renderer2,\n RendererFactory2,\n Inject,\n Optional\n} from '@angular/core';\n\nimport { ComponentLoader, ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\nimport { ModalBackdropComponent } from './modal-backdrop.component';\nimport { ModalContainerComponent } from './modal-container.component';\nimport {\n CLASS_NAME,\n modalConfigDefaults,\n ModalOptions,\n TRANSITION_DURATIONS,\n MODAL_CONFIG_DEFAULT_OVERRIDE\n} from './modal-options.class';\nimport { BsModalRef } from './bs-modal-ref.service';\n\nlet currentId = 1;\n\n@Injectable({providedIn: 'platform'})\nexport class BsModalService {\n // constructor props\n config: ModalOptions;\n\n onShow = new EventEmitter();\n onShown = new EventEmitter();\n onHide = new EventEmitter();\n onHidden = new EventEmitter();\n\n protected isBodyOverflowing = false;\n protected originalBodyPadding = 0;\n\n protected scrollbarWidth = 0;\n\n protected backdropRef?: ComponentRef<ModalBackdropComponent>;\n private _backdropLoader: ComponentLoader<ModalBackdropComponent>;\n private modalsCount = 0;\n private lastDismissReason?: string;\n\n private loaders: ComponentLoader<ModalContainerComponent>[] = [];\n\n private _renderer: Renderer2;\n\n constructor(\n rendererFactory: RendererFactory2,\n private clf: ComponentLoaderFactory,\n @Optional() @Inject(MODAL_CONFIG_DEFAULT_OVERRIDE) private modalDefaultOption: ModalOptions) {\n this._backdropLoader = this.clf.createLoader<ModalBackdropComponent>();\n this._renderer = rendererFactory.createRenderer(null, null);\n this.config = modalDefaultOption ?\n (Object.assign({}, modalConfigDefaults, modalDefaultOption)) :\n modalConfigDefaults;\n }\n\n /** Shows a modal */\n show<T>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n content: string | TemplateRef<any> | { new(...args: any[]): T },\n config?: ModalOptions<T>\n ): BsModalRef<T> {\n this.modalsCount++;\n this._createLoaders();\n\n // must be different per every show() call\n const id = config?.id || currentId++;\n this.config = this.modalDefaultOption ?\n Object.assign({}, modalConfigDefaults, this.modalDefaultOption, config) :\n Object.assign({}, modalConfigDefaults, config);\n this.config.id = id;\n this._showBackdrop();\n this.lastDismissReason = void 0;\n\n return this._showModal<T>(content);\n }\n\n hide(id?: number | string) {\n if (this.modalsCount === 1 || id == null) {\n this._hideBackdrop();\n this.resetScrollbar();\n }\n this.modalsCount = this.modalsCount >= 1 && id != null ? this.modalsCount - 1 : 0;\n setTimeout(() => {\n this._hideModal(id);\n this.removeLoaders(id);\n }, this.config.animated ? TRANSITION_DURATIONS.BACKDROP : 0);\n }\n\n _showBackdrop(): void {\n const isBackdropEnabled =\n this.config.backdrop === true || this.config.backdrop === 'static';\n const isBackdropInDOM =\n !this.backdropRef || !this.backdropRef.instance.isShown;\n\n if (this.modalsCount === 1) {\n this.removeBackdrop();\n\n if (isBackdropEnabled && isBackdropInDOM) {\n this._backdropLoader\n .attach(ModalBackdropComponent)\n .to('body')\n .show({ isAnimated: this.config.animated });\n this.backdropRef = this._backdropLoader._componentRef;\n }\n }\n }\n\n _hideBackdrop(): void {\n if (!this.backdropRef) {\n return;\n }\n this.backdropRef.instance.isShown = false;\n const duration = this.config.animated ? TRANSITION_DURATIONS.BACKDROP : 0;\n setTimeout(() => this.removeBackdrop(), duration);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _showModal<T>(content: any): BsModalRef<T> {\n const modalLoader = this.loaders[this.loaders.length - 1];\n if (this.config && this.config.providers) {\n for (const provider of this.config.providers) {\n modalLoader.provide(provider);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bsModalRef = new BsModalRef<any>();\n const modalContainerRef = modalLoader\n .provide({ provide: ModalOptions, useValue: this.config })\n .provide({ provide: BsModalRef, useValue: bsModalRef })\n .attach(ModalContainerComponent)\n .to('body');\n bsModalRef.hide = () => modalContainerRef.instance?.hide();\n bsModalRef.setClass = (newClass: string) => {\n if (modalContainerRef.instance) {\n modalContainerRef.instance.config.class = newClass;\n }\n };\n\n bsModalRef.onHidden = new EventEmitter<unknown>();\n bsModalRef.onHide = new EventEmitter<unknown>();\n\n this.copyEvent(modalLoader.onBeforeHide, bsModalRef.onHide);\n this.copyEvent(modalLoader.onHidden, bsModalRef.onHidden);\n // call 'show' method after assign setClass in bsModalRef.\n // it makes modal component's bsModalRef available to call setClass method\n modalContainerRef.show({\n content,\n isAnimated: this.config.animated,\n initialState: this.config.initialState,\n bsModalService: this,\n id: this.config.id\n });\n\n if (modalContainerRef.instance) {\n modalContainerRef.instance.level = this.getModalsCount();\n bsModalRef.content = modalLoader.getInnerComponent();\n bsModalRef.id = modalContainerRef.instance.config?.id;\n }\n\n return bsModalRef;\n }\n\n _hideModal(id?: number | string): void {\n if (id != null) {\n const indexToRemove = this.loaders.findIndex(loader => loader.instance?.config.id === id);\n const modalLoader = this.loaders[indexToRemove];\n if (modalLoader) {\n modalLoader.hide(id);\n }\n } else {\n this.loaders.forEach(\n (loader: ComponentLoader<ModalContainerComponent>) => {\n if (loader.instance) {\n loader.hide(loader.instance.config.id);\n }\n }\n );\n }\n }\n\n getModalsCount(): number {\n return this.modalsCount;\n }\n\n setDismissReason(reason: string) {\n this.lastDismissReason = reason;\n }\n\n removeBackdrop(): void {\n this._renderer.removeClass(document.body, CLASS_NAME.OPEN);\n this._renderer.setStyle(document.body, 'overflow-y', '');\n this._backdropLoader.hide();\n this.backdropRef = void 0;\n }\n\n /** Checks if the body is overflowing and sets scrollbar width */\n /** @internal */\n checkScrollbar(): void {\n this.isBodyOverflowing = document.body.clientWidth < window.innerWidth;\n this.scrollbarWidth = this.getScrollbarWidth();\n }\n\n setScrollbar(): void {\n if (!document) {\n return;\n }\n\n this.originalBodyPadding = parseInt(\n window\n .getComputedStyle(document.body)\n .getPropertyValue('padding-right') || '0',\n 10\n );\n\n if (this.isBodyOverflowing) {\n document.body.style.paddingRight = `${this.originalBodyPadding +\n this.scrollbarWidth}px`;\n }\n }\n\n private resetScrollbar(): void {\n document.body.style.paddingRight = `${this.originalBodyPadding}px`;\n }\n\n // thx d.walsh\n private getScrollbarWidth(): number {\n const scrollDiv = this._renderer.createElement('div');\n this._renderer.addClass(scrollDiv, CLASS_NAME.SCROLLBAR_MEASURER);\n this._renderer.appendChild(document.body, scrollDiv);\n const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n this._renderer.removeChild(document.body, scrollDiv);\n\n return scrollbarWidth;\n }\n\n private _createLoaders(): void {\n const loader = this.clf.createLoader<ModalContainerComponent>();\n this.copyEvent(loader.onBeforeShow, this.onShow);\n this.copyEvent(loader.onShown, this.onShown);\n this.copyEvent(loader.onBeforeHide, this.onHide);\n this.copyEvent(loader.onHidden, this.onHidden);\n this.loaders.push(loader);\n }\n\n private removeLoaders(id?: number | string): void {\n if (id != null) {\n const indexToRemove = this.loaders.findIndex(loader => loader.instance?.config.id === id);\n if (indexToRemove >= 0) {\n this.loaders.splice(indexToRemove, 1);\n this.loaders.forEach(\n (loader: ComponentLoader<ModalContainerComponent>, i: number) => {\n if (loader.instance) {\n loader.instance.level = i + 1;\n }\n }\n );\n }\n } else {\n this.loaders.splice(0, this.loaders.length);\n }\n }\n\n private copyEvent(from: EventEmitter<unknown>, to: EventEmitter<unknown>) {\n from.subscribe((data) => {\n to.emit(this.lastDismissReason || data);\n });\n }\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\n\nimport { PositioningService } from 'ngx-bootstrap/positioning';\nimport { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';\nimport { FocusTrapModule } from 'ngx-bootstrap/focus-trap';\n\nimport { ModalBackdropComponent } from './modal-backdrop.component';\nimport { ModalDirective } from './modal.directive';\nimport { ModalContainerComponent } from './modal-container.component';\nimport { BsModalService } from './bs-modal.service';\n\nexport const focusTrapModule = FocusTrapModule.forRoot();\n\n@NgModule({\n imports: [FocusTrapModule],\n declarations: [\n ModalBackdropComponent,\n ModalDirective,\n ModalContainerComponent\n ],\n exports: [ModalBackdropComponent, ModalDirective]\n})\nexport class ModalModule {\n static forRoot(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [BsModalService, ComponentLoaderFactory, PositioningService]\n };\n }\n static forChild(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [BsModalService, ComponentLoaderFactory, PositioningService]\n };\n }\n}\n","// todo: split\nimport { Injectable } from '@angular/core';\n\nimport { ConfigModel, PagerModel } from './models';\n\n/** Provides default values for Pagination and pager components */\n@Injectable({\n providedIn: 'root'\n})\nexport class PaginationConfig {\n main: Partial<ConfigModel> = {\n itemsPerPage: 10,\n boundaryLinks: false,\n directionLinks: true,\n firstText: 'First',\n previousText: 'Previous',\n nextText: 'Next',\n lastText: 'Last',\n pageBtnClass: '',\n rotate: true\n };\n pager: PagerModel = {\n itemsPerPage: 15,\n previousText: '« Previous',\n nextText: 'Next »',\n pageBtnClass: '',\n align: true\n };\n}\n","<ul class=\"pagination\" [ngClass]=\"classMap\">\n <li class=\"pagination-first page-item\"\n *ngIf=\"boundaryLinks\"\n [class.disabled]=\"noPrevious() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customFirstTemplate || defaultFirstTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noPrevious() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-prev page-item\"\n *ngIf=\"directionLinks\"\n [class.disabled]=\"noPrevious() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(page - 1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customPreviousTemplate || defaultPreviousTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noPrevious() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li *ngFor=\"let pg of pages\"\n [class.active]=\"pg.active\"\n [class.disabled]=\"disabled && !pg.active\"\n class=\"pagination-page page-item\">\n <a class=\"page-link\" href (click)=\"selectPage(pg.number, $event)\">\n <ng-container [ngTemplateOutlet]=\"customPageTemplate || defaultPageTemplate\"\n [ngTemplateOutletContext]=\"{disabled: disabled, $implicit: pg, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-next page-item\"\n *ngIf=\"directionLinks\"\n [class.disabled]=\"noNext() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(page + 1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customNextTemplate || defaultNextTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noNext() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-last page-item\"\n *ngIf=\"boundaryLinks\"\n [class.disabled]=\"noNext() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(totalPages, $event)\">\n <ng-container [ngTemplateOutlet]=\"customLastTemplate || defaultLastTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noNext() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n</ul>\n\n<ng-template #defaultPageTemplate let-page>{{ page.text }}</ng-template>\n\n<ng-template #defaultNextTemplate>{{ getText('next') }}</ng-template>\n\n<ng-template #defaultPreviousTemplate>{{ getText('previous') }}</ng-template>\n\n<ng-template #defaultFirstTemplate>{{ getText('first') }}</ng-template>\n\n<ng-template #defaultLastTemplate>{{ getText('last') }}</ng-template>\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n Provider\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { ConfigModel, PagesModel } from './models';\n\nimport { PageChangedEvent } from './pagination.component';\nimport { PaginationConfig } from './pagination.config';\n\nexport const PAGER_CONTROL_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PagerComponent),\n multi: true\n};\n\n@Component({\n selector: 'pager',\n templateUrl: './pager.component.html',\n providers: [PAGER_CONTROL_VALUE_ACCESSOR]\n})\nexport class PagerComponent implements ControlValueAccessor, OnInit {\n config?: Partial<ConfigModel>;\n /** if `true` aligns each link to the sides of pager */\n @Input() align = false;\n /** limit number for page links in pager */\n @Input() maxSize?: number;\n /** if false first and last buttons will be hidden */\n @Input() boundaryLinks = false;\n /** if false previous and next buttons will be hidden */\n @Input() directionLinks = true;\n // labels\n /** first button text */\n @Input() firstText = 'First';\n /** previous button text */\n @Input() previousText = '« Previous';\n /** next button text */\n @Input() nextText = 'Next »';\n /** last button text */\n @Input() lastText = 'Last';\n /** if true current page will in the middle of pages list */\n @Input() rotate = true;\n // css\n /** add class to <code><li\\></code> */\n @Input() pageBtnClass = '';\n\n /** if true pagination component will be disabled */\n @Input() disabled = false;\n\n /** fired when total pages count changes, $event:number equals to total pages count */\n @Output() numPages = new EventEmitter<number>();\n /** fired when page was changed, $event:{page, itemsPerPage} equals to\n * object with current page index and number of items per page\n */\n @Output()\n pageChanged = new EventEmitter<PageChangedEvent>();\n onChange = Function.prototype;\n onTouched = Function.prototype;\n classMap = '';\n pages?: PagesModel[];\n protected inited = false;\n\n constructor(private elementRef: ElementRef,\n paginationConfig: PaginationConfig,\n private changeDetection: ChangeDetectorRef) {\n this.elementRef = elementRef;\n if (!this.config) {\n this.configureOptions(\n Object.assign({}, paginationConfig.main, paginationConfig.pager)\n );\n }\n }\n\n protected _itemsPerPage = 15;\n\n /** maximum number of items per page. If value less than 1 will display all items on one page */\n @Input()\n get itemsPerPage(): number {\n return this._itemsPerPage;\n }\n\n set itemsPerPage(v: number) {\n this._itemsPerPage = v;\n this.totalPages = this.calculateTotalPages();\n }\n\n protected _totalItems = 0;\n\n /** total number of items in all pages */\n @Input()\n get totalItems(): number {\n return this._totalItems;\n }\n\n set totalItems(v: number) {\n this._totalItems = v;\n this.totalPages = this.calculateTotalPages();\n }\n\n protected _totalPages = 0;\n\n get totalPages(): number {\n return this._totalPages;\n }\n\n set totalPages(v: number) {\n this._totalPages = v;\n this.numPages.emit(v);\n if (this.inited) {\n this.selectPage(this.page);\n }\n }\n\n protected _page = 1;\n\n get page(): number {\n return this._page;\n }\n\n set page(value: number) {\n const _previous = this._page;\n this._page = value > this.totalPages ? this.totalPages : value || 1;\n this.changeDetection.markForCheck();\n\n if (_previous === this._page || typeof _previous === 'undefined') {\n return;\n }\n\n this.pageChanged.emit({\n page: this._page,\n itemsPerPage: this.itemsPerPage\n });\n }\n\n configureOptions(config: Partial<ConfigModel>): void {\n this.config = Object.assign({}, config);\n }\n\n ngOnInit(): void {\n if (typeof window !== 'undefined') {\n this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';\n }\n // watch for maxSize\n if (typeof this.maxSize === 'undefined') {\n this.maxSize = this.config?.maxSize || 0;\n }\n\n if (typeof this.rotate === 'undefined') {\n this.rotate = !!this.config?.rotate;\n }\n\n if (typeof this.boundaryLinks === 'undefined') {\n this.boundaryLinks = !!this.config?.boundaryLinks;\n }\n\n\n if (typeof this.directionLinks === 'undefined') {\n this.directionLinks = !!this.config?.directionLinks;\n }\n\n if (typeof this.pageBtnClass === 'undefined') {\n this.pageBtnClass = this.config?.pageBtnClass || '';\n }\n\n // base class\n if (typeof this.itemsPerPage === 'undefined') {\n this.itemsPerPage = this.config?.itemsPerPage || 0;\n }\n\n this.totalPages = this.calculateTotalPages();\n // this class\n this.pages = this.getPages(this.page, this.totalPages);\n this.inited = true;\n }\n\n writeValue(value: number): void {\n this.page = value;\n this.pages = this.getPages(this.page, this.totalPages);\n }\n\n getText(key: string): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (this as any)[`${key}Text`] || (this as any).config[`${key}Text`];\n }\n\n noPrevious(): boolean {\n return this.page === 1;\n }\n\n noNext(): boolean {\n return this.page === this.totalPages;\n }\n\n registerOnChange(fn: () => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n selectPage(page: number, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n\n if (!this.disabled) {\n if (event && event.target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const target: any = event.target;\n target.blur();\n }\n this.writeValue(page);\n this.onChange(this.page);\n }\n }\n\n // Create page object used in template\n protected makePage(num: number,\n text: string,\n active: boolean): { number: number; text: string; active: boolean } {\n return { text, number: num, active };\n }\n\n protected getPages(currentPage: number, totalPages: number): PagesModel[] {\n const pages: PagesModel[] = [];\n\n // Default page limits\n let startPage = 1;\n let endPage = totalPages;\n const isMaxSized =\n typeof this.maxSize !== 'undefined' && this.maxSize < totalPages;\n\n // recompute if maxSize\n if (isMaxSized && this.maxSize) {\n if (this.rotate) {\n // Current page is displayed in the middle of the visible ones\n startPage = Math.max(currentPage - Math.floor(this.maxSize / 2), 1);\n endPage = startPage + this.maxSize - 1;\n\n // Adjust if limit is exceeded\n if (endPage > totalPages) {\n endPage = totalPages;\n startPage = endPage - this.maxSize + 1;\n }\n } else {\n // Visible pages are paginated with maxSize\n startPage =\n (Math.ceil(currentPage / this.maxSize) - 1) * this.maxSize + 1;\n\n // Adjust last page if limit is exceeded\n endPage = Math.min(startPage + this.maxSize - 1, totalPages);\n }\n }\n\n // Add page number links\n for (let num = startPage; num <= endPage; num++) {\n const page = this.makePage(num, num.toString(), num === currentPage);\n pages.push(page);\n }\n\n // Add links to move between page sets\n if (isMaxSized && !this.rotate) {\n if (startPage > 1) {\n const previousPageSet = this.makePage(startPage - 1, '...', false);\n pages.unshift(previousPageSet);\n }\n\n if (endPage < totalPages) {\n const nextPageSet = this.makePage(endPage + 1, '...', false);\n pages.push(nextPageSet);\n }\n }\n\n return pages;\n }\n\n // base class\n protected calculateTotalPages(): number {\n const totalPages =\n this.itemsPerPage < 1\n ? 1\n : Math.ceil(this.totalItems / this.itemsPerPage);\n\n return Math.max(totalPages || 0, 1);\n }\n}\n","<ul class=\"pager\">\n <li [class.disabled]=\"noPrevious()\" [class.previous]=\"align\"\n [ngClass]=\"{'pull-left': align, 'float-left': align}\"\n class=\"{{ pageBtnClass }}\">\n <a href (click)=\"selectPage(page - 1, $event)\">{{ getText('previous') }}</a>\n </li>\n <li [class.disabled]=\"noNext()\" [class.next]=\"align\"\n [ngClass]=\"{'pull-right': align, 'float-right': align}\"\n class=\"{{ pageBtnClass }}\">\n <a href (click)=\"selectPage(page + 1, $event)\">{{ getText('next') }}</a>\n </li>\n</ul>\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n OnInit,\n Output,\n Provider,\n TemplateRef\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ConfigModel, PagesModel, PaginationLinkContext, PaginationNumberLinkContext } from './models';\n\nimport { PaginationConfig } from './pagination.config';\n\nexport interface PageChangedEvent {\n itemsPerPage: number;\n page: number;\n}\n\nexport const PAGINATION_CONTROL_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => PaginationComponent),\n multi: true\n};\n\n@Component({\n selector: 'pagination',\n templateUrl: './pagination.component.html',\n providers: [PAGINATION_CONTROL_VALUE_ACCESSOR]\n})\nexport class PaginationComponent implements ControlValueAccessor, OnInit {\n config?: Partial<ConfigModel>;\n /** if `true` aligns each link to the sides of pager */\n @Input() align = true;\n /** limit number for page links in pager */\n @Input() maxSize?: number;\n /** if false first and last buttons will be hidden */\n @Input() boundaryLinks = false;\n /** if false previous and next buttons will be hidden */\n @Input() directionLinks = true;\n // labels\n /** first button text */\n @Input() firstText?: string;\n /** previous button text */\n @Input() previousText?: string;\n /** next button text */\n @Input() nextText?: string;\n /** last button text */\n @Input() lastText?: string;\n /** if true current page will in the middle of pages list */\n @Input() rotate = true;\n // css\n /** add class to <code><li\\></code> */\n @Input() pageBtnClass = '';\n /** if true pagination component will be disabled */\n @Input() disabled = false;\n /** custom template for page link */\n @Input() customPageTemplate?: TemplateRef<PaginationNumberLinkContext>;\n /** custom template for next link */\n @Input() customNextTemplate?: TemplateRef<PaginationLinkContext>;\n /** custom template for previous link */\n @Input() customPreviousTemplate?: TemplateRef<PaginationLinkContext>;\n /** custom template for first link */\n @Input() customFirstTemplate?: TemplateRef<PaginationLinkContext>;\n /** custom template for last link */\n @Input() customLastTemplate?: TemplateRef<PaginationLinkContext>;\n\n /** fired when total pages count changes, $event:number equals to total pages count */\n @Output() numPages = new EventEmitter<number>();\n /** fired when page was changed, $event:{page, itemsPerPage} equals to object\n * with current page index and number of items per page\n */\n @Output() pageChanged = new EventEmitter<PageChangedEvent>();\n onChange = Function.prototype;\n onTouched = Function.prototype;\n classMap = '';\n pages?: PagesModel[];\n protected inited = false;\n\n constructor(\n private elementRef: ElementRef,\n paginationConfig: PaginationConfig,\n private changeDetection: ChangeDetectorRef\n ) {\n this.elementRef = elementRef;\n if (!this.config) {\n this.configureOptions(paginationConfig.main);\n }\n }\n\n protected _itemsPerPage = 10;\n\n /** maximum number of items per page. If value less than 1 will display all items on one page */\n @Input()\n get itemsPerPage(): number {\n return this._itemsPerPage;\n }\n\n set itemsPerPage(v: number) {\n this._itemsPerPage = v;\n this.totalPages = this.calculateTotalPages();\n }\n\n protected _totalItems = 0;\n\n /** total number of items in all pages */\n @Input()\n get totalItems(): number {\n return this._totalItems;\n }\n\n set totalItems(v: number) {\n this._totalItems = v;\n this.totalPages = this.calculateTotalPages();\n }\n\n protected _totalPages = 0;\n\n get totalPages(): number {\n return this._totalPages;\n }\n\n set totalPages(v: number) {\n this._totalPages = v;\n this.numPages.emit(v);\n if (this.inited) {\n this.selectPage(this.page);\n }\n }\n\n protected _page = 1;\n\n get page(): number {\n return this._page;\n }\n\n set page(value: number) {\n const _previous = this._page;\n this._page = value > this.totalPages ? this.totalPages : value || 1;\n this.changeDetection.markForCheck();\n\n if (_previous === this._page || typeof _previous === 'undefined') {\n return;\n }\n\n this.pageChanged.emit({\n page: this._page,\n itemsPerPage: this.itemsPerPage\n });\n }\n\n configureOptions(config: Partial<ConfigModel>): void {\n this.config = Object.assign({}, config);\n }\n\n ngOnInit(): void {\n if (typeof window !== 'undefined') {\n this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';\n }\n\n // watch for maxSize\n if (typeof this.maxSize === 'undefined') {\n this.maxSize = this.config?.maxSize || 0;\n }\n\n if (typeof this.rotate === 'undefined') {\n this.rotate = !!this.config?.rotate;\n }\n\n if (typeof this.boundaryLinks === 'undefined') {\n this.boundaryLinks = !!this.config?.boundaryLinks;\n }\n\n\n if (typeof this.directionLinks === 'undefined') {\n this.directionLinks = !!this.config?.directionLinks;\n }\n\n if (typeof this.pageBtnClass === 'undefined') {\n this.pageBtnClass = this.config?.pageBtnClass || '';\n }\n\n // base class\n if (typeof this.itemsPerPage === 'undefined') {\n this.itemsPerPage = this.config?.itemsPerPage || 0;\n }\n\n this.totalPages = this.calculateTotalPages();\n // this class\n this.pages = this.getPages(this.page, this.totalPages);\n this.inited = true;\n }\n\n writeValue(value: number): void {\n this.page = value;\n this.pages = this.getPages(this.page, this.totalPages);\n }\n\n getText(key: string): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (this as any)[`${key}Text`] || (this as any).config[`${key}Text`];\n }\n\n noPrevious(): boolean {\n return this.page === 1;\n }\n\n noNext(): boolean {\n return this.page === this.totalPages;\n }\n\n registerOnChange(fn: () => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n selectPage(page: number, event?: Event): void {\n if (event) {\n event.preventDefault();\n }\n\n if (!this.disabled) {\n if (event && event.target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const target: any = event.target;\n target.blur();\n }\n this.writeValue(page);\n this.onChange(this.page);\n }\n }\n\n // Create page object used in template\n protected makePage(\n num: number,\n text: string,\n active: boolean\n ): { number: number; text: string; active: boolean } {\n return { text, number: num, active };\n }\n\n protected getPages(currentPage: number, totalPages: number): PagesModel[] {\n const pages: PagesModel[] = [];\n\n // Default page limits\n let startPage = 1;\n let endPage = totalPages;\n const isMaxSized =\n typeof this.maxSize !== 'undefined' && this.maxSize < totalPages;\n\n // recompute if maxSize\n if (isMaxSized && this.maxSize) {\n if (this.rotate) {\n // Current page is displayed in the middle of the visible ones\n startPage = Math.max(currentPage - Math.floor(this.maxSize / 2), 1);\n endPage = startPage + this.maxSize - 1;\n\n // Adjust if limit is exceeded\n if (endPage > totalPages) {\n endPage = totalPages;\n startPage = endPage - this.maxSize + 1;\n }\n } else {\n // Visible pages are paginated with maxSize\n startPage =\n (Math.ceil(currentPage / this.maxSize) - 1) * this.maxSize + 1;\n\n // Adjust last page if limit is exceeded\n endPage = Math.min(startPage + this.maxSize - 1, totalPages);\n }\n }\n\n // Add page number links\n for (let num = startPage; num <= endPage; num++) {\n const page = this.makePage(num, num.toString(), num === currentPage);\n pages.push(page);\n }\n\n // Add links to move between page sets\n if (isMaxSized && !this.rotate) {\n if (startPage > 1) {\n const previousPageSet = this.makePage(startPage - 1, '...', false);\n pages.unshift(previousPageSet);\n }\n\n if (endPage < totalPages) {\n const nextPageSet = this.makePage(endPage + 1, '...', false);\n pages.push(nextPageSet);\n }\n }\n\n return pages;\n }\n\n // base class\n protected calculateTotalPages(): number {\n const totalPages =\n this.itemsPerPage < 1\n ? 1\n : Math.ceil(this.totalItems / this.itemsPerPage);\n\n return Math.max(totalPages || 0, 1);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule, ModuleWithProviders } from '@angular/core';\n\nimport { PagerComponent } from './pager.component';\nimport { PaginationComponent } from './pagination.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [PagerComponent, PaginationComponent],\n exports: [PagerComponent, PaginationComponent]\n})\nexport class PaginationModule {\n static forRoot(): ModuleWithProviders<PaginationModule> {\n return { ngModule: PaginationModule, providers: [] };\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule, ModuleWithProviders } from '@angular/core';\n\nimport { NgTranscludeDirective } from './ng-transclude.directive';\nimport { TabHeadingDirective } from './tab-heading.directive';\nimport { TabDirective } from './tab.directive';\nimport { TabsetComponent } from './tabset.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [\n NgTranscludeDirective,\n TabDirective,\n TabsetComponent,\n TabHeadingDirective\n ],\n exports: [\n TabDirective,\n TabsetComponent,\n TabHeadingDirective,\n NgTranscludeDirective\n ]\n})\nexport class TabsModule {\n static forRoot(): ModuleWithProviders<TabsModule> {\n return {\n ngModule: TabsModule,\n providers: []\n };\n }\n}\n","\r\n/**\r\n * Check and return true if an object is type of string\r\n * @param obj Analyse has to object the string type\r\n * @return result of analysis\r\n */\r\nexport function isString(obj: any): boolean {\r\n return typeof obj === 'string';\r\n}\r\n\r\n/**\r\n * Check and return true if an object is type of number\r\n * @param obj Analyse has to object the boolean type\r\n * @return result of analysis\r\n */\r\nexport function isNumber(obj: any): boolean {\r\n return typeof obj === 'number';\r\n}\r\n\r\n/**\r\n * Check and return true if an object is type of Function\r\n * @param obj Analyse has to object the function type\r\n * @return result of analysis\r\n */\r\nexport function isFunction(obj: any): boolean {\r\n return typeof obj === 'function';\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\nimport { isString, isNumber, isFunction } from './toasta.utils';\r\n\r\n\r\n\r\n/**\r\n * Options to configure a new Toast\r\n */\r\n@Injectable()\r\nexport class ToastOptions {\r\n title: string;\r\n msg?: string;\r\n showClose?: boolean;\r\n showDuration?: boolean;\r\n theme?: string;\r\n timeout?: number;\r\n onAdd?: Function;\r\n onRemove?: Function;\r\n}\r\n\r\n/**\r\n * Structrure of a created Toast\r\n */\r\n@Injectable()\r\nexport class ToastData {\r\n id: number;\r\n title: string;\r\n msg: string;\r\n showClose: boolean;\r\n showDuration: boolean;\r\n type: string;\r\n theme: string;\r\n timeout: number;\r\n onAdd: Function;\r\n onRemove: Function;\r\n onClick: Function;\r\n}\r\n\r\n/**\r\n * Default configuration for all toasts and toasta container\r\n */\r\n@Injectable()\r\nexport class ToastaConfig {\r\n\r\n // Maximum number of toasties to show at once\r\n limit = 5;\r\n\r\n // Whether to show the 'X' icon to close the toast\r\n showClose = true;\r\n\r\n // Whether to show a progress bar at the bottom of the notification\r\n showDuration = true;\r\n\r\n // The window position where the toast pops up\r\n position: 'bottom-right' | 'bottom-left' | 'bottom-center' | 'bottom-fullwidth' | 'top-right' | 'top-left' | 'top-center' | 'top-fullwidth' | 'center-center' = 'bottom-right';\r\n\r\n // How long (in miliseconds) the toasta shows before it's removed. Set to null/0 to turn off.\r\n timeout = 5000;\r\n\r\n // What theme to use\r\n theme: 'default' | 'material' | 'bootstrap' = 'default';\r\n}\r\n\r\nexport enum ToastaEventType {\r\n ADD,\r\n CLEAR,\r\n CLEAR_ALL\r\n}\r\n\r\nexport class ToastaEvent {\r\n constructor(public type: ToastaEventType, public value?: any) { }\r\n}\r\n\r\nexport function toastaServiceFactory(config: ToastaConfig): ToastaService {\r\n return new ToastaService(config);\r\n}\r\n\r\n/**\r\n * Toasta service helps create different kinds of Toasts\r\n */\r\n@Injectable()\r\nexport class ToastaService {\r\n // Allowed THEMES\r\n static THEMES: Array<string> = ['default', 'material', 'bootstrap'];\r\n // Init the counter\r\n uniqueCounter = 0;\r\n // ToastData event emitter\r\n // private toastsEmitter: EventEmitter<ToastData> = new EventEmitter<ToastData>();\r\n // Clear event emitter\r\n // private clearEmitter: EventEmitter<number> = new EventEmitter<number>();\r\n\r\n private eventSource: Subject<ToastaEvent> = new Subject<ToastaEvent>();\r\n public events: Observable<ToastaEvent> = this.eventSource.asObservable();\r\n\r\n constructor(private config: ToastaConfig) { }\r\n\r\n /**\r\n * Get list of toats\r\n */\r\n // getToasts(): Observable<ToastData> {\r\n // return this.toastsEmitter.asObservable();\r\n // }\r\n\r\n // getClear(): Observable<number> {\r\n // return this.clearEmitter.asObservable();\r\n // }\r\n\r\n /**\r\n * Create Toast of a default type\r\n */\r\n default(options: ToastOptions | string | number): void {\r\n this.add(options, 'default');\r\n }\r\n\r\n /**\r\n * Create Toast of info type\r\n * @param options Individual toasta config overrides\r\n */\r\n info(options: ToastOptions | string | number): void {\r\n this.add(options, 'info');\r\n }\r\n\r\n /**\r\n * Create Toast of success type\r\n * @param options Individual toasta config overrides\r\n */\r\n success(options: ToastOptions | string | number): void {\r\n this.add(options, 'success');\r\n }\r\n\r\n /**\r\n * Create Toast of wait type\r\n * @param options Individual toasta config overrides\r\n */\r\n wait(options: ToastOptions | string | number): void {\r\n this.add(options, 'wait');\r\n }\r\n\r\n /**\r\n * Create Toast of error type\r\n * @param options Individual toasta config overrides\r\n */\r\n error(options: ToastOptions | string | number): void {\r\n this.add(options, 'error');\r\n }\r\n\r\n /**\r\n * Create Toast of warning type\r\n * @param options Individual toasta config overrides\r\n */\r\n warning(options: ToastOptions | string | number): void {\r\n this.add(options, 'warning');\r\n }\r\n\r\n\r\n // Add a new toast item\r\n private add(options: ToastOptions | string | number, type: string) {\r\n let toastaOptions: ToastOptions;\r\n\r\n if (isString(options) && options !== '' || isNumber(options)) {\r\n toastaOptions = {\r\n title: options.toString()\r\n } as ToastOptions;\r\n } else {\r\n toastaOptions = options as ToastOptions;\r\n }\r\n\r\n if (!toastaOptions || !toastaOptions.title && !toastaOptions.msg) {\r\n throw new Error('ngx-toasta: No toast title or message specified!');\r\n }\r\n\r\n type = type || 'default';\r\n\r\n // Set a unique counter for an id\r\n this.uniqueCounter++;\r\n\r\n // Set the local vs global config items\r\n const showClose = this._checkConfigItem(this.config, toastaOptions, 'showClose');\r\n\r\n // Set the local vs global config items\r\n const showDuration = this._checkConfigItem(this.config, toastaOptions, 'showDuration');\r\n\r\n // If we have a theme set, make sure it's a valid one\r\n let theme: string;\r\n if (toastaOptions.theme) {\r\n theme = ToastaService.THEMES.indexOf(toastaOptions.theme) > -1 ? toastaOptions.theme : this.config.theme;\r\n } else {\r\n theme = this.config.theme;\r\n }\r\n\r\n const toast: ToastData = {\r\n id: this.uniqueCounter,\r\n title: toastaOptions.title,\r\n msg: toastaOptions.msg,\r\n showClose,\r\n showDuration,\r\n type: 'toasta-type-' + type,\r\n theme: 'toasta-theme-' + theme,\r\n onAdd: toastaOptions.onAdd && isFunction(toastaOptions.onAdd) ? toastaOptions.onAdd : null,\r\n onRemove: toastaOptions.onRemove && isFunction(toastaOptions.onRemove) ? toastaOptions.onRemove : null\r\n } as ToastData;\r\n\r\n // If there's a timeout individually or globally, set the toast to timeout\r\n // Allows a caller to pass null/0 and override the default. Can also set the default to null/0 to turn off.\r\n toast.timeout = toastaOptions.hasOwnProperty('timeout') ? toastaOptions.timeout ?? 0 : this.config.timeout;\r\n\r\n // Push up a new toast item\r\n // this.toastsSubscriber.next(toast);\r\n // this.toastsEmitter.next(toast);\r\n this.emitEvent(new ToastaEvent(ToastaEventType.ADD, toast));\r\n // If we have a onAdd function, call it here\r\n if (toastaOptions.onAdd && isFunction(toastaOptions.onAdd)) {\r\n toastaOptions.onAdd.call(this, toast);\r\n }\r\n }\r\n\r\n // Clear all toasts\r\n clearAll() {\r\n // this.clearEmitter.next(null);\r\n this.emitEvent(new ToastaEvent(ToastaEventType.CLEAR_ALL));\r\n }\r\n\r\n // Clear the specific one\r\n clear(id: number) {\r\n // this.clearEmitter.next(id);\r\n this.emitEvent(new ToastaEvent(ToastaEventType.CLEAR, id));\r\n }\r\n\r\n // Checks whether the local option is set, if not,\r\n // checks the global config\r\n private _checkConfigItem(config: any, options: any, property: string) {\r\n if (options[property] === false) {\r\n return false;\r\n } else if (!options[property]) {\r\n return config[property];\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n private emitEvent(event: ToastaEvent) {\r\n if (this.eventSource) {\r\n // Push up a new event\r\n this.eventSource.next(event);\r\n }\r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n\r\nimport { ToastaComponent } from './toasta.component';\r\nimport { ToastComponent } from './toast.component';\r\nimport { SafeHtmlPipe } from './shared';\r\nimport { ToastaService, ToastaConfig, toastaServiceFactory } from './toasta.service';\r\n\r\nexport let providers = [\r\n ToastaConfig,\r\n { provide: ToastaService, useFactory: toastaServiceFactory, deps: [ToastaConfig] }\r\n];\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [ToastComponent, ToastaComponent, SafeHtmlPipe],\r\n exports: [ToastComponent, ToastaComponent],\r\n providers\r\n})\r\nexport class ToastaModule {\r\n static forRoot(): ModuleWithProviders<ToastaModule> {\r\n return {\r\n ngModule: ToastaModule,\r\n providers\r\n };\r\n }\r\n}\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HighContrastModeDetector} from '@angular/cdk/a11y';\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {inject, Inject, InjectionToken, NgModule, Optional} from '@angular/core';\nimport {VERSION as CDK_VERSION} from '@angular/cdk';\nimport {DOCUMENT} from '@angular/common';\nimport {Platform, _isTestEnvironment} from '@angular/cdk/platform';\nimport {VERSION} from '../version';\n\n/** @docs-private */\nexport function MATERIAL_SANITY_CHECKS_FACTORY(): SanityChecks {\n return true;\n}\n\n/** Injection token that configures whether the Material sanity checks are enabled. */\nexport const MATERIAL_SANITY_CHECKS = new InjectionToken<SanityChecks>('mat-sanity-checks', {\n providedIn: 'root',\n factory: MATERIAL_SANITY_CHECKS_FACTORY,\n});\n\n/**\n * Possible sanity checks that can be enabled. If set to\n * true/false, all checks will be enabled/disabled.\n */\nexport type SanityChecks = boolean | GranularSanityChecks;\n\n/** Object that can be used to configure the sanity checks granularly. */\nexport interface GranularSanityChecks {\n doctype: boolean;\n theme: boolean;\n version: boolean;\n}\n\n/**\n * Module that captures anything that should be loaded and/or run for *all* Angular Material\n * components. This includes Bidi, etc.\n *\n * This module should be imported to each top-level component module (e.g., MatTabsModule).\n */\n@NgModule({\n imports: [BidiModule],\n exports: [BidiModule],\n})\nexport class MatCommonModule {\n /** Whether we've done the global sanity checks (e.g. a theme is loaded, there is a doctype). */\n private _hasDoneGlobalChecks = false;\n\n constructor(\n highContrastModeDetector: HighContrastModeDetector,\n @Optional() @Inject(MATERIAL_SANITY_CHECKS) private _sanityChecks: SanityChecks,\n @Inject(DOCUMENT) private _document: Document,\n ) {\n // While A11yModule also does this, we repeat it here to avoid importing A11yModule\n // in MatCommonModule.\n highContrastModeDetector._applyBodyHighContrastModeCssClasses();\n\n if (!this._hasDoneGlobalChecks) {\n this._hasDoneGlobalChecks = true;\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Inject in here so the reference to `Platform` can be removed in production mode.\n const platform = inject(Platform, {optional: true});\n\n if (this._checkIsEnabled('doctype')) {\n _checkDoctypeIsDefined(this._document);\n }\n\n if (this._checkIsEnabled('theme')) {\n _checkThemeIsPresent(this._document, !!platform?.isBrowser);\n }\n\n if (this._checkIsEnabled('version')) {\n _checkCdkVersionMatch();\n }\n }\n }\n }\n\n /** Gets whether a specific sanity check is enabled. */\n private _checkIsEnabled(name: keyof GranularSanityChecks): boolean {\n if (_isTestEnvironment()) {\n return false;\n }\n\n if (typeof this._sanityChecks === 'boolean') {\n return this._sanityChecks;\n }\n\n return !!this._sanityChecks[name];\n }\n}\n\n/** Checks that the page has a doctype. */\nfunction _checkDoctypeIsDefined(doc: Document): void {\n if (!doc.doctype) {\n console.warn(\n 'Current document does not have a doctype. This may cause ' +\n 'some Angular Material components not to behave as expected.',\n );\n }\n}\n\n/** Checks that a theme has been included. */\nfunction _checkThemeIsPresent(doc: Document, isBrowser: boolean): void {\n // We need to assert that the `body` is defined, because these checks run very early\n // and the `body` won't be defined if the consumer put their scripts in the `head`.\n if (!doc.body || !isBrowser) {\n return;\n }\n\n const testElement = doc.createElement('div');\n testElement.classList.add('mat-theme-loaded-marker');\n doc.body.appendChild(testElement);\n\n const computedStyle = getComputedStyle(testElement);\n\n // In some situations the computed style of the test element can be null. For example in\n // Firefox, the computed style is null if an application is running inside of a hidden iframe.\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n if (computedStyle && computedStyle.display !== 'none') {\n console.warn(\n 'Could not find Angular Material core theme. Most Material ' +\n 'components may not work as expected. For more info refer ' +\n 'to the theming guide: https://material.angular.io/guide/theming',\n );\n }\n\n testElement.remove();\n}\n\n/** Checks whether the Material version matches the CDK version. */\nfunction _checkCdkVersionMatch(): void {\n if (VERSION.full !== CDK_VERSION.full) {\n console.warn(\n 'The Angular Material version (' +\n VERSION.full +\n ') does not match ' +\n 'the Angular CDK version (' +\n CDK_VERSION.full +\n ').\\n' +\n 'Please ensure the versions of these two packages exactly match.',\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {AbstractConstructor, Constructor} from './constructor';\n\n/** @docs-private */\nexport interface CanDisable {\n /** Whether the component is disabled. */\n disabled: boolean;\n}\n\ntype CanDisableCtor = Constructor<CanDisable> & AbstractConstructor<CanDisable>;\n\n/** Mixin to augment a directive with a `disabled` property. */\nexport function mixinDisabled<T extends AbstractConstructor<{}>>(base: T): CanDisableCtor & T;\nexport function mixinDisabled<T extends Constructor<{}>>(base: T): CanDisableCtor & T {\n return class extends base {\n private _disabled: boolean = false;\n\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n }\n\n constructor(...args: any[]) {\n super(...args);\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AbstractConstructor, Constructor} from './constructor';\nimport {ElementRef} from '@angular/core';\n\n/** @docs-private */\nexport interface CanColor {\n /** Theme color palette for the component. */\n color: ThemePalette;\n\n /** Default color to fall back to if no value is set. */\n defaultColor: ThemePalette | undefined;\n}\n\ntype CanColorCtor = Constructor<CanColor> & AbstractConstructor<CanColor>;\n\n/** @docs-private */\nexport interface HasElementRef {\n _elementRef: ElementRef;\n}\n\n/** Possible color palette values. */\nexport type ThemePalette = 'primary' | 'accent' | 'warn' | undefined;\n\n/** Mixin to augment a directive with a `color` property. */\nexport function mixinColor<T extends AbstractConstructor<HasElementRef>>(\n base: T,\n defaultColor?: ThemePalette,\n): CanColorCtor & T;\nexport function mixinColor<T extends Constructor<HasElementRef>>(\n base: T,\n defaultColor?: ThemePalette,\n): CanColorCtor & T {\n return class extends base {\n private _color: ThemePalette;\n defaultColor = defaultColor;\n\n get color(): ThemePalette {\n return this._color;\n }\n set color(value: ThemePalette) {\n const colorPalette = value || this.defaultColor;\n\n if (colorPalette !== this._color) {\n if (this._color) {\n this._elementRef.nativeElement.classList.remove(`mat-${this._color}`);\n }\n if (colorPalette) {\n this._elementRef.nativeElement.classList.add(`mat-${colorPalette}`);\n }\n\n this._color = colorPalette;\n }\n }\n\n constructor(...args: any[]) {\n super(...args);\n\n // Set the default color that can be specified from the mixin.\n this.color = defaultColor;\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {AbstractConstructor, Constructor} from './constructor';\n\n/** @docs-private */\nexport interface CanDisableRipple {\n /** Whether ripples are disabled. */\n disableRipple: boolean;\n}\n\ntype CanDisableRippleCtor = Constructor<CanDisableRipple> & AbstractConstructor<CanDisableRipple>;\n\n/** Mixin to augment a directive with a `disableRipple` property. */\nexport function mixinDisableRipple<T extends AbstractConstructor<{}>>(\n base: T,\n): CanDisableRippleCtor & T;\nexport function mixinDisableRipple<T extends Constructor<{}>>(base: T): CanDisableRippleCtor & T {\n return class extends base {\n private _disableRipple: boolean = false;\n\n /** Whether the ripple effect is disabled or not. */\n get disableRipple(): boolean {\n return this._disableRipple;\n }\n set disableRipple(value: any) {\n this._disableRipple = coerceBooleanProperty(value);\n }\n\n constructor(...args: any[]) {\n super(...args);\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {DateAdapter} from './date-adapter';\nimport {MAT_DATE_FORMATS} from './date-formats';\nimport {NativeDateAdapter} from './native-date-adapter';\nimport {MAT_NATIVE_DATE_FORMATS} from './native-date-formats';\n\nexport * from './date-adapter';\nexport * from './date-formats';\nexport * from './native-date-adapter';\nexport * from './native-date-formats';\n\n@NgModule({\n providers: [{provide: DateAdapter, useClass: NativeDateAdapter}],\n})\nexport class NativeDateModule {}\n\n@NgModule({\n imports: [NativeDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_NATIVE_DATE_FORMATS}],\n})\nexport class MatNativeDateModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '@angular/core';\nimport {FormGroupDirective, NgForm, AbstractControl} from '@angular/forms';\n\n/** Error state matcher that matches when a control is invalid and dirty. */\n@Injectable()\nexport class ShowOnDirtyErrorStateMatcher implements ErrorStateMatcher {\n isErrorState(control: AbstractControl | null, form: FormGroupDirective | NgForm | null): boolean {\n return !!(control && control.invalid && (control.dirty || (form && form.submitted)));\n }\n}\n\n/** Provider that defines how form controls behave with regards to displaying error messages. */\n@Injectable({providedIn: 'root'})\nexport class ErrorStateMatcher {\n isErrorState(control: AbstractControl | null, form: FormGroupDirective | NgForm | null): boolean {\n return !!(control && control.invalid && (control.touched || (form && form.submitted)));\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Possible states for a ripple element. */\nexport const enum RippleState {\n FADING_IN,\n VISIBLE,\n FADING_OUT,\n HIDDEN,\n}\n\nexport type RippleConfig = {\n color?: string;\n centered?: boolean;\n radius?: number;\n persistent?: boolean;\n animation?: RippleAnimationConfig;\n terminateOnPointerUp?: boolean;\n};\n\n/**\n * Interface that describes the configuration for the animation of a ripple.\n * There are two animation phases with different durations for the ripples.\n */\nexport interface RippleAnimationConfig {\n /** Duration in milliseconds for the enter animation (expansion from point of contact). */\n enterDuration?: number;\n /** Duration in milliseconds for the exit animation (fade-out). */\n exitDuration?: number;\n}\n\n/**\n * Reference to a previously launched ripple element.\n */\nexport class RippleRef {\n /** Current state of the ripple. */\n state: RippleState = RippleState.HIDDEN;\n\n constructor(\n private _renderer: {fadeOutRipple(ref: RippleRef): void},\n /** Reference to the ripple HTML element. */\n public element: HTMLElement,\n /** Ripple configuration used for the ripple. */\n public config: RippleConfig,\n /* Whether animations are forcibly disabled for ripples through CSS. */\n public _animationForciblyDisabledThroughCss = false,\n ) {}\n\n /** Fades out the ripple element. */\n fadeOut() {\n this._renderer.fadeOutRipple(this);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {normalizePassiveListenerOptions, _getEventTarget} from '@angular/cdk/platform';\nimport {NgZone} from '@angular/core';\n\n/** Options used to bind a passive capturing event. */\nconst passiveCapturingEventOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n\n/** Manages events through delegation so that as few event handlers as possible are bound. */\nexport class RippleEventManager {\n private _events = new Map<string, Map<HTMLElement, Set<EventListenerObject>>>();\n\n /** Adds an event handler. */\n addHandler(ngZone: NgZone, name: string, element: HTMLElement, handler: EventListenerObject) {\n const handlersForEvent = this._events.get(name);\n\n if (handlersForEvent) {\n const handlersForElement = handlersForEvent.get(element);\n\n if (handlersForElement) {\n handlersForElement.add(handler);\n } else {\n handlersForEvent.set(element, new Set([handler]));\n }\n } else {\n this._events.set(name, new Map([[element, new Set([handler])]]));\n\n ngZone.runOutsideAngular(() => {\n document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions);\n });\n }\n }\n\n /** Removes an event handler. */\n removeHandler(name: string, element: HTMLElement, handler: EventListenerObject) {\n const handlersForEvent = this._events.get(name);\n\n if (!handlersForEvent) {\n return;\n }\n\n const handlersForElement = handlersForEvent.get(element);\n\n if (!handlersForElement) {\n return;\n }\n\n handlersForElement.delete(handler);\n\n if (handlersForElement.size === 0) {\n handlersForEvent.delete(element);\n }\n\n if (handlersForEvent.size === 0) {\n this._events.delete(name);\n document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions);\n }\n }\n\n /** Event handler that is bound and which dispatches the events to the different targets. */\n private _delegateEventHandler = (event: Event) => {\n const target = _getEventTarget(event);\n\n if (target) {\n this._events.get(event.type)?.forEach((handlers, element) => {\n if (element === target || element.contains(target as Node)) {\n handlers.forEach(handler => handler.handleEvent(event));\n }\n });\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ElementRef, NgZone} from '@angular/core';\nimport {Platform, normalizePassiveListenerOptions, _getEventTarget} from '@angular/cdk/platform';\nimport {isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader} from '@angular/cdk/a11y';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {RippleRef, RippleState, RippleConfig} from './ripple-ref';\nimport {RippleEventManager} from './ripple-event-manager';\n\n/**\n * Interface that describes the target for launching ripples.\n * It defines the ripple configuration and disabled state for interaction ripples.\n * @docs-private\n */\nexport interface RippleTarget {\n /** Configuration for ripples that are launched on pointer down. */\n rippleConfig: RippleConfig;\n /** Whether ripples on pointer down should be disabled. */\n rippleDisabled: boolean;\n}\n\n/** Interfaces the defines ripple element transition event listeners. */\ninterface RippleEventListeners {\n onTransitionEnd: EventListener;\n onTransitionCancel: EventListener;\n}\n\n/**\n * Default ripple animation configuration for ripples without an explicit\n * animation config specified.\n */\nexport const defaultRippleAnimationConfig = {\n enterDuration: 225,\n exitDuration: 150,\n};\n\n/**\n * Timeout for ignoring mouse events. Mouse events will be temporary ignored after touch\n * events to avoid synthetic mouse events.\n */\nconst ignoreMouseEventsTimeout = 800;\n\n/** Options used to bind a passive capturing event. */\nconst passiveCapturingEventOptions = normalizePassiveListenerOptions({\n passive: true,\n capture: true,\n});\n\n/** Events that signal that the pointer is down. */\nconst pointerDownEvents = ['mousedown', 'touchstart'];\n\n/** Events that signal that the pointer is up. */\nconst pointerUpEvents = ['mouseup', 'mouseleave', 'touchend', 'touchcancel'];\n\n/**\n * Helper service that performs DOM manipulations. Not intended to be used outside this module.\n * The constructor takes a reference to the ripple directive's host element and a map of DOM\n * event handlers to be installed on the element that triggers ripple animations.\n * This will eventually become a custom renderer once Angular support exists.\n * @docs-private\n */\nexport class RippleRenderer implements EventListenerObject {\n /** Element where the ripples are being added to. */\n private _containerElement: HTMLElement;\n\n /** Element which triggers the ripple elements on mouse events. */\n private _triggerElement: HTMLElement | null;\n\n /** Whether the pointer is currently down or not. */\n private _isPointerDown = false;\n\n /**\n * Map of currently active ripple references.\n * The ripple reference is mapped to its element event listeners.\n * The reason why `| null` is used is that event listeners are added only\n * when the condition is truthy (see the `_startFadeOutTransition` method).\n */\n private _activeRipples = new Map<RippleRef, RippleEventListeners | null>();\n\n /** Latest non-persistent ripple that was triggered. */\n private _mostRecentTransientRipple: RippleRef | null;\n\n /** Time in milliseconds when the last touchstart event happened. */\n private _lastTouchStartEvent: number;\n\n /** Whether pointer-up event listeners have been registered. */\n private _pointerUpEventsRegistered = false;\n\n /**\n * Cached dimensions of the ripple container. Set when the first\n * ripple is shown and cleared once no more ripples are visible.\n */\n private _containerRect: ClientRect | null;\n\n private static _eventManager = new RippleEventManager();\n\n constructor(\n private _target: RippleTarget,\n private _ngZone: NgZone,\n elementOrElementRef: HTMLElement | ElementRef<HTMLElement>,\n private _platform: Platform,\n ) {\n // Only do anything if we're on the browser.\n if (_platform.isBrowser) {\n this._containerElement = coerceElement(elementOrElementRef);\n }\n }\n\n /**\n * Fades in a ripple at the given coordinates.\n * @param x Coordinate within the element, along the X axis at which to start the ripple.\n * @param y Coordinate within the element, along the Y axis at which to start the ripple.\n * @param config Extra ripple options.\n */\n fadeInRipple(x: number, y: number, config: RippleConfig = {}): RippleRef {\n const containerRect = (this._containerRect =\n this._containerRect || this._containerElement.getBoundingClientRect());\n const animationConfig = {...defaultRippleAnimationConfig, ...config.animation};\n\n if (config.centered) {\n x = containerRect.left + containerRect.width / 2;\n y = containerRect.top + containerRect.height / 2;\n }\n\n const radius = config.radius || distanceToFurthestCorner(x, y, containerRect);\n const offsetX = x - containerRect.left;\n const offsetY = y - containerRect.top;\n const enterDuration = animationConfig.enterDuration;\n\n const ripple = document.createElement('div');\n ripple.classList.add('mat-ripple-element');\n\n ripple.style.left = `${offsetX - radius}px`;\n ripple.style.top = `${offsetY - radius}px`;\n ripple.style.height = `${radius * 2}px`;\n ripple.style.width = `${radius * 2}px`;\n\n // If a custom color has been specified, set it as inline style. If no color is\n // set, the default color will be applied through the ripple theme styles.\n if (config.color != null) {\n ripple.style.backgroundColor = config.color;\n }\n\n ripple.style.transitionDuration = `${enterDuration}ms`;\n\n this._containerElement.appendChild(ripple);\n\n // By default the browser does not recalculate the styles of dynamically created\n // ripple elements. This is critical to ensure that the `scale` animates properly.\n // We enforce a style recalculation by calling `getComputedStyle` and *accessing* a property.\n // See: https://gist.github.com/paulirish/5d52fb081b3570c81e3a\n const computedStyles = window.getComputedStyle(ripple);\n const userTransitionProperty = computedStyles.transitionProperty;\n const userTransitionDuration = computedStyles.transitionDuration;\n\n // Note: We detect whether animation is forcibly disabled through CSS (e.g. through\n // `transition: none` or `display: none`). This is technically unexpected since animations are\n // controlled through the animation config, but this exists for backwards compatibility. This\n // logic does not need to be super accurate since it covers some edge cases which can be easily\n // avoided by users.\n const animationForciblyDisabledThroughCss =\n userTransitionProperty === 'none' ||\n // Note: The canonical unit for serialized CSS `<time>` properties is seconds. Additionally\n // some browsers expand the duration for every property (in our case `opacity` and `transform`).\n userTransitionDuration === '0s' ||\n userTransitionDuration === '0s, 0s' ||\n // If the container is 0x0, it's likely `display: none`.\n (containerRect.width === 0 && containerRect.height === 0);\n\n // Exposed reference to the ripple that will be returned.\n const rippleRef = new RippleRef(this, ripple, config, animationForciblyDisabledThroughCss);\n\n // Start the enter animation by setting the transform/scale to 100%. The animation will\n // execute as part of this statement because we forced a style recalculation before.\n // Note: We use a 3d transform here in order to avoid an issue in Safari where\n // the ripples aren't clipped when inside the shadow DOM (see #24028).\n ripple.style.transform = 'scale3d(1, 1, 1)';\n\n rippleRef.state = RippleState.FADING_IN;\n\n if (!config.persistent) {\n this._mostRecentTransientRipple = rippleRef;\n }\n\n let eventListeners: RippleEventListeners | null = null;\n\n // Do not register the `transition` event listener if fade-in and fade-out duration\n // are set to zero. The events won't fire anyway and we can save resources here.\n if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) {\n this._ngZone.runOutsideAngular(() => {\n const onTransitionEnd = () => this._finishRippleTransition(rippleRef);\n const onTransitionCancel = () => this._destroyRipple(rippleRef);\n ripple.addEventListener('transitionend', onTransitionEnd);\n // If the transition is cancelled (e.g. due to DOM removal), we destroy the ripple\n // directly as otherwise we would keep it part of the ripple container forever.\n // https://www.w3.org/TR/css-transitions-1/#:~:text=no%20longer%20in%20the%20document.\n ripple.addEventListener('transitioncancel', onTransitionCancel);\n eventListeners = {onTransitionEnd, onTransitionCancel};\n });\n }\n\n // Add the ripple reference to the list of all active ripples.\n this._activeRipples.set(rippleRef, eventListeners);\n\n // In case there is no fade-in transition duration, we need to manually call the transition\n // end listener because `transitionend` doesn't fire if there is no transition.\n if (animationForciblyDisabledThroughCss || !enterDuration) {\n this._finishRippleTransition(rippleRef);\n }\n\n return rippleRef;\n }\n\n /** Fades out a ripple reference. */\n fadeOutRipple(rippleRef: RippleRef) {\n // For ripples already fading out or hidden, this should be a noop.\n if (rippleRef.state === RippleState.FADING_OUT || rippleRef.state === RippleState.HIDDEN) {\n return;\n }\n\n const rippleEl = rippleRef.element;\n const animationConfig = {...defaultRippleAnimationConfig, ...rippleRef.config.animation};\n\n // This starts the fade-out transition and will fire the transition end listener that\n // removes the ripple element from the DOM.\n rippleEl.style.transitionDuration = `${animationConfig.exitDuration}ms`;\n rippleEl.style.opacity = '0';\n rippleRef.state = RippleState.FADING_OUT;\n\n // In case there is no fade-out transition duration, we need to manually call the\n // transition end listener because `transitionend` doesn't fire if there is no transition.\n if (rippleRef._animationForciblyDisabledThroughCss || !animationConfig.exitDuration) {\n this._finishRippleTransition(rippleRef);\n }\n }\n\n /** Fades out all currently active ripples. */\n fadeOutAll() {\n this._getActiveRipples().forEach(ripple => ripple.fadeOut());\n }\n\n /** Fades out all currently active non-persistent ripples. */\n fadeOutAllNonPersistent() {\n this._getActiveRipples().forEach(ripple => {\n if (!ripple.config.persistent) {\n ripple.fadeOut();\n }\n });\n }\n\n /** Sets up the trigger event listeners */\n setupTriggerEvents(elementOrElementRef: HTMLElement | ElementRef<HTMLElement>) {\n const element = coerceElement(elementOrElementRef);\n\n if (!this._platform.isBrowser || !element || element === this._triggerElement) {\n return;\n }\n\n // Remove all previously registered event listeners from the trigger element.\n this._removeTriggerEvents();\n this._triggerElement = element;\n\n // Use event delegation for the trigger events since they're\n // set up during creation and are performance-sensitive.\n pointerDownEvents.forEach(type => {\n RippleRenderer._eventManager.addHandler(this._ngZone, type, element, this);\n });\n }\n\n /**\n * Handles all registered events.\n * @docs-private\n */\n handleEvent(event: Event) {\n if (event.type === 'mousedown') {\n this._onMousedown(event as MouseEvent);\n } else if (event.type === 'touchstart') {\n this._onTouchStart(event as TouchEvent);\n } else {\n this._onPointerUp();\n }\n\n // If pointer-up events haven't been registered yet, do so now.\n // We do this on-demand in order to reduce the total number of event listeners\n // registered by the ripples, which speeds up the rendering time for large UIs.\n if (!this._pointerUpEventsRegistered) {\n // The events for hiding the ripple are bound directly on the trigger, because:\n // 1. Some of them occur frequently (e.g. `mouseleave`) and any advantage we get from\n // delegation will be diminished by having to look through all the data structures often.\n // 2. They aren't as performance-sensitive, because they're bound only after the user\n // has interacted with an element.\n this._ngZone.runOutsideAngular(() => {\n pointerUpEvents.forEach(type => {\n this._triggerElement!.addEventListener(type, this, passiveCapturingEventOptions);\n });\n });\n\n this._pointerUpEventsRegistered = true;\n }\n }\n\n /** Method that will be called if the fade-in or fade-in transition completed. */\n private _finishRippleTransition(rippleRef: RippleRef) {\n if (rippleRef.state === RippleState.FADING_IN) {\n this._startFadeOutTransition(rippleRef);\n } else if (rippleRef.state === RippleState.FADING_OUT) {\n this._destroyRipple(rippleRef);\n }\n }\n\n /**\n * Starts the fade-out transition of the given ripple if it's not persistent and the pointer\n * is not held down anymore.\n */\n private _startFadeOutTransition(rippleRef: RippleRef) {\n const isMostRecentTransientRipple = rippleRef === this._mostRecentTransientRipple;\n const {persistent} = rippleRef.config;\n\n rippleRef.state = RippleState.VISIBLE;\n\n // When the timer runs out while the user has kept their pointer down, we want to\n // keep only the persistent ripples and the latest transient ripple. We do this,\n // because we don't want stacked transient ripples to appear after their enter\n // animation has finished.\n if (!persistent && (!isMostRecentTransientRipple || !this._isPointerDown)) {\n rippleRef.fadeOut();\n }\n }\n\n /** Destroys the given ripple by removing it from the DOM and updating its state. */\n private _destroyRipple(rippleRef: RippleRef) {\n const eventListeners = this._activeRipples.get(rippleRef) ?? null;\n this._activeRipples.delete(rippleRef);\n\n // Clear out the cached bounding rect if we have no more ripples.\n if (!this._activeRipples.size) {\n this._containerRect = null;\n }\n\n // If the current ref is the most recent transient ripple, unset it\n // avoid memory leaks.\n if (rippleRef === this._mostRecentTransientRipple) {\n this._mostRecentTransientRipple = null;\n }\n\n rippleRef.state = RippleState.HIDDEN;\n if (eventListeners !== null) {\n rippleRef.element.removeEventListener('transitionend', eventListeners.onTransitionEnd);\n rippleRef.element.removeEventListener('transitioncancel', eventListeners.onTransitionCancel);\n }\n rippleRef.element.remove();\n }\n\n /** Function being called whenever the trigger is being pressed using mouse. */\n private _onMousedown(event: MouseEvent) {\n // Screen readers will fire fake mouse events for space/enter. Skip launching a\n // ripple in this case for consistency with the non-screen-reader experience.\n const isFakeMousedown = isFakeMousedownFromScreenReader(event);\n const isSyntheticEvent =\n this._lastTouchStartEvent &&\n Date.now() < this._lastTouchStartEvent + ignoreMouseEventsTimeout;\n\n if (!this._target.rippleDisabled && !isFakeMousedown && !isSyntheticEvent) {\n this._isPointerDown = true;\n this.fadeInRipple(event.clientX, event.clientY, this._target.rippleConfig);\n }\n }\n\n /** Function being called whenever the trigger is being pressed using touch. */\n private _onTouchStart(event: TouchEvent) {\n if (!this._target.rippleDisabled && !isFakeTouchstartFromScreenReader(event)) {\n // Some browsers fire mouse events after a `touchstart` event. Those synthetic mouse\n // events will launch a second ripple if we don't ignore mouse events for a specific\n // time after a touchstart event.\n this._lastTouchStartEvent = Date.now();\n this._isPointerDown = true;\n\n // Use `changedTouches` so we skip any touches where the user put\n // their finger down, but used another finger to tap the element again.\n const touches = event.changedTouches;\n\n for (let i = 0; i < touches.length; i++) {\n this.fadeInRipple(touches[i].clientX, touches[i].clientY, this._target.rippleConfig);\n }\n }\n }\n\n /** Function being called whenever the trigger is being released. */\n private _onPointerUp() {\n if (!this._isPointerDown) {\n return;\n }\n\n this._isPointerDown = false;\n\n // Fade-out all ripples that are visible and not persistent.\n this._getActiveRipples().forEach(ripple => {\n // By default, only ripples that are completely visible will fade out on pointer release.\n // If the `terminateOnPointerUp` option is set, ripples that still fade in will also fade out.\n const isVisible =\n ripple.state === RippleState.VISIBLE ||\n (ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN);\n\n if (!ripple.config.persistent && isVisible) {\n ripple.fadeOut();\n }\n });\n }\n\n private _getActiveRipples(): RippleRef[] {\n return Array.from(this._activeRipples.keys());\n }\n\n /** Removes previously registered event listeners from the trigger element. */\n _removeTriggerEvents() {\n const trigger = this._triggerElement;\n\n if (trigger) {\n pointerDownEvents.forEach(type =>\n RippleRenderer._eventManager.removeHandler(type, trigger, this),\n );\n\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach(type =>\n trigger.removeEventListener(type, this, passiveCapturingEventOptions),\n );\n }\n }\n }\n}\n\n/**\n * Returns the distance from the point (x, y) to the furthest corner of a rectangle.\n */\nfunction distanceToFurthestCorner(x: number, y: number, rect: ClientRect) {\n const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));\n const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));\n return Math.sqrt(distX * distX + distY * distY);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Optional,\n} from '@angular/core';\nimport {RippleAnimationConfig, RippleConfig, RippleRef} from './ripple-ref';\nimport {RippleRenderer, RippleTarget} from './ripple-renderer';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n/** Configurable options for `matRipple`. */\nexport interface RippleGlobalOptions {\n /**\n * Whether ripples should be disabled. Ripples can be still launched manually by using\n * the `launch()` method. Therefore focus indicators will still show up.\n */\n disabled?: boolean;\n\n /**\n * Default configuration for the animation duration of the ripples. There are two phases with\n * different durations for the ripples: `enter` and `leave`. The durations will be overwritten\n * by the value of `matRippleAnimation` or if the `NoopAnimationsModule` is included.\n */\n animation?: RippleAnimationConfig;\n\n /**\n * Whether ripples should start fading out immediately after the mouse or touch is released. By\n * default, ripples will wait for the enter animation to complete and for mouse or touch release.\n */\n terminateOnPointerUp?: boolean;\n}\n\n/** Injection token that can be used to specify the global ripple options. */\nexport const MAT_RIPPLE_GLOBAL_OPTIONS = new InjectionToken<RippleGlobalOptions>(\n 'mat-ripple-global-options',\n);\n\n@Directive({\n selector: '[mat-ripple], [matRipple]',\n exportAs: 'matRipple',\n host: {\n 'class': 'mat-ripple',\n '[class.mat-ripple-unbounded]': 'unbounded',\n },\n})\nexport class MatRipple implements OnInit, OnDestroy, RippleTarget {\n /** Custom color for all ripples. */\n @Input('matRippleColor') color: string;\n\n /** Whether the ripples should be visible outside the component's bounds. */\n @Input('matRippleUnbounded') unbounded: boolean;\n\n /**\n * Whether the ripple always originates from the center of the host element's bounds, rather\n * than originating from the location of the click event.\n */\n @Input('matRippleCentered') centered: boolean;\n\n /**\n * If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius\n * will be the distance from the center of the ripple to the furthest corner of the host element's\n * bounding rectangle.\n */\n @Input('matRippleRadius') radius: number = 0;\n\n /**\n * Configuration for the ripple animation. Allows modifying the enter and exit animation\n * duration of the ripples. The animation durations will be overwritten if the\n * `NoopAnimationsModule` is being used.\n */\n @Input('matRippleAnimation') animation: RippleAnimationConfig;\n\n /**\n * Whether click events will not trigger the ripple. Ripples can be still launched manually\n * by using the `launch()` method.\n */\n @Input('matRippleDisabled')\n get disabled() {\n return this._disabled;\n }\n set disabled(value: boolean) {\n if (value) {\n this.fadeOutAllNonPersistent();\n }\n this._disabled = value;\n this._setupTriggerEventsIfEnabled();\n }\n private _disabled: boolean = false;\n\n /**\n * The element that triggers the ripple when click events are received.\n * Defaults to the directive's host element.\n */\n @Input('matRippleTrigger')\n get trigger() {\n return this._trigger || this._elementRef.nativeElement;\n }\n set trigger(trigger: HTMLElement) {\n this._trigger = trigger;\n this._setupTriggerEventsIfEnabled();\n }\n private _trigger: HTMLElement;\n\n /** Renderer for the ripple DOM manipulations. */\n private _rippleRenderer: RippleRenderer;\n\n /** Options that are set globally for all ripples. */\n private _globalOptions: RippleGlobalOptions;\n\n /** Whether ripple directive is initialized and the input bindings are set. */\n private _isInitialized: boolean = false;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n ngZone: NgZone,\n platform: Platform,\n @Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) globalOptions?: RippleGlobalOptions,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) private _animationMode?: string,\n ) {\n this._globalOptions = globalOptions || {};\n this._rippleRenderer = new RippleRenderer(this, ngZone, _elementRef, platform);\n }\n\n ngOnInit() {\n this._isInitialized = true;\n this._setupTriggerEventsIfEnabled();\n }\n\n ngOnDestroy() {\n this._rippleRenderer._removeTriggerEvents();\n }\n\n /** Fades out all currently showing ripple elements. */\n fadeOutAll() {\n this._rippleRenderer.fadeOutAll();\n }\n\n /** Fades out all currently showing non-persistent ripple elements. */\n fadeOutAllNonPersistent() {\n this._rippleRenderer.fadeOutAllNonPersistent();\n }\n\n /**\n * Ripple configuration from the directive's input values.\n * @docs-private Implemented as part of RippleTarget\n */\n get rippleConfig(): RippleConfig {\n return {\n centered: this.centered,\n radius: this.radius,\n color: this.color,\n animation: {\n ...this._globalOptions.animation,\n ...(this._animationMode === 'NoopAnimations' ? {enterDuration: 0, exitDuration: 0} : {}),\n ...this.animation,\n },\n terminateOnPointerUp: this._globalOptions.terminateOnPointerUp,\n };\n }\n\n /**\n * Whether ripples on pointer-down are disabled or not.\n * @docs-private Implemented as part of RippleTarget\n */\n get rippleDisabled(): boolean {\n return this.disabled || !!this._globalOptions.disabled;\n }\n\n /** Sets up the trigger event listeners if ripples are enabled. */\n private _setupTriggerEventsIfEnabled() {\n if (!this.disabled && this._isInitialized) {\n this._rippleRenderer.setupTriggerEvents(this.trigger);\n }\n }\n\n /**\n * Launches a manual ripple using the specified ripple configuration.\n * @param config Configuration for the manual ripple.\n */\n launch(config: RippleConfig): RippleRef;\n\n /**\n * Launches a manual ripple at the specified coordinates relative to the viewport.\n * @param x Coordinate along the X axis at which to fade-in the ripple. Coordinate\n * should be relative to the viewport.\n * @param y Coordinate along the Y axis at which to fade-in the ripple. Coordinate\n * should be relative to the viewport.\n * @param config Optional ripple configuration for the manual ripple.\n */\n launch(x: number, y: number, config?: RippleConfig): RippleRef;\n\n /** Launches a manual ripple at the specified coordinated or just by the ripple config. */\n launch(configOrX: number | RippleConfig, y: number = 0, config?: RippleConfig): RippleRef {\n if (typeof configOrX === 'number') {\n return this._rippleRenderer.fadeInRipple(configOrX, y, {...this.rippleConfig, ...config});\n } else {\n return this._rippleRenderer.fadeInRipple(0, 0, {...this.rippleConfig, ...configOrX});\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '../common-behaviors/common-module';\nimport {MatRipple} from './ripple';\n\nexport * from './ripple';\nexport * from './ripple-ref';\nexport * from './ripple-renderer';\n\n@NgModule({\n imports: [MatCommonModule],\n exports: [MatRipple, MatCommonModule],\n declarations: [MatRipple],\n})\nexport class MatRippleModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatPseudoCheckbox} from './pseudo-checkbox';\nimport {MatCommonModule} from '../../common-behaviors/common-module';\n\n@NgModule({\n imports: [MatCommonModule],\n exports: [MatPseudoCheckbox],\n declarations: [MatPseudoCheckbox],\n})\nexport class MatPseudoCheckboxModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatRippleModule, MatPseudoCheckboxModule, MatCommonModule} from '@angular/material/core';\nimport {MatLegacyOption} from './option';\nimport {MatLegacyOptgroup} from './optgroup';\n\n/**\n * @deprecated Use `MatOptionModule` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatRippleModule, CommonModule, MatCommonModule, MatPseudoCheckboxModule],\n exports: [MatLegacyOption, MatLegacyOptgroup],\n declarations: [MatLegacyOption, MatLegacyOptgroup],\n})\nexport class MatLegacyOptionModule {}\n\nexport * from './option';\nexport * from './optgroup';\n\nexport {\n /**\n * @deprecated Use `MAT_OPTGROUP` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n MAT_OPTGROUP as MAT_LEGACY_OPTGROUP,\n\n /**\n * @deprecated Use `MatOptionSelectionChange` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n MatOptionSelectionChange as MatLegacyOptionSelectionChange,\n\n /**\n * @deprecated Use `MatOptionParentComponent` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n MatOptionParentComponent as MatLegacyOptionParentComponent,\n\n /**\n * @deprecated Use `MAT_OPTION_PARENT_COMPONENT` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n MAT_OPTION_PARENT_COMPONENT as MAT_LEGACY_OPTION_PARENT_COMPONENT,\n\n /**\n * @deprecated Use `_countGroupLabelsBeforeOption` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n _countGroupLabelsBeforeOption as _countGroupLabelsBeforeLegacyOption,\n\n /**\n * @deprecated Use `_getOptionScrollPosition` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n _getOptionScrollPosition as _getLegacyOptionScrollPosition,\n\n /**\n * @deprecated Use `_MatOptionBase` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n _MatOptionBase as _MatLegacyOptionBase,\n\n /**\n * @deprecated Use `_MatOptgroupBase` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n _MatOptgroupBase as _MatLegacyOptgroupBase,\n} from '@angular/material/core';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n TemplateRef,\n ViewContainerRef,\n ElementRef,\n ComponentRef,\n EmbeddedViewRef,\n Injector,\n ComponentFactoryResolver,\n} from '@angular/core';\nimport {\n throwNullPortalOutletError,\n throwPortalAlreadyAttachedError,\n throwNoPortalAttachedError,\n throwNullPortalError,\n throwPortalOutletAlreadyDisposedError,\n throwUnknownPortalTypeError,\n} from './portal-errors';\n\n/** Interface that can be used to generically type a class. */\nexport interface ComponentType<T> {\n new (...args: any[]): T;\n}\n\n/**\n * A `Portal` is something that you want to render somewhere else.\n * It can be attach to / detached from a `PortalOutlet`.\n */\nexport abstract class Portal<T> {\n private _attachedHost: PortalOutlet | null;\n\n /** Attach this portal to a host. */\n attach(host: PortalOutlet): T {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (host == null) {\n throwNullPortalOutletError();\n }\n\n if (host.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n }\n\n this._attachedHost = host;\n return <T>host.attach(this);\n }\n\n /** Detach this portal from its host */\n detach(): void {\n let host = this._attachedHost;\n\n if (host != null) {\n this._attachedHost = null;\n host.detach();\n } else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throwNoPortalAttachedError();\n }\n }\n\n /** Whether this portal is attached to a host. */\n get isAttached(): boolean {\n return this._attachedHost != null;\n }\n\n /**\n * Sets the PortalOutlet reference without performing `attach()`. This is used directly by\n * the PortalOutlet when it is performing an `attach()` or `detach()`.\n */\n setAttachedHost(host: PortalOutlet | null) {\n this._attachedHost = host;\n }\n}\n\n/**\n * A `ComponentPortal` is a portal that instantiates some Component upon attachment.\n */\nexport class ComponentPortal<T> extends Portal<ComponentRef<T>> {\n /** The type of the component that will be instantiated for attachment. */\n component: ComponentType<T>;\n\n /**\n * Where the attached component should live in Angular's *logical* component tree.\n * This is different from where the component *renders*, which is determined by the PortalOutlet.\n * The origin is necessary when the host is outside of the Angular application context.\n */\n viewContainerRef?: ViewContainerRef | null;\n\n /** Injector used for the instantiation of the component. */\n injector?: Injector | null;\n\n /**\n * Alternate `ComponentFactoryResolver` to use when resolving the associated component.\n * Defaults to using the resolver from the outlet that the portal is attached to.\n */\n componentFactoryResolver?: ComponentFactoryResolver | null;\n\n /**\n * List of DOM nodes that should be projected through `<ng-content>` of the attached component.\n */\n projectableNodes?: Node[][] | null;\n\n constructor(\n component: ComponentType<T>,\n viewContainerRef?: ViewContainerRef | null,\n injector?: Injector | null,\n componentFactoryResolver?: ComponentFactoryResolver | null,\n projectableNodes?: Node[][] | null,\n ) {\n super();\n this.component = component;\n this.viewContainerRef = viewContainerRef;\n this.injector = injector;\n this.componentFactoryResolver = componentFactoryResolver;\n this.projectableNodes = projectableNodes;\n }\n}\n\n/**\n * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).\n */\nexport class TemplatePortal<C = any> extends Portal<EmbeddedViewRef<C>> {\n constructor(\n /** The embedded template that will be used to instantiate an embedded View in the host. */\n public templateRef: TemplateRef<C>,\n /** Reference to the ViewContainer into which the template will be stamped out. */\n public viewContainerRef: ViewContainerRef,\n /** Contextual data to be passed in to the embedded view. */\n public context?: C,\n /** The injector to use for the embedded view. */\n public injector?: Injector,\n ) {\n super();\n }\n\n get origin(): ElementRef {\n return this.templateRef.elementRef;\n }\n\n /**\n * Attach the portal to the provided `PortalOutlet`.\n * When a context is provided it will override the `context` property of the `TemplatePortal`\n * instance.\n */\n override attach(host: PortalOutlet, context: C | undefined = this.context): EmbeddedViewRef<C> {\n this.context = context;\n return super.attach(host);\n }\n\n override detach(): void {\n this.context = undefined;\n return super.detach();\n }\n}\n\n/**\n * A `DomPortal` is a portal whose DOM element will be taken from its current position\n * in the DOM and moved into a portal outlet, when it is attached. On detach, the content\n * will be restored to its original position.\n */\nexport class DomPortal<T = HTMLElement> extends Portal<T> {\n /** DOM node hosting the portal's content. */\n readonly element: T;\n\n constructor(element: T | ElementRef<T>) {\n super();\n this.element = element instanceof ElementRef ? element.nativeElement : element;\n }\n}\n\n/** A `PortalOutlet` is an space that can contain a single `Portal`. */\nexport interface PortalOutlet {\n /** Attaches a portal to this outlet. */\n attach(portal: Portal<any>): any;\n\n /** Detaches the currently attached portal from this outlet. */\n detach(): any;\n\n /** Performs cleanup before the outlet is destroyed. */\n dispose(): void;\n\n /** Whether there is currently a portal attached to this outlet. */\n hasAttached(): boolean;\n}\n\n/**\n * @deprecated Use `PortalOutlet` instead.\n * @breaking-change 9.0.0\n */\nexport type PortalHost = PortalOutlet;\n\n/**\n * Partial implementation of PortalOutlet that handles attaching\n * ComponentPortal and TemplatePortal.\n */\nexport abstract class BasePortalOutlet implements PortalOutlet {\n /** The portal currently attached to the host. */\n protected _attachedPortal: Portal<any> | null;\n\n /** A function that will permanently dispose this host. */\n private _disposeFn: (() => void) | null;\n\n /** Whether this host has already been permanently disposed. */\n private _isDisposed: boolean = false;\n\n /** Whether this host has an attached portal. */\n hasAttached(): boolean {\n return !!this._attachedPortal;\n }\n\n attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;\n attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;\n attach(portal: any): any;\n\n /** Attaches a portal. */\n attach(portal: Portal<any>): any {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!portal) {\n throwNullPortalError();\n }\n\n if (this.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n\n if (this._isDisposed) {\n throwPortalOutletAlreadyDisposedError();\n }\n }\n\n if (portal instanceof ComponentPortal) {\n this._attachedPortal = portal;\n return this.attachComponentPortal(portal);\n } else if (portal instanceof TemplatePortal) {\n this._attachedPortal = portal;\n return this.attachTemplatePortal(portal);\n // @breaking-change 10.0.0 remove null check for `this.attachDomPortal`.\n } else if (this.attachDomPortal && portal instanceof DomPortal) {\n this._attachedPortal = portal;\n return this.attachDomPortal(portal);\n }\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throwUnknownPortalTypeError();\n }\n }\n\n abstract attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;\n\n abstract attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;\n\n // @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.\n readonly attachDomPortal: null | ((portal: DomPortal) => any) = null;\n\n /** Detaches a previously attached portal. */\n detach(): void {\n if (this._attachedPortal) {\n this._attachedPortal.setAttachedHost(null);\n this._attachedPortal = null;\n }\n\n this._invokeDisposeFn();\n }\n\n /** Permanently dispose of this portal host. */\n dispose(): void {\n if (this.hasAttached()) {\n this.detach();\n }\n\n this._invokeDisposeFn();\n this._isDisposed = true;\n }\n\n /** @docs-private */\n setDisposeFn(fn: () => void) {\n this._disposeFn = fn;\n }\n\n private _invokeDisposeFn() {\n if (this._disposeFn) {\n this._disposeFn();\n this._disposeFn = null;\n }\n }\n}\n\n/**\n * @deprecated Use `BasePortalOutlet` instead.\n * @breaking-change 9.0.0\n */\nexport abstract class BasePortalHost extends BasePortalOutlet {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n EmbeddedViewRef,\n Injector,\n} from '@angular/core';\nimport {BasePortalOutlet, ComponentPortal, DomPortal, TemplatePortal} from './portal';\n\n/**\n * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular\n * application context.\n */\nexport class DomPortalOutlet extends BasePortalOutlet {\n private _document: Document;\n\n /**\n * @param outletElement Element into which the content is projected.\n * @param _componentFactoryResolver Used to resolve the component factory.\n * Only required when attaching component portals.\n * @param _appRef Reference to the application. Only used in component portals when there\n * is no `ViewContainerRef` available.\n * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't\n * have one. Only used for component portals.\n * @param _document Reference to the document. Used when attaching a DOM portal. Will eventually\n * become a required parameter.\n */\n constructor(\n /** Element into which the content is projected. */\n public outletElement: Element,\n private _componentFactoryResolver?: ComponentFactoryResolver,\n private _appRef?: ApplicationRef,\n private _defaultInjector?: Injector,\n\n /**\n * @deprecated `_document` Parameter to be made required.\n * @breaking-change 10.0.0\n */\n _document?: any,\n ) {\n super();\n this._document = _document;\n }\n\n /**\n * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.\n * @param portal Portal to be attached\n * @returns Reference to the created component.\n */\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n const resolver = (portal.componentFactoryResolver || this._componentFactoryResolver)!;\n\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !resolver) {\n throw Error('Cannot attach component portal to outlet without a ComponentFactoryResolver.');\n }\n\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n let componentRef: ComponentRef<T>;\n\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(\n componentFactory,\n portal.viewContainerRef.length,\n portal.injector || portal.viewContainerRef.injector,\n portal.projectableNodes || undefined,\n );\n\n this.setDisposeFn(() => componentRef.destroy());\n } else {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._appRef) {\n throw Error('Cannot attach component portal to outlet without an ApplicationRef.');\n }\n\n componentRef = componentFactory.create(\n portal.injector || this._defaultInjector || Injector.NULL,\n );\n this._appRef!.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n // Verify that the ApplicationRef has registered views before trying to detach a host view.\n // This check also protects the `detachView` from being called on a destroyed ApplicationRef.\n if (this._appRef!.viewCount > 0) {\n this._appRef!.detachView(componentRef.hostView);\n }\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n this._attachedPortal = portal;\n\n return componentRef;\n }\n\n /**\n * Attaches a template portal to the DOM as an embedded view.\n * @param portal Portal to be attached.\n * @returns Reference to the created embedded view.\n */\n attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {\n injector: portal.injector,\n });\n\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n\n this.setDisposeFn(() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n });\n\n this._attachedPortal = portal;\n\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }\n\n /**\n * Attaches a DOM portal by transferring its content into the outlet.\n * @param portal Portal to be attached.\n * @deprecated To be turned into a method.\n * @breaking-change 10.0.0\n */\n override attachDomPortal = (portal: DomPortal) => {\n // @breaking-change 10.0.0 Remove check and error once the\n // `_document` constructor parameter is required.\n if (!this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Cannot attach DOM portal without _document constructor parameter');\n }\n\n const element = portal.element;\n if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('DOM portal content must be attached to a parent node.');\n }\n\n // Anchor used to save the element's previous position so\n // that we can restore it when the portal is detached.\n const anchorNode = this._document.createComment('dom-portal');\n\n element.parentNode!.insertBefore(anchorNode, element);\n this.outletElement.appendChild(element);\n this._attachedPortal = portal;\n\n super.setDisposeFn(() => {\n // We can't use `replaceWith` here because IE doesn't support it.\n if (anchorNode.parentNode) {\n anchorNode.parentNode.replaceChild(element, anchorNode);\n }\n });\n };\n\n /**\n * Clears out a portal from the DOM.\n */\n override dispose(): void {\n super.dispose();\n this.outletElement.remove();\n }\n\n /** Gets the root HTMLElement for an instantiated component. */\n private _getComponentRootNode(componentRef: ComponentRef<any>): HTMLElement {\n return (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;\n }\n}\n\n/**\n * @deprecated Use `DomPortalOutlet` instead.\n * @breaking-change 9.0.0\n */\nexport class DomPortalHost extends DomPortalOutlet {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ComponentFactoryResolver,\n ComponentRef,\n Directive,\n EmbeddedViewRef,\n EventEmitter,\n NgModule,\n OnDestroy,\n OnInit,\n Output,\n TemplateRef,\n ViewContainerRef,\n Inject,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {BasePortalOutlet, ComponentPortal, Portal, TemplatePortal, DomPortal} from './portal';\n\n/**\n * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,\n * the directive instance itself can be attached to a host, enabling declarative use of portals.\n */\n@Directive({\n selector: '[cdkPortal]',\n exportAs: 'cdkPortal',\n})\nexport class CdkPortal extends TemplatePortal {\n constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef) {\n super(templateRef, viewContainerRef);\n }\n}\n\n/**\n * @deprecated Use `CdkPortal` instead.\n * @breaking-change 9.0.0\n */\n@Directive({\n selector: '[cdk-portal], [portal]',\n exportAs: 'cdkPortal',\n providers: [\n {\n provide: CdkPortal,\n useExisting: TemplatePortalDirective,\n },\n ],\n})\nexport class TemplatePortalDirective extends CdkPortal {}\n\n/**\n * Possible attached references to the CdkPortalOutlet.\n */\nexport type CdkPortalOutletAttachedRef = ComponentRef<any> | EmbeddedViewRef<any> | null;\n\n/**\n * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be\n * directly attached to it, enabling declarative use.\n *\n * Usage:\n * `<ng-template [cdkPortalOutlet]=\"greeting\"></ng-template>`\n */\n@Directive({\n selector: '[cdkPortalOutlet]',\n exportAs: 'cdkPortalOutlet',\n inputs: ['portal: cdkPortalOutlet'],\n})\nexport class CdkPortalOutlet extends BasePortalOutlet implements OnInit, OnDestroy {\n private _document: Document;\n\n /** Whether the portal component is initialized. */\n private _isInitialized = false;\n\n /** Reference to the currently-attached component/view ref. */\n private _attachedRef: CdkPortalOutletAttachedRef;\n\n constructor(\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _viewContainerRef: ViewContainerRef,\n\n /**\n * @deprecated `_document` parameter to be made required.\n * @breaking-change 9.0.0\n */\n @Inject(DOCUMENT) _document?: any,\n ) {\n super();\n this._document = _document;\n }\n\n /** Portal associated with the Portal outlet. */\n get portal(): Portal<any> | null {\n return this._attachedPortal;\n }\n\n set portal(portal: Portal<any> | null | undefined | '') {\n // Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have\n // run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`\n // and attach a portal programmatically in the parent component. When Angular does the first CD\n // round, it will fire the setter with empty string, causing the user's content to be cleared.\n if (this.hasAttached() && !portal && !this._isInitialized) {\n return;\n }\n\n if (this.hasAttached()) {\n super.detach();\n }\n\n if (portal) {\n super.attach(portal);\n }\n\n this._attachedPortal = portal || null;\n }\n\n /** Emits when a portal is attached to the outlet. */\n @Output() readonly attached: EventEmitter<CdkPortalOutletAttachedRef> =\n new EventEmitter<CdkPortalOutletAttachedRef>();\n\n /** Component or view reference that is attached to the portal. */\n get attachedRef(): CdkPortalOutletAttachedRef {\n return this._attachedRef;\n }\n\n ngOnInit() {\n this._isInitialized = true;\n }\n\n ngOnDestroy() {\n super.dispose();\n this._attachedRef = this._attachedPortal = null;\n }\n\n /**\n * Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.\n *\n * @param portal Portal to be attached to the portal outlet.\n * @returns Reference to the created component.\n */\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n portal.setAttachedHost(this);\n\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef =\n portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;\n\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(\n componentFactory,\n viewContainerRef.length,\n portal.injector || viewContainerRef.injector,\n portal.projectableNodes || undefined,\n );\n\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild((ref.hostView as EmbeddedViewRef<any>).rootNodes[0]);\n }\n\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n\n return ref;\n }\n\n /**\n * Attach the given TemplatePortal to this PortalHost as an embedded View.\n * @param portal Portal to be attached.\n * @returns Reference to the created embedded view.\n */\n attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {\n injector: portal.injector,\n });\n super.setDisposeFn(() => this._viewContainerRef.clear());\n\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n\n return viewRef;\n }\n\n /**\n * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.\n * @param portal Portal to be attached.\n * @deprecated To be turned into a method.\n * @breaking-change 10.0.0\n */\n override attachDomPortal = (portal: DomPortal) => {\n // @breaking-change 9.0.0 Remove check and error once the\n // `_document` constructor parameter is required.\n if (!this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Cannot attach DOM portal without _document constructor parameter');\n }\n\n const element = portal.element;\n if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('DOM portal content must be attached to a parent node.');\n }\n\n // Anchor used to save the element's previous position so\n // that we can restore it when the portal is detached.\n const anchorNode = this._document.createComment('dom-portal');\n\n portal.setAttachedHost(this);\n element.parentNode!.insertBefore(anchorNode, element);\n this._getRootNode().appendChild(element);\n this._attachedPortal = portal;\n\n super.setDisposeFn(() => {\n if (anchorNode.parentNode) {\n anchorNode.parentNode!.replaceChild(element, anchorNode);\n }\n });\n };\n\n /** Gets the root node of the portal outlet. */\n private _getRootNode(): HTMLElement {\n const nativeElement: Node = this._viewContainerRef.element.nativeElement;\n\n // The directive could be set on a template which will result in a comment\n // node being the root. Use the comment's parent node if that is the case.\n return (\n nativeElement.nodeType === nativeElement.ELEMENT_NODE\n ? nativeElement\n : nativeElement.parentNode!\n ) as HTMLElement;\n }\n}\n\n/**\n * @deprecated Use `CdkPortalOutlet` instead.\n * @breaking-change 9.0.0\n */\n@Directive({\n selector: '[cdkPortalHost], [portalHost]',\n exportAs: 'cdkPortalHost',\n inputs: ['portal: cdkPortalHost'],\n providers: [\n {\n provide: CdkPortalOutlet,\n useExisting: PortalHostDirective,\n },\n ],\n})\nexport class PortalHostDirective extends CdkPortalOutlet {}\n\n@NgModule({\n exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],\n declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],\n})\nexport class PortalModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ScrollStrategy} from './scroll-strategy';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {coerceCssPixelValue} from '@angular/cdk/coercion';\nimport {supportsScrollBehavior} from '@angular/cdk/platform';\n\nconst scrollBehaviorSupported = supportsScrollBehavior();\n\n/**\n * Strategy that will prevent the user from scrolling while the overlay is visible.\n */\nexport class BlockScrollStrategy implements ScrollStrategy {\n private _previousHTMLStyles = {top: '', left: ''};\n private _previousScrollPosition: {top: number; left: number};\n private _isEnabled = false;\n private _document: Document;\n\n constructor(private _viewportRuler: ViewportRuler, document: any) {\n this._document = document;\n }\n\n /** Attaches this scroll strategy to an overlay. */\n attach() {}\n\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this._canBeEnabled()) {\n const root = this._document.documentElement!;\n\n this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();\n\n // Cache the previous inline styles in case the user had set them.\n this._previousHTMLStyles.left = root.style.left || '';\n this._previousHTMLStyles.top = root.style.top || '';\n\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);\n root.classList.add('cdk-global-scrollblock');\n this._isEnabled = true;\n }\n }\n\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable() {\n if (this._isEnabled) {\n const html = this._document.documentElement!;\n const body = this._document.body!;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n\n this._isEnabled = false;\n\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\n\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,\n // because it can throw off feature detections in `supportsScrollBehavior` which\n // checks for `'scrollBehavior' in documentElement.style`.\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n }\n\n window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);\n\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n\n private _canBeEnabled(): boolean {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this._document.documentElement!;\n\n if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {\n return false;\n }\n\n const body = this._document.body;\n const viewport = this._viewportRuler.getViewportSize();\n return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {NgZone} from '@angular/core';\nimport {ScrollStrategy, getMatScrollStrategyAlreadyAttachedError} from './scroll-strategy';\nimport {OverlayReference} from '../overlay-reference';\nimport {Subscription} from 'rxjs';\nimport {ScrollDispatcher, ViewportRuler} from '@angular/cdk/scrolling';\n\n/**\n * Config options for the CloseScrollStrategy.\n */\nexport interface CloseScrollStrategyConfig {\n /** Amount of pixels the user has to scroll before the overlay is closed. */\n threshold?: number;\n}\n\n/**\n * Strategy that will close the overlay as soon as the user starts scrolling.\n */\nexport class CloseScrollStrategy implements ScrollStrategy {\n private _scrollSubscription: Subscription | null = null;\n private _overlayRef: OverlayReference;\n private _initialScrollPosition: number;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _ngZone: NgZone,\n private _viewportRuler: ViewportRuler,\n private _config?: CloseScrollStrategyConfig,\n ) {}\n\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef: OverlayReference) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n\n this._overlayRef = overlayRef;\n }\n\n /** Enables the closing of the attached overlay on scroll. */\n enable() {\n if (this._scrollSubscription) {\n return;\n }\n\n const stream = this._scrollDispatcher.scrolled(0);\n\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config!.threshold!) {\n this._detach();\n } else {\n this._overlayRef.updatePosition();\n }\n });\n } else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }\n\n /** Disables the closing the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n\n detach() {\n this.disable();\n this._overlayRef = null!;\n }\n\n /** Detaches the overlay ref and disables the scroll strategy. */\n private _detach = () => {\n this.disable();\n\n if (this._overlayRef.hasAttached()) {\n this._ngZone.run(() => this._overlayRef.detach());\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ScrollStrategy} from './scroll-strategy';\n\n/** Scroll strategy that doesn't do anything. */\nexport class NoopScrollStrategy implements ScrollStrategy {\n /** Does nothing, as this scroll strategy is a no-op. */\n enable() {}\n /** Does nothing, as this scroll strategy is a no-op. */\n disable() {}\n /** Does nothing, as this scroll strategy is a no-op. */\n attach() {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// TODO(jelbourn): move this to live with the rest of the scrolling code\n// TODO(jelbourn): someday replace this with IntersectionObservers\n\n/** Equivalent of `ClientRect` without some of the properties we don't care about. */\ntype Dimensions = Omit<ClientRect, 'x' | 'y' | 'toJSON'>;\n\n/**\n * Gets whether an element is scrolled outside of view by any of its parent scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is scrolled out of view\n * @docs-private\n */\nexport function isElementScrolledOutsideView(element: Dimensions, scrollContainers: Dimensions[]) {\n return scrollContainers.some(containerBounds => {\n const outsideAbove = element.bottom < containerBounds.top;\n const outsideBelow = element.top > containerBounds.bottom;\n const outsideLeft = element.right < containerBounds.left;\n const outsideRight = element.left > containerBounds.right;\n\n return outsideAbove || outsideBelow || outsideLeft || outsideRight;\n });\n}\n\n/**\n * Gets whether an element is clipped by any of its scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is clipped\n * @docs-private\n */\nexport function isElementClippedByScrolling(element: Dimensions, scrollContainers: Dimensions[]) {\n return scrollContainers.some(scrollContainerRect => {\n const clippedAbove = element.top < scrollContainerRect.top;\n const clippedBelow = element.bottom > scrollContainerRect.bottom;\n const clippedLeft = element.left < scrollContainerRect.left;\n const clippedRight = element.right > scrollContainerRect.right;\n\n return clippedAbove || clippedBelow || clippedLeft || clippedRight;\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgZone} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {ScrollStrategy, getMatScrollStrategyAlreadyAttachedError} from './scroll-strategy';\nimport {OverlayReference} from '../overlay-reference';\nimport {ScrollDispatcher, ViewportRuler} from '@angular/cdk/scrolling';\nimport {isElementScrolledOutsideView} from '../position/scroll-clip';\n\n/**\n * Config options for the RepositionScrollStrategy.\n */\nexport interface RepositionScrollStrategyConfig {\n /** Time in milliseconds to throttle the scroll events. */\n scrollThrottle?: number;\n\n /** Whether to close the overlay once the user has scrolled away completely. */\n autoClose?: boolean;\n}\n\n/**\n * Strategy that will update the element position as the user is scrolling.\n */\nexport class RepositionScrollStrategy implements ScrollStrategy {\n private _scrollSubscription: Subscription | null = null;\n private _overlayRef: OverlayReference;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _viewportRuler: ViewportRuler,\n private _ngZone: NgZone,\n private _config?: RepositionScrollStrategyConfig,\n ) {}\n\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef: OverlayReference) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n\n this._overlayRef = overlayRef;\n }\n\n /** Enables repositioning of the attached overlay on scroll. */\n enable() {\n if (!this._scrollSubscription) {\n const throttle = this._config ? this._config.scrollThrottle : 0;\n\n this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {\n this._overlayRef.updatePosition();\n\n // TODO(crisbeto): make `close` on by default once all components can handle it.\n if (this._config && this._config.autoClose) {\n const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();\n const {width, height} = this._viewportRuler.getViewportSize();\n\n // TODO(crisbeto): include all ancestor scroll containers here once\n // we have a way of exposing the trigger element to the scroll strategy.\n const parentRects = [{width, height, bottom: height, right: width, top: 0, left: 0}];\n\n if (isElementScrolledOutsideView(overlayRect, parentRects)) {\n this.disable();\n this._ngZone.run(() => this._overlayRef.detach());\n }\n }\n });\n }\n }\n\n /** Disables repositioning of the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n\n detach() {\n this.disable();\n this._overlayRef = null!;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ScrollDispatcher, ViewportRuler} from '@angular/cdk/scrolling';\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, NgZone} from '@angular/core';\nimport {BlockScrollStrategy} from './block-scroll-strategy';\nimport {CloseScrollStrategy, CloseScrollStrategyConfig} from './close-scroll-strategy';\nimport {NoopScrollStrategy} from './noop-scroll-strategy';\nimport {\n RepositionScrollStrategy,\n RepositionScrollStrategyConfig,\n} from './reposition-scroll-strategy';\n\n/**\n * Options for how an overlay will handle scrolling.\n *\n * Users can provide a custom value for `ScrollStrategyOptions` to replace the default\n * behaviors. This class primarily acts as a factory for ScrollStrategy instances.\n */\n@Injectable({providedIn: 'root'})\nexport class ScrollStrategyOptions {\n private _document: Document;\n\n constructor(\n private _scrollDispatcher: ScrollDispatcher,\n private _viewportRuler: ViewportRuler,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) document: any,\n ) {\n this._document = document;\n }\n\n /** Do nothing on scroll. */\n noop = () => new NoopScrollStrategy();\n\n /**\n * Close the overlay as soon as the user scrolls.\n * @param config Configuration to be used inside the scroll strategy.\n */\n close = (config?: CloseScrollStrategyConfig) =>\n new CloseScrollStrategy(this._scrollDispatcher, this._ngZone, this._viewportRuler, config);\n\n /** Block scrolling. */\n block = () => new BlockScrollStrategy(this._viewportRuler, this._document);\n\n /**\n * Update the overlay's position on scroll.\n * @param config Configuration to be used inside the scroll strategy.\n * Allows debouncing the reposition calls.\n */\n reposition = (config?: RepositionScrollStrategyConfig) =>\n new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PositionStrategy} from './position/position-strategy';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {ScrollStrategy, NoopScrollStrategy} from './scroll/index';\n\n/** Initial configuration used when creating an overlay. */\nexport class OverlayConfig {\n /** Strategy with which to position the overlay. */\n positionStrategy?: PositionStrategy;\n\n /** Strategy to be used when handling scroll events while the overlay is open. */\n scrollStrategy?: ScrollStrategy = new NoopScrollStrategy();\n\n /** Custom class to add to the overlay pane. */\n panelClass?: string | string[] = '';\n\n /** Whether the overlay has a backdrop. */\n hasBackdrop?: boolean = false;\n\n /** Custom class to add to the backdrop */\n backdropClass?: string | string[] = 'cdk-overlay-dark-backdrop';\n\n /** The width of the overlay panel. If a number is provided, pixel units are assumed. */\n width?: number | string;\n\n /** The height of the overlay panel. If a number is provided, pixel units are assumed. */\n height?: number | string;\n\n /** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */\n minWidth?: number | string;\n\n /** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */\n minHeight?: number | string;\n\n /** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */\n maxWidth?: number | string;\n\n /** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */\n maxHeight?: number | string;\n\n /**\n * Direction of the text in the overlay panel. If a `Directionality` instance\n * is passed in, the overlay will handle changes to its value automatically.\n */\n direction?: Direction | Directionality;\n\n /**\n * Whether the overlay should be disposed of when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n disposeOnNavigation?: boolean = false;\n\n constructor(config?: OverlayConfig) {\n if (config) {\n // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,\n // loses the array generic type in the `for of`. But we *also* have to use `Array` because\n // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`\n const configKeys = Object.keys(config) as Iterable<keyof OverlayConfig> &\n (keyof OverlayConfig)[];\n for (const key of configKeys) {\n if (config[key] !== undefined) {\n // TypeScript, as of version 3.5, sees the left-hand-side of this expression\n // as \"I don't know *which* key this is, so the only valid value is the intersection\n // of all the possible values.\" In this case, that happens to be `undefined`. TypeScript\n // is not smart enough to see that the right-hand-side is actually an access of the same\n // exact type with the same exact key, meaning that the value type must be identical.\n // So we use `any` to work around this.\n this[key] = config[key] as any;\n }\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** Horizontal dimension of a connection point on the perimeter of the origin or overlay element. */\nexport type HorizontalConnectionPos = 'start' | 'center' | 'end';\n\n/** Vertical dimension of a connection point on the perimeter of the origin or overlay element. */\nexport type VerticalConnectionPos = 'top' | 'center' | 'bottom';\n\n/** A connection point on the origin element. */\nexport interface OriginConnectionPosition {\n originX: HorizontalConnectionPos;\n originY: VerticalConnectionPos;\n}\n\n/** A connection point on the overlay element. */\nexport interface OverlayConnectionPosition {\n overlayX: HorizontalConnectionPos;\n overlayY: VerticalConnectionPos;\n}\n\n/** The points of the origin element and the overlay element to connect. */\nexport class ConnectionPositionPair {\n /** X-axis attachment point for connected overlay origin. Can be 'start', 'end', or 'center'. */\n originX: HorizontalConnectionPos;\n /** Y-axis attachment point for connected overlay origin. Can be 'top', 'bottom', or 'center'. */\n originY: VerticalConnectionPos;\n /** X-axis attachment point for connected overlay. Can be 'start', 'end', or 'center'. */\n overlayX: HorizontalConnectionPos;\n /** Y-axis attachment point for connected overlay. Can be 'top', 'bottom', or 'center'. */\n overlayY: VerticalConnectionPos;\n\n constructor(\n origin: OriginConnectionPosition,\n overlay: OverlayConnectionPosition,\n /** Offset along the X axis. */\n public offsetX?: number,\n /** Offset along the Y axis. */\n public offsetY?: number,\n /** Class(es) to be applied to the panel while this position is active. */\n public panelClass?: string | string[],\n ) {\n this.originX = origin.originX;\n this.originY = origin.originY;\n this.overlayX = overlay.overlayX;\n this.overlayY = overlay.overlayY;\n }\n}\n\n/**\n * Set of properties regarding the position of the origin and overlay relative to the viewport\n * with respect to the containing Scrollable elements.\n *\n * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the\n * bounds of any one of the strategy's Scrollable's bounding client rectangle.\n *\n * The overlay and origin are outside view if there is no overlap between their bounding client\n * rectangle and any one of the strategy's Scrollable's bounding client rectangle.\n *\n * ----------- -----------\n * | outside | | clipped |\n * | view | --------------------------\n * | | | | | |\n * ---------- | ----------- |\n * -------------------------- | |\n * | | | Scrollable |\n * | | | |\n * | | --------------------------\n * | Scrollable |\n * | |\n * --------------------------\n *\n * @docs-private\n */\nexport class ScrollingVisibility {\n isOriginClipped: boolean;\n isOriginOutsideView: boolean;\n isOverlayClipped: boolean;\n isOverlayOutsideView: boolean;\n}\n\n/** The change event emitted by the strategy when a fallback position is used. */\nexport class ConnectedOverlayPositionChange {\n constructor(\n /** The position used as a result of this change. */\n public connectionPair: ConnectionPositionPair,\n /** @docs-private */\n public scrollableViewProperties: ScrollingVisibility,\n ) {}\n}\n\n/**\n * Validates whether a vertical position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nexport function validateVerticalPosition(property: string, value: VerticalConnectionPos) {\n if (value !== 'top' && value !== 'bottom' && value !== 'center') {\n throw Error(\n `ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"top\", \"bottom\" or \"center\".`,\n );\n }\n}\n\n/**\n * Validates whether a horizontal position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nexport function validateHorizontalPosition(property: string, value: HorizontalConnectionPos) {\n if (value !== 'start' && value !== 'end' && value !== 'center') {\n throw Error(\n `ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"start\", \"end\" or \"center\".`,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, OnDestroy} from '@angular/core';\nimport {OverlayReference} from '../overlay-reference';\n\n/**\n * Service for dispatching events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport abstract class BaseOverlayDispatcher implements OnDestroy {\n /** Currently attached overlays in the order they were attached. */\n _attachedOverlays: OverlayReference[] = [];\n\n protected _document: Document;\n protected _isAttached: boolean;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n ngOnDestroy(): void {\n this.detach();\n }\n\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef: OverlayReference): void {\n // Ensure that we don't get the same overlay multiple times.\n this.remove(overlayRef);\n this._attachedOverlays.push(overlayRef);\n }\n\n /** Remove an overlay from the list of attached overlay refs. */\n remove(overlayRef: OverlayReference): void {\n const index = this._attachedOverlays.indexOf(overlayRef);\n\n if (index > -1) {\n this._attachedOverlays.splice(index, 1);\n }\n\n // Remove the global listener once there are no more overlays.\n if (this._attachedOverlays.length === 0) {\n this.detach();\n }\n }\n\n /** Detaches the global event listener. */\n protected abstract detach(): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, NgZone, Optional} from '@angular/core';\nimport {OverlayReference} from '../overlay-reference';\nimport {BaseOverlayDispatcher} from './base-overlay-dispatcher';\n\n/**\n * Service for dispatching keyboard events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {\n constructor(\n @Inject(DOCUMENT) document: any,\n /** @breaking-change 14.0.0 _ngZone will be required. */\n @Optional() private _ngZone?: NgZone,\n ) {\n super(document);\n }\n\n /** Add a new overlay to the list of attached overlay refs. */\n override add(overlayRef: OverlayReference): void {\n super.add(overlayRef);\n\n // Lazily start dispatcher once first overlay is added\n if (!this._isAttached) {\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() =>\n this._document.body.addEventListener('keydown', this._keydownListener),\n );\n } else {\n this._document.body.addEventListener('keydown', this._keydownListener);\n }\n this._isAttached = true;\n }\n }\n\n /** Detaches the global keyboard event listener. */\n protected detach() {\n if (this._isAttached) {\n this._document.body.removeEventListener('keydown', this._keydownListener);\n this._isAttached = false;\n }\n }\n\n /** Keyboard event listener that will be attached to the body. */\n private _keydownListener = (event: KeyboardEvent) => {\n const overlays = this._attachedOverlays;\n\n for (let i = overlays.length - 1; i > -1; i--) {\n // Dispatch the keydown event to the top overlay which has subscribers to its keydown events.\n // We want to target the most recent overlay, rather than trying to match where the event came\n // from, because some components might open an overlay, but keep focus on a trigger element\n // (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions,\n // because we don't want overlays that don't handle keyboard events to block the ones below\n // them that do.\n if (overlays[i]._keydownEvents.observers.length > 0) {\n const keydownEvents = overlays[i]._keydownEvents;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.run(() => keydownEvents.next(event));\n } else {\n keydownEvents.next(event);\n }\n break;\n }\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, NgZone, Optional} from '@angular/core';\nimport {OverlayReference} from '../overlay-reference';\nimport {Platform, _getEventTarget} from '@angular/cdk/platform';\nimport {BaseOverlayDispatcher} from './base-overlay-dispatcher';\n\n/**\n * Service for dispatching mouse click events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\n@Injectable({providedIn: 'root'})\nexport class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {\n private _cursorOriginalValue: string;\n private _cursorStyleIsSet = false;\n private _pointerDownEventTarget: EventTarget | null;\n\n constructor(\n @Inject(DOCUMENT) document: any,\n private _platform: Platform,\n /** @breaking-change 14.0.0 _ngZone will be required. */\n @Optional() private _ngZone?: NgZone,\n ) {\n super(document);\n }\n\n /** Add a new overlay to the list of attached overlay refs. */\n override add(overlayRef: OverlayReference): void {\n super.add(overlayRef);\n\n // Safari on iOS does not generate click events for non-interactive\n // elements. However, we want to receive a click for any element outside\n // the overlay. We can force a \"clickable\" state by setting\n // `cursor: pointer` on the document body. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile\n // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html\n if (!this._isAttached) {\n const body = this._document.body;\n\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => this._addEventListeners(body));\n } else {\n this._addEventListeners(body);\n }\n\n // click event is not fired on iOS. To make element \"clickable\" we are\n // setting the cursor to pointer\n if (this._platform.IOS && !this._cursorStyleIsSet) {\n this._cursorOriginalValue = body.style.cursor;\n body.style.cursor = 'pointer';\n this._cursorStyleIsSet = true;\n }\n\n this._isAttached = true;\n }\n }\n\n /** Detaches the global keyboard event listener. */\n protected detach() {\n if (this._isAttached) {\n const body = this._document.body;\n body.removeEventListener('pointerdown', this._pointerDownListener, true);\n body.removeEventListener('click', this._clickListener, true);\n body.removeEventListener('auxclick', this._clickListener, true);\n body.removeEventListener('contextmenu', this._clickListener, true);\n if (this._platform.IOS && this._cursorStyleIsSet) {\n body.style.cursor = this._cursorOriginalValue;\n this._cursorStyleIsSet = false;\n }\n this._isAttached = false;\n }\n }\n\n private _addEventListeners(body: HTMLElement): void {\n body.addEventListener('pointerdown', this._pointerDownListener, true);\n body.addEventListener('click', this._clickListener, true);\n body.addEventListener('auxclick', this._clickListener, true);\n body.addEventListener('contextmenu', this._clickListener, true);\n }\n\n /** Store pointerdown event target to track origin of click. */\n private _pointerDownListener = (event: PointerEvent) => {\n this._pointerDownEventTarget = _getEventTarget(event);\n };\n\n /** Click event listener that will be attached to the body propagate phase. */\n private _clickListener = (event: MouseEvent) => {\n const target = _getEventTarget(event);\n // In case of a click event, we want to check the origin of the click\n // (e.g. in case where a user starts a click inside the overlay and\n // releases the click outside of it).\n // This is done by using the event target of the preceding pointerdown event.\n // Every click event caused by a pointer device has a preceding pointerdown\n // event, unless the click was programmatically triggered (e.g. in a unit test).\n const origin =\n event.type === 'click' && this._pointerDownEventTarget\n ? this._pointerDownEventTarget\n : target;\n // Reset the stored pointerdown event target, to avoid having it interfere\n // in subsequent events.\n this._pointerDownEventTarget = null;\n\n // We copy the array because the original may be modified asynchronously if the\n // outsidePointerEvents listener decides to detach overlays resulting in index errors inside\n // the for loop.\n const overlays = this._attachedOverlays.slice();\n\n // Dispatch the mouse event to the top overlay which has subscribers to its mouse events.\n // We want to target all overlays for which the click could be considered as outside click.\n // As soon as we reach an overlay for which the click is not outside click we break off\n // the loop.\n for (let i = overlays.length - 1; i > -1; i--) {\n const overlayRef = overlays[i];\n if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {\n continue;\n }\n\n // If it's a click inside the overlay, just break - we should do nothing\n // If it's an outside click (both origin and target of the click) dispatch the mouse event,\n // and proceed with the next overlay\n if (\n overlayRef.overlayElement.contains(target as Node) ||\n overlayRef.overlayElement.contains(origin as Node)\n ) {\n break;\n }\n\n const outsidePointerEvents = overlayRef._outsidePointerEvents;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.run(() => outsidePointerEvents.next(event));\n } else {\n outsidePointerEvents.next(event);\n }\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, OnDestroy} from '@angular/core';\nimport {Platform, _isTestEnvironment} from '@angular/cdk/platform';\n\n/** Container inside which all overlays will render. */\n@Injectable({providedIn: 'root'})\nexport class OverlayContainer implements OnDestroy {\n protected _containerElement: HTMLElement;\n protected _document: Document;\n\n constructor(@Inject(DOCUMENT) document: any, protected _platform: Platform) {\n this._document = document;\n }\n\n ngOnDestroy() {\n this._containerElement?.remove();\n }\n\n /**\n * This method returns the overlay container element. It will lazily\n * create the element the first time it is called to facilitate using\n * the container in non-browser environments.\n * @returns the container element\n */\n getContainerElement(): HTMLElement {\n if (!this._containerElement) {\n this._createContainer();\n }\n\n return this._containerElement;\n }\n\n /**\n * Create the overlay container element, which is simply a div\n * with the 'cdk-overlay-container' class on the document body.\n */\n protected _createContainer(): void {\n const containerClass = 'cdk-overlay-container';\n\n // TODO(crisbeto): remove the testing check once we have an overlay testing\n // module or Angular starts tearing down the testing `NgModule`. See:\n // https://github.com/angular/angular/issues/18831\n if (this._platform.isBrowser || _isTestEnvironment()) {\n const oppositePlatformContainers = this._document.querySelectorAll(\n `.${containerClass}[platform=\"server\"], ` + `.${containerClass}[platform=\"test\"]`,\n );\n\n // Remove any old containers from the opposite platform.\n // This can happen when transitioning from the server to the client.\n for (let i = 0; i < oppositePlatformContainers.length; i++) {\n oppositePlatformContainers[i].remove();\n }\n }\n\n const container = this._document.createElement('div');\n container.classList.add(containerClass);\n\n // A long time ago we kept adding new overlay containers whenever a new app was instantiated,\n // but at some point we added logic which clears the duplicate ones in order to avoid leaks.\n // The new logic was a little too aggressive since it was breaking some legitimate use cases.\n // To mitigate the problem we made it so that only containers from a different platform are\n // cleared, but the side-effect was that people started depending on the overly-aggressive\n // logic to clean up their tests for them. Until we can introduce an overlay-specific testing\n // module which does the cleanup, we try to detect that we're in a test environment and we\n // always clear the container. See #17006.\n // TODO(crisbeto): remove the test environment check once we have an overlay testing module.\n if (_isTestEnvironment()) {\n container.setAttribute('platform', 'test');\n } else if (!this._platform.isBrowser) {\n container.setAttribute('platform', 'server');\n }\n\n this._document.body.appendChild(container);\n this._containerElement = container;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {ComponentPortal, Portal, PortalOutlet, TemplatePortal} from '@angular/cdk/portal';\nimport {ComponentRef, EmbeddedViewRef, NgZone} from '@angular/core';\nimport {Location} from '@angular/common';\nimport {Observable, Subject, merge, SubscriptionLike, Subscription} from 'rxjs';\nimport {take, takeUntil} from 'rxjs/operators';\nimport {OverlayKeyboardDispatcher} from './dispatchers/overlay-keyboard-dispatcher';\nimport {OverlayOutsideClickDispatcher} from './dispatchers/overlay-outside-click-dispatcher';\nimport {OverlayConfig} from './overlay-config';\nimport {coerceCssPixelValue, coerceArray} from '@angular/cdk/coercion';\nimport {OverlayReference} from './overlay-reference';\nimport {PositionStrategy} from './position/position-strategy';\nimport {ScrollStrategy} from './scroll';\n\n/** An object where all of its properties cannot be written. */\nexport type ImmutableObject<T> = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * Reference to an overlay that has been created with the Overlay service.\n * Used to manipulate or dispose of said overlay.\n */\nexport class OverlayRef implements PortalOutlet, OverlayReference {\n private _backdropElement: HTMLElement | null = null;\n private _backdropTimeout: number | undefined;\n private readonly _backdropClick = new Subject<MouseEvent>();\n private readonly _attachments = new Subject<void>();\n private readonly _detachments = new Subject<void>();\n private _positionStrategy: PositionStrategy | undefined;\n private _scrollStrategy: ScrollStrategy | undefined;\n private _locationChanges: SubscriptionLike = Subscription.EMPTY;\n private _backdropClickHandler = (event: MouseEvent) => this._backdropClick.next(event);\n private _backdropTransitionendHandler = (event: TransitionEvent) => {\n this._disposeBackdrop(event.target as HTMLElement | null);\n };\n\n /**\n * Reference to the parent of the `_host` at the time it was detached. Used to restore\n * the `_host` to its original position in the DOM when it gets re-attached.\n */\n private _previousHostParent: HTMLElement;\n\n /** Stream of keydown events dispatched to this overlay. */\n readonly _keydownEvents = new Subject<KeyboardEvent>();\n\n /** Stream of mouse outside events dispatched to this overlay. */\n readonly _outsidePointerEvents = new Subject<MouseEvent>();\n\n constructor(\n private _portalOutlet: PortalOutlet,\n private _host: HTMLElement,\n private _pane: HTMLElement,\n private _config: ImmutableObject<OverlayConfig>,\n private _ngZone: NgZone,\n private _keyboardDispatcher: OverlayKeyboardDispatcher,\n private _document: Document,\n private _location: Location,\n private _outsideClickDispatcher: OverlayOutsideClickDispatcher,\n private _animationsDisabled = false,\n ) {\n if (_config.scrollStrategy) {\n this._scrollStrategy = _config.scrollStrategy;\n this._scrollStrategy.attach(this);\n }\n\n this._positionStrategy = _config.positionStrategy;\n }\n\n /** The overlay's HTML element */\n get overlayElement(): HTMLElement {\n return this._pane;\n }\n\n /** The overlay's backdrop HTML element. */\n get backdropElement(): HTMLElement | null {\n return this._backdropElement;\n }\n\n /**\n * Wrapper around the panel element. Can be used for advanced\n * positioning where a wrapper with specific styling is\n * required around the overlay pane.\n */\n get hostElement(): HTMLElement {\n return this._host;\n }\n\n attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;\n attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;\n attach(portal: any): any;\n\n /**\n * Attaches content, given via a Portal, to the overlay.\n * If the overlay is configured to have a backdrop, it will be created.\n *\n * @param portal Portal instance to which to attach the overlay.\n * @returns The portal attachment result.\n */\n attach(portal: Portal<any>): any {\n // Insert the host into the DOM before attaching the portal, otherwise\n // the animations module will skip animations on repeat attachments.\n if (!this._host.parentElement && this._previousHostParent) {\n this._previousHostParent.appendChild(this._host);\n }\n\n const attachResult = this._portalOutlet.attach(portal);\n\n if (this._positionStrategy) {\n this._positionStrategy.attach(this);\n }\n\n this._updateStackingOrder();\n this._updateElementSize();\n this._updateElementDirection();\n\n if (this._scrollStrategy) {\n this._scrollStrategy.enable();\n }\n\n // Update the position once the zone is stable so that the overlay will be fully rendered\n // before attempting to position it, as the position may depend on the size of the rendered\n // content.\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\n // The overlay could've been detached before the zone has stabilized.\n if (this.hasAttached()) {\n this.updatePosition();\n }\n });\n\n // Enable pointer events for the overlay pane element.\n this._togglePointerEvents(true);\n\n if (this._config.hasBackdrop) {\n this._attachBackdrop();\n }\n\n if (this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, true);\n }\n\n // Only emit the `attachments` event once all other setup is done.\n this._attachments.next();\n\n // Track this overlay by the keyboard dispatcher\n this._keyboardDispatcher.add(this);\n\n if (this._config.disposeOnNavigation) {\n this._locationChanges = this._location.subscribe(() => this.dispose());\n }\n\n this._outsideClickDispatcher.add(this);\n\n // TODO(crisbeto): the null check is here, because the portal outlet returns `any`.\n // We should be guaranteed for the result to be `ComponentRef | EmbeddedViewRef`, but\n // `instanceof EmbeddedViewRef` doesn't appear to work at the moment.\n if (typeof attachResult?.onDestroy === 'function') {\n // In most cases we control the portal and we know when it is being detached so that\n // we can finish the disposal process. The exception is if the user passes in a custom\n // `ViewContainerRef` that isn't destroyed through the overlay API. Note that we use\n // `detach` here instead of `dispose`, because we don't know if the user intends to\n // reattach the overlay at a later point. It also has the advantage of waiting for animations.\n attachResult.onDestroy(() => {\n if (this.hasAttached()) {\n // We have to delay the `detach` call, because detaching immediately prevents\n // other destroy hooks from running. This is likely a framework bug similar to\n // https://github.com/angular/angular/issues/46119\n this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach()));\n }\n });\n }\n\n return attachResult;\n }\n\n /**\n * Detaches an overlay from a portal.\n * @returns The portal detachment result.\n */\n detach(): any {\n if (!this.hasAttached()) {\n return;\n }\n\n this.detachBackdrop();\n\n // When the overlay is detached, the pane element should disable pointer events.\n // This is necessary because otherwise the pane element will cover the page and disable\n // pointer events therefore. Depends on the position strategy and the applied pane boundaries.\n this._togglePointerEvents(false);\n\n if (this._positionStrategy && this._positionStrategy.detach) {\n this._positionStrategy.detach();\n }\n\n if (this._scrollStrategy) {\n this._scrollStrategy.disable();\n }\n\n const detachmentResult = this._portalOutlet.detach();\n\n // Only emit after everything is detached.\n this._detachments.next();\n\n // Remove this overlay from keyboard dispatcher tracking.\n this._keyboardDispatcher.remove(this);\n\n // Keeping the host element in the DOM can cause scroll jank, because it still gets\n // rendered, even though it's transparent and unclickable which is why we remove it.\n this._detachContentWhenStable();\n this._locationChanges.unsubscribe();\n this._outsideClickDispatcher.remove(this);\n return detachmentResult;\n }\n\n /** Cleans up the overlay from the DOM. */\n dispose(): void {\n const isAttached = this.hasAttached();\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._disposeScrollStrategy();\n this._disposeBackdrop(this._backdropElement);\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n this._outsidePointerEvents.complete();\n this._outsideClickDispatcher.remove(this);\n this._host?.remove();\n\n this._previousHostParent = this._pane = this._host = null!;\n\n if (isAttached) {\n this._detachments.next();\n }\n\n this._detachments.complete();\n }\n\n /** Whether the overlay has attached content. */\n hasAttached(): boolean {\n return this._portalOutlet.hasAttached();\n }\n\n /** Gets an observable that emits when the backdrop has been clicked. */\n backdropClick(): Observable<MouseEvent> {\n return this._backdropClick;\n }\n\n /** Gets an observable that emits when the overlay has been attached. */\n attachments(): Observable<void> {\n return this._attachments;\n }\n\n /** Gets an observable that emits when the overlay has been detached. */\n detachments(): Observable<void> {\n return this._detachments;\n }\n\n /** Gets an observable of keydown events targeted to this overlay. */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._keydownEvents;\n }\n\n /** Gets an observable of pointer events targeted outside this overlay. */\n outsidePointerEvents(): Observable<MouseEvent> {\n return this._outsidePointerEvents;\n }\n\n /** Gets the current overlay configuration, which is immutable. */\n getConfig(): OverlayConfig {\n return this._config;\n }\n\n /** Updates the position of the overlay based on the position strategy. */\n updatePosition(): void {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }\n\n /** Switches to a new position strategy and updates the overlay position. */\n updatePositionStrategy(strategy: PositionStrategy): void {\n if (strategy === this._positionStrategy) {\n return;\n }\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._positionStrategy = strategy;\n\n if (this.hasAttached()) {\n strategy.attach(this);\n this.updatePosition();\n }\n }\n\n /** Update the size properties of the overlay. */\n updateSize(sizeConfig: OverlaySizeConfig): void {\n this._config = {...this._config, ...sizeConfig};\n this._updateElementSize();\n }\n\n /** Sets the LTR/RTL direction for the overlay. */\n setDirection(dir: Direction | Directionality): void {\n this._config = {...this._config, direction: dir};\n this._updateElementDirection();\n }\n\n /** Add a CSS class or an array of classes to the overlay pane. */\n addPanelClass(classes: string | string[]): void {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, true);\n }\n }\n\n /** Remove a CSS class or an array of classes from the overlay pane. */\n removePanelClass(classes: string | string[]): void {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, false);\n }\n }\n\n /**\n * Returns the layout direction of the overlay panel.\n */\n getDirection(): Direction {\n const direction = this._config.direction;\n\n if (!direction) {\n return 'ltr';\n }\n\n return typeof direction === 'string' ? direction : direction.value;\n }\n\n /** Switches to a new scroll strategy. */\n updateScrollStrategy(strategy: ScrollStrategy): void {\n if (strategy === this._scrollStrategy) {\n return;\n }\n\n this._disposeScrollStrategy();\n this._scrollStrategy = strategy;\n\n if (this.hasAttached()) {\n strategy.attach(this);\n strategy.enable();\n }\n }\n\n /** Updates the text direction of the overlay panel. */\n private _updateElementDirection() {\n this._host.setAttribute('dir', this.getDirection());\n }\n\n /** Updates the size of the overlay element based on the overlay config. */\n private _updateElementSize() {\n if (!this._pane) {\n return;\n }\n\n const style = this._pane.style;\n\n style.width = coerceCssPixelValue(this._config.width);\n style.height = coerceCssPixelValue(this._config.height);\n style.minWidth = coerceCssPixelValue(this._config.minWidth);\n style.minHeight = coerceCssPixelValue(this._config.minHeight);\n style.maxWidth = coerceCssPixelValue(this._config.maxWidth);\n style.maxHeight = coerceCssPixelValue(this._config.maxHeight);\n }\n\n /** Toggles the pointer events for the overlay pane element. */\n private _togglePointerEvents(enablePointer: boolean) {\n this._pane.style.pointerEvents = enablePointer ? '' : 'none';\n }\n\n /** Attaches a backdrop for this overlay. */\n private _attachBackdrop() {\n const showingClass = 'cdk-overlay-backdrop-showing';\n\n this._backdropElement = this._document.createElement('div');\n this._backdropElement.classList.add('cdk-overlay-backdrop');\n\n if (this._animationsDisabled) {\n this._backdropElement.classList.add('cdk-overlay-backdrop-noop-animation');\n }\n\n if (this._config.backdropClass) {\n this._toggleClasses(this._backdropElement, this._config.backdropClass, true);\n }\n\n // Insert the backdrop before the pane in the DOM order,\n // in order to handle stacked overlays properly.\n this._host.parentElement!.insertBefore(this._backdropElement, this._host);\n\n // Forward backdrop clicks such that the consumer of the overlay can perform whatever\n // action desired when such a click occurs (usually closing the overlay).\n this._backdropElement.addEventListener('click', this._backdropClickHandler);\n\n // Add class to fade-in the backdrop after one frame.\n if (!this._animationsDisabled && typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n if (this._backdropElement) {\n this._backdropElement.classList.add(showingClass);\n }\n });\n });\n } else {\n this._backdropElement.classList.add(showingClass);\n }\n }\n\n /**\n * Updates the stacking order of the element, moving it to the top if necessary.\n * This is required in cases where one overlay was detached, while another one,\n * that should be behind it, was destroyed. The next time both of them are opened,\n * the stacking will be wrong, because the detached element's pane will still be\n * in its original DOM position.\n */\n private _updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode!.appendChild(this._host);\n }\n }\n\n /** Detaches the backdrop (if any) associated with the overlay. */\n detachBackdrop(): void {\n const backdropToDetach = this._backdropElement;\n\n if (!backdropToDetach) {\n return;\n }\n\n if (this._animationsDisabled) {\n this._disposeBackdrop(backdropToDetach);\n return;\n }\n\n backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');\n\n this._ngZone.runOutsideAngular(() => {\n backdropToDetach!.addEventListener('transitionend', this._backdropTransitionendHandler);\n });\n\n // If the backdrop doesn't have a transition, the `transitionend` event won't fire.\n // In this case we make it unclickable and we try to remove it after a delay.\n backdropToDetach.style.pointerEvents = 'none';\n\n // Run this outside the Angular zone because there's nothing that Angular cares about.\n // If it were to run inside the Angular zone, every test that used Overlay would have to be\n // either async or fakeAsync.\n this._backdropTimeout = this._ngZone.runOutsideAngular(() =>\n setTimeout(() => {\n this._disposeBackdrop(backdropToDetach);\n }, 500),\n );\n }\n\n /** Toggles a single CSS class or an array of classes on an element. */\n private _toggleClasses(element: HTMLElement, cssClasses: string | string[], isAdd: boolean) {\n const classes = coerceArray(cssClasses || []).filter(c => !!c);\n\n if (classes.length) {\n isAdd ? element.classList.add(...classes) : element.classList.remove(...classes);\n }\n }\n\n /** Detaches the overlay content next time the zone stabilizes. */\n private _detachContentWhenStable() {\n // Normally we wouldn't have to explicitly run this outside the `NgZone`, however\n // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will\n // be patched to run inside the zone, which will throw us into an infinite loop.\n this._ngZone.runOutsideAngular(() => {\n // We can't remove the host here immediately, because the overlay pane's content\n // might still be animating. This stream helps us avoid interrupting the animation\n // by waiting for the pane to become empty.\n const subscription = this._ngZone.onStable\n .pipe(takeUntil(merge(this._attachments, this._detachments)))\n .subscribe(() => {\n // Needs a couple of checks for the pane and host, because\n // they may have been removed by the time the zone stabilizes.\n if (!this._pane || !this._host || this._pane.children.length === 0) {\n if (this._pane && this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, false);\n }\n\n if (this._host && this._host.parentElement) {\n this._previousHostParent = this._host.parentElement;\n this._host.remove();\n }\n\n subscription.unsubscribe();\n }\n });\n });\n }\n\n /** Disposes of a scroll strategy. */\n private _disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n\n if (scrollStrategy) {\n scrollStrategy.disable();\n\n if (scrollStrategy.detach) {\n scrollStrategy.detach();\n }\n }\n }\n\n /** Removes a backdrop element from the DOM. */\n private _disposeBackdrop(backdrop: HTMLElement | null) {\n if (backdrop) {\n backdrop.removeEventListener('click', this._backdropClickHandler);\n backdrop.removeEventListener('transitionend', this._backdropTransitionendHandler);\n backdrop.remove();\n\n // It is possible that a new portal has been attached to this overlay since we started\n // removing the backdrop. If that is the case, only clear the backdrop reference if it\n // is still the same instance that we started to remove.\n if (this._backdropElement === backdrop) {\n this._backdropElement = null;\n }\n }\n\n if (this._backdropTimeout) {\n clearTimeout(this._backdropTimeout);\n this._backdropTimeout = undefined;\n }\n }\n}\n\n/** Size properties for an overlay. */\nexport interface OverlaySizeConfig {\n width?: number | string;\n height?: number | string;\n minWidth?: number | string;\n minHeight?: number | string;\n maxWidth?: number | string;\n maxHeight?: number | string;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PositionStrategy} from './position-strategy';\nimport {ElementRef} from '@angular/core';\nimport {ViewportRuler, CdkScrollable, ViewportScrollPosition} from '@angular/cdk/scrolling';\nimport {\n ConnectedOverlayPositionChange,\n ConnectionPositionPair,\n ScrollingVisibility,\n validateHorizontalPosition,\n validateVerticalPosition,\n} from './connected-position';\nimport {Observable, Subscription, Subject} from 'rxjs';\nimport {OverlayReference} from '../overlay-reference';\nimport {isElementScrolledOutsideView, isElementClippedByScrolling} from './scroll-clip';\nimport {coerceCssPixelValue, coerceArray} from '@angular/cdk/coercion';\nimport {Platform} from '@angular/cdk/platform';\nimport {OverlayContainer} from '../overlay-container';\n\n// TODO: refactor clipping detection into a separate thing (part of scrolling module)\n// TODO: doesn't handle both flexible width and height when it has to scroll along both axis.\n\n/** Class to be added to the overlay bounding box. */\nconst boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';\n\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n\n/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */\nexport type FlexibleConnectedPositionStrategyOrigin =\n | ElementRef\n | Element\n | (Point & {\n width?: number;\n height?: number;\n });\n\n/** Equivalent of `ClientRect` without some of the properties we don't care about. */\ntype Dimensions = Omit<ClientRect, 'x' | 'y' | 'toJSON'>;\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * implicit position relative some origin element. The relative position is defined in terms of\n * a point on the origin element that is connected to a point on the overlay element. For example,\n * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner\n * of the overlay.\n */\nexport class FlexibleConnectedPositionStrategy implements PositionStrategy {\n /** The overlay to which this strategy is attached. */\n private _overlayRef: OverlayReference;\n\n /** Whether we're performing the very first positioning of the overlay. */\n private _isInitialRender: boolean;\n\n /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */\n private _lastBoundingBoxSize = {width: 0, height: 0};\n\n /** Whether the overlay was pushed in a previous positioning. */\n private _isPushed = false;\n\n /** Whether the overlay can be pushed on-screen on the initial open. */\n private _canPush = true;\n\n /** Whether the overlay can grow via flexible width/height after the initial open. */\n private _growAfterOpen = false;\n\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n private _hasFlexibleDimensions = true;\n\n /** Whether the overlay position is locked. */\n private _positionLocked = false;\n\n /** Cached origin dimensions */\n private _originRect: Dimensions;\n\n /** Cached overlay dimensions */\n private _overlayRect: Dimensions;\n\n /** Cached viewport dimensions */\n private _viewportRect: Dimensions;\n\n /** Cached container dimensions */\n private _containerRect: Dimensions;\n\n /** Amount of space that must be maintained between the overlay and the edge of the viewport. */\n private _viewportMargin = 0;\n\n /** The Scrollable containers used to check scrollable view properties on position change. */\n private _scrollables: CdkScrollable[] = [];\n\n /** Ordered list of preferred positions, from most to least desirable. */\n _preferredPositions: ConnectionPositionPair[] = [];\n\n /** The origin element against which the overlay will be positioned. */\n _origin: FlexibleConnectedPositionStrategyOrigin;\n\n /** The overlay pane element. */\n private _pane: HTMLElement;\n\n /** Whether the strategy has been disposed of already. */\n private _isDisposed: boolean;\n\n /**\n * Parent element for the overlay panel used to constrain the overlay panel's size to fit\n * within the viewport.\n */\n private _boundingBox: HTMLElement | null;\n\n /** The last position to have been calculated as the best fit position. */\n private _lastPosition: ConnectedPosition | null;\n\n /** Subject that emits whenever the position changes. */\n private readonly _positionChanges = new Subject<ConnectedOverlayPositionChange>();\n\n /** Subscription to viewport size changes. */\n private _resizeSubscription = Subscription.EMPTY;\n\n /** Default offset for the overlay along the x axis. */\n private _offsetX = 0;\n\n /** Default offset for the overlay along the y axis. */\n private _offsetY = 0;\n\n /** Selector to be used when finding the elements on which to set the transform origin. */\n private _transformOriginSelector: string;\n\n /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */\n private _appliedPanelClasses: string[] = [];\n\n /** Amount by which the overlay was pushed in each axis during the last time it was positioned. */\n private _previousPushAmount: {x: number; y: number} | null;\n\n /** Observable sequence of position changes. */\n positionChanges: Observable<ConnectedOverlayPositionChange> = this._positionChanges;\n\n /** Ordered list of preferred positions, from most to least desirable. */\n get positions(): ConnectionPositionPair[] {\n return this._preferredPositions;\n }\n\n constructor(\n connectedTo: FlexibleConnectedPositionStrategyOrigin,\n private _viewportRuler: ViewportRuler,\n private _document: Document,\n private _platform: Platform,\n private _overlayContainer: OverlayContainer,\n ) {\n this.setOrigin(connectedTo);\n }\n\n /** Attaches this position strategy to an overlay. */\n attach(overlayRef: OverlayReference): void {\n if (\n this._overlayRef &&\n overlayRef !== this._overlayRef &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw Error('This position strategy is already attached to an overlay');\n }\n\n this._validatePositions();\n\n overlayRef.hostElement.classList.add(boundingBoxClass);\n\n this._overlayRef = overlayRef;\n this._boundingBox = overlayRef.hostElement;\n this._pane = overlayRef.overlayElement;\n this._isDisposed = false;\n this._isInitialRender = true;\n this._lastPosition = null;\n this._resizeSubscription.unsubscribe();\n this._resizeSubscription = this._viewportRuler.change().subscribe(() => {\n // When the window is resized, we want to trigger the next reposition as if it\n // was an initial render, in order for the strategy to pick a new optimal position,\n // otherwise position locking will cause it to stay at the old one.\n this._isInitialRender = true;\n this.apply();\n });\n }\n\n /**\n * Updates the position of the overlay element, using whichever preferred position relative\n * to the origin best fits on-screen.\n *\n * The selection of a position goes as follows:\n * - If any positions fit completely within the viewport as-is,\n * choose the first position that does so.\n * - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,\n * choose the position with the greatest available size modified by the positions' weight.\n * - If pushing is enabled, take the position that went off-screen the least and push it\n * on-screen.\n * - If none of the previous criteria were met, use the position that goes off-screen the least.\n * @docs-private\n */\n apply(): void {\n // We shouldn't do anything if the strategy was disposed or we're on the server.\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n\n // If the position has been applied already (e.g. when the overlay was opened) and the\n // consumer opted into locking in the position, re-use the old position, in order to\n // prevent the overlay from jumping around.\n if (!this._isInitialRender && this._positionLocked && this._lastPosition) {\n this.reapplyLastPosition();\n return;\n }\n\n this._clearPanelClasses();\n this._resetOverlayElementStyles();\n this._resetBoundingBoxStyles();\n\n // We need the bounding rects for the origin, the overlay and the container to determine how to position\n // the overlay relative to the origin.\n // We use the viewport rect to determine whether a position would go off-screen.\n this._viewportRect = this._getNarrowedViewportRect();\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();\n\n const originRect = this._originRect;\n const overlayRect = this._overlayRect;\n const viewportRect = this._viewportRect;\n const containerRect = this._containerRect;\n\n // Positions where the overlay will fit with flexible dimensions.\n const flexibleFits: FlexibleFit[] = [];\n\n // Fallback if none of the preferred positions fit within the viewport.\n let fallback: FallbackPosition | undefined;\n\n // Go through each of the preferred positions looking for a good fit.\n // If a good fit is found, it will be applied immediately.\n for (let pos of this._preferredPositions) {\n // Get the exact (x, y) coordinate for the point-of-origin on the origin element.\n let originPoint = this._getOriginPoint(originRect, containerRect, pos);\n\n // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the\n // overlay in this position. We use the top-left corner for calculations and later translate\n // this into an appropriate (top, left, bottom, right) style.\n let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);\n\n // Calculate how well the overlay would fit into the viewport with this point.\n let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);\n\n // If the overlay, without any further work, fits into the viewport, use this position.\n if (overlayFit.isCompletelyWithinViewport) {\n this._isPushed = false;\n this._applyPosition(pos, originPoint);\n return;\n }\n\n // If the overlay has flexible dimensions, we can use this position\n // so long as there's enough space for the minimum dimensions.\n if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {\n // Save positions where the overlay will fit with flexible dimensions. We will use these\n // if none of the positions fit *without* flexible dimensions.\n flexibleFits.push({\n position: pos,\n origin: originPoint,\n overlayRect,\n boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos),\n });\n\n continue;\n }\n\n // If the current preferred position does not fit on the screen, remember the position\n // if it has more visible area on-screen than we've seen and move onto the next preferred\n // position.\n if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {\n fallback = {overlayFit, overlayPoint, originPoint, position: pos, overlayRect};\n }\n }\n\n // If there are any positions where the overlay would fit with flexible dimensions, choose the\n // one that has the greatest area available modified by the position's weight\n if (flexibleFits.length) {\n let bestFit: FlexibleFit | null = null;\n let bestScore = -1;\n for (const fit of flexibleFits) {\n const score =\n fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);\n if (score > bestScore) {\n bestScore = score;\n bestFit = fit;\n }\n }\n\n this._isPushed = false;\n this._applyPosition(bestFit!.position, bestFit!.origin);\n return;\n }\n\n // When none of the preferred positions fit within the viewport, take the position\n // that went off-screen the least and attempt to push it on-screen.\n if (this._canPush) {\n // TODO(jelbourn): after pushing, the opening \"direction\" of the overlay might not make sense.\n this._isPushed = true;\n this._applyPosition(fallback!.position, fallback!.originPoint);\n return;\n }\n\n // All options for getting the overlay within the viewport have been exhausted, so go with the\n // position that went off-screen the least.\n this._applyPosition(fallback!.position, fallback!.originPoint);\n }\n\n detach(): void {\n this._clearPanelClasses();\n this._lastPosition = null;\n this._previousPushAmount = null;\n this._resizeSubscription.unsubscribe();\n }\n\n /** Cleanup after the element gets destroyed. */\n dispose(): void {\n if (this._isDisposed) {\n return;\n }\n\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n } as CSSStyleDeclaration);\n }\n\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null!;\n this._isDisposed = true;\n }\n\n /**\n * This re-aligns the overlay element with the trigger in its last calculated position,\n * even if a position higher in the \"preferred positions\" list would now fit. This\n * allows one to re-align the panel without changing the orientation of the panel.\n */\n reapplyLastPosition(): void {\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n\n const lastPosition = this._lastPosition;\n\n if (lastPosition) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();\n\n const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n } else {\n this.apply();\n }\n }\n\n /**\n * Sets the list of Scrollable containers that host the origin element so that\n * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every\n * Scrollable must be an ancestor element of the strategy's origin element.\n */\n withScrollableContainers(scrollables: CdkScrollable[]): this {\n this._scrollables = scrollables;\n return this;\n }\n\n /**\n * Adds new preferred positions.\n * @param positions List of positions options for this overlay.\n */\n withPositions(positions: ConnectedPosition[]): this {\n this._preferredPositions = positions;\n\n // If the last calculated position object isn't part of the positions anymore, clear\n // it in order to avoid it being picked up if the consumer tries to re-apply.\n if (positions.indexOf(this._lastPosition!) === -1) {\n this._lastPosition = null;\n }\n\n this._validatePositions();\n\n return this;\n }\n\n /**\n * Sets a minimum distance the overlay may be positioned to the edge of the viewport.\n * @param margin Required margin between the overlay and the viewport edge in pixels.\n */\n withViewportMargin(margin: number): this {\n this._viewportMargin = margin;\n return this;\n }\n\n /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */\n withFlexibleDimensions(flexibleDimensions = true): this {\n this._hasFlexibleDimensions = flexibleDimensions;\n return this;\n }\n\n /** Sets whether the overlay can grow after the initial open via flexible width/height. */\n withGrowAfterOpen(growAfterOpen = true): this {\n this._growAfterOpen = growAfterOpen;\n return this;\n }\n\n /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */\n withPush(canPush = true): this {\n this._canPush = canPush;\n return this;\n }\n\n /**\n * Sets whether the overlay's position should be locked in after it is positioned\n * initially. When an overlay is locked in, it won't attempt to reposition itself\n * when the position is re-applied (e.g. when the user scrolls away).\n * @param isLocked Whether the overlay should locked in.\n */\n withLockedPosition(isLocked = true): this {\n this._positionLocked = isLocked;\n return this;\n }\n\n /**\n * Sets the origin, relative to which to position the overlay.\n * Using an element origin is useful for building components that need to be positioned\n * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be\n * used for cases like contextual menus which open relative to the user's pointer.\n * @param origin Reference to the new origin.\n */\n setOrigin(origin: FlexibleConnectedPositionStrategyOrigin): this {\n this._origin = origin;\n return this;\n }\n\n /**\n * Sets the default offset for the overlay's connection point on the x-axis.\n * @param offset New offset in the X axis.\n */\n withDefaultOffsetX(offset: number): this {\n this._offsetX = offset;\n return this;\n }\n\n /**\n * Sets the default offset for the overlay's connection point on the y-axis.\n * @param offset New offset in the Y axis.\n */\n withDefaultOffsetY(offset: number): this {\n this._offsetY = offset;\n return this;\n }\n\n /**\n * Configures that the position strategy should set a `transform-origin` on some elements\n * inside the overlay, depending on the current position that is being applied. This is\n * useful for the cases where the origin of an animation can change depending on the\n * alignment of the overlay.\n * @param selector CSS selector that will be used to find the target\n * elements onto which to set the transform origin.\n */\n withTransformOriginOn(selector: string): this {\n this._transformOriginSelector = selector;\n return this;\n }\n\n /**\n * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.\n */\n private _getOriginPoint(\n originRect: Dimensions,\n containerRect: Dimensions,\n pos: ConnectedPosition,\n ): Point {\n let x: number;\n if (pos.originX == 'center') {\n // Note: when centering we should always use the `left`\n // offset, otherwise the position will be wrong in RTL.\n x = originRect.left + originRect.width / 2;\n } else {\n const startX = this._isRtl() ? originRect.right : originRect.left;\n const endX = this._isRtl() ? originRect.left : originRect.right;\n x = pos.originX == 'start' ? startX : endX;\n }\n\n // When zooming in Safari the container rectangle contains negative values for the position\n // and we need to re-add them to the calculated coordinates.\n if (containerRect.left < 0) {\n x -= containerRect.left;\n }\n\n let y: number;\n if (pos.originY == 'center') {\n y = originRect.top + originRect.height / 2;\n } else {\n y = pos.originY == 'top' ? originRect.top : originRect.bottom;\n }\n\n // Normally the containerRect's top value would be zero, however when the overlay is attached to an input\n // (e.g. in an autocomplete), mobile browsers will shift everything in order to put the input in the middle\n // of the screen and to make space for the virtual keyboard. We need to account for this offset,\n // otherwise our positioning will be thrown off.\n // Additionally, when zooming in Safari this fixes the vertical position.\n if (containerRect.top < 0) {\n y -= containerRect.top;\n }\n\n return {x, y};\n }\n\n /**\n * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and\n * origin point to which the overlay should be connected.\n */\n private _getOverlayPoint(\n originPoint: Point,\n overlayRect: Dimensions,\n pos: ConnectedPosition,\n ): Point {\n // Calculate the (overlayStartX, overlayStartY), the start of the\n // potential overlay position relative to the origin point.\n let overlayStartX: number;\n if (pos.overlayX == 'center') {\n overlayStartX = -overlayRect.width / 2;\n } else if (pos.overlayX === 'start') {\n overlayStartX = this._isRtl() ? -overlayRect.width : 0;\n } else {\n overlayStartX = this._isRtl() ? 0 : -overlayRect.width;\n }\n\n let overlayStartY: number;\n if (pos.overlayY == 'center') {\n overlayStartY = -overlayRect.height / 2;\n } else {\n overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;\n }\n\n // The (x, y) coordinates of the overlay.\n return {\n x: originPoint.x + overlayStartX,\n y: originPoint.y + overlayStartY,\n };\n }\n\n /** Gets how well an overlay at the given point will fit within the viewport. */\n private _getOverlayFit(\n point: Point,\n rawOverlayRect: Dimensions,\n viewport: Dimensions,\n position: ConnectedPosition,\n ): OverlayFit {\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n let {x, y} = point;\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n\n // Account for the offsets since they could push the overlay out of the viewport.\n if (offsetX) {\n x += offsetX;\n }\n\n if (offsetY) {\n y += offsetY;\n }\n\n // How much the overlay would overflow at this position, on each side.\n let leftOverflow = 0 - x;\n let rightOverflow = x + overlay.width - viewport.width;\n let topOverflow = 0 - y;\n let bottomOverflow = y + overlay.height - viewport.height;\n\n // Visible parts of the element on each axis.\n let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);\n let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);\n let visibleArea = visibleWidth * visibleHeight;\n\n return {\n visibleArea,\n isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea,\n fitsInViewportVertically: visibleHeight === overlay.height,\n fitsInViewportHorizontally: visibleWidth == overlay.width,\n };\n }\n\n /**\n * Whether the overlay can fit within the viewport when it may resize either its width or height.\n * @param fit How well the overlay fits in the viewport at some position.\n * @param point The (x, y) coordinates of the overlay at some position.\n * @param viewport The geometry of the viewport.\n */\n private _canFitWithFlexibleDimensions(fit: OverlayFit, point: Point, viewport: Dimensions) {\n if (this._hasFlexibleDimensions) {\n const availableHeight = viewport.bottom - point.y;\n const availableWidth = viewport.right - point.x;\n const minHeight = getPixelValue(this._overlayRef.getConfig().minHeight);\n const minWidth = getPixelValue(this._overlayRef.getConfig().minWidth);\n\n const verticalFit =\n fit.fitsInViewportVertically || (minHeight != null && minHeight <= availableHeight);\n const horizontalFit =\n fit.fitsInViewportHorizontally || (minWidth != null && minWidth <= availableWidth);\n\n return verticalFit && horizontalFit;\n }\n return false;\n }\n\n /**\n * Gets the point at which the overlay can be \"pushed\" on-screen. If the overlay is larger than\n * the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the\n * right and bottom).\n *\n * @param start Starting point from which the overlay is pushed.\n * @param rawOverlayRect Dimensions of the overlay.\n * @param scrollPosition Current viewport scroll position.\n * @returns The point at which to position the overlay after pushing. This is effectively a new\n * originPoint.\n */\n private _pushOverlayOnScreen(\n start: Point,\n rawOverlayRect: Dimensions,\n scrollPosition: ViewportScrollPosition,\n ): Point {\n // If the position is locked and we've pushed the overlay already, reuse the previous push\n // amount, rather than pushing it again. If we were to continue pushing, the element would\n // remain in the viewport, which goes against the expectations when position locking is enabled.\n if (this._previousPushAmount && this._positionLocked) {\n return {\n x: start.x + this._previousPushAmount.x,\n y: start.y + this._previousPushAmount.y,\n };\n }\n\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n const viewport = this._viewportRect;\n\n // Determine how much the overlay goes outside the viewport on each\n // side, which we'll use to decide which direction to push it.\n const overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);\n const overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);\n const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);\n const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);\n\n // Amount by which to push the overlay in each axis such that it remains on-screen.\n let pushX = 0;\n let pushY = 0;\n\n // If the overlay fits completely within the bounds of the viewport, push it from whichever\n // direction is goes off-screen. Otherwise, push the top-left corner such that its in the\n // viewport and allow for the trailing end of the overlay to go out of bounds.\n if (overlay.width <= viewport.width) {\n pushX = overflowLeft || -overflowRight;\n } else {\n pushX = start.x < this._viewportMargin ? viewport.left - scrollPosition.left - start.x : 0;\n }\n\n if (overlay.height <= viewport.height) {\n pushY = overflowTop || -overflowBottom;\n } else {\n pushY = start.y < this._viewportMargin ? viewport.top - scrollPosition.top - start.y : 0;\n }\n\n this._previousPushAmount = {x: pushX, y: pushY};\n\n return {\n x: start.x + pushX,\n y: start.y + pushY,\n };\n }\n\n /**\n * Applies a computed position to the overlay and emits a position change.\n * @param position The position preference\n * @param originPoint The point on the origin element where the overlay is connected.\n */\n private _applyPosition(position: ConnectedPosition, originPoint: Point) {\n this._setTransformOrigin(position);\n this._setOverlayElementStyles(originPoint, position);\n this._setBoundingBoxStyles(originPoint, position);\n\n if (position.panelClass) {\n this._addPanelClasses(position.panelClass);\n }\n\n // Save the last connected position in case the position needs to be re-calculated.\n this._lastPosition = position;\n\n // Notify that the position has been changed along with its change properties.\n // We only emit if we've got any subscriptions, because the scroll visibility\n // calculations can be somewhat expensive.\n if (this._positionChanges.observers.length) {\n const scrollableViewProperties = this._getScrollVisibility();\n const changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);\n this._positionChanges.next(changeEvent);\n }\n\n this._isInitialRender = false;\n }\n\n /** Sets the transform origin based on the configured selector and the passed-in position. */\n private _setTransformOrigin(position: ConnectedPosition) {\n if (!this._transformOriginSelector) {\n return;\n }\n\n const elements: NodeListOf<HTMLElement> = this._boundingBox!.querySelectorAll(\n this._transformOriginSelector,\n );\n let xOrigin: 'left' | 'right' | 'center';\n let yOrigin: 'top' | 'bottom' | 'center' = position.overlayY;\n\n if (position.overlayX === 'center') {\n xOrigin = 'center';\n } else if (this._isRtl()) {\n xOrigin = position.overlayX === 'start' ? 'right' : 'left';\n } else {\n xOrigin = position.overlayX === 'start' ? 'left' : 'right';\n }\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;\n }\n }\n\n /**\n * Gets the position and size of the overlay's sizing container.\n *\n * This method does no measuring and applies no styles so that we can cheaply compute the\n * bounds for all positions and choose the best fit based on these results.\n */\n private _calculateBoundingBoxRect(origin: Point, position: ConnectedPosition): BoundingBoxRect {\n const viewport = this._viewportRect;\n const isRtl = this._isRtl();\n let height: number, top: number, bottom: number;\n\n if (position.overlayY === 'top') {\n // Overlay is opening \"downward\" and thus is bound by the bottom viewport edge.\n top = origin.y;\n height = viewport.height - top + this._viewportMargin;\n } else if (position.overlayY === 'bottom') {\n // Overlay is opening \"upward\" and thus is bound by the top viewport edge. We need to add\n // the viewport margin back in, because the viewport rect is narrowed down to remove the\n // margin, whereas the `origin` position is calculated based on its `ClientRect`.\n bottom = viewport.height - origin.y + this._viewportMargin * 2;\n height = viewport.height - bottom + this._viewportMargin;\n } else {\n // If neither top nor bottom, it means that the overlay is vertically centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.bottom - origin.y` and\n // `origin.y - viewport.top`.\n const smallestDistanceToViewportEdge = Math.min(\n viewport.bottom - origin.y + viewport.top,\n origin.y,\n );\n\n const previousHeight = this._lastBoundingBoxSize.height;\n\n height = smallestDistanceToViewportEdge * 2;\n top = origin.y - smallestDistanceToViewportEdge;\n\n if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {\n top = origin.y - previousHeight / 2;\n }\n }\n\n // The overlay is opening 'right-ward' (the content flows to the right).\n const isBoundedByRightViewportEdge =\n (position.overlayX === 'start' && !isRtl) || (position.overlayX === 'end' && isRtl);\n\n // The overlay is opening 'left-ward' (the content flows to the left).\n const isBoundedByLeftViewportEdge =\n (position.overlayX === 'end' && !isRtl) || (position.overlayX === 'start' && isRtl);\n\n let width: number, left: number, right: number;\n\n if (isBoundedByLeftViewportEdge) {\n right = viewport.width - origin.x + this._viewportMargin;\n width = origin.x - this._viewportMargin;\n } else if (isBoundedByRightViewportEdge) {\n left = origin.x;\n width = viewport.right - origin.x;\n } else {\n // If neither start nor end, it means that the overlay is horizontally centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.right - origin.x` and\n // `origin.x - viewport.left`.\n const smallestDistanceToViewportEdge = Math.min(\n viewport.right - origin.x + viewport.left,\n origin.x,\n );\n const previousWidth = this._lastBoundingBoxSize.width;\n\n width = smallestDistanceToViewportEdge * 2;\n left = origin.x - smallestDistanceToViewportEdge;\n\n if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {\n left = origin.x - previousWidth / 2;\n }\n }\n\n return {top: top!, left: left!, bottom: bottom!, right: right!, width, height};\n }\n\n /**\n * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the\n * origin's connection point and stretches to the bounds of the viewport.\n *\n * @param origin The point on the origin element where the overlay is connected.\n * @param position The position preference\n */\n private _setBoundingBoxStyles(origin: Point, position: ConnectedPosition): void {\n const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);\n\n // It's weird if the overlay *grows* while scrolling, so we take the last size into account\n // when applying a new size.\n if (!this._isInitialRender && !this._growAfterOpen) {\n boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);\n boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);\n }\n\n const styles = {} as CSSStyleDeclaration;\n\n if (this._hasExactPosition()) {\n styles.top = styles.left = '0';\n styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = '';\n styles.width = styles.height = '100%';\n } else {\n const maxHeight = this._overlayRef.getConfig().maxHeight;\n const maxWidth = this._overlayRef.getConfig().maxWidth;\n\n styles.height = coerceCssPixelValue(boundingBoxRect.height);\n styles.top = coerceCssPixelValue(boundingBoxRect.top);\n styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom);\n styles.width = coerceCssPixelValue(boundingBoxRect.width);\n styles.left = coerceCssPixelValue(boundingBoxRect.left);\n styles.right = coerceCssPixelValue(boundingBoxRect.right);\n\n // Push the pane content towards the proper direction.\n if (position.overlayX === 'center') {\n styles.alignItems = 'center';\n } else {\n styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';\n }\n\n if (position.overlayY === 'center') {\n styles.justifyContent = 'center';\n } else {\n styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';\n }\n\n if (maxHeight) {\n styles.maxHeight = coerceCssPixelValue(maxHeight);\n }\n\n if (maxWidth) {\n styles.maxWidth = coerceCssPixelValue(maxWidth);\n }\n }\n\n this._lastBoundingBoxSize = boundingBoxRect;\n\n extendStyles(this._boundingBox!.style, styles);\n }\n\n /** Resets the styles for the bounding box so that a new positioning can be computed. */\n private _resetBoundingBoxStyles() {\n extendStyles(this._boundingBox!.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n } as CSSStyleDeclaration);\n }\n\n /** Resets the styles for the overlay pane so that a new positioning can be computed. */\n private _resetOverlayElementStyles() {\n extendStyles(this._pane.style, {\n top: '',\n left: '',\n bottom: '',\n right: '',\n position: '',\n transform: '',\n } as CSSStyleDeclaration);\n }\n\n /** Sets positioning styles to the overlay element. */\n private _setOverlayElementStyles(originPoint: Point, position: ConnectedPosition): void {\n const styles = {} as CSSStyleDeclaration;\n const hasExactPosition = this._hasExactPosition();\n const hasFlexibleDimensions = this._hasFlexibleDimensions;\n const config = this._overlayRef.getConfig();\n\n if (hasExactPosition) {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));\n extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));\n } else {\n styles.position = 'static';\n }\n\n // Use a transform to apply the offsets. We do this because the `center` positions rely on\n // being in the normal flex flow and setting a `top` / `left` at all will completely throw\n // off the position. We also can't use margins, because they won't have an effect in some\n // cases where the element doesn't have anything to \"push off of\". Finally, this works\n // better both with flexible and non-flexible positioning.\n let transformString = '';\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n\n if (offsetX) {\n transformString += `translateX(${offsetX}px) `;\n }\n\n if (offsetY) {\n transformString += `translateY(${offsetY}px)`;\n }\n\n styles.transform = transformString.trim();\n\n // If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because\n // we need these values to both be set to \"100%\" for the automatic flexible sizing to work.\n // The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint.\n // Note that this doesn't apply when we have an exact position, in which case we do want to\n // apply them because they'll be cleared from the bounding box.\n if (config.maxHeight) {\n if (hasExactPosition) {\n styles.maxHeight = coerceCssPixelValue(config.maxHeight);\n } else if (hasFlexibleDimensions) {\n styles.maxHeight = '';\n }\n }\n\n if (config.maxWidth) {\n if (hasExactPosition) {\n styles.maxWidth = coerceCssPixelValue(config.maxWidth);\n } else if (hasFlexibleDimensions) {\n styles.maxWidth = '';\n }\n }\n\n extendStyles(this._pane.style, styles);\n }\n\n /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */\n private _getExactOverlayY(\n position: ConnectedPosition,\n originPoint: Point,\n scrollPosition: ViewportScrollPosition,\n ) {\n // Reset any existing styles. This is necessary in case the\n // preferred position has changed since the last `apply`.\n let styles = {top: '', bottom: ''} as CSSStyleDeclaration;\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n\n // We want to set either `top` or `bottom` based on whether the overlay wants to appear\n // above or below the origin and the direction in which the element will expand.\n if (position.overlayY === 'bottom') {\n // When using `bottom`, we adjust the y position such that it is the distance\n // from the bottom of the viewport rather than the top.\n const documentHeight = this._document.documentElement!.clientHeight;\n styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;\n } else {\n styles.top = coerceCssPixelValue(overlayPoint.y);\n }\n\n return styles;\n }\n\n /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */\n private _getExactOverlayX(\n position: ConnectedPosition,\n originPoint: Point,\n scrollPosition: ViewportScrollPosition,\n ) {\n // Reset any existing styles. This is necessary in case the preferred position has\n // changed since the last `apply`.\n let styles = {left: '', right: ''} as CSSStyleDeclaration;\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n\n // We want to set either `left` or `right` based on whether the overlay wants to appear \"before\"\n // or \"after\" the origin, which determines the direction in which the element will expand.\n // For the horizontal axis, the meaning of \"before\" and \"after\" change based on whether the\n // page is in RTL or LTR.\n let horizontalStyleProperty: 'left' | 'right';\n\n if (this._isRtl()) {\n horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';\n } else {\n horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';\n }\n\n // When we're setting `right`, we adjust the x position such that it is the distance\n // from the right edge of the viewport rather than the left edge.\n if (horizontalStyleProperty === 'right') {\n const documentWidth = this._document.documentElement!.clientWidth;\n styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;\n } else {\n styles.left = coerceCssPixelValue(overlayPoint.x);\n }\n\n return styles;\n }\n\n /**\n * Gets the view properties of the trigger and overlay, including whether they are clipped\n * or completely outside the view of any of the strategy's scrollables.\n */\n private _getScrollVisibility(): ScrollingVisibility {\n // Note: needs fresh rects since the position could've changed.\n const originBounds = this._getOriginRect();\n const overlayBounds = this._pane.getBoundingClientRect();\n\n // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers\n // every time, we should be able to use the scrollTop of the containers if the size of those\n // containers hasn't changed.\n const scrollContainerBounds = this._scrollables.map(scrollable => {\n return scrollable.getElementRef().nativeElement.getBoundingClientRect();\n });\n\n return {\n isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),\n isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),\n isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),\n isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),\n };\n }\n\n /** Subtracts the amount that an element is overflowing on an axis from its length. */\n private _subtractOverflows(length: number, ...overflows: number[]): number {\n return overflows.reduce((currentValue: number, currentOverflow: number) => {\n return currentValue - Math.max(currentOverflow, 0);\n }, length);\n }\n\n /** Narrows the given viewport rect by the current _viewportMargin. */\n private _getNarrowedViewportRect(): Dimensions {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement!.clientWidth;\n const height = this._document.documentElement!.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n\n return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - 2 * this._viewportMargin,\n height: height - 2 * this._viewportMargin,\n };\n }\n\n /** Whether the we're dealing with an RTL context */\n private _isRtl() {\n return this._overlayRef.getDirection() === 'rtl';\n }\n\n /** Determines whether the overlay uses exact or flexible positioning. */\n private _hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }\n\n /** Retrieves the offset of a position along the x or y axis. */\n private _getOffset(position: ConnectedPosition, axis: 'x' | 'y') {\n if (axis === 'x') {\n // We don't do something like `position['offset' + axis]` in\n // order to avoid breaking minifiers that rename properties.\n return position.offsetX == null ? this._offsetX : position.offsetX;\n }\n\n return position.offsetY == null ? this._offsetY : position.offsetY;\n }\n\n /** Validates that the current position match the expected values. */\n private _validatePositions(): void {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._preferredPositions.length) {\n throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');\n }\n\n // TODO(crisbeto): remove these once Angular's template type\n // checking is advanced enough to catch these cases.\n this._preferredPositions.forEach(pair => {\n validateHorizontalPosition('originX', pair.originX);\n validateVerticalPosition('originY', pair.originY);\n validateHorizontalPosition('overlayX', pair.overlayX);\n validateVerticalPosition('overlayY', pair.overlayY);\n });\n }\n }\n\n /** Adds a single CSS class or an array of classes on the overlay panel. */\n private _addPanelClasses(cssClasses: string | string[]) {\n if (this._pane) {\n coerceArray(cssClasses).forEach(cssClass => {\n if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) {\n this._appliedPanelClasses.push(cssClass);\n this._pane.classList.add(cssClass);\n }\n });\n }\n }\n\n /** Clears the classes that the position strategy has applied from the overlay panel. */\n private _clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }\n\n /** Returns the ClientRect of the current origin. */\n private _getOriginRect(): Dimensions {\n const origin = this._origin;\n\n if (origin instanceof ElementRef) {\n return origin.nativeElement.getBoundingClientRect();\n }\n\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n\n const width = origin.width || 0;\n const height = origin.height || 0;\n\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width,\n };\n }\n}\n\n/** A simple (x, y) coordinate. */\ninterface Point {\n x: number;\n y: number;\n}\n\n/** Record of measurements for how an overlay (at a given position) fits into the viewport. */\ninterface OverlayFit {\n /** Whether the overlay fits completely in the viewport. */\n isCompletelyWithinViewport: boolean;\n\n /** Whether the overlay fits in the viewport on the y-axis. */\n fitsInViewportVertically: boolean;\n\n /** Whether the overlay fits in the viewport on the x-axis. */\n fitsInViewportHorizontally: boolean;\n\n /** The total visible area (in px^2) of the overlay inside the viewport. */\n visibleArea: number;\n}\n\n/** Record of the measurements determining whether an overlay will fit in a specific position. */\ninterface FallbackPosition {\n position: ConnectedPosition;\n originPoint: Point;\n overlayPoint: Point;\n overlayFit: OverlayFit;\n overlayRect: Dimensions;\n}\n\n/** Position and size of the overlay sizing wrapper for a specific position. */\ninterface BoundingBoxRect {\n top: number;\n left: number;\n bottom: number;\n right: number;\n height: number;\n width: number;\n}\n\n/** Record of measures determining how well a given position will fit with flexible dimensions. */\ninterface FlexibleFit {\n position: ConnectedPosition;\n origin: Point;\n overlayRect: Dimensions;\n boundingBoxRect: BoundingBoxRect;\n}\n\n/** A connected position as specified by the user. */\nexport interface ConnectedPosition {\n originX: 'start' | 'center' | 'end';\n originY: 'top' | 'center' | 'bottom';\n\n overlayX: 'start' | 'center' | 'end';\n overlayY: 'top' | 'center' | 'bottom';\n\n weight?: number;\n offsetX?: number;\n offsetY?: number;\n panelClass?: string | string[];\n}\n\n/** Shallow-extends a stylesheet object with another stylesheet object. */\nfunction extendStyles(\n destination: CSSStyleDeclaration,\n source: CSSStyleDeclaration,\n): CSSStyleDeclaration {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n\n return destination;\n}\n\n/**\n * Extracts the pixel value as a number from a value, if it's a number\n * or a CSS pixel string (e.g. `1337px`). Otherwise returns null.\n */\nfunction getPixelValue(input: number | string | null | undefined): number | null {\n if (typeof input !== 'number' && input != null) {\n const [value, units] = input.split(cssUnitPattern);\n return !units || units === 'px' ? parseFloat(value) : null;\n }\n\n return input || null;\n}\n\n/**\n * Gets a version of an element's bounding `ClientRect` where all the values are rounded down to\n * the nearest pixel. This allows us to account for the cases where there may be sub-pixel\n * deviations in the `ClientRect` returned by the browser (e.g. when zoomed in with a percentage\n * size, see #21350).\n */\nfunction getRoundedBoundingClientRect(clientRect: Dimensions): Dimensions {\n return {\n top: Math.floor(clientRect.top),\n right: Math.floor(clientRect.right),\n bottom: Math.floor(clientRect.bottom),\n left: Math.floor(clientRect.left),\n width: Math.floor(clientRect.width),\n height: Math.floor(clientRect.height),\n };\n}\n\nexport const STANDARD_DROPDOWN_BELOW_POSITIONS: ConnectedPosition[] = [\n {originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top'},\n {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top'},\n {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom'},\n];\n\nexport const STANDARD_DROPDOWN_ADJACENT_POSITIONS: ConnectedPosition[] = [\n {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom'},\n {originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top'},\n {originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom'},\n];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PositionStrategy} from './position-strategy';\nimport {OverlayReference} from '../overlay-reference';\n\n/** Class to be added to the overlay pane wrapper. */\nconst wrapperClass = 'cdk-global-overlay-wrapper';\n\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * explicit position relative to the browser's viewport. We use flexbox, instead of\n * transforms, in order to avoid issues with subpixel rendering which can cause the\n * element to become blurry.\n */\nexport class GlobalPositionStrategy implements PositionStrategy {\n /** The overlay to which this strategy is attached. */\n private _overlayRef: OverlayReference;\n private _cssPosition = 'static';\n private _topOffset = '';\n private _bottomOffset = '';\n private _alignItems = '';\n private _xPosition = '';\n private _xOffset = '';\n private _width = '';\n private _height = '';\n private _isDisposed = false;\n\n attach(overlayRef: OverlayReference): void {\n const config = overlayRef.getConfig();\n\n this._overlayRef = overlayRef;\n\n if (this._width && !config.width) {\n overlayRef.updateSize({width: this._width});\n }\n\n if (this._height && !config.height) {\n overlayRef.updateSize({height: this._height});\n }\n\n overlayRef.hostElement.classList.add(wrapperClass);\n this._isDisposed = false;\n }\n\n /**\n * Sets the top position of the overlay. Clears any previously set vertical position.\n * @param value New top offset.\n */\n top(value: string = ''): this {\n this._bottomOffset = '';\n this._topOffset = value;\n this._alignItems = 'flex-start';\n return this;\n }\n\n /**\n * Sets the left position of the overlay. Clears any previously set horizontal position.\n * @param value New left offset.\n */\n left(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'left';\n return this;\n }\n\n /**\n * Sets the bottom position of the overlay. Clears any previously set vertical position.\n * @param value New bottom offset.\n */\n bottom(value: string = ''): this {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }\n\n /**\n * Sets the right position of the overlay. Clears any previously set horizontal position.\n * @param value New right offset.\n */\n right(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'right';\n return this;\n }\n\n /**\n * Sets the overlay to the start of the viewport, depending on the overlay direction.\n * This will be to the left in LTR layouts and to the right in RTL.\n * @param offset Offset from the edge of the screen.\n */\n start(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'start';\n return this;\n }\n\n /**\n * Sets the overlay to the end of the viewport, depending on the overlay direction.\n * This will be to the right in LTR layouts and to the left in RTL.\n * @param offset Offset from the edge of the screen.\n */\n end(value: string = ''): this {\n this._xOffset = value;\n this._xPosition = 'end';\n return this;\n }\n\n /**\n * Sets the overlay width and clears any previously set width.\n * @param value New width for the overlay\n * @deprecated Pass the `width` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n width(value: string = ''): this {\n if (this._overlayRef) {\n this._overlayRef.updateSize({width: value});\n } else {\n this._width = value;\n }\n\n return this;\n }\n\n /**\n * Sets the overlay height and clears any previously set height.\n * @param value New height for the overlay\n * @deprecated Pass the `height` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n height(value: string = ''): this {\n if (this._overlayRef) {\n this._overlayRef.updateSize({height: value});\n } else {\n this._height = value;\n }\n\n return this;\n }\n\n /**\n * Centers the overlay horizontally with an optional offset.\n * Clears any previously set horizontal position.\n *\n * @param offset Overlay offset from the horizontal center.\n */\n centerHorizontally(offset: string = ''): this {\n this.left(offset);\n this._xPosition = 'center';\n return this;\n }\n\n /**\n * Centers the overlay vertically with an optional offset.\n * Clears any previously set vertical position.\n *\n * @param offset Overlay offset from the vertical center.\n */\n centerVertically(offset: string = ''): this {\n this.top(offset);\n this._alignItems = 'center';\n return this;\n }\n\n /**\n * Apply the position to the element.\n * @docs-private\n */\n apply(): void {\n // Since the overlay ref applies the strategy asynchronously, it could\n // have been disposed before it ends up being applied. If that is the\n // case, we shouldn't do anything.\n if (!this._overlayRef || !this._overlayRef.hasAttached()) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parentStyles = this._overlayRef.hostElement.style;\n const config = this._overlayRef.getConfig();\n const {width, height, maxWidth, maxHeight} = config;\n const shouldBeFlushHorizontally =\n (width === '100%' || width === '100vw') &&\n (!maxWidth || maxWidth === '100%' || maxWidth === '100vw');\n const shouldBeFlushVertically =\n (height === '100%' || height === '100vh') &&\n (!maxHeight || maxHeight === '100%' || maxHeight === '100vh');\n const xPosition = this._xPosition;\n const xOffset = this._xOffset;\n const isRtl = this._overlayRef.getConfig().direction === 'rtl';\n let marginLeft = '';\n let marginRight = '';\n let justifyContent = '';\n\n if (shouldBeFlushHorizontally) {\n justifyContent = 'flex-start';\n } else if (xPosition === 'center') {\n justifyContent = 'center';\n\n if (isRtl) {\n marginRight = xOffset;\n } else {\n marginLeft = xOffset;\n }\n } else if (isRtl) {\n if (xPosition === 'left' || xPosition === 'end') {\n justifyContent = 'flex-end';\n marginLeft = xOffset;\n } else if (xPosition === 'right' || xPosition === 'start') {\n justifyContent = 'flex-start';\n marginRight = xOffset;\n }\n } else if (xPosition === 'left' || xPosition === 'start') {\n justifyContent = 'flex-start';\n marginLeft = xOffset;\n } else if (xPosition === 'right' || xPosition === 'end') {\n justifyContent = 'flex-end';\n marginRight = xOffset;\n }\n\n styles.position = this._cssPosition;\n styles.marginLeft = shouldBeFlushHorizontally ? '0' : marginLeft;\n styles.marginTop = shouldBeFlushVertically ? '0' : this._topOffset;\n styles.marginBottom = this._bottomOffset;\n styles.marginRight = shouldBeFlushHorizontally ? '0' : marginRight;\n parentStyles.justifyContent = justifyContent;\n parentStyles.alignItems = shouldBeFlushVertically ? 'flex-start' : this._alignItems;\n }\n\n /**\n * Cleans up the DOM changes from the position strategy.\n * @docs-private\n */\n dispose(): void {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent =\n parentStyles.alignItems =\n styles.marginTop =\n styles.marginBottom =\n styles.marginLeft =\n styles.marginRight =\n styles.position =\n '';\n\n this._overlayRef = null!;\n this._isDisposed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {OverlayContainer} from '../overlay-container';\nimport {\n FlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategyOrigin,\n} from './flexible-connected-position-strategy';\nimport {GlobalPositionStrategy} from './global-position-strategy';\n\n/** Builder for overlay position strategy. */\n@Injectable({providedIn: 'root'})\nexport class OverlayPositionBuilder {\n constructor(\n private _viewportRuler: ViewportRuler,\n @Inject(DOCUMENT) private _document: any,\n private _platform: Platform,\n private _overlayContainer: OverlayContainer,\n ) {}\n\n /**\n * Creates a global position strategy.\n */\n global(): GlobalPositionStrategy {\n return new GlobalPositionStrategy();\n }\n\n /**\n * Creates a flexible position strategy.\n * @param origin Origin relative to which to position the overlay.\n */\n flexibleConnectedTo(\n origin: FlexibleConnectedPositionStrategyOrigin,\n ): FlexibleConnectedPositionStrategy {\n return new FlexibleConnectedPositionStrategy(\n origin,\n this._viewportRuler,\n this._document,\n this._platform,\n this._overlayContainer,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {DomPortalOutlet} from '@angular/cdk/portal';\nimport {DOCUMENT, Location} from '@angular/common';\nimport {\n ApplicationRef,\n ComponentFactoryResolver,\n Inject,\n Injectable,\n Injector,\n NgZone,\n ANIMATION_MODULE_TYPE,\n Optional,\n} from '@angular/core';\nimport {OverlayKeyboardDispatcher} from './dispatchers/overlay-keyboard-dispatcher';\nimport {OverlayOutsideClickDispatcher} from './dispatchers/overlay-outside-click-dispatcher';\nimport {OverlayConfig} from './overlay-config';\nimport {OverlayContainer} from './overlay-container';\nimport {OverlayRef} from './overlay-ref';\nimport {OverlayPositionBuilder} from './position/overlay-position-builder';\nimport {ScrollStrategyOptions} from './scroll/index';\n\n/** Next overlay unique ID. */\nlet nextUniqueId = 0;\n\n// Note that Overlay is *not* scoped to the app root because of the ComponentFactoryResolver\n// which needs to be different depending on where OverlayModule is imported.\n\n/**\n * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be\n * used as a low-level building block for other components. Dialogs, tooltips, menus,\n * selects, etc. can all be built using overlays. The service should primarily be used by authors\n * of re-usable components rather than developers building end-user applications.\n *\n * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.\n */\n@Injectable({providedIn: 'root'})\nexport class Overlay {\n private _appRef: ApplicationRef;\n\n constructor(\n /** Scrolling strategies that can be used when creating an overlay. */\n public scrollStrategies: ScrollStrategyOptions,\n private _overlayContainer: OverlayContainer,\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _positionBuilder: OverlayPositionBuilder,\n private _keyboardDispatcher: OverlayKeyboardDispatcher,\n private _injector: Injector,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) private _document: any,\n private _directionality: Directionality,\n private _location: Location,\n private _outsideClickDispatcher: OverlayOutsideClickDispatcher,\n @Inject(ANIMATION_MODULE_TYPE) @Optional() private _animationsModuleType?: string,\n ) {}\n\n /**\n * Creates an overlay.\n * @param config Configuration applied to the overlay.\n * @returns Reference to the created overlay.\n */\n create(config?: OverlayConfig): OverlayRef {\n const host = this._createHostElement();\n const pane = this._createPaneElement(host);\n const portalOutlet = this._createPortalOutlet(pane);\n const overlayConfig = new OverlayConfig(config);\n\n overlayConfig.direction = overlayConfig.direction || this._directionality.value;\n\n return new OverlayRef(\n portalOutlet,\n host,\n pane,\n overlayConfig,\n this._ngZone,\n this._keyboardDispatcher,\n this._document,\n this._location,\n this._outsideClickDispatcher,\n this._animationsModuleType === 'NoopAnimations',\n );\n }\n\n /**\n * Gets a position builder that can be used, via fluent API,\n * to construct and configure a position strategy.\n * @returns An overlay position builder.\n */\n position(): OverlayPositionBuilder {\n return this._positionBuilder;\n }\n\n /**\n * Creates the DOM element for an overlay and appends it to the overlay container.\n * @returns Newly-created pane element\n */\n private _createPaneElement(host: HTMLElement): HTMLElement {\n const pane = this._document.createElement('div');\n\n pane.id = `cdk-overlay-${nextUniqueId++}`;\n pane.classList.add('cdk-overlay-pane');\n host.appendChild(pane);\n\n return pane;\n }\n\n /**\n * Creates the host element that wraps around an overlay\n * and can be used for advanced positioning.\n * @returns Newly-create host element.\n */\n private _createHostElement(): HTMLElement {\n const host = this._document.createElement('div');\n this._overlayContainer.getContainerElement().appendChild(host);\n return host;\n }\n\n /**\n * Create a DomPortalOutlet into which the overlay content can be loaded.\n * @param pane The DOM element to turn into a portal outlet.\n * @returns A portal outlet for the given DOM element.\n */\n private _createPortalOutlet(pane: HTMLElement): DomPortalOutlet {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get<ApplicationRef>(ApplicationRef);\n }\n\n return new DomPortalOutlet(\n pane,\n this._componentFactoryResolver,\n this._appRef,\n this._injector,\n this._document,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {takeWhile} from 'rxjs/operators';\nimport {Overlay} from './overlay';\nimport {OverlayConfig} from './overlay-config';\nimport {OverlayRef} from './overlay-ref';\nimport {ConnectedOverlayPositionChange} from './position/connected-position';\nimport {\n ConnectedPosition,\n FlexibleConnectedPositionStrategy,\n FlexibleConnectedPositionStrategyOrigin,\n} from './position/flexible-connected-position-strategy';\nimport {RepositionScrollStrategy, ScrollStrategy} from './scroll/index';\n\n/** Default set of positions for the overlay. Follows the behavior of a dropdown. */\nconst defaultPositionList: ConnectedPosition[] = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n },\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n },\n];\n\n/** Injection token that determines the scroll handling while the connected overlay is open. */\nexport const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'cdk-connected-overlay-scroll-strategy',\n);\n\n/**\n * Directive applied to an element to make it usable as an origin for an Overlay using a\n * ConnectedPositionStrategy.\n */\n@Directive({\n selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',\n exportAs: 'cdkOverlayOrigin',\n standalone: true,\n})\nexport class CdkOverlayOrigin {\n constructor(\n /** Reference to the element on which the directive is applied. */\n public elementRef: ElementRef,\n ) {}\n}\n\n/**\n * Directive to facilitate declarative creation of an\n * Overlay using a FlexibleConnectedPositionStrategy.\n */\n@Directive({\n selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',\n exportAs: 'cdkConnectedOverlay',\n standalone: true,\n})\nexport class CdkConnectedOverlay implements OnDestroy, OnChanges {\n private _overlayRef: OverlayRef;\n private _templatePortal: TemplatePortal;\n private _hasBackdrop = false;\n private _lockPosition = false;\n private _growAfterOpen = false;\n private _flexibleDimensions = false;\n private _push = false;\n private _backdropSubscription = Subscription.EMPTY;\n private _attachSubscription = Subscription.EMPTY;\n private _detachSubscription = Subscription.EMPTY;\n private _positionSubscription = Subscription.EMPTY;\n private _offsetX: number;\n private _offsetY: number;\n private _position: FlexibleConnectedPositionStrategy;\n private _scrollStrategyFactory: () => ScrollStrategy;\n\n /** Origin for the connected overlay. */\n @Input('cdkConnectedOverlayOrigin')\n origin: CdkOverlayOrigin | FlexibleConnectedPositionStrategyOrigin;\n\n /** Registered connected position pairs. */\n @Input('cdkConnectedOverlayPositions') positions: ConnectedPosition[];\n\n /**\n * This input overrides the positions input if specified. It lets users pass\n * in arbitrary positioning strategies.\n */\n @Input('cdkConnectedOverlayPositionStrategy') positionStrategy: FlexibleConnectedPositionStrategy;\n\n /** The offset in pixels for the overlay connection point on the x-axis */\n @Input('cdkConnectedOverlayOffsetX')\n get offsetX(): number {\n return this._offsetX;\n }\n set offsetX(offsetX: number) {\n this._offsetX = offsetX;\n\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n\n /** The offset in pixels for the overlay connection point on the y-axis */\n @Input('cdkConnectedOverlayOffsetY')\n get offsetY() {\n return this._offsetY;\n }\n set offsetY(offsetY: number) {\n this._offsetY = offsetY;\n\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n\n /** The width of the overlay panel. */\n @Input('cdkConnectedOverlayWidth') width: number | string;\n\n /** The height of the overlay panel. */\n @Input('cdkConnectedOverlayHeight') height: number | string;\n\n /** The min width of the overlay panel. */\n @Input('cdkConnectedOverlayMinWidth') minWidth: number | string;\n\n /** The min height of the overlay panel. */\n @Input('cdkConnectedOverlayMinHeight') minHeight: number | string;\n\n /** The custom class to be set on the backdrop element. */\n @Input('cdkConnectedOverlayBackdropClass') backdropClass: string | string[];\n\n /** The custom class to add to the overlay pane element. */\n @Input('cdkConnectedOverlayPanelClass') panelClass: string | string[];\n\n /** Margin between the overlay and the viewport edges. */\n @Input('cdkConnectedOverlayViewportMargin') viewportMargin: number = 0;\n\n /** Strategy to be used when handling scroll events while the overlay is open. */\n @Input('cdkConnectedOverlayScrollStrategy') scrollStrategy: ScrollStrategy;\n\n /** Whether the overlay is open. */\n @Input('cdkConnectedOverlayOpen') open: boolean = false;\n\n /** Whether the overlay can be closed by user interaction. */\n @Input('cdkConnectedOverlayDisableClose') disableClose: boolean = false;\n\n /** CSS selector which to set the transform origin. */\n @Input('cdkConnectedOverlayTransformOriginOn') transformOriginSelector: string;\n\n /** Whether or not the overlay should attach a backdrop. */\n @Input('cdkConnectedOverlayHasBackdrop')\n get hasBackdrop(): boolean {\n return this._hasBackdrop;\n }\n set hasBackdrop(value: BooleanInput) {\n this._hasBackdrop = coerceBooleanProperty(value);\n }\n\n /** Whether or not the overlay should be locked when scrolling. */\n @Input('cdkConnectedOverlayLockPosition')\n get lockPosition(): boolean {\n return this._lockPosition;\n }\n set lockPosition(value: BooleanInput) {\n this._lockPosition = coerceBooleanProperty(value);\n }\n\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n @Input('cdkConnectedOverlayFlexibleDimensions')\n get flexibleDimensions(): boolean {\n return this._flexibleDimensions;\n }\n set flexibleDimensions(value: BooleanInput) {\n this._flexibleDimensions = coerceBooleanProperty(value);\n }\n\n /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */\n @Input('cdkConnectedOverlayGrowAfterOpen')\n get growAfterOpen(): boolean {\n return this._growAfterOpen;\n }\n set growAfterOpen(value: BooleanInput) {\n this._growAfterOpen = coerceBooleanProperty(value);\n }\n\n /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */\n @Input('cdkConnectedOverlayPush')\n get push(): boolean {\n return this._push;\n }\n set push(value: BooleanInput) {\n this._push = coerceBooleanProperty(value);\n }\n\n /** Event emitted when the backdrop is clicked. */\n @Output() readonly backdropClick = new EventEmitter<MouseEvent>();\n\n /** Event emitted when the position has changed. */\n @Output() readonly positionChange = new EventEmitter<ConnectedOverlayPositionChange>();\n\n /** Event emitted when the overlay has been attached. */\n @Output() readonly attach = new EventEmitter<void>();\n\n /** Event emitted when the overlay has been detached. */\n @Output() readonly detach = new EventEmitter<void>();\n\n /** Emits when there are keyboard events that are targeted at the overlay. */\n @Output() readonly overlayKeydown = new EventEmitter<KeyboardEvent>();\n\n /** Emits when there are mouse outside click events that are targeted at the overlay. */\n @Output() readonly overlayOutsideClick = new EventEmitter<MouseEvent>();\n\n // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.\n\n constructor(\n private _overlay: Overlay,\n templateRef: TemplateRef<any>,\n viewContainerRef: ViewContainerRef,\n @Inject(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY) scrollStrategyFactory: any,\n @Optional() private _dir: Directionality,\n ) {\n this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);\n this._scrollStrategyFactory = scrollStrategyFactory;\n this.scrollStrategy = this._scrollStrategyFactory();\n }\n\n /** The associated overlay reference. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\n\n /** The element's layout direction. */\n get dir(): Direction {\n return this._dir ? this._dir.value : 'ltr';\n }\n\n ngOnDestroy() {\n this._attachSubscription.unsubscribe();\n this._detachSubscription.unsubscribe();\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n\n if (this._overlayRef) {\n this._overlayRef.dispose();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this._position) {\n this._updatePositionStrategy(this._position);\n this._overlayRef.updateSize({\n width: this.width,\n minWidth: this.minWidth,\n height: this.height,\n minHeight: this.minHeight,\n });\n\n if (changes['origin'] && this.open) {\n this._position.apply();\n }\n }\n\n if (changes['open']) {\n this.open ? this._attachOverlay() : this._detachOverlay();\n }\n }\n\n /** Creates an overlay */\n private _createOverlay() {\n if (!this.positions || !this.positions.length) {\n this.positions = defaultPositionList;\n }\n\n const overlayRef = (this._overlayRef = this._overlay.create(this._buildConfig()));\n this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit());\n this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit());\n overlayRef.keydownEvents().subscribe((event: KeyboardEvent) => {\n this.overlayKeydown.next(event);\n\n if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {\n event.preventDefault();\n this._detachOverlay();\n }\n });\n\n this._overlayRef.outsidePointerEvents().subscribe((event: MouseEvent) => {\n this.overlayOutsideClick.next(event);\n });\n }\n\n /** Builds the overlay config based on the directive's inputs */\n private _buildConfig(): OverlayConfig {\n const positionStrategy = (this._position =\n this.positionStrategy || this._createPositionStrategy());\n const overlayConfig = new OverlayConfig({\n direction: this._dir,\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n hasBackdrop: this.hasBackdrop,\n });\n\n if (this.width || this.width === 0) {\n overlayConfig.width = this.width;\n }\n\n if (this.height || this.height === 0) {\n overlayConfig.height = this.height;\n }\n\n if (this.minWidth || this.minWidth === 0) {\n overlayConfig.minWidth = this.minWidth;\n }\n\n if (this.minHeight || this.minHeight === 0) {\n overlayConfig.minHeight = this.minHeight;\n }\n\n if (this.backdropClass) {\n overlayConfig.backdropClass = this.backdropClass;\n }\n\n if (this.panelClass) {\n overlayConfig.panelClass = this.panelClass;\n }\n\n return overlayConfig;\n }\n\n /** Updates the state of a position strategy, based on the values of the directive inputs. */\n private _updatePositionStrategy(positionStrategy: FlexibleConnectedPositionStrategy) {\n const positions: ConnectedPosition[] = this.positions.map(currentPosition => ({\n originX: currentPosition.originX,\n originY: currentPosition.originY,\n overlayX: currentPosition.overlayX,\n overlayY: currentPosition.overlayY,\n offsetX: currentPosition.offsetX || this.offsetX,\n offsetY: currentPosition.offsetY || this.offsetY,\n panelClass: currentPosition.panelClass || undefined,\n }));\n\n return positionStrategy\n .setOrigin(this._getFlexibleConnectedPositionStrategyOrigin())\n .withPositions(positions)\n .withFlexibleDimensions(this.flexibleDimensions)\n .withPush(this.push)\n .withGrowAfterOpen(this.growAfterOpen)\n .withViewportMargin(this.viewportMargin)\n .withLockedPosition(this.lockPosition)\n .withTransformOriginOn(this.transformOriginSelector);\n }\n\n /** Returns the position strategy of the overlay to be set on the overlay config */\n private _createPositionStrategy(): FlexibleConnectedPositionStrategy {\n const strategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());\n this._updatePositionStrategy(strategy);\n return strategy;\n }\n\n private _getFlexibleConnectedPositionStrategyOrigin(): FlexibleConnectedPositionStrategyOrigin {\n if (this.origin instanceof CdkOverlayOrigin) {\n return this.origin.elementRef;\n } else {\n return this.origin;\n }\n }\n\n /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */\n private _attachOverlay() {\n if (!this._overlayRef) {\n this._createOverlay();\n } else {\n // Update the overlay size, in case the directive's inputs have changed\n this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;\n }\n\n if (!this._overlayRef.hasAttached()) {\n this._overlayRef.attach(this._templatePortal);\n }\n\n if (this.hasBackdrop) {\n this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {\n this.backdropClick.emit(event);\n });\n } else {\n this._backdropSubscription.unsubscribe();\n }\n\n this._positionSubscription.unsubscribe();\n\n // Only subscribe to `positionChanges` if requested, because putting\n // together all the information for it can be expensive.\n if (this.positionChange.observers.length > 0) {\n this._positionSubscription = this._position.positionChanges\n .pipe(takeWhile(() => this.positionChange.observers.length > 0))\n .subscribe(position => {\n this.positionChange.emit(position);\n\n if (this.positionChange.observers.length === 0) {\n this._positionSubscription.unsubscribe();\n }\n });\n }\n }\n\n /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */\n private _detachOverlay() {\n if (this._overlayRef) {\n this._overlayRef.detach();\n }\n\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n }\n}\n\n/** @docs-private */\nexport function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(\n overlay: Overlay,\n): () => RepositionScrollStrategy {\n return () => overlay.scrollStrategies.reposition();\n}\n\n/** @docs-private */\nexport const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {\n provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY,\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {ScrollingModule} from '@angular/cdk/scrolling';\nimport {NgModule} from '@angular/core';\nimport {Overlay} from './overlay';\nimport {\n CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,\n CdkConnectedOverlay,\n CdkOverlayOrigin,\n} from './overlay-directives';\n\n@NgModule({\n imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],\n exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],\n providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER],\n})\nexport class OverlayModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n AfterViewInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n forwardRef,\n Host,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Optional,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOWN_ARROW, ENTER, ESCAPE, TAB, UP_ARROW, hasModifierKey} from '@angular/cdk/keycodes';\nimport {_getEventTarget} from '@angular/cdk/platform';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayConfig,\n OverlayRef,\n PositionStrategy,\n ScrollStrategy,\n ConnectedPosition,\n} from '@angular/cdk/overlay';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n MatOptionSelectionChange,\n _countGroupLabelsBeforeOption,\n _getOptionScrollPosition,\n _MatOptionBase,\n} from '@angular/material/core';\nimport {MAT_FORM_FIELD, MatFormField} from '@angular/material/form-field';\nimport {defer, fromEvent, merge, Observable, of as observableOf, Subject, Subscription} from 'rxjs';\nimport {delay, filter, map, switchMap, take, tap, startWith} from 'rxjs/operators';\nimport {_MatAutocompleteOriginBase} from './autocomplete-origin';\nimport {\n MatAutocompleteDefaultOptions,\n MAT_AUTOCOMPLETE_DEFAULT_OPTIONS,\n _MatAutocompleteBase,\n} from './autocomplete';\n\n/**\n * Provider that allows the autocomplete to register as a ControlValueAccessor.\n * @docs-private\n */\nexport const MAT_AUTOCOMPLETE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatAutocompleteTrigger),\n multi: true,\n};\n\n/**\n * Creates an error to be thrown when attempting to use an autocomplete trigger without a panel.\n * @docs-private\n */\nexport function getMatAutocompleteMissingPanelError(): Error {\n return Error(\n 'Attempting to open an undefined instance of `mat-autocomplete`. ' +\n 'Make sure that the id passed to the `matAutocomplete` is correct and that ' +\n \"you're attempting to open it after the ngAfterContentInit hook.\",\n );\n}\n\n/** Injection token that determines the scroll handling while the autocomplete panel is open. */\nexport const MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'mat-autocomplete-scroll-strategy',\n);\n\n/** @docs-private */\nexport function MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy {\n return () => overlay.scrollStrategies.reposition();\n}\n\n/** @docs-private */\nexport const MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER = {\n provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY,\n};\n\n/** Base class with all of the `MatAutocompleteTrigger` functionality. */\n@Directive()\nexport abstract class _MatAutocompleteTriggerBase\n implements ControlValueAccessor, AfterViewInit, OnChanges, OnDestroy\n{\n private _overlayRef: OverlayRef | null;\n private _portal: TemplatePortal;\n private _componentDestroyed = false;\n private _autocompleteDisabled = false;\n private _scrollStrategy: () => ScrollStrategy;\n\n /** Old value of the native input. Used to work around issues with the `input` event on IE. */\n private _previousValue: string | number | null;\n\n /** Strategy that is used to position the panel. */\n private _positionStrategy: FlexibleConnectedPositionStrategy;\n\n /** Whether or not the label state is being overridden. */\n private _manuallyFloatingLabel = false;\n\n /** The subscription for closing actions (some are bound to document). */\n private _closingActionsSubscription: Subscription;\n\n /** Subscription to viewport size changes. */\n private _viewportSubscription = Subscription.EMPTY;\n\n /**\n * Whether the autocomplete can open the next time it is focused. Used to prevent a focused,\n * closed autocomplete from being reopened if the user switches to another browser tab and then\n * comes back.\n */\n private _canOpenOnNextFocus = true;\n\n /** Value inside the input before we auto-selected an option. */\n private _valueBeforeAutoSelection: string | undefined;\n\n /**\n * Current option that we have auto-selected as the user is navigating,\n * but which hasn't been propagated to the model value yet.\n */\n private _pendingAutoselectedOption: _MatOptionBase | null;\n\n /** Stream of keyboard events that can close the panel. */\n private readonly _closeKeyEventStream = new Subject<void>();\n\n /**\n * Event handler for when the window is blurred. Needs to be an\n * arrow function in order to preserve the context.\n */\n private _windowBlurHandler = () => {\n // If the user blurred the window while the autocomplete is focused, it means that it'll be\n // refocused when they come back. In this case we want to skip the first focus event, if the\n // pane was closed, in order to avoid reopening it unintentionally.\n this._canOpenOnNextFocus =\n this._document.activeElement !== this._element.nativeElement || this.panelOpen;\n };\n\n /** `View -> model callback called when value changes` */\n _onChange: (value: any) => void = () => {};\n\n /** `View -> model callback called when autocomplete has been touched` */\n _onTouched = () => {};\n\n /** The autocomplete panel to be attached to this trigger. */\n @Input('matAutocomplete') autocomplete: _MatAutocompleteBase;\n\n /**\n * Position of the autocomplete panel relative to the trigger element. A position of `auto`\n * will render the panel underneath the trigger if there is enough space for it to fit in\n * the viewport, otherwise the panel will be shown above it. If the position is set to\n * `above` or `below`, the panel will always be shown above or below the trigger. no matter\n * whether it fits completely in the viewport.\n */\n @Input('matAutocompletePosition') position: 'auto' | 'above' | 'below' = 'auto';\n\n /**\n * Reference relative to which to position the autocomplete panel.\n * Defaults to the autocomplete trigger element.\n */\n @Input('matAutocompleteConnectedTo') connectedTo: _MatAutocompleteOriginBase;\n\n /**\n * `autocomplete` attribute to be set on the input element.\n * @docs-private\n */\n @Input('autocomplete') autocompleteAttribute: string = 'off';\n\n /**\n * Whether the autocomplete is disabled. When disabled, the element will\n * act as a regular input and the user won't be able to open the panel.\n */\n @Input('matAutocompleteDisabled')\n get autocompleteDisabled(): boolean {\n return this._autocompleteDisabled;\n }\n set autocompleteDisabled(value: BooleanInput) {\n this._autocompleteDisabled = coerceBooleanProperty(value);\n }\n\n constructor(\n private _element: ElementRef<HTMLInputElement>,\n private _overlay: Overlay,\n private _viewContainerRef: ViewContainerRef,\n private _zone: NgZone,\n private _changeDetectorRef: ChangeDetectorRef,\n @Inject(MAT_AUTOCOMPLETE_SCROLL_STRATEGY) scrollStrategy: any,\n @Optional() private _dir: Directionality | null,\n @Optional() @Inject(MAT_FORM_FIELD) @Host() private _formField: MatFormField | null,\n @Optional() @Inject(DOCUMENT) private _document: any,\n private _viewportRuler: ViewportRuler,\n @Optional()\n @Inject(MAT_AUTOCOMPLETE_DEFAULT_OPTIONS)\n private _defaults?: MatAutocompleteDefaultOptions | null,\n ) {\n this._scrollStrategy = scrollStrategy;\n }\n\n /** Class to apply to the panel when it's above the input. */\n protected abstract _aboveClass: string;\n\n ngAfterViewInit() {\n const window = this._getWindow();\n\n if (typeof window !== 'undefined') {\n this._zone.runOutsideAngular(() => window.addEventListener('blur', this._windowBlurHandler));\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['position'] && this._positionStrategy) {\n this._setStrategyPositions(this._positionStrategy);\n\n if (this.panelOpen) {\n this._overlayRef!.updatePosition();\n }\n }\n }\n\n ngOnDestroy() {\n const window = this._getWindow();\n\n if (typeof window !== 'undefined') {\n window.removeEventListener('blur', this._windowBlurHandler);\n }\n\n this._viewportSubscription.unsubscribe();\n this._componentDestroyed = true;\n this._destroyPanel();\n this._closeKeyEventStream.complete();\n }\n\n /** Whether or not the autocomplete panel is open. */\n get panelOpen(): boolean {\n return this._overlayAttached && this.autocomplete.showPanel;\n }\n private _overlayAttached: boolean = false;\n\n /** Opens the autocomplete suggestion panel. */\n openPanel(): void {\n this._attachOverlay();\n this._floatLabel();\n }\n\n /** Closes the autocomplete suggestion panel. */\n closePanel(): void {\n this._resetLabel();\n\n if (!this._overlayAttached) {\n return;\n }\n\n if (this.panelOpen) {\n // Only emit if the panel was visible.\n // The `NgZone.onStable` always emits outside of the Angular zone,\n // so all the subscriptions from `_subscribeToClosingActions()` are also outside of the Angular zone.\n // We should manually run in Angular zone to update UI after panel closing.\n this._zone.run(() => {\n this.autocomplete.closed.emit();\n });\n }\n\n this.autocomplete._isOpen = this._overlayAttached = false;\n this._pendingAutoselectedOption = null;\n\n if (this._overlayRef && this._overlayRef.hasAttached()) {\n this._overlayRef.detach();\n this._closingActionsSubscription.unsubscribe();\n }\n\n // Note that in some cases this can end up being called after the component is destroyed.\n // Add a check to ensure that we don't try to run change detection on a destroyed view.\n if (!this._componentDestroyed) {\n // We need to trigger change detection manually, because\n // `fromEvent` doesn't seem to do it at the proper time.\n // This ensures that the label is reset when the\n // user clicks outside.\n this._changeDetectorRef.detectChanges();\n }\n }\n\n /**\n * Updates the position of the autocomplete suggestion panel to ensure that it fits all options\n * within the viewport.\n */\n updatePosition(): void {\n if (this._overlayAttached) {\n this._overlayRef!.updatePosition();\n }\n }\n\n /**\n * A stream of actions that should close the autocomplete panel, including\n * when an option is selected, on blur, and when TAB is pressed.\n */\n get panelClosingActions(): Observable<MatOptionSelectionChange | null> {\n return merge(\n this.optionSelections,\n this.autocomplete._keyManager.tabOut.pipe(filter(() => this._overlayAttached)),\n this._closeKeyEventStream,\n this._getOutsideClickStream(),\n this._overlayRef\n ? this._overlayRef.detachments().pipe(filter(() => this._overlayAttached))\n : observableOf(),\n ).pipe(\n // Normalize the output so we return a consistent type.\n map(event => (event instanceof MatOptionSelectionChange ? event : null)),\n );\n }\n\n /** Stream of changes to the selection state of the autocomplete options. */\n readonly optionSelections: Observable<MatOptionSelectionChange> = defer(() => {\n const options = this.autocomplete ? this.autocomplete.options : null;\n\n if (options) {\n return options.changes.pipe(\n startWith(options),\n switchMap(() => merge(...options.map(option => option.onSelectionChange))),\n );\n }\n\n // If there are any subscribers before `ngAfterViewInit`, the `autocomplete` will be undefined.\n // Return a stream that we'll replace with the real one once everything is in place.\n return this._zone.onStable.pipe(\n take(1),\n switchMap(() => this.optionSelections),\n );\n }) as Observable<MatOptionSelectionChange>;\n\n /** The currently active option, coerced to MatOption type. */\n get activeOption(): _MatOptionBase | null {\n if (this.autocomplete && this.autocomplete._keyManager) {\n return this.autocomplete._keyManager.activeItem;\n }\n\n return null;\n }\n\n /** Stream of clicks outside of the autocomplete panel. */\n private _getOutsideClickStream(): Observable<any> {\n return merge(\n fromEvent(this._document, 'click') as Observable<MouseEvent>,\n fromEvent(this._document, 'auxclick') as Observable<MouseEvent>,\n fromEvent(this._document, 'touchend') as Observable<TouchEvent>,\n ).pipe(\n filter(event => {\n // If we're in the Shadow DOM, the event target will be the shadow root, so we have to\n // fall back to check the first element in the path of the click event.\n const clickTarget = _getEventTarget<HTMLElement>(event)!;\n const formField = this._formField ? this._formField._elementRef.nativeElement : null;\n const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;\n\n return (\n this._overlayAttached &&\n clickTarget !== this._element.nativeElement &&\n // Normally focus moves inside `mousedown` so this condition will almost always be\n // true. Its main purpose is to handle the case where the input is focused from an\n // outside click which propagates up to the `body` listener within the same sequence\n // and causes the panel to close immediately (see #3106).\n this._document.activeElement !== this._element.nativeElement &&\n (!formField || !formField.contains(clickTarget)) &&\n (!customOrigin || !customOrigin.contains(clickTarget)) &&\n !!this._overlayRef &&\n !this._overlayRef.overlayElement.contains(clickTarget)\n );\n }),\n );\n }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: any): void {\n Promise.resolve(null).then(() => this._assignOptionValue(value));\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => {}): void {\n this._onChange = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: () => {}) {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean) {\n this._element.nativeElement.disabled = isDisabled;\n }\n\n _handleKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n const hasModifier = hasModifierKey(event);\n\n // Prevent the default action on all escape key presses. This is here primarily to bring IE\n // in line with other browsers. By default, pressing escape on IE will cause it to revert\n // the input value to the one that it had on focus, however it won't dispatch any events\n // which means that the model value will be out of sync with the view.\n if (keyCode === ESCAPE && !hasModifier) {\n event.preventDefault();\n }\n\n if (this.activeOption && keyCode === ENTER && this.panelOpen && !hasModifier) {\n this.activeOption._selectViaInteraction();\n this._resetActiveItem();\n event.preventDefault();\n } else if (this.autocomplete) {\n const prevActiveItem = this.autocomplete._keyManager.activeItem;\n const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;\n\n if (keyCode === TAB || (isArrowKey && !hasModifier && this.panelOpen)) {\n this.autocomplete._keyManager.onKeydown(event);\n } else if (isArrowKey && this._canOpen()) {\n this.openPanel();\n }\n\n if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {\n this._scrollToOption(this.autocomplete._keyManager.activeItemIndex || 0);\n\n if (this.autocomplete.autoSelectActiveOption && this.activeOption) {\n if (!this._pendingAutoselectedOption) {\n this._valueBeforeAutoSelection = this._element.nativeElement.value;\n }\n\n this._pendingAutoselectedOption = this.activeOption;\n this._assignOptionValue(this.activeOption.value);\n }\n }\n }\n }\n\n _handleInput(event: KeyboardEvent): void {\n let target = event.target as HTMLInputElement;\n let value: number | string | null = target.value;\n\n // Based on `NumberValueAccessor` from forms.\n if (target.type === 'number') {\n value = value == '' ? null : parseFloat(value);\n }\n\n // If the input has a placeholder, IE will fire the `input` event on page load,\n // focus and blur, in addition to when the user actually changed the value. To\n // filter out all of the extra events, we save the value on focus and between\n // `input` events, and we check whether it changed.\n // See: https://connect.microsoft.com/IE/feedback/details/885747/\n if (this._previousValue !== value) {\n this._previousValue = value;\n this._pendingAutoselectedOption = null;\n this._onChange(value);\n\n if (this._canOpen() && this._document.activeElement === event.target) {\n this.openPanel();\n }\n }\n }\n\n _handleFocus(): void {\n if (!this._canOpenOnNextFocus) {\n this._canOpenOnNextFocus = true;\n } else if (this._canOpen()) {\n this._previousValue = this._element.nativeElement.value;\n this._attachOverlay();\n this._floatLabel(true);\n }\n }\n\n _handleClick(): void {\n if (this._canOpen() && !this.panelOpen) {\n this.openPanel();\n }\n }\n\n /**\n * In \"auto\" mode, the label will animate down as soon as focus is lost.\n * This causes the value to jump when selecting an option with the mouse.\n * This method manually floats the label until the panel can be closed.\n * @param shouldAnimate Whether the label should be animated when it is floated.\n */\n private _floatLabel(shouldAnimate = false): void {\n if (this._formField && this._formField.floatLabel === 'auto') {\n if (shouldAnimate) {\n this._formField._animateAndLockLabel();\n } else {\n this._formField.floatLabel = 'always';\n }\n\n this._manuallyFloatingLabel = true;\n }\n }\n\n /** If the label has been manually elevated, return it to its normal state. */\n private _resetLabel(): void {\n if (this._manuallyFloatingLabel) {\n if (this._formField) {\n this._formField.floatLabel = 'auto';\n }\n this._manuallyFloatingLabel = false;\n }\n }\n\n /**\n * This method listens to a stream of panel closing actions and resets the\n * stream every time the option list changes.\n */\n private _subscribeToClosingActions(): Subscription {\n const firstStable = this._zone.onStable.pipe(take(1));\n const optionChanges = this.autocomplete.options.changes.pipe(\n tap(() => this._positionStrategy.reapplyLastPosition()),\n // Defer emitting to the stream until the next tick, because changing\n // bindings in here will cause \"changed after checked\" errors.\n delay(0),\n );\n\n // When the zone is stable initially, and when the option list changes...\n return (\n merge(firstStable, optionChanges)\n .pipe(\n // create a new stream of panelClosingActions, replacing any previous streams\n // that were created, and flatten it so our stream only emits closing events...\n switchMap(() => {\n // The `NgZone.onStable` always emits outside of the Angular zone, thus we have to re-enter\n // the Angular zone. This will lead to change detection being called outside of the Angular\n // zone and the `autocomplete.opened` will also emit outside of the Angular.\n this._zone.run(() => {\n const wasOpen = this.panelOpen;\n this._resetActiveItem();\n this.autocomplete._setVisibility();\n this._changeDetectorRef.detectChanges();\n\n if (this.panelOpen) {\n this._overlayRef!.updatePosition();\n }\n\n if (wasOpen !== this.panelOpen) {\n // If the `panelOpen` state changed, we need to make sure to emit the `opened` or\n // `closed` event, because we may not have emitted it. This can happen\n // - if the users opens the panel and there are no options, but the\n // options come in slightly later or as a result of the value changing,\n // - if the panel is closed after the user entered a string that did not match any\n // of the available options,\n // - if a valid string is entered after an invalid one.\n if (this.panelOpen) {\n this.autocomplete.opened.emit();\n } else {\n this.autocomplete.closed.emit();\n }\n }\n });\n\n return this.panelClosingActions;\n }),\n // when the first closing event occurs...\n take(1),\n )\n // set the value, close the panel, and complete.\n .subscribe(event => this._setValueAndClose(event))\n );\n }\n\n /** Destroys the autocomplete suggestion panel. */\n private _destroyPanel(): void {\n if (this._overlayRef) {\n this.closePanel();\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n }\n\n private _assignOptionValue(value: any): void {\n const toDisplay =\n this.autocomplete && this.autocomplete.displayWith\n ? this.autocomplete.displayWith(value)\n : value;\n\n // Simply falling back to an empty string if the display value is falsy does not work properly.\n // The display value can also be the number zero and shouldn't fall back to an empty string.\n this._updateNativeInputValue(toDisplay != null ? toDisplay : '');\n }\n\n private _updateNativeInputValue(value: string): void {\n // If it's used within a `MatFormField`, we should set it through the property so it can go\n // through change detection.\n if (this._formField) {\n this._formField._control.value = value;\n } else {\n this._element.nativeElement.value = value;\n }\n\n this._previousValue = value;\n }\n\n /**\n * This method closes the panel, and if a value is specified, also sets the associated\n * control to that value. It will also mark the control as dirty if this interaction\n * stemmed from the user.\n */\n private _setValueAndClose(event: MatOptionSelectionChange | null): void {\n const toSelect = event ? event.source : this._pendingAutoselectedOption;\n\n if (toSelect) {\n this._clearPreviousSelectedOption(toSelect);\n this._assignOptionValue(toSelect.value);\n this._onChange(toSelect.value);\n this.autocomplete._emitSelectEvent(toSelect);\n this._element.nativeElement.focus();\n }\n\n this.closePanel();\n }\n\n /**\n * Clear any previous selected option and emit a selection change event for this option\n */\n private _clearPreviousSelectedOption(skip: _MatOptionBase) {\n this.autocomplete.options.forEach(option => {\n if (option !== skip && option.selected) {\n option.deselect();\n }\n });\n }\n\n private _attachOverlay(): void {\n if (!this.autocomplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatAutocompleteMissingPanelError();\n }\n\n let overlayRef = this._overlayRef;\n\n if (!overlayRef) {\n this._portal = new TemplatePortal(this.autocomplete.template, this._viewContainerRef, {\n id: this._formField?.getLabelId(),\n });\n overlayRef = this._overlay.create(this._getOverlayConfig());\n this._overlayRef = overlayRef;\n this._handleOverlayEvents(overlayRef);\n this._viewportSubscription = this._viewportRuler.change().subscribe(() => {\n if (this.panelOpen && overlayRef) {\n overlayRef.updateSize({width: this._getPanelWidth()});\n }\n });\n } else {\n // Update the trigger, panel width and direction, in case anything has changed.\n this._positionStrategy.setOrigin(this._getConnectedElement());\n overlayRef.updateSize({width: this._getPanelWidth()});\n }\n\n if (overlayRef && !overlayRef.hasAttached()) {\n overlayRef.attach(this._portal);\n this._closingActionsSubscription = this._subscribeToClosingActions();\n }\n\n const wasOpen = this.panelOpen;\n\n this.autocomplete._setVisibility();\n this.autocomplete._isOpen = this._overlayAttached = true;\n this.autocomplete._setColor(this._formField?.color);\n\n // We need to do an extra `panelOpen` check in here, because the\n // autocomplete won't be shown if there are no options.\n if (this.panelOpen && wasOpen !== this.panelOpen) {\n this.autocomplete.opened.emit();\n }\n }\n\n private _getOverlayConfig(): OverlayConfig {\n return new OverlayConfig({\n positionStrategy: this._getOverlayPosition(),\n scrollStrategy: this._scrollStrategy(),\n width: this._getPanelWidth(),\n direction: this._dir ?? undefined,\n panelClass: this._defaults?.overlayPanelClass,\n });\n }\n\n private _getOverlayPosition(): PositionStrategy {\n const strategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getConnectedElement())\n .withFlexibleDimensions(false)\n .withPush(false);\n\n this._setStrategyPositions(strategy);\n this._positionStrategy = strategy;\n return strategy;\n }\n\n /** Sets the positions on a position strategy based on the directive's input state. */\n private _setStrategyPositions(positionStrategy: FlexibleConnectedPositionStrategy) {\n // Note that we provide horizontal fallback positions, even though by default the dropdown\n // width matches the input, because consumers can override the width. See #18854.\n const belowPositions: ConnectedPosition[] = [\n {originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top'},\n {originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top'},\n ];\n\n // The overlay edge connected to the trigger should have squared corners, while\n // the opposite end has rounded corners. We apply a CSS class to swap the\n // border-radius based on the overlay position.\n const panelClass = this._aboveClass;\n const abovePositions: ConnectedPosition[] = [\n {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', panelClass},\n {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', panelClass},\n ];\n\n let positions: ConnectedPosition[];\n\n if (this.position === 'above') {\n positions = abovePositions;\n } else if (this.position === 'below') {\n positions = belowPositions;\n } else {\n positions = [...belowPositions, ...abovePositions];\n }\n\n positionStrategy.withPositions(positions);\n }\n\n private _getConnectedElement(): ElementRef<HTMLElement> {\n if (this.connectedTo) {\n return this.connectedTo.elementRef;\n }\n\n return this._formField ? this._formField.getConnectedOverlayOrigin() : this._element;\n }\n\n private _getPanelWidth(): number | string {\n return this.autocomplete.panelWidth || this._getHostWidth();\n }\n\n /** Returns the width of the input element, so the panel width can match it. */\n private _getHostWidth(): number {\n return this._getConnectedElement().nativeElement.getBoundingClientRect().width;\n }\n\n /**\n * Resets the active item to -1 so arrow events will activate the\n * correct options, or to 0 if the consumer opted into it.\n */\n private _resetActiveItem(): void {\n const autocomplete = this.autocomplete;\n\n if (autocomplete.autoActiveFirstOption) {\n // Note that we go through `setFirstItemActive`, rather than `setActiveItem(0)`, because\n // the former will find the next enabled option, if the first one is disabled.\n autocomplete._keyManager.setFirstItemActive();\n } else {\n autocomplete._keyManager.setActiveItem(-1);\n }\n }\n\n /** Determines whether the panel can be opened. */\n private _canOpen(): boolean {\n const element = this._element.nativeElement;\n return !element.readOnly && !element.disabled && !this._autocompleteDisabled;\n }\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document?.defaultView || window;\n }\n\n /** Scrolls to a particular option in the list. */\n private _scrollToOption(index: number): void {\n // Given that we are not actually focusing active options, we must manually adjust scroll\n // to reveal options below the fold. First, we find the offset of the option from the top\n // of the panel. If that offset is below the fold, the new scrollTop will be the offset -\n // the panel height + the option height, so the active option will be just visible at the\n // bottom of the panel. If that offset is above the top of the visible panel, the new scrollTop\n // will become the offset. If that offset is visible within the panel already, the scrollTop is\n // not adjusted.\n const autocomplete = this.autocomplete;\n const labelCount = _countGroupLabelsBeforeOption(\n index,\n autocomplete.options,\n autocomplete.optionGroups,\n );\n\n if (index === 0 && labelCount === 1) {\n // If we've got one group label before the option and we're at the top option,\n // scroll the list to the top. This is better UX than scrolling the list to the\n // top of the option, because it allows the user to read the top group's label.\n autocomplete._setScrollTop(0);\n } else if (autocomplete.panel) {\n const option = autocomplete.options.toArray()[index];\n\n if (option) {\n const element = option._getHostElement();\n const newScrollPosition = _getOptionScrollPosition(\n element.offsetTop,\n element.offsetHeight,\n autocomplete._getScrollTop(),\n autocomplete.panel.nativeElement.offsetHeight,\n );\n\n autocomplete._setScrollTop(newScrollPosition);\n }\n }\n }\n\n /** Handles keyboard events coming from the overlay panel. */\n private _handleOverlayEvents(overlayRef: OverlayRef) {\n // Use the `keydownEvents` in order to take advantage of\n // the overlay event targeting provided by the CDK overlay.\n overlayRef.keydownEvents().subscribe(event => {\n // Close when pressing ESCAPE or ALT + UP_ARROW, based on the a11y guidelines.\n // See: https://www.w3.org/TR/wai-aria-practices-1.1/#textbox-keyboard-interaction\n if (\n (event.keyCode === ESCAPE && !hasModifierKey(event)) ||\n (event.keyCode === UP_ARROW && hasModifierKey(event, 'altKey'))\n ) {\n // If the user had typed something in before we autoselected an option, and they decided\n // to cancel the selection, restore the input value to the one they had typed in.\n if (this._pendingAutoselectedOption) {\n this._updateNativeInputValue(this._valueBeforeAutoSelection ?? '');\n this._pendingAutoselectedOption = null;\n }\n\n this._closeKeyEventStream.next();\n this._resetActiveItem();\n\n // We need to stop propagation, otherwise the event will eventually\n // reach the input itself and cause the overlay to be reopened.\n event.stopPropagation();\n event.preventDefault();\n }\n });\n\n // Subscribe to the pointer events stream so that it doesn't get picked up by other overlays.\n // TODO(crisbeto): we should switch `_getOutsideClickStream` eventually to use this stream,\n // but the behvior isn't exactly the same and it ends up breaking some internal tests.\n overlayRef.outsidePointerEvents().subscribe();\n }\n}\n\n@Directive({\n selector: `input[matAutocomplete], textarea[matAutocomplete]`,\n host: {\n 'class': 'mat-mdc-autocomplete-trigger',\n '[attr.autocomplete]': 'autocompleteAttribute',\n '[attr.role]': 'autocompleteDisabled ? null : \"combobox\"',\n '[attr.aria-autocomplete]': 'autocompleteDisabled ? null : \"list\"',\n '[attr.aria-activedescendant]': '(panelOpen && activeOption) ? activeOption.id : null',\n '[attr.aria-expanded]': 'autocompleteDisabled ? null : panelOpen.toString()',\n '[attr.aria-owns]': '(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id',\n '[attr.aria-haspopup]': 'autocompleteDisabled ? null : \"listbox\"',\n // Note: we use `focusin`, as opposed to `focus`, in order to open the panel\n // a little earlier. This avoids issues where IE delays the focusing of the input.\n '(focusin)': '_handleFocus()',\n '(blur)': '_onTouched()',\n '(input)': '_handleInput($event)',\n '(keydown)': '_handleKeydown($event)',\n '(click)': '_handleClick()',\n },\n exportAs: 'matAutocompleteTrigger',\n providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR],\n})\nexport class MatAutocompleteTrigger extends _MatAutocompleteTriggerBase {\n protected _aboveClass = 'mat-mdc-autocomplete-panel-above';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Directive, forwardRef} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n _MatAutocompleteBase,\n _MatAutocompleteTriggerBase,\n _MatAutocompleteOriginBase,\n} from '@angular/material/autocomplete';\n\n/**\n * Provider that allows the autocomplete to register as a ControlValueAccessor.\n * @docs-private\n * @deprecated Use `MAT_AUTOCOMPLETE_VALUE_ACCESSOR` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatLegacyAutocompleteTrigger),\n multi: true,\n};\n\n/**\n * @deprecated Use `MatAutocompleteTrigger` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: `input[matAutocomplete], textarea[matAutocomplete]`,\n host: {\n 'class': 'mat-autocomplete-trigger',\n '[attr.autocomplete]': 'autocompleteAttribute',\n '[attr.role]': 'autocompleteDisabled ? null : \"combobox\"',\n '[attr.aria-autocomplete]': 'autocompleteDisabled ? null : \"list\"',\n '[attr.aria-activedescendant]': '(panelOpen && activeOption) ? activeOption.id : null',\n '[attr.aria-expanded]': 'autocompleteDisabled ? null : panelOpen.toString()',\n '[attr.aria-owns]': '(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id',\n '[attr.aria-haspopup]': 'autocompleteDisabled ? null : \"listbox\"',\n // Note: we use `focusin`, as opposed to `focus`, in order to open the panel\n // a little earlier. This avoids issues where IE delays the focusing of the input.\n '(focusin)': '_handleFocus()',\n '(blur)': '_onTouched()',\n '(input)': '_handleInput($event)',\n '(keydown)': '_handleKeydown($event)',\n '(click)': '_handleClick()',\n },\n exportAs: 'matAutocompleteTrigger',\n providers: [MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR],\n})\nexport class MatLegacyAutocompleteTrigger extends _MatAutocompleteTriggerBase {\n protected _aboveClass = 'mat-autocomplete-panel-above';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatLegacyOptionModule} from '@angular/material/legacy-core';\nimport {CdkScrollableModule} from '@angular/cdk/scrolling';\nimport {MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER} from '@angular/material/autocomplete';\nimport {MatLegacyAutocomplete} from './autocomplete';\nimport {MatLegacyAutocompleteTrigger} from './autocomplete-trigger';\nimport {MatLegacyAutocompleteOrigin} from './autocomplete-origin';\n\n/**\n * @deprecated Use `MatAutocompleteModule` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [OverlayModule, MatLegacyOptionModule, MatCommonModule, CommonModule],\n exports: [\n MatLegacyAutocomplete,\n MatLegacyAutocompleteTrigger,\n MatLegacyAutocompleteOrigin,\n CdkScrollableModule,\n MatLegacyOptionModule,\n MatCommonModule,\n ],\n declarations: [MatLegacyAutocomplete, MatLegacyAutocompleteTrigger, MatLegacyAutocompleteOrigin],\n providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER],\n})\nexport class MatLegacyAutocompleteModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor, FocusableOption, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n ViewChild,\n ViewEncapsulation,\n Optional,\n Inject,\n Input,\n AfterViewInit,\n NgZone,\n} from '@angular/core';\nimport {\n CanColor,\n CanDisable,\n CanDisableRipple,\n MatRipple,\n mixinColor,\n mixinDisabled,\n mixinDisableRipple,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n/** Default color palette for round buttons (mat-fab and mat-mini-fab) */\nconst DEFAULT_ROUND_BUTTON_COLOR = 'accent';\n\n/**\n * List of classes to add to button instances based on host attributes to\n * style as different variants.\n */\nconst BUTTON_HOST_ATTRIBUTES = [\n 'mat-button',\n 'mat-flat-button',\n 'mat-icon-button',\n 'mat-raised-button',\n 'mat-stroked-button',\n 'mat-mini-fab',\n 'mat-fab',\n];\n\n// Boilerplate for applying mixins to button.\nconst _MatButtonBase = mixinColor(\n mixinDisabled(\n mixinDisableRipple(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n ),\n ),\n);\n\n/**\n * Material design button.\n * @deprecated Use `MatButton` from `@angular/material/button` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: `button[mat-button], button[mat-raised-button], button[mat-icon-button],\n button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],\n button[mat-flat-button]`,\n exportAs: 'matButton',\n host: {\n '[attr.disabled]': 'disabled || null',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n // Add a class for disabled button styling instead of the using attribute\n // selector or pseudo-selector. This allows users to create focusable\n // disabled buttons without recreating the styles.\n '[class.mat-button-disabled]': 'disabled',\n 'class': 'mat-focus-indicator',\n },\n templateUrl: 'button.html',\n styleUrls: ['button.css'],\n inputs: ['disabled', 'disableRipple', 'color'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacyButton\n extends _MatButtonBase\n implements AfterViewInit, OnDestroy, CanDisable, CanColor, CanDisableRipple, FocusableOption\n{\n /** Whether the button is round. */\n readonly isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');\n\n /** Whether the button is icon button. */\n readonly isIconButton: boolean = this._hasHostAttributes('mat-icon-button');\n\n /** Reference to the MatRipple instance of the button. */\n @ViewChild(MatRipple) ripple: MatRipple;\n\n constructor(\n elementRef: ElementRef,\n private _focusMonitor: FocusMonitor,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode: string,\n ) {\n super(elementRef);\n\n // For each of the variant selectors that is present in the button's host\n // attributes, add the correct corresponding class.\n for (const attr of BUTTON_HOST_ATTRIBUTES) {\n if (this._hasHostAttributes(attr)) {\n (this._getHostElement() as HTMLElement).classList.add(attr);\n }\n }\n\n // Add a class that applies to all buttons. This makes it easier to target if somebody\n // wants to target all Material buttons. We do it here rather than `host` to ensure that\n // the class is applied to derived classes.\n elementRef.nativeElement.classList.add('mat-button-base');\n\n if (this.isRoundButton) {\n this.color = DEFAULT_ROUND_BUTTON_COLOR;\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor.monitor(this._elementRef, true);\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n }\n\n /** Focuses the button. */\n focus(origin?: FocusOrigin, options?: FocusOptions): void {\n if (origin) {\n this._focusMonitor.focusVia(this._getHostElement(), origin, options);\n } else {\n this._getHostElement().focus(options);\n }\n }\n\n _getHostElement() {\n return this._elementRef.nativeElement;\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n /** Gets whether the button has one of the given attributes. */\n _hasHostAttributes(...attributes: string[]) {\n return attributes.some(attribute => this._getHostElement().hasAttribute(attribute));\n }\n}\n\n/**\n * Material design anchor button.\n * @deprecated Use `MatAnchor` from `@angular/material/button` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: `a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab],\n a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]`,\n exportAs: 'matButton, matAnchor',\n host: {\n // Note that we ignore the user-specified tabindex when it's disabled for\n // consistency with the `mat-button` applied on native buttons where even\n // though they have an index, they're not tabbable.\n '[attr.tabindex]': 'disabled ? -1 : tabIndex',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n '[class.mat-button-disabled]': 'disabled',\n 'class': 'mat-focus-indicator',\n },\n inputs: ['disabled', 'disableRipple', 'color'],\n templateUrl: 'button.html',\n styleUrls: ['button.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacyAnchor extends MatLegacyButton implements AfterViewInit, OnDestroy {\n /** Tabindex of the button. */\n @Input() tabIndex: number;\n\n constructor(\n focusMonitor: FocusMonitor,\n elementRef: ElementRef,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode: string,\n /** @breaking-change 14.0.0 _ngZone will be required. */\n @Optional() private _ngZone?: NgZone,\n ) {\n super(elementRef, focusMonitor, animationMode);\n }\n\n override ngAfterViewInit(): void {\n super.ngAfterViewInit();\n\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => {\n this._elementRef.nativeElement.addEventListener('click', this._haltDisabledEvents);\n });\n } else {\n this._elementRef.nativeElement.addEventListener('click', this._haltDisabledEvents);\n }\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._elementRef.nativeElement.removeEventListener('click', this._haltDisabledEvents);\n }\n\n _haltDisabledEvents = (event: Event): void => {\n // A disabled button shouldn't apply any actions\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n}\n","<span class=\"mat-button-wrapper\"><ng-content></ng-content></span>\n<span matRipple class=\"mat-button-ripple\"\n [class.mat-button-ripple-round]=\"isRoundButton || isIconButton\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleCentered]=\"isIconButton\"\n [matRippleTrigger]=\"_getHostElement()\"></span>\n<span class=\"mat-button-focus-overlay\"></span>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatLegacyAnchor, MatLegacyButton} from './button';\n\n/**\n * @deprecated Use `MatButtonModule` from `@angular/material/button` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatRippleModule, MatCommonModule],\n exports: [MatLegacyButton, MatLegacyAnchor, MatCommonModule],\n declarations: [MatLegacyButton, MatLegacyAnchor],\n})\nexport class MatLegacyButtonModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {\n MatLegacyCard,\n MatLegacyCardActions,\n MatLegacyCardAvatar,\n MatLegacyCardContent,\n MatLegacyCardFooter,\n MatLegacyCardHeader,\n MatLegacyCardImage,\n MatLegacyCardLgImage,\n MatLegacyCardMdImage,\n MatLegacyCardSmImage,\n MatLegacyCardSubtitle,\n MatLegacyCardTitle,\n MatLegacyCardTitleGroup,\n MatLegacyCardXlImage,\n} from './card';\n\n/**\n * @deprecated Use `MatCardModule` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatCommonModule],\n exports: [\n MatLegacyCard,\n MatLegacyCardHeader,\n MatLegacyCardTitleGroup,\n MatLegacyCardContent,\n MatLegacyCardTitle,\n MatLegacyCardSubtitle,\n MatLegacyCardActions,\n MatLegacyCardFooter,\n MatLegacyCardSmImage,\n MatLegacyCardMdImage,\n MatLegacyCardLgImage,\n MatLegacyCardImage,\n MatLegacyCardXlImage,\n MatLegacyCardAvatar,\n MatCommonModule,\n ],\n declarations: [\n MatLegacyCard,\n MatLegacyCardHeader,\n MatLegacyCardTitleGroup,\n MatLegacyCardContent,\n MatLegacyCardTitle,\n MatLegacyCardSubtitle,\n MatLegacyCardActions,\n MatLegacyCardFooter,\n MatLegacyCardSmImage,\n MatLegacyCardMdImage,\n MatLegacyCardLgImage,\n MatLegacyCardImage,\n MatLegacyCardXlImage,\n MatLegacyCardAvatar,\n ],\n})\nexport class MatLegacyCardModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n NgZone,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanColor,\n CanDisable,\n CanDisableRipple,\n HasTabIndex,\n MatRipple,\n mixinColor,\n mixinDisabled,\n mixinDisableRipple,\n mixinTabIndex,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {FocusableOption, FocusOrigin} from '@angular/cdk/a11y';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n MAT_CHECKBOX_DEFAULT_OPTIONS,\n MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY,\n MatCheckboxDefaultOptions,\n} from './checkbox-config';\n\n/**\n * Represents the different states that require custom transitions between them.\n * @docs-private\n */\nexport const enum TransitionCheckState {\n /** The initial state of the component before any user interaction. */\n Init,\n /** The state representing the component when it's becoming checked. */\n Checked,\n /** The state representing the component when it's becoming unchecked. */\n Unchecked,\n /** The state representing the component when it's becoming indeterminate. */\n Indeterminate,\n}\n\nexport const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatCheckbox),\n multi: true,\n};\n\n/** Change event object emitted by checkbox. */\nexport class MatCheckboxChange {\n /** The source checkbox of the event. */\n source: MatCheckbox;\n /** The new `checked` value of the checkbox. */\n checked: boolean;\n}\n\n// Increasing integer for generating unique ids for checkbox components.\nlet nextUniqueId = 0;\n\n// Default checkbox configuration.\nconst defaults = MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY();\n\n// Boilerplate for applying mixins to MatCheckbox.\n/** @docs-private */\nconst _MatCheckboxMixinBase = mixinTabIndex(\n mixinColor(\n mixinDisableRipple(\n mixinDisabled(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n ),\n ),\n ),\n);\n\n@Directive()\nexport abstract class _MatCheckboxBase<E>\n extends _MatCheckboxMixinBase\n implements\n AfterViewInit,\n ControlValueAccessor,\n CanColor,\n CanDisable,\n HasTabIndex,\n CanDisableRipple,\n FocusableOption\n{\n /** Focuses the checkbox. */\n abstract focus(origin?: FocusOrigin): void;\n\n /** Creates the change event that will be emitted by the checkbox. */\n protected abstract _createChangeEvent(isChecked: boolean): E;\n\n /** Gets the element on which to add the animation CSS classes. */\n protected abstract _getAnimationTargetElement(): HTMLElement | null;\n\n /** CSS classes to add when transitioning between the different checkbox states. */\n protected abstract _animationClasses: {\n uncheckedToChecked: string;\n uncheckedToIndeterminate: string;\n checkedToUnchecked: string;\n checkedToIndeterminate: string;\n indeterminateToChecked: string;\n indeterminateToUnchecked: string;\n };\n\n /**\n * Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will\n * take precedence so this may be omitted.\n */\n @Input('aria-label') ariaLabel: string = '';\n\n /**\n * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element\n */\n @Input('aria-labelledby') ariaLabelledby: string | null = null;\n\n /** The 'aria-describedby' attribute is read after the element's label and field type. */\n @Input('aria-describedby') ariaDescribedby: string;\n\n private _uniqueId: string;\n\n /** A unique id for the checkbox input. If none is supplied, it will be auto-generated. */\n @Input() id: string;\n\n /** Returns the unique id for the visual hidden input. */\n get inputId(): string {\n return `${this.id || this._uniqueId}-input`;\n }\n\n /** Whether the checkbox is required. */\n @Input()\n get required(): boolean {\n return this._required;\n }\n set required(value: BooleanInput) {\n this._required = coerceBooleanProperty(value);\n }\n private _required: boolean;\n\n /** Whether the label should appear after or before the checkbox. Defaults to 'after' */\n @Input() labelPosition: 'before' | 'after' = 'after';\n\n /** Name value will be applied to the input element if present */\n @Input() name: string | null = null;\n\n /** Event emitted when the checkbox's `checked` value changes. */\n @Output() readonly change: EventEmitter<E> = new EventEmitter<E>();\n\n /** Event emitted when the checkbox's `indeterminate` value changes. */\n @Output() readonly indeterminateChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /** The value attribute of the native input element */\n @Input() value: string;\n\n /** The native `<input type=\"checkbox\">` element */\n @ViewChild('input') _inputElement: ElementRef<HTMLInputElement>;\n\n /** The native `<label>` element */\n @ViewChild('label') _labelElement: ElementRef<HTMLInputElement>;\n\n /** Reference to the ripple instance of the checkbox. */\n @ViewChild(MatRipple) ripple: MatRipple;\n\n /**\n * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.\n * @docs-private\n */\n _onTouched: () => any = () => {};\n\n private _currentAnimationClass: string = '';\n\n private _currentCheckState: TransitionCheckState = TransitionCheckState.Init;\n\n private _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n constructor(\n idPrefix: string,\n elementRef: ElementRef<HTMLElement>,\n protected _changeDetectorRef: ChangeDetectorRef,\n protected _ngZone: NgZone,\n tabIndex: string,\n public _animationMode?: string,\n protected _options?: MatCheckboxDefaultOptions,\n ) {\n super(elementRef);\n this._options = this._options || defaults;\n this.color = this.defaultColor = this._options.color || defaults.color;\n this.tabIndex = parseInt(tabIndex) || 0;\n this.id = this._uniqueId = `${idPrefix}${++nextUniqueId}`;\n }\n\n ngAfterViewInit() {\n this._syncIndeterminate(this._indeterminate);\n }\n\n /** Whether the checkbox is checked. */\n @Input()\n get checked(): boolean {\n return this._checked;\n }\n set checked(value: BooleanInput) {\n const checked = coerceBooleanProperty(value);\n\n if (checked != this.checked) {\n this._checked = checked;\n this._changeDetectorRef.markForCheck();\n }\n }\n private _checked: boolean = false;\n\n /**\n * Whether the checkbox is disabled. This fully overrides the implementation provided by\n * mixinDisabled, but the mixin is still required because mixinTabIndex requires it.\n */\n @Input()\n override get disabled(): boolean {\n return this._disabled;\n }\n override set disabled(value: BooleanInput) {\n const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this.disabled) {\n this._disabled = newValue;\n this._changeDetectorRef.markForCheck();\n }\n }\n private _disabled: boolean = false;\n\n /**\n * Whether the checkbox is indeterminate. This is also known as \"mixed\" mode and can be used to\n * represent a checkbox with three states, e.g. a checkbox that represents a nested list of\n * checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately\n * set to false.\n */\n @Input()\n get indeterminate(): boolean {\n return this._indeterminate;\n }\n set indeterminate(value: BooleanInput) {\n const changed = value != this._indeterminate;\n this._indeterminate = coerceBooleanProperty(value);\n\n if (changed) {\n if (this._indeterminate) {\n this._transitionCheckState(TransitionCheckState.Indeterminate);\n } else {\n this._transitionCheckState(\n this.checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked,\n );\n }\n this.indeterminateChange.emit(this._indeterminate);\n }\n\n this._syncIndeterminate(this._indeterminate);\n }\n private _indeterminate: boolean = false;\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n /** Method being called whenever the label text changes. */\n _onLabelTextChange() {\n // Since the event of the `cdkObserveContent` directive runs outside of the zone, the checkbox\n // component will be only marked for check, but no actual change detection runs automatically.\n // Instead of going back into the zone in order to trigger a change detection which causes\n // *all* components to be checked (if explicitly marked or not using OnPush), we only trigger\n // an explicit change detection for the checkbox view and its children.\n this._changeDetectorRef.detectChanges();\n }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: any) {\n this.checked = !!value;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: any) {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n }\n\n _getAriaChecked(): 'true' | 'false' | 'mixed' {\n if (this.checked) {\n return 'true';\n }\n\n return this.indeterminate ? 'mixed' : 'false';\n }\n\n private _transitionCheckState(newState: TransitionCheckState) {\n let oldState = this._currentCheckState;\n let element = this._getAnimationTargetElement();\n\n if (oldState === newState || !element) {\n return;\n }\n if (this._currentAnimationClass) {\n element.classList.remove(this._currentAnimationClass);\n }\n\n this._currentAnimationClass = this._getAnimationClassForCheckStateTransition(\n oldState,\n newState,\n );\n this._currentCheckState = newState;\n\n if (this._currentAnimationClass.length > 0) {\n element.classList.add(this._currentAnimationClass);\n\n // Remove the animation class to avoid animation when the checkbox is moved between containers\n const animationClass = this._currentAnimationClass;\n\n this._ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n element!.classList.remove(animationClass);\n }, 1000);\n });\n }\n }\n\n private _emitChangeEvent() {\n this._controlValueAccessorChangeFn(this.checked);\n this.change.emit(this._createChangeEvent(this.checked));\n\n // Assigning the value again here is redundant, but we have to do it in case it was\n // changed inside the `change` listener which will cause the input to be out of sync.\n if (this._inputElement) {\n this._inputElement.nativeElement.checked = this.checked;\n }\n }\n\n /** Toggles the `checked` state of the checkbox. */\n toggle(): void {\n this.checked = !this.checked;\n this._controlValueAccessorChangeFn(this.checked);\n }\n\n protected _handleInputClick() {\n const clickAction = this._options?.clickAction;\n\n // If resetIndeterminate is false, and the current state is indeterminate, do nothing on click\n if (!this.disabled && clickAction !== 'noop') {\n // When user manually click on the checkbox, `indeterminate` is set to false.\n if (this.indeterminate && clickAction !== 'check') {\n Promise.resolve().then(() => {\n this._indeterminate = false;\n this.indeterminateChange.emit(this._indeterminate);\n });\n }\n\n this._checked = !this._checked;\n this._transitionCheckState(\n this._checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked,\n );\n\n // Emit our custom change event if the native input emitted one.\n // It is important to only emit it, if the native input triggered one, because\n // we don't want to trigger a change event, when the `checked` variable changes for example.\n this._emitChangeEvent();\n } else if (!this.disabled && clickAction === 'noop') {\n // Reset native input when clicked with noop. The native checkbox becomes checked after\n // click, reset it to be align with `checked` value of `mat-checkbox`.\n this._inputElement.nativeElement.checked = this.checked;\n this._inputElement.nativeElement.indeterminate = this.indeterminate;\n }\n }\n\n _onInteractionEvent(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n }\n\n _onBlur() {\n // When a focused element becomes disabled, the browser *immediately* fires a blur event.\n // Angular does not expect events to be raised during change detection, so any state change\n // (such as a form control's 'ng-touched') will cause a changed-after-checked error.\n // See https://github.com/angular/angular/issues/17793. To work around this, we defer\n // telling the form control it has been touched until the next tick.\n Promise.resolve().then(() => {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n });\n }\n\n private _getAnimationClassForCheckStateTransition(\n oldState: TransitionCheckState,\n newState: TransitionCheckState,\n ): string {\n // Don't transition if animations are disabled.\n if (this._animationMode === 'NoopAnimations') {\n return '';\n }\n\n switch (oldState) {\n case TransitionCheckState.Init:\n // Handle edge case where user interacts with checkbox that does not have [(ngModel)] or\n // [checked] bound to it.\n if (newState === TransitionCheckState.Checked) {\n return this._animationClasses.uncheckedToChecked;\n } else if (newState == TransitionCheckState.Indeterminate) {\n return this._checked\n ? this._animationClasses.checkedToIndeterminate\n : this._animationClasses.uncheckedToIndeterminate;\n }\n break;\n case TransitionCheckState.Unchecked:\n return newState === TransitionCheckState.Checked\n ? this._animationClasses.uncheckedToChecked\n : this._animationClasses.uncheckedToIndeterminate;\n case TransitionCheckState.Checked:\n return newState === TransitionCheckState.Unchecked\n ? this._animationClasses.checkedToUnchecked\n : this._animationClasses.checkedToIndeterminate;\n case TransitionCheckState.Indeterminate:\n return newState === TransitionCheckState.Checked\n ? this._animationClasses.indeterminateToChecked\n : this._animationClasses.indeterminateToUnchecked;\n }\n\n return '';\n }\n\n /**\n * Syncs the indeterminate value with the checkbox DOM node.\n *\n * We sync `indeterminate` directly on the DOM node, because in Ivy the check for whether a\n * property is supported on an element boils down to `if (propName in element)`. Domino's\n * HTMLInputElement doesn't have an `indeterminate` property so Ivy will warn during\n * server-side rendering.\n */\n private _syncIndeterminate(value: boolean) {\n const nativeCheckbox = this._inputElement;\n\n if (nativeCheckbox) {\n nativeCheckbox.nativeElement.indeterminate = value;\n }\n }\n}\n\n@Component({\n selector: 'mat-checkbox',\n templateUrl: 'checkbox.html',\n styleUrls: ['checkbox.css'],\n host: {\n 'class': 'mat-mdc-checkbox',\n '[attr.tabindex]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,\n '[class.mdc-checkbox--disabled]': 'disabled',\n '[id]': 'id',\n // Add classes that users can use to more easily target disabled or checked checkboxes.\n '[class.mat-mdc-checkbox-disabled]': 'disabled',\n '[class.mat-mdc-checkbox-checked]': 'checked',\n },\n providers: [MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR],\n inputs: ['disableRipple', 'color', 'tabIndex'],\n exportAs: 'matCheckbox',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatCheckbox\n extends _MatCheckboxBase<MatCheckboxChange>\n implements ControlValueAccessor, CanColor, CanDisable\n{\n protected _animationClasses = {\n uncheckedToChecked: 'mdc-checkbox--anim-unchecked-checked',\n uncheckedToIndeterminate: 'mdc-checkbox--anim-unchecked-indeterminate',\n checkedToUnchecked: 'mdc-checkbox--anim-checked-unchecked',\n checkedToIndeterminate: 'mdc-checkbox--anim-checked-indeterminate',\n indeterminateToChecked: 'mdc-checkbox--anim-indeterminate-checked',\n indeterminateToUnchecked: 'mdc-checkbox--anim-indeterminate-unchecked',\n };\n\n constructor(\n elementRef: ElementRef<HTMLElement>,\n changeDetectorRef: ChangeDetectorRef,\n ngZone: NgZone,\n @Attribute('tabindex') tabIndex: string,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n @Optional()\n @Inject(MAT_CHECKBOX_DEFAULT_OPTIONS)\n options?: MatCheckboxDefaultOptions,\n ) {\n super(\n 'mat-mdc-checkbox-',\n elementRef,\n changeDetectorRef,\n ngZone,\n tabIndex,\n animationMode,\n options,\n );\n }\n\n /** Focuses the checkbox. */\n focus() {\n this._inputElement.nativeElement.focus();\n }\n\n protected _createChangeEvent(isChecked: boolean) {\n const event = new MatCheckboxChange();\n event.source = this;\n event.checked = isChecked;\n return event;\n }\n\n protected _getAnimationTargetElement() {\n return this._inputElement?.nativeElement;\n }\n\n _onInputClick() {\n super._handleInputClick();\n }\n\n _onTouchTargetClick() {\n super._handleInputClick();\n\n if (!this.disabled) {\n // Normally the input should be focused already, but if the click\n // comes from the touch target, then we might have to focus it ourselves.\n this._inputElement.nativeElement.focus();\n }\n }\n\n /**\n * Prevent click events that come from the `<label/>` element from bubbling. This prevents the\n * click handler on the host from triggering twice when clicking on the `<label/>` element. After\n * the click event on the `<label/>` propagates, the browsers dispatches click on the associated\n * `<input/>`. By preventing clicks on the label by bubbling, we ensure only one click event\n * bubbles when the label is clicked.\n */\n _preventBubblingFromLabel(event: MouseEvent) {\n if (!!event.target && this._labelElement.nativeElement.contains(event.target as HTMLElement)) {\n event.stopPropagation();\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatCheckbox} from './checkbox';\nimport {MatCheckboxRequiredValidator} from './checkbox-required-validator';\n\n/** This module is used by both original and MDC-based checkbox implementations. */\n@NgModule({\n exports: [MatCheckboxRequiredValidator],\n declarations: [MatCheckboxRequiredValidator],\n})\nexport class _MatCheckboxRequiredValidatorModule {}\n\n@NgModule({\n imports: [MatCommonModule, MatRippleModule, _MatCheckboxRequiredValidatorModule],\n exports: [MatCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule],\n declarations: [MatCheckbox],\n})\nexport class MatCheckboxModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n Inject,\n NgZone,\n OnDestroy,\n Optional,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {\n _MatCheckboxBase,\n MAT_CHECKBOX_DEFAULT_OPTIONS,\n MatCheckboxDefaultOptions,\n} from '@angular/material/checkbox';\n\n/**\n * Change event object emitted by a checkbox.\n * @deprecated Use `MatCheckboxChange` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyCheckboxChange {\n /** The source checkbox of the event. */\n source: MatLegacyCheckbox;\n /** The new `checked` value of the checkbox. */\n checked: boolean;\n}\n/**\n * Provider Expression that allows mat-checkbox to register as a ControlValueAccessor.\n * This allows it to support [(ngModel)].\n * @docs-private\n * @deprecated Use `MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatLegacyCheckbox),\n multi: true,\n};\n\n/**\n * A material design checkbox component. Supports all of the functionality of an HTML5 checkbox,\n * and exposes a similar API. A checkbox can be either checked, unchecked, indeterminate, or\n * disabled. Note that all additional accessibility attributes are taken care of by the component,\n * so there is no need to provide them yourself. However, if you want to omit a label and still\n * have the checkbox be accessible, you may supply an [aria-label] input.\n * See: https://material.io/design/components/selection-controls.html\n * @deprecated Use `MatCheckbox` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-checkbox',\n templateUrl: 'checkbox.html',\n styleUrls: ['checkbox.css'],\n exportAs: 'matCheckbox',\n host: {\n 'class': 'mat-checkbox',\n '[id]': 'id',\n '[attr.tabindex]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[class.mat-checkbox-indeterminate]': 'indeterminate',\n '[class.mat-checkbox-checked]': 'checked',\n '[class.mat-checkbox-disabled]': 'disabled',\n '[class.mat-checkbox-label-before]': 'labelPosition == \"before\"',\n '[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,\n },\n providers: [MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR],\n inputs: ['disableRipple', 'color', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacyCheckbox\n extends _MatCheckboxBase<MatLegacyCheckboxChange>\n implements AfterViewInit, OnDestroy\n{\n protected _animationClasses = {\n uncheckedToChecked: 'mat-checkbox-anim-unchecked-checked',\n uncheckedToIndeterminate: 'mat-checkbox-anim-unchecked-indeterminate',\n checkedToUnchecked: 'mat-checkbox-anim-checked-unchecked',\n checkedToIndeterminate: 'mat-checkbox-anim-checked-indeterminate',\n indeterminateToChecked: 'mat-checkbox-anim-indeterminate-checked',\n indeterminateToUnchecked: 'mat-checkbox-anim-indeterminate-unchecked',\n };\n\n constructor(\n elementRef: ElementRef<HTMLElement>,\n changeDetectorRef: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n ngZone: NgZone,\n @Attribute('tabindex') tabIndex: string,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n @Optional()\n @Inject(MAT_CHECKBOX_DEFAULT_OPTIONS)\n options?: MatCheckboxDefaultOptions,\n ) {\n super('mat-checkbox-', elementRef, changeDetectorRef, ngZone, tabIndex, animationMode, options);\n }\n\n protected _createChangeEvent(isChecked: boolean) {\n const event = new MatLegacyCheckboxChange();\n event.source = this;\n event.checked = isChecked;\n return event;\n }\n\n protected _getAnimationTargetElement() {\n return this._elementRef.nativeElement;\n }\n\n override ngAfterViewInit() {\n super.ngAfterViewInit();\n\n this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {\n if (!focusOrigin) {\n this._onBlur();\n }\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n }\n\n /**\n * Event handler for checkbox input element.\n * Toggles checked state if element is not disabled.\n * Do not toggle on (change) event since IE doesn't fire change event when\n * indeterminate checkbox is clicked.\n * @param event\n */\n _onInputClick(event: Event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `checkbox` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n super._handleInputClick();\n }\n\n /** Focuses the checkbox. */\n focus(origin?: FocusOrigin, options?: FocusOptions): void {\n if (origin) {\n this._focusMonitor.focusVia(this._inputElement, origin, options);\n } else {\n this._inputElement.nativeElement.focus(options);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatLegacyCheckbox} from './checkbox';\nimport {_MatCheckboxRequiredValidatorModule} from '@angular/material/checkbox';\n\n/**\n * @deprecated Use `MatCheckboxModule` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatRippleModule, MatCommonModule, ObserversModule, _MatCheckboxRequiredValidatorModule],\n exports: [MatLegacyCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule],\n declarations: [MatLegacyCheckbox],\n})\nexport class MatLegacyCheckboxModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/**\n * Default options, for the chips module, that can be overridden.\n * @deprecated Use `MatChipsDefaultOptions` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport interface MatLegacyChipsDefaultOptions {\n /** The list of key codes that will trigger a chipEnd event. */\n separatorKeyCodes: readonly number[] | ReadonlySet<number>;\n}\n\n/**\n * Injection token to be used to override the default options for the chips module.\n * @deprecated Use `MAT_CHIPS_DEFAULT_OPTIONS` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_CHIPS_DEFAULT_OPTIONS = new InjectionToken<MatLegacyChipsDefaultOptions>(\n 'mat-chips-default-options',\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusKeyManager} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DoCheck,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n Self,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n FormGroupDirective,\n NgControl,\n NgForm,\n Validators,\n} from '@angular/forms';\nimport {CanUpdateErrorState, ErrorStateMatcher, mixinErrorState} from '@angular/material/core';\nimport {MatLegacyFormFieldControl} from '@angular/material/legacy-form-field';\nimport {merge, Observable, Subject, Subscription} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {MatLegacyChip, MatLegacyChipEvent, MatLegacyChipSelectionChange} from './chip';\nimport {MatLegacyChipTextControl} from './chip-text-control';\n\n// Boilerplate for applying mixins to MatChipList.\n/** @docs-private */\nconst _MatChipListBase = mixinErrorState(\n class {\n /**\n * Emits whenever the component state changes and should cause the parent\n * form-field to update. Implemented as part of `MatFormFieldControl`.\n * @docs-private\n */\n readonly stateChanges = new Subject<void>();\n\n constructor(\n public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n /**\n * Form control bound to the component.\n * Implemented as part of `MatFormFieldControl`.\n * @docs-private\n */\n public ngControl: NgControl,\n ) {}\n },\n);\n\n// Increasing integer for generating unique ids for chip-list components.\nlet nextUniqueId = 0;\n\n/**\n * Change event object that is emitted when the chip list value has changed.\n * @deprecated Use `MatChipListChange` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyChipListChange {\n constructor(\n /** Chip list that emitted the event. */\n public source: MatLegacyChipList,\n /** Value of the chip list when the event was emitted. */\n public value: any,\n ) {}\n}\n\n/**\n * A material design chips component (named ChipList for its similarity to the List component).\n * @deprecated Use `MatChipList` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-chip-list',\n template: `<div class=\"mat-chip-list-wrapper\"><ng-content></ng-content></div>`,\n exportAs: 'matChipList',\n host: {\n '[attr.tabindex]': 'disabled ? null : _tabIndex',\n '[attr.aria-required]': 'role ? required : null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.aria-invalid]': 'errorState',\n '[attr.aria-multiselectable]': 'multiple',\n '[attr.role]': 'role',\n '[class.mat-chip-list-disabled]': 'disabled',\n '[class.mat-chip-list-invalid]': 'errorState',\n '[class.mat-chip-list-required]': 'required',\n '[attr.aria-orientation]': 'ariaOrientation',\n 'class': 'mat-chip-list',\n '(focus)': 'focus()',\n '(blur)': '_blur()',\n '(keydown)': '_keydown($event)',\n '[id]': '_uid',\n },\n providers: [{provide: MatLegacyFormFieldControl, useExisting: MatLegacyChipList}],\n styleUrls: ['chips.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacyChipList\n extends _MatChipListBase\n implements\n MatLegacyFormFieldControl<any>,\n ControlValueAccessor,\n AfterContentInit,\n DoCheck,\n OnInit,\n OnDestroy,\n CanUpdateErrorState\n{\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n readonly controlType: string = 'mat-chip-list';\n\n /**\n * When a chip is destroyed, we store the index of the destroyed chip until the chips\n * query list notifies about the update. This is necessary because we cannot determine an\n * appropriate chip that should receive focus until the array of chips updated completely.\n */\n private _lastDestroyedChipIndex: number | null = null;\n\n /** Subject that emits when the component has been destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n /** Subscription to focus changes in the chips. */\n private _chipFocusSubscription: Subscription | null;\n\n /** Subscription to blur changes in the chips. */\n private _chipBlurSubscription: Subscription | null;\n\n /** Subscription to selection changes in chips. */\n private _chipSelectionSubscription: Subscription | null;\n\n /** Subscription to remove changes in chips. */\n private _chipRemoveSubscription: Subscription | null;\n\n /** The chip input to add more chips */\n protected _chipInput: MatLegacyChipTextControl;\n\n /** Uid of the chip list */\n _uid: string = `mat-chip-list-${nextUniqueId++}`;\n\n /** Tab index for the chip list. */\n _tabIndex = 0;\n\n /**\n * User defined tab index.\n * When it is not null, use user defined tab index. Otherwise use _tabIndex\n */\n _userTabIndex: number | null = null;\n\n /** The FocusKeyManager which handles focus. */\n _keyManager: FocusKeyManager<MatLegacyChip>;\n\n /** Function when touched */\n _onTouched = () => {};\n\n /** Function when changed */\n _onChange: (value: any) => void = () => {};\n\n _selectionModel: SelectionModel<MatLegacyChip>;\n\n /** The array of selected chips inside chip list. */\n get selected(): MatLegacyChip[] | MatLegacyChip {\n return this.multiple ? this._selectionModel?.selected || [] : this._selectionModel?.selected[0];\n }\n\n /** The ARIA role applied to the chip list. */\n @Input()\n get role(): string | null {\n if (this._explicitRole) {\n return this._explicitRole;\n }\n\n return this.empty ? null : 'listbox';\n }\n set role(role: string | null) {\n this._explicitRole = role;\n }\n private _explicitRole?: string | null;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input('aria-describedby') userAriaDescribedBy: string;\n\n /** An object used to control when error messages are shown. */\n @Input() override errorStateMatcher: ErrorStateMatcher;\n\n /** Whether the user should be allowed to select multiple chips. */\n @Input()\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(value: BooleanInput) {\n this._multiple = coerceBooleanProperty(value);\n this._syncChipsState();\n }\n private _multiple: boolean = false;\n\n /**\n * A function to compare the option values with the selected values. The first argument\n * is a value from an option. The second is a value from the selection. A boolean\n * should be returned.\n */\n @Input()\n get compareWith(): (o1: any, o2: any) => boolean {\n return this._compareWith;\n }\n set compareWith(fn: (o1: any, o2: any) => boolean) {\n this._compareWith = fn;\n if (this._selectionModel) {\n // A different comparator means the selection could change.\n this._initializeSelection();\n }\n }\n private _compareWith = (o1: any, o2: any) => o1 === o2;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get value(): any {\n return this._value;\n }\n set value(value: any) {\n this.writeValue(value);\n this._value = value;\n }\n protected _value: any;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get id(): string {\n return this._chipInput ? this._chipInput.id : this._uid;\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get required(): boolean {\n return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;\n }\n set required(value: BooleanInput) {\n this._required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n protected _required: boolean | undefined;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get placeholder(): string {\n return this._chipInput ? this._chipInput.placeholder : this._placeholder;\n }\n set placeholder(value: string) {\n this._placeholder = value;\n this.stateChanges.next();\n }\n protected _placeholder: string;\n\n /** Whether any chips or the matChipInput inside of this chip-list has focus. */\n get focused(): boolean {\n return (this._chipInput && this._chipInput.focused) || this._hasFocusedChip();\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get empty(): boolean {\n return (!this._chipInput || this._chipInput.empty) && (!this.chips || this.chips.length === 0);\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get shouldLabelFloat(): boolean {\n return !this.empty || this.focused;\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get disabled(): boolean {\n return this.ngControl ? !!this.ngControl.disabled : this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n this._syncChipsState();\n }\n protected _disabled: boolean = false;\n\n /** Orientation of the chip list. */\n @Input('aria-orientation') ariaOrientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether or not this chip list is selectable. When a chip list is not selectable,\n * the selected states for all the chips inside the chip list are always ignored.\n */\n @Input()\n get selectable(): boolean {\n return this._selectable;\n }\n set selectable(value: BooleanInput) {\n this._selectable = coerceBooleanProperty(value);\n this._syncChipsState();\n }\n protected _selectable: boolean = true;\n\n @Input()\n set tabIndex(value: number) {\n this._userTabIndex = value;\n this._tabIndex = value;\n }\n\n /** Combined stream of all of the child chips' selection change events. */\n get chipSelectionChanges(): Observable<MatLegacyChipSelectionChange> {\n return merge(...this.chips.map(chip => chip.selectionChange));\n }\n\n /** Combined stream of all of the child chips' focus change events. */\n get chipFocusChanges(): Observable<MatLegacyChipEvent> {\n return merge(...this.chips.map(chip => chip._onFocus));\n }\n\n /** Combined stream of all of the child chips' blur change events. */\n get chipBlurChanges(): Observable<MatLegacyChipEvent> {\n return merge(...this.chips.map(chip => chip._onBlur));\n }\n\n /** Combined stream of all of the child chips' remove change events. */\n get chipRemoveChanges(): Observable<MatLegacyChipEvent> {\n return merge(...this.chips.map(chip => chip.destroyed));\n }\n\n /** Event emitted when the selected chip list value has been changed by the user. */\n @Output() readonly change = new EventEmitter<MatLegacyChipListChange>();\n\n /**\n * Event that emits whenever the raw value of the chip-list changes. This is here primarily\n * to facilitate the two-way binding for the `value` input.\n * @docs-private\n */\n @Output() readonly valueChange = new EventEmitter<any>();\n\n /** The chips contained within this chip list. */\n @ContentChildren(MatLegacyChip, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true,\n })\n chips: QueryList<MatLegacyChip>;\n\n constructor(\n protected _elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n @Optional() private _dir: Directionality,\n @Optional() _parentForm: NgForm,\n @Optional() _parentFormGroup: FormGroupDirective,\n _defaultErrorStateMatcher: ErrorStateMatcher,\n @Optional() @Self() ngControl: NgControl,\n ) {\n super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngAfterContentInit() {\n this._keyManager = new FocusKeyManager<MatLegacyChip>(this.chips)\n .withWrap()\n .withVerticalOrientation()\n .withHomeAndEnd()\n .withHorizontalOrientation(this._dir ? this._dir.value : 'ltr');\n\n if (this._dir) {\n this._dir.change\n .pipe(takeUntil(this._destroyed))\n .subscribe(dir => this._keyManager.withHorizontalOrientation(dir));\n }\n\n this._keyManager.tabOut.subscribe(() => this._allowFocusEscape());\n\n // When the list changes, re-subscribe\n this.chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {\n if (this.disabled || !this.selectable) {\n // Since this happens after the content has been\n // checked, we need to defer it to the next tick.\n Promise.resolve().then(() => {\n this._syncChipsState();\n });\n }\n\n this._resetChips();\n\n // Reset chips selected/deselected status\n this._initializeSelection();\n\n // Check to see if we need to update our tab index\n this._updateTabIndex();\n\n // Check to see if we have a destroyed chip and need to refocus\n this._updateFocusForDestroyedChips();\n\n this.stateChanges.next();\n });\n }\n\n ngOnInit() {\n this._selectionModel = new SelectionModel<MatLegacyChip>(this.multiple, undefined, false);\n this.stateChanges.next();\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n // We need to re-evaluate this on every change detection cycle, because there are some\n // error triggers that we can't subscribe to (e.g. parent form submissions). This means\n // that whatever logic is in here has to be super lean or we risk destroying the performance.\n this.updateErrorState();\n\n if (this.ngControl.disabled !== this._disabled) {\n this.disabled = !!this.ngControl.disabled;\n }\n }\n }\n\n ngOnDestroy() {\n this._keyManager?.destroy();\n this._destroyed.next();\n this._destroyed.complete();\n this.stateChanges.complete();\n this._dropSubscriptions();\n }\n\n /** Associates an HTML input element with this chip list. */\n registerInput(inputElement: MatLegacyChipTextControl): void {\n this._chipInput = inputElement;\n\n // We use this attribute to match the chip list to its input in test harnesses.\n // Set the attribute directly here to avoid \"changed after checked\" errors.\n this._elementRef.nativeElement.setAttribute('data-mat-chip-input', inputElement.id);\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n setDescribedByIds(ids: string[]) {\n if (ids.length) {\n this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n } else {\n this._elementRef.nativeElement.removeAttribute('aria-describedby');\n }\n }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: any): void {\n if (this.chips) {\n this._setSelectionByValue(value, false);\n }\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void): void {\n this._onChange = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n onContainerClick(event: MouseEvent) {\n if (!this._originatesFromChip(event)) {\n this.focus();\n }\n }\n\n /**\n * Focuses the first non-disabled chip in this chip list, or the associated input when there\n * are no eligible chips.\n */\n focus(options?: FocusOptions): void {\n if (this.disabled) {\n return;\n }\n\n // TODO: ARIA says this should focus the first `selected` chip if any are selected.\n // Focus on first element if there's no chipInput inside chip-list\n if (this._chipInput && this._chipInput.focused) {\n // do nothing\n } else if (this.chips.length > 0) {\n this._keyManager.setFirstItemActive();\n this.stateChanges.next();\n } else {\n this._focusInput(options);\n this.stateChanges.next();\n }\n }\n\n /** Attempt to focus an input if we have one. */\n _focusInput(options?: FocusOptions) {\n if (this._chipInput) {\n this._chipInput.focus(options);\n }\n }\n\n /**\n * Pass events to the keyboard manager. Available here for tests.\n */\n _keydown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n\n if (target && target.classList.contains('mat-chip')) {\n this._keyManager.onKeydown(event);\n this.stateChanges.next();\n }\n }\n\n /**\n * Check the tab index as you should not be allowed to focus an empty list.\n */\n protected _updateTabIndex(): void {\n // If we have 0 chips, we should not allow keyboard focus\n this._tabIndex = this._userTabIndex || (this.chips.length === 0 ? -1 : 0);\n }\n\n /**\n * If the amount of chips changed, we need to update the\n * key manager state and focus the next closest chip.\n */\n protected _updateFocusForDestroyedChips() {\n // Move focus to the closest chip. If no other chips remain, focus the chip-list itself.\n if (this._lastDestroyedChipIndex != null) {\n if (this.chips.length) {\n const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);\n this._keyManager.setActiveItem(newChipIndex);\n } else {\n this.focus();\n }\n }\n\n this._lastDestroyedChipIndex = null;\n }\n\n /**\n * Utility to ensure all indexes are valid.\n *\n * @param index The index to be checked.\n * @returns True if the index is valid for our list of chips.\n */\n private _isValidIndex(index: number): boolean {\n return index >= 0 && index < this.chips.length;\n }\n\n _setSelectionByValue(value: any, isUserInput: boolean = true) {\n this._clearSelection();\n this.chips.forEach(chip => chip.deselect());\n\n if (Array.isArray(value)) {\n value.forEach(currentValue => this._selectValue(currentValue, isUserInput));\n this._sortValues();\n } else {\n const correspondingChip = this._selectValue(value, isUserInput);\n\n // Shift focus to the active item. Note that we shouldn't do this in multiple\n // mode, because we don't know what chip the user interacted with last.\n if (correspondingChip) {\n if (isUserInput) {\n this._keyManager.setActiveItem(correspondingChip);\n }\n }\n }\n }\n\n /**\n * Finds and selects the chip based on its value.\n * @returns Chip that has the corresponding value.\n */\n private _selectValue(value: any, isUserInput: boolean = true): MatLegacyChip | undefined {\n const correspondingChip = this.chips.find(chip => {\n return chip.value != null && this._compareWith(chip.value, value);\n });\n\n if (correspondingChip) {\n isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();\n this._selectionModel.select(correspondingChip);\n }\n\n return correspondingChip;\n }\n\n private _initializeSelection(): void {\n // Defer setting the value in order to avoid the \"Expression\n // has changed after it was checked\" errors from Angular.\n Promise.resolve().then(() => {\n if (this.ngControl || this._value) {\n this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value, false);\n this.stateChanges.next();\n }\n });\n }\n\n /**\n * Deselects every chip in the list.\n * @param skip Chip that should not be deselected.\n */\n private _clearSelection(skip?: MatLegacyChip): void {\n this._selectionModel.clear();\n this.chips.forEach(chip => {\n if (chip !== skip) {\n chip.deselect();\n }\n });\n this.stateChanges.next();\n }\n\n /**\n * Sorts the model values, ensuring that they keep the same\n * order that they have in the panel.\n */\n private _sortValues(): void {\n if (this._multiple) {\n this._selectionModel.clear();\n\n this.chips.forEach(chip => {\n if (chip.selected) {\n this._selectionModel.select(chip);\n }\n });\n this.stateChanges.next();\n }\n }\n\n /** Emits change event to set the model value. */\n private _propagateChanges(fallbackValue?: any): void {\n let valueToEmit: any = null;\n\n if (Array.isArray(this.selected)) {\n valueToEmit = this.selected.map(chip => chip.value);\n } else {\n valueToEmit = this.selected ? this.selected.value : fallbackValue;\n }\n this._value = valueToEmit;\n this.change.emit(new MatLegacyChipListChange(this, valueToEmit));\n this.valueChange.emit(valueToEmit);\n this._onChange(valueToEmit);\n this._changeDetectorRef.markForCheck();\n }\n\n /** When blurred, mark the field as touched when focus moved outside the chip list. */\n _blur() {\n if (!this._hasFocusedChip()) {\n this._keyManager.setActiveItem(-1);\n }\n\n if (!this.disabled) {\n if (this._chipInput) {\n // If there's a chip input, we should check whether the focus moved to chip input.\n // If the focus is not moved to chip input, mark the field as touched. If the focus moved\n // to chip input, do nothing.\n // Timeout is needed to wait for the focus() event trigger on chip input.\n setTimeout(() => {\n if (!this.focused) {\n this._markAsTouched();\n }\n });\n } else {\n // If there's no chip input, then mark the field as touched.\n this._markAsTouched();\n }\n }\n }\n\n /** Mark the field as touched */\n _markAsTouched() {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n\n /**\n * Removes the `tabindex` from the chip list and resets it back afterwards, allowing the\n * user to tab out of it. This prevents the list from capturing focus and redirecting\n * it back to the first chip, creating a focus trap, if it user tries to tab away.\n */\n _allowFocusEscape() {\n if (this._tabIndex !== -1) {\n this._tabIndex = -1;\n\n setTimeout(() => {\n this._tabIndex = this._userTabIndex || 0;\n this._changeDetectorRef.markForCheck();\n });\n }\n }\n\n private _resetChips() {\n this._dropSubscriptions();\n this._listenToChipsFocus();\n this._listenToChipsSelection();\n this._listenToChipsRemoved();\n }\n\n private _dropSubscriptions() {\n if (this._chipFocusSubscription) {\n this._chipFocusSubscription.unsubscribe();\n this._chipFocusSubscription = null;\n }\n\n if (this._chipBlurSubscription) {\n this._chipBlurSubscription.unsubscribe();\n this._chipBlurSubscription = null;\n }\n\n if (this._chipSelectionSubscription) {\n this._chipSelectionSubscription.unsubscribe();\n this._chipSelectionSubscription = null;\n }\n\n if (this._chipRemoveSubscription) {\n this._chipRemoveSubscription.unsubscribe();\n this._chipRemoveSubscription = null;\n }\n }\n\n /** Listens to user-generated selection events on each chip. */\n private _listenToChipsSelection(): void {\n this._chipSelectionSubscription = this.chipSelectionChanges.subscribe(event => {\n event.source.selected\n ? this._selectionModel.select(event.source)\n : this._selectionModel.deselect(event.source);\n\n // For single selection chip list, make sure the deselected value is unselected.\n if (!this.multiple) {\n this.chips.forEach(chip => {\n if (!this._selectionModel.isSelected(chip) && chip.selected) {\n chip.deselect();\n }\n });\n }\n\n if (event.isUserInput) {\n this._propagateChanges();\n }\n });\n }\n\n /** Listens to user-generated selection events on each chip. */\n private _listenToChipsFocus(): void {\n this._chipFocusSubscription = this.chipFocusChanges.subscribe(event => {\n let chipIndex: number = this.chips.toArray().indexOf(event.chip);\n\n if (this._isValidIndex(chipIndex)) {\n this._keyManager.updateActiveItem(chipIndex);\n }\n this.stateChanges.next();\n });\n\n this._chipBlurSubscription = this.chipBlurChanges.subscribe(() => {\n this._blur();\n this.stateChanges.next();\n });\n }\n\n private _listenToChipsRemoved(): void {\n this._chipRemoveSubscription = this.chipRemoveChanges.subscribe(event => {\n const chip = event.chip;\n const chipIndex = this.chips.toArray().indexOf(event.chip);\n\n // In case the chip that will be removed is currently focused, we temporarily store\n // the index in order to be able to determine an appropriate sibling chip that will\n // receive focus.\n if (this._isValidIndex(chipIndex) && chip._hasFocus) {\n this._lastDestroyedChipIndex = chipIndex;\n }\n });\n }\n\n /** Checks whether an event comes from inside a chip element. */\n private _originatesFromChip(event: Event): boolean {\n let currentElement = event.target as HTMLElement | null;\n\n while (currentElement && currentElement !== this._elementRef.nativeElement) {\n if (currentElement.classList.contains('mat-chip')) {\n return true;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return false;\n }\n\n /** Checks whether any of the chips is focused. */\n private _hasFocusedChip() {\n return this.chips && this.chips.some(chip => chip._hasFocus);\n }\n\n /** Syncs the list's state with the individual chips. */\n private _syncChipsState() {\n if (this.chips) {\n this.chips.forEach(chip => {\n chip._chipListDisabled = this._disabled;\n chip._chipListMultiple = this.multiple;\n chip.chipListSelectable = this._selectable;\n });\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ENTER} from '@angular/cdk/keycodes';\nimport {NgModule} from '@angular/core';\nimport {ErrorStateMatcher, MatCommonModule} from '@angular/material/core';\nimport {\n MatLegacyChip,\n MatLegacyChipAvatar,\n MatLegacyChipRemove,\n MatLegacyChipTrailingIcon,\n} from './chip';\nimport {\n MAT_LEGACY_CHIPS_DEFAULT_OPTIONS,\n MatLegacyChipsDefaultOptions,\n} from './chip-default-options';\nimport {MatLegacyChipInput} from './chip-input';\nimport {MatLegacyChipList} from './chip-list';\n\nconst CHIP_DECLARATIONS = [\n MatLegacyChipList,\n MatLegacyChip,\n MatLegacyChipInput,\n MatLegacyChipRemove,\n MatLegacyChipAvatar,\n MatLegacyChipTrailingIcon,\n];\n\n/**\n * @deprecated Use `MatChipsModule` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatCommonModule],\n exports: CHIP_DECLARATIONS,\n declarations: CHIP_DECLARATIONS,\n providers: [\n ErrorStateMatcher,\n {\n provide: MAT_LEGACY_CHIPS_DEFAULT_OPTIONS,\n useValue: {\n separatorKeyCodes: [ENTER],\n } as MatLegacyChipsDefaultOptions,\n },\n ],\n})\nexport class MatLegacyChipsModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatDivider} from './divider';\n\n@NgModule({\n imports: [MatCommonModule],\n exports: [MatDivider, MatCommonModule],\n declarations: [MatDivider],\n})\nexport class MatDividerModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, InjectionToken, Input, OnChanges, OnDestroy, SimpleChanges} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/** Used to generate unique ID for each accordion. */\nlet nextId = 0;\n\n/**\n * Injection token that can be used to reference instances of `CdkAccordion`. It serves\n * as alternative token to the actual `CdkAccordion` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_ACCORDION = new InjectionToken<CdkAccordion>('CdkAccordion');\n\n/**\n * Directive whose purpose is to manage the expanded state of CdkAccordionItem children.\n */\n@Directive({\n selector: 'cdk-accordion, [cdkAccordion]',\n exportAs: 'cdkAccordion',\n providers: [{provide: CDK_ACCORDION, useExisting: CdkAccordion}],\n})\nexport class CdkAccordion implements OnDestroy, OnChanges {\n /** Emits when the state of the accordion changes */\n readonly _stateChanges = new Subject<SimpleChanges>();\n\n /** Stream that emits true/false when openAll/closeAll is triggered. */\n readonly _openCloseAllActions: Subject<boolean> = new Subject<boolean>();\n\n /** A readonly id value to use for unique selection coordination. */\n readonly id: string = `cdk-accordion-${nextId++}`;\n\n /** Whether the accordion should allow multiple expanded accordion items simultaneously. */\n @Input()\n get multi(): boolean {\n return this._multi;\n }\n set multi(multi: BooleanInput) {\n this._multi = coerceBooleanProperty(multi);\n }\n private _multi: boolean = false;\n\n /** Opens all enabled accordion items in an accordion where multi is enabled. */\n openAll(): void {\n if (this._multi) {\n this._openCloseAllActions.next(true);\n }\n }\n\n /** Closes all enabled accordion items. */\n closeAll(): void {\n this._openCloseAllActions.next(false);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n this._stateChanges.next(changes);\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n this._openCloseAllActions.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkAccordion} from './accordion';\nimport {CdkAccordionItem} from './accordion-item';\n\n@NgModule({\n exports: [CdkAccordion, CdkAccordionItem],\n declarations: [CdkAccordion, CdkAccordionItem],\n})\nexport class CdkAccordionModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusableOption, FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {ENTER, hasModifierKey, SPACE} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n Host,\n Inject,\n Input,\n OnDestroy,\n Optional,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {HasTabIndex, mixinTabIndex} from '@angular/material/core';\nimport {EMPTY, merge, Subscription} from 'rxjs';\nimport {filter} from 'rxjs/operators';\nimport {MatAccordionTogglePosition} from './accordion-base';\nimport {matExpansionAnimations} from './expansion-animations';\nimport {\n MatExpansionPanel,\n MatExpansionPanelDefaultOptions,\n MAT_EXPANSION_PANEL_DEFAULT_OPTIONS,\n} from './expansion-panel';\n\n// Boilerplate for applying mixins to MatExpansionPanelHeader.\n/** @docs-private */\nabstract class MatExpansionPanelHeaderBase {\n abstract readonly disabled: boolean;\n}\nconst _MatExpansionPanelHeaderMixinBase = mixinTabIndex(MatExpansionPanelHeaderBase);\n\n/**\n * Header element of a `<mat-expansion-panel>`.\n */\n@Component({\n selector: 'mat-expansion-panel-header',\n styleUrls: ['expansion-panel-header.css'],\n templateUrl: 'expansion-panel-header.html',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['tabIndex'],\n animations: [matExpansionAnimations.indicatorRotate],\n host: {\n 'class': 'mat-expansion-panel-header mat-focus-indicator',\n 'role': 'button',\n '[attr.id]': 'panel._headerId',\n '[attr.tabindex]': 'tabIndex',\n '[attr.aria-controls]': '_getPanelId()',\n '[attr.aria-expanded]': '_isExpanded()',\n '[attr.aria-disabled]': 'panel.disabled',\n '[class.mat-expanded]': '_isExpanded()',\n '[class.mat-expansion-toggle-indicator-after]': `_getTogglePosition() === 'after'`,\n '[class.mat-expansion-toggle-indicator-before]': `_getTogglePosition() === 'before'`,\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n '[style.height]': '_getHeaderHeight()',\n '(click)': '_toggle()',\n '(keydown)': '_keydown($event)',\n },\n})\nexport class MatExpansionPanelHeader\n extends _MatExpansionPanelHeaderMixinBase\n implements AfterViewInit, OnDestroy, FocusableOption, HasTabIndex\n{\n private _parentChangeSubscription = Subscription.EMPTY;\n\n constructor(\n @Host() public panel: MatExpansionPanel,\n private _element: ElementRef,\n private _focusMonitor: FocusMonitor,\n private _changeDetectorRef: ChangeDetectorRef,\n @Inject(MAT_EXPANSION_PANEL_DEFAULT_OPTIONS)\n @Optional()\n defaultOptions?: MatExpansionPanelDefaultOptions,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n @Attribute('tabindex') tabIndex?: string,\n ) {\n super();\n const accordionHideToggleChange = panel.accordion\n ? panel.accordion._stateChanges.pipe(\n filter(changes => !!(changes['hideToggle'] || changes['togglePosition'])),\n )\n : EMPTY;\n this.tabIndex = parseInt(tabIndex || '') || 0;\n\n // Since the toggle state depends on an @Input on the panel, we\n // need to subscribe and trigger change detection manually.\n this._parentChangeSubscription = merge(\n panel.opened,\n panel.closed,\n accordionHideToggleChange,\n panel._inputChanges.pipe(\n filter(changes => {\n return !!(changes['hideToggle'] || changes['disabled'] || changes['togglePosition']);\n }),\n ),\n ).subscribe(() => this._changeDetectorRef.markForCheck());\n\n // Avoids focus being lost if the panel contained the focused element and was closed.\n panel.closed\n .pipe(filter(() => panel._containsFocus()))\n .subscribe(() => _focusMonitor.focusVia(_element, 'program'));\n\n if (defaultOptions) {\n this.expandedHeight = defaultOptions.expandedHeight;\n this.collapsedHeight = defaultOptions.collapsedHeight;\n }\n }\n\n /** Height of the header while the panel is expanded. */\n @Input() expandedHeight: string;\n\n /** Height of the header while the panel is collapsed. */\n @Input() collapsedHeight: string;\n\n /**\n * Whether the associated panel is disabled. Implemented as a part of `FocusableOption`.\n * @docs-private\n */\n get disabled(): boolean {\n return this.panel.disabled;\n }\n\n /** Toggles the expanded state of the panel. */\n _toggle(): void {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }\n\n /** Gets whether the panel is expanded. */\n _isExpanded(): boolean {\n return this.panel.expanded;\n }\n\n /** Gets the expanded state string of the panel. */\n _getExpandedState(): string {\n return this.panel._getExpandedState();\n }\n\n /** Gets the panel id. */\n _getPanelId(): string {\n return this.panel.id;\n }\n\n /** Gets the toggle position for the header. */\n _getTogglePosition(): MatAccordionTogglePosition {\n return this.panel.togglePosition;\n }\n\n /** Gets whether the expand indicator should be shown. */\n _showToggle(): boolean {\n return !this.panel.hideToggle && !this.panel.disabled;\n }\n\n /**\n * Gets the current height of the header. Null if no custom height has been\n * specified, and if the default height from the stylesheet should be used.\n */\n _getHeaderHeight(): string | null {\n const isExpanded = this._isExpanded();\n if (isExpanded && this.expandedHeight) {\n return this.expandedHeight;\n } else if (!isExpanded && this.collapsedHeight) {\n return this.collapsedHeight;\n }\n return null;\n }\n\n /** Handle keydown event calling to toggle() if appropriate. */\n _keydown(event: KeyboardEvent) {\n switch (event.keyCode) {\n // Toggle for space and enter keys.\n case SPACE:\n case ENTER:\n if (!hasModifierKey(event)) {\n event.preventDefault();\n this._toggle();\n }\n\n break;\n default:\n if (this.panel.accordion) {\n this.panel.accordion._handleHeaderKeydown(event);\n }\n\n return;\n }\n }\n\n /**\n * Focuses the panel header. Implemented as a part of `FocusableOption`.\n * @param origin Origin of the action that triggered the focus.\n * @docs-private\n */\n focus(origin?: FocusOrigin, options?: FocusOptions) {\n if (origin) {\n this._focusMonitor.focusVia(this._element, origin, options);\n } else {\n this._element.nativeElement.focus(options);\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor.monitor(this._element).subscribe(origin => {\n if (origin && this.panel.accordion) {\n this.panel.accordion._handleHeaderFocus(this);\n }\n });\n }\n\n ngOnDestroy() {\n this._parentChangeSubscription.unsubscribe();\n this._focusMonitor.stopMonitoring(this._element);\n }\n}\n\n/**\n * Description element of a `<mat-expansion-panel-header>`.\n */\n@Directive({\n selector: 'mat-panel-description',\n host: {\n class: 'mat-expansion-panel-header-description',\n },\n})\nexport class MatExpansionPanelDescription {}\n\n/**\n * Title element of a `<mat-expansion-panel-header>`.\n */\n@Directive({\n selector: 'mat-panel-title',\n host: {\n class: 'mat-expansion-panel-header-title',\n },\n})\nexport class MatExpansionPanelTitle {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CdkAccordionModule} from '@angular/cdk/accordion';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatAccordion} from './accordion';\nimport {MatExpansionPanel, MatExpansionPanelActionRow} from './expansion-panel';\nimport {MatExpansionPanelContent} from './expansion-panel-content';\nimport {\n MatExpansionPanelDescription,\n MatExpansionPanelHeader,\n MatExpansionPanelTitle,\n} from './expansion-panel-header';\n\n@NgModule({\n imports: [CommonModule, MatCommonModule, CdkAccordionModule, PortalModule],\n exports: [\n MatAccordion,\n MatExpansionPanel,\n MatExpansionPanelActionRow,\n MatExpansionPanelHeader,\n MatExpansionPanelTitle,\n MatExpansionPanelDescription,\n MatExpansionPanelContent,\n ],\n declarations: [\n MatAccordion,\n MatExpansionPanel,\n MatExpansionPanelActionRow,\n MatExpansionPanelHeader,\n MatExpansionPanelTitle,\n MatExpansionPanelDescription,\n MatExpansionPanelContent,\n ],\n})\nexport class MatExpansionModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, Inject, Optional} from '@angular/core';\nimport {MAT_EXPANSION_PANEL, MatExpansionPanelBase} from './expansion-panel-base';\n\n/**\n * Expansion panel content that will be rendered lazily\n * after the panel is opened for the first time.\n */\n@Directive({\n selector: 'ng-template[matExpansionPanelContent]',\n})\nexport class MatExpansionPanelContent {\n constructor(\n public _template: TemplateRef<any>,\n @Inject(MAT_EXPANSION_PANEL) @Optional() public _expansionPanel?: MatExpansionPanelBase,\n ) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n AfterContentChecked,\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n ElementRef,\n Inject,\n Input,\n NgZone,\n Optional,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n OnDestroy,\n InjectionToken,\n} from '@angular/core';\nimport {CanColor, mixinColor, ThemePalette} from '@angular/material/core';\nimport {fromEvent, merge, Subject} from 'rxjs';\nimport {startWith, take, takeUntil} from 'rxjs/operators';\nimport {MatLegacyError} from './error';\nimport {_MAT_LEGACY_HINT, MatLegacyHint} from './hint';\nimport {MatLegacyLabel} from './label';\nimport {MatLegacyPlaceholder} from './placeholder';\nimport {MatLegacyPrefix} from './prefix';\nimport {MatLegacySuffix} from './suffix';\nimport {Platform} from '@angular/cdk/platform';\nimport {AbstractControlDirective} from '@angular/forms';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {\n getMatFormFieldDuplicatedHintError,\n getMatFormFieldMissingControlError,\n getMatFormFieldPlaceholderConflictError,\n matFormFieldAnimations,\n MatFormFieldControl,\n MAT_ERROR,\n MAT_FORM_FIELD,\n MAT_PREFIX,\n MAT_SUFFIX,\n} from '@angular/material/form-field';\n\nlet nextUniqueId = 0;\nconst floatingLabelScale = 0.75;\nconst outlineGapPadding = 5;\n\n/**\n * Boilerplate for applying mixins to MatFormField.\n * @docs-private\n */\nconst _MatFormFieldBase = mixinColor(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n 'primary',\n);\n\n/**\n * Possible appearance styles for the form field.\n * @deprecated Use `MatFormFieldAppearance` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport type MatLegacyFormFieldAppearance = 'legacy' | 'standard' | 'fill' | 'outline';\n\n/**\n * Possible values for the \"floatLabel\" form field input.\n * @deprecated Use `FloatLabelType` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport type LegacyFloatLabelType = 'always' | 'never' | 'auto';\n\n/**\n * Represents the default options for the form field that can be configured\n * using the `MAT_FORM_FIELD_DEFAULT_OPTIONS` injection token.\n * @deprecated Use `MatFormFieldDefaultOptions` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport interface MatLegacyFormFieldDefaultOptions {\n /** Default form field appearance style. */\n appearance?: MatLegacyFormFieldAppearance;\n /** Default color of the form field. */\n color?: ThemePalette;\n /** Whether the required marker should be hidden by default. */\n hideRequiredMarker?: boolean;\n /**\n * Whether the label for form fields should by default float `always`,\n * `never`, or `auto` (only when necessary).\n */\n floatLabel?: LegacyFloatLabelType;\n}\n\n/**\n * Injection token that can be used to configure the\n * default options for all form field within an app.\n * @deprecated Use `MAT_FORM_FIELD_DEFAULT_OPTIONS` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS =\n new InjectionToken<MatLegacyFormFieldDefaultOptions>('MAT_FORM_FIELD_DEFAULT_OPTIONS');\n\n/**\n * Container for form controls that applies Material Design styling and behavior.\n * @deprecated Use `MatFormField` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-form-field',\n exportAs: 'matFormField',\n templateUrl: 'form-field.html',\n // MatInput is a directive and can't have styles, so we need to include its styles here\n // in form-field-input.css. The MatInput styles are fairly minimal so it shouldn't be a\n // big deal for people who aren't using MatInput.\n styleUrls: [\n 'form-field.css',\n 'form-field-fill.css',\n 'form-field-input.css',\n 'form-field-legacy.css',\n 'form-field-outline.css',\n 'form-field-standard.css',\n ],\n animations: [matFormFieldAnimations.transitionMessages],\n host: {\n 'class': 'mat-form-field',\n '[class.mat-form-field-appearance-standard]': 'appearance == \"standard\"',\n '[class.mat-form-field-appearance-fill]': 'appearance == \"fill\"',\n '[class.mat-form-field-appearance-outline]': 'appearance == \"outline\"',\n '[class.mat-form-field-appearance-legacy]': 'appearance == \"legacy\"',\n '[class.mat-form-field-invalid]': '_control.errorState',\n '[class.mat-form-field-can-float]': '_canLabelFloat()',\n '[class.mat-form-field-should-float]': '_shouldLabelFloat()',\n '[class.mat-form-field-has-label]': '_hasFloatingLabel()',\n '[class.mat-form-field-hide-placeholder]': '_hideControlPlaceholder()',\n '[class.mat-form-field-disabled]': '_control.disabled',\n '[class.mat-form-field-autofilled]': '_control.autofilled',\n '[class.mat-focused]': '_control.focused',\n '[class.ng-untouched]': '_shouldForward(\"untouched\")',\n '[class.ng-touched]': '_shouldForward(\"touched\")',\n '[class.ng-pristine]': '_shouldForward(\"pristine\")',\n '[class.ng-dirty]': '_shouldForward(\"dirty\")',\n '[class.ng-valid]': '_shouldForward(\"valid\")',\n '[class.ng-invalid]': '_shouldForward(\"invalid\")',\n '[class.ng-pending]': '_shouldForward(\"pending\")',\n '[class._mat-animation-noopable]': '!_animationsEnabled',\n },\n inputs: ['color'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{provide: MAT_FORM_FIELD, useExisting: MatLegacyFormField}],\n})\nexport class MatLegacyFormField\n extends _MatFormFieldBase\n implements AfterContentInit, AfterContentChecked, AfterViewInit, OnDestroy, CanColor\n{\n /**\n * Whether the outline gap needs to be calculated\n * immediately on the next change detection run.\n */\n private _outlineGapCalculationNeededImmediately = false;\n\n /** Whether the outline gap needs to be calculated next time the zone has stabilized. */\n private _outlineGapCalculationNeededOnStable = false;\n\n private readonly _destroyed = new Subject<void>();\n\n /** The form field appearance style. */\n @Input()\n get appearance(): MatLegacyFormFieldAppearance {\n return this._appearance;\n }\n set appearance(value: MatLegacyFormFieldAppearance) {\n const oldValue = this._appearance;\n\n this._appearance = value || this._defaults?.appearance || 'legacy';\n\n if (this._appearance === 'outline' && oldValue !== value) {\n this._outlineGapCalculationNeededOnStable = true;\n }\n }\n _appearance: MatLegacyFormFieldAppearance;\n\n /** Whether the required marker should be hidden. */\n @Input()\n get hideRequiredMarker(): boolean {\n return this._hideRequiredMarker;\n }\n set hideRequiredMarker(value: BooleanInput) {\n this._hideRequiredMarker = coerceBooleanProperty(value);\n }\n private _hideRequiredMarker = false;\n\n /** Override for the logic that disables the label animation in certain cases. */\n private _showAlwaysAnimate = false;\n\n /** Whether the floating label should always float or not. */\n _shouldAlwaysFloat(): boolean {\n return this.floatLabel === 'always' && !this._showAlwaysAnimate;\n }\n\n /** Whether the label can float or not. */\n _canLabelFloat(): boolean {\n return this.floatLabel !== 'never';\n }\n\n /** State of the mat-hint and mat-error animations. */\n _subscriptAnimationState: string = '';\n\n /** Text for the form field hint. */\n @Input()\n get hintLabel(): string {\n return this._hintLabel;\n }\n set hintLabel(value: string) {\n this._hintLabel = value;\n this._processHints();\n }\n private _hintLabel = '';\n\n // Unique id for the hint label.\n readonly _hintLabelId: string = `mat-hint-${nextUniqueId++}`;\n\n // Unique id for the label element.\n readonly _labelId = `mat-form-field-label-${nextUniqueId++}`;\n\n /**\n * Whether the label should always float, never float or float as the user types.\n *\n * Note: only the legacy appearance supports the `never` option. `never` was originally added as a\n * way to make the floating label emulate the behavior of a standard input placeholder. However\n * the form field now supports both floating labels and placeholders. Therefore in the non-legacy\n * appearances the `never` option has been disabled in favor of just using the placeholder.\n */\n @Input()\n get floatLabel(): LegacyFloatLabelType {\n return this.appearance !== 'legacy' && this._floatLabel === 'never' ? 'auto' : this._floatLabel;\n }\n set floatLabel(value: LegacyFloatLabelType) {\n if (value !== this._floatLabel) {\n this._floatLabel = value || this._getDefaultFloatLabelState();\n this._changeDetectorRef.markForCheck();\n }\n }\n private _floatLabel: LegacyFloatLabelType;\n\n /** Whether the Angular animations are enabled. */\n _animationsEnabled: boolean;\n\n @ViewChild('connectionContainer', {static: true}) _connectionContainerRef: ElementRef;\n @ViewChild('inputContainer') _inputContainerRef: ElementRef;\n @ViewChild('label') private _label: ElementRef<HTMLElement>;\n\n @ContentChild(MatFormFieldControl) _controlNonStatic: MatFormFieldControl<any>;\n @ContentChild(MatFormFieldControl, {static: true}) _controlStatic: MatFormFieldControl<any>;\n get _control() {\n // TODO(crisbeto): we need this workaround in order to support both Ivy and ViewEngine.\n // We should clean this up once Ivy is the default renderer.\n return this._explicitFormFieldControl || this._controlNonStatic || this._controlStatic;\n }\n set _control(value) {\n this._explicitFormFieldControl = value;\n }\n private _explicitFormFieldControl: MatFormFieldControl<any>;\n\n @ContentChild(MatLegacyLabel) _labelChildNonStatic: MatLegacyLabel;\n @ContentChild(MatLegacyLabel, {static: true}) _labelChildStatic: MatLegacyLabel;\n @ContentChild(MatLegacyPlaceholder) _placeholderChild: MatLegacyPlaceholder;\n\n @ContentChildren(MAT_ERROR, {descendants: true}) _errorChildren: QueryList<MatLegacyError>;\n @ContentChildren(_MAT_LEGACY_HINT, {descendants: true}) _hintChildren: QueryList<MatLegacyHint>;\n @ContentChildren(MAT_PREFIX, {descendants: true})\n _prefixChildren: QueryList<MatLegacyPrefix>;\n @ContentChildren(MAT_SUFFIX, {descendants: true})\n _suffixChildren: QueryList<MatLegacySuffix>;\n\n constructor(\n elementRef: ElementRef,\n private _changeDetectorRef: ChangeDetectorRef,\n @Optional() private _dir: Directionality,\n @Optional()\n @Inject(MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS)\n private _defaults: MatLegacyFormFieldDefaultOptions,\n private _platform: Platform,\n private _ngZone: NgZone,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) _animationMode: string,\n ) {\n super(elementRef);\n\n this.floatLabel = this._getDefaultFloatLabelState();\n this._animationsEnabled = _animationMode !== 'NoopAnimations';\n\n // Set the default through here so we invoke the setter on the first run.\n this.appearance = _defaults?.appearance || 'legacy';\n if (_defaults) {\n this._hideRequiredMarker = Boolean(_defaults.hideRequiredMarker);\n if (_defaults.color) {\n this.color = this.defaultColor = _defaults.color;\n }\n }\n }\n\n /**\n * Gets the id of the label element. If no label is present, returns `null`.\n */\n getLabelId(): string | null {\n return this._hasFloatingLabel() ? this._labelId : null;\n }\n\n /**\n * Gets an ElementRef for the element that a overlay attached to the form field should be\n * positioned relative to.\n */\n getConnectedOverlayOrigin(): ElementRef {\n return this._connectionContainerRef || this._elementRef;\n }\n\n ngAfterContentInit() {\n this._validateControlChild();\n\n const control = this._control;\n\n if (control.controlType) {\n this._elementRef.nativeElement.classList.add(`mat-form-field-type-${control.controlType}`);\n }\n\n // Subscribe to changes in the child control state in order to update the form field UI.\n control.stateChanges.pipe(startWith(null)).subscribe(() => {\n this._validatePlaceholders();\n this._syncDescribedByIds();\n this._changeDetectorRef.markForCheck();\n });\n\n // Run change detection if the value changes.\n if (control.ngControl && control.ngControl.valueChanges) {\n control.ngControl.valueChanges\n .pipe(takeUntil(this._destroyed))\n .subscribe(() => this._changeDetectorRef.markForCheck());\n }\n\n // Note that we have to run outside of the `NgZone` explicitly,\n // in order to avoid throwing users into an infinite loop\n // if `zone-patch-rxjs` is included.\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (this._outlineGapCalculationNeededOnStable) {\n this.updateOutlineGap();\n }\n });\n });\n\n // Run change detection and update the outline if the suffix or prefix changes.\n merge(this._prefixChildren.changes, this._suffixChildren.changes).subscribe(() => {\n this._outlineGapCalculationNeededOnStable = true;\n this._changeDetectorRef.markForCheck();\n });\n\n // Re-validate when the number of hints changes.\n this._hintChildren.changes.pipe(startWith(null)).subscribe(() => {\n this._processHints();\n this._changeDetectorRef.markForCheck();\n });\n\n // Update the aria-described by when the number of errors changes.\n this._errorChildren.changes.pipe(startWith(null)).subscribe(() => {\n this._syncDescribedByIds();\n this._changeDetectorRef.markForCheck();\n });\n\n if (this._dir) {\n this._dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (typeof requestAnimationFrame === 'function') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => this.updateOutlineGap());\n });\n } else {\n this.updateOutlineGap();\n }\n });\n }\n }\n\n ngAfterContentChecked() {\n this._validateControlChild();\n if (this._outlineGapCalculationNeededImmediately) {\n this.updateOutlineGap();\n }\n }\n\n ngAfterViewInit() {\n // Avoid animations on load.\n this._subscriptAnimationState = 'enter';\n this._changeDetectorRef.detectChanges();\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /**\n * Determines whether a class from the AbstractControlDirective\n * should be forwarded to the host element.\n */\n _shouldForward(prop: keyof AbstractControlDirective): boolean {\n const control = this._control ? this._control.ngControl : null;\n return control && control[prop];\n }\n\n _hasPlaceholder() {\n return !!((this._control && this._control.placeholder) || this._placeholderChild);\n }\n\n _hasLabel() {\n return !!(this._labelChildNonStatic || this._labelChildStatic);\n }\n\n _shouldLabelFloat() {\n return (\n this._canLabelFloat() &&\n ((this._control && this._control.shouldLabelFloat) || this._shouldAlwaysFloat())\n );\n }\n\n _hideControlPlaceholder() {\n // In the legacy appearance the placeholder is promoted to a label if no label is given.\n return (\n (this.appearance === 'legacy' && !this._hasLabel()) ||\n (this._hasLabel() && !this._shouldLabelFloat())\n );\n }\n\n _hasFloatingLabel() {\n // In the legacy appearance the placeholder is promoted to a label if no label is given.\n return this._hasLabel() || (this.appearance === 'legacy' && this._hasPlaceholder());\n }\n\n /** Determines whether to display hints or errors. */\n _getDisplayedMessages(): 'error' | 'hint' {\n return this._errorChildren && this._errorChildren.length > 0 && this._control.errorState\n ? 'error'\n : 'hint';\n }\n\n /** Animates the placeholder up and locks it in position. */\n _animateAndLockLabel(): void {\n if (this._hasFloatingLabel() && this._canLabelFloat()) {\n // If animations are disabled, we shouldn't go in here,\n // because the `transitionend` will never fire.\n if (this._animationsEnabled && this._label) {\n this._showAlwaysAnimate = true;\n\n fromEvent(this._label.nativeElement, 'transitionend')\n .pipe(take(1))\n .subscribe(() => {\n this._showAlwaysAnimate = false;\n });\n }\n\n this.floatLabel = 'always';\n this._changeDetectorRef.markForCheck();\n }\n }\n\n /**\n * Ensure that there is only one placeholder (either `placeholder` attribute on the child control\n * or child element with the `mat-placeholder` directive).\n */\n private _validatePlaceholders() {\n if (\n this._control.placeholder &&\n this._placeholderChild &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw getMatFormFieldPlaceholderConflictError();\n }\n }\n\n /** Does any extra processing that is required when handling the hints. */\n private _processHints() {\n this._validateHints();\n this._syncDescribedByIds();\n }\n\n /**\n * Ensure that there is a maximum of one of each `<mat-hint>` alignment specified, with the\n * attribute being considered as `align=\"start\"`.\n */\n private _validateHints() {\n if (this._hintChildren && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n let startHint: MatLegacyHint;\n let endHint: MatLegacyHint;\n this._hintChildren.forEach((hint: MatLegacyHint) => {\n if (hint.align === 'start') {\n if (startHint || this.hintLabel) {\n throw getMatFormFieldDuplicatedHintError('start');\n }\n startHint = hint;\n } else if (hint.align === 'end') {\n if (endHint) {\n throw getMatFormFieldDuplicatedHintError('end');\n }\n endHint = hint;\n }\n });\n }\n }\n\n /** Gets the default float label state. */\n private _getDefaultFloatLabelState(): LegacyFloatLabelType {\n return (this._defaults && this._defaults.floatLabel) || 'auto';\n }\n\n /**\n * Sets the list of element IDs that describe the child control. This allows the control to update\n * its `aria-describedby` attribute accordingly.\n */\n private _syncDescribedByIds() {\n if (this._control) {\n let ids: string[] = [];\n\n // TODO(wagnermaciel): Remove the type check when we find the root cause of this bug.\n if (\n this._control.userAriaDescribedBy &&\n typeof this._control.userAriaDescribedBy === 'string'\n ) {\n ids.push(...this._control.userAriaDescribedBy.split(' '));\n }\n\n if (this._getDisplayedMessages() === 'hint') {\n const startHint = this._hintChildren\n ? this._hintChildren.find(hint => hint.align === 'start')\n : null;\n const endHint = this._hintChildren\n ? this._hintChildren.find(hint => hint.align === 'end')\n : null;\n\n if (startHint) {\n ids.push(startHint.id);\n } else if (this._hintLabel) {\n ids.push(this._hintLabelId);\n }\n\n if (endHint) {\n ids.push(endHint.id);\n }\n } else if (this._errorChildren) {\n ids.push(...this._errorChildren.map(error => error.id));\n }\n\n this._control.setDescribedByIds(ids);\n }\n }\n\n /** Throws an error if the form field's control is missing. */\n protected _validateControlChild() {\n if (!this._control && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatFormFieldMissingControlError();\n }\n }\n\n /**\n * Updates the width and position of the gap in the outline. Only relevant for the outline\n * appearance.\n */\n updateOutlineGap() {\n const labelEl = this._label ? this._label.nativeElement : null;\n const container = this._connectionContainerRef.nativeElement;\n const outlineStartSelector = '.mat-form-field-outline-start';\n const outlineGapSelector = '.mat-form-field-outline-gap';\n\n // getBoundingClientRect isn't available on the server.\n if (this.appearance !== 'outline' || !this._platform.isBrowser) {\n return;\n }\n\n // If there is no content, set the gap elements to zero.\n if (!labelEl || !labelEl.children.length || !labelEl.textContent!.trim()) {\n const gapElements = container.querySelectorAll(\n `${outlineStartSelector}, ${outlineGapSelector}`,\n );\n for (let i = 0; i < gapElements.length; i++) {\n gapElements[i].style.width = '0';\n }\n return;\n }\n\n // If the element is not present in the DOM, the outline gap will need to be calculated\n // the next time it is checked and in the DOM.\n if (!this._isAttachedToDOM()) {\n this._outlineGapCalculationNeededImmediately = true;\n return;\n }\n\n let startWidth = 0;\n let gapWidth = 0;\n\n const startEls = container.querySelectorAll(outlineStartSelector);\n const gapEls = container.querySelectorAll(outlineGapSelector);\n\n if (this._label && this._label.nativeElement.children.length) {\n const containerRect = container.getBoundingClientRect();\n\n // If the container's width and height are zero, it means that the element is\n // invisible and we can't calculate the outline gap. Mark the element as needing\n // to be checked the next time the zone stabilizes. We can't do this immediately\n // on the next change detection, because even if the element becomes visible,\n // the `ClientRect` won't be recalculated immediately. We reset the\n // `_outlineGapCalculationNeededImmediately` flag some we don't run the checks twice.\n if (containerRect.width === 0 && containerRect.height === 0) {\n this._outlineGapCalculationNeededOnStable = true;\n this._outlineGapCalculationNeededImmediately = false;\n return;\n }\n\n const containerStart = this._getStartEnd(containerRect);\n const labelChildren = labelEl.children;\n const labelStart = this._getStartEnd(labelChildren[0].getBoundingClientRect());\n let labelWidth = 0;\n\n for (let i = 0; i < labelChildren.length; i++) {\n labelWidth += (labelChildren[i] as HTMLElement).offsetWidth;\n }\n startWidth = Math.abs(labelStart - containerStart) - outlineGapPadding;\n gapWidth = labelWidth > 0 ? labelWidth * floatingLabelScale + outlineGapPadding * 2 : 0;\n }\n\n for (let i = 0; i < startEls.length; i++) {\n startEls[i].style.width = `${startWidth}px`;\n }\n for (let i = 0; i < gapEls.length; i++) {\n gapEls[i].style.width = `${gapWidth}px`;\n }\n\n this._outlineGapCalculationNeededOnStable = this._outlineGapCalculationNeededImmediately =\n false;\n }\n\n /** Gets the start end of the rect considering the current directionality. */\n private _getStartEnd(rect: ClientRect): number {\n return this._dir && this._dir.value === 'rtl' ? rect.right : rect.left;\n }\n\n /** Checks whether the form field is attached to the DOM. */\n private _isAttachedToDOM(): boolean {\n const element: HTMLElement = this._elementRef.nativeElement;\n\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement!.contains(element);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatLegacyError} from './error';\nimport {MatLegacyFormField} from './form-field';\nimport {MatLegacyHint} from './hint';\nimport {MatLegacyLabel} from './label';\nimport {MatLegacyPlaceholder} from './placeholder';\nimport {MatLegacyPrefix} from './prefix';\nimport {MatLegacySuffix} from './suffix';\n\n/**\n * @deprecated Use `MatFormFieldModule` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n declarations: [\n MatLegacyError,\n MatLegacyFormField,\n MatLegacyHint,\n MatLegacyLabel,\n MatLegacyPlaceholder,\n MatLegacyPrefix,\n MatLegacySuffix,\n ],\n imports: [CommonModule, MatCommonModule, ObserversModule],\n exports: [\n MatCommonModule,\n MatLegacyError,\n MatLegacyFormField,\n MatLegacyHint,\n MatLegacyLabel,\n MatLegacyPlaceholder,\n MatLegacyPrefix,\n MatLegacySuffix,\n ],\n})\nexport class MatLegacyFormFieldModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Attribute, Directive, ElementRef, Input} from '@angular/core';\nimport {MAT_ERROR} from '@angular/material/form-field';\n\nlet nextUniqueId = 0;\n\n/**\n * Single error message to be shown underneath the form field.\n * @deprecated Use `MatError` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: 'mat-error',\n host: {\n 'class': 'mat-error',\n '[attr.id]': 'id',\n 'aria-atomic': 'true',\n },\n providers: [{provide: MAT_ERROR, useExisting: MatLegacyError}],\n})\nexport class MatLegacyError {\n @Input() id: string = `mat-error-${nextUniqueId++}`;\n\n constructor(@Attribute('aria-live') ariaLive: string, elementRef: ElementRef) {\n // If no aria-live value is set add 'polite' as a default. This is preferred over setting\n // role='alert' so that screen readers do not interrupt the current task to read this aloud.\n if (!ariaLive) {\n elementRef.nativeElement.setAttribute('aria-live', 'polite');\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Subscription } from '../Subscription';\nimport { Observable } from '../Observable';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that mirrors the source Observable, but will call a specified function when\n * the source terminates on complete or error.\n * @param {function} callback Function to be called when source terminates.\n * @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.\n * @method finally\n * @owner Observable\n */\nexport function finalize<T>(callback: () => void): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new FinallyOperator(callback));\n}\n\nclass FinallyOperator<T> implements Operator<T, T> {\n constructor(private callback: () => void) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new FinallySubscriber(subscriber, this.callback));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass FinallySubscriber<T> extends Subscriber<T> {\n constructor(destination: Subscriber<T>, callback: () => void) {\n super(destination);\n this.add(new Subscription(callback));\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {HttpRequest} from './request';\nimport {HttpEvent} from './response';\n\n/**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * @publicApi\n */\nexport abstract class HttpHandler {\n abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;\n}\n\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * @publicApi\n */\nexport abstract class HttpBackend implements HttpHandler {\n abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\ninterface Update {\n name: string;\n value?: string|string[];\n op: 'a'|'s'|'d';\n}\n\n/**\n * Represents the header configuration options for an HTTP request.\n * Instances are immutable. Modifying methods return a cloned\n * instance with the change. The original object is never changed.\n *\n * @publicApi\n */\nexport class HttpHeaders {\n /**\n * Internal map of lowercase header names to values.\n */\n // TODO(issue/24571): remove '!'.\n private headers!: Map<string, string[]>;\n\n\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n private normalizedNames: Map<string, string> = new Map();\n\n /**\n * Complete the lazy initialization of this object (needed before reading).\n */\n private lazyInit!: HttpHeaders|Function|null;\n\n /**\n * Queued updates to be materialized the next initialization.\n */\n private lazyUpdate: Update[]|null = null;\n\n /** Constructs a new HTTP header object with the given values.*/\n\n constructor(headers?: string|{[name: string]: string | string[]}) {\n if (!headers) {\n this.headers = new Map<string, string[]>();\n } else if (typeof headers === 'string') {\n this.lazyInit = () => {\n this.headers = new Map<string, string[]>();\n headers.split('\\n').forEach(line => {\n const index = line.indexOf(':');\n if (index > 0) {\n const name = line.slice(0, index);\n const key = name.toLowerCase();\n const value = line.slice(index + 1).trim();\n this.maybeSetNormalizedName(name, key);\n if (this.headers.has(key)) {\n this.headers.get(key)!.push(value);\n } else {\n this.headers.set(key, [value]);\n }\n }\n });\n };\n } else {\n this.lazyInit = () => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertValidHeaders(headers);\n }\n this.headers = new Map<string, string[]>();\n Object.keys(headers).forEach(name => {\n let values: string|string[] = headers[name];\n const key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n this.headers.set(key, values);\n this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }\n\n /**\n * Checks for existence of a given header.\n *\n * @param name The header name to check for existence.\n *\n * @returns True if the header exists, false otherwise.\n */\n has(name: string): boolean {\n this.init();\n\n return this.headers.has(name.toLowerCase());\n }\n\n /**\n * Retrieves the first value of a given header.\n *\n * @param name The header name.\n *\n * @returns The value string if the header exists, null otherwise\n */\n get(name: string): string|null {\n this.init();\n\n const values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n }\n\n /**\n * Retrieves the names of the headers.\n *\n * @returns A list of header names.\n */\n keys(): string[] {\n this.init();\n\n return Array.from(this.normalizedNames.values());\n }\n\n /**\n * Retrieves a list of values for a given header.\n *\n * @param name The header name from which to retrieve values.\n *\n * @returns A string of values if the header exists, null otherwise.\n */\n getAll(name: string): string[]|null {\n this.init();\n\n return this.headers.get(name.toLowerCase()) || null;\n }\n\n /**\n * Appends a new value to the existing set of values for a header\n * and returns them in a clone of the original instance.\n *\n * @param name The header name for which to append the values.\n * @param value The value to append.\n *\n * @returns A clone of the HTTP headers object with the value appended to the given header.\n */\n\n append(name: string, value: string|string[]): HttpHeaders {\n return this.clone({name, value, op: 'a'});\n }\n /**\n * Sets or modifies a value for a given header in a clone of the original instance.\n * If the header already exists, its value is replaced with the given value\n * in the returned object.\n *\n * @param name The header name.\n * @param value The value or values to set or override for the given header.\n *\n * @returns A clone of the HTTP headers object with the newly set header value.\n */\n set(name: string, value: string|string[]): HttpHeaders {\n return this.clone({name, value, op: 's'});\n }\n /**\n * Deletes values for a given header in a clone of the original instance.\n *\n * @param name The header name.\n * @param value The value or values to delete for the given header.\n *\n * @returns A clone of the HTTP headers object with the given value deleted.\n */\n delete(name: string, value?: string|string[]): HttpHeaders {\n return this.clone({name, value, op: 'd'});\n }\n\n private maybeSetNormalizedName(name: string, lcName: string): void {\n if (!this.normalizedNames.has(lcName)) {\n this.normalizedNames.set(lcName, name);\n }\n }\n\n private init(): void {\n if (!!this.lazyInit) {\n if (this.lazyInit instanceof HttpHeaders) {\n this.copyFrom(this.lazyInit);\n } else {\n this.lazyInit();\n }\n this.lazyInit = null;\n if (!!this.lazyUpdate) {\n this.lazyUpdate.forEach(update => this.applyUpdate(update));\n this.lazyUpdate = null;\n }\n }\n }\n\n private copyFrom(other: HttpHeaders) {\n other.init();\n Array.from(other.headers.keys()).forEach(key => {\n this.headers.set(key, other.headers.get(key)!);\n this.normalizedNames.set(key, other.normalizedNames.get(key)!);\n });\n }\n\n private clone(update: Update): HttpHeaders {\n const clone = new HttpHeaders();\n clone.lazyInit =\n (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;\n clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);\n return clone;\n }\n\n private applyUpdate(update: Update): void {\n const key = update.name.toLowerCase();\n switch (update.op) {\n case 'a':\n case 's':\n let value = update.value!;\n if (typeof value === 'string') {\n value = [value];\n }\n if (value.length === 0) {\n return;\n }\n this.maybeSetNormalizedName(update.name, key);\n const base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];\n base.push(...value);\n this.headers.set(key, base);\n break;\n case 'd':\n const toDelete = update.value as string | undefined;\n if (!toDelete) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n } else {\n let existing = this.headers.get(key);\n if (!existing) {\n return;\n }\n existing = existing.filter(value => toDelete.indexOf(value) === -1);\n if (existing.length === 0) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n } else {\n this.headers.set(key, existing);\n }\n }\n break;\n }\n }\n\n /**\n * @internal\n */\n forEach(fn: (name: string, values: string[]) => void) {\n this.init();\n Array.from(this.normalizedNames.keys())\n .forEach(key => fn(this.normalizedNames.get(key)!, this.headers.get(key)!));\n }\n}\n\n/**\n * Verifies that the headers object has the right shape: the values\n * must be either strings or arrays. Throws an error if an invalid\n * header value is present.\n */\nfunction assertValidHeaders(headers: Record<string, unknown>):\n asserts headers is Record<string, string|string[]> {\n for (const [key, value] of Object.entries(headers)) {\n if (typeof value !== 'string' && !Array.isArray(value)) {\n throw new Error(\n `Unexpected value of the \\`${key}\\` header provided. ` +\n `Expecting either a string or an array, but got: \\`${value}\\`.`);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A codec for encoding and decoding parameters in URLs.\n *\n * Used by `HttpParams`.\n *\n * @publicApi\n **/\nexport interface HttpParameterCodec {\n encodeKey(key: string): string;\n encodeValue(value: string): string;\n\n decodeKey(key: string): string;\n decodeValue(value: string): string;\n}\n\n/**\n * Provides encoding and decoding of URL parameter and query-string values.\n *\n * Serializes and parses URL parameter keys and values to encode and decode them.\n * If you pass URL query parameters without encoding,\n * the query parameters can be misinterpreted at the receiving end.\n *\n *\n * @publicApi\n */\nexport class HttpUrlEncodingCodec implements HttpParameterCodec {\n /**\n * Encodes a key name for a URL parameter or query-string.\n * @param key The key name.\n * @returns The encoded key name.\n */\n encodeKey(key: string): string {\n return standardEncoding(key);\n }\n\n /**\n * Encodes the value of a URL parameter or query-string.\n * @param value The value.\n * @returns The encoded value.\n */\n encodeValue(value: string): string {\n return standardEncoding(value);\n }\n\n /**\n * Decodes an encoded URL parameter or query-string key.\n * @param key The encoded key name.\n * @returns The decoded key name.\n */\n decodeKey(key: string): string {\n return decodeURIComponent(key);\n }\n\n /**\n * Decodes an encoded URL parameter or query-string value.\n * @param value The encoded value.\n * @returns The decoded value.\n */\n decodeValue(value: string) {\n return decodeURIComponent(value);\n }\n}\n\n\nfunction paramParser(rawParams: string, codec: HttpParameterCodec): Map<string, string[]> {\n const map = new Map<string, string[]>();\n if (rawParams.length > 0) {\n // The `window.location.search` can be used while creating an instance of the `HttpParams` class\n // (e.g. `new HttpParams({ fromString: window.location.search })`). The `window.location.search`\n // may start with the `?` char, so we strip it if it's present.\n const params: string[] = rawParams.replace(/^\\?/, '').split('&');\n params.forEach((param: string) => {\n const eqIdx = param.indexOf('=');\n const [key, val]: string[] = eqIdx == -1 ?\n [codec.decodeKey(param), ''] :\n [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];\n const list = map.get(key) || [];\n list.push(val);\n map.set(key, list);\n });\n }\n return map;\n}\n\n/**\n * Encode input string with standard encodeURIComponent and then un-encode specific characters.\n */\nconst STANDARD_ENCODING_REGEX = /%(\\d[a-f0-9])/gi;\nconst STANDARD_ENCODING_REPLACEMENTS: {[x: string]: string} = {\n '40': '@',\n '3A': ':',\n '24': '$',\n '2C': ',',\n '3B': ';',\n '3D': '=',\n '3F': '?',\n '2F': '/',\n};\n\nfunction standardEncoding(v: string): string {\n return encodeURIComponent(v).replace(\n STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s);\n}\n\nfunction valueToString(value: string|number|boolean): string {\n return `${value}`;\n}\n\ninterface Update {\n param: string;\n value?: string|number|boolean;\n op: 'a'|'d'|'s';\n}\n\n/**\n * Options used to construct an `HttpParams` instance.\n *\n * @publicApi\n */\nexport interface HttpParamsOptions {\n /**\n * String representation of the HTTP parameters in URL-query-string format.\n * Mutually exclusive with `fromObject`.\n */\n fromString?: string;\n\n /** Object map of the HTTP parameters. Mutually exclusive with `fromString`. */\n fromObject?: {[param: string]: string|number|boolean|ReadonlyArray<string|number|boolean>};\n\n /** Encoding codec used to parse and serialize the parameters. */\n encoder?: HttpParameterCodec;\n}\n\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable; all mutation operations return a new instance.\n *\n * @publicApi\n */\nexport class HttpParams {\n private map: Map<string, string[]>|null;\n private encoder: HttpParameterCodec;\n private updates: Update[]|null = null;\n private cloneFrom: HttpParams|null = null;\n\n constructor(options: HttpParamsOptions = {} as HttpParamsOptions) {\n this.encoder = options.encoder || new HttpUrlEncodingCodec();\n if (!!options.fromString) {\n if (!!options.fromObject) {\n throw new Error(`Cannot specify both fromString and fromObject.`);\n }\n this.map = paramParser(options.fromString, this.encoder);\n } else if (!!options.fromObject) {\n this.map = new Map<string, string[]>();\n Object.keys(options.fromObject).forEach(key => {\n const value = (options.fromObject as any)[key];\n // convert the values to strings\n const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)];\n this.map!.set(key, values);\n });\n } else {\n this.map = null;\n }\n }\n\n /**\n * Reports whether the body includes one or more values for a given parameter.\n * @param param The parameter name.\n * @returns True if the parameter has one or more values,\n * false if it has no value or is not present.\n */\n has(param: string): boolean {\n this.init();\n return this.map!.has(param);\n }\n\n /**\n * Retrieves the first value for a parameter.\n * @param param The parameter name.\n * @returns The first value of the given parameter,\n * or `null` if the parameter is not present.\n */\n get(param: string): string|null {\n this.init();\n const res = this.map!.get(param);\n return !!res ? res[0] : null;\n }\n\n /**\n * Retrieves all values for a parameter.\n * @param param The parameter name.\n * @returns All values in a string array,\n * or `null` if the parameter not present.\n */\n getAll(param: string): string[]|null {\n this.init();\n return this.map!.get(param) || null;\n }\n\n /**\n * Retrieves all the parameters for this body.\n * @returns The parameter names in a string array.\n */\n keys(): string[] {\n this.init();\n return Array.from(this.map!.keys());\n }\n\n /**\n * Appends a new value to existing values for a parameter.\n * @param param The parameter name.\n * @param value The new value to add.\n * @return A new body with the appended value.\n */\n append(param: string, value: string|number|boolean): HttpParams {\n return this.clone({param, value, op: 'a'});\n }\n\n /**\n * Constructs a new body with appended values for the given parameter name.\n * @param params parameters and values\n * @return A new body with the new value.\n */\n appendAll(params: {[param: string]: string|number|boolean|ReadonlyArray<string|number|boolean>}):\n HttpParams {\n const updates: Update[] = [];\n Object.keys(params).forEach(param => {\n const value = params[param];\n if (Array.isArray(value)) {\n value.forEach(_value => {\n updates.push({param, value: _value, op: 'a'});\n });\n } else {\n updates.push({param, value: value as (string | number | boolean), op: 'a'});\n }\n });\n return this.clone(updates);\n }\n\n /**\n * Replaces the value for a parameter.\n * @param param The parameter name.\n * @param value The new value.\n * @return A new body with the new value.\n */\n set(param: string, value: string|number|boolean): HttpParams {\n return this.clone({param, value, op: 's'});\n }\n\n /**\n * Removes a given value or all values from a parameter.\n * @param param The parameter name.\n * @param value The value to remove, if provided.\n * @return A new body with the given value removed, or with all values\n * removed if no value is specified.\n */\n delete(param: string, value?: string|number|boolean): HttpParams {\n return this.clone({param, value, op: 'd'});\n }\n\n /**\n * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n */\n toString(): string {\n this.init();\n return this.keys()\n .map(key => {\n const eKey = this.encoder.encodeKey(key);\n // `a: ['1']` produces `'a=1'`\n // `b: []` produces `''`\n // `c: ['1', '2']` produces `'c=1&c=2'`\n return this.map!.get(key)!.map(value => eKey + '=' + this.encoder.encodeValue(value))\n .join('&');\n })\n // filter out empty values because `b: []` produces `''`\n // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't\n .filter(param => param !== '')\n .join('&');\n }\n\n private clone(update: Update|Update[]): HttpParams {\n const clone = new HttpParams({encoder: this.encoder} as HttpParamsOptions);\n clone.cloneFrom = this.cloneFrom || this;\n clone.updates = (this.updates || []).concat(update);\n return clone;\n }\n\n private init() {\n if (this.map === null) {\n this.map = new Map<string, string[]>();\n }\n if (this.cloneFrom !== null) {\n this.cloneFrom.init();\n this.cloneFrom.keys().forEach(key => this.map!.set(key, this.cloneFrom!.map!.get(key)!));\n this.updates!.forEach(update => {\n switch (update.op) {\n case 'a':\n case 's':\n const base = (update.op === 'a' ? this.map!.get(update.param) : undefined) || [];\n base.push(valueToString(update.value!));\n this.map!.set(update.param, base);\n break;\n case 'd':\n if (update.value !== undefined) {\n let base = this.map!.get(update.param) || [];\n const idx = base.indexOf(valueToString(update.value));\n if (idx !== -1) {\n base.splice(idx, 1);\n }\n if (base.length > 0) {\n this.map!.set(update.param, base);\n } else {\n this.map!.delete(update.param);\n }\n } else {\n this.map!.delete(update.param);\n break;\n }\n }\n });\n this.cloneFrom = this.updates = null;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A token used to manipulate and access values stored in `HttpContext`.\n *\n * @publicApi\n */\nexport class HttpContextToken<T> {\n constructor(public readonly defaultValue: () => T) {}\n}\n\n/**\n * Http context stores arbitrary user defined values and ensures type safety without\n * actually knowing the types. It is backed by a `Map` and guarantees that keys do not clash.\n *\n * This context is mutable and is shared between cloned requests unless explicitly specified.\n *\n * @usageNotes\n *\n * ### Usage Example\n *\n * ```typescript\n * // inside cache.interceptors.ts\n * export const IS_CACHE_ENABLED = new HttpContextToken<boolean>(() => false);\n *\n * export class CacheInterceptor implements HttpInterceptor {\n *\n * intercept(req: HttpRequest<any>, delegate: HttpHandler): Observable<HttpEvent<any>> {\n * if (req.context.get(IS_CACHE_ENABLED) === true) {\n * return ...;\n * }\n * return delegate.handle(req);\n * }\n * }\n *\n * // inside a service\n *\n * this.httpClient.get('/api/weather', {\n * context: new HttpContext().set(IS_CACHE_ENABLED, true)\n * }).subscribe(...);\n * ```\n *\n * @publicApi\n */\nexport class HttpContext {\n private readonly map = new Map<HttpContextToken<unknown>, unknown>();\n\n /**\n * Store a value in the context. If a value is already present it will be overwritten.\n *\n * @param token The reference to an instance of `HttpContextToken`.\n * @param value The value to store.\n *\n * @returns A reference to itself for easy chaining.\n */\n set<T>(token: HttpContextToken<T>, value: T): HttpContext {\n this.map.set(token, value);\n return this;\n }\n\n /**\n * Retrieve the value associated with the given token.\n *\n * @param token The reference to an instance of `HttpContextToken`.\n *\n * @returns The stored value or default if one is defined.\n */\n get<T>(token: HttpContextToken<T>): T {\n if (!this.map.has(token)) {\n this.map.set(token, token.defaultValue());\n }\n return this.map.get(token) as T;\n }\n\n /**\n * Delete the value associated with the given token.\n *\n * @param token The reference to an instance of `HttpContextToken`.\n *\n * @returns A reference to itself for easy chaining.\n */\n delete(token: HttpContextToken<unknown>): HttpContext {\n this.map.delete(token);\n return this;\n }\n\n /**\n * Checks for existence of a given token.\n *\n * @param token The reference to an instance of `HttpContextToken`.\n *\n * @returns True if the token exists, false otherwise.\n */\n has(token: HttpContextToken<unknown>): boolean {\n return this.map.has(token);\n }\n\n /**\n * @returns a list of tokens currently stored in the context.\n */\n keys(): IterableIterator<HttpContextToken<unknown>> {\n return this.map.keys();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpContext} from './context';\nimport {HttpHeaders} from './headers';\nimport {HttpParams} from './params';\n\n\n/**\n * Construction interface for `HttpRequest`s.\n *\n * All values are optional and will override default values if provided.\n */\ninterface HttpRequestInit {\n headers?: HttpHeaders;\n context?: HttpContext;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer'|'blob'|'json'|'text';\n withCredentials?: boolean;\n}\n\n/**\n * Determine whether the given HTTP method may include a body.\n */\nfunction mightHaveBody(method: string): boolean {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}\n\n/**\n * Safely assert whether the given value is an ArrayBuffer.\n *\n * In some execution environments ArrayBuffer is not defined.\n */\nfunction isArrayBuffer(value: any): value is ArrayBuffer {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}\n\n/**\n * Safely assert whether the given value is a Blob.\n *\n * In some execution environments Blob is not defined.\n */\nfunction isBlob(value: any): value is Blob {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n\n/**\n * Safely assert whether the given value is a FormData instance.\n *\n * In some execution environments FormData is not defined.\n */\nfunction isFormData(value: any): value is FormData {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}\n\n/**\n * Safely assert whether the given value is a URLSearchParams instance.\n *\n * In some execution environments URLSearchParams is not defined.\n */\nfunction isUrlSearchParams(value: any): value is URLSearchParams {\n return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;\n}\n\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * @publicApi\n */\nexport class HttpRequest<T> {\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n */\n readonly body: T|null = null;\n\n /**\n * Outgoing headers for this request.\n */\n // TODO(issue/24571): remove '!'.\n readonly headers!: HttpHeaders;\n\n /**\n * Shared and mutable context that can be used by interceptors\n */\n readonly context!: HttpContext;\n\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n */\n readonly reportProgress: boolean = false;\n\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n */\n readonly withCredentials: boolean = false;\n\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\n readonly responseType: 'arraybuffer'|'blob'|'json'|'text' = 'json';\n\n /**\n * The outgoing HTTP request method.\n */\n readonly method: string;\n\n /**\n * Outgoing URL parameters.\n *\n * To pass a string representation of HTTP parameters in the URL-query-string format,\n * the `HttpParamsOptions`' `fromString` may be used. For example:\n *\n * ```\n * new HttpParams({fromString: 'angular=awesome'})\n * ```\n */\n // TODO(issue/24571): remove '!'.\n readonly params!: HttpParams;\n\n /**\n * The outgoing URL with all URL parameters set.\n */\n readonly urlWithParams: string;\n\n constructor(method: 'DELETE'|'GET'|'HEAD'|'JSONP'|'OPTIONS', url: string, init?: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n });\n constructor(method: 'POST'|'PUT'|'PATCH', url: string, body: T|null, init?: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n });\n constructor(method: string, url: string, body: T|null, init?: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n });\n constructor(\n method: string, readonly url: string, third?: T|{\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n }|null,\n fourth?: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n }) {\n this.method = method.toUpperCase();\n // Next, need to figure out which argument holds the HttpRequestInit\n // options, if any.\n let options: HttpRequestInit|undefined;\n\n // Check whether a body argument is expected. The only valid way to omit\n // the body argument is to use a known no-body method like GET.\n if (mightHaveBody(this.method) || !!fourth) {\n // Body is the third argument, options are the fourth.\n this.body = (third !== undefined) ? third as T : null;\n options = fourth;\n } else {\n // No body required, options are the third argument. The body stays null.\n options = third as HttpRequestInit;\n }\n\n // If options have been passed, interpret them.\n if (options) {\n // Normalize reportProgress and withCredentials.\n this.reportProgress = !!options.reportProgress;\n this.withCredentials = !!options.withCredentials;\n\n // Override default response type of 'json' if one is provided.\n if (!!options.responseType) {\n this.responseType = options.responseType;\n }\n\n // Override headers if they're provided.\n if (!!options.headers) {\n this.headers = options.headers;\n }\n\n if (!!options.context) {\n this.context = options.context;\n }\n\n if (!!options.params) {\n this.params = options.params;\n }\n }\n\n // If no headers have been passed in, construct a new HttpHeaders instance.\n if (!this.headers) {\n this.headers = new HttpHeaders();\n }\n\n // If no context have been passed in, construct a new HttpContext instance.\n if (!this.context) {\n this.context = new HttpContext();\n }\n\n // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.\n if (!this.params) {\n this.params = new HttpParams();\n this.urlWithParams = url;\n } else {\n // Encode the parameters to a string in preparation for inclusion in the URL.\n const params = this.params.toString();\n if (params.length === 0) {\n // No parameters, the visible URL is just the URL given at creation time.\n this.urlWithParams = url;\n } else {\n // Does the URL already have query parameters? Look for '?'.\n const qIdx = url.indexOf('?');\n // There are 3 cases to handle:\n // 1) No existing parameters -> append '?' followed by params.\n // 2) '?' exists and is followed by existing query string ->\n // append '&' followed by params.\n // 3) '?' exists at the end of the url -> append params directly.\n // This basically amounts to determining the character, if any, with\n // which to join the URL and parameters.\n const sep: string = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');\n this.urlWithParams = url + sep + params;\n }\n }\n }\n\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n */\n serializeBody(): ArrayBuffer|Blob|FormData|string|null {\n // If no body is present, no need to serialize it.\n if (this.body === null) {\n return null;\n }\n // Check whether the body is already in a serialized form. If so,\n // it can just be returned directly.\n if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||\n isUrlSearchParams(this.body) || typeof this.body === 'string') {\n return this.body;\n }\n // Check whether the body is an instance of HttpUrlEncodedParams.\n if (this.body instanceof HttpParams) {\n return this.body.toString();\n }\n // Check whether the body is an object or array, and serialize with JSON if so.\n if (typeof this.body === 'object' || typeof this.body === 'boolean' ||\n Array.isArray(this.body)) {\n return JSON.stringify(this.body);\n }\n // Fall back on toString() for everything else.\n return (this.body as any).toString();\n }\n\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n */\n detectContentTypeHeader(): string|null {\n // An empty body has no content type.\n if (this.body === null) {\n return null;\n }\n // FormData bodies rely on the browser's content type assignment.\n if (isFormData(this.body)) {\n return null;\n }\n // Blobs usually have their own content type. If it doesn't, then\n // no type can be inferred.\n if (isBlob(this.body)) {\n return this.body.type || null;\n }\n // Array buffers have unknown contents and thus no type can be inferred.\n if (isArrayBuffer(this.body)) {\n return null;\n }\n // Technically, strings could be a form of JSON data, but it's safe enough\n // to assume they're plain strings.\n if (typeof this.body === 'string') {\n return 'text/plain';\n }\n // `HttpUrlEncodedParams` has its own content-type.\n if (this.body instanceof HttpParams) {\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n }\n // Arrays, objects, boolean and numbers will be encoded as JSON.\n if (typeof this.body === 'object' || typeof this.body === 'number' ||\n typeof this.body === 'boolean') {\n return 'application/json';\n }\n // No type could be inferred.\n return null;\n }\n\n clone(): HttpRequest<T>;\n clone(update: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n body?: T|null,\n method?: string,\n url?: string,\n setHeaders?: {[name: string]: string|string[]},\n setParams?: {[param: string]: string},\n }): HttpRequest<T>;\n clone<V>(update: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n body?: V|null,\n method?: string,\n url?: string,\n setHeaders?: {[name: string]: string|string[]},\n setParams?: {[param: string]: string},\n }): HttpRequest<V>;\n clone(update: {\n headers?: HttpHeaders,\n context?: HttpContext,\n reportProgress?: boolean,\n params?: HttpParams,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n body?: any|null,\n method?: string,\n url?: string,\n setHeaders?: {[name: string]: string|string[]},\n setParams?: {[param: string]: string};\n } = {}): HttpRequest<any> {\n // For method, url, and responseType, take the current value unless\n // it is overridden in the update hash.\n const method = update.method || this.method;\n const url = update.url || this.url;\n const responseType = update.responseType || this.responseType;\n\n // The body is somewhat special - a `null` value in update.body means\n // whatever current body is present is being overridden with an empty\n // body, whereas an `undefined` value in update.body implies no\n // override.\n const body = (update.body !== undefined) ? update.body : this.body;\n\n // Carefully handle the boolean options to differentiate between\n // `false` and `undefined` in the update args.\n const withCredentials =\n (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;\n const reportProgress =\n (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;\n\n // Headers and params may be appended to if `setHeaders` or\n // `setParams` are used.\n let headers = update.headers || this.headers;\n let params = update.params || this.params;\n\n // Pass on context if needed\n const context = update.context ?? this.context;\n\n // Check whether the caller has asked to add headers.\n if (update.setHeaders !== undefined) {\n // Set every requested header.\n headers =\n Object.keys(update.setHeaders)\n .reduce((headers, name) => headers.set(name, update.setHeaders![name]), headers);\n }\n\n // Check whether the caller has asked to set params.\n if (update.setParams) {\n // Set every requested param.\n params = Object.keys(update.setParams)\n .reduce((params, param) => params.set(param, update.setParams![param]), params);\n }\n\n // Finally, construct the new HttpRequest using the pieces from above.\n return new HttpRequest(method, url, body, {\n params,\n headers,\n context,\n reportProgress,\n responseType,\n withCredentials,\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpHeaders} from './headers';\n\n/**\n * Type enumeration for the different kinds of `HttpEvent`.\n *\n * @publicApi\n */\nexport enum HttpEventType {\n /**\n * The request was sent out over the wire.\n */\n Sent,\n\n /**\n * An upload progress event was received.\n */\n UploadProgress,\n\n /**\n * The response status code and headers were received.\n */\n ResponseHeader,\n\n /**\n * A download progress event was received.\n */\n DownloadProgress,\n\n /**\n * The full response including the body was received.\n */\n Response,\n\n /**\n * A custom event from an interceptor or a backend.\n */\n User,\n}\n\n/**\n * Base interface for progress events.\n *\n * @publicApi\n */\nexport interface HttpProgressEvent {\n /**\n * Progress event type is either upload or download.\n */\n type: HttpEventType.DownloadProgress|HttpEventType.UploadProgress;\n\n /**\n * Number of bytes uploaded or downloaded.\n */\n loaded: number;\n\n /**\n * Total number of bytes to upload or download. Depending on the request or\n * response, this may not be computable and thus may not be present.\n */\n total?: number;\n}\n\n/**\n * A download progress event.\n *\n * @publicApi\n */\nexport interface HttpDownloadProgressEvent extends HttpProgressEvent {\n type: HttpEventType.DownloadProgress;\n\n /**\n * The partial response body as downloaded so far.\n *\n * Only present if the responseType was `text`.\n */\n partialText?: string;\n}\n\n/**\n * An upload progress event.\n *\n * @publicApi\n */\nexport interface HttpUploadProgressEvent extends HttpProgressEvent {\n type: HttpEventType.UploadProgress;\n}\n\n/**\n * An event indicating that the request was sent to the server. Useful\n * when a request may be retried multiple times, to distinguish between\n * retries on the final event stream.\n *\n * @publicApi\n */\nexport interface HttpSentEvent {\n type: HttpEventType.Sent;\n}\n\n/**\n * A user-defined event.\n *\n * Grouping all custom events under this type ensures they will be handled\n * and forwarded by all implementations of interceptors.\n *\n * @publicApi\n */\nexport interface HttpUserEvent<T> {\n type: HttpEventType.User;\n}\n\n/**\n * An error that represents a failed attempt to JSON.parse text coming back\n * from the server.\n *\n * It bundles the Error object with the actual response body that failed to parse.\n *\n *\n */\nexport interface HttpJsonParseError {\n error: Error;\n text: string;\n}\n\n/**\n * Union type for all possible events on the response stream.\n *\n * Typed according to the expected type of the response.\n *\n * @publicApi\n */\nexport type HttpEvent<T> =\n HttpSentEvent|HttpHeaderResponse|HttpResponse<T>|HttpProgressEvent|HttpUserEvent<T>;\n\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * @publicApi\n */\nexport abstract class HttpResponseBase {\n /**\n * All response headers.\n */\n readonly headers: HttpHeaders;\n\n /**\n * Response status code.\n */\n readonly status: number;\n\n /**\n * Textual description of response status code, defaults to OK.\n *\n * Do not depend on this.\n */\n readonly statusText: string;\n\n /**\n * URL of the resource retrieved, or null if not available.\n */\n readonly url: string|null;\n\n /**\n * Whether the status code falls in the 2xx range.\n */\n readonly ok: boolean;\n\n /**\n * Type of the response, narrowed to either the full response or the header.\n */\n // TODO(issue/24571): remove '!'.\n readonly type!: HttpEventType.Response|HttpEventType.ResponseHeader;\n\n /**\n * Super-constructor for all responses.\n *\n * The single parameter accepted is an initialization hash. Any properties\n * of the response passed there will override the default values.\n */\n constructor(\n init: {\n headers?: HttpHeaders,\n status?: number,\n statusText?: string,\n url?: string,\n },\n defaultStatus: number = HttpStatusCode.Ok, defaultStatusText: string = 'OK') {\n // If the hash has values passed, use them to initialize the response.\n // Otherwise use the default values.\n this.headers = init.headers || new HttpHeaders();\n this.status = init.status !== undefined ? init.status : defaultStatus;\n this.statusText = init.statusText || defaultStatusText;\n this.url = init.url || null;\n\n // Cache the ok value to avoid defining a getter.\n this.ok = this.status >= 200 && this.status < 300;\n }\n}\n\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * @publicApi\n */\nexport class HttpHeaderResponse extends HttpResponseBase {\n /**\n * Create a new `HttpHeaderResponse` with the given parameters.\n */\n constructor(init: {\n headers?: HttpHeaders,\n status?: number,\n statusText?: string,\n url?: string,\n } = {}) {\n super(init);\n }\n\n override readonly type: HttpEventType.ResponseHeader = HttpEventType.ResponseHeader;\n\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n */\n clone(update: {headers?: HttpHeaders; status?: number; statusText?: string; url?: string;} = {}):\n HttpHeaderResponse {\n // Perform a straightforward initialization of the new HttpHeaderResponse,\n // overriding the current parameters with new ones if given.\n return new HttpHeaderResponse({\n headers: update.headers || this.headers,\n status: update.status !== undefined ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n }\n}\n\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * @publicApi\n */\nexport class HttpResponse<T> extends HttpResponseBase {\n /**\n * The response body, or `null` if one was not returned.\n */\n readonly body: T|null;\n\n /**\n * Construct a new `HttpResponse`.\n */\n constructor(init: {\n body?: T|null,\n headers?: HttpHeaders;\n status?: number;\n statusText?: string;\n url?: string;\n } = {}) {\n super(init);\n this.body = init.body !== undefined ? init.body : null;\n }\n\n override readonly type: HttpEventType.Response = HttpEventType.Response;\n\n clone(): HttpResponse<T>;\n clone(update: {headers?: HttpHeaders; status?: number; statusText?: string; url?: string;}):\n HttpResponse<T>;\n clone<V>(update: {\n body?: V|null,\n headers?: HttpHeaders;\n status?: number;\n statusText?: string;\n url?: string;\n }): HttpResponse<V>;\n clone(update: {\n body?: any|null;\n headers?: HttpHeaders;\n status?: number;\n statusText?: string;\n url?: string;\n } = {}): HttpResponse<any> {\n return new HttpResponse<any>({\n body: (update.body !== undefined) ? update.body : this.body,\n headers: update.headers || this.headers,\n status: (update.status !== undefined) ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n }\n}\n\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * @publicApi\n */\nexport class HttpErrorResponse extends HttpResponseBase implements Error {\n readonly name = 'HttpErrorResponse';\n readonly message: string;\n readonly error: any|null;\n\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n */\n override readonly ok = false;\n\n constructor(init: {\n error?: any;\n headers?: HttpHeaders;\n status?: number;\n statusText?: string;\n url?: string;\n }) {\n // Initialize with a default status of 0 / Unknown Error.\n super(init, 0, 'Unknown Error');\n\n // If the response was successful, then this was a parse error. Otherwise, it was\n // a protocol-level failure of some sort. Either the request failed in transit\n // or the server returned an unsuccessful status code.\n if (this.status >= 200 && this.status < 300) {\n this.message = `Http failure during parsing for ${init.url || '(unknown url)'}`;\n } else {\n this.message = `Http failure response for ${init.url || '(unknown url)'}: ${init.status} ${\n init.statusText}`;\n }\n this.error = init.error || null;\n }\n}\n\n/**\n * Http status codes.\n * As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\n * @publicApi\n */\nexport const enum HttpStatusCode {\n Continue = 100,\n SwitchingProtocols = 101,\n Processing = 102,\n EarlyHints = 103,\n\n Ok = 200,\n Created = 201,\n Accepted = 202,\n NonAuthoritativeInformation = 203,\n NoContent = 204,\n ResetContent = 205,\n PartialContent = 206,\n MultiStatus = 207,\n AlreadyReported = 208,\n ImUsed = 226,\n\n MultipleChoices = 300,\n MovedPermanently = 301,\n Found = 302,\n SeeOther = 303,\n NotModified = 304,\n UseProxy = 305,\n Unused = 306,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n\n BadRequest = 400,\n Unauthorized = 401,\n PaymentRequired = 402,\n Forbidden = 403,\n NotFound = 404,\n MethodNotAllowed = 405,\n NotAcceptable = 406,\n ProxyAuthenticationRequired = 407,\n RequestTimeout = 408,\n Conflict = 409,\n Gone = 410,\n LengthRequired = 411,\n PreconditionFailed = 412,\n PayloadTooLarge = 413,\n UriTooLong = 414,\n UnsupportedMediaType = 415,\n RangeNotSatisfiable = 416,\n ExpectationFailed = 417,\n ImATeapot = 418,\n MisdirectedRequest = 421,\n UnprocessableEntity = 422,\n Locked = 423,\n FailedDependency = 424,\n TooEarly = 425,\n UpgradeRequired = 426,\n PreconditionRequired = 428,\n TooManyRequests = 429,\n RequestHeaderFieldsTooLarge = 431,\n UnavailableForLegalReasons = 451,\n\n InternalServerError = 500,\n NotImplemented = 501,\n BadGateway = 502,\n ServiceUnavailable = 503,\n GatewayTimeout = 504,\n HttpVersionNotSupported = 505,\n VariantAlsoNegotiates = 506,\n InsufficientStorage = 507,\n LoopDetected = 508,\n NotExtended = 510,\n NetworkAuthenticationRequired = 511\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '@angular/core';\nimport {Observable, of} from 'rxjs';\nimport {concatMap, filter, map} from 'rxjs/operators';\n\nimport {HttpHandler} from './backend';\nimport {HttpContext} from './context';\nimport {HttpHeaders} from './headers';\nimport {HttpParams, HttpParamsOptions} from './params';\nimport {HttpRequest} from './request';\nimport {HttpEvent, HttpResponse} from './response';\n\n\n/**\n * Constructs an instance of `HttpRequestOptions<T>` from a source `HttpMethodOptions` and\n * the given `body`. This function clones the object and adds the body.\n *\n * Note that the `responseType` *options* value is a String that identifies the\n * single data type of the response.\n * A single overload version of the method handles each response type.\n * The value of `responseType` cannot be a union, as the combined signature could imply.\n *\n */\nfunction addBody<T>(\n options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n },\n body: T|null): any {\n return {\n body,\n headers: options.headers,\n context: options.context,\n observe: options.observe,\n params: options.params,\n reportProgress: options.reportProgress,\n responseType: options.responseType,\n withCredentials: options.withCredentials,\n };\n}\n\n/**\n * Performs HTTP requests.\n * This service is available as an injectable class, with methods to perform HTTP requests.\n * Each request method has multiple signatures, and the return type varies based on\n * the signature that is called (mainly the values of `observe` and `responseType`).\n *\n * Note that the `responseType` *options* value is a String that identifies the\n * single data type of the response.\n * A single overload version of the method handles each response type.\n * The value of `responseType` cannot be a union, as the combined signature could imply.\n\n *\n * @usageNotes\n * Sample HTTP requests for the [Tour of Heroes](/tutorial/tour-of-heroes/toh-pt0) application.\n *\n * ### HTTP Request Example\n *\n * ```\n * // GET heroes whose name contains search term\n * searchHeroes(term: string): observable<Hero[]>{\n *\n * const params = new HttpParams({fromString: 'name=term'});\n * return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params});\n * }\n * ```\n *\n * Alternatively, the parameter string can be used without invoking HttpParams\n * by directly joining to the URL.\n * ```\n * this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'});\n * ```\n *\n *\n * ### JSONP Example\n * ```\n * requestJsonp(url, callback = 'callback') {\n * return this.httpClient.jsonp(this.heroesURL, callback);\n * }\n * ```\n *\n * ### PATCH Example\n * ```\n * // PATCH one of the heroes' name\n * patchHero (id: number, heroName: string): Observable<{}> {\n * const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42\n * return this.httpClient.patch(url, {name: heroName}, httpOptions)\n * .pipe(catchError(this.handleError('patchHero')));\n * }\n * ```\n *\n * @see [HTTP Guide](guide/http)\n * @see [HTTP Request](api/common/http/HttpRequest)\n *\n * @publicApi\n */\n@Injectable()\nexport class HttpClient {\n constructor(private handler: HttpHandler) {}\n\n /**\n * Sends an `HttpRequest` and returns a stream of `HttpEvent`s.\n *\n * @return An `Observable` of the response, with the response body as a stream of `HttpEvent`s.\n */\n request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>;\n\n /**\n * Constructs a request that interprets the body as an `ArrayBuffer` and returns the response in\n * an `ArrayBuffer`.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs a request that interprets the body as a blob and returns\n * the response as a blob.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type `Blob`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs a request that interprets the body as a text string and\n * returns a string value.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type string.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs a request that interprets the body as an `ArrayBuffer` and returns the\n * the full event stream.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as an array of `HttpEvent`s for\n * the request.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n observe: 'events',\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a request that interprets the body as a `Blob` and returns\n * the full event stream.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body of type `Blob`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a request which interprets the body as a text string and returns the full event\n * stream.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body of type string.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a request which interprets the body as a JavaScript object and returns the full\n * event stream.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body of type `Object`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n reportProgress?: boolean, observe: 'events',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<any>>;\n\n /**\n * Constructs a request which interprets the body as a JavaScript object and returns the full\n * event stream.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body of type `R`.\n */\n request<R>(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n reportProgress?: boolean, observe: 'events',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<R>>;\n\n /**\n * Constructs a request which interprets the body as an `ArrayBuffer`\n * and returns the full `HttpResponse`.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body as an `ArrayBuffer`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a request which interprets the body as a `Blob` and returns the full `HttpResponse`.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a request which interprets the body as a text stream and returns the full\n * `HttpResponse`.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the HTTP response, with the response body of type string.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a request which interprets the body as a JavaScript object and returns the full\n * `HttpResponse`.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the full `HttpResponse`,\n * with the response body of type `Object`.\n */\n request(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n reportProgress?: boolean, observe: 'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a request which interprets the body as a JavaScript object and returns\n * the full `HttpResponse` with the response body in the requested type.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the full `HttpResponse`, with the response body of type `R`.\n */\n request<R>(method: string, url: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n reportProgress?: boolean, observe: 'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<R>>;\n\n /**\n * Constructs a request which interprets the body as a JavaScript object and returns the full\n * `HttpResponse` as a JavaScript object.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`.\n */\n request(method: string, url: string, options?: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n responseType?: 'json',\n reportProgress?: boolean,\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs a request which interprets the body as a JavaScript object\n * with the response body of the requested type.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body of type `R`.\n */\n request<R>(method: string, url: string, options?: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n responseType?: 'json',\n reportProgress?: boolean,\n withCredentials?: boolean,\n }): Observable<R>;\n\n /**\n * Constructs a request where response type and requested observable are not known statically.\n *\n * @param method The HTTP method.\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the requested response, with body of type `any`.\n */\n request(method: string, url: string, options?: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n observe?: 'body'|'events'|'response',\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n }): Observable<any>;\n\n /**\n * Constructs an observable for a generic HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * You can pass an `HttpRequest` directly as the only parameter. In this case,\n * the call returns an observable of the raw `HttpEvent` stream.\n *\n * Alternatively you can pass an HTTP method as the first parameter,\n * a URL string as the second, and an options hash containing the request body as the third.\n * See `addBody()`. In this case, the specified `responseType` and `observe` options determine the\n * type of returned observable.\n * * The `responseType` value determines how a successful response body is parsed.\n * * If `responseType` is the default `json`, you can pass a type interface for the resulting\n * object as a type parameter to the call.\n *\n * The `observe` value determines the return type, according to what you are interested in\n * observing.\n * * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including\n * progress events by default.\n * * An `observe` value of response returns an observable of `HttpResponse<T>`,\n * where the `T` parameter depends on the `responseType` and any optionally provided type\n * parameter.\n * * An `observe` value of body returns an observable of `<T>` with the same `T` body type.\n *\n */\n request(first: string|HttpRequest<any>, url?: string, options: {\n body?: any,\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n let req: HttpRequest<any>;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n } else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n\n // Figure out the headers.\n let headers: HttpHeaders|undefined = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n } else {\n headers = new HttpHeaders(options.headers);\n }\n\n // Sort out parameters.\n let params: HttpParams|undefined = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n } else {\n params = new HttpParams({fromObject: options.params} as HttpParamsOptions);\n }\n }\n\n // Construct the request.\n req = new HttpRequest(first, url!, (options.body !== undefined ? options.body : null), {\n headers,\n context: options.context,\n params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n const events$: Observable<HttpEvent<any>> =\n of(req).pipe(concatMap((req: HttpRequest<any>) => this.handler.handle(req)));\n\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n const res$: Observable<HttpResponse<any>> = <Observable<HttpResponse<any>>>events$.pipe(\n filter((event: HttpEvent<any>) => event instanceof HttpResponse));\n\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(map((res: HttpResponse<any>) => {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(map((res: HttpResponse<any>) => {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(map((res: HttpResponse<any>) => {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(map((res: HttpResponse<any>) => res.body));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);\n }\n }\n\n /**\n * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`\n * and returns the response as an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response body as an `ArrayBuffer`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<ArrayBuffer>;\n\n\n /**\n * Constructs a `DELETE` request that interprets the body as a `Blob` and returns\n * the response as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response body as a `Blob`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<Blob>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as a text string and returns\n * a string.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type string.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<string>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with response body as an `ArrayBuffer`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n body?: any|null\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as a `Blob`\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request, with the response body as a\n * `Blob`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as a text string\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with the response\n * body of type string.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as JSON\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with response body of\n * type `Object`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs a `DELETE`request that interprets the body as JSON\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request, with a response\n * body in the requested type.\n */\n delete<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | (string | number | boolean)[]},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` and returns\n * the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the full `HttpResponse`, with the response body as an `ArrayBuffer`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as a `Blob` and returns the full\n * `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as a text stream and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the full `HttpResponse`, with the response body of type string.\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a `DELETE` request the interprets the body as a JavaScript object and returns\n * the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`.\n *\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as JSON\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with the response body of the requested type.\n */\n delete<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<HttpResponse<T>>;\n\n /**\n * Constructs a `DELETE` request that interprets the body as JSON and\n * returns the response body as an object parsed from JSON.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type `Object`.\n */\n delete(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<Object>;\n\n /**\n * Constructs a DELETE request that interprets the body as JSON and returns\n * the response in a given type.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with response body in the requested type.\n */\n delete<T>(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n body?: any|null,\n }): Observable<T>;\n\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `DELETE` request to execute on the server. See the individual overloads for\n * details on the return type.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n */\n delete(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n body?: any|null,\n } = {}): Observable<any> {\n return this.request<any>('DELETE', url, options as any);\n }\n\n\n /**\n * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns the\n * response in an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs a `GET` request that interprets the body as a `Blob`\n * and returns the response as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs a `GET` request that interprets the body as a text string\n * and returns the response as a string value.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type string.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns\n * the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with the response\n * body as an `ArrayBuffer`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a `GET` request that interprets the body as a `Blob` and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a `GET` request that interprets the body as a text string and returns\n * the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type string.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a `GET` request that interprets the body as JSON\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type `Object`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs a `GET` request that interprets the body as JSON and returns the full\n * event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with a response body in the requested type.\n */\n get<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as an `ArrayBuffer`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a `GET` request that interprets the body as a `Blob` and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as a `Blob`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a `GET` request that interprets the body as a text stream and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body of type string.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a `GET` request that interprets the body as JSON and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the full `HttpResponse`,\n * with the response body of type `Object`.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a `GET` request that interprets the body as JSON and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the full `HttpResponse` for the request,\n * with a response body in the requested type.\n */\n get<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<T>>;\n\n /**\n * Constructs a `GET` request that interprets the body as JSON and\n * returns the response body as an object parsed from JSON.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n *\n * @return An `Observable` of the response body as a JavaScript object.\n */\n get(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs a `GET` request that interprets the body as JSON and returns\n * the response body in a given type.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse`, with a response body in the requested type.\n */\n get<T>(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<T>;\n\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `GET` request to execute on the server. See the individual overloads for\n * details on the return type.\n */\n get(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n return this.request<any>('GET', url, options as any);\n }\n\n\n /**\n * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` and\n * returns the response as an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as a `Blob` and returns\n * the response as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as a text string and returns the response\n * as a string value.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body of type string.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as an `ArrayBuffer`.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as a `Blob` and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as a `Blob`.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as a text string\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with the response body of type\n * string.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as JSON\n * and returns the full HTTP event stream.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body of\n * type `Object`.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as JSON and\n * returns the full event stream.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request,\n * with a response body in the requested type.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n */\n head<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`\n * and returns the full HTTP response.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as an `ArrayBuffer`.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as a `Blob` and returns\n * the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as a blob.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as text stream\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body of type string.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as JSON and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body of type `Object`.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as JSON\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body of the requested type.\n */\n head<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<T>>;\n\n /**\n\n * Constructs a `HEAD` request that interprets the body as JSON and\n * returns the response body as an object parsed from JSON.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\n */\n head(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs a `HEAD` request that interprets the body as JSON and returns\n * the response in a given type.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body of the given type.\n */\n head<T>(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<T>;\n\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `HEAD` request to execute on the server. The `HEAD` method returns\n * meta information about the resource without transferring the\n * resource itself. See the individual overloads for\n * details on the return type.\n */\n head(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n return this.request<any>('HEAD', url, options as any);\n }\n\n /**\n * Constructs a `JSONP` request for the given URL and name of the callback parameter.\n *\n * @param url The resource URL.\n * @param callbackParam The callback function name.\n *\n * @return An `Observable` of the response object, with response body as an object.\n */\n jsonp(url: string, callbackParam: string): Observable<Object>;\n\n /**\n * Constructs a `JSONP` request for the given URL and name of the callback parameter.\n *\n * @param url The resource URL.\n * @param callbackParam The callback function name.\n *\n * You must install a suitable interceptor, such as one provided by `HttpClientJsonpModule`.\n * If no such interceptor is reached,\n * then the `JSONP` request can be rejected by the configured backend.\n *\n * @return An `Observable` of the response object, with response body in the requested type.\n */\n jsonp<T>(url: string, callbackParam: string): Observable<T>;\n\n /**\n * Constructs an `Observable` that, when subscribed, causes a request with the special method\n * `JSONP` to be dispatched via the interceptor pipeline.\n * The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain\n * API endpoints that don't support newer,\n * and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol.\n * JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the\n * requests even if the API endpoint is not located on the same domain (origin) as the client-side\n * application making the request.\n * The endpoint API must support JSONP callback for JSONP requests to work.\n * The resource API returns the JSON response wrapped in a callback function.\n * You can pass the callback function name as one of the query parameters.\n * Note that JSONP requests can only be used with `GET` requests.\n *\n * @param url The resource URL.\n * @param callbackParam The callback function name.\n *\n */\n jsonp<T>(url: string, callbackParam: string): Observable<T> {\n return this.request<any>('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n }\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as an\n * `ArrayBuffer` and returns the response as an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns\n * the response as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as a text string and\n * returns a string value.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body of type string.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer`\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as an `ArrayBuffer`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as a `Blob` and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as a `Blob`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as a text string\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request,\n * with the response body of type string.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as JSON\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request with the response\n * body of type `Object`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as JSON and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request,\n * with a response body in the requested type.\n */\n options<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer`\n * and returns the full HTTP response.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as an `ArrayBuffer`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as a `Blob`\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as a `Blob`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as text stream\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body of type string.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as JSON\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body of type `Object`.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as JSON and\n * returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body in the requested type.\n */\n options<T>(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<T>>;\n\n /**\n\n * Constructs an `OPTIONS` request that interprets the body as JSON and returns the\n * response body as an object parsed from JSON.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\n */\n options(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs an `OPTIONS` request that interprets the body as JSON and returns the\n * response in a given type.\n *\n * @param url The endpoint URL.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse`, with a response body of the given type.\n */\n options<T>(url: string, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<T>;\n\n /**\n * Constructs an `Observable` that, when subscribed, causes the configured\n * `OPTIONS` request to execute on the server. This method allows the client\n * to determine the supported HTTP methods and other capabilities of an endpoint,\n * without implying a resource action. See the individual overloads for\n * details on the return type.\n */\n options(url: string, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n return this.request<any>('OPTIONS', url, options as any);\n }\n\n /**\n * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and returns\n * the response as an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the response\n * as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as a text string and\n * returns the response as a string value.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with a response body of type string.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request,\n * with the response body as an `ArrayBuffer`.\n */\n\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as a `Blob`\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request, with the\n * response body as `Blob`.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as a text string and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request, with a\n * response body of type string.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as JSON\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request,\n * with a response body of type `Object`.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as JSON\n * and returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of all the `HttpEvent`s for the request,\n * with a response body in the requested type.\n */\n patch<T>(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer`\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as an `ArrayBuffer`.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the full\n * `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as a `Blob`.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as a text stream and returns the\n * full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body of type string.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as JSON\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body in the requested type.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as JSON\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body in the given type.\n */\n patch<T>(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<T>>;\n\n /**\n\n * Constructs a `PATCH` request that interprets the body as JSON and\n * returns the response body as an object parsed from JSON.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\n */\n patch(url: string, body: any|null, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs a `PATCH` request that interprets the body as JSON\n * and returns the response in a given type.\n *\n * @param url The endpoint URL.\n * @param body The resources to edit.\n * @param options HTTP options.\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body in the given type.\n */\n patch<T>(url: string, body: any|null, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<T>;\n\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `PATCH` request to execute on the server. See the individual overloads for\n * details on the return type.\n */\n patch(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n return this.request<any>('PATCH', url, addBody(options, body));\n }\n\n /**\n * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and returns\n * an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options.\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs a `POST` request that interprets the body as a `Blob` and returns the\n * response as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs a `POST` request that interprets the body as a text string and\n * returns the response as a string value.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the response, with a response body of type string.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as an `ArrayBuffer`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a `POST` request that interprets the body as a `Blob`\n * and returns the response in an observable of the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with the response body as `Blob`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a `POST` request that interprets the body as a text string and returns the full\n * event stream.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with a response body of type string.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a POST request that interprets the body as JSON and returns the full\n * event stream.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with a response body of type `Object`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs a POST request that interprets the body as JSON and returns the full\n * event stream.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with a response body in the requested type.\n */\n post<T>(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs a POST request that interprets the body as an `ArrayBuffer`\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with the response body as an\n * `ArrayBuffer`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a `POST` request that interprets the body as a `Blob` and returns the full\n * `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as a `Blob`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a `POST` request that interprets the body as a text stream and returns\n * the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body of type string.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a `POST` request that interprets the body as JSON\n * and returns the full `HttpResponse`.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with a response body of type\n * `Object`.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a `POST` request that interprets the body as JSON and returns the\n * full `HttpResponse`.\n *\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with a response body in the\n * requested type.\n */\n post<T>(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<T>>;\n\n /**\n * Constructs a `POST` request that interprets the body as JSON\n * and returns the response body as an object parsed from JSON.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the response, with the response body as an object parsed from JSON.\n */\n post(url: string, body: any|null, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs a `POST` request that interprets the body as JSON\n * and returns an observable of the response.\n *\n * @param url The endpoint URL.\n * @param body The content to replace with.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with a response body in the\n * requested type.\n */\n post<T>(url: string, body: any|null, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<T>;\n\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `POST` request to execute on the server. The server responds with the location of\n * the replaced resource. See the individual overloads for\n * details on the return type.\n */\n post(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n return this.request<any>('POST', url, addBody(options, body));\n }\n\n /**\n * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and returns the\n * response as an `ArrayBuffer`.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<ArrayBuffer>;\n\n /**\n * Constructs a `PUT` request that interprets the body as a `Blob` and returns\n * the response as a `Blob`.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the response, with the response body as a `Blob`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<Blob>;\n\n /**\n * Constructs a `PUT` request that interprets the body as a text string and\n * returns the response as a string value.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the response, with a response body of type string.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<string>;\n\n /**\n * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and\n * returns the full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as an `ArrayBuffer`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpEvent<ArrayBuffer>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as a `Blob` and returns the full event\n * stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with the response body as a `Blob`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Blob>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as a text string and returns the full event\n * stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body\n * of type string.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpEvent<string>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as JSON and returns the full\n * event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request, with a response body of\n * type `Object`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<Object>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as JSON and returns the\n * full event stream.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of all `HttpEvent`s for the request,\n * with a response body in the requested type.\n */\n put<T>(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpEvent<T>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as an\n * `ArrayBuffer` and returns an observable of the full HTTP response.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with the response body as an\n * `ArrayBuffer`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'arraybuffer',\n withCredentials?: boolean,\n }): Observable<HttpResponse<ArrayBuffer>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as a `Blob` and returns the\n * full HTTP response.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with the response body as a `Blob`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'blob',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Blob>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as a text stream and returns the\n * full HTTP response.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with a response body of type\n * string.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean, responseType: 'text',\n withCredentials?: boolean,\n }): Observable<HttpResponse<string>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as JSON and returns the full\n * HTTP response.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request, with a response body\n * of type 'Object`.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<Object>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as an instance of the requested type and\n * returns the full HTTP response.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the `HttpResponse` for the request,\n * with a response body in the requested type.\n */\n put<T>(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',\n context?: HttpContext,\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<HttpResponse<T>>;\n\n /**\n * Constructs a `PUT` request that interprets the body as JSON\n * and returns an observable of JavaScript object.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the response as a JavaScript object.\n */\n put(url: string, body: any|null, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<Object>;\n\n /**\n * Constructs a `PUT` request that interprets the body as an instance of the requested type\n * and returns an observable of the requested type.\n *\n * @param url The endpoint URL.\n * @param body The resources to add/update.\n * @param options HTTP options\n *\n * @return An `Observable` of the requested type.\n */\n put<T>(url: string, body: any|null, options?: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'json',\n withCredentials?: boolean,\n }): Observable<T>;\n\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `PUT` request to execute on the server. The `PUT` method replaces an existing resource\n * with a new set of values.\n * See the individual overloads for details on the return type.\n */\n put(url: string, body: any|null, options: {\n headers?: HttpHeaders|{[header: string]: string | string[]},\n context?: HttpContext,\n observe?: 'body'|'events'|'response',\n params?: HttpParams|\n {[param: string]: string | number | boolean | ReadonlyArray<string|number|boolean>},\n reportProgress?: boolean,\n responseType?: 'arraybuffer'|'blob'|'json'|'text',\n withCredentials?: boolean,\n } = {}): Observable<any> {\n return this.request<any>('PUT', url, addBody(options, body));\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EnvironmentInjector, inject, Injectable, InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {HttpBackend, HttpHandler} from './backend';\nimport {HttpRequest} from './request';\nimport {HttpEvent} from './response';\n\n/**\n * Intercepts and handles an `HttpRequest` or `HttpResponse`.\n *\n * Most interceptors transform the outgoing request before passing it to the\n * next interceptor in the chain, by calling `next.handle(transformedReq)`.\n * An interceptor may transform the\n * response event stream as well, by applying additional RxJS operators on the stream\n * returned by `next.handle()`.\n *\n * More rarely, an interceptor may handle the request entirely,\n * and compose a new event stream instead of invoking `next.handle()`. This is an\n * acceptable behavior, but keep in mind that further interceptors will be skipped entirely.\n *\n * It is also rare but valid for an interceptor to return multiple responses on the\n * event stream for a single request.\n *\n * @publicApi\n *\n * @see [HTTP Guide](guide/http#intercepting-requests-and-responses)\n *\n * @usageNotes\n *\n * To use the same instance of `HttpInterceptors` for the entire app, import the `HttpClientModule`\n * only in your `AppModule`, and add the interceptors to the root application injector.\n * If you import `HttpClientModule` multiple times across different modules (for example, in lazy\n * loading modules), each import creates a new copy of the `HttpClientModule`, which overwrites the\n * interceptors provided in the root module.\n */\nexport interface HttpInterceptor {\n /**\n * Identifies and handles a given HTTP request.\n * @param req The outgoing request object to handle.\n * @param next The next interceptor in the chain, or the backend\n * if no interceptors remain in the chain.\n * @returns An observable of the event stream.\n */\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;\n}\n\n/**\n * Represents the next interceptor in an interceptor chain, or the real backend if there are no\n * further interceptors.\n *\n * Most interceptors will delegate to this function, and either modify the outgoing request or the\n * response when it arrives. Within the scope of the current request, however, this function may be\n * called any number of times, for any number of downstream requests. Such downstream requests need\n * not be to the same URL or even the same origin as the current request. It is also valid to not\n * call the downstream handler at all, and process the current request entirely within the\n * interceptor.\n *\n * This function should only be called within the scope of the request that's currently being\n * intercepted. Once that request is complete, this downstream handler function should not be\n * called.\n *\n * @publicApi\n *\n * @see [HTTP Guide](guide/http#intercepting-requests-and-responses)\n */\nexport type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<unknown>>;\n\n/**\n * An interceptor for HTTP requests made via `HttpClient`.\n *\n * `HttpInterceptorFn`s are middleware functions which `HttpClient` calls when a request is made.\n * These functions have the opportunity to modify the outgoing request or any response that comes\n * back, as well as block, redirect, or otherwise change the request or response semantics.\n *\n * An `HttpHandlerFn` representing the next interceptor (or the backend which will make a real HTTP\n * request) is provided. Most interceptors will delegate to this function, but that is not required\n * (see `HttpHandlerFn` for more details).\n *\n * `HttpInterceptorFn`s have access to `inject()` via the `EnvironmentInjector` from which they were\n * configured.\n */\nexport type HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) =>\n Observable<HttpEvent<unknown>>;\n\n/**\n * Function which invokes an HTTP interceptor chain.\n *\n * Each interceptor in the interceptor chain is turned into a `ChainedInterceptorFn` which closes\n * over the rest of the chain (represented by another `ChainedInterceptorFn`). The last such\n * function in the chain will instead delegate to the `finalHandlerFn`, which is passed down when\n * the chain is invoked.\n *\n * This pattern allows for a chain of many interceptors to be composed and wrapped in a single\n * `HttpInterceptorFn`, which is a useful abstraction for including different kinds of interceptors\n * (e.g. legacy class-based interceptors) in the same chain.\n */\ntype ChainedInterceptorFn<RequestT> = (req: HttpRequest<RequestT>, finalHandlerFn: HttpHandlerFn) =>\n Observable<HttpEvent<RequestT>>;\n\nfunction interceptorChainEndFn(\n req: HttpRequest<any>, finalHandlerFn: HttpHandlerFn): Observable<HttpEvent<any>> {\n return finalHandlerFn(req);\n}\n\n/**\n * Constructs a `ChainedInterceptorFn` which adapts a legacy `HttpInterceptor` to the\n * `ChainedInterceptorFn` interface.\n */\nfunction adaptLegacyInterceptorToChain(\n chainTailFn: ChainedInterceptorFn<any>,\n interceptor: HttpInterceptor): ChainedInterceptorFn<any> {\n return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, {\n handle: (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn),\n });\n}\n\n/**\n * Constructs a `ChainedInterceptorFn` which wraps and invokes a functional interceptor in the given\n * injector.\n */\nfunction chainedInterceptorFn(\n chainTailFn: ChainedInterceptorFn<unknown>, interceptorFn: HttpInterceptorFn,\n injector: EnvironmentInjector): ChainedInterceptorFn<unknown> {\n // clang-format off\n return (initialRequest, finalHandlerFn) => injector.runInContext(() =>\n interceptorFn(\n initialRequest,\n downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn)\n )\n );\n // clang-format on\n}\n\n/**\n * A multi-provider token that represents the array of registered\n * `HttpInterceptor` objects.\n *\n * @publicApi\n */\nexport const HTTP_INTERCEPTORS = new InjectionToken<HttpInterceptor[]>('HTTP_INTERCEPTORS');\n\n/**\n * A multi-provided token of `HttpInterceptorFn`s.\n */\nexport const HTTP_INTERCEPTOR_FNS = new InjectionToken<HttpInterceptorFn[]>('HTTP_INTERCEPTOR_FNS');\n\n/**\n * Creates an `HttpInterceptorFn` which lazily initializes an interceptor chain from the legacy\n * class-based interceptors and runs the request through it.\n */\nexport function legacyInterceptorFnFactory(): HttpInterceptorFn {\n let chain: ChainedInterceptorFn<any>|null = null;\n\n return (req, handler) => {\n if (chain === null) {\n const interceptors = inject(HTTP_INTERCEPTORS, {optional: true}) ?? [];\n // Note: interceptors are wrapped right-to-left so that final execution order is\n // left-to-right. That is, if `interceptors` is the array `[a, b, c]`, we want to\n // produce a chain that is conceptually `c(b(a(end)))`, which we build from the inside\n // out.\n chain = interceptors.reduceRight(\n adaptLegacyInterceptorToChain, interceptorChainEndFn as ChainedInterceptorFn<any>);\n }\n\n return chain(req, handler);\n };\n}\n\n@Injectable()\nexport class HttpInterceptorHandler extends HttpHandler {\n private chain: ChainedInterceptorFn<unknown>|null = null;\n\n constructor(private backend: HttpBackend, private injector: EnvironmentInjector) {\n super();\n }\n\n override handle(initialRequest: HttpRequest<any>): Observable<HttpEvent<any>> {\n if (this.chain === null) {\n const dedupedInterceptorFns = Array.from(new Set(this.injector.get(HTTP_INTERCEPTOR_FNS)));\n\n // Note: interceptors are wrapped right-to-left so that final execution order is\n // left-to-right. That is, if `dedupedInterceptorFns` is the array `[a, b, c]`, we want to\n // produce a chain that is conceptually `c(b(a(end)))`, which we build from the inside\n // out.\n this.chain = dedupedInterceptorFns.reduceRight(\n (nextSequencedFn, interceptorFn) =>\n chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector),\n interceptorChainEndFn as ChainedInterceptorFn<unknown>);\n }\n return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest));\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {XhrFactory} from '@angular/common';\nimport {Injectable} from '@angular/core';\nimport {Observable, Observer} from 'rxjs';\n\nimport {HttpBackend} from './backend';\nimport {HttpHeaders} from './headers';\nimport {HttpRequest} from './request';\nimport {HttpDownloadProgressEvent, HttpErrorResponse, HttpEvent, HttpEventType, HttpHeaderResponse, HttpJsonParseError, HttpResponse, HttpStatusCode, HttpUploadProgressEvent} from './response';\n\n\nconst XSSI_PREFIX = /^\\)\\]\\}',?\\n/;\n\n/**\n * Determine an appropriate URL for the response, by checking either\n * XMLHttpRequest.responseURL or the X-Request-URL header.\n */\nfunction getResponseUrl(xhr: any): string|null {\n if ('responseURL' in xhr && xhr.responseURL) {\n return xhr.responseURL;\n }\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL');\n }\n return null;\n}\n\n/**\n * Uses `XMLHttpRequest` to send requests to a backend server.\n * @see `HttpHandler`\n * @see `JsonpClientBackend`\n *\n * @publicApi\n */\n@Injectable()\nexport class HttpXhrBackend implements HttpBackend {\n constructor(private xhrFactory: XhrFactory) {}\n\n /**\n * Processes a request and returns a stream of response events.\n * @param req The request object.\n * @returns An observable of the response events.\n */\n handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {\n // Quick check to give a better error message when a user attempts to use\n // HttpClient.jsonp() without installing the HttpClientJsonpModule\n if (req.method === 'JSONP') {\n throw new Error(\n `Attempted to construct Jsonp request without HttpClientJsonpModule installed.`);\n }\n\n // Everything happens on Observable subscription.\n return new Observable((observer: Observer<HttpEvent<any>>) => {\n // Start by setting up the XHR object with request method, URL, and withCredentials flag.\n const xhr = this.xhrFactory.build();\n xhr.open(req.method, req.urlWithParams);\n if (!!req.withCredentials) {\n xhr.withCredentials = true;\n }\n\n // Add all the requested headers.\n req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(',')));\n\n // Add an Accept header if one isn't present already.\n if (!req.headers.has('Accept')) {\n xhr.setRequestHeader('Accept', 'application/json, text/plain, */*');\n }\n\n // Auto-detect the Content-Type header if one isn't present already.\n if (!req.headers.has('Content-Type')) {\n const detectedType = req.detectContentTypeHeader();\n // Sometimes Content-Type detection fails.\n if (detectedType !== null) {\n xhr.setRequestHeader('Content-Type', detectedType);\n }\n }\n\n // Set the responseType if one was requested.\n if (req.responseType) {\n const responseType = req.responseType.toLowerCase();\n\n // JSON responses need to be processed as text. This is because if the server\n // returns an XSSI-prefixed JSON response, the browser will fail to parse it,\n // xhr.response will be null, and xhr.responseText cannot be accessed to\n // retrieve the prefixed JSON data in order to strip the prefix. Thus, all JSON\n // is parsed by first requesting text and then applying JSON.parse.\n xhr.responseType = ((responseType !== 'json') ? responseType : 'text') as any;\n }\n\n // Serialize the request body if one is present. If not, this will be set to null.\n const reqBody = req.serializeBody();\n\n // If progress events are enabled, response headers will be delivered\n // in two events - the HttpHeaderResponse event and the full HttpResponse\n // event. However, since response headers don't change in between these\n // two events, it doesn't make sense to parse them twice. So headerResponse\n // caches the data extracted from the response whenever it's first parsed,\n // to ensure parsing isn't duplicated.\n let headerResponse: HttpHeaderResponse|null = null;\n\n // partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest\n // state, and memoizes it into headerResponse.\n const partialFromXhr = (): HttpHeaderResponse => {\n if (headerResponse !== null) {\n return headerResponse;\n }\n\n const statusText = xhr.statusText || 'OK';\n\n // Parse headers from XMLHttpRequest - this step is lazy.\n const headers = new HttpHeaders(xhr.getAllResponseHeaders());\n\n // Read the response URL from the XMLHttpResponse instance and fall back on the\n // request URL.\n const url = getResponseUrl(xhr) || req.url;\n\n // Construct the HttpHeaderResponse and memoize it.\n headerResponse = new HttpHeaderResponse({headers, status: xhr.status, statusText, url});\n return headerResponse;\n };\n\n // Next, a few closures are defined for the various events which XMLHttpRequest can\n // emit. This allows them to be unregistered as event listeners later.\n\n // First up is the load event, which represents a response being fully available.\n const onLoad = () => {\n // Read response state from the memoized partial data.\n let {headers, status, statusText, url} = partialFromXhr();\n\n // The body will be read out if present.\n let body: any|null = null;\n\n if (status !== HttpStatusCode.NoContent) {\n // Use XMLHttpRequest.response if set, responseText otherwise.\n body = (typeof xhr.response === 'undefined') ? xhr.responseText : xhr.response;\n }\n\n // Normalize another potential bug (this one comes from CORS).\n if (status === 0) {\n status = !!body ? HttpStatusCode.Ok : 0;\n }\n\n // ok determines whether the response will be transmitted on the event or\n // error channel. Unsuccessful status codes (not 2xx) will always be errors,\n // but a successful status code can still result in an error if the user\n // asked for JSON data and the body cannot be parsed as such.\n let ok = status >= 200 && status < 300;\n\n // Check whether the body needs to be parsed as JSON (in many cases the browser\n // will have done that already).\n if (req.responseType === 'json' && typeof body === 'string') {\n // Save the original body, before attempting XSSI prefix stripping.\n const originalBody = body;\n body = body.replace(XSSI_PREFIX, '');\n try {\n // Attempt the parse. If it fails, a parse error should be delivered to the user.\n body = body !== '' ? JSON.parse(body) : null;\n } catch (error) {\n // Since the JSON.parse failed, it's reasonable to assume this might not have been a\n // JSON response. Restore the original body (including any XSSI prefix) to deliver\n // a better error response.\n body = originalBody;\n\n // If this was an error request to begin with, leave it as a string, it probably\n // just isn't JSON. Otherwise, deliver the parsing error to the user.\n if (ok) {\n // Even though the response status was 2xx, this is still an error.\n ok = false;\n // The parse error contains the text of the body that failed to parse.\n body = {error, text: body} as HttpJsonParseError;\n }\n }\n }\n\n if (ok) {\n // A successful response is delivered on the event stream.\n observer.next(new HttpResponse({\n body,\n headers,\n status,\n statusText,\n url: url || undefined,\n }));\n // The full body has been received and delivered, no further events\n // are possible. This request is complete.\n observer.complete();\n } else {\n // An unsuccessful request is delivered on the error channel.\n observer.error(new HttpErrorResponse({\n // The error in this case is the response body (error from the server).\n error: body,\n headers,\n status,\n statusText,\n url: url || undefined,\n }));\n }\n };\n\n // The onError callback is called when something goes wrong at the network level.\n // Connection timeout, DNS error, offline, etc. These are actual errors, and are\n // transmitted on the error channel.\n const onError = (error: ProgressEvent) => {\n const {url} = partialFromXhr();\n const res = new HttpErrorResponse({\n error,\n status: xhr.status || 0,\n statusText: xhr.statusText || 'Unknown Error',\n url: url || undefined,\n });\n observer.error(res);\n };\n\n // The sentHeaders flag tracks whether the HttpResponseHeaders event\n // has been sent on the stream. This is necessary to track if progress\n // is enabled since the event will be sent on only the first download\n // progress event.\n let sentHeaders = false;\n\n // The download progress event handler, which is only registered if\n // progress events are enabled.\n const onDownProgress = (event: ProgressEvent) => {\n // Send the HttpResponseHeaders event if it hasn't been sent already.\n if (!sentHeaders) {\n observer.next(partialFromXhr());\n sentHeaders = true;\n }\n\n // Start building the download progress event to deliver on the response\n // event stream.\n let progressEvent: HttpDownloadProgressEvent = {\n type: HttpEventType.DownloadProgress,\n loaded: event.loaded,\n };\n\n // Set the total number of bytes in the event if it's available.\n if (event.lengthComputable) {\n progressEvent.total = event.total;\n }\n\n // If the request was for text content and a partial response is\n // available on XMLHttpRequest, include it in the progress event\n // to allow for streaming reads.\n if (req.responseType === 'text' && !!xhr.responseText) {\n progressEvent.partialText = xhr.responseText;\n }\n\n // Finally, fire the event.\n observer.next(progressEvent);\n };\n\n // The upload progress event handler, which is only registered if\n // progress events are enabled.\n const onUpProgress = (event: ProgressEvent) => {\n // Upload progress events are simpler. Begin building the progress\n // event.\n let progress: HttpUploadProgressEvent = {\n type: HttpEventType.UploadProgress,\n loaded: event.loaded,\n };\n\n // If the total number of bytes being uploaded is available, include\n // it.\n if (event.lengthComputable) {\n progress.total = event.total;\n }\n\n // Send the event.\n observer.next(progress);\n };\n\n // By default, register for load and error events.\n xhr.addEventListener('load', onLoad);\n xhr.addEventListener('error', onError);\n xhr.addEventListener('timeout', onError);\n xhr.addEventListener('abort', onError);\n\n // Progress events are only enabled if requested.\n if (req.reportProgress) {\n // Download progress is always enabled if requested.\n xhr.addEventListener('progress', onDownProgress);\n\n // Upload progress depends on whether there is a body to upload.\n if (reqBody !== null && xhr.upload) {\n xhr.upload.addEventListener('progress', onUpProgress);\n }\n }\n\n // Fire the request, and notify the event stream that it was fired.\n xhr.send(reqBody!);\n observer.next({type: HttpEventType.Sent});\n\n // This is the return from the Observable function, which is the\n // request cancellation handler.\n return () => {\n // On a cancellation, remove all registered event listeners.\n xhr.removeEventListener('error', onError);\n xhr.removeEventListener('abort', onError);\n xhr.removeEventListener('load', onLoad);\n xhr.removeEventListener('timeout', onError);\n if (req.reportProgress) {\n xhr.removeEventListener('progress', onDownProgress);\n if (reqBody !== null && xhr.upload) {\n xhr.upload.removeEventListener('progress', onUpProgress);\n }\n }\n\n // Finally, abort the in-flight request.\n if (xhr.readyState !== xhr.DONE) {\n xhr.abort();\n }\n };\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, ɵparseCookieValue as parseCookieValue} from '@angular/common';\nimport {EnvironmentInjector, Inject, inject, Injectable, InjectionToken, PLATFORM_ID} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {HttpHandler} from './backend';\nimport {HttpHandlerFn, HttpInterceptor} from './interceptor';\nimport {HttpRequest} from './request';\nimport {HttpEvent} from './response';\n\nexport const XSRF_ENABLED = new InjectionToken<boolean>('XSRF_ENABLED');\n\nexport const XSRF_DEFAULT_COOKIE_NAME = 'XSRF-TOKEN';\nexport const XSRF_COOKIE_NAME = new InjectionToken<string>('XSRF_COOKIE_NAME', {\n providedIn: 'root',\n factory: () => XSRF_DEFAULT_COOKIE_NAME,\n});\n\nexport const XSRF_DEFAULT_HEADER_NAME = 'X-XSRF-TOKEN';\nexport const XSRF_HEADER_NAME = new InjectionToken<string>('XSRF_HEADER_NAME', {\n providedIn: 'root',\n factory: () => XSRF_DEFAULT_HEADER_NAME,\n});\n\n/**\n * Retrieves the current XSRF token to use with the next outgoing request.\n *\n * @publicApi\n */\nexport abstract class HttpXsrfTokenExtractor {\n /**\n * Get the XSRF token to use with an outgoing request.\n *\n * Will be called for every request, so the token may change between requests.\n */\n abstract getToken(): string|null;\n}\n\n/**\n * `HttpXsrfTokenExtractor` which retrieves the token from a cookie.\n */\n@Injectable()\nexport class HttpXsrfCookieExtractor implements HttpXsrfTokenExtractor {\n private lastCookieString: string = '';\n private lastToken: string|null = null;\n\n /**\n * @internal for testing\n */\n parseCount: number = 0;\n\n constructor(\n @Inject(DOCUMENT) private doc: any, @Inject(PLATFORM_ID) private platform: string,\n @Inject(XSRF_COOKIE_NAME) private cookieName: string) {}\n\n getToken(): string|null {\n if (this.platform === 'server') {\n return null;\n }\n const cookieString = this.doc.cookie || '';\n if (cookieString !== this.lastCookieString) {\n this.parseCount++;\n this.lastToken = parseCookieValue(cookieString, this.cookieName);\n this.lastCookieString = cookieString;\n }\n return this.lastToken;\n }\n}\n\nexport function xsrfInterceptorFn(\n req: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>> {\n const lcUrl = req.url.toLowerCase();\n // Skip both non-mutating requests and absolute URLs.\n // Non-mutating requests don't require a token, and absolute URLs require special handling\n // anyway as the cookie set\n // on our origin is not the same as the token expected by another origin.\n if (!inject(XSRF_ENABLED) || req.method === 'GET' || req.method === 'HEAD' ||\n lcUrl.startsWith('http://') || lcUrl.startsWith('https://')) {\n return next(req);\n }\n\n const token = inject(HttpXsrfTokenExtractor).getToken();\n const headerName = inject(XSRF_HEADER_NAME);\n\n // Be careful not to overwrite an existing header of the same name.\n if (token != null && !req.headers.has(headerName)) {\n req = req.clone({headers: req.headers.set(headerName, token)});\n }\n return next(req);\n}\n\n/**\n * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.\n */\n@Injectable()\nexport class HttpXsrfInterceptor implements HttpInterceptor {\n constructor(private injector: EnvironmentInjector) {}\n\n intercept(initialRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n return this.injector.runInContext(\n () =>\n xsrfInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest)));\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EnvironmentProviders, inject, InjectionToken, makeEnvironmentProviders, Provider} from '@angular/core';\n\nimport {HttpBackend, HttpHandler} from './backend';\nimport {HttpClient} from './client';\nimport {HTTP_INTERCEPTOR_FNS, HttpInterceptorFn, HttpInterceptorHandler, legacyInterceptorFnFactory} from './interceptor';\nimport {jsonpCallbackContext, JsonpCallbackContext, JsonpClientBackend, jsonpInterceptorFn} from './jsonp';\nimport {HttpXhrBackend} from './xhr';\nimport {HttpXsrfCookieExtractor, HttpXsrfTokenExtractor, XSRF_COOKIE_NAME, XSRF_ENABLED, XSRF_HEADER_NAME, xsrfInterceptorFn} from './xsrf';\n\n/**\n * Identifies a particular kind of `HttpFeature`.\n *\n * @publicApi\n */\nexport enum HttpFeatureKind {\n Interceptors,\n LegacyInterceptors,\n CustomXsrfConfiguration,\n NoXsrfProtection,\n JsonpSupport,\n RequestsMadeViaParent,\n}\n\n/**\n * A feature for use when configuring `provideHttpClient`.\n *\n * @publicApi\n */\nexport interface HttpFeature<KindT extends HttpFeatureKind> {\n ɵkind: KindT;\n ɵproviders: Provider[];\n}\n\nfunction makeHttpFeature<KindT extends HttpFeatureKind>(\n kind: KindT, providers: Provider[]): HttpFeature<KindT> {\n return {\n ɵkind: kind,\n ɵproviders: providers,\n };\n}\n\n/**\n * Configures Angular's `HttpClient` service to be available for injection.\n *\n * By default, `HttpClient` will be configured for injection with its default options for XSRF\n * protection of outgoing requests. Additional configuration options can be provided by passing\n * feature functions to `provideHttpClient`. For example, HTTP interceptors can be added using the\n * `withInterceptors(...)` feature.\n *\n * @see withInterceptors\n * @see withInterceptorsFromDi\n * @see withXsrfConfiguration\n * @see withNoXsrfProtection\n * @see withJsonpSupport\n * @see withRequestsMadeViaParent\n */\nexport function provideHttpClient(...features: HttpFeature<HttpFeatureKind>[]):\n EnvironmentProviders {\n if (ngDevMode) {\n const featureKinds = new Set(features.map(f => f.ɵkind));\n if (featureKinds.has(HttpFeatureKind.NoXsrfProtection) &&\n featureKinds.has(HttpFeatureKind.CustomXsrfConfiguration)) {\n throw new Error(\n ngDevMode ?\n `Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.` :\n '');\n }\n }\n\n const providers: Provider[] = [\n HttpClient,\n HttpXhrBackend,\n HttpInterceptorHandler,\n {provide: HttpHandler, useExisting: HttpInterceptorHandler},\n {provide: HttpBackend, useExisting: HttpXhrBackend},\n {\n provide: HTTP_INTERCEPTOR_FNS,\n useValue: xsrfInterceptorFn,\n multi: true,\n },\n {provide: XSRF_ENABLED, useValue: true},\n {provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor},\n ];\n\n for (const feature of features) {\n providers.push(...feature.ɵproviders);\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Adds one or more functional-style HTTP interceptors to the configuration of the `HttpClient`\n * instance.\n *\n * @see HttpInterceptorFn\n * @see provideHttpClient\n * @publicApi\n */\nexport function withInterceptors(interceptorFns: HttpInterceptorFn[]):\n HttpFeature<HttpFeatureKind.Interceptors> {\n return makeHttpFeature(HttpFeatureKind.Interceptors, interceptorFns.map(interceptorFn => {\n return {\n provide: HTTP_INTERCEPTOR_FNS,\n useValue: interceptorFn,\n multi: true,\n };\n }));\n}\n\nconst LEGACY_INTERCEPTOR_FN = new InjectionToken<HttpInterceptorFn>('LEGACY_INTERCEPTOR_FN');\n\n/**\n * Includes class-based interceptors configured using a multi-provider in the current injector into\n * the configured `HttpClient` instance.\n *\n * Prefer `withInterceptors` and functional interceptors instead, as support for DI-provided\n * interceptors may be phased out in a later release.\n *\n * @see HttpInterceptor\n * @see HTTP_INTERCEPTORS\n * @see provideHttpClient\n */\nexport function withInterceptorsFromDi(): HttpFeature<HttpFeatureKind.LegacyInterceptors> {\n // Note: the legacy interceptor function is provided here via an intermediate token\n // (`LEGACY_INTERCEPTOR_FN`), using a pattern which guarantees that if these providers are\n // included multiple times, all of the multi-provider entries will have the same instance of the\n // interceptor function. That way, the `HttpINterceptorHandler` will dedup them and legacy\n // interceptors will not run multiple times.\n return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [\n {\n provide: LEGACY_INTERCEPTOR_FN,\n useFactory: legacyInterceptorFnFactory,\n },\n {\n provide: HTTP_INTERCEPTOR_FNS,\n useExisting: LEGACY_INTERCEPTOR_FN,\n multi: true,\n }\n ]);\n}\n\n/**\n * Customizes the XSRF protection for the configuration of the current `HttpClient` instance.\n *\n * This feature is incompatible with the `withNoXsrfProtection` feature.\n *\n * @see provideHttpClient\n */\nexport function withXsrfConfiguration(\n {cookieName, headerName}: {cookieName?: string, headerName?: string}):\n HttpFeature<HttpFeatureKind.CustomXsrfConfiguration> {\n const providers: Provider[] = [];\n if (cookieName !== undefined) {\n providers.push({provide: XSRF_COOKIE_NAME, useValue: cookieName});\n }\n if (headerName !== undefined) {\n providers.push({provide: XSRF_HEADER_NAME, useValue: headerName});\n }\n\n return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);\n}\n\n/**\n * Disables XSRF protection in the configuration of the current `HttpClient` instance.\n *\n * This feature is incompatible with the `withXsrfConfiguration` feature.\n *\n * @see provideHttpClient\n */\nexport function withNoXsrfProtection(): HttpFeature<HttpFeatureKind.NoXsrfProtection> {\n return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [\n {\n provide: XSRF_ENABLED,\n useValue: false,\n },\n ]);\n}\n\n/**\n * Add JSONP support to the configuration of the current `HttpClient` instance.\n *\n * @see provideHttpClient\n */\nexport function withJsonpSupport(): HttpFeature<HttpFeatureKind.JsonpSupport> {\n return makeHttpFeature(HttpFeatureKind.JsonpSupport, [\n JsonpClientBackend,\n {provide: JsonpCallbackContext, useFactory: jsonpCallbackContext},\n {provide: HTTP_INTERCEPTOR_FNS, useValue: jsonpInterceptorFn, multi: true},\n ]);\n}\n\n/**\n * Configures the current `HttpClient` instance to make requests via the parent injector's\n * `HttpClient` instead of directly.\n *\n * By default, `provideHttpClient` configures `HttpClient` in its injector to be an independent\n * instance. For example, even if `HttpClient` is configured in the parent injector with\n * one or more interceptors, they will not intercept requests made via this instance.\n *\n * With this option enabled, once the request has passed through the current injector's\n * interceptors, it will be delegated to the parent injector's `HttpClient` chain instead of\n * dispatched directly, and interceptors in the parent configuration will be applied to the request.\n *\n * If there are several `HttpClient` instances in the injector hierarchy, it's possible for\n * `withRequestsMadeViaParent` to be used at multiple levels, which will cause the request to\n * \"bubble up\" until either reaching the root level or an `HttpClient` which was not configured with\n * this option.\n *\n * @see provideHttpClient\n * @developerPreview\n */\nexport function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.RequestsMadeViaParent> {\n return makeHttpFeature(HttpFeatureKind.RequestsMadeViaParent, [\n {\n provide: HttpBackend,\n useFactory: () => {\n const handlerFromParent = inject(HttpHandler, {skipSelf: true, optional: true});\n if (ngDevMode && handlerFromParent === null) {\n throw new Error(\n 'withRequestsMadeViaParent() can only be used when the parent injector also configures HttpClient');\n }\n return handlerFromParent;\n },\n },\n ]);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ModuleWithProviders, NgModule} from '@angular/core';\n\nimport {HTTP_INTERCEPTORS} from './interceptor';\nimport {provideHttpClient, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withXsrfConfiguration} from './provider';\nimport {HttpXsrfCookieExtractor, HttpXsrfInterceptor, HttpXsrfTokenExtractor, XSRF_DEFAULT_COOKIE_NAME, XSRF_DEFAULT_HEADER_NAME, XSRF_ENABLED} from './xsrf';\n\n/**\n * Configures XSRF protection support for outgoing requests.\n *\n * For a server that supports a cookie-based XSRF protection system,\n * use directly to configure XSRF protection with the correct\n * cookie and header names.\n *\n * If no names are supplied, the default cookie name is `XSRF-TOKEN`\n * and the default header name is `X-XSRF-TOKEN`.\n *\n * @publicApi\n */\n@NgModule({\n providers: [\n HttpXsrfInterceptor,\n {provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true},\n {provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor},\n withXsrfConfiguration({\n cookieName: XSRF_DEFAULT_COOKIE_NAME,\n headerName: XSRF_DEFAULT_HEADER_NAME,\n }).ɵproviders,\n {provide: XSRF_ENABLED, useValue: true},\n ],\n})\nexport class HttpClientXsrfModule {\n /**\n * Disable the default XSRF protection.\n */\n static disable(): ModuleWithProviders<HttpClientXsrfModule> {\n return {\n ngModule: HttpClientXsrfModule,\n providers: [\n withNoXsrfProtection().ɵproviders,\n ],\n };\n }\n\n /**\n * Configure XSRF protection.\n * @param options An object that can specify either or both\n * cookie name or header name.\n * - Cookie name default is `XSRF-TOKEN`.\n * - Header name default is `X-XSRF-TOKEN`.\n *\n */\n static withOptions(options: {\n cookieName?: string,\n headerName?: string,\n } = {}): ModuleWithProviders<HttpClientXsrfModule> {\n return {\n ngModule: HttpClientXsrfModule,\n providers: withXsrfConfiguration(options).ɵproviders,\n };\n }\n}\n\n/**\n * Configures the [dependency injector](guide/glossary#injector) for `HttpClient`\n * with supporting services for XSRF. Automatically imported by `HttpClientModule`.\n *\n * You can add interceptors to the chain behind `HttpClient` by binding them to the\n * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`.\n *\n * @publicApi\n */\n@NgModule({\n /**\n * Configures the [dependency injector](guide/glossary#injector) where it is imported\n * with supporting services for HTTP communications.\n */\n providers: [\n provideHttpClient(withInterceptorsFromDi()),\n ],\n})\nexport class HttpClientModule {\n}\n\n/**\n * Configures the [dependency injector](guide/glossary#injector) for `HttpClient`\n * with supporting services for JSONP.\n * Without this module, Jsonp requests reach the backend\n * with method JSONP, where they are rejected.\n *\n * @publicApi\n */\n@NgModule({\n providers: [\n withJsonpSupport().ɵproviders,\n ],\n})\nexport class HttpClientJsonpModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewChecked,\n Attribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ErrorHandler,\n inject,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n ViewEncapsulation,\n} from '@angular/core';\nimport {CanColor, ThemePalette, mixinColor} from '@angular/material/core';\nimport {Subscription} from 'rxjs';\nimport {take} from 'rxjs/operators';\n\nimport {MatIconRegistry} from './icon-registry';\n\n// Boilerplate for applying mixins to MatIcon.\n/** @docs-private */\nconst _MatIconBase = mixinColor(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n);\n\n/** Default options for `mat-icon`. */\nexport interface MatIconDefaultOptions {\n /** Default color of the icon. */\n color?: ThemePalette;\n /** Font set that the icon is a part of. */\n fontSet?: string;\n}\n\n/** Injection token to be used to override the default options for `mat-icon`. */\nexport const MAT_ICON_DEFAULT_OPTIONS = new InjectionToken<MatIconDefaultOptions>(\n 'MAT_ICON_DEFAULT_OPTIONS',\n);\n\n/**\n * Injection token used to provide the current location to `MatIcon`.\n * Used to handle server-side rendering and to stub out during unit tests.\n * @docs-private\n */\nexport const MAT_ICON_LOCATION = new InjectionToken<MatIconLocation>('mat-icon-location', {\n providedIn: 'root',\n factory: MAT_ICON_LOCATION_FACTORY,\n});\n\n/**\n * Stubbed out location for `MatIcon`.\n * @docs-private\n */\nexport interface MatIconLocation {\n getPathname: () => string;\n}\n\n/** @docs-private */\nexport function MAT_ICON_LOCATION_FACTORY(): MatIconLocation {\n const _document = inject(DOCUMENT);\n const _location = _document ? _document.location : null;\n\n return {\n // Note that this needs to be a function, rather than a property, because Angular\n // will only resolve it once, but we want the current path on each call.\n getPathname: () => (_location ? _location.pathname + _location.search : ''),\n };\n}\n\n/** SVG attributes that accept a FuncIRI (e.g. `url(<something>)`). */\nconst funcIriAttributes = [\n 'clip-path',\n 'color-profile',\n 'src',\n 'cursor',\n 'fill',\n 'filter',\n 'marker',\n 'marker-start',\n 'marker-mid',\n 'marker-end',\n 'mask',\n 'stroke',\n];\n\n/** Selector that can be used to find all elements that are using a `FuncIRI`. */\nconst funcIriAttributeSelector = funcIriAttributes.map(attr => `[${attr}]`).join(', ');\n\n/** Regex that can be used to extract the id out of a FuncIRI. */\nconst funcIriPattern = /^url\\(['\"]?#(.*?)['\"]?\\)$/;\n\n/**\n * Component to display an icon. It can be used in the following ways:\n *\n * - Specify the svgIcon input to load an SVG icon from a URL previously registered with the\n * addSvgIcon, addSvgIconInNamespace, addSvgIconSet, or addSvgIconSetInNamespace methods of\n * MatIconRegistry. If the svgIcon value contains a colon it is assumed to be in the format\n * \"[namespace]:[name]\", if not the value will be the name of an icon in the default namespace.\n * Examples:\n * `<mat-icon svgIcon=\"left-arrow\"></mat-icon>\n * <mat-icon svgIcon=\"animals:cat\"></mat-icon>`\n *\n * - Use a font ligature as an icon by putting the ligature text in the `fontIcon` attribute or the\n * content of the `<mat-icon>` component. If you register a custom font class, don't forget to also\n * include the special class `mat-ligature-font`. It is recommended to use the attribute alternative\n * to prevent the ligature text to be selectable and to appear in search engine results.\n * By default, the Material icons font is used as described at\n * http://google.github.io/material-design-icons/#icon-font-for-the-web. You can specify an\n * alternate font by setting the fontSet input to either the CSS class to apply to use the\n * desired font, or to an alias previously registered with MatIconRegistry.registerFontClassAlias.\n * Examples:\n * `<mat-icon fontIcon=\"home\"></mat-icon>\n * <mat-icon>home</mat-icon>\n * <mat-icon fontSet=\"myfont\" fontIcon=\"sun\"></mat-icon>\n * <mat-icon fontSet=\"myfont\">sun</mat-icon>`\n *\n * - Specify a font glyph to be included via CSS rules by setting the fontSet input to specify the\n * font, and the fontIcon input to specify the icon. Typically the fontIcon will specify a\n * CSS class which causes the glyph to be displayed via a :before selector, as in\n * https://fortawesome.github.io/Font-Awesome/examples/\n * Example:\n * `<mat-icon fontSet=\"fa\" fontIcon=\"alarm\"></mat-icon>`\n */\n@Component({\n template: '<ng-content></ng-content>',\n selector: 'mat-icon',\n exportAs: 'matIcon',\n styleUrls: ['icon.css'],\n inputs: ['color'],\n host: {\n 'role': 'img',\n 'class': 'mat-icon notranslate',\n '[attr.data-mat-icon-type]': '_usingFontIcon() ? \"font\" : \"svg\"',\n '[attr.data-mat-icon-name]': '_svgName || fontIcon',\n '[attr.data-mat-icon-namespace]': '_svgNamespace || fontSet',\n '[attr.fontIcon]': '_usingFontIcon() ? fontIcon : null',\n '[class.mat-icon-inline]': 'inline',\n '[class.mat-icon-no-color]': 'color !== \"primary\" && color !== \"accent\" && color !== \"warn\"',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatIcon extends _MatIconBase implements OnInit, AfterViewChecked, CanColor, OnDestroy {\n /**\n * Whether the icon should be inlined, automatically sizing the icon to match the font size of\n * the element the icon is contained in.\n */\n @Input()\n get inline(): boolean {\n return this._inline;\n }\n set inline(inline: BooleanInput) {\n this._inline = coerceBooleanProperty(inline);\n }\n private _inline: boolean = false;\n\n /** Name of the icon in the SVG icon set. */\n @Input()\n get svgIcon(): string {\n return this._svgIcon;\n }\n set svgIcon(value: string) {\n if (value !== this._svgIcon) {\n if (value) {\n this._updateSvgIcon(value);\n } else if (this._svgIcon) {\n this._clearSvgElement();\n }\n this._svgIcon = value;\n }\n }\n private _svgIcon: string;\n\n /** Font set that the icon is a part of. */\n @Input()\n get fontSet(): string {\n return this._fontSet;\n }\n set fontSet(value: string) {\n const newValue = this._cleanupFontValue(value);\n\n if (newValue !== this._fontSet) {\n this._fontSet = newValue;\n this._updateFontIconClasses();\n }\n }\n private _fontSet: string;\n\n /** Name of an icon within a font set. */\n @Input()\n get fontIcon(): string {\n return this._fontIcon;\n }\n set fontIcon(value: string) {\n const newValue = this._cleanupFontValue(value);\n\n if (newValue !== this._fontIcon) {\n this._fontIcon = newValue;\n this._updateFontIconClasses();\n }\n }\n private _fontIcon: string;\n\n private _previousFontSetClass: string[] = [];\n private _previousFontIconClass: string;\n\n _svgName: string | null;\n _svgNamespace: string | null;\n\n /** Keeps track of the current page path. */\n private _previousPath?: string;\n\n /** Keeps track of the elements and attributes that we've prefixed with the current path. */\n private _elementsWithExternalReferences?: Map<Element, {name: string; value: string}[]>;\n\n /** Subscription to the current in-progress SVG icon request. */\n private _currentIconFetch = Subscription.EMPTY;\n\n constructor(\n elementRef: ElementRef<HTMLElement>,\n private _iconRegistry: MatIconRegistry,\n @Attribute('aria-hidden') ariaHidden: string,\n @Inject(MAT_ICON_LOCATION) private _location: MatIconLocation,\n private readonly _errorHandler: ErrorHandler,\n @Optional()\n @Inject(MAT_ICON_DEFAULT_OPTIONS)\n defaults?: MatIconDefaultOptions,\n ) {\n super(elementRef);\n\n if (defaults) {\n if (defaults.color) {\n this.color = this.defaultColor = defaults.color;\n }\n\n if (defaults.fontSet) {\n this.fontSet = defaults.fontSet;\n }\n }\n\n // If the user has not explicitly set aria-hidden, mark the icon as hidden, as this is\n // the right thing to do for the majority of icon use-cases.\n if (!ariaHidden) {\n elementRef.nativeElement.setAttribute('aria-hidden', 'true');\n }\n }\n\n /**\n * Splits an svgIcon binding value into its icon set and icon name components.\n * Returns a 2-element array of [(icon set), (icon name)].\n * The separator for the two fields is ':'. If there is no separator, an empty\n * string is returned for the icon set and the entire value is returned for\n * the icon name. If the argument is falsy, returns an array of two empty strings.\n * Throws an error if the name contains two or more ':' separators.\n * Examples:\n * `'social:cake' -> ['social', 'cake']\n * 'penguin' -> ['', 'penguin']\n * null -> ['', '']\n * 'a:b:c' -> (throws Error)`\n */\n private _splitIconName(iconName: string): [string, string] {\n if (!iconName) {\n return ['', ''];\n }\n const parts = iconName.split(':');\n switch (parts.length) {\n case 1:\n return ['', parts[0]]; // Use default namespace.\n case 2:\n return <[string, string]>parts;\n default:\n throw Error(`Invalid icon name: \"${iconName}\"`); // TODO: add an ngDevMode check\n }\n }\n\n ngOnInit() {\n // Update font classes because ngOnChanges won't be called if none of the inputs are present,\n // e.g. <mat-icon>arrow</mat-icon> In this case we need to add a CSS class for the default font.\n this._updateFontIconClasses();\n }\n\n ngAfterViewChecked() {\n const cachedElements = this._elementsWithExternalReferences;\n\n if (cachedElements && cachedElements.size) {\n const newPath = this._location.getPathname();\n\n // We need to check whether the URL has changed on each change detection since\n // the browser doesn't have an API that will let us react on link clicks and\n // we can't depend on the Angular router. The references need to be updated,\n // because while most browsers don't care whether the URL is correct after\n // the first render, Safari will break if the user navigates to a different\n // page and the SVG isn't re-rendered.\n if (newPath !== this._previousPath) {\n this._previousPath = newPath;\n this._prependPathToReferences(newPath);\n }\n }\n }\n\n ngOnDestroy() {\n this._currentIconFetch.unsubscribe();\n\n if (this._elementsWithExternalReferences) {\n this._elementsWithExternalReferences.clear();\n }\n }\n\n _usingFontIcon(): boolean {\n return !this.svgIcon;\n }\n\n private _setSvgElement(svg: SVGElement) {\n this._clearSvgElement();\n\n // Note: we do this fix here, rather than the icon registry, because the\n // references have to point to the URL at the time that the icon was created.\n const path = this._location.getPathname();\n this._previousPath = path;\n this._cacheChildrenWithExternalReferences(svg);\n this._prependPathToReferences(path);\n this._elementRef.nativeElement.appendChild(svg);\n }\n\n private _clearSvgElement() {\n const layoutElement: HTMLElement = this._elementRef.nativeElement;\n let childCount = layoutElement.childNodes.length;\n\n if (this._elementsWithExternalReferences) {\n this._elementsWithExternalReferences.clear();\n }\n\n // Remove existing non-element child nodes and SVGs, and add the new SVG element. Note that\n // we can't use innerHTML, because IE will throw if the element has a data binding.\n while (childCount--) {\n const child = layoutElement.childNodes[childCount];\n\n // 1 corresponds to Node.ELEMENT_NODE. We remove all non-element nodes in order to get rid\n // of any loose text nodes, as well as any SVG elements in order to remove any old icons.\n if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') {\n child.remove();\n }\n }\n }\n\n private _updateFontIconClasses() {\n if (!this._usingFontIcon()) {\n return;\n }\n\n const elem: HTMLElement = this._elementRef.nativeElement;\n const fontSetClasses = (\n this.fontSet\n ? this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/)\n : this._iconRegistry.getDefaultFontSetClass()\n ).filter(className => className.length > 0);\n\n this._previousFontSetClass.forEach(className => elem.classList.remove(className));\n fontSetClasses.forEach(className => elem.classList.add(className));\n this._previousFontSetClass = fontSetClasses;\n\n if (\n this.fontIcon !== this._previousFontIconClass &&\n !fontSetClasses.includes('mat-ligature-font')\n ) {\n if (this._previousFontIconClass) {\n elem.classList.remove(this._previousFontIconClass);\n }\n if (this.fontIcon) {\n elem.classList.add(this.fontIcon);\n }\n this._previousFontIconClass = this.fontIcon;\n }\n }\n\n /**\n * Cleans up a value to be used as a fontIcon or fontSet.\n * Since the value ends up being assigned as a CSS class, we\n * have to trim the value and omit space-separated values.\n */\n private _cleanupFontValue(value: string) {\n return typeof value === 'string' ? value.trim().split(' ')[0] : value;\n }\n\n /**\n * Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`\n * reference. This is required because WebKit browsers require references to be prefixed with\n * the current path, if the page has a `base` tag.\n */\n private _prependPathToReferences(path: string) {\n const elements = this._elementsWithExternalReferences;\n\n if (elements) {\n elements.forEach((attrs, element) => {\n attrs.forEach(attr => {\n element.setAttribute(attr.name, `url('${path}#${attr.value}')`);\n });\n });\n }\n }\n\n /**\n * Caches the children of an SVG element that have `url()`\n * references that we need to prefix with the current path.\n */\n private _cacheChildrenWithExternalReferences(element: SVGElement) {\n const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);\n const elements = (this._elementsWithExternalReferences =\n this._elementsWithExternalReferences || new Map());\n\n for (let i = 0; i < elementsWithFuncIri.length; i++) {\n funcIriAttributes.forEach(attr => {\n const elementWithReference = elementsWithFuncIri[i];\n const value = elementWithReference.getAttribute(attr);\n const match = value ? value.match(funcIriPattern) : null;\n\n if (match) {\n let attributes = elements.get(elementWithReference);\n\n if (!attributes) {\n attributes = [];\n elements.set(elementWithReference, attributes);\n }\n\n attributes!.push({name: attr, value: match[1]});\n }\n });\n }\n }\n\n /** Sets a new SVG icon with a particular name. */\n private _updateSvgIcon(rawName: string | undefined) {\n this._svgNamespace = null;\n this._svgName = null;\n this._currentIconFetch.unsubscribe();\n\n if (rawName) {\n const [namespace, iconName] = this._splitIconName(rawName);\n\n if (namespace) {\n this._svgNamespace = namespace;\n }\n\n if (iconName) {\n this._svgName = iconName;\n }\n\n this._currentIconFetch = this._iconRegistry\n .getNamedSvgIcon(iconName, namespace)\n .pipe(take(1))\n .subscribe(\n svg => this._setSvgElement(svg),\n (err: Error) => {\n const errorMessage = `Error retrieving icon ${namespace}:${iconName}! ${err.message}`;\n this._errorHandler.handleError(new Error(errorMessage));\n },\n );\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatIcon} from './icon';\n\n@NgModule({\n imports: [MatCommonModule],\n exports: [MatIcon, MatCommonModule],\n declarations: [MatIcon],\n})\nexport class MatIconModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {HttpClient, HttpErrorResponse} from '@angular/common/http';\nimport {\n ErrorHandler,\n Inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Optional,\n SecurityContext,\n SkipSelf,\n} from '@angular/core';\nimport {DomSanitizer, SafeHtml, SafeResourceUrl} from '@angular/platform-browser';\nimport {forkJoin, Observable, of as observableOf, throwError as observableThrow} from 'rxjs';\nimport {catchError, finalize, map, share, tap} from 'rxjs/operators';\nimport {TrustedHTML, trustedHTMLFromString} from './trusted-types';\n\n/**\n * Returns an exception to be thrown in the case when attempting to\n * load an icon with a name that cannot be found.\n * @docs-private\n */\nexport function getMatIconNameNotFoundError(iconName: string): Error {\n return Error(`Unable to find icon with the name \"${iconName}\"`);\n}\n\n/**\n * Returns an exception to be thrown when the consumer attempts to use\n * `<mat-icon>` without including @angular/common/http.\n * @docs-private\n */\nexport function getMatIconNoHttpProviderError(): Error {\n return Error(\n 'Could not find HttpClient provider for use with Angular Material icons. ' +\n 'Please include the HttpClientModule from @angular/common/http in your ' +\n 'app imports.',\n );\n}\n\n/**\n * Returns an exception to be thrown when a URL couldn't be sanitized.\n * @param url URL that was attempted to be sanitized.\n * @docs-private\n */\nexport function getMatIconFailedToSanitizeUrlError(url: SafeResourceUrl): Error {\n return Error(\n `The URL provided to MatIconRegistry was not trusted as a resource URL ` +\n `via Angular's DomSanitizer. Attempted URL was \"${url}\".`,\n );\n}\n\n/**\n * Returns an exception to be thrown when a HTML string couldn't be sanitized.\n * @param literal HTML that was attempted to be sanitized.\n * @docs-private\n */\nexport function getMatIconFailedToSanitizeLiteralError(literal: SafeHtml): Error {\n return Error(\n `The literal provided to MatIconRegistry was not trusted as safe HTML by ` +\n `Angular's DomSanitizer. Attempted literal was \"${literal}\".`,\n );\n}\n\n/** Options that can be used to configure how an icon or the icons in an icon set are presented. */\nexport interface IconOptions {\n /** View box to set on the icon. */\n viewBox?: string;\n\n /** Whether or not to fetch the icon or icon set using HTTP credentials. */\n withCredentials?: boolean;\n}\n\n/**\n * Function that will be invoked by the icon registry when trying to resolve the\n * URL from which to fetch an icon. The returned URL will be used to make a request for the icon.\n */\nexport type IconResolver = (\n name: string,\n namespace: string,\n) => SafeResourceUrl | SafeResourceUrlWithIconOptions | null;\n\n/** Object that specifies a URL from which to fetch an icon and the options to use for it. */\nexport interface SafeResourceUrlWithIconOptions {\n url: SafeResourceUrl;\n options: IconOptions;\n}\n\n/**\n * Configuration for an icon, including the URL and possibly the cached SVG element.\n * @docs-private\n */\nclass SvgIconConfig {\n svgElement: SVGElement | null;\n\n constructor(\n public url: SafeResourceUrl,\n public svgText: TrustedHTML | null,\n public options?: IconOptions,\n ) {}\n}\n\n/** Icon configuration whose content has already been loaded. */\ntype LoadedSvgIconConfig = SvgIconConfig & {svgText: TrustedHTML};\n\n/**\n * Service to register and display icons used by the `<mat-icon>` component.\n * - Registers icon URLs by namespace and name.\n * - Registers icon set URLs by namespace.\n * - Registers aliases for CSS classes, for use with icon fonts.\n * - Loads icons from URLs and extracts individual icons from icon sets.\n */\n@Injectable({providedIn: 'root'})\nexport class MatIconRegistry implements OnDestroy {\n private _document: Document;\n\n /**\n * URLs and cached SVG elements for individual icons. Keys are of the format \"[namespace]:[icon]\".\n */\n private _svgIconConfigs = new Map<string, SvgIconConfig>();\n\n /**\n * SvgIconConfig objects and cached SVG elements for icon sets, keyed by namespace.\n * Multiple icon sets can be registered under the same namespace.\n */\n private _iconSetConfigs = new Map<string, SvgIconConfig[]>();\n\n /** Cache for icons loaded by direct URLs. */\n private _cachedIconsByUrl = new Map<string, SVGElement>();\n\n /** In-progress icon fetches. Used to coalesce multiple requests to the same URL. */\n private _inProgressUrlFetches = new Map<string, Observable<TrustedHTML>>();\n\n /** Map from font identifiers to their CSS class names. Used for icon fonts. */\n private _fontCssClassesByAlias = new Map<string, string>();\n\n /** Registered icon resolver functions. */\n private _resolvers: IconResolver[] = [];\n\n /**\n * The CSS classes to apply when an `<mat-icon>` component has no icon name, url, or font\n * specified. The default 'material-icons' value assumes that the material icon font has been\n * loaded as described at http://google.github.io/material-design-icons/#icon-font-for-the-web\n */\n private _defaultFontSetClass = ['material-icons', 'mat-ligature-font'];\n\n constructor(\n @Optional() private _httpClient: HttpClient,\n private _sanitizer: DomSanitizer,\n @Optional() @Inject(DOCUMENT) document: any,\n private readonly _errorHandler: ErrorHandler,\n ) {\n this._document = document;\n }\n\n /**\n * Registers an icon by URL in the default namespace.\n * @param iconName Name under which the icon should be registered.\n * @param url\n */\n addSvgIcon(iconName: string, url: SafeResourceUrl, options?: IconOptions): this {\n return this.addSvgIconInNamespace('', iconName, url, options);\n }\n\n /**\n * Registers an icon using an HTML string in the default namespace.\n * @param iconName Name under which the icon should be registered.\n * @param literal SVG source of the icon.\n */\n addSvgIconLiteral(iconName: string, literal: SafeHtml, options?: IconOptions): this {\n return this.addSvgIconLiteralInNamespace('', iconName, literal, options);\n }\n\n /**\n * Registers an icon by URL in the specified namespace.\n * @param namespace Namespace in which the icon should be registered.\n * @param iconName Name under which the icon should be registered.\n * @param url\n */\n addSvgIconInNamespace(\n namespace: string,\n iconName: string,\n url: SafeResourceUrl,\n options?: IconOptions,\n ): this {\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, null, options));\n }\n\n /**\n * Registers an icon resolver function with the registry. The function will be invoked with the\n * name and namespace of an icon when the registry tries to resolve the URL from which to fetch\n * the icon. The resolver is expected to return a `SafeResourceUrl` that points to the icon,\n * an object with the icon URL and icon options, or `null` if the icon is not supported. Resolvers\n * will be invoked in the order in which they have been registered.\n * @param resolver Resolver function to be registered.\n */\n addSvgIconResolver(resolver: IconResolver): this {\n this._resolvers.push(resolver);\n return this;\n }\n\n /**\n * Registers an icon using an HTML string in the specified namespace.\n * @param namespace Namespace in which the icon should be registered.\n * @param iconName Name under which the icon should be registered.\n * @param literal SVG source of the icon.\n */\n addSvgIconLiteralInNamespace(\n namespace: string,\n iconName: string,\n literal: SafeHtml,\n options?: IconOptions,\n ): this {\n const cleanLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);\n\n // TODO: add an ngDevMode check\n if (!cleanLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n\n // Security: The literal is passed in as SafeHtml, and is thus trusted.\n const trustedLiteral = trustedHTMLFromString(cleanLiteral);\n return this._addSvgIconConfig(\n namespace,\n iconName,\n new SvgIconConfig('', trustedLiteral, options),\n );\n }\n\n /**\n * Registers an icon set by URL in the default namespace.\n * @param url\n */\n addSvgIconSet(url: SafeResourceUrl, options?: IconOptions): this {\n return this.addSvgIconSetInNamespace('', url, options);\n }\n\n /**\n * Registers an icon set using an HTML string in the default namespace.\n * @param literal SVG source of the icon set.\n */\n addSvgIconSetLiteral(literal: SafeHtml, options?: IconOptions): this {\n return this.addSvgIconSetLiteralInNamespace('', literal, options);\n }\n\n /**\n * Registers an icon set by URL in the specified namespace.\n * @param namespace Namespace in which to register the icon set.\n * @param url\n */\n addSvgIconSetInNamespace(namespace: string, url: SafeResourceUrl, options?: IconOptions): this {\n return this._addSvgIconSetConfig(namespace, new SvgIconConfig(url, null, options));\n }\n\n /**\n * Registers an icon set using an HTML string in the specified namespace.\n * @param namespace Namespace in which to register the icon set.\n * @param literal SVG source of the icon set.\n */\n addSvgIconSetLiteralInNamespace(\n namespace: string,\n literal: SafeHtml,\n options?: IconOptions,\n ): this {\n const cleanLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);\n\n if (!cleanLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n\n // Security: The literal is passed in as SafeHtml, and is thus trusted.\n const trustedLiteral = trustedHTMLFromString(cleanLiteral);\n return this._addSvgIconSetConfig(namespace, new SvgIconConfig('', trustedLiteral, options));\n }\n\n /**\n * Defines an alias for CSS class names to be used for icon fonts. Creating an matIcon\n * component with the alias as the fontSet input will cause the class name to be applied\n * to the `<mat-icon>` element.\n *\n * If the registered font is a ligature font, then don't forget to also include the special\n * class `mat-ligature-font` to allow the usage via attribute. So register like this:\n *\n * ```ts\n * iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');\n * ```\n *\n * And use like this:\n *\n * ```html\n * <mat-icon fontSet=\"f1\" fontIcon=\"home\"></mat-icon>\n * ```\n *\n * @param alias Alias for the font.\n * @param classNames Class names override to be used instead of the alias.\n */\n registerFontClassAlias(alias: string, classNames: string = alias): this {\n this._fontCssClassesByAlias.set(alias, classNames);\n return this;\n }\n\n /**\n * Returns the CSS class name associated with the alias by a previous call to\n * registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.\n */\n classNameForFontAlias(alias: string): string {\n return this._fontCssClassesByAlias.get(alias) || alias;\n }\n\n /**\n * Sets the CSS classes to be used for icon fonts when an `<mat-icon>` component does not\n * have a fontSet input value, and is not loading an icon by name or URL.\n */\n setDefaultFontSetClass(...classNames: string[]): this {\n this._defaultFontSetClass = classNames;\n return this;\n }\n\n /**\n * Returns the CSS classes to be used for icon fonts when an `<mat-icon>` component does not\n * have a fontSet input value, and is not loading an icon by name or URL.\n */\n getDefaultFontSetClass(): string[] {\n return this._defaultFontSetClass;\n }\n\n /**\n * Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.\n * The response from the URL may be cached so this will not always cause an HTTP request, but\n * the produced element will always be a new copy of the originally fetched icon. (That is,\n * it will not contain any modifications made to elements previously returned).\n *\n * @param safeUrl URL from which to fetch the SVG icon.\n */\n getSvgIconFromUrl(safeUrl: SafeResourceUrl): Observable<SVGElement> {\n const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);\n\n if (!url) {\n throw getMatIconFailedToSanitizeUrlError(safeUrl);\n }\n\n const cachedIcon = this._cachedIconsByUrl.get(url);\n\n if (cachedIcon) {\n return observableOf(cloneSvg(cachedIcon));\n }\n\n return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl, null)).pipe(\n tap(svg => this._cachedIconsByUrl.set(url!, svg)),\n map(svg => cloneSvg(svg)),\n );\n }\n\n /**\n * Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name\n * and namespace. The icon must have been previously registered with addIcon or addIconSet;\n * if not, the Observable will throw an error.\n *\n * @param name Name of the icon to be retrieved.\n * @param namespace Namespace in which to look for the icon.\n */\n getNamedSvgIcon(name: string, namespace: string = ''): Observable<SVGElement> {\n const key = iconKey(namespace, name);\n let config = this._svgIconConfigs.get(key);\n\n // Return (copy of) cached icon if possible.\n if (config) {\n return this._getSvgFromConfig(config);\n }\n\n // Otherwise try to resolve the config from one of the resolver functions.\n config = this._getIconConfigFromResolvers(namespace, name);\n\n if (config) {\n this._svgIconConfigs.set(key, config);\n return this._getSvgFromConfig(config);\n }\n\n // See if we have any icon sets registered for the namespace.\n const iconSetConfigs = this._iconSetConfigs.get(namespace);\n\n if (iconSetConfigs) {\n return this._getSvgFromIconSetConfigs(name, iconSetConfigs);\n }\n\n return observableThrow(getMatIconNameNotFoundError(key));\n }\n\n ngOnDestroy() {\n this._resolvers = [];\n this._svgIconConfigs.clear();\n this._iconSetConfigs.clear();\n this._cachedIconsByUrl.clear();\n }\n\n /**\n * Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.\n */\n private _getSvgFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n if (config.svgText) {\n // We already have the SVG element for this icon, return a copy.\n return observableOf(cloneSvg(this._svgElementFromConfig(config as LoadedSvgIconConfig)));\n } else {\n // Fetch the icon from the config's URL, cache it, and return a copy.\n return this._loadSvgIconFromConfig(config).pipe(map(svg => cloneSvg(svg)));\n }\n }\n\n /**\n * Attempts to find an icon with the specified name in any of the SVG icon sets.\n * First searches the available cached icons for a nested element with a matching name, and\n * if found copies the element to a new `<svg>` element. If not found, fetches all icon sets\n * that have not been cached, and searches again after all fetches are completed.\n * The returned Observable produces the SVG element if possible, and throws\n * an error if no icon with the specified name can be found.\n */\n private _getSvgFromIconSetConfigs(\n name: string,\n iconSetConfigs: SvgIconConfig[],\n ): Observable<SVGElement> {\n // For all the icon set SVG elements we've fetched, see if any contain an icon with the\n // requested name.\n const namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);\n\n if (namedIcon) {\n // We could cache namedIcon in _svgIconConfigs, but since we have to make a copy every\n // time anyway, there's probably not much advantage compared to just always extracting\n // it from the icon set.\n return observableOf(namedIcon);\n }\n\n // Not found in any cached icon sets. If there are icon sets with URLs that we haven't\n // fetched, fetch them now and look for iconName in the results.\n const iconSetFetchRequests: Observable<TrustedHTML | null>[] = iconSetConfigs\n .filter(iconSetConfig => !iconSetConfig.svgText)\n .map(iconSetConfig => {\n return this._loadSvgIconSetFromConfig(iconSetConfig).pipe(\n catchError((err: HttpErrorResponse) => {\n const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconSetConfig.url);\n\n // Swallow errors fetching individual URLs so the\n // combined Observable won't necessarily fail.\n const errorMessage = `Loading icon set URL: ${url} failed: ${err.message}`;\n this._errorHandler.handleError(new Error(errorMessage));\n return observableOf(null);\n }),\n );\n });\n\n // Fetch all the icon set URLs. When the requests complete, every IconSet should have a\n // cached SVG element (unless the request failed), and we can check again for the icon.\n return forkJoin(iconSetFetchRequests).pipe(\n map(() => {\n const foundIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);\n\n // TODO: add an ngDevMode check\n if (!foundIcon) {\n throw getMatIconNameNotFoundError(name);\n }\n\n return foundIcon;\n }),\n );\n }\n\n /**\n * Searches the cached SVG elements for the given icon sets for a nested icon element whose \"id\"\n * tag matches the specified name. If found, copies the nested element to a new SVG element and\n * returns it. Returns null if no matching element is found.\n */\n private _extractIconWithNameFromAnySet(\n iconName: string,\n iconSetConfigs: SvgIconConfig[],\n ): SVGElement | null {\n // Iterate backwards, so icon sets added later have precedence.\n for (let i = iconSetConfigs.length - 1; i >= 0; i--) {\n const config = iconSetConfigs[i];\n\n // Parsing the icon set's text into an SVG element can be expensive. We can avoid some of\n // the parsing by doing a quick check using `indexOf` to see if there's any chance for the\n // icon to be in the set. This won't be 100% accurate, but it should help us avoid at least\n // some of the parsing.\n if (config.svgText && config.svgText.toString().indexOf(iconName) > -1) {\n const svg = this._svgElementFromConfig(config as LoadedSvgIconConfig);\n const foundIcon = this._extractSvgIconFromSet(svg, iconName, config.options);\n if (foundIcon) {\n return foundIcon;\n }\n }\n }\n return null;\n }\n\n /**\n * Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element\n * from it.\n */\n private _loadSvgIconFromConfig(config: SvgIconConfig): Observable<SVGElement> {\n return this._fetchIcon(config).pipe(\n tap(svgText => (config.svgText = svgText)),\n map(() => this._svgElementFromConfig(config as LoadedSvgIconConfig)),\n );\n }\n\n /**\n * Loads the content of the icon set URL specified in the\n * SvgIconConfig and attaches it to the config.\n */\n private _loadSvgIconSetFromConfig(config: SvgIconConfig): Observable<TrustedHTML | null> {\n if (config.svgText) {\n return observableOf(null);\n }\n\n return this._fetchIcon(config).pipe(tap(svgText => (config.svgText = svgText)));\n }\n\n /**\n * Searches the cached element of the given SvgIconConfig for a nested icon element whose \"id\"\n * tag matches the specified name. If found, copies the nested element to a new SVG element and\n * returns it. Returns null if no matching element is found.\n */\n private _extractSvgIconFromSet(\n iconSet: SVGElement,\n iconName: string,\n options?: IconOptions,\n ): SVGElement | null {\n // Use the `id=\"iconName\"` syntax in order to escape special\n // characters in the ID (versus using the #iconName syntax).\n const iconSource = iconSet.querySelector(`[id=\"${iconName}\"]`);\n\n if (!iconSource) {\n return null;\n }\n\n // Clone the element and remove the ID to prevent multiple elements from being added\n // to the page with the same ID.\n const iconElement = iconSource.cloneNode(true) as Element;\n iconElement.removeAttribute('id');\n\n // If the icon node is itself an <svg> node, clone and return it directly. If not, set it as\n // the content of a new <svg> node.\n if (iconElement.nodeName.toLowerCase() === 'svg') {\n return this._setSvgAttributes(iconElement as SVGElement, options);\n }\n\n // If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>. Note\n // that the same could be achieved by referring to it via <use href=\"#id\">, however the <use>\n // tag is problematic on Firefox, because it needs to include the current page path.\n if (iconElement.nodeName.toLowerCase() === 'symbol') {\n return this._setSvgAttributes(this._toSvgElement(iconElement), options);\n }\n\n // createElement('SVG') doesn't work as expected; the DOM ends up with\n // the correct nodes, but the SVG content doesn't render. Instead we\n // have to create an empty SVG node using innerHTML and append its content.\n // Elements created using DOMParser.parseFromString have the same problem.\n // http://stackoverflow.com/questions/23003278/svg-innerhtml-in-firefox-can-not-display\n const svg = this._svgElementFromString(trustedHTMLFromString('<svg></svg>'));\n // Clone the node so we don't remove it from the parent icon set element.\n svg.appendChild(iconElement);\n\n return this._setSvgAttributes(svg, options);\n }\n\n /**\n * Creates a DOM element from the given SVG string.\n */\n private _svgElementFromString(str: TrustedHTML): SVGElement {\n const div = this._document.createElement('DIV');\n div.innerHTML = str as unknown as string;\n const svg = div.querySelector('svg') as SVGElement;\n\n // TODO: add an ngDevMode check\n if (!svg) {\n throw Error('<svg> tag not found');\n }\n\n return svg;\n }\n\n /**\n * Converts an element into an SVG node by cloning all of its children.\n */\n private _toSvgElement(element: Element): SVGElement {\n const svg = this._svgElementFromString(trustedHTMLFromString('<svg></svg>'));\n const attributes = element.attributes;\n\n // Copy over all the attributes from the `symbol` to the new SVG, except the id.\n for (let i = 0; i < attributes.length; i++) {\n const {name, value} = attributes[i];\n\n if (name !== 'id') {\n svg.setAttribute(name, value);\n }\n }\n\n for (let i = 0; i < element.childNodes.length; i++) {\n if (element.childNodes[i].nodeType === this._document.ELEMENT_NODE) {\n svg.appendChild(element.childNodes[i].cloneNode(true));\n }\n }\n\n return svg;\n }\n\n /**\n * Sets the default attributes for an SVG element to be used as an icon.\n */\n private _setSvgAttributes(svg: SVGElement, options?: IconOptions): SVGElement {\n svg.setAttribute('fit', '');\n svg.setAttribute('height', '100%');\n svg.setAttribute('width', '100%');\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n svg.setAttribute('focusable', 'false'); // Disable IE11 default behavior to make SVGs focusable.\n\n if (options && options.viewBox) {\n svg.setAttribute('viewBox', options.viewBox);\n }\n\n return svg;\n }\n\n /**\n * Returns an Observable which produces the string contents of the given icon. Results may be\n * cached, so future calls with the same URL may not cause another HTTP request.\n */\n private _fetchIcon(iconConfig: SvgIconConfig): Observable<TrustedHTML> {\n const {url: safeUrl, options} = iconConfig;\n const withCredentials = options?.withCredentials ?? false;\n\n if (!this._httpClient) {\n throw getMatIconNoHttpProviderError();\n }\n\n // TODO: add an ngDevMode check\n if (safeUrl == null) {\n throw Error(`Cannot fetch icon from URL \"${safeUrl}\".`);\n }\n\n const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);\n\n // TODO: add an ngDevMode check\n if (!url) {\n throw getMatIconFailedToSanitizeUrlError(safeUrl);\n }\n\n // Store in-progress fetches to avoid sending a duplicate request for a URL when there is\n // already a request in progress for that URL. It's necessary to call share() on the\n // Observable returned by http.get() so that multiple subscribers don't cause multiple XHRs.\n const inProgressFetch = this._inProgressUrlFetches.get(url);\n\n if (inProgressFetch) {\n return inProgressFetch;\n }\n\n const req = this._httpClient.get(url, {responseType: 'text', withCredentials}).pipe(\n map(svg => {\n // Security: This SVG is fetched from a SafeResourceUrl, and is thus\n // trusted HTML.\n return trustedHTMLFromString(svg);\n }),\n finalize(() => this._inProgressUrlFetches.delete(url)),\n share(),\n );\n\n this._inProgressUrlFetches.set(url, req);\n return req;\n }\n\n /**\n * Registers an icon config by name in the specified namespace.\n * @param namespace Namespace in which to register the icon config.\n * @param iconName Name under which to register the config.\n * @param config Config to be registered.\n */\n private _addSvgIconConfig(namespace: string, iconName: string, config: SvgIconConfig): this {\n this._svgIconConfigs.set(iconKey(namespace, iconName), config);\n return this;\n }\n\n /**\n * Registers an icon set config in the specified namespace.\n * @param namespace Namespace in which to register the icon config.\n * @param config Config to be registered.\n */\n private _addSvgIconSetConfig(namespace: string, config: SvgIconConfig): this {\n const configNamespace = this._iconSetConfigs.get(namespace);\n\n if (configNamespace) {\n configNamespace.push(config);\n } else {\n this._iconSetConfigs.set(namespace, [config]);\n }\n\n return this;\n }\n\n /** Parses a config's text into an SVG element. */\n private _svgElementFromConfig(config: LoadedSvgIconConfig): SVGElement {\n if (!config.svgElement) {\n const svg = this._svgElementFromString(config.svgText);\n this._setSvgAttributes(svg, config.options);\n config.svgElement = svg;\n }\n\n return config.svgElement;\n }\n\n /** Tries to create an icon config through the registered resolver functions. */\n private _getIconConfigFromResolvers(namespace: string, name: string): SvgIconConfig | undefined {\n for (let i = 0; i < this._resolvers.length; i++) {\n const result = this._resolvers[i](name, namespace);\n\n if (result) {\n return isSafeUrlWithOptions(result)\n ? new SvgIconConfig(result.url, null, result.options)\n : new SvgIconConfig(result, null);\n }\n }\n\n return undefined;\n }\n}\n\n/** @docs-private */\nexport function ICON_REGISTRY_PROVIDER_FACTORY(\n parentRegistry: MatIconRegistry,\n httpClient: HttpClient,\n sanitizer: DomSanitizer,\n errorHandler: ErrorHandler,\n document?: any,\n) {\n return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document, errorHandler);\n}\n\n/** @docs-private */\nexport const ICON_REGISTRY_PROVIDER = {\n // If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.\n provide: MatIconRegistry,\n deps: [\n [new Optional(), new SkipSelf(), MatIconRegistry],\n [new Optional(), HttpClient],\n DomSanitizer,\n ErrorHandler,\n [new Optional(), DOCUMENT as InjectionToken<any>],\n ],\n useFactory: ICON_REGISTRY_PROVIDER_FACTORY,\n};\n\n/** Clones an SVGElement while preserving type information. */\nfunction cloneSvg(svg: SVGElement): SVGElement {\n return svg.cloneNode(true) as SVGElement;\n}\n\n/** Returns the cache key to use for an icon namespace and name. */\nfunction iconKey(namespace: string, name: string) {\n return namespace + ':' + name;\n}\n\nfunction isSafeUrlWithOptions(value: any): value is SafeResourceUrlWithIconOptions {\n return !!(value.url && value.options);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform, normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\nimport {coerceElement} from '@angular/cdk/coercion';\nimport {EMPTY, Observable, Subject} from 'rxjs';\n\n/** An event that is emitted when the autofill state of an input changes. */\nexport type AutofillEvent = {\n /** The element whose autofill state changes. */\n target: Element;\n /** Whether the element is currently autofilled. */\n isAutofilled: boolean;\n};\n\n/** Used to track info about currently monitored elements. */\ntype MonitoredElementInfo = {\n readonly subject: Subject<AutofillEvent>;\n unlisten: () => void;\n};\n\n/** Options to pass to the animationstart listener. */\nconst listenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/**\n * An injectable service that can be used to monitor the autofill state of an input.\n * Based on the following blog post:\n * https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7\n */\n@Injectable({providedIn: 'root'})\nexport class AutofillMonitor implements OnDestroy {\n private _monitoredElements = new Map<Element, MonitoredElementInfo>();\n\n constructor(private _platform: Platform, private _ngZone: NgZone) {}\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: Element): Observable<AutofillEvent>;\n\n /**\n * Monitor for changes in the autofill state of the given input element.\n * @param element The element to monitor.\n * @return A stream of autofill state changes.\n */\n monitor(element: ElementRef<Element>): Observable<AutofillEvent>;\n\n monitor(elementOrRef: Element | ElementRef<Element>): Observable<AutofillEvent> {\n if (!this._platform.isBrowser) {\n return EMPTY;\n }\n\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n return info.subject;\n }\n\n const result = new Subject<AutofillEvent>();\n const cssClass = 'cdk-text-field-autofilled';\n const listener = ((event: AnimationEvent) => {\n // Animation events fire on initial element render, we check for the presence of the autofill\n // CSS class to make sure this is a real change in state, not just the initial render before\n // we fire off events.\n if (\n event.animationName === 'cdk-text-field-autofill-start' &&\n !element.classList.contains(cssClass)\n ) {\n element.classList.add(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: true}));\n } else if (\n event.animationName === 'cdk-text-field-autofill-end' &&\n element.classList.contains(cssClass)\n ) {\n element.classList.remove(cssClass);\n this._ngZone.run(() => result.next({target: event.target as Element, isAutofilled: false}));\n }\n }) as EventListenerOrEventListenerObject;\n\n this._ngZone.runOutsideAngular(() => {\n element.addEventListener('animationstart', listener, listenerOptions);\n element.classList.add('cdk-text-field-autofill-monitored');\n });\n\n this._monitoredElements.set(element, {\n subject: result,\n unlisten: () => {\n element.removeEventListener('animationstart', listener, listenerOptions);\n },\n });\n\n return result;\n }\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: Element): void;\n\n /**\n * Stop monitoring the autofill state of the given input element.\n * @param element The element to stop monitoring.\n */\n stopMonitoring(element: ElementRef<Element>): void;\n\n stopMonitoring(elementOrRef: Element | ElementRef<Element>): void {\n const element = coerceElement(elementOrRef);\n const info = this._monitoredElements.get(element);\n\n if (info) {\n info.unlisten();\n info.subject.complete();\n element.classList.remove('cdk-text-field-autofill-monitored');\n element.classList.remove('cdk-text-field-autofilled');\n this._monitoredElements.delete(element);\n }\n }\n\n ngOnDestroy() {\n this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));\n }\n}\n\n/** A directive that can be used to monitor the autofill state of an input. */\n@Directive({\n selector: '[cdkAutofill]',\n})\nexport class CdkAutofill implements OnDestroy, OnInit {\n /** Emits when the autofill state of the element changes. */\n @Output() readonly cdkAutofill = new EventEmitter<AutofillEvent>();\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _autofillMonitor: AutofillMonitor,\n ) {}\n\n ngOnInit() {\n this._autofillMonitor\n .monitor(this._elementRef)\n .subscribe(event => this.cdkAutofill.emit(event));\n }\n\n ngOnDestroy() {\n this._autofillMonitor.stopMonitoring(this._elementRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkAutofill} from './autofill';\nimport {CdkTextareaAutosize} from './autosize';\n\n@NgModule({\n declarations: [CdkAutofill, CdkTextareaAutosize],\n exports: [CdkAutofill, CdkTextareaAutosize],\n})\nexport class TextFieldModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {getSupportedInputTypes, Platform} from '@angular/cdk/platform';\nimport {AutofillMonitor} from '@angular/cdk/text-field';\nimport {\n AfterViewInit,\n Directive,\n DoCheck,\n ElementRef,\n Inject,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Optional,\n Self,\n} from '@angular/core';\nimport {FormGroupDirective, NgControl, NgForm, Validators} from '@angular/forms';\nimport {CanUpdateErrorState, ErrorStateMatcher, mixinErrorState} from '@angular/material/core';\nimport {MatFormFieldControl, MatFormField, MAT_FORM_FIELD} from '@angular/material/form-field';\nimport {Subject} from 'rxjs';\nimport {getMatInputUnsupportedTypeError} from './input-errors';\nimport {MAT_INPUT_VALUE_ACCESSOR} from './input-value-accessor';\n\n// Invalid input type. Using one of these will throw an MatInputUnsupportedTypeError.\nconst MAT_INPUT_INVALID_TYPES = [\n 'button',\n 'checkbox',\n 'file',\n 'hidden',\n 'image',\n 'radio',\n 'range',\n 'reset',\n 'submit',\n];\n\nlet nextUniqueId = 0;\n\n// Boilerplate for applying mixins to MatInput.\n/** @docs-private */\nconst _MatInputBase = mixinErrorState(\n class {\n /**\n * Emits whenever the component state changes and should cause the parent\n * form field to update. Implemented as part of `MatFormFieldControl`.\n * @docs-private\n */\n readonly stateChanges = new Subject<void>();\n\n constructor(\n public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n /**\n * Form control bound to the component.\n * Implemented as part of `MatFormFieldControl`.\n * @docs-private\n */\n public ngControl: NgControl,\n ) {}\n },\n);\n\n@Directive({\n selector: `input[matInput], textarea[matInput], select[matNativeControl],\n input[matNativeControl], textarea[matNativeControl]`,\n exportAs: 'matInput',\n host: {\n 'class': 'mat-mdc-input-element',\n // The BaseMatInput parent class adds `mat-input-element`, `mat-form-field-control` and\n // `mat-form-field-autofill-control` to the CSS class list, but this should not be added for\n // this MDC equivalent input.\n '[class.mat-input-server]': '_isServer',\n '[class.mat-mdc-form-field-textarea-control]': '_isInFormField && _isTextarea',\n '[class.mat-mdc-form-field-input-control]': '_isInFormField',\n '[class.mdc-text-field__input]': '_isInFormField',\n '[class.mat-mdc-native-select-inline]': '_isInlineSelect()',\n // Native input properties that are overwritten by Angular inputs need to be synced with\n // the native input element. Otherwise property bindings for those don't work.\n '[id]': 'id',\n '[disabled]': 'disabled',\n '[required]': 'required',\n '[attr.name]': 'name || null',\n '[attr.readonly]': 'readonly && !_isNativeSelect || null',\n // Only mark the input as invalid for assistive technology if it has a value since the\n // state usually overlaps with `aria-required` when the input is empty and can be redundant.\n '[attr.aria-invalid]': '(empty && required) ? null : errorState',\n '[attr.aria-required]': 'required',\n // Native input properties that are overwritten by Angular inputs need to be synced with\n // the native input element. Otherwise property bindings for those don't work.\n '[attr.id]': 'id',\n '(focus)': '_focusChanged(true)',\n '(blur)': '_focusChanged(false)',\n '(input)': '_onInput()',\n },\n providers: [{provide: MatFormFieldControl, useExisting: MatInput}],\n})\nexport class MatInput\n extends _MatInputBase\n implements\n MatFormFieldControl<any>,\n OnChanges,\n OnDestroy,\n AfterViewInit,\n DoCheck,\n CanUpdateErrorState\n{\n protected _uid = `mat-input-${nextUniqueId++}`;\n protected _previousNativeValue: any;\n private _inputValueAccessor: {value: any};\n private _previousPlaceholder: string | null;\n\n /** Whether the component is being rendered on the server. */\n readonly _isServer: boolean;\n\n /** Whether the component is a native html select. */\n readonly _isNativeSelect: boolean;\n\n /** Whether the component is a textarea. */\n readonly _isTextarea: boolean;\n\n /** Whether the input is inside of a form field. */\n readonly _isInFormField: boolean;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n focused: boolean = false;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n override readonly stateChanges: Subject<void> = new Subject<void>();\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n controlType: string = 'mat-input';\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n autofilled = false;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n\n // Browsers may not fire the blur event if the input is disabled too quickly.\n // Reset from here to ensure that the element doesn't become stuck.\n if (this.focused) {\n this.focused = false;\n this.stateChanges.next();\n }\n }\n protected _disabled = false;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get id(): string {\n return this._id;\n }\n set id(value: string) {\n this._id = value || this._uid;\n }\n protected _id: string;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input() placeholder: string;\n\n /**\n * Name of the input.\n * @docs-private\n */\n @Input() name: string;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get required(): boolean {\n return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;\n }\n set required(value: BooleanInput) {\n this._required = coerceBooleanProperty(value);\n }\n protected _required: boolean | undefined;\n\n /** Input type of the element. */\n @Input()\n get type(): string {\n return this._type;\n }\n set type(value: string) {\n this._type = value || 'text';\n this._validateType();\n\n // When using Angular inputs, developers are no longer able to set the properties on the native\n // input element. To ensure that bindings for `type` work, we need to sync the setter\n // with the native property. Textarea elements don't support the type property or attribute.\n if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {\n (this._elementRef.nativeElement as HTMLInputElement).type = this._type;\n }\n }\n protected _type = 'text';\n\n /** An object used to control when error messages are shown. */\n @Input() override errorStateMatcher: ErrorStateMatcher;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input('aria-describedby') userAriaDescribedBy: string;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get value(): string {\n return this._inputValueAccessor.value;\n }\n set value(value: any) {\n if (value !== this.value) {\n this._inputValueAccessor.value = value;\n this.stateChanges.next();\n }\n }\n\n /** Whether the element is readonly. */\n @Input()\n get readonly(): boolean {\n return this._readonly;\n }\n set readonly(value: BooleanInput) {\n this._readonly = coerceBooleanProperty(value);\n }\n private _readonly = false;\n\n protected _neverEmptyInputTypes = [\n 'date',\n 'datetime',\n 'datetime-local',\n 'month',\n 'time',\n 'week',\n ].filter(t => getSupportedInputTypes().has(t));\n\n constructor(\n protected _elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>,\n protected _platform: Platform,\n @Optional() @Self() ngControl: NgControl,\n @Optional() _parentForm: NgForm,\n @Optional() _parentFormGroup: FormGroupDirective,\n _defaultErrorStateMatcher: ErrorStateMatcher,\n @Optional() @Self() @Inject(MAT_INPUT_VALUE_ACCESSOR) inputValueAccessor: any,\n private _autofillMonitor: AutofillMonitor,\n ngZone: NgZone,\n // TODO: Remove this once the legacy appearance has been removed. We only need\n // to inject the form field for determining whether the placeholder has been promoted.\n @Optional() @Inject(MAT_FORM_FIELD) protected _formField?: MatFormField,\n ) {\n super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);\n\n const element = this._elementRef.nativeElement;\n const nodeName = element.nodeName.toLowerCase();\n\n // If no input value accessor was explicitly specified, use the element as the input value\n // accessor.\n this._inputValueAccessor = inputValueAccessor || element;\n\n this._previousNativeValue = this.value;\n\n // Force setter to be called in case id was not specified.\n this.id = this.id;\n\n // On some versions of iOS the caret gets stuck in the wrong place when holding down the delete\n // key. In order to get around this we need to \"jiggle\" the caret loose. Since this bug only\n // exists on iOS, we only bother to install the listener on iOS.\n if (_platform.IOS) {\n ngZone.runOutsideAngular(() => {\n _elementRef.nativeElement.addEventListener('keyup', this._iOSKeyupListener);\n });\n }\n\n this._isServer = !this._platform.isBrowser;\n this._isNativeSelect = nodeName === 'select';\n this._isTextarea = nodeName === 'textarea';\n this._isInFormField = !!_formField;\n\n if (this._isNativeSelect) {\n this.controlType = (element as HTMLSelectElement).multiple\n ? 'mat-native-select-multiple'\n : 'mat-native-select';\n }\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(event => {\n this.autofilled = event.isAutofilled;\n this.stateChanges.next();\n });\n }\n }\n\n ngOnChanges() {\n this.stateChanges.next();\n }\n\n ngOnDestroy() {\n this.stateChanges.complete();\n\n if (this._platform.isBrowser) {\n this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);\n }\n\n if (this._platform.IOS) {\n this._elementRef.nativeElement.removeEventListener('keyup', this._iOSKeyupListener);\n }\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n // We need to re-evaluate this on every change detection cycle, because there are some\n // error triggers that we can't subscribe to (e.g. parent form submissions). This means\n // that whatever logic is in here has to be super lean or we risk destroying the performance.\n this.updateErrorState();\n\n // Since the input isn't a `ControlValueAccessor`, we don't have a good way of knowing when\n // the disabled state has changed. We can't use the `ngControl.statusChanges`, because it\n // won't fire if the input is disabled with `emitEvents = false`, despite the input becoming\n // disabled.\n if (this.ngControl.disabled !== null && this.ngControl.disabled !== this.disabled) {\n this.disabled = this.ngControl.disabled;\n this.stateChanges.next();\n }\n }\n\n // We need to dirty-check the native element's value, because there are some cases where\n // we won't be notified when it changes (e.g. the consumer isn't using forms or they're\n // updating the value using `emitEvent: false`).\n this._dirtyCheckNativeValue();\n\n // We need to dirty-check and set the placeholder attribute ourselves, because whether it's\n // present or not depends on a query which is prone to \"changed after checked\" errors.\n this._dirtyCheckPlaceholder();\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this._elementRef.nativeElement.focus(options);\n }\n\n /** Callback for the cases where the focused state of the input changes. */\n _focusChanged(isFocused: boolean) {\n if (isFocused !== this.focused) {\n this.focused = isFocused;\n this.stateChanges.next();\n }\n }\n\n _onInput() {\n // This is a noop function and is used to let Angular know whenever the value changes.\n // Angular will run a new change detection each time the `input` event has been dispatched.\n // It's necessary that Angular recognizes the value change, because when floatingLabel\n // is set to false and Angular forms aren't used, the placeholder won't recognize the\n // value changes and will not disappear.\n // Listening to the input event wouldn't be necessary when the input is using the\n // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.\n }\n\n /** Does some manual dirty checking on the native input `value` property. */\n protected _dirtyCheckNativeValue() {\n const newValue = this._elementRef.nativeElement.value;\n\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this.stateChanges.next();\n }\n }\n\n /** Does some manual dirty checking on the native input `placeholder` attribute. */\n private _dirtyCheckPlaceholder() {\n const placeholder = this._getPlaceholder();\n if (placeholder !== this._previousPlaceholder) {\n const element = this._elementRef.nativeElement;\n this._previousPlaceholder = placeholder;\n placeholder\n ? element.setAttribute('placeholder', placeholder)\n : element.removeAttribute('placeholder');\n }\n }\n\n /** Gets the current placeholder of the form field. */\n protected _getPlaceholder(): string | null {\n return this.placeholder || null;\n }\n\n /** Make sure the input is a supported type. */\n protected _validateType() {\n if (\n MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1 &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw getMatInputUnsupportedTypeError(this._type);\n }\n }\n\n /** Checks whether the input type is one of the types that are never empty. */\n protected _isNeverEmpty() {\n return this._neverEmptyInputTypes.indexOf(this._type) > -1;\n }\n\n /** Checks whether the input is invalid based on the native validation. */\n protected _isBadInput() {\n // The `validity` property won't be present on platform-server.\n let validity = (this._elementRef.nativeElement as HTMLInputElement).validity;\n return validity && validity.badInput;\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get empty(): boolean {\n return (\n !this._isNeverEmpty() &&\n !this._elementRef.nativeElement.value &&\n !this._isBadInput() &&\n !this.autofilled\n );\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get shouldLabelFloat(): boolean {\n if (this._isNativeSelect) {\n // For a single-selection `<select>`, the label should float when the selected option has\n // a non-empty display value. For a `<select multiple>`, the label *always* floats to avoid\n // overlapping the label with the options.\n const selectElement = this._elementRef.nativeElement as HTMLSelectElement;\n const firstOption: HTMLOptionElement | undefined = selectElement.options[0];\n\n // On most browsers the `selectedIndex` will always be 0, however on IE and Edge it'll be\n // -1 if the `value` is set to something, that isn't in the list of options, at a later point.\n return (\n this.focused ||\n selectElement.multiple ||\n !this.empty ||\n !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label)\n );\n } else {\n return this.focused || !this.empty;\n }\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n setDescribedByIds(ids: string[]) {\n if (ids.length) {\n this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n } else {\n this._elementRef.nativeElement.removeAttribute('aria-describedby');\n }\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n onContainerClick() {\n // Do not re-focus the input element if the element is already focused. Otherwise it can happen\n // that someone clicks on a time input and the cursor resets to the \"hours\" field while the\n // \"minutes\" field was actually clicked. See: https://github.com/angular/components/issues/12849\n if (!this.focused) {\n this.focus();\n }\n }\n\n /** Whether the form control is a native select that is displayed inline. */\n _isInlineSelect(): boolean {\n const element = this._elementRef.nativeElement as HTMLSelectElement;\n return this._isNativeSelect && (element.multiple || element.size > 1);\n }\n\n private _iOSKeyupListener = (event: Event): void => {\n const el = event.target as HTMLInputElement;\n\n // Note: We specifically check for 0, rather than `!el.selectionStart`, because the two\n // indicate different things. If the value is 0, it means that the caret is at the start\n // of the input, whereas a value of `null` means that the input doesn't support\n // manipulating the selection range. Inputs that don't support setting the selection range\n // will throw an error so we want to avoid calling `setSelectionRange` on them. See:\n // https://html.spec.whatwg.org/multipage/input.html#do-not-apply\n if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {\n // Note: Just setting `0, 0` doesn't fix the issue. Setting\n // `1, 1` fixes it for the first time that you type text and\n // then hold delete. Toggling to `1, 1` and then back to\n // `0, 0` seems to completely fix it.\n el.setSelectionRange(1, 1);\n el.setSelectionRange(0, 0);\n }\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {TextFieldModule} from '@angular/cdk/text-field';\nimport {NgModule} from '@angular/core';\nimport {ErrorStateMatcher, MatCommonModule} from '@angular/material/core';\nimport {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';\nimport {MatLegacyInput} from './input';\n\n/**\n * @deprecated Use `MatInputModule` from `@angular/material/input` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n declarations: [MatLegacyInput],\n imports: [TextFieldModule, MatLegacyFormFieldModule, MatCommonModule],\n exports: [\n TextFieldModule,\n // We re-export the `MatLegacyFormFieldModule` since `MatLegacyInput` will almost always\n // be used together with `MatLegacyFormField`.\n MatLegacyFormFieldModule,\n MatLegacyInput,\n ],\n providers: [ErrorStateMatcher],\n})\nexport class MatLegacyInputModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n FocusMonitor,\n FocusOrigin,\n isFakeMousedownFromScreenReader,\n isFakeTouchstartFromScreenReader,\n} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE} from '@angular/cdk/keycodes';\nimport {\n FlexibleConnectedPositionStrategy,\n HorizontalConnectionPos,\n Overlay,\n OverlayConfig,\n OverlayRef,\n ScrollStrategy,\n VerticalConnectionPos,\n} from '@angular/cdk/overlay';\nimport {TemplatePortal} from '@angular/cdk/portal';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n EventEmitter,\n inject,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n Self,\n ViewContainerRef,\n} from '@angular/core';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {asapScheduler, merge, Observable, of as observableOf, Subscription} from 'rxjs';\nimport {delay, filter, take, takeUntil} from 'rxjs/operators';\nimport {_MatMenuBase, MenuCloseReason} from './menu';\nimport {throwMatMenuRecursiveError} from './menu-errors';\nimport {MatMenuItem} from './menu-item';\nimport {MAT_MENU_PANEL, MatMenuPanel} from './menu-panel';\nimport {MenuPositionX, MenuPositionY} from './menu-positions';\n\n/** Injection token that determines the scroll handling while the menu is open. */\nexport const MAT_MENU_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'mat-menu-scroll-strategy',\n);\n\n/** @docs-private */\nexport function MAT_MENU_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy {\n return () => overlay.scrollStrategies.reposition();\n}\n\n/** @docs-private */\nexport const MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER = {\n provide: MAT_MENU_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: MAT_MENU_SCROLL_STRATEGY_FACTORY,\n};\n\n/** Options for binding a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/**\n * Default top padding of the menu panel.\n * @deprecated No longer being used. Will be removed.\n * @breaking-change 15.0.0\n */\nexport const MENU_PANEL_TOP_PADDING = 8;\n\n@Directive({\n host: {\n '[attr.aria-haspopup]': 'menu ? \"menu\" : null',\n '[attr.aria-expanded]': 'menuOpen',\n '[attr.aria-controls]': 'menuOpen ? menu.panelId : null',\n '(click)': '_handleClick($event)',\n '(mousedown)': '_handleMousedown($event)',\n '(keydown)': '_handleKeydown($event)',\n },\n})\nexport abstract class _MatMenuTriggerBase implements AfterContentInit, OnDestroy {\n private _portal: TemplatePortal;\n private _overlayRef: OverlayRef | null = null;\n private _menuOpen: boolean = false;\n private _closingActionsSubscription = Subscription.EMPTY;\n private _hoverSubscription = Subscription.EMPTY;\n private _menuCloseSubscription = Subscription.EMPTY;\n private _scrollStrategy: () => ScrollStrategy;\n private _changeDetectorRef = inject(ChangeDetectorRef);\n\n /**\n * We're specifically looking for a `MatMenu` here since the generic `MatMenuPanel`\n * interface lacks some functionality around nested menus and animations.\n */\n private _parentMaterialMenu: _MatMenuBase | undefined;\n\n /**\n * Cached value of the padding of the parent menu panel.\n * Used to offset sub-menus to compensate for the padding.\n */\n private _parentInnerPadding: number | undefined;\n\n /**\n * Handles touch start events on the trigger.\n * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.\n */\n private _handleTouchStart = (event: TouchEvent) => {\n if (!isFakeTouchstartFromScreenReader(event)) {\n this._openedBy = 'touch';\n }\n };\n\n // Tracking input type is necessary so it's possible to only auto-focus\n // the first item of the list when the menu is opened via the keyboard\n _openedBy: Exclude<FocusOrigin, 'program' | null> | undefined = undefined;\n\n /**\n * @deprecated\n * @breaking-change 8.0.0\n */\n @Input('mat-menu-trigger-for')\n get _deprecatedMatMenuTriggerFor(): MatMenuPanel | null {\n return this.menu;\n }\n set _deprecatedMatMenuTriggerFor(v: MatMenuPanel | null) {\n this.menu = v;\n }\n\n /** References the menu instance that the trigger is associated with. */\n @Input('matMenuTriggerFor')\n get menu(): MatMenuPanel | null {\n return this._menu;\n }\n set menu(menu: MatMenuPanel | null) {\n if (menu === this._menu) {\n return;\n }\n\n this._menu = menu;\n this._menuCloseSubscription.unsubscribe();\n\n if (menu) {\n if (menu === this._parentMaterialMenu && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throwMatMenuRecursiveError();\n }\n\n this._menuCloseSubscription = menu.close.subscribe((reason: MenuCloseReason) => {\n this._destroyMenu(reason);\n\n // If a click closed the menu, we should close the entire chain of nested menus.\n if ((reason === 'click' || reason === 'tab') && this._parentMaterialMenu) {\n this._parentMaterialMenu.closed.emit(reason);\n }\n });\n }\n\n this._menuItemInstance?._setTriggersSubmenu(this.triggersSubmenu());\n }\n private _menu: MatMenuPanel | null;\n\n /** Data to be passed along to any lazily-rendered content. */\n @Input('matMenuTriggerData') menuData: any;\n\n /**\n * Whether focus should be restored when the menu is closed.\n * Note that disabling this option can have accessibility implications\n * and it's up to you to manage focus, if you decide to turn it off.\n */\n @Input('matMenuTriggerRestoreFocus') restoreFocus: boolean = true;\n\n /** Event emitted when the associated menu is opened. */\n @Output() readonly menuOpened: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Event emitted when the associated menu is opened.\n * @deprecated Switch to `menuOpened` instead\n * @breaking-change 8.0.0\n */\n // tslint:disable-next-line:no-output-on-prefix\n @Output() readonly onMenuOpen: EventEmitter<void> = this.menuOpened;\n\n /** Event emitted when the associated menu is closed. */\n @Output() readonly menuClosed: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Event emitted when the associated menu is closed.\n * @deprecated Switch to `menuClosed` instead\n * @breaking-change 8.0.0\n */\n // tslint:disable-next-line:no-output-on-prefix\n @Output() readonly onMenuClose: EventEmitter<void> = this.menuClosed;\n\n constructor(\n overlay: Overlay,\n element: ElementRef<HTMLElement>,\n viewContainerRef: ViewContainerRef,\n scrollStrategy: any,\n parentMenu: MatMenuPanel,\n menuItemInstance: MatMenuItem,\n dir: Directionality,\n focusMonitor: FocusMonitor,\n ngZone: NgZone,\n );\n\n /**\n * @deprecated `focusMonitor` will become a required parameter.\n * @breaking-change 8.0.0\n */\n constructor(\n overlay: Overlay,\n element: ElementRef<HTMLElement>,\n viewContainerRef: ViewContainerRef,\n scrollStrategy: any,\n parentMenu: MatMenuPanel,\n menuItemInstance: MatMenuItem,\n dir: Directionality,\n focusMonitor?: FocusMonitor | null,\n );\n\n /**\n * @deprecated `ngZone` will become a required parameter.\n * @breaking-change 15.0.0\n */\n constructor(\n overlay: Overlay,\n element: ElementRef<HTMLElement>,\n viewContainerRef: ViewContainerRef,\n scrollStrategy: any,\n parentMenu: MatMenuPanel,\n menuItemInstance: MatMenuItem,\n dir: Directionality,\n focusMonitor: FocusMonitor,\n );\n\n constructor(\n private _overlay: Overlay,\n private _element: ElementRef<HTMLElement>,\n private _viewContainerRef: ViewContainerRef,\n @Inject(MAT_MENU_SCROLL_STRATEGY) scrollStrategy: any,\n @Inject(MAT_MENU_PANEL) @Optional() parentMenu: MatMenuPanel,\n // `MatMenuTrigger` is commonly used in combination with a `MatMenuItem`.\n // tslint:disable-next-line: lightweight-tokens\n @Optional() @Self() private _menuItemInstance: MatMenuItem,\n @Optional() private _dir: Directionality,\n private _focusMonitor: FocusMonitor | null,\n private _ngZone?: NgZone,\n ) {\n this._scrollStrategy = scrollStrategy;\n this._parentMaterialMenu = parentMenu instanceof _MatMenuBase ? parentMenu : undefined;\n\n _element.nativeElement.addEventListener(\n 'touchstart',\n this._handleTouchStart,\n passiveEventListenerOptions,\n );\n }\n\n ngAfterContentInit() {\n this._handleHover();\n }\n\n ngOnDestroy() {\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n\n this._element.nativeElement.removeEventListener(\n 'touchstart',\n this._handleTouchStart,\n passiveEventListenerOptions,\n );\n\n this._menuCloseSubscription.unsubscribe();\n this._closingActionsSubscription.unsubscribe();\n this._hoverSubscription.unsubscribe();\n }\n\n /** Whether the menu is open. */\n get menuOpen(): boolean {\n return this._menuOpen;\n }\n\n /** The text direction of the containing app. */\n get dir(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Whether the menu triggers a sub-menu or a top-level one. */\n triggersSubmenu(): boolean {\n return !!(this._menuItemInstance && this._parentMaterialMenu && this.menu);\n }\n\n /** Toggles the menu between the open and closed states. */\n toggleMenu(): void {\n return this._menuOpen ? this.closeMenu() : this.openMenu();\n }\n\n /** Opens the menu. */\n openMenu(): void {\n const menu = this.menu;\n\n if (this._menuOpen || !menu) {\n return;\n }\n\n const overlayRef = this._createOverlay(menu);\n const overlayConfig = overlayRef.getConfig();\n const positionStrategy = overlayConfig.positionStrategy as FlexibleConnectedPositionStrategy;\n\n this._setPosition(menu, positionStrategy);\n overlayConfig.hasBackdrop =\n menu.hasBackdrop == null ? !this.triggersSubmenu() : menu.hasBackdrop;\n overlayRef.attach(this._getPortal(menu));\n\n if (menu.lazyContent) {\n menu.lazyContent.attach(this.menuData);\n }\n\n this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu());\n this._initMenu(menu);\n\n if (menu instanceof _MatMenuBase) {\n menu._startAnimation();\n menu._directDescendantItems.changes.pipe(takeUntil(menu.close)).subscribe(() => {\n // Re-adjust the position without locking when the amount of items\n // changes so that the overlay is allowed to pick a new optimal position.\n positionStrategy.withLockedPosition(false).reapplyLastPosition();\n positionStrategy.withLockedPosition(true);\n });\n }\n }\n\n /** Closes the menu. */\n closeMenu(): void {\n this.menu?.close.emit();\n }\n\n /**\n * Focuses the menu trigger.\n * @param origin Source of the menu trigger's focus.\n */\n focus(origin?: FocusOrigin, options?: FocusOptions) {\n if (this._focusMonitor && origin) {\n this._focusMonitor.focusVia(this._element, origin, options);\n } else {\n this._element.nativeElement.focus(options);\n }\n }\n\n /**\n * Updates the position of the menu to ensure that it fits all options within the viewport.\n */\n updatePosition(): void {\n this._overlayRef?.updatePosition();\n }\n\n /** Closes the menu and does the necessary cleanup. */\n private _destroyMenu(reason: MenuCloseReason) {\n if (!this._overlayRef || !this.menuOpen) {\n return;\n }\n\n const menu = this.menu;\n this._closingActionsSubscription.unsubscribe();\n this._overlayRef.detach();\n\n // Always restore focus if the user is navigating using the keyboard or the menu was opened\n // programmatically. We don't restore for non-root triggers, because it can prevent focus\n // from making it back to the root trigger when closing a long chain of menus by clicking\n // on the backdrop.\n if (this.restoreFocus && (reason === 'keydown' || !this._openedBy || !this.triggersSubmenu())) {\n this.focus(this._openedBy);\n }\n\n this._openedBy = undefined;\n\n if (menu instanceof _MatMenuBase) {\n menu._resetAnimation();\n\n if (menu.lazyContent) {\n // Wait for the exit animation to finish before detaching the content.\n menu._animationDone\n .pipe(\n filter(event => event.toState === 'void'),\n take(1),\n // Interrupt if the content got re-attached.\n takeUntil(menu.lazyContent._attached),\n )\n .subscribe({\n next: () => menu.lazyContent!.detach(),\n // No matter whether the content got re-attached, reset the menu.\n complete: () => this._setIsMenuOpen(false),\n });\n } else {\n this._setIsMenuOpen(false);\n }\n } else {\n this._setIsMenuOpen(false);\n menu?.lazyContent?.detach();\n }\n }\n\n /**\n * This method sets the menu state to open and focuses the first item if\n * the menu was opened via the keyboard.\n */\n private _initMenu(menu: MatMenuPanel): void {\n menu.parentMenu = this.triggersSubmenu() ? this._parentMaterialMenu : undefined;\n menu.direction = this.dir;\n this._setMenuElevation(menu);\n menu.focusFirstItem(this._openedBy || 'program');\n this._setIsMenuOpen(true);\n }\n\n /** Updates the menu elevation based on the amount of parent menus that it has. */\n private _setMenuElevation(menu: MatMenuPanel): void {\n if (menu.setElevation) {\n let depth = 0;\n let parentMenu = menu.parentMenu;\n\n while (parentMenu) {\n depth++;\n parentMenu = parentMenu.parentMenu;\n }\n\n menu.setElevation(depth);\n }\n }\n\n // set state rather than toggle to support triggers sharing a menu\n private _setIsMenuOpen(isOpen: boolean): void {\n if (isOpen !== this._menuOpen) {\n this._menuOpen = isOpen;\n this._menuOpen ? this.menuOpened.emit() : this.menuClosed.emit();\n\n if (this.triggersSubmenu()) {\n this._menuItemInstance._setHighlighted(isOpen);\n }\n\n this._changeDetectorRef.markForCheck();\n }\n }\n\n /**\n * This method creates the overlay from the provided menu's template and saves its\n * OverlayRef so that it can be attached to the DOM when openMenu is called.\n */\n private _createOverlay(menu: MatMenuPanel): OverlayRef {\n if (!this._overlayRef) {\n const config = this._getOverlayConfig(menu);\n this._subscribeToPositions(\n menu,\n config.positionStrategy as FlexibleConnectedPositionStrategy,\n );\n this._overlayRef = this._overlay.create(config);\n\n // Consume the `keydownEvents` in order to prevent them from going to another overlay.\n // Ideally we'd also have our keyboard event logic in here, however doing so will\n // break anybody that may have implemented the `MatMenuPanel` themselves.\n this._overlayRef.keydownEvents().subscribe();\n }\n\n return this._overlayRef;\n }\n\n /**\n * This method builds the configuration object needed to create the overlay, the OverlayState.\n * @returns OverlayConfig\n */\n private _getOverlayConfig(menu: MatMenuPanel): OverlayConfig {\n return new OverlayConfig({\n positionStrategy: this._overlay\n .position()\n .flexibleConnectedTo(this._element)\n .withLockedPosition()\n .withGrowAfterOpen()\n .withTransformOriginOn('.mat-menu-panel, .mat-mdc-menu-panel'),\n backdropClass: menu.backdropClass || 'cdk-overlay-transparent-backdrop',\n panelClass: menu.overlayPanelClass,\n scrollStrategy: this._scrollStrategy(),\n direction: this._dir,\n });\n }\n\n /**\n * Listens to changes in the position of the overlay and sets the correct classes\n * on the menu based on the new position. This ensures the animation origin is always\n * correct, even if a fallback position is used for the overlay.\n */\n private _subscribeToPositions(menu: MatMenuPanel, position: FlexibleConnectedPositionStrategy) {\n if (menu.setPositionClasses) {\n position.positionChanges.subscribe(change => {\n const posX: MenuPositionX = change.connectionPair.overlayX === 'start' ? 'after' : 'before';\n const posY: MenuPositionY = change.connectionPair.overlayY === 'top' ? 'below' : 'above';\n\n // @breaking-change 15.0.0 Remove null check for `ngZone`.\n // `positionChanges` fires outside of the `ngZone` and `setPositionClasses` might be\n // updating something in the view so we need to bring it back in.\n if (this._ngZone) {\n this._ngZone.run(() => menu.setPositionClasses!(posX, posY));\n } else {\n menu.setPositionClasses!(posX, posY);\n }\n });\n }\n }\n\n /**\n * Sets the appropriate positions on a position strategy\n * so the overlay connects with the trigger correctly.\n * @param positionStrategy Strategy whose position to update.\n */\n private _setPosition(menu: MatMenuPanel, positionStrategy: FlexibleConnectedPositionStrategy) {\n let [originX, originFallbackX]: HorizontalConnectionPos[] =\n menu.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'];\n\n let [overlayY, overlayFallbackY]: VerticalConnectionPos[] =\n menu.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];\n\n let [originY, originFallbackY] = [overlayY, overlayFallbackY];\n let [overlayX, overlayFallbackX] = [originX, originFallbackX];\n let offsetY = 0;\n\n if (this.triggersSubmenu()) {\n // When the menu is a sub-menu, it should always align itself\n // to the edges of the trigger, instead of overlapping it.\n overlayFallbackX = originX = menu.xPosition === 'before' ? 'start' : 'end';\n originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';\n\n if (this._parentMaterialMenu) {\n if (this._parentInnerPadding == null) {\n const firstItem = this._parentMaterialMenu.items.first;\n this._parentInnerPadding = firstItem ? firstItem._getHostElement().offsetTop : 0;\n }\n\n offsetY = overlayY === 'bottom' ? this._parentInnerPadding : -this._parentInnerPadding;\n }\n } else if (!menu.overlapTrigger) {\n originY = overlayY === 'top' ? 'bottom' : 'top';\n originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';\n }\n\n positionStrategy.withPositions([\n {originX, originY, overlayX, overlayY, offsetY},\n {originX: originFallbackX, originY, overlayX: overlayFallbackX, overlayY, offsetY},\n {\n originX,\n originY: originFallbackY,\n overlayX,\n overlayY: overlayFallbackY,\n offsetY: -offsetY,\n },\n {\n originX: originFallbackX,\n originY: originFallbackY,\n overlayX: overlayFallbackX,\n overlayY: overlayFallbackY,\n offsetY: -offsetY,\n },\n ]);\n }\n\n /** Returns a stream that emits whenever an action that should close the menu occurs. */\n private _menuClosingActions() {\n const backdrop = this._overlayRef!.backdropClick();\n const detachments = this._overlayRef!.detachments();\n const parentClose = this._parentMaterialMenu ? this._parentMaterialMenu.closed : observableOf();\n const hover = this._parentMaterialMenu\n ? this._parentMaterialMenu._hovered().pipe(\n filter(active => active !== this._menuItemInstance),\n filter(() => this._menuOpen),\n )\n : observableOf();\n\n return merge(backdrop, parentClose as Observable<MenuCloseReason>, hover, detachments);\n }\n\n /** Handles mouse presses on the trigger. */\n _handleMousedown(event: MouseEvent): void {\n if (!isFakeMousedownFromScreenReader(event)) {\n // Since right or middle button clicks won't trigger the `click` event,\n // we shouldn't consider the menu as opened by mouse in those cases.\n this._openedBy = event.button === 0 ? 'mouse' : undefined;\n\n // Since clicking on the trigger won't close the menu if it opens a sub-menu,\n // we should prevent focus from moving onto it via click to avoid the\n // highlight from lingering on the menu item.\n if (this.triggersSubmenu()) {\n event.preventDefault();\n }\n }\n }\n\n /** Handles key presses on the trigger. */\n _handleKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n\n // Pressing enter on the trigger will trigger the click handler later.\n if (keyCode === ENTER || keyCode === SPACE) {\n this._openedBy = 'keyboard';\n }\n\n if (\n this.triggersSubmenu() &&\n ((keyCode === RIGHT_ARROW && this.dir === 'ltr') ||\n (keyCode === LEFT_ARROW && this.dir === 'rtl'))\n ) {\n this._openedBy = 'keyboard';\n this.openMenu();\n }\n }\n\n /** Handles click events on the trigger. */\n _handleClick(event: MouseEvent): void {\n if (this.triggersSubmenu()) {\n // Stop event propagation to avoid closing the parent menu.\n event.stopPropagation();\n this.openMenu();\n } else {\n this.toggleMenu();\n }\n }\n\n /** Handles the cases where the user hovers over the trigger. */\n private _handleHover() {\n // Subscribe to changes in the hovered item in order to toggle the panel.\n if (!this.triggersSubmenu() || !this._parentMaterialMenu) {\n return;\n }\n\n this._hoverSubscription = this._parentMaterialMenu\n ._hovered()\n // Since we might have multiple competing triggers for the same menu (e.g. a sub-menu\n // with different data and triggers), we have to delay it by a tick to ensure that\n // it won't be closed immediately after it is opened.\n .pipe(\n filter(active => active === this._menuItemInstance && !active.disabled),\n delay(0, asapScheduler),\n )\n .subscribe(() => {\n this._openedBy = 'mouse';\n\n // If the same menu is used between multiple triggers, it might still be animating\n // while the new trigger tries to re-open it. Wait for the animation to finish\n // before doing so. Also interrupt if the user moves to another item.\n if (this.menu instanceof _MatMenuBase && this.menu._isAnimating) {\n // We need the `delay(0)` here in order to avoid\n // 'changed after checked' errors in some cases. See #12194.\n this.menu._animationDone\n .pipe(take(1), delay(0, asapScheduler), takeUntil(this._parentMaterialMenu!._hovered()))\n .subscribe(() => this.openMenu());\n } else {\n this.openMenu();\n }\n });\n }\n\n /** Gets the portal that should be attached to the overlay. */\n private _getPortal(menu: MatMenuPanel): TemplatePortal {\n // Note that we can avoid this check by keeping the portal on the menu panel.\n // While it would be cleaner, we'd have to introduce another required method on\n // `MatMenuPanel`, making it harder to consume.\n if (!this._portal || this._portal.templateRef !== menu.templateRef) {\n this._portal = new TemplatePortal(menu.templateRef, this._viewContainerRef);\n }\n\n return this._portal;\n }\n}\n\n/** Directive applied to an element that should trigger a `mat-menu`. */\n@Directive({\n selector: `[mat-menu-trigger-for], [matMenuTriggerFor]`,\n host: {\n 'class': 'mat-mdc-menu-trigger',\n },\n exportAs: 'matMenuTrigger',\n})\nexport class MatMenuTrigger extends _MatMenuTriggerBase {}\n","<ng-content></ng-content>\n<div class=\"mat-menu-ripple\" matRipple\n [matRippleDisabled]=\"disableRipple || disabled\"\n [matRippleTrigger]=\"_getHostElement()\">\n</div>\n\n<svg\n *ngIf=\"_triggersSubmenu\"\n class=\"mat-menu-submenu-icon\"\n viewBox=\"0 0 5 10\"\n focusable=\"false\"><polygon points=\"0,0 5,5 0,10\"/></svg>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {CdkScrollableModule} from '@angular/cdk/scrolling';\nimport {MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER} from '@angular/material/menu';\nimport {MatLegacyMenu} from './menu';\nimport {MatLegacyMenuContent} from './menu-content';\nimport {MatLegacyMenuItem} from './menu-item';\nimport {MatLegacyMenuTrigger} from './menu-trigger';\n\n/**\n * @deprecated Use `MatMenuModule` from `@angular/material/menu` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [CommonModule, MatCommonModule, MatRippleModule, OverlayModule],\n exports: [\n CdkScrollableModule,\n MatCommonModule,\n MatLegacyMenu,\n MatLegacyMenuItem,\n MatLegacyMenuTrigger,\n MatLegacyMenuContent,\n ],\n declarations: [MatLegacyMenu, MatLegacyMenuItem, MatLegacyMenuTrigger, MatLegacyMenuContent],\n providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER],\n})\nexport class MatLegacyMenuModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n NgZone,\n ViewEncapsulation,\n ChangeDetectorRef,\n} from '@angular/core';\nimport {\n MAT_MENU_PANEL,\n matMenuAnimations,\n _MatMenuBase,\n MAT_MENU_DEFAULT_OPTIONS,\n MatMenuDefaultOptions,\n} from '@angular/material/menu';\n\n/**\n * @docs-public MatMenu\n * @deprecated Use `MatMenu` from `@angular/material/menu` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-menu',\n templateUrl: 'menu.html',\n styleUrls: ['menu.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matMenu',\n host: {\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n },\n animations: [matMenuAnimations.transformMenu, matMenuAnimations.fadeInItems],\n providers: [{provide: MAT_MENU_PANEL, useExisting: MatLegacyMenu}],\n})\nexport class MatLegacyMenu extends _MatMenuBase {\n protected override _elevationPrefix = 'mat-elevation-z';\n protected override _baseElevation = 4;\n\n /**\n * @deprecated `changeDetectorRef` parameter will become a required parameter.\n * @breaking-change 15.0.0\n */\n constructor(\n elementRef: ElementRef<HTMLElement>,\n ngZone: NgZone,\n defaultOptions: MatMenuDefaultOptions,\n );\n\n constructor(\n elementRef: ElementRef<HTMLElement>,\n ngZone: NgZone,\n @Inject(MAT_MENU_DEFAULT_OPTIONS) defaultOptions: MatMenuDefaultOptions,\n changeDetectorRef?: ChangeDetectorRef,\n ) {\n super(elementRef, ngZone, defaultOptions, changeDetectorRef);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor} from '@angular/cdk/a11y';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n forwardRef,\n Inject,\n Optional,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {\n MAT_RADIO_GROUP,\n _MatRadioGroupBase,\n _MatRadioButtonBase,\n MAT_RADIO_DEFAULT_OPTIONS,\n MatRadioDefaultOptions,\n} from '@angular/material/radio';\n\n/**\n * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This\n * allows it to support [(ngModel)] and ngControl.\n * @docs-private\n * @deprecated Use `MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR` from `@angular/material/radio` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatLegacyRadioGroup),\n multi: true,\n};\n\n/**\n * A group of radio buttons. May contain one or more `<mat-radio-button>` elements.\n * @deprecated Use `MatRadioGroup` from `@angular/material/radio` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: 'mat-radio-group',\n exportAs: 'matRadioGroup',\n providers: [\n MAT_LEGACY_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,\n {provide: MAT_RADIO_GROUP, useExisting: MatLegacyRadioGroup},\n ],\n host: {\n 'role': 'radiogroup',\n 'class': 'mat-radio-group',\n },\n})\nexport class MatLegacyRadioGroup extends _MatRadioGroupBase<MatLegacyRadioButton> {\n @ContentChildren(forwardRef(() => MatLegacyRadioButton), {descendants: true})\n _radios: QueryList<MatLegacyRadioButton>;\n}\n\n/**\n * A Material design radio-button. Typically placed inside of `<mat-radio-group>` elements.\n * @deprecated Use `MatRadioButton` from `@angular/material/radio` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-radio-button',\n templateUrl: 'radio.html',\n styleUrls: ['radio.css'],\n inputs: ['disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matRadioButton',\n host: {\n 'class': 'mat-radio-button',\n '[class.mat-radio-checked]': 'checked',\n '[class.mat-radio-disabled]': 'disabled',\n '[class._mat-animation-noopable]': '_noopAnimations',\n '[class.mat-primary]': 'color === \"primary\"',\n '[class.mat-accent]': 'color === \"accent\"',\n '[class.mat-warn]': 'color === \"warn\"',\n // Needs to be removed since it causes some a11y issues (see #21266).\n '[attr.tabindex]': 'null',\n '[attr.id]': 'id',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n // Note: under normal conditions focus shouldn't land on this element, however it may be\n // programmatically set, for example inside of a focus trap, in this case we want to forward\n // the focus to the native element.\n '(focus)': '_inputElement.nativeElement.focus()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacyRadioButton extends _MatRadioButtonBase {\n constructor(\n @Optional() @Inject(MAT_RADIO_GROUP) radioGroup: MatLegacyRadioGroup,\n elementRef: ElementRef,\n changeDetector: ChangeDetectorRef,\n focusMonitor: FocusMonitor,\n radioDispatcher: UniqueSelectionDispatcher,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n @Optional()\n @Inject(MAT_RADIO_DEFAULT_OPTIONS)\n providerOverride?: MatRadioDefaultOptions,\n @Attribute('tabindex') tabIndex?: string,\n ) {\n super(\n radioGroup,\n elementRef,\n changeDetector,\n focusMonitor,\n radioDispatcher,\n animationMode,\n providerOverride,\n tabIndex,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatLegacyRadioButton, MatLegacyRadioGroup} from './radio';\n\n/**\n * @deprecated Use `MatRadioModule` from `@angular/material/radio` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatRippleModule, MatCommonModule],\n exports: [MatLegacyRadioGroup, MatLegacyRadioButton, MatCommonModule],\n declarations: [MatLegacyRadioGroup, MatLegacyRadioButton],\n})\nexport class MatLegacyRadioModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ActiveDescendantKeyManager, LiveAnnouncer} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {\n A,\n DOWN_ARROW,\n ENTER,\n hasModifierKey,\n LEFT_ARROW,\n RIGHT_ARROW,\n SPACE,\n UP_ARROW,\n} from '@angular/cdk/keycodes';\nimport {\n CdkConnectedOverlay,\n CdkOverlayOrigin,\n ConnectedPosition,\n Overlay,\n ScrollStrategy,\n} from '@angular/cdk/overlay';\nimport {ViewportRuler} from '@angular/cdk/scrolling';\nimport {\n AfterContentInit,\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n DoCheck,\n ElementRef,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n Self,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n FormGroupDirective,\n NgControl,\n NgForm,\n Validators,\n} from '@angular/forms';\nimport {\n CanDisable,\n CanDisableRipple,\n CanUpdateErrorState,\n ErrorStateMatcher,\n HasTabIndex,\n MatOptgroup,\n MatOption,\n MatOptionSelectionChange,\n MAT_OPTGROUP,\n MAT_OPTION_PARENT_COMPONENT,\n mixinDisabled,\n mixinDisableRipple,\n mixinErrorState,\n mixinTabIndex,\n _countGroupLabelsBeforeOption,\n _getOptionScrollPosition,\n _MatOptionBase,\n} from '@angular/material/core';\nimport {MatFormField, MatFormFieldControl, MAT_FORM_FIELD} from '@angular/material/form-field';\nimport {defer, merge, Observable, Subject} from 'rxjs';\nimport {\n distinctUntilChanged,\n filter,\n map,\n startWith,\n switchMap,\n take,\n takeUntil,\n} from 'rxjs/operators';\nimport {matSelectAnimations} from './select-animations';\nimport {\n getMatSelectDynamicMultipleError,\n getMatSelectNonArrayValueError,\n getMatSelectNonFunctionValueError,\n} from './select-errors';\n\nlet nextUniqueId = 0;\n\n/** Injection token that determines the scroll handling while a select is open. */\nexport const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'mat-select-scroll-strategy',\n);\n\n/** @docs-private */\nexport function MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY(\n overlay: Overlay,\n): () => ScrollStrategy {\n return () => overlay.scrollStrategies.reposition();\n}\n\n/** Object that can be used to configure the default options for the select module. */\nexport interface MatSelectConfig {\n /** Whether option centering should be disabled. */\n disableOptionCentering?: boolean;\n\n /** Time to wait in milliseconds after the last keystroke before moving focus to an item. */\n typeaheadDebounceInterval?: number;\n\n /** Class or list of classes to be applied to the menu's overlay panel. */\n overlayPanelClass?: string | string[];\n\n /** Wheter icon indicators should be hidden for single-selection. */\n hideSingleSelectionIndicator?: boolean;\n}\n\n/** Injection token that can be used to provide the default options the select module. */\nexport const MAT_SELECT_CONFIG = new InjectionToken<MatSelectConfig>('MAT_SELECT_CONFIG');\n\n/** @docs-private */\nexport const MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {\n provide: MAT_SELECT_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY,\n};\n\n/**\n * Injection token that can be used to reference instances of `MatSelectTrigger`. It serves as\n * alternative token to the actual `MatSelectTrigger` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const MAT_SELECT_TRIGGER = new InjectionToken<MatSelectTrigger>('MatSelectTrigger');\n\n/** Change event object that is emitted when the select value has changed. */\nexport class MatSelectChange {\n constructor(\n /** Reference to the select that emitted the change event. */\n public source: MatSelect,\n /** Current value of the select that emitted the event. */\n public value: any,\n ) {}\n}\n\n// Boilerplate for applying mixins to MatSelect.\n/** @docs-private */\nconst _MatSelectMixinBase = mixinDisableRipple(\n mixinTabIndex(\n mixinDisabled(\n mixinErrorState(\n class {\n /**\n * Emits whenever the component state changes and should cause the parent\n * form-field to update. Implemented as part of `MatFormFieldControl`.\n * @docs-private\n */\n readonly stateChanges = new Subject<void>();\n\n constructor(\n public _elementRef: ElementRef,\n public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n /**\n * Form control bound to the component.\n * Implemented as part of `MatFormFieldControl`.\n * @docs-private\n */\n public ngControl: NgControl,\n ) {}\n },\n ),\n ),\n ),\n);\n\n/** Base class with all of the `MatSelect` functionality. */\n@Directive()\nexport abstract class _MatSelectBase<C>\n extends _MatSelectMixinBase\n implements\n AfterContentInit,\n OnChanges,\n OnDestroy,\n OnInit,\n DoCheck,\n ControlValueAccessor,\n CanDisable,\n HasTabIndex,\n MatFormFieldControl<any>,\n CanUpdateErrorState,\n CanDisableRipple\n{\n /** All of the defined select options. */\n abstract options: QueryList<_MatOptionBase>;\n\n // TODO(crisbeto): this is only necessary for the non-MDC select, but it's technically a\n // public API so we have to keep it. It should be deprecated and removed eventually.\n /** All of the defined groups of options. */\n abstract optionGroups: QueryList<MatOptgroup>;\n\n /** User-supplied override of the trigger element. */\n abstract customTrigger: {};\n\n /**\n * This position config ensures that the top \"start\" corner of the overlay\n * is aligned with with the top \"start\" of the origin by default (overlapping\n * the trigger completely). If the panel cannot fit below the trigger, it\n * will fall back to a position above the trigger.\n */\n abstract _positions: ConnectedPosition[];\n\n /** Scrolls a particular option into the view. */\n protected abstract _scrollOptionIntoView(index: number): void;\n\n /** Called when the panel has been opened and the overlay has settled on its final position. */\n protected abstract _positioningSettled(): void;\n\n /** Creates a change event object that should be emitted by the select. */\n protected abstract _getChangeEvent(value: any): C;\n\n /** Factory function used to create a scroll strategy for this select. */\n private _scrollStrategyFactory: () => ScrollStrategy;\n\n /** Whether or not the overlay panel is open. */\n private _panelOpen = false;\n\n /** Comparison function to specify which option is displayed. Defaults to object equality. */\n private _compareWith = (o1: any, o2: any) => o1 === o2;\n\n /** Unique id for this input. */\n private _uid = `mat-select-${nextUniqueId++}`;\n\n /** Current `aria-labelledby` value for the select trigger. */\n private _triggerAriaLabelledBy: string | null = null;\n\n /**\n * Keeps track of the previous form control assigned to the select.\n * Used to detect if it has changed.\n */\n private _previousControl: AbstractControl | null | undefined;\n\n /** Emits whenever the component is destroyed. */\n protected readonly _destroy = new Subject<void>();\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input('aria-describedby') userAriaDescribedBy: string;\n\n /** Deals with the selection logic. */\n _selectionModel: SelectionModel<MatOption>;\n\n /** Manages keyboard events for options in the panel. */\n _keyManager: ActiveDescendantKeyManager<MatOption>;\n\n /** `View -> model callback called when value changes` */\n _onChange: (value: any) => void = () => {};\n\n /** `View -> model callback called when select has been touched` */\n _onTouched = () => {};\n\n /** ID for the DOM node containing the select's value. */\n _valueId = `mat-select-value-${nextUniqueId++}`;\n\n /** Emits when the panel element is finished transforming in. */\n readonly _panelDoneAnimatingStream = new Subject<string>();\n\n /** Strategy that will be used to handle scrolling while the select panel is open. */\n _scrollStrategy: ScrollStrategy;\n\n _overlayPanelClass: string | string[] = this._defaultOptions?.overlayPanelClass || '';\n\n /** Whether the select is focused. */\n get focused(): boolean {\n return this._focused || this._panelOpen;\n }\n private _focused = false;\n\n /** A name for this control that can be used by `mat-form-field`. */\n controlType = 'mat-select';\n\n /** Trigger that opens the select. */\n @ViewChild('trigger') trigger: ElementRef;\n\n /** Panel containing the select options. */\n @ViewChild('panel') panel: ElementRef;\n\n /** Overlay pane containing the options. */\n @ViewChild(CdkConnectedOverlay)\n protected _overlayDir: CdkConnectedOverlay;\n\n /** Classes to be passed to the select panel. Supports the same syntax as `ngClass`. */\n @Input() panelClass: string | string[] | Set<string> | {[key: string]: any};\n\n /** Placeholder to be shown if no value has been selected. */\n @Input()\n get placeholder(): string {\n return this._placeholder;\n }\n set placeholder(value: string) {\n this._placeholder = value;\n this.stateChanges.next();\n }\n private _placeholder: string;\n\n /** Whether the component is required. */\n @Input()\n get required(): boolean {\n return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;\n }\n set required(value: BooleanInput) {\n this._required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n private _required: boolean | undefined;\n\n /** Whether the user should be allowed to select multiple options. */\n @Input()\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(value: BooleanInput) {\n if (this._selectionModel && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatSelectDynamicMultipleError();\n }\n\n this._multiple = coerceBooleanProperty(value);\n }\n private _multiple: boolean = false;\n\n /** Whether to center the active option over the trigger. */\n @Input()\n get disableOptionCentering(): boolean {\n return this._disableOptionCentering;\n }\n set disableOptionCentering(value: BooleanInput) {\n this._disableOptionCentering = coerceBooleanProperty(value);\n }\n private _disableOptionCentering = this._defaultOptions?.disableOptionCentering ?? false;\n\n /**\n * Function to compare the option values with the selected values. The first argument\n * is a value from an option. The second is a value from the selection. A boolean\n * should be returned.\n */\n @Input()\n get compareWith() {\n return this._compareWith;\n }\n set compareWith(fn: (o1: any, o2: any) => boolean) {\n if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatSelectNonFunctionValueError();\n }\n this._compareWith = fn;\n if (this._selectionModel) {\n // A different comparator means the selection could change.\n this._initializeSelection();\n }\n }\n\n /** Value of the select control. */\n @Input()\n get value(): any {\n return this._value;\n }\n set value(newValue: any) {\n const hasAssigned = this._assignValue(newValue);\n\n if (hasAssigned) {\n this._onChange(newValue);\n }\n }\n private _value: any;\n\n /** Aria label of the select. */\n @Input('aria-label') ariaLabel: string = '';\n\n /** Input that can be used to specify the `aria-labelledby` attribute. */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** Object used to control when error messages are shown. */\n @Input() override errorStateMatcher: ErrorStateMatcher;\n\n /** Time to wait in milliseconds after the last keystroke before moving focus to an item. */\n @Input()\n get typeaheadDebounceInterval(): number {\n return this._typeaheadDebounceInterval;\n }\n set typeaheadDebounceInterval(value: NumberInput) {\n this._typeaheadDebounceInterval = coerceNumberProperty(value);\n }\n private _typeaheadDebounceInterval: number;\n\n /**\n * Function used to sort the values in a select in multiple mode.\n * Follows the same logic as `Array.prototype.sort`.\n */\n @Input() sortComparator: (a: MatOption, b: MatOption, options: MatOption[]) => number;\n\n /** Unique id of the element. */\n @Input()\n get id(): string {\n return this._id;\n }\n set id(value: string) {\n this._id = value || this._uid;\n this.stateChanges.next();\n }\n private _id: string;\n\n /** Combined stream of all of the child options' change events. */\n readonly optionSelectionChanges: Observable<MatOptionSelectionChange> = defer(() => {\n const options = this.options;\n\n if (options) {\n return options.changes.pipe(\n startWith(options),\n switchMap(() => merge(...options.map(option => option.onSelectionChange))),\n );\n }\n\n return this._ngZone.onStable.pipe(\n take(1),\n switchMap(() => this.optionSelectionChanges),\n );\n }) as Observable<MatOptionSelectionChange>;\n\n /** Event emitted when the select panel has been toggled. */\n @Output() readonly openedChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /** Event emitted when the select has been opened. */\n @Output('opened') readonly _openedStream: Observable<void> = this.openedChange.pipe(\n filter(o => o),\n map(() => {}),\n );\n\n /** Event emitted when the select has been closed. */\n @Output('closed') readonly _closedStream: Observable<void> = this.openedChange.pipe(\n filter(o => !o),\n map(() => {}),\n );\n\n /** Event emitted when the selected value has been changed by the user. */\n @Output() readonly selectionChange: EventEmitter<C> = new EventEmitter<C>();\n\n /**\n * Event that emits whenever the raw value of the select changes. This is here primarily\n * to facilitate the two-way binding for the `value` input.\n * @docs-private\n */\n @Output() readonly valueChange: EventEmitter<any> = new EventEmitter<any>();\n\n constructor(\n protected _viewportRuler: ViewportRuler,\n protected _changeDetectorRef: ChangeDetectorRef,\n protected _ngZone: NgZone,\n _defaultErrorStateMatcher: ErrorStateMatcher,\n elementRef: ElementRef,\n @Optional() private _dir: Directionality,\n @Optional() _parentForm: NgForm,\n @Optional() _parentFormGroup: FormGroupDirective,\n @Optional() @Inject(MAT_FORM_FIELD) protected _parentFormField: MatFormField,\n @Self() @Optional() ngControl: NgControl,\n @Attribute('tabindex') tabIndex: string,\n @Inject(MAT_SELECT_SCROLL_STRATEGY) scrollStrategyFactory: any,\n private _liveAnnouncer: LiveAnnouncer,\n @Optional() @Inject(MAT_SELECT_CONFIG) protected _defaultOptions?: MatSelectConfig,\n ) {\n super(elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);\n\n if (this.ngControl) {\n // Note: we provide the value accessor through here, instead of\n // the `providers` to avoid running into a circular import.\n this.ngControl.valueAccessor = this;\n }\n\n // Note that we only want to set this when the defaults pass it in, otherwise it should\n // stay as `undefined` so that it falls back to the default in the key manager.\n if (_defaultOptions?.typeaheadDebounceInterval != null) {\n this._typeaheadDebounceInterval = _defaultOptions.typeaheadDebounceInterval;\n }\n\n this._scrollStrategyFactory = scrollStrategyFactory;\n this._scrollStrategy = this._scrollStrategyFactory();\n this.tabIndex = parseInt(tabIndex) || 0;\n\n // Force setter to be called in case id was not specified.\n this.id = this.id;\n }\n\n ngOnInit() {\n this._selectionModel = new SelectionModel<MatOption>(this.multiple);\n this.stateChanges.next();\n\n // We need `distinctUntilChanged` here, because some browsers will\n // fire the animation end event twice for the same animation. See:\n // https://github.com/angular/angular/issues/24084\n this._panelDoneAnimatingStream\n .pipe(distinctUntilChanged(), takeUntil(this._destroy))\n .subscribe(() => this._panelDoneAnimating(this.panelOpen));\n }\n\n ngAfterContentInit() {\n this._initKeyManager();\n\n this._selectionModel.changed.pipe(takeUntil(this._destroy)).subscribe(event => {\n event.added.forEach(option => option.select());\n event.removed.forEach(option => option.deselect());\n });\n\n this.options.changes.pipe(startWith(null), takeUntil(this._destroy)).subscribe(() => {\n this._resetOptions();\n this._initializeSelection();\n });\n }\n\n ngDoCheck() {\n const newAriaLabelledby = this._getTriggerAriaLabelledby();\n const ngControl = this.ngControl;\n\n // We have to manage setting the `aria-labelledby` ourselves, because part of its value\n // is computed as a result of a content query which can cause this binding to trigger a\n // \"changed after checked\" error.\n if (newAriaLabelledby !== this._triggerAriaLabelledBy) {\n const element: HTMLElement = this._elementRef.nativeElement;\n this._triggerAriaLabelledBy = newAriaLabelledby;\n if (newAriaLabelledby) {\n element.setAttribute('aria-labelledby', newAriaLabelledby);\n } else {\n element.removeAttribute('aria-labelledby');\n }\n }\n\n if (ngControl) {\n // The disabled state might go out of sync if the form group is swapped out. See #17860.\n if (this._previousControl !== ngControl.control) {\n if (\n this._previousControl !== undefined &&\n ngControl.disabled !== null &&\n ngControl.disabled !== this.disabled\n ) {\n this.disabled = ngControl.disabled;\n }\n\n this._previousControl = ngControl.control;\n }\n\n this.updateErrorState();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // Updating the disabled state is handled by `mixinDisabled`, but we need to additionally let\n // the parent form field know to run change detection when the disabled state changes.\n if (changes['disabled'] || changes['userAriaDescribedBy']) {\n this.stateChanges.next();\n }\n\n if (changes['typeaheadDebounceInterval'] && this._keyManager) {\n this._keyManager.withTypeAhead(this._typeaheadDebounceInterval);\n }\n }\n\n ngOnDestroy() {\n this._keyManager?.destroy();\n this._destroy.next();\n this._destroy.complete();\n this.stateChanges.complete();\n }\n\n /** Toggles the overlay panel open or closed. */\n toggle(): void {\n this.panelOpen ? this.close() : this.open();\n }\n\n /** Opens the overlay panel. */\n open(): void {\n if (this._canOpen()) {\n this._panelOpen = true;\n this._keyManager.withHorizontalOrientation(null);\n this._highlightCorrectOption();\n this._changeDetectorRef.markForCheck();\n }\n }\n\n /** Closes the overlay panel and focuses the host element. */\n close(): void {\n if (this._panelOpen) {\n this._panelOpen = false;\n this._keyManager.withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr');\n this._changeDetectorRef.markForCheck();\n this._onTouched();\n }\n }\n\n /**\n * Sets the select's value. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param value New value to be written to the model.\n */\n writeValue(value: any): void {\n this._assignValue(value);\n }\n\n /**\n * Saves a callback function to be invoked when the select's value\n * changes from user input. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the value changes.\n */\n registerOnChange(fn: (value: any) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Saves a callback function to be invoked when the select is blurred\n * by the user. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the component has been touched.\n */\n registerOnTouched(fn: () => {}): void {\n this._onTouched = fn;\n }\n\n /**\n * Disables the select. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param isDisabled Sets whether the component is disabled.\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n\n /** Whether or not the overlay panel is open. */\n get panelOpen(): boolean {\n return this._panelOpen;\n }\n\n /** The currently selected option. */\n get selected(): MatOption | MatOption[] {\n return this.multiple ? this._selectionModel?.selected || [] : this._selectionModel?.selected[0];\n }\n\n /** The value displayed in the trigger. */\n get triggerValue(): string {\n if (this.empty) {\n return '';\n }\n\n if (this._multiple) {\n const selectedOptions = this._selectionModel.selected.map(option => option.viewValue);\n\n if (this._isRtl()) {\n selectedOptions.reverse();\n }\n\n // TODO(crisbeto): delimiter should be configurable for proper localization.\n return selectedOptions.join(', ');\n }\n\n return this._selectionModel.selected[0].viewValue;\n }\n\n /** Whether the element is in RTL mode. */\n _isRtl(): boolean {\n return this._dir ? this._dir.value === 'rtl' : false;\n }\n\n /** Handles all keydown events on the select. */\n _handleKeydown(event: KeyboardEvent): void {\n if (!this.disabled) {\n this.panelOpen ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);\n }\n }\n\n /** Handles keyboard events while the select is closed. */\n private _handleClosedKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n const isArrowKey =\n keyCode === DOWN_ARROW ||\n keyCode === UP_ARROW ||\n keyCode === LEFT_ARROW ||\n keyCode === RIGHT_ARROW;\n const isOpenKey = keyCode === ENTER || keyCode === SPACE;\n const manager = this._keyManager;\n\n // Open the select on ALT + arrow key to match the native <select>\n if (\n (!manager.isTyping() && isOpenKey && !hasModifierKey(event)) ||\n ((this.multiple || event.altKey) && isArrowKey)\n ) {\n event.preventDefault(); // prevents the page from scrolling down when pressing space\n this.open();\n } else if (!this.multiple) {\n const previouslySelectedOption = this.selected;\n manager.onKeydown(event);\n const selectedOption = this.selected;\n\n // Since the value has changed, we need to announce it ourselves.\n if (selectedOption && previouslySelectedOption !== selectedOption) {\n // We set a duration on the live announcement, because we want the live element to be\n // cleared after a while so that users can't navigate to it using the arrow keys.\n this._liveAnnouncer.announce((selectedOption as MatOption).viewValue, 10000);\n }\n }\n }\n\n /** Handles keyboard events when the selected is open. */\n private _handleOpenKeydown(event: KeyboardEvent): void {\n const manager = this._keyManager;\n const keyCode = event.keyCode;\n const isArrowKey = keyCode === DOWN_ARROW || keyCode === UP_ARROW;\n const isTyping = manager.isTyping();\n\n if (isArrowKey && event.altKey) {\n // Close the select on ALT + arrow key to match the native <select>\n event.preventDefault();\n this.close();\n // Don't do anything in this case if the user is typing,\n // because the typing sequence can include the space key.\n } else if (\n !isTyping &&\n (keyCode === ENTER || keyCode === SPACE) &&\n manager.activeItem &&\n !hasModifierKey(event)\n ) {\n event.preventDefault();\n manager.activeItem._selectViaInteraction();\n } else if (!isTyping && this._multiple && keyCode === A && event.ctrlKey) {\n event.preventDefault();\n const hasDeselectedOptions = this.options.some(opt => !opt.disabled && !opt.selected);\n\n this.options.forEach(option => {\n if (!option.disabled) {\n hasDeselectedOptions ? option.select() : option.deselect();\n }\n });\n } else {\n const previouslyFocusedIndex = manager.activeItemIndex;\n\n manager.onKeydown(event);\n\n if (\n this._multiple &&\n isArrowKey &&\n event.shiftKey &&\n manager.activeItem &&\n manager.activeItemIndex !== previouslyFocusedIndex\n ) {\n manager.activeItem._selectViaInteraction();\n }\n }\n }\n\n _onFocus() {\n if (!this.disabled) {\n this._focused = true;\n this.stateChanges.next();\n }\n }\n\n /**\n * Calls the touched callback only if the panel is closed. Otherwise, the trigger will\n * \"blur\" to the panel when it opens, causing a false positive.\n */\n _onBlur() {\n this._focused = false;\n this._keyManager?.cancelTypeahead();\n\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }\n\n /**\n * Callback that is invoked when the overlay panel has been attached.\n */\n _onAttached(): void {\n this._overlayDir.positionChange.pipe(take(1)).subscribe(() => {\n this._changeDetectorRef.detectChanges();\n this._positioningSettled();\n });\n }\n\n /** Returns the theme to be used on the panel. */\n _getPanelTheme(): string {\n return this._parentFormField ? `mat-${this._parentFormField.color}` : '';\n }\n\n /** Whether the select has a value. */\n get empty(): boolean {\n return !this._selectionModel || this._selectionModel.isEmpty();\n }\n\n private _initializeSelection(): void {\n // Defer setting the value in order to avoid the \"Expression\n // has changed after it was checked\" errors from Angular.\n Promise.resolve().then(() => {\n if (this.ngControl) {\n this._value = this.ngControl.value;\n }\n\n this._setSelectionByValue(this._value);\n this.stateChanges.next();\n });\n }\n\n /**\n * Sets the selected option based on a value. If no option can be\n * found with the designated value, the select trigger is cleared.\n */\n private _setSelectionByValue(value: any | any[]): void {\n this.options.forEach(option => option.setInactiveStyles());\n this._selectionModel.clear();\n\n if (this.multiple && value) {\n if (!Array.isArray(value) && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatSelectNonArrayValueError();\n }\n\n value.forEach((currentValue: any) => this._selectOptionByValue(currentValue));\n this._sortValues();\n } else {\n const correspondingOption = this._selectOptionByValue(value);\n\n // Shift focus to the active item. Note that we shouldn't do this in multiple\n // mode, because we don't know what option the user interacted with last.\n if (correspondingOption) {\n this._keyManager.updateActiveItem(correspondingOption);\n } else if (!this.panelOpen) {\n // Otherwise reset the highlighted option. Note that we only want to do this while\n // closed, because doing it while open can shift the user's focus unnecessarily.\n this._keyManager.updateActiveItem(-1);\n }\n }\n\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Finds and selects and option based on its value.\n * @returns Option that has the corresponding value.\n */\n private _selectOptionByValue(value: any): MatOption | undefined {\n const correspondingOption = this.options.find((option: MatOption) => {\n // Skip options that are already in the model. This allows us to handle cases\n // where the same primitive value is selected multiple times.\n if (this._selectionModel.isSelected(option)) {\n return false;\n }\n\n try {\n // Treat null as a special reset value.\n return option.value != null && this._compareWith(option.value, value);\n } catch (error) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Notify developers of errors in their comparator.\n console.warn(error);\n }\n return false;\n }\n });\n\n if (correspondingOption) {\n this._selectionModel.select(correspondingOption);\n }\n\n return correspondingOption;\n }\n\n /** Assigns a specific value to the select. Returns whether the value has changed. */\n private _assignValue(newValue: any | any[]): boolean {\n // Always re-assign an array, because it might have been mutated.\n if (newValue !== this._value || (this._multiple && Array.isArray(newValue))) {\n if (this.options) {\n this._setSelectionByValue(newValue);\n }\n\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** Sets up a key manager to listen to keyboard events on the overlay panel. */\n private _initKeyManager() {\n this._keyManager = new ActiveDescendantKeyManager<MatOption>(this.options)\n .withTypeAhead(this._typeaheadDebounceInterval)\n .withVerticalOrientation()\n .withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr')\n .withHomeAndEnd()\n .withPageUpDown()\n .withAllowedModifierKeys(['shiftKey']);\n\n this._keyManager.tabOut.subscribe(() => {\n if (this.panelOpen) {\n // Select the active item when tabbing away. This is consistent with how the native\n // select behaves. Note that we only want to do this in single selection mode.\n if (!this.multiple && this._keyManager.activeItem) {\n this._keyManager.activeItem._selectViaInteraction();\n }\n\n // Restore focus to the trigger before closing. Ensures that the focus\n // position won't be lost if the user got focus into the overlay.\n this.focus();\n this.close();\n }\n });\n\n this._keyManager.change.subscribe(() => {\n if (this._panelOpen && this.panel) {\n this._scrollOptionIntoView(this._keyManager.activeItemIndex || 0);\n } else if (!this._panelOpen && !this.multiple && this._keyManager.activeItem) {\n this._keyManager.activeItem._selectViaInteraction();\n }\n });\n }\n\n /** Drops current option subscriptions and IDs and resets from scratch. */\n private _resetOptions(): void {\n const changedOrDestroyed = merge(this.options.changes, this._destroy);\n\n this.optionSelectionChanges.pipe(takeUntil(changedOrDestroyed)).subscribe(event => {\n this._onSelect(event.source, event.isUserInput);\n\n if (event.isUserInput && !this.multiple && this._panelOpen) {\n this.close();\n this.focus();\n }\n });\n\n // Listen to changes in the internal state of the options and react accordingly.\n // Handles cases like the labels of the selected options changing.\n merge(...this.options.map(option => option._stateChanges))\n .pipe(takeUntil(changedOrDestroyed))\n .subscribe(() => {\n // `_stateChanges` can fire as a result of a change in the label's DOM value which may\n // be the result of an expression changing. We have to use `detectChanges` in order\n // to avoid \"changed after checked\" errors (see #14793).\n this._changeDetectorRef.detectChanges();\n this.stateChanges.next();\n });\n }\n\n /** Invoked when an option is clicked. */\n private _onSelect(option: MatOption, isUserInput: boolean): void {\n const wasSelected = this._selectionModel.isSelected(option);\n\n if (option.value == null && !this._multiple) {\n option.deselect();\n this._selectionModel.clear();\n\n if (this.value != null) {\n this._propagateChanges(option.value);\n }\n } else {\n if (wasSelected !== option.selected) {\n option.selected\n ? this._selectionModel.select(option)\n : this._selectionModel.deselect(option);\n }\n\n if (isUserInput) {\n this._keyManager.setActiveItem(option);\n }\n\n if (this.multiple) {\n this._sortValues();\n\n if (isUserInput) {\n // In case the user selected the option with their mouse, we\n // want to restore focus back to the trigger, in order to\n // prevent the select keyboard controls from clashing with\n // the ones from `mat-option`.\n this.focus();\n }\n }\n }\n\n if (wasSelected !== this._selectionModel.isSelected(option)) {\n this._propagateChanges();\n }\n\n this.stateChanges.next();\n }\n\n /** Sorts the selected values in the selected based on their order in the panel. */\n private _sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n\n this._selectionModel.sort((a, b) => {\n return this.sortComparator\n ? this.sortComparator(a, b, options)\n : options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }\n\n /** Emits change event to set the model value. */\n private _propagateChanges(fallbackValue?: any): void {\n let valueToEmit: any = null;\n\n if (this.multiple) {\n valueToEmit = (this.selected as MatOption[]).map(option => option.value);\n } else {\n valueToEmit = this.selected ? (this.selected as MatOption).value : fallbackValue;\n }\n\n this._value = valueToEmit;\n this.valueChange.emit(valueToEmit);\n this._onChange(valueToEmit);\n this.selectionChange.emit(this._getChangeEvent(valueToEmit));\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Highlights the selected item. If no option is selected, it will highlight\n * the first item instead.\n */\n private _highlightCorrectOption(): void {\n if (this._keyManager) {\n if (this.empty) {\n this._keyManager.setFirstItemActive();\n } else {\n this._keyManager.setActiveItem(this._selectionModel.selected[0]);\n }\n }\n }\n\n /** Whether the panel is allowed to open. */\n protected _canOpen(): boolean {\n return !this._panelOpen && !this.disabled && this.options?.length > 0;\n }\n\n /** Focuses the select element. */\n focus(options?: FocusOptions): void {\n this._elementRef.nativeElement.focus(options);\n }\n\n /** Gets the aria-labelledby for the select panel. */\n _getPanelAriaLabelledby(): string | null {\n if (this.ariaLabel) {\n return null;\n }\n\n const labelId = this._parentFormField?.getLabelId();\n const labelExpression = labelId ? labelId + ' ' : '';\n return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;\n }\n\n /** Determines the `aria-activedescendant` to be set on the host. */\n _getAriaActiveDescendant(): string | null {\n if (this.panelOpen && this._keyManager && this._keyManager.activeItem) {\n return this._keyManager.activeItem.id;\n }\n\n return null;\n }\n\n /** Gets the aria-labelledby of the select component trigger. */\n private _getTriggerAriaLabelledby(): string | null {\n if (this.ariaLabel) {\n return null;\n }\n\n const labelId = this._parentFormField?.getLabelId();\n let value = (labelId ? labelId + ' ' : '') + this._valueId;\n\n if (this.ariaLabelledby) {\n value += ' ' + this.ariaLabelledby;\n }\n\n return value;\n }\n\n /** Called when the overlay panel is done animating. */\n protected _panelDoneAnimating(isOpen: boolean) {\n this.openedChange.emit(isOpen);\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n setDescribedByIds(ids: string[]) {\n if (ids.length) {\n this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));\n } else {\n this._elementRef.nativeElement.removeAttribute('aria-describedby');\n }\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n onContainerClick() {\n this.focus();\n this.open();\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get shouldLabelFloat(): boolean {\n return this._panelOpen || !this.empty || (this._focused && !!this._placeholder);\n }\n}\n\n/**\n * Allows the user to customize the trigger that is displayed when the select has a value.\n */\n@Directive({\n selector: 'mat-select-trigger',\n providers: [{provide: MAT_SELECT_TRIGGER, useExisting: MatSelectTrigger}],\n})\nexport class MatSelectTrigger {}\n\n@Component({\n selector: 'mat-select',\n exportAs: 'matSelect',\n templateUrl: 'select.html',\n styleUrls: ['select.css'],\n inputs: ['disabled', 'disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'role': 'combobox',\n 'aria-autocomplete': 'none',\n 'aria-haspopup': 'listbox',\n 'class': 'mat-mdc-select',\n '[attr.id]': 'id',\n '[attr.tabindex]': 'tabIndex',\n '[attr.aria-controls]': 'panelOpen ? id + \"-panel\" : null',\n '[attr.aria-expanded]': 'panelOpen',\n '[attr.aria-label]': 'ariaLabel || null',\n '[attr.aria-required]': 'required.toString()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.aria-invalid]': 'errorState',\n '[attr.aria-activedescendant]': '_getAriaActiveDescendant()',\n '[class.mat-mdc-select-disabled]': 'disabled',\n '[class.mat-mdc-select-invalid]': 'errorState',\n '[class.mat-mdc-select-required]': 'required',\n '[class.mat-mdc-select-empty]': 'empty',\n '[class.mat-mdc-select-multiple]': 'multiple',\n '(keydown)': '_handleKeydown($event)',\n '(focus)': '_onFocus()',\n '(blur)': '_onBlur()',\n },\n animations: [matSelectAnimations.transformPanel],\n providers: [\n {provide: MatFormFieldControl, useExisting: MatSelect},\n {provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatSelect},\n ],\n})\nexport class MatSelect extends _MatSelectBase<MatSelectChange> implements OnInit, AfterViewInit {\n @ContentChildren(MatOption, {descendants: true}) options: QueryList<MatOption>;\n @ContentChildren(MAT_OPTGROUP, {descendants: true}) optionGroups: QueryList<MatOptgroup>;\n @ContentChild(MAT_SELECT_TRIGGER) customTrigger: MatSelectTrigger;\n\n _positions: ConnectedPosition[] = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n panelClass: 'mat-mdc-select-panel-above',\n },\n ];\n\n /** Ideal origin for the overlay panel. */\n _preferredOverlayOrigin: CdkOverlayOrigin | ElementRef | undefined;\n\n /** Width of the overlay panel. */\n _overlayWidth: number;\n\n override get shouldLabelFloat(): boolean {\n // Since the panel doesn't overlap the trigger, we\n // want the label to only float when there's a value.\n return this.panelOpen || !this.empty || (this.focused && !!this.placeholder);\n }\n\n override ngOnInit() {\n super.ngOnInit();\n this._viewportRuler\n .change()\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n if (this.panelOpen) {\n this._overlayWidth = this._getOverlayWidth();\n this._changeDetectorRef.detectChanges();\n }\n });\n }\n\n ngAfterViewInit() {\n // Note that it's important that we read this in `ngAfterViewInit`, because\n // reading it earlier will cause the form field to return a different element.\n if (this._parentFormField) {\n this._preferredOverlayOrigin = this._parentFormField.getConnectedOverlayOrigin();\n }\n }\n\n override open() {\n this._overlayWidth = this._getOverlayWidth();\n super.open();\n // Required for the MDC form field to pick up when the overlay has been opened.\n this.stateChanges.next();\n }\n\n override close() {\n super.close();\n // Required for the MDC form field to pick up when the overlay has been closed.\n this.stateChanges.next();\n }\n\n /** Scrolls the active option into view. */\n protected _scrollOptionIntoView(index: number): void {\n const option = this.options.toArray()[index];\n\n if (option) {\n const panel: HTMLElement = this.panel.nativeElement;\n const labelCount = _countGroupLabelsBeforeOption(index, this.options, this.optionGroups);\n const element = option._getHostElement();\n\n if (index === 0 && labelCount === 1) {\n // If we've got one group label before the option and we're at the top option,\n // scroll the list to the top. This is better UX than scrolling the list to the\n // top of the option, because it allows the user to read the top group's label.\n panel.scrollTop = 0;\n } else {\n panel.scrollTop = _getOptionScrollPosition(\n element.offsetTop,\n element.offsetHeight,\n panel.scrollTop,\n panel.offsetHeight,\n );\n }\n }\n }\n\n protected _positioningSettled() {\n this._scrollOptionIntoView(this._keyManager.activeItemIndex || 0);\n }\n\n protected _getChangeEvent(value: any) {\n return new MatSelectChange(this, value);\n }\n\n /** Gets how wide the overlay panel should be. */\n private _getOverlayWidth() {\n const refToMeasure =\n this._preferredOverlayOrigin instanceof CdkOverlayOrigin\n ? this._preferredOverlayOrigin.elementRef\n : this._preferredOverlayOrigin || this._elementRef;\n return refToMeasure.nativeElement.getBoundingClientRect().width;\n }\n\n /** Whether checkmark indicator for single-selection options is hidden. */\n @Input()\n get hideSingleSelectionIndicator(): boolean {\n return this._hideSingleSelectionIndicator;\n }\n set hideSingleSelectionIndicator(value: BooleanInput) {\n this._hideSingleSelectionIndicator = coerceBooleanProperty(value);\n this._syncParentProperties();\n }\n private _hideSingleSelectionIndicator: boolean =\n this._defaultOptions?.hideSingleSelectionIndicator ?? false;\n\n /** Syncs the parent state with the individual options. */\n _syncParentProperties(): void {\n if (this.options) {\n for (const option of this.options) {\n option._changeDetectorRef.markForCheck();\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ConnectedPosition} from '@angular/cdk/overlay';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n OnInit,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n _countGroupLabelsBeforeLegacyOption,\n _getLegacyOptionScrollPosition,\n MAT_LEGACY_OPTGROUP,\n MAT_LEGACY_OPTION_PARENT_COMPONENT,\n MatLegacyOption,\n MatLegacyOptgroup,\n} from '@angular/material/legacy-core';\nimport {MAT_SELECT_TRIGGER, _MatSelectBase} from '@angular/material/select';\nimport {MatLegacyFormFieldControl} from '@angular/material/legacy-form-field';\nimport {take, takeUntil} from 'rxjs/operators';\nimport {matLegacySelectAnimations} from './select-animations';\n\n/**\n * The following style constants are necessary to save here in order\n * to properly calculate the alignment of the selected option over\n * the trigger element.\n */\n\n/**\n * The max height of the select's overlay panel.\n * @deprecated Use `SELECT_PANEL_MAX_HEIGHT` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const SELECT_PANEL_MAX_HEIGHT = 256;\n\n/**\n * The panel's padding on the x-axis.\n * @deprecated Use `SELECT_PANEL_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const SELECT_PANEL_PADDING_X = 16;\n\n/**\n * The panel's x axis padding if it is indented (e.g. there is an option group).\n * @deprecated Use `SELECT_PANEL_INDENT_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;\n\n/**\n * The height of the select items in `em` units.\n * @deprecated Use `SELECT_ITEM_HEIGHT_EM` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const SELECT_ITEM_HEIGHT_EM = 3;\n\n// TODO(josephperrott): Revert to a constant after 2018 spec updates are fully merged.\n/**\n * Distance between the panel edge and the option text in\n * multi-selection mode.\n *\n * Calculated as:\n * (SELECT_PANEL_PADDING_X * 1.5) + 16 = 40\n * The padding is multiplied by 1.5 because the checkbox's margin is half the padding.\n * The checkbox width is 16px.\n *\n * @deprecated Use `SELECT_MULTIPLE_PANEL_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.5 + 16;\n\n/**\n * The select panel will only \"fit\" inside the viewport if it is positioned at\n * this value or more away from the viewport boundary.\n * @deprecated Use `SELECT_PANEL_VIEWPORT_PADDING` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const SELECT_PANEL_VIEWPORT_PADDING = 8;\n\n/**\n * Change event object that is emitted when the select value has changed.\n * @deprecated Use `MatSelectChange` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacySelectChange {\n constructor(\n /** Reference to the select that emitted the change event. */\n public source: MatLegacySelect,\n /** Current value of the select that emitted the event. */\n public value: any,\n ) {}\n}\n\n/**\n * Allows the user to customize the trigger that is displayed when the select has a value.\n * @deprecated Use `MatSelectTrigger` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: 'mat-select-trigger',\n providers: [{provide: MAT_SELECT_TRIGGER, useExisting: MatLegacySelectTrigger}],\n})\nexport class MatLegacySelectTrigger {}\n\n/**\n * @deprecated Use `MatSelect` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-select',\n exportAs: 'matSelect',\n templateUrl: 'select.html',\n styleUrls: ['select.css'],\n inputs: ['disabled', 'disableRipple', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'role': 'combobox',\n 'aria-autocomplete': 'none',\n // TODO(crisbeto): the value for aria-haspopup should be `listbox`, but currently it's difficult\n // to sync into Google, because of an outdated automated a11y check which flags it as an invalid\n // value. At some point we should try to switch it back to being `listbox`.\n 'aria-haspopup': 'true',\n 'class': 'mat-select',\n '[attr.id]': 'id',\n '[attr.tabindex]': 'tabIndex',\n '[attr.aria-controls]': 'panelOpen ? id + \"-panel\" : null',\n '[attr.aria-expanded]': 'panelOpen',\n '[attr.aria-label]': 'ariaLabel || null',\n '[attr.aria-required]': 'required.toString()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.aria-invalid]': 'errorState',\n '[attr.aria-activedescendant]': '_getAriaActiveDescendant()',\n '[class.mat-select-disabled]': 'disabled',\n '[class.mat-select-invalid]': 'errorState',\n '[class.mat-select-required]': 'required',\n '[class.mat-select-empty]': 'empty',\n '[class.mat-select-multiple]': 'multiple',\n '(keydown)': '_handleKeydown($event)',\n '(focus)': '_onFocus()',\n '(blur)': '_onBlur()',\n },\n animations: [\n matLegacySelectAnimations.transformPanelWrap,\n matLegacySelectAnimations.transformPanel,\n ],\n providers: [\n {provide: MatLegacyFormFieldControl, useExisting: MatLegacySelect},\n {provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacySelect},\n ],\n})\nexport class MatLegacySelect extends _MatSelectBase<MatLegacySelectChange> implements OnInit {\n /** The scroll position of the overlay panel, calculated to center the selected option. */\n private _scrollTop = 0;\n\n /** The last measured value for the trigger's client bounding rect. */\n private _triggerRect: ClientRect;\n\n /** The cached font-size of the trigger element. */\n _triggerFontSize = 0;\n\n /** The value of the select panel's transform-origin property. */\n _transformOrigin: string = 'top';\n\n /**\n * The y-offset of the overlay panel in relation to the trigger's top start corner.\n * This must be adjusted to align the selected option text over the trigger text.\n * when the panel opens. Will change based on the y-position of the selected option.\n */\n _offsetY = 0;\n\n @ContentChildren(MatLegacyOption, {descendants: true}) options: QueryList<MatLegacyOption>;\n\n @ContentChildren(MAT_LEGACY_OPTGROUP, {descendants: true})\n optionGroups: QueryList<MatLegacyOptgroup>;\n\n @ContentChild(MAT_SELECT_TRIGGER) customTrigger: MatLegacySelectTrigger;\n\n _positions: ConnectedPosition[] = [\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ];\n\n /**\n * Calculates the scroll position of the select's overlay panel.\n *\n * Attempts to center the selected option in the panel. If the option is\n * too high or too low in the panel to be scrolled to the center, it clamps the\n * scroll position to the min or max scroll positions respectively.\n */\n _calculateOverlayScroll(selectedIndex: number, scrollBuffer: number, maxScroll: number): number {\n const itemHeight = this._getItemHeight();\n const optionOffsetFromScrollTop = itemHeight * selectedIndex;\n const halfOptionHeight = itemHeight / 2;\n\n // Starts at the optionOffsetFromScrollTop, which scrolls the option to the top of the\n // scroll container, then subtracts the scroll buffer to scroll the option down to\n // the center of the overlay panel. Half the option height must be re-added to the\n // scrollTop so the option is centered based on its middle, not its top edge.\n const optimalScrollPosition = optionOffsetFromScrollTop - scrollBuffer + halfOptionHeight;\n return Math.min(Math.max(0, optimalScrollPosition), maxScroll);\n }\n\n override ngOnInit() {\n super.ngOnInit();\n this._viewportRuler\n .change()\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n if (this.panelOpen) {\n this._triggerRect = this.trigger.nativeElement.getBoundingClientRect();\n this._changeDetectorRef.markForCheck();\n }\n });\n }\n\n override open(): void {\n if (super._canOpen()) {\n super.open();\n this._triggerRect = this.trigger.nativeElement.getBoundingClientRect();\n // Note: The computed font-size will be a string pixel value (e.g. \"16px\").\n // `parseInt` ignores the trailing 'px' and converts this to a number.\n this._triggerFontSize = parseInt(\n getComputedStyle(this.trigger.nativeElement).fontSize || '0',\n );\n this._calculateOverlayPosition();\n\n // Set the font size on the panel element once it exists.\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\n if (\n this._triggerFontSize &&\n this._overlayDir.overlayRef &&\n this._overlayDir.overlayRef.overlayElement\n ) {\n this._overlayDir.overlayRef.overlayElement.style.fontSize = `${this._triggerFontSize}px`;\n }\n });\n }\n }\n\n /** Scrolls the active option into view. */\n protected _scrollOptionIntoView(index: number): void {\n const labelCount = _countGroupLabelsBeforeLegacyOption(index, this.options, this.optionGroups);\n const itemHeight = this._getItemHeight();\n\n if (index === 0 && labelCount === 1) {\n // If we've got one group label before the option and we're at the top option,\n // scroll the list to the top. This is better UX than scrolling the list to the\n // top of the option, because it allows the user to read the top group's label.\n this.panel.nativeElement.scrollTop = 0;\n } else {\n this.panel.nativeElement.scrollTop = _getLegacyOptionScrollPosition(\n (index + labelCount) * itemHeight,\n itemHeight,\n this.panel.nativeElement.scrollTop,\n SELECT_PANEL_MAX_HEIGHT,\n );\n }\n }\n\n protected _positioningSettled() {\n this._calculateOverlayOffsetX();\n this.panel.nativeElement.scrollTop = this._scrollTop;\n }\n\n protected override _panelDoneAnimating(isOpen: boolean) {\n if (this.panelOpen) {\n this._scrollTop = 0;\n } else {\n this._overlayDir.offsetX = 0;\n this._changeDetectorRef.markForCheck();\n }\n\n super._panelDoneAnimating(isOpen);\n }\n\n protected _getChangeEvent(value: any) {\n return new MatLegacySelectChange(this, value);\n }\n\n protected _getOverlayMinWidth(): number {\n return this._triggerRect?.width;\n }\n\n /**\n * Sets the x-offset of the overlay panel in relation to the trigger's top start corner.\n * This must be adjusted to align the selected option text over the trigger text when\n * the panel opens. Will change based on LTR or RTL text direction. Note that the offset\n * can't be calculated until the panel has been attached, because we need to know the\n * content width in order to constrain the panel within the viewport.\n */\n private _calculateOverlayOffsetX(): void {\n const overlayRect = this._overlayDir.overlayRef.overlayElement.getBoundingClientRect();\n const viewportSize = this._viewportRuler.getViewportSize();\n const isRtl = this._isRtl();\n const paddingWidth = this.multiple\n ? SELECT_MULTIPLE_PANEL_PADDING_X + SELECT_PANEL_PADDING_X\n : SELECT_PANEL_PADDING_X * 2;\n let offsetX: number;\n\n // Adjust the offset, depending on the option padding.\n if (this.multiple) {\n offsetX = SELECT_MULTIPLE_PANEL_PADDING_X;\n } else if (this.disableOptionCentering) {\n offsetX = SELECT_PANEL_PADDING_X;\n } else {\n let selected = this._selectionModel.selected[0] || this.options.first;\n offsetX = selected && selected.group ? SELECT_PANEL_INDENT_PADDING_X : SELECT_PANEL_PADDING_X;\n }\n\n // Invert the offset in LTR.\n if (!isRtl) {\n offsetX *= -1;\n }\n\n // Determine how much the select overflows on each side.\n const leftOverflow = 0 - (overlayRect.left + offsetX - (isRtl ? paddingWidth : 0));\n const rightOverflow =\n overlayRect.right + offsetX - viewportSize.width + (isRtl ? 0 : paddingWidth);\n\n // If the element overflows on either side, reduce the offset to allow it to fit.\n if (leftOverflow > 0) {\n offsetX += leftOverflow + SELECT_PANEL_VIEWPORT_PADDING;\n } else if (rightOverflow > 0) {\n offsetX -= rightOverflow + SELECT_PANEL_VIEWPORT_PADDING;\n }\n\n // Set the offset directly in order to avoid having to go through change detection and\n // potentially triggering \"changed after it was checked\" errors. Round the value to avoid\n // blurry content in some browsers.\n this._overlayDir.offsetX = Math.round(offsetX);\n this._overlayDir.overlayRef.updatePosition();\n }\n\n /**\n * Calculates the y-offset of the select's overlay panel in relation to the\n * top start corner of the trigger. It has to be adjusted in order for the\n * selected option to be aligned over the trigger when the panel opens.\n */\n private _calculateOverlayOffsetY(\n selectedIndex: number,\n scrollBuffer: number,\n maxScroll: number,\n ): number {\n const itemHeight = this._getItemHeight();\n const optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;\n const maxOptionsDisplayed = Math.floor(SELECT_PANEL_MAX_HEIGHT / itemHeight);\n let optionOffsetFromPanelTop: number;\n\n // Disable offset if requested by user by returning 0 as value to offset\n if (this.disableOptionCentering) {\n return 0;\n }\n\n if (this._scrollTop === 0) {\n optionOffsetFromPanelTop = selectedIndex * itemHeight;\n } else if (this._scrollTop === maxScroll) {\n const firstDisplayedIndex = this._getItemCount() - maxOptionsDisplayed;\n const selectedDisplayIndex = selectedIndex - firstDisplayedIndex;\n\n // The first item is partially out of the viewport. Therefore we need to calculate what\n // portion of it is shown in the viewport and account for it in our offset.\n let partialItemHeight =\n itemHeight - ((this._getItemCount() * itemHeight - SELECT_PANEL_MAX_HEIGHT) % itemHeight);\n\n // Because the panel height is longer than the height of the options alone,\n // there is always extra padding at the top or bottom of the panel. When\n // scrolled to the very bottom, this padding is at the top of the panel and\n // must be added to the offset.\n optionOffsetFromPanelTop = selectedDisplayIndex * itemHeight + partialItemHeight;\n } else {\n // If the option was scrolled to the middle of the panel using a scroll buffer,\n // its offset will be the scroll buffer minus the half height that was added to\n // center it.\n optionOffsetFromPanelTop = scrollBuffer - itemHeight / 2;\n }\n\n // The final offset is the option's offset from the top, adjusted for the height difference,\n // multiplied by -1 to ensure that the overlay moves in the correct direction up the page.\n // The value is rounded to prevent some browsers from blurring the content.\n return Math.round(optionOffsetFromPanelTop * -1 - optionHeightAdjustment);\n }\n\n /**\n * Checks that the attempted overlay position will fit within the viewport.\n * If it will not fit, tries to adjust the scroll position and the associated\n * y-offset so the panel can open fully on-screen. If it still won't fit,\n * sets the offset back to 0 to allow the fallback position to take over.\n */\n private _checkOverlayWithinViewport(maxScroll: number): void {\n const itemHeight = this._getItemHeight();\n const viewportSize = this._viewportRuler.getViewportSize();\n\n const topSpaceAvailable = this._triggerRect.top - SELECT_PANEL_VIEWPORT_PADDING;\n const bottomSpaceAvailable =\n viewportSize.height - this._triggerRect.bottom - SELECT_PANEL_VIEWPORT_PADDING;\n\n const panelHeightTop = Math.abs(this._offsetY);\n const totalPanelHeight = Math.min(this._getItemCount() * itemHeight, SELECT_PANEL_MAX_HEIGHT);\n const panelHeightBottom = totalPanelHeight - panelHeightTop - this._triggerRect.height;\n\n if (panelHeightBottom > bottomSpaceAvailable) {\n this._adjustPanelUp(panelHeightBottom, bottomSpaceAvailable);\n } else if (panelHeightTop > topSpaceAvailable) {\n this._adjustPanelDown(panelHeightTop, topSpaceAvailable, maxScroll);\n } else {\n this._transformOrigin = this._getOriginBasedOnOption();\n }\n }\n\n /** Adjusts the overlay panel up to fit in the viewport. */\n private _adjustPanelUp(panelHeightBottom: number, bottomSpaceAvailable: number) {\n // Browsers ignore fractional scroll offsets, so we need to round.\n const distanceBelowViewport = Math.round(panelHeightBottom - bottomSpaceAvailable);\n\n // Scrolls the panel up by the distance it was extending past the boundary, then\n // adjusts the offset by that amount to move the panel up into the viewport.\n this._scrollTop -= distanceBelowViewport;\n this._offsetY -= distanceBelowViewport;\n this._transformOrigin = this._getOriginBasedOnOption();\n\n // If the panel is scrolled to the very top, it won't be able to fit the panel\n // by scrolling, so set the offset to 0 to allow the fallback position to take\n // effect.\n if (this._scrollTop <= 0) {\n this._scrollTop = 0;\n this._offsetY = 0;\n this._transformOrigin = `50% bottom 0px`;\n }\n }\n\n /** Adjusts the overlay panel down to fit in the viewport. */\n private _adjustPanelDown(panelHeightTop: number, topSpaceAvailable: number, maxScroll: number) {\n // Browsers ignore fractional scroll offsets, so we need to round.\n const distanceAboveViewport = Math.round(panelHeightTop - topSpaceAvailable);\n\n // Scrolls the panel down by the distance it was extending past the boundary, then\n // adjusts the offset by that amount to move the panel down into the viewport.\n this._scrollTop += distanceAboveViewport;\n this._offsetY += distanceAboveViewport;\n this._transformOrigin = this._getOriginBasedOnOption();\n\n // If the panel is scrolled to the very bottom, it won't be able to fit the\n // panel by scrolling, so set the offset to 0 to allow the fallback position\n // to take effect.\n if (this._scrollTop >= maxScroll) {\n this._scrollTop = maxScroll;\n this._offsetY = 0;\n this._transformOrigin = `50% top 0px`;\n return;\n }\n }\n\n /** Calculates the scroll position and x- and y-offsets of the overlay panel. */\n private _calculateOverlayPosition(): void {\n const itemHeight = this._getItemHeight();\n const items = this._getItemCount();\n const panelHeight = Math.min(items * itemHeight, SELECT_PANEL_MAX_HEIGHT);\n const scrollContainerHeight = items * itemHeight;\n\n // The farthest the panel can be scrolled before it hits the bottom\n const maxScroll = scrollContainerHeight - panelHeight;\n\n // If no value is selected we open the popup to the first item.\n let selectedOptionOffset: number;\n\n if (this.empty) {\n selectedOptionOffset = 0;\n } else {\n selectedOptionOffset = Math.max(\n this.options.toArray().indexOf(this._selectionModel.selected[0]),\n 0,\n );\n }\n\n selectedOptionOffset += _countGroupLabelsBeforeLegacyOption(\n selectedOptionOffset,\n this.options,\n this.optionGroups,\n );\n\n // We must maintain a scroll buffer so the selected option will be scrolled to the\n // center of the overlay panel rather than the top.\n const scrollBuffer = panelHeight / 2;\n this._scrollTop = this._calculateOverlayScroll(selectedOptionOffset, scrollBuffer, maxScroll);\n this._offsetY = this._calculateOverlayOffsetY(selectedOptionOffset, scrollBuffer, maxScroll);\n\n this._checkOverlayWithinViewport(maxScroll);\n }\n\n /** Sets the transform origin point based on the selected option. */\n private _getOriginBasedOnOption(): string {\n const itemHeight = this._getItemHeight();\n const optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;\n const originY = Math.abs(this._offsetY) - optionHeightAdjustment + itemHeight / 2;\n return `50% ${originY}px 0px`;\n }\n\n /** Calculates the height of the select's options. */\n private _getItemHeight(): number {\n return this._triggerFontSize * SELECT_ITEM_HEIGHT_EM;\n }\n\n /** Calculates the amount of items in the select. This includes options and group labels. */\n private _getItemCount(): number {\n return this.options.length + this.optionGroups.length;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatLegacyOptionModule} from '@angular/material/legacy-core';\nimport {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';\nimport {CdkScrollableModule} from '@angular/cdk/scrolling';\nimport {MAT_SELECT_SCROLL_STRATEGY_PROVIDER} from '@angular/material/select';\nimport {MatLegacySelect, MatLegacySelectTrigger} from './select';\n\n/**\n * @deprecated Use `MatSelectModule` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [CommonModule, OverlayModule, MatLegacyOptionModule, MatCommonModule],\n exports: [\n CdkScrollableModule,\n MatLegacyFormFieldModule,\n MatLegacySelect,\n MatLegacySelectTrigger,\n MatLegacyOptionModule,\n MatCommonModule,\n ],\n declarations: [MatLegacySelect, MatLegacySelectTrigger],\n providers: [MAT_SELECT_SCROLL_STRATEGY_PROVIDER],\n})\nexport class MatLegacySelectModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatLegacyButtonModule} from '@angular/material/legacy-button';\nimport {LegacySimpleSnackBar} from './simple-snack-bar';\nimport {MatLegacySnackBarContainer} from './snack-bar-container';\n\n/**\n * @deprecated Use `MatSnackBarModule` from `@angular/material/snack-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [OverlayModule, PortalModule, CommonModule, MatLegacyButtonModule, MatCommonModule],\n exports: [MatLegacySnackBarContainer, MatCommonModule],\n declarations: [MatLegacySnackBarContainer, LegacySimpleSnackBar],\n})\nexport class MatLegacySnackBarModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectionStrategy, Component, Inject, ViewEncapsulation} from '@angular/core';\nimport {TextOnlySnackBar, MatSnackBarRef, MAT_SNACK_BAR_DATA} from '@angular/material/snack-bar';\n\n/**\n * A component used to open as the default snack bar, matching material spec.\n * This should only be used internally by the snack bar service.\n * @deprecated Use `SimpleSnackBar` from `@angular/material/snack-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'simple-snack-bar',\n templateUrl: 'simple-snack-bar.html',\n styleUrls: ['simple-snack-bar.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'mat-simple-snackbar',\n },\n})\nexport class LegacySimpleSnackBar implements TextOnlySnackBar {\n /** Data that was injected into the snack bar. */\n data: {message: string; action: string};\n\n constructor(\n public snackBarRef: MatSnackBarRef<LegacySimpleSnackBar>,\n @Inject(MAT_SNACK_BAR_DATA) data: any,\n ) {\n this.data = data;\n }\n\n /** Performs the action on the snack bar. */\n action(): void {\n this.snackBarRef.dismissWithAction();\n }\n\n /** If the action button should be shown. */\n get hasAction(): boolean {\n return !!this.data.action;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {\n HeaderRowOutlet,\n DataRowOutlet,\n CdkTable,\n CdkRecycleRows,\n FooterRowOutlet,\n NoDataRowOutlet,\n} from './table';\nimport {\n CdkCellOutlet,\n CdkFooterRow,\n CdkFooterRowDef,\n CdkHeaderRow,\n CdkHeaderRowDef,\n CdkRow,\n CdkRowDef,\n CdkNoDataRow,\n} from './row';\nimport {\n CdkColumnDef,\n CdkHeaderCellDef,\n CdkHeaderCell,\n CdkCell,\n CdkCellDef,\n CdkFooterCellDef,\n CdkFooterCell,\n} from './cell';\nimport {CdkTextColumn} from './text-column';\nimport {ScrollingModule} from '@angular/cdk/scrolling';\n\nconst EXPORTED_DECLARATIONS = [\n CdkTable,\n CdkRowDef,\n CdkCellDef,\n CdkCellOutlet,\n CdkHeaderCellDef,\n CdkFooterCellDef,\n CdkColumnDef,\n CdkCell,\n CdkRow,\n CdkHeaderCell,\n CdkFooterCell,\n CdkHeaderRow,\n CdkHeaderRowDef,\n CdkFooterRow,\n CdkFooterRowDef,\n DataRowOutlet,\n HeaderRowOutlet,\n FooterRowOutlet,\n CdkTextColumn,\n CdkNoDataRow,\n CdkRecycleRows,\n NoDataRowOutlet,\n];\n\n@NgModule({\n exports: EXPORTED_DECLARATIONS,\n declarations: EXPORTED_DECLARATIONS,\n imports: [ScrollingModule],\n})\nexport class CdkTableModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatLegacyRecycleRows, MatLegacyTable} from './table';\nimport {CdkTableModule} from '@angular/cdk/table';\nimport {\n MatLegacyCell,\n MatLegacyCellDef,\n MatLegacyColumnDef,\n MatLegacyFooterCell,\n MatLegacyFooterCellDef,\n MatLegacyHeaderCell,\n MatLegacyHeaderCellDef,\n} from './cell';\nimport {\n MatLegacyFooterRow,\n MatLegacyFooterRowDef,\n MatLegacyHeaderRow,\n MatLegacyHeaderRowDef,\n MatLegacyRow,\n MatLegacyRowDef,\n MatLegacyNoDataRow,\n} from './row';\nimport {MatLegacyTextColumn} from './text-column';\nimport {MatCommonModule} from '@angular/material/core';\n\nconst EXPORTED_DECLARATIONS = [\n // Table\n MatLegacyTable,\n MatLegacyRecycleRows,\n\n // Template defs\n MatLegacyHeaderCellDef,\n MatLegacyHeaderRowDef,\n MatLegacyColumnDef,\n MatLegacyCellDef,\n MatLegacyRowDef,\n MatLegacyFooterCellDef,\n MatLegacyFooterRowDef,\n\n // Cell directives\n MatLegacyHeaderCell,\n MatLegacyCell,\n MatLegacyFooterCell,\n\n // Row directives\n MatLegacyHeaderRow,\n MatLegacyRow,\n MatLegacyFooterRow,\n MatLegacyNoDataRow,\n\n MatLegacyTextColumn,\n];\n\n/**\n * @deprecated Use `MatTableModule` from `@angular/material/table` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [CdkTableModule, MatCommonModule],\n exports: [MatCommonModule, EXPORTED_DECLARATIONS],\n declarations: EXPORTED_DECLARATIONS,\n})\nexport class MatLegacyTableModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {take, takeUntil} from 'rxjs/operators';\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n Inject,\n InjectionToken,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {normalizePassiveListenerOptions, Platform} from '@angular/cdk/platform';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {AriaDescriber, FocusMonitor} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n ComponentType,\n ConnectedPosition,\n ConnectionPositionPair,\n FlexibleConnectedPositionStrategy,\n HorizontalConnectionPos,\n OriginConnectionPosition,\n Overlay,\n OverlayConnectionPosition,\n OverlayRef,\n ScrollDispatcher,\n ScrollStrategy,\n VerticalConnectionPos,\n} from '@angular/cdk/overlay';\nimport {ComponentPortal} from '@angular/cdk/portal';\nimport {Observable, Subject} from 'rxjs';\n\n/** Possible positions for a tooltip. */\nexport type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after';\n\n/**\n * Options for how the tooltip trigger should handle touch gestures.\n * See `MatTooltip.touchGestures` for more information.\n */\nexport type TooltipTouchGestures = 'auto' | 'on' | 'off';\n\n/** Possible visibility states of a tooltip. */\nexport type TooltipVisibility = 'initial' | 'visible' | 'hidden';\n\n/** Time in ms to throttle repositioning after scroll events. */\nexport const SCROLL_THROTTLE_MS = 20;\n\n/**\n * Creates an error to be thrown if the user supplied an invalid tooltip position.\n * @docs-private\n */\nexport function getMatTooltipInvalidPositionError(position: string) {\n return Error(`Tooltip position \"${position}\" is invalid.`);\n}\n\n/** Injection token that determines the scroll handling while a tooltip is visible. */\nexport const MAT_TOOLTIP_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'mat-tooltip-scroll-strategy',\n);\n\n/** @docs-private */\nexport function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy {\n return () => overlay.scrollStrategies.reposition({scrollThrottle: SCROLL_THROTTLE_MS});\n}\n\n/** @docs-private */\nexport const MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER = {\n provide: MAT_TOOLTIP_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY,\n};\n\n/** @docs-private */\nexport function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY(): MatTooltipDefaultOptions {\n return {\n showDelay: 0,\n hideDelay: 0,\n touchendHideDelay: 1500,\n };\n}\n\n/** Injection token to be used to override the default options for `matTooltip`. */\nexport const MAT_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken<MatTooltipDefaultOptions>(\n 'mat-tooltip-default-options',\n {\n providedIn: 'root',\n factory: MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY,\n },\n);\n\n/** Default `matTooltip` options that can be overridden. */\nexport interface MatTooltipDefaultOptions {\n /** Default delay when the tooltip is shown. */\n showDelay: number;\n\n /** Default delay when the tooltip is hidden. */\n hideDelay: number;\n\n /** Default delay when hiding the tooltip on a touch device. */\n touchendHideDelay: number;\n\n /** Default touch gesture handling for tooltips. */\n touchGestures?: TooltipTouchGestures;\n\n /** Default position for tooltips. */\n position?: TooltipPosition;\n\n /**\n * Default value for whether tooltips should be positioned near the click or touch origin\n * instead of outside the element bounding box.\n */\n positionAtOrigin?: boolean;\n\n /** Disables the ability for the user to interact with the tooltip element. */\n disableTooltipInteractivity?: boolean;\n}\n\n/**\n * CSS class that will be attached to the overlay panel.\n * @deprecated\n * @breaking-change 13.0.0 remove this variable\n */\nexport const TOOLTIP_PANEL_CLASS = 'mat-mdc-tooltip-panel';\n\nconst PANEL_CLASS = 'tooltip-panel';\n\n/** Options used to bind passive event listeners. */\nconst passiveListenerOptions = normalizePassiveListenerOptions({passive: true});\n\n/**\n * Time between the user putting the pointer on a tooltip\n * trigger and the long press event being fired.\n */\nconst LONGPRESS_DELAY = 500;\n\n// These constants were taken from MDC's `numbers` object. We can't import them from MDC,\n// because they have some top-level references to `window` which break during SSR.\nconst MIN_VIEWPORT_TOOLTIP_THRESHOLD = 8;\nconst UNBOUNDED_ANCHOR_GAP = 8;\nconst MIN_HEIGHT = 24;\nconst MAX_WIDTH = 200;\n\n@Directive()\nexport abstract class _MatTooltipBase<T extends _TooltipComponentBase>\n implements OnDestroy, AfterViewInit\n{\n _overlayRef: OverlayRef | null;\n _tooltipInstance: T | null;\n\n private _portal: ComponentPortal<T>;\n private _position: TooltipPosition = 'below';\n private _positionAtOrigin: boolean = false;\n private _disabled: boolean = false;\n private _tooltipClass: string | string[] | Set<string> | {[key: string]: any};\n private _scrollStrategy: () => ScrollStrategy;\n private _viewInitialized = false;\n private _pointerExitEventsInitialized = false;\n protected abstract readonly _tooltipComponent: ComponentType<T>;\n protected _viewportMargin = 8;\n private _currentPosition: TooltipPosition;\n protected readonly _cssClassPrefix: string = 'mat';\n\n /** Allows the user to define the position of the tooltip relative to the parent element */\n @Input('matTooltipPosition')\n get position(): TooltipPosition {\n return this._position;\n }\n\n set position(value: TooltipPosition) {\n if (value !== this._position) {\n this._position = value;\n\n if (this._overlayRef) {\n this._updatePosition(this._overlayRef);\n this._tooltipInstance?.show(0);\n this._overlayRef.updatePosition();\n }\n }\n }\n\n @Input('matTooltipPositionAtOrigin')\n get positionAtOrigin(): boolean {\n return this._positionAtOrigin;\n }\n set positionAtOrigin(value: BooleanInput) {\n this._positionAtOrigin = coerceBooleanProperty(value);\n this._detach();\n this._overlayRef = null;\n }\n\n /** Disables the display of the tooltip. */\n @Input('matTooltipDisabled')\n get disabled(): boolean {\n return this._disabled;\n }\n\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n\n // If tooltip is disabled, hide immediately.\n if (this._disabled) {\n this.hide(0);\n } else {\n this._setupPointerEnterEventsIfNeeded();\n }\n }\n\n /** The default delay in ms before showing the tooltip after show is called */\n @Input('matTooltipShowDelay')\n get showDelay(): number {\n return this._showDelay;\n }\n\n set showDelay(value: NumberInput) {\n this._showDelay = coerceNumberProperty(value);\n }\n\n private _showDelay = this._defaultOptions.showDelay;\n\n /** The default delay in ms before hiding the tooltip after hide is called */\n @Input('matTooltipHideDelay')\n get hideDelay(): number {\n return this._hideDelay;\n }\n\n set hideDelay(value: NumberInput) {\n this._hideDelay = coerceNumberProperty(value);\n\n if (this._tooltipInstance) {\n this._tooltipInstance._mouseLeaveHideDelay = this._hideDelay;\n }\n }\n\n private _hideDelay = this._defaultOptions.hideDelay;\n\n /**\n * How touch gestures should be handled by the tooltip. On touch devices the tooltip directive\n * uses a long press gesture to show and hide, however it can conflict with the native browser\n * gestures. To work around the conflict, Angular Material disables native gestures on the\n * trigger, but that might not be desirable on particular elements (e.g. inputs and draggable\n * elements). The different values for this option configure the touch event handling as follows:\n * - `auto` - Enables touch gestures for all elements, but tries to avoid conflicts with native\n * browser gestures on particular elements. In particular, it allows text selection on inputs\n * and textareas, and preserves the native browser dragging on elements marked as `draggable`.\n * - `on` - Enables touch gestures for all elements and disables native\n * browser gestures with no exceptions.\n * - `off` - Disables touch gestures. Note that this will prevent the tooltip from\n * showing on touch devices.\n */\n @Input('matTooltipTouchGestures') touchGestures: TooltipTouchGestures = 'auto';\n\n /** The message to be displayed in the tooltip */\n @Input('matTooltip')\n get message() {\n return this._message;\n }\n\n set message(value: string) {\n this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message, 'tooltip');\n\n // If the message is not a string (e.g. number), convert it to a string and trim it.\n // Must convert with `String(value)`, not `${value}`, otherwise Closure Compiler optimises\n // away the string-conversion: https://github.com/angular/components/issues/20684\n this._message = value != null ? String(value).trim() : '';\n\n if (!this._message && this._isTooltipVisible()) {\n this.hide(0);\n } else {\n this._setupPointerEnterEventsIfNeeded();\n this._updateTooltipMessage();\n this._ngZone.runOutsideAngular(() => {\n // The `AriaDescriber` has some functionality that avoids adding a description if it's the\n // same as the `aria-label` of an element, however we can't know whether the tooltip trigger\n // has a data-bound `aria-label` or when it'll be set for the first time. We can avoid the\n // issue by deferring the description by a tick so Angular has time to set the `aria-label`.\n Promise.resolve().then(() => {\n this._ariaDescriber.describe(this._elementRef.nativeElement, this.message, 'tooltip');\n });\n });\n }\n }\n\n private _message = '';\n\n /** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */\n @Input('matTooltipClass')\n get tooltipClass() {\n return this._tooltipClass;\n }\n\n set tooltipClass(value: string | string[] | Set<string> | {[key: string]: any}) {\n this._tooltipClass = value;\n if (this._tooltipInstance) {\n this._setTooltipClass(this._tooltipClass);\n }\n }\n\n /** Manually-bound passive event listeners. */\n private readonly _passiveListeners: (readonly [string, EventListenerOrEventListenerObject])[] =\n [];\n\n /** Reference to the current document. */\n private _document: Document;\n\n /** Timer started at the last `touchstart` event. */\n private _touchstartTimeout: number;\n\n /** Emits when the component is destroyed. */\n private readonly _destroyed = new Subject<void>();\n\n constructor(\n private _overlay: Overlay,\n private _elementRef: ElementRef<HTMLElement>,\n private _scrollDispatcher: ScrollDispatcher,\n private _viewContainerRef: ViewContainerRef,\n private _ngZone: NgZone,\n private _platform: Platform,\n private _ariaDescriber: AriaDescriber,\n private _focusMonitor: FocusMonitor,\n scrollStrategy: any,\n protected _dir: Directionality,\n private _defaultOptions: MatTooltipDefaultOptions,\n @Inject(DOCUMENT) _document: any,\n ) {\n this._scrollStrategy = scrollStrategy;\n this._document = _document;\n\n if (_defaultOptions) {\n if (_defaultOptions.position) {\n this.position = _defaultOptions.position;\n }\n\n if (_defaultOptions.positionAtOrigin) {\n this.positionAtOrigin = _defaultOptions.positionAtOrigin;\n }\n\n if (_defaultOptions.touchGestures) {\n this.touchGestures = _defaultOptions.touchGestures;\n }\n }\n\n _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (this._overlayRef) {\n this._updatePosition(this._overlayRef);\n }\n });\n }\n\n ngAfterViewInit() {\n // This needs to happen after view init so the initial values for all inputs have been set.\n this._viewInitialized = true;\n this._setupPointerEnterEventsIfNeeded();\n\n this._focusMonitor\n .monitor(this._elementRef)\n .pipe(takeUntil(this._destroyed))\n .subscribe(origin => {\n // Note that the focus monitor runs outside the Angular zone.\n if (!origin) {\n this._ngZone.run(() => this.hide(0));\n } else if (origin === 'keyboard') {\n this._ngZone.run(() => this.show());\n }\n });\n }\n\n /**\n * Dispose the tooltip when destroyed.\n */\n ngOnDestroy() {\n const nativeElement = this._elementRef.nativeElement;\n\n clearTimeout(this._touchstartTimeout);\n\n if (this._overlayRef) {\n this._overlayRef.dispose();\n this._tooltipInstance = null;\n }\n\n // Clean up the event listeners set in the constructor\n this._passiveListeners.forEach(([event, listener]) => {\n nativeElement.removeEventListener(event, listener, passiveListenerOptions);\n });\n this._passiveListeners.length = 0;\n\n this._destroyed.next();\n this._destroyed.complete();\n\n this._ariaDescriber.removeDescription(nativeElement, this.message, 'tooltip');\n this._focusMonitor.stopMonitoring(nativeElement);\n }\n\n /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */\n show(delay: number = this.showDelay, origin?: {x: number; y: number}): void {\n if (this.disabled || !this.message || this._isTooltipVisible()) {\n this._tooltipInstance?._cancelPendingAnimations();\n return;\n }\n\n const overlayRef = this._createOverlay(origin);\n this._detach();\n this._portal =\n this._portal || new ComponentPortal(this._tooltipComponent, this._viewContainerRef);\n const instance = (this._tooltipInstance = overlayRef.attach(this._portal).instance);\n instance._triggerElement = this._elementRef.nativeElement;\n instance._mouseLeaveHideDelay = this._hideDelay;\n instance\n .afterHidden()\n .pipe(takeUntil(this._destroyed))\n .subscribe(() => this._detach());\n this._setTooltipClass(this._tooltipClass);\n this._updateTooltipMessage();\n instance.show(delay);\n }\n\n /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */\n hide(delay: number = this.hideDelay): void {\n const instance = this._tooltipInstance;\n\n if (instance) {\n if (instance.isVisible()) {\n instance.hide(delay);\n } else {\n instance._cancelPendingAnimations();\n this._detach();\n }\n }\n }\n\n /** Shows/hides the tooltip */\n toggle(origin?: {x: number; y: number}): void {\n this._isTooltipVisible() ? this.hide() : this.show(undefined, origin);\n }\n\n /** Returns true if the tooltip is currently visible to the user */\n _isTooltipVisible(): boolean {\n return !!this._tooltipInstance && this._tooltipInstance.isVisible();\n }\n\n /** Create the overlay config and position strategy */\n private _createOverlay(origin?: {x: number; y: number}): OverlayRef {\n if (this._overlayRef) {\n const existingStrategy = this._overlayRef.getConfig()\n .positionStrategy as FlexibleConnectedPositionStrategy;\n\n if ((!this.positionAtOrigin || !origin) && existingStrategy._origin instanceof ElementRef) {\n return this._overlayRef;\n }\n\n this._detach();\n }\n\n const scrollableAncestors = this._scrollDispatcher.getAncestorScrollContainers(\n this._elementRef,\n );\n\n // Create connected position strategy that listens for scroll events to reposition.\n const strategy = this._overlay\n .position()\n .flexibleConnectedTo(this.positionAtOrigin ? origin || this._elementRef : this._elementRef)\n .withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`)\n .withFlexibleDimensions(false)\n .withViewportMargin(this._viewportMargin)\n .withScrollableContainers(scrollableAncestors);\n\n strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe(change => {\n this._updateCurrentPositionClass(change.connectionPair);\n\n if (this._tooltipInstance) {\n if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance.isVisible()) {\n // After position changes occur and the overlay is clipped by\n // a parent scrollable then close the tooltip.\n this._ngZone.run(() => this.hide(0));\n }\n }\n });\n\n this._overlayRef = this._overlay.create({\n direction: this._dir,\n positionStrategy: strategy,\n panelClass: `${this._cssClassPrefix}-${PANEL_CLASS}`,\n scrollStrategy: this._scrollStrategy(),\n });\n\n this._updatePosition(this._overlayRef);\n\n this._overlayRef\n .detachments()\n .pipe(takeUntil(this._destroyed))\n .subscribe(() => this._detach());\n\n this._overlayRef\n .outsidePointerEvents()\n .pipe(takeUntil(this._destroyed))\n .subscribe(() => this._tooltipInstance?._handleBodyInteraction());\n\n this._overlayRef\n .keydownEvents()\n .pipe(takeUntil(this._destroyed))\n .subscribe(event => {\n if (this._isTooltipVisible() && event.keyCode === ESCAPE && !hasModifierKey(event)) {\n event.preventDefault();\n event.stopPropagation();\n this._ngZone.run(() => this.hide(0));\n }\n });\n\n if (this._defaultOptions?.disableTooltipInteractivity) {\n this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`);\n }\n\n return this._overlayRef;\n }\n\n /** Detaches the currently-attached tooltip. */\n private _detach() {\n if (this._overlayRef && this._overlayRef.hasAttached()) {\n this._overlayRef.detach();\n }\n\n this._tooltipInstance = null;\n }\n\n /** Updates the position of the current tooltip. */\n private _updatePosition(overlayRef: OverlayRef) {\n const position = overlayRef.getConfig().positionStrategy as FlexibleConnectedPositionStrategy;\n const origin = this._getOrigin();\n const overlay = this._getOverlayPosition();\n\n position.withPositions([\n this._addOffset({...origin.main, ...overlay.main}),\n this._addOffset({...origin.fallback, ...overlay.fallback}),\n ]);\n }\n\n /** Adds the configured offset to a position. Used as a hook for child classes. */\n protected _addOffset(position: ConnectedPosition): ConnectedPosition {\n return position;\n }\n\n /**\n * Returns the origin position and a fallback position based on the user's position preference.\n * The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).\n */\n _getOrigin(): {main: OriginConnectionPosition; fallback: OriginConnectionPosition} {\n const isLtr = !this._dir || this._dir.value == 'ltr';\n const position = this.position;\n let originPosition: OriginConnectionPosition;\n\n if (position == 'above' || position == 'below') {\n originPosition = {originX: 'center', originY: position == 'above' ? 'top' : 'bottom'};\n } else if (\n position == 'before' ||\n (position == 'left' && isLtr) ||\n (position == 'right' && !isLtr)\n ) {\n originPosition = {originX: 'start', originY: 'center'};\n } else if (\n position == 'after' ||\n (position == 'right' && isLtr) ||\n (position == 'left' && !isLtr)\n ) {\n originPosition = {originX: 'end', originY: 'center'};\n } else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw getMatTooltipInvalidPositionError(position);\n }\n\n const {x, y} = this._invertPosition(originPosition!.originX, originPosition!.originY);\n\n return {\n main: originPosition!,\n fallback: {originX: x, originY: y},\n };\n }\n\n /** Returns the overlay position and a fallback position based on the user's preference */\n _getOverlayPosition(): {main: OverlayConnectionPosition; fallback: OverlayConnectionPosition} {\n const isLtr = !this._dir || this._dir.value == 'ltr';\n const position = this.position;\n let overlayPosition: OverlayConnectionPosition;\n\n if (position == 'above') {\n overlayPosition = {overlayX: 'center', overlayY: 'bottom'};\n } else if (position == 'below') {\n overlayPosition = {overlayX: 'center', overlayY: 'top'};\n } else if (\n position == 'before' ||\n (position == 'left' && isLtr) ||\n (position == 'right' && !isLtr)\n ) {\n overlayPosition = {overlayX: 'end', overlayY: 'center'};\n } else if (\n position == 'after' ||\n (position == 'right' && isLtr) ||\n (position == 'left' && !isLtr)\n ) {\n overlayPosition = {overlayX: 'start', overlayY: 'center'};\n } else if (typeof ngDevMode === 'undefined' || ngDevMode) {\n throw getMatTooltipInvalidPositionError(position);\n }\n\n const {x, y} = this._invertPosition(overlayPosition!.overlayX, overlayPosition!.overlayY);\n\n return {\n main: overlayPosition!,\n fallback: {overlayX: x, overlayY: y},\n };\n }\n\n /** Updates the tooltip message and repositions the overlay according to the new message length */\n private _updateTooltipMessage() {\n // Must wait for the message to be painted to the tooltip so that the overlay can properly\n // calculate the correct positioning based on the size of the text.\n if (this._tooltipInstance) {\n this._tooltipInstance.message = this.message;\n this._tooltipInstance._markForCheck();\n\n this._ngZone.onMicrotaskEmpty.pipe(take(1), takeUntil(this._destroyed)).subscribe(() => {\n if (this._tooltipInstance) {\n this._overlayRef!.updatePosition();\n }\n });\n }\n }\n\n /** Updates the tooltip class */\n private _setTooltipClass(tooltipClass: string | string[] | Set<string> | {[key: string]: any}) {\n if (this._tooltipInstance) {\n this._tooltipInstance.tooltipClass = tooltipClass;\n this._tooltipInstance._markForCheck();\n }\n }\n\n /** Inverts an overlay position. */\n private _invertPosition(x: HorizontalConnectionPos, y: VerticalConnectionPos) {\n if (this.position === 'above' || this.position === 'below') {\n if (y === 'top') {\n y = 'bottom';\n } else if (y === 'bottom') {\n y = 'top';\n }\n } else {\n if (x === 'end') {\n x = 'start';\n } else if (x === 'start') {\n x = 'end';\n }\n }\n\n return {x, y};\n }\n\n /** Updates the class on the overlay panel based on the current position of the tooltip. */\n private _updateCurrentPositionClass(connectionPair: ConnectionPositionPair): void {\n const {overlayY, originX, originY} = connectionPair;\n let newPosition: TooltipPosition;\n\n // If the overlay is in the middle along the Y axis,\n // it means that it's either before or after.\n if (overlayY === 'center') {\n // Note that since this information is used for styling, we want to\n // resolve `start` and `end` to their real values, otherwise consumers\n // would have to remember to do it themselves on each consumption.\n if (this._dir && this._dir.value === 'rtl') {\n newPosition = originX === 'end' ? 'left' : 'right';\n } else {\n newPosition = originX === 'start' ? 'left' : 'right';\n }\n } else {\n newPosition = overlayY === 'bottom' && originY === 'top' ? 'above' : 'below';\n }\n\n if (newPosition !== this._currentPosition) {\n const overlayRef = this._overlayRef;\n\n if (overlayRef) {\n const classPrefix = `${this._cssClassPrefix}-${PANEL_CLASS}-`;\n overlayRef.removePanelClass(classPrefix + this._currentPosition);\n overlayRef.addPanelClass(classPrefix + newPosition);\n }\n\n this._currentPosition = newPosition;\n }\n }\n\n /** Binds the pointer events to the tooltip trigger. */\n private _setupPointerEnterEventsIfNeeded() {\n // Optimization: Defer hooking up events if there's no message or the tooltip is disabled.\n if (\n this._disabled ||\n !this.message ||\n !this._viewInitialized ||\n this._passiveListeners.length\n ) {\n return;\n }\n\n // The mouse events shouldn't be bound on mobile devices, because they can prevent the\n // first tap from firing its click event or can cause the tooltip to open for clicks.\n if (this._platformSupportsMouseEvents()) {\n this._passiveListeners.push([\n 'mouseenter',\n event => {\n this._setupPointerExitEventsIfNeeded();\n let point = undefined;\n if ((event as MouseEvent).x !== undefined && (event as MouseEvent).y !== undefined) {\n point = event as MouseEvent;\n }\n this.show(undefined, point);\n },\n ]);\n } else if (this.touchGestures !== 'off') {\n this._disableNativeGesturesIfNecessary();\n\n this._passiveListeners.push([\n 'touchstart',\n event => {\n const touch = (event as TouchEvent).targetTouches?.[0];\n const origin = touch ? {x: touch.clientX, y: touch.clientY} : undefined;\n // Note that it's important that we don't `preventDefault` here,\n // because it can prevent click events from firing on the element.\n this._setupPointerExitEventsIfNeeded();\n clearTimeout(this._touchstartTimeout);\n this._touchstartTimeout = setTimeout(() => this.show(undefined, origin), LONGPRESS_DELAY);\n },\n ]);\n }\n\n this._addListeners(this._passiveListeners);\n }\n\n private _setupPointerExitEventsIfNeeded() {\n if (this._pointerExitEventsInitialized) {\n return;\n }\n this._pointerExitEventsInitialized = true;\n\n const exitListeners: (readonly [string, EventListenerOrEventListenerObject])[] = [];\n if (this._platformSupportsMouseEvents()) {\n exitListeners.push(\n [\n 'mouseleave',\n event => {\n const newTarget = (event as MouseEvent).relatedTarget as Node | null;\n if (!newTarget || !this._overlayRef?.overlayElement.contains(newTarget)) {\n this.hide();\n }\n },\n ],\n ['wheel', event => this._wheelListener(event as WheelEvent)],\n );\n } else if (this.touchGestures !== 'off') {\n this._disableNativeGesturesIfNecessary();\n const touchendListener = () => {\n clearTimeout(this._touchstartTimeout);\n this.hide(this._defaultOptions.touchendHideDelay);\n };\n\n exitListeners.push(['touchend', touchendListener], ['touchcancel', touchendListener]);\n }\n\n this._addListeners(exitListeners);\n this._passiveListeners.push(...exitListeners);\n }\n\n private _addListeners(listeners: (readonly [string, EventListenerOrEventListenerObject])[]) {\n listeners.forEach(([event, listener]) => {\n this._elementRef.nativeElement.addEventListener(event, listener, passiveListenerOptions);\n });\n }\n\n private _platformSupportsMouseEvents() {\n return !this._platform.IOS && !this._platform.ANDROID;\n }\n\n /** Listener for the `wheel` event on the element. */\n private _wheelListener(event: WheelEvent) {\n if (this._isTooltipVisible()) {\n const elementUnderPointer = this._document.elementFromPoint(event.clientX, event.clientY);\n const element = this._elementRef.nativeElement;\n\n // On non-touch devices we depend on the `mouseleave` event to close the tooltip, but it\n // won't fire if the user scrolls away using the wheel without moving their cursor. We\n // work around it by finding the element under the user's cursor and closing the tooltip\n // if it's not the trigger.\n if (elementUnderPointer !== element && !element.contains(elementUnderPointer)) {\n this.hide();\n }\n }\n }\n\n /** Disables the native browser gestures, based on how the tooltip has been configured. */\n private _disableNativeGesturesIfNecessary() {\n const gestures = this.touchGestures;\n\n if (gestures !== 'off') {\n const element = this._elementRef.nativeElement;\n const style = element.style;\n\n // If gestures are set to `auto`, we don't disable text selection on inputs and\n // textareas, because it prevents the user from typing into them on iOS Safari.\n if (gestures === 'on' || (element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA')) {\n style.userSelect =\n (style as any).msUserSelect =\n style.webkitUserSelect =\n (style as any).MozUserSelect =\n 'none';\n }\n\n // If we have `auto` gestures and the element uses native HTML dragging,\n // we don't set `-webkit-user-drag` because it prevents the native behavior.\n if (gestures === 'on' || !element.draggable) {\n (style as any).webkitUserDrag = 'none';\n }\n\n style.touchAction = 'none';\n (style as any).webkitTapHighlightColor = 'transparent';\n }\n }\n}\n\n/**\n * Directive that attaches a material design tooltip to the host element. Animates the showing and\n * hiding of a tooltip provided position (defaults to below the element).\n *\n * https://material.io/design/components/tooltips.html\n */\n@Directive({\n selector: '[matTooltip]',\n exportAs: 'matTooltip',\n host: {\n 'class': 'mat-mdc-tooltip-trigger',\n },\n})\nexport class MatTooltip extends _MatTooltipBase<TooltipComponent> {\n protected override readonly _tooltipComponent = TooltipComponent;\n protected override readonly _cssClassPrefix = 'mat-mdc';\n\n constructor(\n overlay: Overlay,\n elementRef: ElementRef<HTMLElement>,\n scrollDispatcher: ScrollDispatcher,\n viewContainerRef: ViewContainerRef,\n ngZone: NgZone,\n platform: Platform,\n ariaDescriber: AriaDescriber,\n focusMonitor: FocusMonitor,\n @Inject(MAT_TOOLTIP_SCROLL_STRATEGY) scrollStrategy: any,\n @Optional() dir: Directionality,\n @Optional() @Inject(MAT_TOOLTIP_DEFAULT_OPTIONS) defaultOptions: MatTooltipDefaultOptions,\n @Inject(DOCUMENT) _document: any,\n ) {\n super(\n overlay,\n elementRef,\n scrollDispatcher,\n viewContainerRef,\n ngZone,\n platform,\n ariaDescriber,\n focusMonitor,\n scrollStrategy,\n dir,\n defaultOptions,\n _document,\n );\n this._viewportMargin = MIN_VIEWPORT_TOOLTIP_THRESHOLD;\n }\n\n protected override _addOffset(position: ConnectedPosition): ConnectedPosition {\n const offset = UNBOUNDED_ANCHOR_GAP;\n const isLtr = !this._dir || this._dir.value == 'ltr';\n\n if (position.originY === 'top') {\n position.offsetY = -offset;\n } else if (position.originY === 'bottom') {\n position.offsetY = offset;\n } else if (position.originX === 'start') {\n position.offsetX = isLtr ? -offset : offset;\n } else if (position.originX === 'end') {\n position.offsetX = isLtr ? offset : -offset;\n }\n\n return position;\n }\n}\n\n@Directive()\nexport abstract class _TooltipComponentBase implements OnDestroy {\n /** Message to display in the tooltip */\n message: string;\n\n /** Classes to be added to the tooltip. Supports the same syntax as `ngClass`. */\n tooltipClass: string | string[] | Set<string> | {[key: string]: any};\n\n /** The timeout ID of any current timer set to show the tooltip */\n private _showTimeoutId: number | undefined;\n\n /** The timeout ID of any current timer set to hide the tooltip */\n private _hideTimeoutId: number | undefined;\n\n /** Element that caused the tooltip to open. */\n _triggerElement: HTMLElement;\n\n /** Amount of milliseconds to delay the closing sequence. */\n _mouseLeaveHideDelay: number;\n\n /** Whether animations are currently disabled. */\n private _animationsDisabled: boolean;\n\n /** Reference to the internal tooltip element. */\n abstract _tooltip: ElementRef<HTMLElement>;\n\n /** Whether interactions on the page should close the tooltip */\n private _closeOnInteraction = false;\n\n /** Whether the tooltip is currently visible. */\n private _isVisible = false;\n\n /** Subject for notifying that the tooltip has been hidden from the view */\n private readonly _onHide: Subject<void> = new Subject();\n\n /** Name of the show animation and the class that toggles it. */\n protected abstract readonly _showAnimation: string;\n\n /** Name of the hide animation and the class that toggles it. */\n protected abstract readonly _hideAnimation: string;\n\n constructor(\n private _changeDetectorRef: ChangeDetectorRef,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n ) {\n this._animationsDisabled = animationMode === 'NoopAnimations';\n }\n\n /**\n * Shows the tooltip with an animation originating from the provided origin\n * @param delay Amount of milliseconds to the delay showing the tooltip.\n */\n show(delay: number): void {\n // Cancel the delayed hide if it is scheduled\n clearTimeout(this._hideTimeoutId);\n\n this._showTimeoutId = setTimeout(() => {\n this._toggleVisibility(true);\n this._showTimeoutId = undefined;\n }, delay);\n }\n\n /**\n * Begins the animation to hide the tooltip after the provided delay in ms.\n * @param delay Amount of milliseconds to delay showing the tooltip.\n */\n hide(delay: number): void {\n // Cancel the delayed show if it is scheduled\n clearTimeout(this._showTimeoutId);\n\n this._hideTimeoutId = setTimeout(() => {\n this._toggleVisibility(false);\n this._hideTimeoutId = undefined;\n }, delay);\n }\n\n /** Returns an observable that notifies when the tooltip has been hidden from view. */\n afterHidden(): Observable<void> {\n return this._onHide;\n }\n\n /** Whether the tooltip is being displayed. */\n isVisible(): boolean {\n return this._isVisible;\n }\n\n ngOnDestroy() {\n this._cancelPendingAnimations();\n this._onHide.complete();\n this._triggerElement = null!;\n }\n\n /**\n * Interactions on the HTML body should close the tooltip immediately as defined in the\n * material design spec.\n * https://material.io/design/components/tooltips.html#behavior\n */\n _handleBodyInteraction(): void {\n if (this._closeOnInteraction) {\n this.hide(0);\n }\n }\n\n /**\n * Marks that the tooltip needs to be checked in the next change detection run.\n * Mainly used for rendering the initial text before positioning a tooltip, which\n * can be problematic in components with OnPush change detection.\n */\n _markForCheck(): void {\n this._changeDetectorRef.markForCheck();\n }\n\n _handleMouseLeave({relatedTarget}: MouseEvent) {\n if (!relatedTarget || !this._triggerElement.contains(relatedTarget as Node)) {\n if (this.isVisible()) {\n this.hide(this._mouseLeaveHideDelay);\n } else {\n this._finalizeAnimation(false);\n }\n }\n }\n\n /**\n * Callback for when the timeout in this.show() gets completed.\n * This method is only needed by the mdc-tooltip, and so it is only implemented\n * in the mdc-tooltip, not here.\n */\n protected _onShow(): void {}\n\n /** Event listener dispatched when an animation on the tooltip finishes. */\n _handleAnimationEnd({animationName}: AnimationEvent) {\n if (animationName === this._showAnimation || animationName === this._hideAnimation) {\n this._finalizeAnimation(animationName === this._showAnimation);\n }\n }\n\n /** Cancels any pending animation sequences. */\n _cancelPendingAnimations() {\n clearTimeout(this._showTimeoutId);\n clearTimeout(this._hideTimeoutId);\n this._showTimeoutId = this._hideTimeoutId = undefined;\n }\n\n /** Handles the cleanup after an animation has finished. */\n private _finalizeAnimation(toVisible: boolean) {\n if (toVisible) {\n this._closeOnInteraction = true;\n } else if (!this.isVisible()) {\n this._onHide.next();\n }\n }\n\n /** Toggles the visibility of the tooltip element. */\n private _toggleVisibility(isVisible: boolean) {\n // We set the classes directly here ourselves so that toggling the tooltip state\n // isn't bound by change detection. This allows us to hide it even if the\n // view ref has been detached from the CD tree.\n const tooltip = this._tooltip.nativeElement;\n const showClass = this._showAnimation;\n const hideClass = this._hideAnimation;\n tooltip.classList.remove(isVisible ? hideClass : showClass);\n tooltip.classList.add(isVisible ? showClass : hideClass);\n this._isVisible = isVisible;\n\n // It's common for internal apps to disable animations using `* { animation: none !important }`\n // which can break the opening sequence. Try to detect such cases and work around them.\n if (isVisible && !this._animationsDisabled && typeof getComputedStyle === 'function') {\n const styles = getComputedStyle(tooltip);\n\n // Use `getPropertyValue` to avoid issues with property renaming.\n if (\n styles.getPropertyValue('animation-duration') === '0s' ||\n styles.getPropertyValue('animation-name') === 'none'\n ) {\n this._animationsDisabled = true;\n }\n }\n\n if (isVisible) {\n this._onShow();\n }\n\n if (this._animationsDisabled) {\n tooltip.classList.add('_mat-animation-noopable');\n this._finalizeAnimation(isVisible);\n }\n }\n}\n\n/**\n * Internal component that wraps the tooltip's content.\n * @docs-private\n */\n@Component({\n selector: 'mat-tooltip-component',\n templateUrl: 'tooltip.html',\n styleUrls: ['tooltip.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // Forces the element to have a layout in IE and Edge. This fixes issues where the element\n // won't be rendered if the animations are disabled or there is no web animations polyfill.\n '[style.zoom]': 'isVisible() ? 1 : null',\n '(mouseleave)': '_handleMouseLeave($event)',\n 'aria-hidden': 'true',\n },\n})\nexport class TooltipComponent extends _TooltipComponentBase {\n /* Whether the tooltip text overflows to multiple lines */\n _isMultiline = false;\n\n /** Reference to the internal tooltip element. */\n @ViewChild('tooltip', {\n // Use a static query here since we interact directly with\n // the DOM which can happen before `ngAfterViewInit`.\n static: true,\n })\n _tooltip: ElementRef<HTMLElement>;\n _showAnimation = 'mat-mdc-tooltip-show';\n _hideAnimation = 'mat-mdc-tooltip-hide';\n\n constructor(\n changeDetectorRef: ChangeDetectorRef,\n private _elementRef: ElementRef<HTMLElement>,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n ) {\n super(changeDetectorRef, animationMode);\n }\n\n protected override _onShow(): void {\n this._isMultiline = this._isTooltipMultiline();\n this._markForCheck();\n }\n\n /** Whether the tooltip text has overflown to the next line */\n private _isTooltipMultiline() {\n const rect = this._elementRef.nativeElement.getBoundingClientRect();\n return rect.height > MIN_HEIGHT && rect.width >= MAX_WIDTH;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AriaDescriber, FocusMonitor} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {BreakpointObserver, Breakpoints, BreakpointState} from '@angular/cdk/layout';\nimport {Overlay} from '@angular/cdk/overlay';\nimport {Platform} from '@angular/cdk/platform';\nimport {ScrollDispatcher} from '@angular/cdk/scrolling';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Optional,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {Observable} from 'rxjs';\nimport {\n _MatTooltipBase,\n _TooltipComponentBase,\n MAT_TOOLTIP_DEFAULT_OPTIONS,\n MAT_TOOLTIP_SCROLL_STRATEGY,\n MatTooltipDefaultOptions,\n} from '@angular/material/tooltip';\n\n/**\n * Directive that attaches a material design tooltip to the host element. Animates the showing and\n * hiding of a tooltip provided position (defaults to below the element).\n *\n * https://material.io/design/components/tooltips.html\n *\n * @deprecated Use `MatTooltip` from `@angular/material/tooltip` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Directive({\n selector: '[matTooltip]',\n exportAs: 'matTooltip',\n host: {\n 'class': 'mat-tooltip-trigger',\n },\n})\nexport class MatLegacyTooltip extends _MatTooltipBase<LegacyTooltipComponent> {\n protected readonly _tooltipComponent = LegacyTooltipComponent;\n\n constructor(\n overlay: Overlay,\n elementRef: ElementRef<HTMLElement>,\n scrollDispatcher: ScrollDispatcher,\n viewContainerRef: ViewContainerRef,\n ngZone: NgZone,\n platform: Platform,\n ariaDescriber: AriaDescriber,\n focusMonitor: FocusMonitor,\n @Inject(MAT_TOOLTIP_SCROLL_STRATEGY) scrollStrategy: any,\n @Optional() dir: Directionality,\n @Optional() @Inject(MAT_TOOLTIP_DEFAULT_OPTIONS) defaultOptions: MatTooltipDefaultOptions,\n @Inject(DOCUMENT) _document: any,\n ) {\n super(\n overlay,\n elementRef,\n scrollDispatcher,\n viewContainerRef,\n ngZone,\n platform,\n ariaDescriber,\n focusMonitor,\n scrollStrategy,\n dir,\n defaultOptions,\n _document,\n );\n }\n}\n\n/**\n * Internal component that wraps the tooltip's content.\n * @docs-private\n * @deprecated Use `TooltipComponent` from `@angular/material/tooltip` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-tooltip-component',\n templateUrl: 'tooltip.html',\n styleUrls: ['tooltip.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // Forces the element to have a layout in IE and Edge. This fixes issues where the element\n // won't be rendered if the animations are disabled or there is no web animations polyfill.\n '[style.zoom]': 'isVisible() ? 1 : null',\n '(mouseleave)': '_handleMouseLeave($event)',\n 'aria-hidden': 'true',\n },\n})\nexport class LegacyTooltipComponent extends _TooltipComponentBase {\n /** Stream that emits whether the user has a handset-sized display. */\n _isHandset: Observable<BreakpointState> = this._breakpointObserver.observe(Breakpoints.Handset);\n _showAnimation = 'mat-tooltip-show';\n _hideAnimation = 'mat-tooltip-hide';\n\n @ViewChild('tooltip', {\n // Use a static query here since we interact directly with\n // the DOM which can happen before `ngAfterViewInit`.\n static: true,\n })\n _tooltip: ElementRef<HTMLElement>;\n\n constructor(\n changeDetectorRef: ChangeDetectorRef,\n private _breakpointObserver: BreakpointObserver,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n ) {\n super(changeDetectorRef, animationMode);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {CdkScrollableModule} from '@angular/cdk/scrolling';\nimport {MatLegacyTooltip, LegacyTooltipComponent} from './tooltip';\nimport {MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER} from '@angular/material/tooltip';\n\n/**\n * @deprecated Use `MatTooltipModule` from `@angular/material/tooltip` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule],\n exports: [MatLegacyTooltip, LegacyTooltipComponent, MatCommonModule, CdkScrollableModule],\n declarations: [MatLegacyTooltip, LegacyTooltipComponent],\n providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER],\n})\nexport class MatLegacyTooltipModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatLegacyInkBar} from './ink-bar';\nimport {MatLegacyTab} from './tab';\nimport {MatLegacyTabBody, MatLegacyTabBodyPortal} from './tab-body';\nimport {MatLegacyTabGroup} from './tab-group';\nimport {MatLegacyTabHeader} from './tab-header';\nimport {MatLegacyTabLink, MatLegacyTabNav, MatLegacyTabNavPanel} from './tab-nav-bar/tab-nav-bar';\nimport {MatLegacyTabLabel} from './tab-label';\nimport {MatLegacyTabContent} from './tab-content';\nimport {MatLegacyTabLabelWrapper} from './tab-label-wrapper';\n\n/**\n * @deprecated Use `MatTabsModule` from `@angular/material/tabs` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [\n CommonModule,\n MatCommonModule,\n PortalModule,\n MatRippleModule,\n ObserversModule,\n A11yModule,\n ],\n // Don't export all components because some are only to be used internally.\n exports: [\n MatCommonModule,\n MatLegacyTabGroup,\n MatLegacyTabLabel,\n MatLegacyTab,\n MatLegacyTabNav,\n MatLegacyTabNavPanel,\n MatLegacyTabLink,\n MatLegacyTabContent,\n ],\n declarations: [\n MatLegacyTabGroup,\n MatLegacyTabLabel,\n MatLegacyTab,\n MatLegacyInkBar,\n MatLegacyTabLabelWrapper,\n MatLegacyTabNav,\n MatLegacyTabNavPanel,\n MatLegacyTabLink,\n MatLegacyTabBody,\n MatLegacyTabBodyPortal,\n MatLegacyTabHeader,\n MatLegacyTabContent,\n ],\n})\nexport class MatLegacyTabsModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatLegacySlider} from './slider';\n\n/**\n * @deprecated Use `MatSliderModule` from `@angular/material/slider` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [CommonModule, MatCommonModule],\n exports: [MatLegacySlider, MatCommonModule],\n declarations: [MatLegacySlider],\n})\nexport class MatLegacySliderModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n BooleanInput,\n coerceBooleanProperty,\n coerceNumberProperty,\n NumberInput,\n} from '@angular/cdk/coercion';\nimport {\n DOWN_ARROW,\n END,\n HOME,\n LEFT_ARROW,\n PAGE_DOWN,\n PAGE_UP,\n RIGHT_ARROW,\n UP_ARROW,\n hasModifierKey,\n} from '@angular/cdk/keycodes';\nimport {\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n NgZone,\n AfterViewInit,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanColor,\n CanDisable,\n HasTabIndex,\n mixinColor,\n mixinDisabled,\n mixinTabIndex,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {normalizePassiveListenerOptions} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {Subscription} from 'rxjs';\n\nconst activeEventOptions = normalizePassiveListenerOptions({passive: false});\n\n/**\n * Visually, a 30px separation between tick marks looks best. This is very subjective but it is\n * the default separation we chose.\n */\nconst MIN_AUTO_TICK_SEPARATION = 30;\n\n/** The thumb gap size for a disabled slider. */\nconst DISABLED_THUMB_GAP = 7;\n\n/** The thumb gap size for a non-active slider at its minimum value. */\nconst MIN_VALUE_NONACTIVE_THUMB_GAP = 7;\n\n/** The thumb gap size for an active slider at its minimum value. */\nconst MIN_VALUE_ACTIVE_THUMB_GAP = 10;\n\n/**\n * Provider Expression that allows mat-slider to register as a ControlValueAccessor.\n * This allows it to support [(ngModel)] and [formControl].\n * @docs-private\n * @deprecated Use `MAT_SLIDER_VALUE_ACCESSOR` from `@angular/material/slider` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_SLIDER_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatLegacySlider),\n multi: true,\n};\n\n/**\n * A simple change event emitted by the MatSlider component.\n * @deprecated Use `MatSliderChange` from `@angular/material/slider` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacySliderChange {\n /** The MatSlider that changed. */\n source: MatLegacySlider;\n\n /** The new value of the source slider. */\n value: number | null;\n}\n\n// Boilerplate for applying mixins to MatSlider.\n/** @docs-private */\nconst _MatSliderBase = mixinTabIndex(\n mixinColor(\n mixinDisabled(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n ),\n 'accent',\n ),\n);\n\n/**\n * Allows users to select from a range of values by moving the slider thumb. It is similar in\n * behavior to the native `<input type=\"range\">` element.\n * @deprecated Use `MatSlider` from `@angular/material/slider` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-slider',\n exportAs: 'matSlider',\n providers: [MAT_LEGACY_SLIDER_VALUE_ACCESSOR],\n host: {\n '(focus)': '_onFocus()',\n '(blur)': '_onBlur()',\n '(keydown)': '_onKeydown($event)',\n '(keyup)': '_onKeyup()',\n '(mouseenter)': '_onMouseenter()',\n\n // On Safari starting to slide temporarily triggers text selection mode which\n // show the wrong cursor. We prevent it by stopping the `selectstart` event.\n '(selectstart)': '$event.preventDefault()',\n 'class': 'mat-slider mat-focus-indicator',\n 'role': 'slider',\n '[tabIndex]': 'tabIndex',\n '[attr.aria-disabled]': 'disabled',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': 'min',\n '[attr.aria-valuenow]': 'value',\n\n // NVDA and Jaws appear to announce the `aria-valuenow` by calculating its percentage based\n // on its value between `aria-valuemin` and `aria-valuemax`. Due to how decimals are handled,\n // it can cause the slider to read out a very long value like 0.20000068 if the current value\n // is 0.2 with a min of 0 and max of 1. We work around the issue by setting `aria-valuetext`\n // to the same value that we set on the slider's thumb which will be truncated.\n '[attr.aria-valuetext]': 'valueText == null ? displayValue : valueText',\n '[attr.aria-orientation]': 'vertical ? \"vertical\" : \"horizontal\"',\n '[class.mat-slider-disabled]': 'disabled',\n '[class.mat-slider-has-ticks]': 'tickInterval',\n '[class.mat-slider-horizontal]': '!vertical',\n '[class.mat-slider-axis-inverted]': '_shouldInvertAxis()',\n // Class binding which is only used by the test harness as there is no other\n // way for the harness to detect if mouse coordinates need to be inverted.\n '[class.mat-slider-invert-mouse-coords]': '_shouldInvertMouseCoords()',\n '[class.mat-slider-sliding]': '_isSliding',\n '[class.mat-slider-thumb-label-showing]': 'thumbLabel',\n '[class.mat-slider-vertical]': 'vertical',\n '[class.mat-slider-min-value]': '_isMinValue()',\n '[class.mat-slider-hide-last-tick]':\n 'disabled || _isMinValue() && _getThumbGap() && _shouldInvertAxis()',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n templateUrl: 'slider.html',\n styleUrls: ['slider.css'],\n inputs: ['disabled', 'color', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacySlider\n extends _MatSliderBase\n implements ControlValueAccessor, OnDestroy, CanDisable, CanColor, AfterViewInit, HasTabIndex\n{\n /** Whether the slider is inverted. */\n @Input()\n get invert(): boolean {\n return this._invert;\n }\n set invert(value: BooleanInput) {\n this._invert = coerceBooleanProperty(value);\n }\n private _invert = false;\n\n /** The maximum value that the slider can have. */\n @Input()\n get max(): number {\n return this._max;\n }\n set max(v: NumberInput) {\n this._max = coerceNumberProperty(v, this._max);\n this._percent = this._calculatePercentage(this._value);\n\n // Since this also modifies the percentage, we need to let the change detection know.\n this._changeDetectorRef.markForCheck();\n }\n private _max: number = 100;\n\n /** The minimum value that the slider can have. */\n @Input()\n get min(): number {\n return this._min;\n }\n set min(v: NumberInput) {\n this._min = coerceNumberProperty(v, this._min);\n this._percent = this._calculatePercentage(this._value);\n\n // Since this also modifies the percentage, we need to let the change detection know.\n this._changeDetectorRef.markForCheck();\n }\n private _min: number = 0;\n\n /** The values at which the thumb will snap. */\n @Input()\n get step(): number {\n return this._step;\n }\n set step(v: NumberInput) {\n this._step = coerceNumberProperty(v, this._step);\n\n if (this._step % 1 !== 0) {\n this._roundToDecimal = this._step.toString().split('.').pop()!.length;\n }\n\n // Since this could modify the label, we need to notify the change detection.\n this._changeDetectorRef.markForCheck();\n }\n private _step: number = 1;\n\n /** Whether or not to show the thumb label. */\n @Input()\n get thumbLabel(): boolean {\n return this._thumbLabel;\n }\n set thumbLabel(value: BooleanInput) {\n this._thumbLabel = coerceBooleanProperty(value);\n }\n private _thumbLabel: boolean = false;\n\n /**\n * How often to show ticks. Relative to the step so that a tick always appears on a step.\n * Ex: Tick interval of 4 with a step of 3 will draw a tick every 4 steps (every 12 values).\n */\n @Input()\n get tickInterval(): 'auto' | number {\n return this._tickInterval;\n }\n set tickInterval(value: 'auto' | NumberInput) {\n if (value === 'auto') {\n this._tickInterval = 'auto';\n } else if (typeof value === 'number' || typeof value === 'string') {\n this._tickInterval = coerceNumberProperty(value, this._tickInterval as number);\n } else {\n this._tickInterval = 0;\n }\n }\n private _tickInterval: 'auto' | number = 0;\n\n /** Value of the slider. */\n @Input()\n get value(): number {\n // If the value needs to be read and it is still uninitialized, initialize it to the min.\n if (this._value === null) {\n this.value = this._min;\n }\n return this._value as number;\n }\n set value(v: NumberInput) {\n if (v !== this._value) {\n let value = coerceNumberProperty(v, 0);\n\n // While incrementing by a decimal we can end up with values like 33.300000000000004.\n // Truncate it to ensure that it matches the label and to make it easier to work with.\n if (this._roundToDecimal && value !== this.min && value !== this.max) {\n value = parseFloat(value.toFixed(this._roundToDecimal));\n }\n\n this._value = value;\n this._percent = this._calculatePercentage(this._value);\n\n // Since this also modifies the percentage, we need to let the change detection know.\n this._changeDetectorRef.markForCheck();\n }\n }\n private _value: number | null = null;\n\n /**\n * Function that will be used to format the value before it is displayed\n * in the thumb label. Can be used to format very large number in order\n * for them to fit into the slider thumb.\n */\n @Input() displayWith: (value: number) => string | number;\n\n /** Text corresponding to the slider's value. Used primarily for improved accessibility. */\n @Input() valueText: string;\n\n /** Whether the slider is vertical. */\n @Input()\n get vertical(): boolean {\n return this._vertical;\n }\n set vertical(value: BooleanInput) {\n this._vertical = coerceBooleanProperty(value);\n }\n private _vertical = false;\n\n /** Event emitted when the slider value has changed. */\n @Output() readonly change: EventEmitter<MatLegacySliderChange> =\n new EventEmitter<MatLegacySliderChange>();\n\n /** Event emitted when the slider thumb moves. */\n @Output() readonly input: EventEmitter<MatLegacySliderChange> =\n new EventEmitter<MatLegacySliderChange>();\n\n /**\n * Emits when the raw value of the slider changes. This is here primarily\n * to facilitate the two-way binding for the `value` input.\n * @docs-private\n */\n @Output() readonly valueChange: EventEmitter<number | null> = new EventEmitter<number | null>();\n\n /** The value to be used for display purposes. */\n get displayValue(): string | number {\n if (this.displayWith) {\n // Value is never null but since setters and getters cannot have\n // different types, the value getter is also typed to return null.\n return this.displayWith(this.value!);\n }\n\n // Note that this could be improved further by rounding something like 0.999 to 1 or\n // 0.899 to 0.9, however it is very performance sensitive, because it gets called on\n // every change detection cycle.\n if (this._roundToDecimal && this.value && this.value % 1 !== 0) {\n return this.value.toFixed(this._roundToDecimal);\n }\n\n return this.value || 0;\n }\n\n /** set focus to the host element */\n focus(options?: FocusOptions) {\n this._focusHostElement(options);\n }\n\n /** blur the host element */\n blur() {\n this._blurHostElement();\n }\n\n /** onTouch function registered via registerOnTouch (ControlValueAccessor). */\n onTouched: () => any = () => {};\n\n /** The percentage of the slider that coincides with the value. */\n get percent(): number {\n return this._clamp(this._percent);\n }\n private _percent: number = 0;\n\n /**\n * Whether or not the thumb is sliding and what the user is using to slide it with.\n * Used to determine if there should be a transition for the thumb and fill track.\n */\n _isSliding: 'keyboard' | 'pointer' | null = null;\n\n /**\n * Whether or not the slider is active (clicked or sliding).\n * Used to shrink and grow the thumb as according to the Material Design spec.\n */\n _isActive: boolean = false;\n\n /**\n * Whether the axis of the slider is inverted.\n * (i.e. whether moving the thumb in the positive x or y direction decreases the slider's value).\n */\n _shouldInvertAxis() {\n // Standard non-inverted mode for a vertical slider should be dragging the thumb from bottom to\n // top. However from a y-axis standpoint this is inverted.\n return this.vertical ? !this.invert : this.invert;\n }\n\n /** Whether the slider is at its minimum value. */\n _isMinValue() {\n return this.percent === 0;\n }\n\n /**\n * The amount of space to leave between the slider thumb and the track fill & track background\n * elements.\n */\n _getThumbGap() {\n if (this.disabled) {\n return DISABLED_THUMB_GAP;\n }\n if (this._isMinValue() && !this.thumbLabel) {\n return this._isActive ? MIN_VALUE_ACTIVE_THUMB_GAP : MIN_VALUE_NONACTIVE_THUMB_GAP;\n }\n return 0;\n }\n\n /** CSS styles for the track background element. */\n _getTrackBackgroundStyles(): {[key: string]: string} {\n const axis = this.vertical ? 'Y' : 'X';\n const scale = this.vertical ? `1, ${1 - this.percent}, 1` : `${1 - this.percent}, 1, 1`;\n const sign = this._shouldInvertMouseCoords() ? '-' : '';\n\n return {\n // scale3d avoids some rendering issues in Chrome. See #12071.\n transform: `translate${axis}(${sign}${this._getThumbGap()}px) scale3d(${scale})`,\n };\n }\n\n /** CSS styles for the track fill element. */\n _getTrackFillStyles(): {[key: string]: string} {\n const percent = this.percent;\n const axis = this.vertical ? 'Y' : 'X';\n const scale = this.vertical ? `1, ${percent}, 1` : `${percent}, 1, 1`;\n const sign = this._shouldInvertMouseCoords() ? '' : '-';\n\n return {\n // scale3d avoids some rendering issues in Chrome. See #12071.\n transform: `translate${axis}(${sign}${this._getThumbGap()}px) scale3d(${scale})`,\n // iOS Safari has a bug where it won't re-render elements which start of as `scale(0)` until\n // something forces a style recalculation on it. Since we'll end up with `scale(0)` when\n // the value of the slider is 0, we can easily get into this situation. We force a\n // recalculation by changing the element's `display` when it goes from 0 to any other value.\n display: percent === 0 ? 'none' : '',\n };\n }\n\n /** CSS styles for the ticks container element. */\n _getTicksContainerStyles(): {[key: string]: string} {\n let axis = this.vertical ? 'Y' : 'X';\n // For a horizontal slider in RTL languages we push the ticks container off the left edge\n // instead of the right edge to avoid causing a horizontal scrollbar to appear.\n let sign = !this.vertical && this._getDirection() == 'rtl' ? '' : '-';\n let offset = (this._tickIntervalPercent / 2) * 100;\n return {\n 'transform': `translate${axis}(${sign}${offset}%)`,\n };\n }\n\n /** CSS styles for the ticks element. */\n _getTicksStyles(): {[key: string]: string} {\n let tickSize = this._tickIntervalPercent * 100;\n let backgroundSize = this.vertical ? `2px ${tickSize}%` : `${tickSize}% 2px`;\n let axis = this.vertical ? 'Y' : 'X';\n // Depending on the direction we pushed the ticks container, push the ticks the opposite\n // direction to re-center them but clip off the end edge. In RTL languages we need to flip the\n // ticks 180 degrees so we're really cutting off the end edge abd not the start.\n let sign = !this.vertical && this._getDirection() == 'rtl' ? '-' : '';\n let rotate = !this.vertical && this._getDirection() == 'rtl' ? ' rotate(180deg)' : '';\n let styles: {[key: string]: string} = {\n 'backgroundSize': backgroundSize,\n // Without translateZ ticks sometimes jitter as the slider moves on Chrome & Firefox.\n 'transform': `translateZ(0) translate${axis}(${sign}${tickSize / 2}%)${rotate}`,\n };\n\n if (this._isMinValue() && this._getThumbGap()) {\n const shouldInvertAxis = this._shouldInvertAxis();\n let side: string;\n\n if (this.vertical) {\n side = shouldInvertAxis ? 'Bottom' : 'Top';\n } else {\n side = shouldInvertAxis ? 'Right' : 'Left';\n }\n\n styles[`padding${side}`] = `${this._getThumbGap()}px`;\n }\n\n return styles;\n }\n\n _getThumbContainerStyles(): {[key: string]: string} {\n const shouldInvertAxis = this._shouldInvertAxis();\n let axis = this.vertical ? 'Y' : 'X';\n // For a horizontal slider in RTL languages we push the thumb container off the left edge\n // instead of the right edge to avoid causing a horizontal scrollbar to appear.\n let invertOffset =\n this._getDirection() == 'rtl' && !this.vertical ? !shouldInvertAxis : shouldInvertAxis;\n let offset = (invertOffset ? this.percent : 1 - this.percent) * 100;\n return {\n 'transform': `translate${axis}(-${offset}%)`,\n };\n }\n\n /** The size of a tick interval as a percentage of the size of the track. */\n private _tickIntervalPercent: number = 0;\n\n /** The dimensions of the slider. */\n private _sliderDimensions: ClientRect | null = null;\n\n private _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n /** Decimal places to round to, based on the step amount. */\n private _roundToDecimal: number;\n\n /** Subscription to the Directionality change EventEmitter. */\n private _dirChangeSubscription = Subscription.EMPTY;\n\n /** The value of the slider when the slide start event fires. */\n private _valueOnSlideStart: number | null;\n\n /** Reference to the inner slider wrapper element. */\n @ViewChild('sliderWrapper') private _sliderWrapper: ElementRef;\n\n /**\n * Whether mouse events should be converted to a slider position by calculating their distance\n * from the right or bottom edge of the slider as opposed to the top or left.\n */\n _shouldInvertMouseCoords() {\n const shouldInvertAxis = this._shouldInvertAxis();\n return this._getDirection() == 'rtl' && !this.vertical ? !shouldInvertAxis : shouldInvertAxis;\n }\n\n /** The language direction for this slider element. */\n private _getDirection() {\n return this._dir && this._dir.value == 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Keeps track of the last pointer event that was captured by the slider. */\n private _lastPointerEvent: MouseEvent | TouchEvent | null;\n\n /** Used to subscribe to global move and end events */\n protected _document: Document;\n\n /**\n * Identifier used to attribute a touch event to a particular slider.\n * Will be undefined if one of the following conditions is true:\n * - The user isn't dragging using a touch device.\n * - The browser doesn't support `Touch.identifier`.\n * - Dragging hasn't started yet.\n */\n private _touchId: number | undefined;\n\n constructor(\n elementRef: ElementRef,\n private _focusMonitor: FocusMonitor,\n private _changeDetectorRef: ChangeDetectorRef,\n @Optional() private _dir: Directionality,\n @Attribute('tabindex') tabIndex: string,\n private _ngZone: NgZone,\n @Inject(DOCUMENT) _document: any,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string,\n ) {\n super(elementRef);\n this._document = _document;\n this.tabIndex = parseInt(tabIndex) || 0;\n\n _ngZone.runOutsideAngular(() => {\n const element = elementRef.nativeElement;\n element.addEventListener('mousedown', this._pointerDown, activeEventOptions);\n element.addEventListener('touchstart', this._pointerDown, activeEventOptions);\n });\n }\n\n ngAfterViewInit() {\n this._focusMonitor.monitor(this._elementRef, true).subscribe((origin: FocusOrigin) => {\n this._isActive = !!origin && origin !== 'keyboard';\n this._changeDetectorRef.detectChanges();\n });\n if (this._dir) {\n this._dirChangeSubscription = this._dir.change.subscribe(() => {\n this._changeDetectorRef.markForCheck();\n });\n }\n }\n\n ngOnDestroy() {\n const element = this._elementRef.nativeElement;\n element.removeEventListener('mousedown', this._pointerDown, activeEventOptions);\n element.removeEventListener('touchstart', this._pointerDown, activeEventOptions);\n this._lastPointerEvent = null;\n this._removeGlobalEvents();\n this._focusMonitor.stopMonitoring(this._elementRef);\n this._dirChangeSubscription.unsubscribe();\n }\n\n _onMouseenter() {\n if (this.disabled) {\n return;\n }\n\n // We save the dimensions of the slider here so we can use them to update the spacing of the\n // ticks and determine where on the slider click and slide events happen.\n this._sliderDimensions = this._getSliderDimensions();\n this._updateTickIntervalPercent();\n }\n\n _onFocus() {\n // We save the dimensions of the slider here so we can use them to update the spacing of the\n // ticks and determine where on the slider click and slide events happen.\n this._sliderDimensions = this._getSliderDimensions();\n this._updateTickIntervalPercent();\n }\n\n _onBlur() {\n this.onTouched();\n }\n\n _onKeydown(event: KeyboardEvent) {\n if (\n this.disabled ||\n hasModifierKey(event) ||\n (this._isSliding && this._isSliding !== 'keyboard')\n ) {\n return;\n }\n\n const oldValue = this.value;\n\n switch (event.keyCode) {\n case PAGE_UP:\n this._increment(10);\n break;\n case PAGE_DOWN:\n this._increment(-10);\n break;\n case END:\n this.value = this.max;\n break;\n case HOME:\n this.value = this.min;\n break;\n case LEFT_ARROW:\n // NOTE: For a sighted user it would make more sense that when they press an arrow key on an\n // inverted slider the thumb moves in that direction. However for a blind user, nothing\n // about the slider indicates that it is inverted. They will expect left to be decrement,\n // regardless of how it appears on the screen. For speakers ofRTL languages, they probably\n // expect left to mean increment. Therefore we flip the meaning of the side arrow keys for\n // RTL. For inverted sliders we prefer a good a11y experience to having it \"look right\" for\n // sighted users, therefore we do not swap the meaning.\n this._increment(this._getDirection() == 'rtl' ? 1 : -1);\n break;\n case UP_ARROW:\n this._increment(1);\n break;\n case RIGHT_ARROW:\n // See comment on LEFT_ARROW about the conditions under which we flip the meaning.\n this._increment(this._getDirection() == 'rtl' ? -1 : 1);\n break;\n case DOWN_ARROW:\n this._increment(-1);\n break;\n default:\n // Return if the key is not one that we explicitly handle to avoid calling preventDefault on\n // it.\n return;\n }\n\n if (oldValue != this.value) {\n this._emitInputEvent();\n this._emitChangeEvent();\n }\n\n this._isSliding = 'keyboard';\n event.preventDefault();\n }\n\n _onKeyup() {\n if (this._isSliding === 'keyboard') {\n this._isSliding = null;\n }\n }\n\n /** Called when the user has put their pointer down on the slider. */\n private _pointerDown = (event: TouchEvent | MouseEvent) => {\n // Don't do anything if the slider is disabled or the\n // user is using anything other than the main mouse button.\n if (this.disabled || this._isSliding || (!isTouchEvent(event) && event.button !== 0)) {\n return;\n }\n\n this._ngZone.run(() => {\n this._touchId = isTouchEvent(event)\n ? getTouchIdForSlider(event, this._elementRef.nativeElement)\n : undefined;\n const pointerPosition = getPointerPositionOnPage(event, this._touchId);\n\n if (pointerPosition) {\n const oldValue = this.value;\n this._isSliding = 'pointer';\n this._lastPointerEvent = event;\n this._focusHostElement();\n this._onMouseenter(); // Simulate mouseenter in case this is a mobile device.\n this._bindGlobalEvents(event);\n this._focusHostElement();\n this._updateValueFromPosition(pointerPosition);\n this._valueOnSlideStart = oldValue;\n\n // Despite the fact that we explicitly bind active events, in some cases the browser\n // still dispatches non-cancelable events which cause this call to throw an error.\n // There doesn't appear to be a good way of avoiding them. See #23820.\n if (event.cancelable) {\n event.preventDefault();\n }\n\n // Emit a change and input event if the value changed.\n if (oldValue != this.value) {\n this._emitInputEvent();\n }\n }\n });\n };\n\n /**\n * Called when the user has moved their pointer after\n * starting to drag. Bound on the document level.\n */\n private _pointerMove = (event: TouchEvent | MouseEvent) => {\n if (this._isSliding === 'pointer') {\n const pointerPosition = getPointerPositionOnPage(event, this._touchId);\n\n if (pointerPosition) {\n // Prevent the slide from selecting anything else.\n if (event.cancelable) {\n event.preventDefault();\n }\n const oldValue = this.value;\n this._lastPointerEvent = event;\n this._updateValueFromPosition(pointerPosition);\n\n // Native range elements always emit `input` events when the value changed while sliding.\n if (oldValue != this.value) {\n this._emitInputEvent();\n }\n }\n }\n };\n\n /** Called when the user has lifted their pointer. Bound on the document level. */\n private _pointerUp = (event: TouchEvent | MouseEvent) => {\n if (this._isSliding === 'pointer') {\n if (\n !isTouchEvent(event) ||\n typeof this._touchId !== 'number' ||\n // Note that we use `changedTouches`, rather than `touches` because it\n // seems like in most cases `touches` is empty for `touchend` events.\n findMatchingTouch(event.changedTouches, this._touchId)\n ) {\n if (event.cancelable) {\n event.preventDefault();\n }\n this._removeGlobalEvents();\n this._isSliding = null;\n this._touchId = undefined;\n\n if (this._valueOnSlideStart != this.value && !this.disabled) {\n this._emitChangeEvent();\n }\n\n this._valueOnSlideStart = this._lastPointerEvent = null;\n }\n }\n };\n\n /** Called when the window has lost focus. */\n private _windowBlur = () => {\n // If the window is blurred while dragging we need to stop dragging because the\n // browser won't dispatch the `mouseup` and `touchend` events anymore.\n if (this._lastPointerEvent) {\n this._pointerUp(this._lastPointerEvent);\n }\n };\n\n /** Use defaultView of injected document if available or fallback to global window reference */\n private _getWindow(): Window {\n return this._document.defaultView || window;\n }\n\n /**\n * Binds our global move and end events. They're bound at the document level and only while\n * dragging so that the user doesn't have to keep their pointer exactly over the slider\n * as they're swiping across the screen.\n */\n private _bindGlobalEvents(triggerEvent: TouchEvent | MouseEvent) {\n // Note that we bind the events to the `document`, because it allows us to capture\n // drag cancel events where the user's pointer is outside the browser window.\n const document = this._document;\n const isTouch = isTouchEvent(triggerEvent);\n const moveEventName = isTouch ? 'touchmove' : 'mousemove';\n const endEventName = isTouch ? 'touchend' : 'mouseup';\n document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);\n document.addEventListener(endEventName, this._pointerUp, activeEventOptions);\n\n if (isTouch) {\n document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);\n }\n\n const window = this._getWindow();\n\n if (typeof window !== 'undefined' && window) {\n window.addEventListener('blur', this._windowBlur);\n }\n }\n\n /** Removes any global event listeners that we may have added. */\n private _removeGlobalEvents() {\n const document = this._document;\n document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);\n document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);\n document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);\n document.removeEventListener('touchend', this._pointerUp, activeEventOptions);\n document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);\n\n const window = this._getWindow();\n\n if (typeof window !== 'undefined' && window) {\n window.removeEventListener('blur', this._windowBlur);\n }\n }\n\n /** Increments the slider by the given number of steps (negative number decrements). */\n private _increment(numSteps: number) {\n // Pre-clamp the current value since it's allowed to be\n // out of bounds when assigned programmatically.\n const clampedValue = this._clamp(this.value || 0, this.min, this.max);\n this.value = this._clamp(clampedValue + this.step * numSteps, this.min, this.max);\n }\n\n /** Calculate the new value from the new physical location. The value will always be snapped. */\n private _updateValueFromPosition(pos: {x: number; y: number}) {\n if (!this._sliderDimensions) {\n return;\n }\n\n let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;\n let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let posComponent = this.vertical ? pos.y : pos.x;\n\n // The exact value is calculated from the event and used to find the closest snap value.\n let percent = this._clamp((posComponent - offset) / size);\n\n if (this._shouldInvertMouseCoords()) {\n percent = 1 - percent;\n }\n\n // Since the steps may not divide cleanly into the max value, if the user\n // slid to 0 or 100 percent, we jump to the min/max value. This approach\n // is slightly more intuitive than using `Math.ceil` below, because it\n // follows the user's pointer closer.\n if (percent === 0) {\n this.value = this.min;\n } else if (percent === 1) {\n this.value = this.max;\n } else {\n const exactValue = this._calculateValue(percent);\n\n // This calculation finds the closest step by finding the closest\n // whole number divisible by the step relative to the min.\n const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;\n\n // The value needs to snap to the min and max.\n this.value = this._clamp(closestValue, this.min, this.max);\n }\n }\n\n /** Emits a change event if the current value is different from the last emitted value. */\n private _emitChangeEvent() {\n this._controlValueAccessorChangeFn(this.value);\n this.valueChange.emit(this.value);\n this.change.emit(this._createChangeEvent());\n }\n\n /** Emits an input event when the current value is different from the last emitted value. */\n private _emitInputEvent() {\n this.input.emit(this._createChangeEvent());\n }\n\n /** Updates the amount of space between ticks as a percentage of the width of the slider. */\n private _updateTickIntervalPercent() {\n if (!this.tickInterval || !this._sliderDimensions) {\n return;\n }\n\n let tickIntervalPercent: number;\n if (this.tickInterval == 'auto') {\n let trackSize = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let pixelsPerStep = (trackSize * this.step) / (this.max - this.min);\n let stepsPerTick = Math.ceil(MIN_AUTO_TICK_SEPARATION / pixelsPerStep);\n let pixelsPerTick = stepsPerTick * this.step;\n tickIntervalPercent = pixelsPerTick / trackSize;\n } else {\n tickIntervalPercent = (this.tickInterval * this.step) / (this.max - this.min);\n }\n this._tickIntervalPercent = isSafeNumber(tickIntervalPercent) ? tickIntervalPercent : 0;\n }\n\n /** Creates a slider change object from the specified value. */\n private _createChangeEvent(value = this.value): MatLegacySliderChange {\n let event = new MatLegacySliderChange();\n\n event.source = this;\n event.value = value;\n\n return event;\n }\n\n /** Calculates the percentage of the slider that a value is. */\n private _calculatePercentage(value: number | null) {\n const percentage = ((value || 0) - this.min) / (this.max - this.min);\n return isSafeNumber(percentage) ? percentage : 0;\n }\n\n /** Calculates the value a percentage of the slider corresponds to. */\n private _calculateValue(percentage: number) {\n return this.min + percentage * (this.max - this.min);\n }\n\n /** Return a number between two numbers. */\n private _clamp(value: number, min = 0, max = 1) {\n return Math.max(min, Math.min(value, max));\n }\n\n /**\n * Get the bounding client rect of the slider track element.\n * The track is used rather than the native element to ignore the extra space that the thumb can\n * take up.\n */\n private _getSliderDimensions() {\n return this._sliderWrapper ? this._sliderWrapper.nativeElement.getBoundingClientRect() : null;\n }\n\n /**\n * Focuses the native element.\n * Currently only used to allow a blur event to fire but will be used with keyboard input later.\n */\n private _focusHostElement(options?: FocusOptions) {\n this._elementRef.nativeElement.focus(options);\n }\n\n /** Blurs the native element. */\n private _blurHostElement() {\n this._elementRef.nativeElement.blur();\n }\n\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value: any) {\n this.value = value;\n }\n\n /**\n * Registers a callback to be triggered when the value has changed.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n /**\n * Registers a callback to be triggered when the component is touched.\n * Implemented as part of ControlValueAccessor.\n * @param fn Callback to be registered.\n */\n registerOnTouched(fn: any) {\n this.onTouched = fn;\n }\n\n /**\n * Sets whether the component should be disabled.\n * Implemented as part of ControlValueAccessor.\n * @param isDisabled\n */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n }\n}\n\n/** Checks if number is safe for calculation */\nfunction isSafeNumber(value: number) {\n return !isNaN(value) && isFinite(value);\n}\n\n/** Returns whether an event is a touch event. */\nfunction isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent {\n // This function is called for every pixel that the user has dragged so we need it to be\n // as fast as possible. Since we only bind mouse events and touch events, we can assume\n // that if the event's name starts with `t`, it's a touch event.\n return event.type[0] === 't';\n}\n\n/** Gets the coordinates of a touch or mouse event relative to the viewport. */\nfunction getPointerPositionOnPage(event: MouseEvent | TouchEvent, id: number | undefined) {\n let point: {clientX: number; clientY: number} | undefined;\n\n if (isTouchEvent(event)) {\n // The `identifier` could be undefined if the browser doesn't support `TouchEvent.identifier`.\n // If that's the case, attribute the first touch to all active sliders. This should still cover\n // the most common case while only breaking multi-touch.\n if (typeof id === 'number') {\n point = findMatchingTouch(event.touches, id) || findMatchingTouch(event.changedTouches, id);\n } else {\n // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.\n point = event.touches[0] || event.changedTouches[0];\n }\n } else {\n point = event;\n }\n\n return point ? {x: point.clientX, y: point.clientY} : undefined;\n}\n\n/** Finds a `Touch` with a specific ID in a `TouchList`. */\nfunction findMatchingTouch(touches: TouchList, id: number): Touch | undefined {\n for (let i = 0; i < touches.length; i++) {\n if (touches[i].identifier === id) {\n return touches[i];\n }\n }\n\n return undefined;\n}\n\n/** Gets the unique ID of a touch that matches a specific slider. */\nfunction getTouchIdForSlider(event: TouchEvent, sliderHost: HTMLElement): number | undefined {\n for (let i = 0; i < event.touches.length; i++) {\n const target = event.touches[i].target as HTMLElement;\n\n if (sliderHost === target || sliderHost.contains(target)) {\n return event.touches[i].identifier;\n }\n }\n\n return undefined;\n}\n","import { Observable } from '../Observable';\nimport { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { MonoTypeOperatorFunction, TeardownLogic } from '../types';\n\n/**\n * Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds\n * true, but emits all further source items as soon as the condition becomes false.\n *\n * \n *\n * @param {Function} predicate - A function to test each item emitted from the source Observable.\n * @return {Observable<T>} An Observable that begins emitting items emitted by the source Observable when the\n * specified predicate becomes false.\n * @method skipWhile\n * @owner Observable\n */\nexport function skipWhile<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) => source.lift(new SkipWhileOperator(predicate));\n}\n\nclass SkipWhileOperator<T> implements Operator<T, T> {\n constructor(private predicate: (value: T, index: number) => boolean) {\n }\n\n call(subscriber: Subscriber<T>, source: any): TeardownLogic {\n return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass SkipWhileSubscriber<T> extends Subscriber<T> {\n private skipping: boolean = true;\n private index: number = 0;\n\n constructor(destination: Subscriber<T>,\n private predicate: (value: T, index: number) => boolean) {\n super(destination);\n }\n\n protected _next(value: T): void {\n const destination = this.destination;\n if (this.skipping) {\n this.tryCallPredicate(value);\n }\n\n if (!this.skipping) {\n destination.next(value);\n }\n }\n\n private tryCallPredicate(value: T): void {\n try {\n const result = this.predicate(value, this.index++);\n this.skipping = Boolean(result);\n } catch (err) {\n this.destination.error(err);\n }\n }\n}\n","import { Operator } from '../Operator';\nimport { Subscriber } from '../Subscriber';\nimport { Observable } from '../Observable';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\n\n/* tslint:disable:max-line-length */\nexport function withLatestFrom<T, R>(project: (v1: T) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, R>(source2: O2, project: (v1: T, v2: ObservedValueOf<O2>) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(v2: O2, v3: O3, project: (v1: T, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(v2: O2, v3: O3, v4: O4, project: (v1: T, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(v2: O2, v3: O3, v4: O4, v5: O5, project: (v1: T, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, project: (v1: T, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R): OperatorFunction<T, R>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>>(source2: O2): OperatorFunction<T, [T, ObservedValueOf<O2>]>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v2: O2, v3: O3): OperatorFunction<T, [T, ObservedValueOf<O2>, ObservedValueOf<O3>]>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v2: O2, v3: O3, v4: O4): OperatorFunction<T, [T, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v2: O2, v3: O3, v4: O4, v5: O5): OperatorFunction<T, [T, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;\nexport function withLatestFrom<T, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v2: O2, v3: O3, v4: O4, v5: O5, v6: O6): OperatorFunction<T, [T, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;\nexport function withLatestFrom<T, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, R>;\nexport function withLatestFrom<T, R>(array: ObservableInput<any>[]): OperatorFunction<T, R>;\nexport function withLatestFrom<T, R>(array: ObservableInput<any>[], project: (...values: Array<any>) => R): OperatorFunction<T, R>;\n\n/* tslint:enable:max-line-length */\n\n/**\n * Combines the source Observable with other Observables to create an Observable\n * whose values are calculated from the latest values of each, only when the\n * source emits.\n *\n * <span class=\"informal\">Whenever the source Observable emits a value, it\n * computes a formula using that value plus the latest values from other input\n * Observables, then emits the output of that formula.</span>\n *\n * \n *\n * `withLatestFrom` combines each value from the source Observable (the\n * instance) with the latest values from the other input Observables only when\n * the source emits a value, optionally using a `project` function to determine\n * the value to be emitted on the output Observable. All input Observables must\n * emit at least one value before the output Observable will emit a value.\n *\n * ## Example\n * On every click event, emit an array with the latest timer event plus the click event\n * ```ts\n * import { fromEvent, interval } from 'rxjs';\n * import { withLatestFrom } from 'rxjs/operators';\n *\n * const clicks = fromEvent(document, 'click');\n * const timer = interval(1000);\n * const result = clicks.pipe(withLatestFrom(timer));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link combineLatest}\n *\n * @param {ObservableInput} other An input Observable to combine with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {Function} [project] Projection function for combining values\n * together. Receives all values in order of the Observables passed, where the\n * first parameter is a value from the source Observable. (e.g.\n * `a.pipe(withLatestFrom(b, c), map(([a1, b1, c1]) => a1 + b1 + c1))`). If this is not\n * passed, arrays will be emitted on the output Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n * @method withLatestFrom\n * @owner Observable\n */\nexport function withLatestFrom<T, R>(...args: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): OperatorFunction<T, R> {\n return (source: Observable<T>) => {\n let project: any;\n if (typeof args[args.length - 1] === 'function') {\n project = args.pop();\n }\n const observables = <Observable<any>[]>args;\n return source.lift(new WithLatestFromOperator(observables, project));\n };\n}\n\nclass WithLatestFromOperator<T, R> implements Operator<T, R> {\n constructor(private observables: Observable<any>[],\n private project?: (...values: any[]) => Observable<R>) {\n }\n\n call(subscriber: Subscriber<R>, source: any): any {\n return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nclass WithLatestFromSubscriber<T, R> extends OuterSubscriber<T, R> {\n private values: any[];\n private toRespond: number[] = [];\n\n constructor(destination: Subscriber<R>,\n private observables: Observable<any>[],\n private project?: (...values: any[]) => Observable<R>) {\n super(destination);\n const len = observables.length;\n this.values = new Array(len);\n\n for (let i = 0; i < len; i++) {\n this.toRespond.push(i);\n }\n\n for (let i = 0; i < len; i++) {\n let observable = observables[i];\n this.add(subscribeToResult<T, R>(this, observable, undefined, i));\n }\n }\n\n notifyNext(_outerValue: T, innerValue: R,\n outerIndex: number): void {\n this.values[outerIndex] = innerValue;\n const toRespond = this.toRespond;\n if (toRespond.length > 0) {\n const found = toRespond.indexOf(outerIndex);\n if (found !== -1) {\n toRespond.splice(found, 1);\n }\n }\n }\n\n notifyComplete() {\n // noop\n }\n\n protected _next(value: T) {\n if (this.toRespond.length === 0) {\n const args = [value, ...this.values];\n if (this.project) {\n this._tryProject(args);\n } else {\n this.destination.next!(args);\n }\n }\n }\n\n private _tryProject(args: any[]) {\n let result: any;\n try {\n result = this.project!.apply(this, args);\n } catch (err) {\n this.destination.error!(err);\n return;\n }\n this.destination.next!(result);\n }\n}\n","import {Directive, OnDestroy} from '@angular/core';\r\nimport {MonoTypeOperatorFunction, Observable, Subject} from 'rxjs';\r\n\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport {throwAsyncError} from '../errors';\r\n\r\n// This is an interface to expose an Observable that emits when the implementing class is destroyed\r\nexport interface Destroyable$ {\r\n onDestroy$: Observable<any>;\r\n}\r\n\r\n// This can contain stuff shared across classes for services, components, etc\r\n@Directive()\r\n// tslint:disable-next-line:directive-class-suffix\r\nexport class ApBaseClass implements OnDestroy, Destroyable$ {\r\n readonly onDestroy$: Subject<void> = new Subject<void>();\r\n\r\n throwAsyncError(error: unknown): void {\r\n throwAsyncError(error);\r\n }\r\n\r\n takeUntilDestroy<T>(): MonoTypeOperatorFunction<T> {\r\n return takeUntil(this.onDestroy$);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.onDestroy$.next();\r\n this.onDestroy$.complete();\r\n }\r\n}\r\n","// throw an error that would be picked up as an unhandled error,\r\n// without having to emit an error on the observable (which would close the stream).\r\n// There could be unintended issues with doing it this way, but it seems fine for now i guess.\r\n// This is basically like hostReportError in rxjs\r\nexport function throwAsyncError(error: unknown): void {\r\n setTimeout(() => {\r\n throw error;\r\n });\r\n}\r\n","import {Injectable} from '@angular/core';\r\n\r\n// Currently, Guids coming from the server that are serialized in a dto will be lowercase,\r\n// so really these could and should all be lowercase.\r\n// However, there are situations where that would break current functionality.\r\n// Example: there is JSON in the db for FND and Homepage which has the Guids as uppercase,\r\n// so the constants in here kinda need to match that.\r\n// Updating 1 would require updating both, and possibly could cause other unknown issues.\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\n/* tslint:disable:variable-name comment-format max-line-length */\r\nexport class SystemGuid {\r\n static readonly ajsFactoryName = 'SystemGuid';\r\n\r\n readonly GuidEmpty = '00000000-0000-0000-0000-000000000000';\r\n readonly CareTeam = '10101010-0000-0000-0000-000000000001';\r\n readonly Everyone = '00000101-0000-0000-0000-000000000000';\r\n\r\n // Messaging module guids\r\n readonly BuildInMessageImplementation = '10101010-0000-0000-0000-000000000006';\r\n readonly ApproveMessageImplementation = '10101010-0000-0000-0000-000000000007';\r\n\r\n // Message Urgency\r\n readonly RoutineMessageUrgency = 'c2a64d38-3be1-4f8a-8947-ef9e9ad861a4';\r\n\r\n // Message Types\r\n readonly AAMessageType = '10101010-0000-0000-0000-000000000002';\r\n readonly TCMessageType = '10101010-0000-0000-0000-000000000003';\r\n readonly RxMessageType = '10101010-0000-0000-0000-000000000004';\r\n readonly TaskMessageType = '10101010-0000-0000-0000-000000000005';\r\n readonly TaskMessageType_Procedure = '10101010-0000-0000-1111-000000000005';\r\n readonly HL7MessageType = '10101010-0000-0000-0000-000000000008';\r\n readonly ANMessageType = '10101010-0000-0000-0000-000000000009';\r\n readonly ClaimErrorMessageType = '10101010-0000-0000-0000-000000000010';\r\n readonly MessageAttachHTML = '10101010-0000-0000-0000-000000000011';\r\n readonly ERxRefillMessageType = 'd7716f70-61d6-4ec0-8ba6-01afc95e99f2';\r\n readonly RxRefillMessageType = 'a2b88bc2-e7c8-4990-92f6-ae28b5c0dc77';\r\n readonly ChangeRxMessageType = '2C259B74-444F-4F29-9634-5768DDA9E572';\r\n readonly ChangeRxPriorAuthorizationMessageType = '61A96124-6977-491E-9390-EF506DBBC05F';\r\n readonly RxRefillRequestMessageType = 'EB31DF6B-3685-4639-81F6-026F6278E1DC';\r\n readonly SurveyMessageType = '5e9280e5-3388-49e8-a5ae-4dffbb0a9b89';\r\n readonly AuthorizationMessageType = '34e136de-85d4-4bdf-a487-7972ea3ce105';\r\n readonly MessageAttachmentType = '10101010-0000-0000-0000-000000000012';\r\n readonly InstantMessageMessageType = '3c2fa842-9097-483a-bff8-2e7e47f2b6e2';\r\n readonly CollectionMessageMessageType = '7a0ea261-29e8-44be-9e0a-13bdaa7b282a';\r\n readonly StrikeOutMessageType = 'e3226583-1509-4ef1-9647-e5d5991dd41a';\r\n readonly LabMessageType = 'f05f9c71-a893-46c3-a7fe-37988f48a782';\r\n readonly PatientLabOrderMessageType = '77882a75-7c9d-430b-9da6-f8ed12058ddb';\r\n readonly ERxChangeMessageType = 'f4bee48e-2975-46d5-acc8-4a04126f5275';\r\n readonly ERxEligibilityMessageType = '10101010-0000-0000-0000-000000000014';\r\n readonly ERxMedicationHistoryMessageType = '10101010-0000-0000-0000-000000000013';\r\n readonly PatientEmergencyChartAccessMessageType = '07dfc802-0ce9-4381-bdae-959315458476';\r\n readonly VisitBillingReviewMessageType = '81ad57ba-e3f1-4b8f-b3f2-23a189fba3e5';\r\n readonly VaccineAdministrationMessageType = '3a68f4d0-b93d-4f9d-8036-1a89db86cdd5';\r\n readonly PatientReferralMessageType = 'b2a91010-cd37-4391-a850-683d230c177f';\r\n readonly RefundTaskMessageType = '52249495-41c2-4c68-b027-eac66218599f';\r\n readonly FinancialChangeAlertMessageType = '2cc02936-d3d5-4887-8f8f-45831ce1a46a';\r\n readonly AmendmentMessageType = 'b1f8b643-cd55-410f-bc5d-649fb64e98ba';\r\n readonly FacilityPortalMessageType = 'aa62132e-6f9b-46b1-bcba-987ce73bee89';\r\n readonly EPCSSignatureRightsMessageType = '35A799B9-AB5C-4E16-B527-C4FC0C2072B0';\r\n // Message SubTypes\r\n readonly MessageRxRequestSubType = '136d8762-82ec-487d-9448-f52469a3cdcd';\r\n readonly MessageRxResponseSubType = 'd0ddd888-de71-4156-a2d8-6f1f4068b249';\r\n readonly MessageRxElectronicTransmissionErrorSubType = 'f28b3d6a-2244-4197-8133-aeef881354fa';\r\n readonly JobEngineSubMessageType = '00000000-0000-0000-7777-200000000001';\r\n readonly DocumentFaxErrorSubMessageType = '77ef2a24-7e5e-436c-b689-8427ae45e7bf';\r\n readonly PatientSurveySubMessageType = '0266be8e-73d2-452c-89fb-e16786ebdd94';\r\n readonly PatientDemographicsSubMessageType = 'd1d54662-29c2-44da-a0cf-28fefdf5d825';\r\n readonly PatientAppointmentRequestSubMessageType = '4778614c-4594-4d1b-851d-5c67d21c5776';\r\n readonly PatientRxRefillRequestSubMessageType = 'b1b7d286-1fb2-43d0-a883-7946b1cd8751';\r\n readonly PatientAmendmentSubMessageType = 'e9fc14a7-0f2a-47ab-8fc3-4a04b7a20247';\r\n readonly AttachmentSubMessageType = '458dadad-5879-43d0-b94e-603d312b1ca7';\r\n readonly PatientPortalRxRefillMessageSubType = 'F4404BED-406D-4E46-B514-93D5D81F73D2';\r\n //\r\n //\r\n readonly PatientGeneralQuestionSubMessageType = '9af1089b-e98b-4758-80f8-0435b143426d';\r\n readonly PatientAppointmentQuestionSubMessageType = 'fd4e2c5d-29c6-4a51-bd20-551d6ed90843';\r\n readonly PatientRxQuestionSubMessageType = 'e94b7146-407d-4f92-a393-de8429b7bfbf';\r\n readonly PatientDemographicsQuestionSubMessageType = 'dffb40d0-2318-41a9-8eef-94c58babb9b9';\r\n readonly PatientBillingQuestionSubMessageType = '73366ba8-0149-47e0-875b-cb12bb4cb250';\r\n readonly PatientEmailNewPatientAccountSubMessageType = '897562e2-94cd-4a0f-9f8c-2fcff3fe95ff';\r\n readonly PatientEmailNewPortalAccountSubMessageType = '28652a5e-19e3-45ea-a6ba-f546d50e7fe7';\r\n readonly PatientPortalErrorSubMessageType = '786e319f-01ef-48b8-a5a2-8499334a660d';\r\n readonly PatientSubmitLoginAssistanceType = 'eca5b8a3-8371-4c08-bf43-386bac737d3f';\r\n readonly CDSReminderSubMessageType = '45d56c6b-f843-4e12-8d41-dc0f728c8b41';\r\n readonly PatientRecallSubMessageType = 'af799cc9-343c-4b2e-876d-36ce0ebdbf5a';\r\n readonly PatientFamilyHistorySubMessageType = '2a00a8fb-4a0e-49c0-9dfa-c94a9ae6f165';\r\n readonly PatientServiceOrderSubMessageType = '8080c9d5-be1c-478b-af6c-e179102e0c46';\r\n readonly PatientWelcomeMessagePracticeDefaultSubMessageType = 'd9a50836-98bb-4157-94ff-10a61c4f8355';\r\n readonly PatientWelcomeMessageProviderOverrideSubMessageType = '3ff6ab41-02f2-4835-90d0-7093311e7ca0';\r\n //\r\n readonly HMRuleMessageSubType = '10101010-0000-0000-0000-000000000050';\r\n readonly ReplicationMessageSubType = '594d621b-cbf4-4e1f-bafc-5195abc0ea9e';\r\n readonly MessageProcedureRequestSubType = '6116da32-d833-4b3d-ba27-e7bec468fb6f';\r\n readonly PatientVisitNoteAccessSubMessageType = '2a470344-8bb2-46a5-8893-73701911fc96';\r\n readonly PatientChartAccessSubMessageType = '015a35fc-7c0e-4ac8-8ec9-3946a302028b';\r\n readonly CPOBillingMessageSubType = '5214f054-5369-4102-97e4-9abbae205b66';\r\n readonly SecurityAlertMessageSubType = '99810285-c0da-4e4a-8f23-8f6100fbdec3';\r\n readonly ScheduledReportMessageSubType = '99b8ef67-faf4-4a15-abc5-76d95d826093';\r\n readonly ClaimReportMessageSubType = '02430101-0067-485e-8431-842a420c2d41';\r\n readonly CancelledServiceOrderSubType = 'cba8e1a7-e65c-4eca-b3a3-c2cbedf6d7d3';\r\n readonly CarePlanMessageSubType = '18cb87f2-291e-47b6-b1eb-8c2ad96a9b6c';\r\n readonly CCMMessageSubType = '65e1a474-3ef4-41a0-ba88-473ec2c11011';\r\n //BEGIN MICROSELECT CHANGES\r\n readonly CollectionStatusExpirationMessageSubType = '806a2155-acf7-4d0a-b83f-915232530e50';\r\n //END MICROSELECT CHANGES\r\n readonly AuthorizationRequestSubType = '3febe005-809b-4c15-ae4a-3e7bcf12f2b1';\r\n readonly AuthorizationResponseSubType = '34830710-2326-468c-a58c-355165a7d5e1';\r\n //\r\n //\r\n readonly AccountChangeAlertSubType = '43580720-de8c-4ccb-8c8a-170a3d8cda65';\r\n //\r\n //\r\n readonly PatientLabOrderRequestSubType = '22a2b2b0-d3c5-4229-84a4-9db792836f58';\r\n readonly PatientLabOrderResponseSubType = '73fc9cfd-777d-497b-8c18-a9c09bc489c4';\r\n readonly DocumentGenerationInstructionsSubType = '25fb8f0e-22cf-41dc-a63a-e10d49a34e8e';\r\n readonly CompleteChartPrintSubType = '5b6f1708-e35c-4264-b4aa-a53a5dca7446';\r\n readonly ProviderIDVerificationSubType = '00cdcaeb-d65b-4a1d-976e-b349a3e48da1';\r\n readonly RequestGrantProviderEPCSRightsSubType = '082a7b1b-9a44-408b-87fd-6508b90544fe';\r\n readonly RequestRevokeProviderEPCSSubType = '77e7df51-c19f-45ba-88a0-9f3492159ffd';\r\n\r\n readonly DirectMailWithoutAttachmentMessageSubType = '613f69c5-42f4-4f81-ae64-deedb3670490';\r\n readonly DirectMailWithAttachmentMessageSubType = '6347edde-54ee-4da1-b912-ea742030efc3';\r\n readonly UrlLinkMessageSubType = 'fd530fb4-05e3-46fe-8abb-6bfc3c1cd531';\r\n readonly ElectronicResultMessageSubType = '43bca388-7d6c-466b-b859-0480156ec4f2';\r\n\r\n readonly ERxMessageDenyReasonRefillNotAppropriate = 'fffa4de9-d931-4311-8969-0dbd4e9c25ee';\r\n readonly ERxMessageDenyReasonPatientUnknownToPractice = 'b2464f3f-7ab4-4c18-b36f-96bf046b1c00';\r\n\r\n // KS - These were commented out, but I had to add them back in when re-generating prm.xml from scratch\r\n readonly MessageStatusNew = '10101010-0000-0000-0000-000000000010';\r\n readonly MessageStatusView = '10101010-0000-0000-0000-000000000011';\r\n readonly MessageStatusComplete = '10101010-0000-0000-0000-000000000012';\r\n readonly MessageStatusWait = '10101010-0000-0000-0000-000000000013';\r\n\r\n readonly KdbSecurityGroup = '10101010-0000-0000-0000-000000000021';\r\n // fixed bug #17788.\r\n //KdbSecurityGroupAllow = '82276eab-504d-46b6-8aea-4d9ab1c0bab8';\r\n readonly ClinicalDelgateSecurityAllow = '82276eab-504d-46b6-8aea-4d9ab1c0bab8';\r\n readonly SecurityListEditorObjects = '10101010-0000-0000-0000-000000000022';\r\n readonly SecurityListReportObjects = '10101010-0000-0000-0000-000000000023';\r\n readonly SecurityListFilterObjects = '10101010-0000-0000-0000-000000000024';\r\n readonly ReportSecurity = '10101010-0000-0000-0000-000000000025';\r\n\r\n readonly AttachmentHandler_GraphicNote = '10101010-0000-0000-0000-000000000100';\r\n readonly AttachmentHandler_AllFiles = 'fc724a17-fdc7-4a0c-89a2-6a02f6b3e701';\r\n readonly AttachmentHandler_Bmp = '1d037286-73d1-4ca3-b9f8-3dff4fb459a0';\r\n\r\n // List Report\r\n readonly Report_CQM = '153cab39-18ff-416b-bd31-178f92fc23ff';\r\n readonly Report_HEDIS = '3d2bda74-02bf-45d3-ad7f-06e3ae7bd173';\r\n\r\n /* reserve Uid's 102 - 109 for ListJobScheduleTimeBase */\r\n readonly HL7ListenerJob = '10101010-0000-0000-0000-000000000110';\r\n\r\n // Financial center\r\n readonly MainFinancialCenterUid = '14b99c94-edac-47bd-97b9-cf421ac16018';\r\n\r\n // Claims\r\n readonly ClaimReportStatusNewUid = '00000000-0000-0000-0000-000000000010';\r\n readonly ClaimReportStatusReviewedUid = '00000000-0000-0000-0000-000000000011';\r\n readonly PaperClaimOptionDefaultToElectronicUid = '5b36f9c3-b1cf-4e80-8541-11397058b723';\r\n readonly PaperClaimOptionSecondaryClaimsPrintUid = '9cb84c44-19f5-4f32-809c-3350bbe99aca';\r\n readonly PaperClaimOptionAllClaimsPrintUid = '09aa94e4-e72b-499e-bf6e-e5fe9e05d8b8';\r\n\r\n // Statements\r\n readonly ETacticsHL7PartnerUid = '905317b4-d36e-4b19-9d79-244a67b9274e';\r\n readonly ETacticsCreateHL7PartnerMessageUid = '76c48549-a2fb-4396-a0d9-6dc9c05dbff6';\r\n readonly PrintStatementActionUid = 'a88f5a75-0ad5-4c90-b006-8a007a7fa13c';\r\n readonly SubmitStatementActionUid = 'dd9e9acd-0a49-44f3-b0b0-ece163fd8d42';\r\n readonly PrintPreviewStatementActionUid = '067ab4ce-7bc3-4da5-8fa8-f8f5db24057e';\r\n readonly PracticeInsightElectronicStatementsHL7PartnerUid = '66f598ce-0658-4ab4-814f-d2aa59cded6c';\r\n readonly PracticeInsightElectronicStatementsHL7PartnerMessageUid = 'd7c2b2b0-6c9f-4676-b5df-04d8c6bf44a9';\r\n readonly ProcessStatementActionUid = '6fcad410-fe20-426f-b996-1b39650bc409';\r\n\r\n // Payment types\r\n readonly PaymentTypeCheckUid = '97270636-da7a-4e41-9fe9-e42b8dfa2f13';\r\n readonly PaymentTypePureAdjustmentUid = '4a3eea98-802c-45f8-b3a1-d9957eafd075';\r\n\r\n // Deposit macros\r\n readonly ListDepositMacro_Visit = '2f480610-bc75-4193-9072-1d4cd9e5788c';\r\n readonly ListDepositMacro_Account = '1dea5e1c-440d-4177-84b0-26aa78103fae';\r\n readonly ListDepositMacro_RPOldestFirst = '2318d5e2-cc3f-428f-89a3-fe57338333cf';\r\n\r\n // payer credit refund status\r\n readonly ListPayerCreditRefundStatus_Pending = '66872612-1a69-4c93-90a2-819288479ab2';\r\n readonly ListPayerCreditRefundStatus_Approved = 'b0f4343b-ac05-492a-91f7-2e41d5e9d197';\r\n readonly ListPayerCreditRefundStatus_Rejected = '2049316f-4819-4d51-8d04-488b000b85bc';\r\n readonly ListPayerCreditRefundStatus_Open = '5279aee2-ef6a-44e5-8a3c-a6a4a916db40';\r\n readonly ListPayerCreditRefundStatus_Closed = '296b823d-78dc-4f60-a24d-e000e162e3cb';\r\n\r\n // Appointment\r\n readonly ScheduledAppointmentStatusUid = '17982339-1dfe-4d69-ac0e-8f3af4087255';\r\n readonly CancelledAppointmentStatusUid = '9c52e394-e4b6-450c-aba2-87b2a75fdb13';\r\n readonly NoShowAppointmentStatusUid = 'e7be0240-f633-4271-9054-50f1b5c1e9d4';\r\n readonly CheckedInAppointmentStatusUid = 'cd2a0578-0c89-4151-b4e9-66ed9d5b4995';\r\n readonly DischargedAppointmentStatusUid = '31886389-631f-4d03-bc28-b4db87e9b172';\r\n readonly ReadyToDischageAppointmentStatusUid = 'c8f3cd36-ff13-4088-8181-81ed9b14dbd1';\r\n readonly AppointmentCallStatusConfirmed = '20af514b-517b-4419-88c9-6725b2469989';\r\n readonly NeedToRescheduleAppointmentStatusUid = '923ed792-581d-4610-9f17-9fa915df97b2';\r\n\r\n // Fee schedules\r\n readonly DefaultAmountAllowedScheduleUid = '00000000-0000-0000-0fee-000000000001';\r\n\r\n readonly UserDefinedGroupType = '10101010-0000-0000-0000-000000000099';\r\n\r\n // Attachments\r\n readonly AttachmentType_Dictation = '00000000-0000-0000-8888-000000000004';\r\n readonly AttachmentType_CCDCDataExchangExport = '82e352da-9dea-48ff-9ee6-108aff424bb5';\r\n\r\n // Reports\r\n readonly ReportAppointment = '9e8a3f49-d368-48dc-a65f-dbd3d96ed4b9';\r\n readonly ReportBalanceAndCloseCharges = 'ee20411b-a90f-4327-b145-7a358b332bae';\r\n readonly ReportBalanceAndCloseTransactions = 'a1eb2c50-66eb-4e28-8a22-073e000a9fa7';\r\n readonly ReportCapitation = '729b0f35-d190-458e-ae64-91edd24b1d6e';\r\n readonly ReportCMS1500 = '7e372962-6870-41d2-9162-76d0e643fea1';\r\n readonly ReportCMS1500NPI = '58ea30f7-d52f-4aee-92cd-3701204d763b';\r\n readonly ReportCMS1500NPI5010 = '09676db6-dfb9-4d9a-a204-f0c7465231f4';\r\n readonly ReportCollectionsInsurance = '38373452-9546-46fb-901f-d5e4d7be8703';\r\n readonly ReportCollectionsPatient = 'ece75489-f96e-4a5c-b6d1-cd1d8840dadc';\r\n readonly ReportDepositSlip = 'eb6ae34c-af06-4cdc-ac77-a1151ee4848b';\r\n readonly ReportHL7LabReport = 'a26cda78-dd9f-4253-b4cc-e26e227877cf';\r\n readonly ReportInsuranceAging = '4e5703f5-6389-4981-ad1e-d152d8025045';\r\n readonly ReportNoSB_Encounters = '9b35b7d0-d8a6-46be-94bc-711550e7a6fc';\r\n readonly ReportPatientLedger = 'c7aa9366-ba87-41bf-8895-9cfd6a1a9968';\r\n readonly ReportPracticeFinancials = '5d890d9f-c967-4f95-b280-8ed488dcf853';\r\n readonly ReportPrescription = 'f8eaa510-83c6-4575-a124-ed5ddecc1b76';\r\n readonly ReportProcedureProductivity = '70d9290a-2265-4059-a1b8-071b353f4327';\r\n readonly ReportStatementBatch = '53bebc35-28b7-4ef9-b479-21e0ff8d1767';\r\n readonly ReportStatementDetails = 'ab980a4e-d02d-402c-b88b-16cfc14e54d8';\r\n readonly ReportStatementBatchMainAccount = '9b3ecd3c-e695-43b0-a5d7-e4524dc33b4a';\r\n readonly ReportStatementDetailsMainAccount = 'ab08221b-61bf-4f7d-9554-d0a84deecd67';\r\n readonly ReportTotalAR = '9d6625bf-4f6b-4944-a402-8d1c5083789d';\r\n readonly ReportVisitsWithoutSBs = 'f8414e3f-9aa2-42c7-a4f2-0cd060e30bb5';\r\n readonly ReportMedicationTimeFlow = 'e8fcf679-a654-4b12-85ad-fb7e107ad377';\r\n readonly ReportSuperbill = 'bb768412-3b62-425b-9e70-4becc6783702';\r\n readonly ReportERA = '92256504-356b-41ae-b68d-84076d3d2e2c';\r\n readonly ReportStatementBatchByFinancialCenter = 'aa491038-ac02-458d-b5d9-682e229b3e8c';\r\n readonly ReportStatementDetailsByFinancialCenter = 'a77ef1c5-f9ec-4597-9646-b96b8fc0054b';\r\n readonly ReportStatementBatchMainAccountByFinancialCenter = 'cd3c82a1-ae62-49c0-8587-6f859029fa2b';\r\n readonly ReportStatementDetailsMainAccountByFinancialCenter = 'e57f4dce-a24d-470c-b163-42060726cf91';\r\n readonly ReportPrintAttachmentText = 'a363aed0-4a54-4576-b79e-d8fc90bc52fe';\r\n readonly ReportPrintAttachmentImage = 'd541d42f-b4a2-4dba-be41-52ddbec8facf';\r\n readonly ReportPrintAttachmentNoNote = 'f5777afe-de62-4959-a3b1-08779dac8341';\r\n readonly ReportPrintAttachmentImageOnly = '363e08f6-ad10-4b07-827e-097d13af5537';\r\n readonly ReportGroupVisitRosterSignInSheet = '75ee272a-0890-40c4-944c-3e865ecd0042';\r\n\r\n readonly ReportPatientRecordDisclosure = 'f7b11729-c421-4b92-b177-343018f4a81a';\r\n readonly ReportCDSReminders = 'b9ba795f-71fa-4e33-a9dd-40f09819388b';\r\n readonly ReportCallpointeMU = '6cdf8b90-0071-49a8-a534-64134f00599c';\r\n\r\n // fixed bug #15134.\r\n readonly ReportPrintAttachmentTIF = '1f505b4d-9b89-44c2-8924-c09133fc7a15';\r\n readonly ReportMedicationReviewForm = '900377c9-d12c-4f73-b5f0-429ff928def8';\r\n readonly AppointmentChargeTicket = 'd8b62581-8cc1-4d09-b078-6372e9cfdaf0';\r\n readonly ListFindTable_Reports = '6c57e4a8-1314-4e42-9100-24534d01b887';\r\n readonly ListFindTable_DiagnosisCode10 = '48ac27ee-cb5a-4be6-b43c-d98534fb484e';\r\n //Refund reports\r\n readonly ReportRefundCheck = '69305c0d-881f-4b24-bbe6-4dbdc6af8523';\r\n readonly ReportRefundCheckRegister = 'e85955b5-b04f-4e1d-9668-3e8d8154f69e';\r\n\r\n //CYS SC\r\n readonly ReportUB04 = '4ee0fb9c-41cc-4da9-964c-ddbb588c7a72';\r\n\r\n //Added for ABN\r\n readonly ReportCMSR131L = 'b7c160c6-dbc9-4380-a2c2-c18a9f0dbec2';\r\n //BEGIN MICROSELECT CHANGES\r\n readonly ReportResponsiblePartyAccountPage = '90c232e9-7941-4629-bb86-a0be2a1325d4';\r\n //END MICROSELECT CHANGES\r\n\r\n // Vitals\r\n readonly Vital_BMI = '00000000-0000-0000-7777-100000000007';\r\n readonly Vital_Temperature = '00000000-0000-0000-7777-100000000008';\r\n readonly Vital_Temperature_Method = '00000000-0000-0000-7777-100000000009';\r\n readonly Vital_RR = '00000000-0000-0000-7777-100000000010';\r\n readonly Vital_RR_Condition = '00000000-0000-0000-7777-100000000011';\r\n readonly Vital_SpO2 = '00000000-0000-0000-7777-100000000012';\r\n readonly Vital_SpO2_Condition = '00000000-0000-0000-7777-100000000013';\r\n readonly Vital_SpO2_Method = '00000000-0000-0000-7777-100000000014';\r\n readonly Vital_Comment = '00000000-0000-0000-7777-100000000015';\r\n\r\n readonly Vital_Metric_Head_Circ = '00000000-0000-0000-7777-100000000069';\r\n\r\n readonly Vital_HR_Method = '00000000-0000-0000-7777-100000000016';\r\n readonly Vital_HR_Value_Sitting = '00000000-0000-0000-7777-100000000017';\r\n readonly Vital_HR_Value_Standing = '00000000-0000-0000-7777-100000000018';\r\n readonly Vital_HR_Value_Supine = '00000000-0000-0000-7777-100000000019';\r\n readonly Vital_HR_Location_Sitting = '00000000-0000-0000-7777-100000000020';\r\n readonly Vital_HR_Location_Standing = '00000000-0000-0000-7777-100000000021';\r\n readonly Vital_HR_Location_Supine = '00000000-0000-0000-7777-100000000022';\r\n readonly Vital_HR_Regularity_Sitting = '00000000-0000-0000-7777-100000000023';\r\n readonly Vital_HR_Regularity_Standing = '00000000-0000-0000-7777-100000000024';\r\n readonly Vital_HR_Regularity_Supine = '00000000-0000-0000-7777-100000000025';\r\n\r\n readonly Vital_BP_Location_1 = '00000000-0000-0000-7777-100000000051';\r\n readonly Vital_BP_Position_1 = '00000000-0000-0000-7777-100000000052';\r\n readonly Vital_BP_Sys_1 = '00000000-0000-0000-7777-100000000053';\r\n readonly Vital_BP_Dias_1 = '00000000-0000-0000-7777-100000000054';\r\n readonly Vital_BP_Location_2 = '00000000-0000-0000-7777-100000000055';\r\n readonly Vital_BP_Position_2 = '00000000-0000-0000-7777-100000000056';\r\n readonly Vital_BP_Sys_2 = '00000000-0000-0000-7777-100000000057';\r\n readonly Vital_BP_Dias_2 = '00000000-0000-0000-7777-100000000058';\r\n readonly Vital_BP_Location_3 = '00000000-0000-0000-7777-100000000059';\r\n readonly Vital_BP_Position_3 = '00000000-0000-0000-7777-100000000060';\r\n readonly Vital_BP_Sys_3 = '00000000-0000-0000-7777-100000000061';\r\n readonly Vital_BP_Dias_3 = '00000000-0000-0000-7777-100000000062';\r\n readonly Vital_BP_Location_4 = '00000000-0000-0000-7777-100000000063';\r\n readonly Vital_BP_Position_4 = '00000000-0000-0000-7777-100000000064';\r\n readonly Vital_BP_Sys_4 = '00000000-0000-0000-7777-100000000065';\r\n readonly Vital_BP_Dias_4 = '00000000-0000-0000-7777-100000000066';\r\n\r\n // blood pressure locations in table \"ListMisc\" to find BP locations\r\n readonly Vital_BP_Location_NotSelected = '00000000-0000-0000-7777-000000000101';\r\n readonly Vital_BP_Location_LeftArm = '00000000-0000-0000-7777-000000000102';\r\n readonly Vital_BP_Location_RightArm = '00000000-0000-0000-7777-000000000103';\r\n readonly Vital_BP_Location_LeftLeg = '00000000-0000-0000-7777-000000000104';\r\n readonly Vital_BP_Location_RightLeg = '00000000-0000-0000-7777-000000000105';\r\n\r\n // blood pressure positions in table \"ListMisc\" to find BP positions\r\n readonly Vital_BP_Position_NotSelected = '00000000-0000-0000-7777-000000000106';\r\n readonly Vital_BP_Position_Sitting = '00000000-0000-0000-7777-000000000107';\r\n readonly Vital_BP_Position_Standing = '00000000-0000-0000-7777-000000000108';\r\n readonly Vital_BP_Position_Supine = '00000000-0000-0000-7777-000000000109';\r\n\r\n // Heart rate guids (same as orginal sitting, standing and supine)\r\n readonly Vital_Heart_Rate_1 = '00000000-0000-0000-7777-100000000017';\r\n readonly Vital_Heart_Rate_2 = '00000000-0000-0000-7777-100000000018';\r\n readonly Vital_Heart_Rate_3 = '00000000-0000-0000-7777-100000000019';\r\n\r\n // Heart Rate and Blood Pressure Position in guids in table \"ListMisc\" (same as the orginal blood pressure)\r\n readonly Vital_Position_Sitting = '00000000-0000-0000-7777-000000000107';\r\n readonly Vital_Position_Standing = '00000000-0000-0000-7777-000000000108';\r\n readonly Vital_Position_Supine = '00000000-0000-0000-7777-000000000109';\r\n\r\n // weight dress options in table \"ListMisc\" to find weight dress options\r\n readonly Vital_Weight_Dress_NotSelected = '00000000-0000-0000-7777-000000000001';\r\n readonly Vital_Weight_Dress_Clothed = '00000000-0000-0000-7777-000000000002';\r\n readonly Vital_Weight_Dress_Unclothed = '00000000-0000-0000-7777-000000000003';\r\n\r\n // respiratory rate conditions in table \"ListMisc\" to find respiratory rate conditions\r\n readonly Vital_Respiratory_Rate_NotSelected = '00000000-0000-0000-7777-000000000021';\r\n readonly Vital_Respiratory_Rate_Quiet = '00000000-0000-0000-7777-000000000022';\r\n readonly Vital_Respiratory_Rate_Sleeping = '00000000-0000-0000-7777-000000000023';\r\n readonly Vital_Respiratory_Rate_Crying = '00000000-0000-0000-7777-000000000024';\r\n\r\n // heart regularity conditions in table \"ListMisc\" to find heart regularity conditions\r\n readonly Vital_Heart_Regularity_Regular = '00000000-0000-0000-7777-000000000081';\r\n readonly Vital_Heart_Regularity_Irregular = '00000000-0000-0000-7777-000000000082';\r\n readonly Vital_Heart_Regularity_RegularRegular = '00000000-0000-0000-7777-000000000083';\r\n readonly Vital_Heart_Regularity_RegularIrregular = '00000000-0000-0000-7777-000000000084';\r\n readonly Vital_Heart_Regularity_IrregularRegular = '00000000-0000-0000-7777-000000000085';\r\n readonly Vital_Heart_Regularity_IrregularIrregular = '00000000-0000-0000-7777-000000000086';\r\n\r\n //vitals weight and height guids\r\n readonly Vital_MetricWeight = '00000000-0000-0000-7777-100000000070';\r\n readonly Vital_MetricHeight = '00000000-0000-0000-7777-100000000071';\r\n readonly Vital_MetricTemp = '00000000-0000-0000-7777-100000000072';\r\n readonly Vital_ImperialTemp = '00000000-0000-0000-7777-100000000077';\r\n\r\n // vitals blood pressure guids\r\n readonly Vital_BloodPressureMethod = '00000000-0000-0000-7777-100000000026';\r\n readonly Vital_MetricBloodPressure1 = '00000000-0000-0000-7777-100000000073';\r\n readonly Vital_MetricBloodPressure2 = '00000000-0000-0000-7777-100000000074';\r\n readonly Vital_MetricBloodPressure3 = '00000000-0000-0000-7777-100000000075';\r\n readonly Vital_MetricBloodPressure4 = '00000000-0000-0000-7777-100000000076';\r\n readonly Vital_HeadCircumference = '00000000-0000-0000-7777-100000000006';\r\n readonly Vital_WaistMeasure = '2a11dc70-be5f-40aa-a34a-caef718d0513';\r\n\r\n // List Signature Source\r\n readonly ListSignatureSource_Medical_Records_Release = '42de70f4-9f0f-4a08-b446-e1e5027e7e00'; // Signature on file for medical records release\r\n\r\n // ListSuperbillStatus\r\n readonly ListSuperbillStatus_AprimaVaultDataConversionComplete = '0e755dd2-6a40-47b4-a60c-d06257ee58e0';\r\n readonly ListSuperbillStatus_Cancelled = 'fc8ad61b-139a-4cfa-9580-cdacfc3acf90';\r\n readonly ListSuperbillStatus_Complete = '30f64d66-55cb-4438-bb2f-7a6250399312';\r\n readonly ListSuperbillStatus_Filed = '9ffe6214-7c7f-4516-9899-43d37fabe21d';\r\n readonly ListSuperbillStatus_Hold = '5d149ced-a42f-4a23-a236-f1c9c48ee8b1';\r\n readonly ListSuperbillStatus_Insurance_Action = 'b4d6b17e-a8a1-425d-95d3-5d29b465d682';\r\n readonly ListSuperbillStatus_Account_Change_Alert = 'b42f00ab-32ea-4d81-81e9-b4ad186fac4f';\r\n readonly ListSuperbillStatus_Overpaid = '43c2c635-184b-4e5e-a893-d2030bde7df3';\r\n readonly ListSuperbillStatus_Pending_Patient_Payment = 'd2bf0f3c-6e03-478f-bdae-4dcac5eb9410';\r\n readonly ListSuperbillStatus_Preliminary = 'df81be7c-71cf-47f4-8573-733e81e30ea8';\r\n readonly ListSuperbillStatus_Queued = '0b42c4c4-6d7e-41f2-9d08-b28f17404e79';\r\n readonly ListSuperbillStatus_Ready_to_Review = 'd2291c14-3f4e-4381-80a7-883c76c9499b';\r\n readonly ListSuperbillStatus_Ready_to_Submit = '55ed3239-89f3-4488-89c9-71be5a541cc4';\r\n readonly ListSuperbillStatus_Rejected = '2c4a6e7d-eb6d-4370-a836-5937363c6b69';\r\n readonly ListSuperbillStatus_Succeeded = 'd2341cba-6f5c-47d9-95a5-16d5680565c3';\r\n readonly ListSuperbillStatus_Failed_Validation = '695681c6-f9b3-45f6-a8fe-5fa3b1d07469';\r\n readonly ListSuperbillStatus_Passed_CodeValidation = '96d656a3-fea4-4aa4-9cc4-e39640ab5808';\r\n readonly ListSuperbillStatus_ERA_Claim_Rejected = '2352f0fb-708b-437e-9809-f80128195f9e';\r\n readonly ListSuperbillStatus_Queued_Rejected = '8bca307f-e59f-42f2-925b-b1c102a985f9';\r\n readonly ListSuperbillStatus_Batched = '3796674a-6a9e-45b3-abf3-0c3b606159dd';\r\n readonly ListSuperbillStatus_Batching = '55f1c3f2-2384-4d54-a9e5-fb60ddb28f76';\r\n\r\n // History group anchor questions for multirow groups - used to sync between Survey and PatientHistory tables\r\n readonly PatientHistory_AnchorQuestion_Immunization = '00000000-0000-0000-0000-000000111201';\r\n readonly PatientHistory_AnchorQuestion_Menstrual = 'ffffffff-0000-0000-0000-000000000001';\r\n readonly PatientHistory_AnchorQuestion_Pregnancy = '078dc26e-5ac4-4901-a7b9-cf310b9610eb';\r\n\r\n // History group uids from the OPS options panel\r\n readonly HistoryGroupMedicalHistory = '00000000-0000-0000-0000-000000000101';\r\n readonly HistoryGroupInfectionHistory = '00000000-0000-0000-0000-000000000102';\r\n readonly HistoryGroupSurgicalHistory = '00000000-0000-0000-0000-000000000103';\r\n readonly HistoryGroupFamilyHistory = '00000000-0000-0000-0000-000000000104';\r\n readonly HistoryGroupGeneticScreening = '00000000-0000-0000-0000-000000000105';\r\n readonly HistoryGroupSocialHistory = '00000000-0000-0000-0000-000000000106';\r\n readonly HistoryGroupMedicationHistory = '00000000-0000-0000-0000-000000000107';\r\n readonly HistoryGroupFoodAllergy = '00000000-0000-0000-0000-000000000108';\r\n readonly HistoryGroupDrugAllergy = '00000000-0000-0000-0000-000000000109';\r\n readonly HistoryGroupEnvironmentAllergy = '00000000-0000-0000-0000-000000000110';\r\n readonly HistoryGroupImmunizationHistory = '00000000-0000-0000-0000-000000000111';\r\n readonly HistoryGroupSpecialtyHistory = '00000000-0000-0000-0000-000000000112';\r\n readonly HistoryGroupMenstrualHistory = '00000000-0000-0000-0000-000000000114';\r\n readonly HistoryGroupPregnancyHistory = '00000000-0000-0000-0000-000000000115';\r\n readonly HistoryGroupFlowsheet = '00000000-0000-0000-0000-000000000011';\r\n readonly HistoryGroupObservationHistory = '00000000-0000-0000-0000-000000000116';\r\n readonly HistoryGroupProblemDiagnosis = '0238a133-904e-4e49-bdba-4eb3cb3b39a7';\r\n readonly HistoryGroupAddressHistory = '49283214-0137-45ed-893e-19fb6b688ebb';\r\n // added for new family history\r\n readonly HistoryGroupNewFamilyHistory = 'a3faf896-b328-4364-9621-012f8c6643bb';\r\n readonly HistoryGroupDSMIV = '167473e6-7f98-4840-870b-a5a5313b022e';\r\n readonly HistoryGroupCognitiveAssessment = '00000000-0000-0000-0000-000000000120';\r\n readonly HistoryGroupFunctionalAssessment = '00000000-0000-0000-0000-000000000121';\r\n // fix for senario #34484\r\n readonly HistoryGroupProcedureHistory = 'fa2b8214-a2ef-419d-8ef4-ce42ac4e8191';\r\n\r\n //freetext\r\n readonly HistoryGroupGenericFreeText = '00000000-0000-0000-0000-000000000267';\r\n\r\n //GUID constants for Immunization History\r\n readonly HistoryGroup_Immunization_Question_Vaccine = '00000000-0000-0000-0000-000000111201';\r\n readonly HistoryGroup_Immunization_Question_TypeofVaccine = '00000000-0000-0000-0000-000000111202';\r\n readonly HistoryGroup_Immunization_Question_DateGiven = '00000000-0000-0000-0000-000000111203';\r\n readonly HistoryGroup_Immunization_Question_Route = '00000000-0000-0000-0000-000000111204';\r\n readonly HistoryGroup_Immunization_Question_SiteGiven = '00000000-0000-0000-0000-000000111205';\r\n readonly HistoryGroup_Immunization_Question_LotNum = '00000000-0000-0000-0000-000000111206';\r\n readonly HistoryGroup_Immunization_Question_Manufacture = '00000000-0000-0000-0000-000000111207';\r\n readonly HistoryGroup_Immunization_Question_ExpDate = '00000000-0000-0000-0000-000000111208';\r\n readonly HistoryGroup_Immunization_Question_VISDate = '00000000-0000-0000-0000-000000111209';\r\n readonly HistoryGroup_Immunization_Question_VISGivenDate = '00000000-0000-0000-0000-000000111210';\r\n readonly HistoryGroup_Immunization_Question_Initial = '00000000-0000-0000-0000-000000111211';\r\n readonly HistoryGroup_Immunization_Question_Notes = '00000000-0000-0000-0000-000000111212';\r\n readonly HistoryGroup_Immunization_Question_FundingSource = '1d524fe4-8ac3-43f8-bd00-c08cec100ffa';\r\n\r\n readonly HistoryGroup_Immunization_Answer_Date = '00000000-0000-0000-0000-000000000171';\r\n readonly HistoryGroup_Immunization_Answer_Text = '00000000-0000-0000-0000-000000000288';\r\n\r\n readonly HistoryGroup_Immunization_VaccineFunding_AnswerGroup = 'a33cdd2b-67e3-4cc1-afd0-76a3e3d0fc0f';\r\n\r\n //unsupported questionnaire section\r\n readonly HistoryGroup_Immunization_FamilyImmunizationSection = '417ed290-1967-4f05-be18-1242b37d3f75';\r\n\r\n //Guid constants for vaccine route\r\n readonly VaccineRoute_PO = '47c0dd4e-cfa1-4a72-b623-0ad9d501fa81';\r\n readonly VaccineRoute_NS = 'c6e14630-95c2-4c47-ad37-4abbf79a9ed5';\r\n readonly VaccineRoute_OTH = '0ee77772-27ed-4b40-98ef-c4f1e3a4caec';\r\n\r\n // Answer Group\r\n readonly HistoryGroup_ANSWERGOUP_TIMEFRAME = '00000000-0000-0000-0000-000000101000';\r\n readonly HistoryGroup_ANSWERGOUP_FAMILY_DISEASE = '00000000-0000-0000-0000-000000104000';\r\n readonly HistoryGroup_ANSWERGOUP_REACTION = '00000000-0000-0000-0000-000000108000';\r\n\r\n // Question, Patient Takes No Medications\r\n readonly HistoryGroup_MedicationHistory_PatientTakesNoMeds = 'a9a4e0a0-443a-4734-8e3f-592abea0061b';\r\n\r\n //PQRI Related History Questions\r\n //Smoking\r\n readonly SocialHistory_TobaccoHistory = '00000000-0000-0000-0000-000000000008';\r\n readonly SocialHistory_TobaccoHistory_NeverSmoked = '00000000-0000-0000-0000-000000000047';\r\n\r\n readonly SocialHistory_TobaccoHistory_QuitSmoking5 = '00000000-0000-0000-0000-000000000051';\r\n readonly SocialHistory_TobaccoHistory_QuitSmoking10 = '00000000-0000-0000-0000-000000000052';\r\n readonly SocialHistory_TobaccoHistory_QuitSmoking10Plus = '00000000-0000-0000-0000-000000000053';\r\n // uses non smokeless tabacco\r\n readonly SocialHistory_TobaccoHistory_CurrentlySmokeless = '83569607-629e-4f31-a10b-af2a34326e1e';\r\n // smoking answer guids\r\n readonly SocialHistory_TobaccoHistory_CurrentlySmokes = '00000000-0000-0000-0000-000000000048';\r\n readonly SocialHistory_TobaccoHistory_EverydaySmoker = '292f21b1-9ca3-4ace-b5cd-fe73bf1b3a31';\r\n readonly SocialHistory_TobaccoHistory_SomeDaySmoker = '809d9f30-5e2c-4552-a7a9-a70e2eeb6031';\r\n readonly SocialHistory_TobaccoHistory_Smoker_StatusUnknown = '13d7e47e-1634-48cc-bb0c-5bf5675ca044';\r\n readonly SocialHistory_TobaccoHistory_HeavySmoker = 'f82a9884-3a7b-477e-a3cd-a30ab7afed42';\r\n readonly SocialHistory_TobaccoHistory_LightSmoker = '30daa871-dd29-44a1-a830-04150363421f';\r\n\r\n // Patient Communication Type\r\n readonly PatientCommunicationType_SmokingCessation = '8e30897b-39ac-456a-b8db-5f670b1ae009';\r\n readonly PatientCommunicationType_PhysicalActivity = '8b0798af-346d-4de5-abb9-2c29d59b8325';\r\n readonly PatientCommunicationType_Nutrition = '84b0c475-ef42-4988-b00a-d0b1d6e352fe';\r\n readonly PatientCommunicationType_Underweight = '84b0c475-ef42-4988-b00a-d0b1d6e35200';\r\n readonly PatientCommunicationType_Overweight = '84b0c475-ef42-4988-b00a-d0b1d6e35201';\r\n\r\n // Pregnancy CaseType UID\r\n readonly OBCaseTypeUid = '5bdc8794-20cb-4253-96af-0907e73b9185';\r\n readonly Disease_Pregnancy = '00000000-0000-0000-0000-000000101101';\r\n\r\n // 'special' uids for case modules\r\n readonly CaseTypeOBFlowsheet = '34157ce8-e296-4fdc-a060-e34de957022c';\r\n readonly CaseTypeOBEDD = '4b29d2ed-4983-4f4a-b16f-070659f6ac30';\r\n\r\n // eRx message type\r\n readonly eRxMessageType_new_rx = '9f19ed8c-3524-46ea-9f4b-b932d38f8585';\r\n readonly eRxMessageType_refill_request = '443d1a55-7384-495b-9bdf-15debd9379e2';\r\n readonly eRxMessageType_refill_response = '5151d647-729f-40f1-afe3-f0cdf31f12a7';\r\n readonly eRxMessageType_error_script = 'fbfe211c-18ba-4ddd-a5e2-817933847588';\r\n readonly eRxMessageType_status = '06d3f14d-3da4-4404-a45f-1b3294b487ed';\r\n readonly eRxMessageType_verify = '4cd98089-2475-4f86-a904-f0086cfc0b0b';\r\n readonly eRxMessageType_eligibity = '6b18c334-e4a6-4f82-a831-1aaa6cf6009e';\r\n readonly eRxMessageType_eligibility_response = '5506f18b-084c-489f-8891-89c76fb3dfab';\r\n readonly eRxMessageType_rx_history_request = '90db44ee-adea-427c-9450-b418f8577ade';\r\n readonly eRxMessageType_rx_history_response = '1a36a4a2-4b4f-4e49-8dc8-b6f13439fde3';\r\n readonly eRxMessageType_rx_cancel_request = 'c0bd8e17-1fcf-44b2-a1e8-99bb840e5591';\r\n readonly eRxMessageType_rx_cancel_response = 'f59bdcb7-8df9-4468-bbba-544415db133e';\r\n readonly eRxMessageType_rx_change_request = '2c259b74-444f-4f29-9634-5768dda9e572';\r\n readonly eRxMessageType_rx_change_response = '1c03a342-4fde-4dde-99cf-28bae7d1fa1a';\r\n readonly eRxMessageType_rx_formularyupdate = '4a412563-f3de-43f2-907e-3e6df8b20e90';\r\n readonly eRxMessageType_rx_formularylist = 'e76dcef2-7b7e-4640-b750-ea28768ebd2b';\r\n readonly eRxMessageType_rx_eprescribingactivityreportupdate = 'eff314ca-668b-4823-b206-366921a0d243';\r\n readonly eRxMessageType_pharmacy_update = '0ffde3e6-a37b-4885-a142-4430c7526fc3';\r\n readonly eRxMessageType_pharmacy_list = 'a68df433-597d-4e7c-800a-beb65397ff04';\r\n readonly eRxMessageType_prescriber_update = 'c0c8c0de-96f3-4efe-8db0-125d0b6dbe4f';\r\n readonly eRxMessageType_prescriber_list = 'f60e147c-81b2-4562-af18-a69e25ca2185';\r\n readonly eRxMessageType_inboundmessageroutingregistration = 'ce675e1b-3b82-4ec3-8d7b-3b1a027e42b4';\r\n readonly eRxMessageType_inbound = 'd375fb2c-454f-4175-a253-6a382028fb0a';\r\n readonly eRxMessageType_providerdirectory = 'be1a51c4-fa09-49fc-8c10-6e7f6f878b07';\r\n readonly eRxMessageType_formulary_download = 'a54ec9c9-ae68-4381-81fe-14cbff113e4e';\r\n readonly eRxMessageType_pharmacy_download = '93af01dc-c3a9-49d2-afb8-df6adb39d745';\r\n readonly eRxMessageType_prescriber_download = 'b0484716-ea09-4eb3-ba50-cbd352d4351f';\r\n\r\n // eRx status uid\r\n readonly eRxSentSuccessfulStatusUid = 'b1f7efaf-d56d-4bad-ae1f-8205e1d00b58';\r\n readonly eRxQueueForTransmissionStatusUid = '0605b6f6-2fe4-49cb-b868-9df448ab3e01';\r\n readonly eRxQueueForRxRefillAcceptUid = 'e2427516-e347-4586-af42-8c9a32872a78';\r\n readonly eRxControlledDrugStatusUid = '1a2ca5ed-297d-4973-858e-a79180565591';\r\n readonly eRxControlledDrugRequiresSignatureUid = 'e8b201fe-5540-4f47-bf0b-197331d054f3';\r\n readonly eRxUserDefinedDrugStatusUid = 'c5c9af90-92f8-479f-81d5-6a327d19cd1d';\r\n readonly eRxUnknownDrugClassStatusUid = 'e6378e41-2b44-4c76-923d-99994f749c1b';\r\n readonly eRxNoMailOrderBenefitUid = '369e0bf1-b361-4d27-9e6a-752f2b8c37a1';\r\n readonly eRxFailedValidationStatusUid = '86250938-b4de-4c85-9e12-5e132086b305';\r\n readonly eRxSentFailureStatusUid = '5f659708-d32c-4a81-af49-860883626304';\r\n readonly eRxProcessingErrorStatusUid = '5196d31c-360d-4eac-a294-05245a927f8c';\r\n readonly eRxProviderMappingErrorStatusUid = 'aa16051b-fdc9-4cf5-b1eb-32135baec80d';\r\n readonly eRxPatientMappingErrorStatusUid = 'c008a24b-37fd-44f8-b29b-70d141aaee72';\r\n\r\n // eRx Benefits download status.\r\n readonly eRxDownloadInProgressStatusUid = '09cdf8fb-8678-4084-805e-35d81e35534b';\r\n readonly eRxNoMedicationHistoryToDownloadStatusUid = 'bb189f74-f733-4552-a036-c305a33a69ba';\r\n readonly eRxDownloadCompletedWithErrorStatusUid = '378e7d05-06e5-41be-bd41-d1be5b6716f3';\r\n readonly eRxDownloadCompletedSuccessfulStatusUid = 'c20ca48a-f961-40f7-8eb6-e6f0ecbd1ef5';\r\n readonly eRxDownloadWaitForRXBenefitsResponsStatusUid = '4769f67c-c4ba-4e77-8fcc-82a967e4c887';\r\n\r\n // Jobs\r\n readonly JobScheduler = '10101010-0000-0000-0000-000000000101';\r\n readonly JobScheduledReports = '10101010-0000-0000-0000-000000000301';\r\n readonly JobScheduledERxMonitor = 'fbc47409-4dda-4457-bd3e-2c2666b45d98';\r\n readonly JobERAMessageProcessor = '0b5d9460-b33d-4968-a435-d5287c598c6b';\r\n readonly JobApplyERARules = 'dca52c7c-4d0b-4445-bf23-99a25ffe9719';\r\n readonly JobEligibility = '3dca8049-8df5-4b4f-a10f-fe6f54c0abad';\r\n\r\n // Job Time Intervals\r\n readonly JobTimeIntervalSeconds = '10101010-0000-0000-0000-000000000201';\r\n readonly JobTimeIntervalMinutes = '10101010-0000-0000-0000-000000000202';\r\n readonly JobTimeIntervalHourly = '10101010-0000-0000-0000-000000000203';\r\n readonly JobTimeIntervalDaily = '10101010-0000-0000-0000-000000000204';\r\n readonly JobTimeIntervalWeekly = '10101010-0000-0000-0000-000000000205';\r\n readonly JobTimeIntervalMonthly = '10101010-0000-0000-0000-000000000206';\r\n readonly JobTimeIntervalRunOnce = '10101010-0000-0000-0000-000000000207';\r\n\r\n // ListTimespan defaults\r\n readonly ListTimespanToday = 'f2e52f89-7f2c-466a-a878-459f82fa12c9';\r\n readonly ListTimespanLast2Weeks = '125f81d9-9055-4020-8927-9ec814b6c05d';\r\n readonly ListTimespanLast30Days = '95e07b97-aeab-46de-94ee-2674e419307b';\r\n readonly ListTimespanCustomDates = 'b657552d-872a-4e05-b76a-298754f56ecd';\r\n readonly ListTimespanCurrentWeek = '43570f5f-909d-4a76-9b9f-a0f293733fd6';\r\n readonly ListTimespanCurrentMonth = 'b35a144b-b91e-4207-8e26-f7c9fcd06645';\r\n readonly ListTimespanCurrentQuarter = '87212cb8-01b5-4e49-b206-a94111b7874a';\r\n readonly ListTimespanCurrentYear = '3863338d-160f-45d8-81c7-62738f3114d0';\r\n readonly ListTimespanLast2WeeksFromSunday = 'b3b927bf-fee9-4c44-bd0a-3e9587d34f69';\r\n readonly ListTimespanLast60Days = '11e8ceb9-308d-4fcb-9315-21c4f74214a7';\r\n readonly ListTimespanLast90Days = '4f614170-b9aa-4f08-a86e-25b509ed0c3e';\r\n readonly ListTimespanLast365Days = 'c90f9c3e-6a8e-4e2a-8afe-829094df0366';\r\n\r\n // ClaimFormatType\r\n readonly ClaimFormatElectronic837 = '0baf0b1a-48e6-403a-8981-2b58618dfc07';\r\n readonly ClaimFormatElectronic837I = '8d4cce55-2211-4ecf-8b01-f996cb5a0cfc';\r\n\r\n // ClaimFormatValueTypeUid\r\n readonly UPINClaimFormatValueTypeUid = 'be3aae71-5565-4edc-a166-3d7b688548b9';\r\n readonly DEAClaimFormatValueTypeUid = '018e7542-5de7-405e-9f4a-ee4bffde68d4';\r\n readonly NPIClaimFormatValueTypeUid = 'ce282f4e-a866-49ba-9636-c4ba0439e907';\r\n readonly SPIClaimFormatValueTypeUid = '87197e82-1f35-467a-ba37-0d8cf3de04d5';\r\n readonly CTPClaimFormatValueTypeUid = 'a337b06f-b4e2-4e8b-a439-faa973de3ca5';\r\n readonly MedicalLicenseNumberClaimFormatValueTypeUid = '2e7c5879-b7dc-4c2f-9e1c-ad157c561c3b';\r\n readonly StateLicenseNumberClaimFormatValueTypeUid = '37b7ea5e-1e98-46c0-916b-766ab518e99e';\r\n readonly SSNClaimFormatValueTypeUid = '897ff8b5-5c4f-4289-83eb-d75cdbedc510';\r\n readonly MedicareProviderIDClaimFormatValueTypeUid = 'b339708b-7b70-432d-8452-f2e199b46a01';\r\n readonly MedicaidProviderIDClaimFormatValueTypeUid = '33d096f9-ce6d-415a-bf57-9d2aaa5d2b2e';\r\n readonly PriorAuthorizationClaimFormatValueTypeUid = 'e8654441-940f-4d57-a0ee-f36d13c860b2';\r\n readonly FileIDClaimFormatValueTypeUid = 'a197989d-4200-4ea6-9e6e-7e3ab6f5f462';\r\n readonly PPONumberClaimFormatValueTypeUid = '783c246f-b633-4d8a-9cfc-7cd02bf4293c';\r\n readonly PayerIdentificationNumberClaimFormatValueTypeUid = '1a84232e-dcfd-43bf-8352-0afd0af79f47';\r\n readonly RxHubParticipantIDClaimFormatValueTypeUid = '4fec0a5f-2412-4408-97ad-d0ea3ad512b8';\r\n readonly SurescriptsStateLicenseNumberClaimFormatValueTypeUid = '846b9878-70d2-4daf-af6d-451f416f67ea';\r\n\r\n //SC 06/18/08 - may not need\r\n readonly ProcedureClaimFormatValueTypeUid = '024c64d6-9f63-471b-891f-2e777515668d';\r\n\r\n // ClaimFormatValueTypeTypeUid\r\n readonly ClaimFormatValueTypeTypeFilingTypeGroupIndividual = '4bbec2af-efee-49e5-8a55-96f837146061';\r\n readonly ClaimFormatValueTypeTypeClaimValueFormat = '205448ce-1aba-4273-b7bd-b4017e789d0c';\r\n readonly ClaimFormatValueTypeTypeCodeBasedClaimValueFormat = 'd64d9c6e-ad54-4f27-b5bf-4fb8bbd84412';\r\n readonly ClaimFormatValueTypeTypePaperBillingAsRef = '5f392cc6-ecc7-45be-9e4c-598ed4b36f8b'; //added for new (modified) ClaimFormat setting (Paper)\r\n readonly LabUse_BillingProvider = '83a25a0d-bd39-42ed-8324-12670f1d17c6'; //added for new (modified)listclaimformatvaluetype setting\r\n\r\n readonly ClaimFormatValueTypeTypeLabUseBillingProvider = 'aa380c38-3091-44ff-9675-bf8ba2088c7e'; //added for new ClaimFormat setting\r\n readonly ClaimFormatOptionType2310A = 'fff19d24-8250-4355-9b4b-60333eaef3e4'; //added for new listclaimformatvaluetype setting\r\n readonly ClaimFormatOptionTypeEPSDT = 'fe1d5047-6059-4051-b041-08c33031bb9f'; //added for new listclaimformatvaluetype setting\r\n //SC 06/18/08\r\n readonly ClaimFormatValueTypeTypeProcedureOverrideFormatValue = 'ae114249-40bc-49dd-a0e6-702fe4b7aab1';\r\n //SC 07/14/08\r\n readonly ClaimFormatValueTypeTypeTypeOfBillOverrideFormatValue = 'cf54a488-7a3c-473f-8cb7-8fc255899d9f';\r\n readonly ClaimFormatValueTypeTypeBox29Type = '81fe128f-2c86-42e6-83e1-f44a3edeebaf'; // Box 29 Type\r\n\r\n // ClaimFormatValueType ListMiscUid\r\n readonly MiscPracticeUid = '39035923-68fd-4276-8616-b027919d7840';\r\n readonly MiscProviderUid = '2cc009f6-7e06-4197-9b7c-9bb7893f9669';\r\n readonly MiscServiceSiteUid = '3eea5d17-2d86-4eaf-ab26-cb9016e175b8';\r\n readonly MiscFinancialCenterUid = '284a3ec8-a39a-4178-aade-e20c6829708b';\r\n readonly MiscMedicalServicesProviderUid = '4f49b11d-ced0-4e8d-9439-9113eac60b47';\r\n //SC 06/18/08\r\n readonly MiscProcedureOwnerUid = 'ebff0a0d-3a79-4e50-b15d-71a998a7e6e0';\r\n\r\n // ListAttachmentType\r\n readonly AttachmentTypePatientIndication = '8f6c46b0-f17b-41ad-8215-3fb3d116a9bb';\r\n readonly AttachmentTypeScheduledReport = '10101011-0000-0000-0000-000000000100';\r\n readonly AttachmentTypeDeposit = '78d03a12-29a8-46a2-8a72-0a31efeee2db';\r\n readonly AttachmentTypeGeneratedDocument = 'afecb3ab-f316-41b7-884a-94d441103b9a';\r\n readonly AttachmentTypeAdvancedDirective = '10101011-0000-0000-0000-000000000101';\r\n readonly AttachmentTypeExternalPatient = '7ef83ec9-cbde-4074-b9fd-bca3e6aac463';\r\n readonly AttachmentTypeLabResults = 'af6e749e-fbd9-40c8-98f4-09d1d0a5e04e';\r\n readonly AttachmentTypeAssessmentForms = '10101011-0000-0000-0000-000000000102';\r\n readonly AttachmentTypeScannedChart = '39981fac-3c26-45a8-b3ee-ea754692d17a';\r\n readonly AttachmentTypeDirectMail = '91293e86-6aa1-4b30-aa00-7ddd42135d64';\r\n readonly AttachmentTypeCareManagement = '6ff4a1f0-d9b3-4283-b109-ba492b172c86';\r\n readonly AttachmentTypeStatement = '3bd598e3-1b14-4b4d-9a0c-49fd31a32edb';\r\n\r\n // Financial Center Data SecurityUid\r\n readonly FinancialCenterDataSecurityUid = 'efa3bef1-b522-4e9a-ae74-4645851cfbf6';\r\n\r\n readonly BatchSecurityUid = '2bbd5b04-9549-4ef2-b321-489fa93a2324';\r\n readonly BatchOwnerDataSecurityUid = '6dc8e244-75b4-43a0-9eae-6ee2c7b372cc';\r\n\r\n readonly BatchProcessTypeSecurityUid = 'bfb6c86d-ec0e-435a-a10e-ee8f1f75bf5d';\r\n\r\n // Claim Clearinghouse\r\n readonly ClaimClearingHousePracticeInsightUid = 'b58b4c69-907d-4ab1-9945-0e4cd53df510';\r\n\r\n // PharmacyClearinghouse Data SecurityUid\r\n readonly PharmacyClearinghouseMedAvantUid = '371decbd-66d4-4c4f-8dbd-110c00098169';\r\n readonly PharmacyClearinghouseSureScriptsUid = '118422aa-c165-4a2e-8389-e5b7e89636ea';\r\n readonly PharmacyClearinghouseFaxUid = 'e5a59c09-a77d-4c08-953d-d92ce1b1135c';\r\n\r\n // eRxWS pharmacy clearing house.\r\n readonly eRxWSSureScripts = '118422aa-c165-4a2e-8389-e5b7e89636ea';\r\n\r\n // eRxWS job\r\n readonly eRxWSJobSendMessages = '2438b6b4-6d85-4f8f-91ce-7b26b094e353';\r\n readonly eRxWSJobPharmacyDirectoryDownloadNightly = 'd2c7de64-1463-4b04-ac6e-0c2cd67bc781';\r\n readonly eRxWSJobMonitor = '923d2ab4-f0df-47e8-b0c3-42c5f0887554';\r\n readonly eRxWSJobPharmacyDirectoryDownloadFull = '902cb485-3f44-467d-877a-81c2269eb477';\r\n readonly eRxWSJobFormularyDirectoryDownload = 'cc2aa760-702e-45f6-abe9-12ce88521744';\r\n readonly eRxWSJobProcessFormularyDirectory = 'f3bcc7fa-ae86-4954-8097-f637a6a0315c';\r\n readonly eRxWSJobePrescribingActivityReportUpload = '6a887b40-3446-4c61-a570-10c01a2bcdf5';\r\n readonly eRxWSJobGenerateePrescribingActivityReport = '20fe8b8f-5dce-4701-9fc4-5fbc4d4ba858';\r\n readonly eRxWSJobPRVBRD = 'fd66ccc4-10ec-44e6-b4ed-8cef32d1f24b';\r\n readonly eRxWSJobPrescriberDirectoryDownloadFull = '8c1bb635-7efe-4087-a5b4-667196f0565e';\r\n readonly eRxWSJobPrescriberDirectoryDownloadNightly = '2a109586-c975-4eb0-a0c4-359ef7b58f0d';\r\n\r\n //eRxWSJobDownload_FormularyAlternative = eRxWSMessageType_Download_FormularyAlternative;\r\n readonly eRxWSJobProcess_FormularyAlternative = 'dca8121e-06c2-4e0a-9aa4-02cd672691e1';\r\n\r\n //eRxWSJobDownload_FormularyCopay = eRxWSMessageType_Download_FormularyCopay;\r\n readonly eRxWSJobProcess_FormularyCopay = 'ecb1c118-bafe-4b65-b6b3-397147bb4be6';\r\n\r\n //eRxWSJobDownload_FormularyCoverage = eRxWSMessageType_Download_FormularyCoverage;\r\n readonly eRxWSJobProcess_FormularyCoverage = 'fb64ceec-908b-4410-95df-7a83b0a9db66';\r\n\r\n //eRxWSJob_Download_FormularyStatus = eRxWSMessageType_Download_FormularyStatus;\r\n readonly eRxWSJob_Process_FormularyStatus = 'ca4762f2-4f23-469a-b9a9-0b5de63e2141';\r\n\r\n // eRxWSMessageType\r\n readonly eRxWSMessageType_refill_request = '443d1a55-7384-495b-9bdf-15debd9379e2';\r\n readonly eRxWSMessageType_pharmacy_update = '0ffde3e6-a37b-4885-a142-4430c7526fc3';\r\n readonly eRxWSMessageType_provider_update = '83e4ce75-831d-42ff-a8be-5c192a358bba';\r\n readonly eRxWSMessageType_error_prvbrd = 'eccf1422-6127-4dd5-9897-44585f612c84';\r\n readonly eRxWSMessageType_error_script = 'fbfe211c-18ba-4ddd-a5e2-817933847588';\r\n readonly eRxWSMessageType_new_rx = '9f19ed8c-3524-46ea-9f4b-b932d38f8585';\r\n readonly eRxWSMessageType_pharmacy_list = 'a68df433-597d-4e7c-800a-beb65397ff04';\r\n readonly eRxWSMessageType_provider_list = '69f6dff1-210e-4258-b246-b50556ff2e0a';\r\n readonly eRxWSMessageType_refill_response = '5151d647-729f-40f1-afe3-f0cdf31f12a7';\r\n readonly eRxWSMessageType_Download_Pharmacy_File_Nightly = '9629d151-c4ba-4882-8ed8-6ec143827c30';\r\n readonly eRxWSMessageType_Download_Pharmacy_File_Full = '3f6c999f-dc86-472d-9f0c-5c0d90675a58';\r\n readonly eRxWSMessageType_Process_Pharmacy_File_Nightly = '25c70185-07db-47c2-b567-b16de01c2655';\r\n readonly eRxWSMessageType_Process_Pharmacy_File_Full = 'ed7c8aab-0bb8-4cee-b6d5-23fba39fe3d9';\r\n readonly eRxWSMessageType_formulary_file_list = '68f79b7e-6d5b-4574-ac4f-17c9f8077cf8';\r\n readonly eRxWSMessageType_ePrescribingActivityReport = '2e84582e-5947-4a5a-8ec8-c000853796d0';\r\n\r\n readonly eRxWSMessageType_Download_FormularyAlternative = '1543e471-f8d1-4fc2-adb8-15db5958fed3';\r\n\r\n readonly eRxWSMessageType_Download_FormularyCopay = 'dd3851b6-9a93-4b06-b6dc-378af8616475';\r\n\r\n readonly eRxWSMessageType_Download_FormularyCoverage = 'fb64ceec-908b-4410-95df-7a83b0a9db66';\r\n\r\n readonly eRxWSMessageType_Download_FormularyStatus = '8230406d-7e9c-4a2f-948f-4142ac629fe2';\r\n\r\n // Security\r\n readonly MessageSecurityUid = '10101010-0000-0000-0000-100000000100';\r\n readonly ListFindTable_Users = 'ec4c281c-12b3-4ca7-8269-7171ad5d8f94';\r\n readonly ListFindTable_UserSetting = '4dad8226-6097-4892-9d3f-fe5e1e346f42';\r\n readonly Security_GeneralNoteTypeNotes = '387c1f8e-69aa-4144-85dd-fc7e922ec9c4';\r\n\r\n // ListReferralTrackingStatus\r\n readonly ListReferralTrackingStatusInitiated = 'fc29eadd-fa10-4430-b6e5-7328f5b74c62';\r\n readonly ListReferralTrackingStatusRelationship = 'cac39e49-14e8-4045-bc1e-d051c33ae887';\r\n\r\n // ListInstantMessageStatus\r\n readonly ListInstantMessageStatusBusy = 'fefb6c5e-d476-432c-ba09-5009b38e5ccc';\r\n readonly ListInstantMessageStatusHidden = '5004e771-4ffd-4095-9ed2-be38e690b70d';\r\n\r\n // ListRelationship\r\n readonly Relationship_Self = '7b4c63c7-fe13-48ef-81e5-3afc963f3fee';\r\n readonly Relationship_Employee = 'fda2b6c2-fb40-416b-bfc8-73118827f8f0';\r\n readonly Relationship_Spouse = '9863d8b0-e698-4cea-8a3f-b4e1c7e6d094';\r\n readonly Relationship_Significant = '9b1f93b8-7611-4702-85ad-9ee0b7b99e57';\r\n readonly Relationship_Mother = 'cc4a41ef-5881-4f77-8a8c-330ebe75556d';\r\n readonly Relationship_Father = '111a79d8-3641-48dc-b47c-a8f8b374bf68';\r\n readonly Relationship_Child = '719bed52-7ec2-4240-aa02-00d073fda8c7';\r\n readonly Relationship_Unknown = '11eadee6-52dc-4fe1-bfd4-e1c03abaaa51';\r\n readonly Relationship_OtherAdult = 'bfe52efa-e4c2-4ec3-9f20-9637691fbe38';\r\n readonly Relationship_GuardianUid = '96118232-da86-41a3-9e99-0a7dc9c3ae26';\r\n readonly Relationship_CareGiverUid = '59aa0df9-3346-4e54-a3b1-3659d5cecaaa';\r\n\r\n // PQRI uids\r\n readonly PQRIGroupMedicare = 'bf5e56e0-187f-427a-a7ad-2d5eebeb0b43';\r\n readonly PQRIOperatorOR = '121dce7d-6aed-4974-b72e-0cb0aadacf5c';\r\n readonly PQRIOperatorAND = '184449fa-bc7c-43c8-9e84-58fb3cdf9261';\r\n readonly PQRIOperatorNOTOR = '93e9e5b7-e171-47b0-88b8-d9c22469b23d';\r\n readonly PQRIOperatorNOTAND = '6e1d0d18-ad47-4970-81e1-6c0323821304';\r\n readonly PQRICodeTypeICD9 = 'a057050d-e0c8-4727-a9e9-86fe9a05b5f9';\r\n readonly PQRICodeTypeEM = 'da5185e3-539e-4200-9e7a-7133115562d1';\r\n readonly PQRICodeTypeCPT = '13bfb012-d2af-4d5c-b3a4-8d288992c696';\r\n readonly PQRICodeTypeCPTII = 'ca39b7a8-2b88-467a-8293-7e76b527e44e';\r\n\r\n // PQRI known measures\r\n readonly PQRIMeasure125Adoption_e_Prescribing = 'ff13c3e2-b72b-41b8-b483-ed8a41be3a2a';\r\n readonly PQRIMeasure124Adoption_EMR = 'ce2eb02f-9f13-43fe-913b-b9747f265f25';\r\n readonly PQRIMeasure114TobaccoUse = 'b4df7b7b-f0be-4791-b0e0-04e60b362eb0';\r\n readonly PQRIMeasure115QuitSmoking = '14b51863-8ad7-460a-9db7-8cd576f740a0';\r\n readonly PQRIMeasure116InappropriateAntibiotic = '0bd7ca31-3380-41e0-a9b1-2816fbf553d4';\r\n readonly PQRIMeasure128BMI = '3263ff24-207b-4423-8adb-19cbfefae3a3';\r\n readonly PQRIMeasure130CurrentMedication = '361c7e72-00e1-421a-83d4-38c8561ae42e';\r\n readonly PQRIMeasure142Osteoarthritis = 'be0a135a-91ff-46c1-b6b9-f450ba6e5cd6';\r\n\r\n readonly PQRINumerator_130_NotDocumented_NotEligible_G8430 = '445f3804-cc10-4653-a64e-5a544d07ef41';\r\n readonly PQRINumerator_130_Documented_NotVerified_G8428 = '9f9fbe2f-0907-4e49-9885-235b9a052811';\r\n readonly PQRINumerator_130_NotDocumented_G8429 = '1621c1f1-f77c-4a0b-a784-be9dc348259b';\r\n readonly PQRINumerator_130_Documented_Verified_G8427 = '7216fad4-218f-4042-adad-73ae0d21dd30';\r\n\r\n readonly PQRINumerator_114_TobaccoUseNotAssessed_1000F_8P = '3d971193-17d6-4443-85de-894b1ef6b713';\r\n\r\n readonly PQRINumerator_115_Smokeless_G8456 = '1f26313b-d3fa-4add-a789-e77ec22d2346';\r\n readonly PQRINumerator_115_NonSmoker_G8457 = '17d1fc9e-82f8-4f80-b7de-a6b86ec7d1c1';\r\n\r\n readonly PQRINumerator_128_BMI_Normal_G8420 = '33db8be1-623b-40f1-be34-044b2514d75c';\r\n readonly PQRINumerator_128_BMI_Overweight_G8417 = '60c61fce-db9e-4549-882c-71c43eb6871f';\r\n readonly PQRINumerator_128_BMI_Underweight_G8418 = 'a5aa8faa-ddb4-4079-af5d-4272cc38db79';\r\n readonly PQRINumerator_128_BMI_NotEligible_G8422 = 'ff0e3c89-22aa-481f-830b-09bbcf7ecbad';\r\n readonly PQRINumerator_128_BMI_NotPerformed_G8421 = '51119e92-f3fd-4be2-9480-7623abd880d5';\r\n readonly PQRINumerator_128_BMI_OverUnderWeight_NoEducation_G8419 = '17cb9df2-88ca-4c48-8132-65083aabe660';\r\n\r\n readonly PQRINumerator_142_OST_AntiInflam_Assessed_1007F = '2258d5fb-1505-43d2-9610-1970db8f2558';\r\n readonly PQRINumerator_142_OST_AntiInflam_NotAssessed_1007F_8P = '617b87f3-9100-4989-885f-921541bdeffa';\r\n\r\n // PQRI known numerator used in E-Prescribing Incentive Program\r\n readonly PQRINumerator_ERX_Incentive_G8553 = 'fc128494-7632-4b64-84f4-7dedae62d77d';\r\n // no longer used 2010\r\n //PQRINumerator_ERX_NoPrescription_G8445 = 'b5539110-4dec-4ff2-9395-050e208e1672';\r\n //PQRINumerator_ERX_AlleRx_G8443 = '3ad9b779-989e-4c4c-b832-17c59d6bd32d';\r\n //PQRINumerator_ERX_SomeNonERx_G8446 = 'a5e1539d-9790-4220-a6d5-d6c89e4e4aab';\r\n\r\n // DesktoControl uids\r\n readonly DesktopControl_Calendar = '10101010-0000-0000-1000-000000000001';\r\n readonly DesktopControl_Waitlist = '10101010-0000-0000-1000-000000000002';\r\n readonly DesktopControl_Message = '10101010-0000-0000-1000-000000000003';\r\n readonly DesktopControl_Note = '10101010-0000-0000-1000-000000000004';\r\n\r\n // AddIn Types Uids\r\n readonly AddInType_Acquisition_Attachment = '10101010-0000-0000-1001-000000000001';\r\n readonly AddInType_Acquisition_Vitals = '10101010-0000-0000-1001-000000000002';\r\n readonly AddInType_PatientDemographics = '10101010-0000-0000-1001-000000000003';\r\n readonly AddInType_FNC = '10101010-0000-0000-1001-000000000004';\r\n readonly AddInType_Schedule = '10101010-0000-0000-1001-000000000005';\r\n readonly AddInType_Messaging = '10101010-0000-0000-1001-000000000006';\r\n readonly AddInType_PatientToolstrip = '10101010-0000-0000-1001-000000000007';\r\n readonly AddInType_Desktop = '10101010-0000-0000-1001-000000000008';\r\n readonly AddInType_CreditCardReader = '10101010-0000-0000-1001-000000000009';\r\n readonly AddInType_FNC_Slider = '10101010-0000-0000-1001-000000000010';\r\n readonly AddInType_FNC_SPSO = '10101010-0000-0000-1001-000000000011';\r\n readonly AddInType_AppointmentTypeFilter = '10101010-0000-0000-1001-000000000012';\r\n readonly AddInType_SuperbillChargeProcessor = '10101010-0000-0000-1001-000000000013';\r\n readonly AddInType_Find = '10101010-0000-0000-1001-000000000014';\r\n readonly AddInType_Find_Background = '10101010-0000-0000-1001-000000000015';\r\n readonly AddInType_SaveProcessor = '10101010-0000-0000-1001-000000000016';\r\n readonly AddInType_ServerObjectProcessor = '10101010-0000-0000-1001-000000000017';\r\n readonly AddInType_BillingRule = '10101010-0000-0000-1001-000000000018';\r\n readonly AddInType_CombinedServices = '10101010-0000-0000-1001-000000000019';\r\n readonly AddInType_OrderObservation = 'abeddd4f-b031-4a88-ae39-bfd56f74359c';\r\n\r\n // Compression\r\n readonly Compression_Zip = '10101011-0000-0000-1001-000000000001';\r\n\r\n // ERA Status\r\n readonly EraStatus_Error = '8b694843-f568-4097-b862-e4c63487881c';\r\n\r\n// ERA Codes ( frequently used )\r\n readonly ERA_GroupCode_CO = '55ba9568-1c8a-4a6d-a919-f11ce4cc9be5'; // CO\r\n readonly ERA_ReasonCode_45 = 'd16c8f44-ee79-4f01-ae2f-fdf83d3e048f'; // 45\r\n\r\n // MessageUrgency\r\n readonly MessageUrgency_Abnormal = '10101010-0000-0000-1000-100000000004';\r\n readonly MessageUrgency_Urgent = '623496d7-f48e-4ddb-8983-827cacee6901';\r\n readonly MessageUrgency_LowPriority = '2afc12c6-f24f-422d-800f-bfe534373f3f';\r\n readonly MessageUrgency_Routine = 'c2a64d38-3be1-4f8a-8947-ef9e9ad861a4';\r\n\r\n // ListCreditType\r\n readonly ListCreditType_Transfer = '0274c6df-47fb-402e-b19c-ca660b05fce1';\r\n readonly ListCreditType_Transfer_Adjustment = '3709199d-2a5a-49ed-b9ba-7272627c9ea6';\r\n readonly ListCreditType_Remark = 'ee8f34fe-4cbe-4f71-9f48-5907b7ff5820';\r\n\r\n readonly ListCreditType_ContractualInsuranceAdjustmentType = 'f8690cac-f9f8-45f6-8782-61246386d480';\r\n readonly ListCreditType_InsuranceAdjustmentType = '7f839eb0-406b-4ae2-94eb-a1eee171f331';\r\n readonly ListCreditType_CarrierTransferType = '046ac40d-c58d-4732-8399-266851b9f29d';\r\n readonly ListCreditType_PatientPaymentType = 'bbfdc458-cac6-4598-8e9c-660696b95e11';\r\n readonly ListCreditType_InsPaymentType = '83daa0c5-0888-4e57-8ce2-9888f8054889';\r\n readonly ListCreditType_PatientTransferType = '0274c6df-47fb-402e-b19c-ca660b05fce1';\r\n\r\n // List gender uids\r\n readonly ListGenderFemale = 'e5ded511-ee8a-4b47-aa68-8ff9f74741a1';\r\n readonly ListGenderMale = '8202fcb6-c28d-4985-9fc4-0c92e35c2dfd';\r\n readonly ListGenderUnknown = '9ef147f5-0265-4611-a9c7-d4005d306fd6';\r\n\r\n // Provider Care Types\r\n readonly ProviderCareTypePrimaryCare = '37e9f42d-9e10-45db-bcdc-cc86d1d4ff90';\r\n readonly ProviderCareTypeReferring = '9ed1cc47-1e90-41c1-81e4-16110078f9fe';\r\n\r\n // FTP uids\r\n readonly FtpProtocol_FTP = '11a82019-6756-481d-8491-d20fb4897a59';\r\n readonly FtpProtocol_FTPSSL = 'b418682d-f146-439d-9e9b-8111d8aa2fd4';\r\n readonly FtpProtocol_SFTP = '893b891e-ec44-4284-92b2-ccd2102c4cfb';\r\n\r\n // Procedure Code Types\r\n readonly ProcedureCodeType_CPT = '00000000-0000-0000-0000-000000000001';\r\n readonly ProcedureCodeType_HCPCS = '00000000-0000-0000-0000-000000000002';\r\n readonly ProcedureCodeType_LAB = '00000000-0000-0000-0000-000000000003';\r\n readonly ProcedureCodeType_ProcedureSet = '66164f99-1142-4f7e-8878-83e600fc6ded';\r\n readonly ProcedureCodeType_PQRI = '0852e87a-a5e0-43b2-808a-c6152251a4cd';\r\n readonly ProcedureCodeType_CarePlan = 'b4350da1-2202-4566-bac3-60f3d55e312d';\r\n readonly ProcedureCodeType_RiskAssessment = '4b45bbe4-31c1-4b2d-8df0-67960b9419c9';\r\n readonly ProcedureCodeType_Lab = 'ed8e7b10-9769-4d4d-9816-1117a95af96a';\r\n readonly ProcedureCodeType_Radiology = '7b04148e-4902-496b-b027-f0ee5038d157';\r\n readonly ProcedureCodeType_Referral = '6405ca7e-6739-4cd0-9b12-5350e769ee98';\r\n\r\n // AddIns\r\n readonly AddIn_CSSNDriverLicense = '10101010-0000-0000-0000-110000000001';\r\n readonly AddIn_CSSNInsuranceCard = '10101010-0000-0000-0000-110000000002';\r\n readonly AddIn_ICSDriverLicense = '10101010-0000-0000-0000-110000000003';\r\n readonly AddIn_ICSInsuranceCard = '10101010-0000-0000-0000-110000000004';\r\n readonly AddIn_ICS6DriverLicense = '10101010-0000-0000-0000-110000000005';\r\n readonly AddIn_ICS6InsuranceCard = '10101010-0000-0000-0000-110000000006';\r\n readonly AddIn_ExistingImage = 'ad312d6f-cd0c-4956-9652-3d12e73ae0ef';\r\n readonly AddIn_ConsentForm = 'a9aa31c9-be6e-4cb5-905a-ce04da7cb90e';\r\n readonly AddIn_TopazSignature = 'a4935c4a-dd00-4666-a820-0fdced9bf6ce';\r\n readonly AddIn_BillTimeRule = 'f33c7695-0233-4bd6-9600-4efa1340b34f';\r\n readonly AddIn_FeeScheduleRule = '2d90ff99-d43d-442e-a3cd-bfa730d704af';\r\n readonly AddIn_CombinedServices = '7c3967d2-ac2b-4783-ae2a-c7091022bf24';\r\n // fix for scenario #34930\r\n readonly AddIn_PDRNetwork = 'b0273b46-5983-43f2-9b28-432ab9546c8d';\r\n // fix for scenario #36161\r\n readonly AddIn_ePASurescripts = '1353fbb7-ed52-4cf7-8665-fb35d6d60497';\r\n readonly AddIn_VitalBMI = 'ccf82708-f120-43ff-97fc-a1299eef462e';\r\n readonly AddIn_VitalBP = 'a6425135-9530-4078-a4f3-eecc68358b1e';\r\n\r\n // KDB\r\n readonly KDB_MFU = 'ffffffff-0000-0000-0000-000000000001';\r\n readonly KDB_PATIENT_MFU = 'ffffffff-0000-0000-0000-000000000002';\r\n readonly KDB_DASP = 'ffffffff-0000-0000-0000-000000000003';\r\n readonly KDB_DESP = 'ffffffff-0000-0000-0000-000000000004';\r\n readonly KDB_CPP = 'ffffffff-0000-0000-0000-000000000005';\r\n readonly KDB_ADDIN = 'ffffffff-0000-0000-0000-000000000006';\r\n readonly KDB_ALL = 'ffffffff-0000-0000-0000-000000000099';\r\n\r\n // ContextReportType\r\n readonly CONTEXTREPORTTYPE_PATIENT = '10101010-0000-0000-0001-110000000001';\r\n readonly CONTEXTREPORTTYPE_VISIT = '10101010-0000-0000-0001-110000000002';\r\n readonly CONTEXTREPORTTYPE_SUPERBILL = '10101010-0000-0000-0001-110000000003';\r\n readonly CONTEXTREPORTTYPE_APPOINTMENT = '10101010-0000-0000-0001-110000000004';\r\n\r\n // UserGroup Type\r\n readonly USERGROUPTYPE_CARETEAM = '10101010-0000-0000-0000-000000000001';\r\n readonly USERGROUPTYPE_AUTHORIZATION = '10101010-0000-0000-0000-000000000002';\r\n readonly USERGROUPTYPE_SECURITY = '10101010-0000-0000-0001-110000000003';\r\n\r\n // UserGroup\r\n readonly USERGROUP_CLINICALADMINISTRATORS = '00000101-0000-0000-0000-000000000001';\r\n readonly USERGROUP_FINANCIALADMINISTRATORS = '00000101-0000-0000-0000-000000000002';\r\n readonly USERGROUP_ADMINISTRATORS = '00000101-0000-0000-0000-000000000003';\r\n readonly USERGROUP_PHYSICIANS = '00000101-0000-0000-0000-000000000004';\r\n readonly USERGROUP_NURSES = '00000101-0000-0000-0000-000000000005';\r\n readonly USERGROUP_REGISTRATION = '00000101-0000-0000-0000-000000000006';\r\n readonly USERGROUP_PAYMENTPOSTERS = '00000101-0000-0000-0000-000000000007';\r\n\r\n // medication units - guid are from table \"ListMedicationUnit\"\r\n readonly medicationUnitTablets = '944ae82b-8244-4553-9fdd-328fffe901c7';\r\n readonly medicationUnitCapsules = 'fc42ebe7-5c16-4f91-aa73-b6bc48b0a4aa';\r\n readonly medicationUnitDrops = '768585b4-71ba-4045-8e9d-77a972e8597a';\r\n readonly medicationUnitUnits = '513bc21a-b348-43ea-a8b4-276d5e550f1e';\r\n readonly medicationUnitMilliliters = 'e9b15f0d-cb8f-4364-ac09-b86301b4d585';\r\n readonly medicationUnitGrams = '495c5e93-5c82-44bf-8ac0-423d83a29280';\r\n readonly medicationUnitTeaspoons = '9aaba096-f0b5-4f4d-acdb-bce2b131bc22';\r\n readonly medicationUnitTablespoons = '328bf7c1-fa26-4229-81cf-9cf5b0c019a6';\r\n readonly medicationUnitOz = 'cb31a6dc-e156-4f5b-9119-5f6d53abcfb0';\r\n readonly medicationUnitMilligrams = 'd362abc2-4661-4703-80e8-0d506937274c';\r\n readonly medicationUnitMicrograms = '708613a7-6ac4-4027-8dc9-aba237f8c5ca';\r\n readonly medicationUnitSpray = 'ce49ba3e-d8c8-4e14-a1e3-7a9b24eb14c8';\r\n readonly medicationUnitPuffs = '0aba7d84-b35e-4eee-b34b-ac3b9244c2d6';\r\n\r\n // medication discontinue reasons\r\n readonly DiscontinueReason_DC = 'be13824c-b025-46b2-931c-378c00585ef7';\r\n readonly DiscontinueReason_Refilled = '8f132a93-e4a7-4b45-bdbe-ac68e63b1ed4';\r\n readonly DiscontinueReason_Deleted = 'e322d823-f96d-4070-af3b-aab21b21e6a9';\r\n readonly DiscontinueReason_Unspecified = 'fe706b0e-9df7-485b-b22b-cefc59192c62';\r\n readonly DiscontinueReason_Reaction = '106bff92-868b-4ad6-a1ea-d26b3e71ffd8';\r\n // fixed bug #23281\r\n readonly DiscontinueReason_Revised = '0587b29a-c354-432b-8b41-f34f7916ef1f';\r\n\r\n // FindTableUid\r\n readonly FINDTABLE_RELCCSYSTEMSYMPTOM = '9c4ca244-69d6-4faf-a16f-60a7645b577c';\r\n readonly FINDTABLE_DIAGNOSIS = '3b12df01-5df4-44a2-a16b-ba0bc5dd459a';\r\n readonly FINDTABLE_SO = '21c60022-225f-4ffe-ae7c-b0b3863cfbcf';\r\n readonly FINDTABLE_SP = '22c60022-225f-4ffe-ae7c-b0b3863cfbcf';\r\n readonly FINDTABLE_MEDICATION = 'd3e281ce-6db6-4a06-8b1c-7c869041cbdf';\r\n readonly FINDTABLE_PATIENT = '034f9d24-92ec-4ad5-9b08-dab99d030bc3';\r\n readonly FINDTABLE_GENERALNOTETYPE = 'c6d90dd0-8d75-4dda-ad40-b661dff8fd09';\r\n readonly FINDTABLE_LISTASSESSMENTFORM = '632770df-5a4e-4859-b890-50f32e309e67';\r\n readonly FINDTABLE_LISTLABORATORY = '91716d23-9fed-4e35-8169-2ff1b4360c96';\r\n readonly FINDTABLE_FINDVITALSOBSERVATION = 'a01cfadf-d7db-4aa6-af55-f130825e6c1a';\r\n readonly FINDTABLE_WAITINGKLISTDETAIL = '59723a32-10b5-4185-a1ad-f2dbdfd2a27f';\r\n //FINDTABLE_APPOINTMENTCLIPBOARD = '39b3af2a-0841-49aa-8e4a-b99a655ae80b';\r\n\r\n // PhoneTypes\r\n readonly PhoneType_Work = '01443a53-7345-4327-a43e-9cc7cf82c98c';\r\n readonly PhoneType_Fax = '48af7137-1791-48e4-b338-3dd0a7419073';\r\n readonly PhoneType_Home = '07044f79-126c-4bf5-8a91-5ab4b36ac99a';\r\n readonly PhoneType_Cell = '13248051-ef12-451e-b27f-71a38ee4c3dc';\r\n readonly PhoneType_Pager = '4f6d1328-7e5c-4b1b-b3b1-c06e24d0654a';\r\n readonly PhoneType_Rx = 'f1e28b28-4c23-4f56-ab4f-e03b10c045cc';\r\n readonly PhoneType_Other = '8f7fc1ab-054d-4c5f-a130-d2a63d9d0a26';\r\n readonly PhoneType_Night = 'ee7ce61f-24e7-4e15-a500-a8d0ae470c71';\r\n readonly PhoneType_Office = 'ebb01f3d-6431-4d3d-9f51-62d8efa6ae66';\r\n\r\n //ReimbursementRuleUid for Quest ABN generation\r\n readonly ReimbursementRuleUidForQuestABN = '4bfe0401-785b-4b00-88ea-974b6e79f432';\r\n readonly LaboratoryUidQuest = '4524b6e9-2be4-4e55-9389-514159a6f995';\r\n\r\n // Clinical Note Types\r\n readonly ClinicalNoteType_FNC = '10101010-1111-0000-0000-000000000001';\r\n readonly ClinicalNoteType_SBC = '10101010-1111-0000-0000-000000000002';\r\n readonly ClinicalNoteType_Order = '10101010-1111-0000-0000-000000000003';\r\n readonly ClinicalNoteType_General = '10101010-1111-0000-0000-000000000004';\r\n\r\n // Clinical Note Controls\r\n readonly ClinicalNoteControl_SP = '5db71e56-0da7-4480-a277-e4f796cbff67';\r\n\r\n // Visit Types\r\n // PLEASE NOTE:\r\n // When adding new visit types the job \"PQRIHistoryUpdate\" needs to be review; the new visit type may need to be skipped by the job.\r\n readonly VisitType_StrikeOut = 'fb954167-9d1c-43b7-9f5b-a76260654c96';\r\n readonly VisitType_Private = 'dddb34a1-f886-49e3-ad75-e267fafcb1c4';\r\n readonly VisitType_Refill = 'ada7eb5d-fd9a-4e9f-88e5-84edda9efc42';\r\n readonly VisitType_Lab = '6a18a657-b912-4c12-828e-a3df8571d205';\r\n readonly VisitType_CancelRX = '7e9ca276-3445-4dfc-9e6c-972b23d34229';\r\n // fixed bug #23281\r\n readonly VisitType_RxChange = '4bca0ee2-7f2f-4a2e-ad74-834c31af92c5';\r\n\r\n readonly VisitDiagnosisType_Differential = '240f7492-a04c-4f57-a2b0-58ef7ab57ff0';\r\n readonly VisitDiagnosisType_PreOp = 'fcdc0aad-94fe-484e-9202-933606eaf421';\r\n readonly VisitDiagnosisType_PostOp = 'f004794f-c9fb-4c62-98e2-9594bcba1f8d';\r\n\r\n readonly VisitDiagnosisAxisType_One = 'c60524b9-33a6-44c6-ba8f-0fa133818c50';\r\n readonly VisitDiagnosisAxisType_Two = 'd41e2a8d-1c05-48df-805e-94f4a5cb3f10';\r\n readonly VisitDiagnosisAxisType_Three = 'ccf041f6-3e09-4276-b11a-dca172b64f8f';\r\n\r\n // Patient Tracking Event Types\r\n readonly PatientTrackingEvent_General = 'fb0b78ed-7140-4980-969e-f70039176b5d';\r\n readonly PatientTrackingEvent_Visit = '87291d36-0d40-4536-8458-1d5c55882804';\r\n\r\n // SIG Quantity Unit Of Measure Guids - guids are from table \"ListSIGQuantityUnitOfMeasure\"\r\n readonly sigQtyUomCapsule = '74972c03-9c7f-4af0-b3d9-4030eb8b3c82';\r\n readonly sigQtyUomInhaler = '90cc0864-aaaf-40fa-b39e-e472783fa9f6';\r\n readonly sigQtyUomKit = 'faeb9b7f-c4b3-441a-b16d-dc089c472cb5';\r\n readonly sigQtyUomSuppository = 'e8357870-a050-494d-94fc-391b7ece24e3';\r\n readonly sigQtyUomTablet = '3720a2af-50ea-4bbe-968d-90434f08cb8c';\r\n readonly sigQtyUomGum = '352c9425-7c67-407d-a111-870757f019cb';\r\n readonly sigQtyUomPacket = '3e7cb1b6-fbf8-4626-b327-0b064e68ba72';\r\n readonly sigQtyUomBottle = 'b11ecea7-3715-494d-979b-7d2120d83e10';\r\n readonly sigQtyUomCartridge = '0bdd7d87-dfee-4f03-89f7-9e216172bcff';\r\n readonly sigQtyUomUnit = '24401a56-521e-467a-85c2-b0e6267a4b3c';\r\n readonly sigQtyUomLozenge = 'b020244f-dcbf-4f74-96c8-e20d07a24928';\r\n readonly sigQtyUomSyringe = 'd68de1e5-5836-4bd9-85c2-f5d275f637fc';\r\n readonly sigQtyUomMilliliter = 'b2b811b0-2ad8-4324-a909-a885936f1460';\r\n readonly sigQtyUomTablespoon = '83c4b10c-6933-4438-bcc0-b322dada5a33';\r\n readonly sigQtyUomTeaspoon = 'ccec57e0-431f-48ee-a146-4af1829c4b72';\r\n readonly sigQtyUomNotSpecified = 'a1ef67ed-010e-45f1-a292-38b1fd03419d';\r\n\r\n readonly DosingCalculatorUnitGPerKgPerDay = 'b657d3c5-4a62-4c10-8ccb-c091a5f5ec0b';\r\n readonly DosingCalculatorUnitMcgPerKgPerDay = '75fc5f60-02fb-4861-a2ca-cefe57dbdeb0';\r\n readonly DosingCalculatorUnitMgPerKgPerDay = '172b6568-77ee-41cc-956d-5fc15a2a796f';\r\n readonly DosingCalculatorUnitMlPerKgPerDay = 'a7ba4269-07ab-45b6-9d4c-bf4ca1a3126c';\r\n\r\n // Transaction Credit Types\r\n readonly TransactionType_Payment = 'e78af210-4992-484d-b804-cc2031868598';\r\n readonly TransactionType_Adjustment = 'dfe2cdcd-f156-4c5c-a56e-52d7cd3105d3';\r\n readonly TransactionType_CollectableAdjustment = '9cceb99c-727a-48fd-9474-f91f14f22a97';\r\n readonly TransactionType_Remark = 'c02494ee-f471-4237-a35f-974555b0f828';\r\n readonly TransactionType_Transfer = '28a84e67-a2a0-48e4-93ba-ef49607ead17';\r\n readonly TransactionType_Charge = 'b4c75e1c-4360-453d-b8f7-5091e51ddaf0';\r\n readonly TransactionType_CarrierTransfer = 'ee9a074d-5660-400c-9975-2f961a38d7b2';\r\n\r\n //SC 07/16/08 Account/Provider Coverage Types\r\n readonly CoverageType_Medical = '10101010-0000-0000-1001-000000000001';\r\n readonly CoverageType_Dental = '10101010-0000-0000-1001-000000000002';\r\n readonly CoverageType_BehavioralHealth = '10101010-0000-0000-1001-000000000003';\r\n readonly CoverageType_Uninsured = '10101010-0000-0000-1001-000000000004';\r\n\r\n //Lab order bill types\r\n readonly PatientBill = '4d460de7-fd6c-43b6-9fdb-bec08713ec98';\r\n readonly InsuranceBill = '2eafdf7d-3b73-46dc-af8b-4f2ba5a1743e';\r\n readonly ClientBill = '9376a37e-b27f-422b-97c0-d398a5dd86d8';\r\n\r\n // EM Examination Description\r\n readonly EM1995RulesExamination = 'b78818e4-345f-4a20-b303-7f2146343330';\r\n readonly CardiovascularExamination = '58dd4ba5-1ec2-49d2-9287-8fef51acf104';\r\n readonly ENTExamination = '8cca5d54-2f38-44aa-a416-8e62c2b4d2ef';\r\n readonly EyeExamination = '49949119-8d84-4764-aaba-902698c65cbb';\r\n readonly GeneralMultiSystemExamination = '9c1c8d66-89f9-4097-b1e7-f601f10e60f8';\r\n readonly GenitourinaryExamination = '23c8a50e-06bc-4fd4-98aa-a80242cb0374';\r\n readonly HematologicLymphaticImmunologicExamination = 'f5e2db8f-0884-487e-bc04-5554bb187b4a';\r\n readonly MusculoskeletalExamination = '20ef398a-50e2-4b42-b350-d563a8c22637';\r\n readonly NeurologicalExamination = '97b8c00d-d75f-4885-8363-1e6c252dfcd4';\r\n readonly PsychiatricExamination = '37e40cc7-07af-4520-9d47-d2e6d09b4ed7';\r\n readonly RespiratoryExamination = '199151d4-0a37-4567-9c67-0bb7858523c7';\r\n readonly SkinExamination = 'aadde121-1315-46fc-a32d-4440d55fb239';\r\n\r\n // EM Key Component\r\n readonly EMHistoryPresentIllness = 'bef97f98-fc7b-4938-a611-3961fabe7c82';\r\n readonly EMReviewOfSystems = '2f4c8c81-20d6-4551-80cd-87fb9403fd0c';\r\n readonly EMHistory = 'e770d652-dddc-4950-8c23-1941677ec51e';\r\n readonly EMPhysicalExam = 'dbcd49e7-4d67-4414-9881-f72438eabae6';\r\n readonly EMComplexity = '8ffbe65c-8e12-4c3f-b4ae-d603c8217692';\r\n\r\n // EM System Body Area\r\n readonly SystemBodyAreaAbdomen = '88fb7da6-9fd7-45a8-bb9b-525db08174dd';\r\n readonly SystemBodyAreaAllergicImmunologic = 'd316b3ed-5004-4a69-85b3-2308cdc310c8';\r\n readonly SystemBodyAreaBack = '745f34ab-10dd-4e22-8aa4-e506d3d77791';\r\n readonly SystemBodyAreaCardiovascular = '18c37cd0-6b72-41f6-97f1-22171a694da4';\r\n readonly SystemBodyAreaChestBreasts = '61433637-4dce-4e4e-a8c6-016447fe0251';\r\n readonly SystemBodyAreaConstitutionalGeneral = 'fee1b725-b1c9-4544-87dd-d9ac27dcc7ed';\r\n readonly SystemBodyAreaEachExtremity = '3368a111-dedf-44c6-9363-dfddb21367fe';\r\n readonly SystemBodyAreaEndocrine = '11d2dae7-6d0c-419d-954d-5d9702826f1f';\r\n readonly SystemBodyAreaENMT = '57824fba-b1eb-4753-aa00-1dd9b245a00c';\r\n readonly SystemBodyAreaExtremities = '82f5a636-a9d2-483c-86e9-659055efc076';\r\n readonly SystemBodyAreaEyes = '7df385b7-fd9b-49bc-b951-374f55b45e5a';\r\n readonly SystemBodyAreaGastrointestinal = '074a4b52-6e98-4b0d-a381-5a59778dd2a1';\r\n readonly SystemBodyAreaGenitaliaGroinButtocks = '65511a5a-6009-4fc1-9457-fdba294ab963';\r\n readonly SystemBodyAreaGenitourinary = 'd152486f-74b1-4cce-958d-bfd0108683c1';\r\n readonly SystemBodyAreaGUfemale = 'c09042c4-3280-4824-9be8-95f736c3f2a2';\r\n readonly SystemBodyAreaGUmale = '43093213-8382-48b6-9a7c-c5cb230d9c39';\r\n readonly SystemBodyAreaHeadFace = '546c7b3a-a749-4556-ac1f-e9f224427756';\r\n readonly SystemBodyAreaHematologicLymphatic = 'a320cbeb-45dd-4ff3-a978-ca9e49031976';\r\n readonly SystemBodyAreaIntegumentary = '95593059-117e-4f38-b508-14e03e9f0fd6';\r\n readonly SystemBodyAreaMusculoskeletal = '348a5b05-0c69-4079-8c51-e7fc70d18db9';\r\n readonly SystemBodyAreaNeck = '258b3fef-2c22-4c14-b766-aaf1be4b7210';\r\n readonly SystemBodyAreaNeurological = 'dff1ee30-ce8e-4911-a6b6-a89ee1c3ccab';\r\n readonly SystemBodyAreaPsychiatric = '23970102-c468-42b7-b326-163aa89700ff';\r\n readonly SystemBodyAreaRespiratory = '348e524f-264d-40eb-91c3-dbc0a6d00ded';\r\n\r\n // EM Bullets needed to count Musculoskeletal Examination\r\n readonly BulletExaminationGaitAndStation = 'e0b4bf3c-5bca-400e-8a6d-aabea02e0f9b';\r\n\r\n // EM Bullets Musculoskeletal: Head and Neck\r\n readonly BulletHeadNeckAssessmentMuscleStrength = '87abb1ab-88bd-46fe-b444-f6cfdf2706b8';\r\n readonly BulletHeadNeckAssessmentRangeMotion = 'c00f5206-3dd7-4415-9421-35633ca04c30';\r\n readonly BulletHeadNeckAssessmentStability = '89a893e4-cc49-4271-967e-a47edb373887';\r\n readonly BulletHeadNeckInspectionPercussionPalpation = 'd314963d-9ad4-46c6-8612-e93bdd6e11b4';\r\n\r\n // EM Bullets Musculoskeletal: LLE\r\n readonly BulletLLEAssessmentMuscleStrength = '7248507d-4079-46ea-bd04-7c93ef8de796';\r\n readonly BulletLLEAssessmentRangeMotion = 'ff7a2629-3050-451f-b876-90bbf94d1237';\r\n readonly BulletLLEAssessmentStability = '3e7ff9f5-bde9-40f0-850f-1de5a22ef782';\r\n readonly BulletLLEInspectionPercussionPalpation = 'eb210e0d-8e14-42bc-a230-c8d217ce4b6f';\r\n\r\n // EM Bullets Musculoskeletal: LUE\r\n readonly BulletLUEAssessmentMuscleStrength = '23a0260c-ef54-4aae-823a-8872d4e51aa1';\r\n readonly BulletLUEAssessmentRangeMotion = '4dd4328c-49ae-462a-a4b2-b91244bd336a';\r\n readonly BulletLUEAssessmentStability = 'e7e3316f-0b29-4ff2-9c4b-97cfe7eeee6d';\r\n readonly BulletLUEInspectionPercussionPalpation = '5726e7e5-5eb4-4b14-a92b-7c8aa8b0fee1';\r\n\r\n // EM Bullets Musculoskeletal: RLE\r\n readonly BulletRLEAssessmentMuscleStrength = '5fed9f47-4715-443d-98f0-186409e7e5d4';\r\n readonly BulletRLEAssessmentRangeMotion = 'ab880484-1d2c-4c57-bfa0-8ef204426613';\r\n readonly BulletRLEAssessmentStability = '2a30e4cc-8e92-41d3-bf53-ec0a8cb2ae4b';\r\n readonly BulletRLEInspectionPercussionPalpation = '3bff721c-a1fe-4211-be53-3cb6bfb58272';\r\n\r\n // EM Bullets Musculoskeletal: RUE\r\n readonly BulletRUEAssessmentMuscleStrength = 'a2a73e16-346d-40c4-9448-0cf35ec252df';\r\n readonly BulletRUEAssessmentRangeMotion = '68cbf246-3f18-4023-b5de-98cd6f6c4faa';\r\n readonly BulletRUEAssessmentStability = '8f343b4b-f9d3-4a75-acd0-053a5b2997f2';\r\n readonly BulletRUEInspectionPercussionPalpation = 'ce254a35-4999-468c-8142-916fc9ed1147';\r\n\r\n // EM Bullets Musculoskeletal: Spine, ribs, and pelvis\r\n readonly BulletSpineRibsPelvisAssessmentMuscleStrength = 'f9331555-d8ff-4a1b-a23a-87622739cf36';\r\n readonly BulletSpineRibsPelvisAssessmentRangeMotion = '7fcab774-1053-4a52-893d-0ea2fd4bc8c3';\r\n readonly BulletSpineRibsPelvisAssessmentStability = '3871ce19-a073-4282-930e-a3d61b1546e4';\r\n readonly BulletSpineRibsPelvisInspectionPercussionPalpation = '8e4dd741-589a-45c7-a2f9-4b008d261498';\r\n\r\n // EM Bullets Musculoskeletal: Bilateral Lower Extremities\r\n readonly BulletBilateralLowerExtremitiesAssessmentMuscleStrength = 'feaf086d-a100-4629-8fc8-80784dc10b2d';\r\n readonly BulletBilateralLowerExtremitiesAssessmentRangeMotion = '85b34895-9afa-4ec4-8e99-8d7f8eacd350';\r\n readonly BulletBilateralLowerExtremitiesAssessmentStability = '82faba5e-8c37-4725-ac07-6cbb684165ee';\r\n readonly BulletBilateralLowerExtremitiesInspectionPercussionPalpation = '69c445bf-5d9b-4486-abdd-fd56d411ad2f';\r\n\r\n // EM Bullets Musculoskeletal: Bilateral Upper Extremities\r\n readonly BulletBilateralUpperExtremitiesAssessmentMuscleStrength = '911d7cc1-5bd4-4e99-a810-3c236c3725cf';\r\n readonly BulletBilateralUpperExtremitiesAssessmentRangeMotion = 'a3ef1718-b31a-4da5-8d53-3e71b9e8da7d';\r\n readonly BulletBilateralUpperExtremitiesAssessmentStability = 'f53e7fb0-8ec0-432a-9d57-ba8fa89de18e';\r\n readonly BulletBilateralUpperExtremitiesInspectionPercussionPalpation = 'a0624d3a-2f36-4705-b3ac-ab397d9e459e';\r\n\r\n // EM Bullet skin: Inspection of eccrine and apocrine glands of skin and subcutaneous tissue\r\n readonly BulletSkinInspectionEccrineandApocrineGlands = 'bf719d7d-bc45-4507-b162-5227526bd781';\r\n // EM Bullet skin: Palpation of scalp & inspection of hair of scalp, eyebrows, face, chest, pubic area, & extremities\r\n readonly BulletSkinPalpationofScalpInspectionofHair = '2b4bfede-73ab-4098-b1ba-e40b717fe352';\r\n // EM Bullet skin: Chest, breasts, axilla - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinChestBreastsAxillaInspectionPalpation = 'adc1c908-a874-485c-85a3-5b9391631bc8';\r\n // EM Bullet skin: Genitalia, groin, buttocks - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinGenitaliaGroinButtocksInspectionPalpation = '94e371f4-36be-4cb4-b904-ba3bc373871a';\r\n // EM Bullet skin: Back - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinBackInspectionpalpation = '869022df-099b-4a5f-8902-30c6ab9b9bae';\r\n // EM Bullet skin: Abdomen - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinAbdomenInspectionPalpation = '059e7a21-124d-4ce9-8faf-32f48c4a3463';\r\n // EM Bullet skin: Neck - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinNeckInspectionPalpation = 'dead1aa4-4474-4cd5-a88c-9804281e7b1b';\r\n // EM Bullet skin: Head/face - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinHeadFaceInspectionPalpation = '12f6ec75-2e61-4ed0-9040-a61dee0528bc';\r\n // EM Bullet skin: RLE - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinRLEInspectionPalpation = '3c82c8fb-87c5-457b-bae2-cd43438692a7';\r\n // EM Bullet skin: RUE - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinRUEInspectionPalpation = 'dd39da78-5a0f-44dd-95e5-0d4baa7ad63d';\r\n // EM Bullet skin: LUE - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinLUEInspectionPalpation = '4ef562f1-3345-4ba2-9806-0985b6bf6cad';\r\n // EM Bullet skin: LLE - Inspection and/or palpation of skin and subcutaneous tissue\r\n readonly BulletSkinLLEInspectionPalpation = 'f4331d61-7d78-47ee-a23b-c65720e8e27a';\r\n\r\n // EM Bullet skin: Bilateral Lower Extremities\r\n readonly BulletSkinBilateralLowerExtremitiesInspectionPalpation = '747bd4ac-a12d-40e4-bee7-210a6a7d059e';\r\n // EM Bullet skin: Bilateral Upper Extremities\r\n readonly BulletSkinBilateralUpperExtremitiesInspectionPalpation = '3944567f-767d-44d8-8113-2637997bdf03';\r\n\r\n // history answer group\r\n readonly AnswerGroupGestationalAge = 'ffffffff-0000-0000-0000-000000000004';\r\n\r\n // history list answer\r\n readonly GestationalAge24Weeks = '556f48a1-2f5d-409d-bd09-e08057f5be4c';\r\n readonly GestationalAge25Weeks = '8fe8a052-7bbf-4569-8520-44eca79867c7';\r\n readonly GestationalAge26Weeks = 'a46638f1-a764-4a1c-9bbf-5bf8279fd6a7';\r\n readonly GestationalAge27Weeks = '4b3640e3-9563-4703-bcf5-b4bcbdb7790c';\r\n readonly GestationalAge28Weeks = 'b32c8d4e-d3fd-449e-a5f7-f997893d97b8';\r\n readonly GestationalAge29Weeks = '74815aac-f0dc-4076-9b38-b716ad8c6f30';\r\n readonly GestationalAge30Weeks = '22d9d282-8063-457e-82ce-976f2fdbf7ef';\r\n readonly GestationalAge31Weeks = '60884edd-9bdb-43d4-87a6-d658a10c5b22';\r\n readonly GestationalAge32Weeks = 'fb996b55-bdad-43d8-8362-69a2f756d3c2';\r\n readonly GestationalAge33Weeks = 'ad63793e-d690-4774-812c-f8dff9130e8d';\r\n readonly GestationalAge34Weeks = '80641b5e-f7bd-44e1-915f-da508fe592b0';\r\n readonly GestationalAge35Weeks = '9124175e-ef21-48de-8d74-09b88147b0fc';\r\n readonly GestationalAge36Weeks = '47c03c8e-bcc8-4ec0-abce-2256e997f5d9';\r\n readonly GestationalAge37Weeks = 'f0c15fe4-f9ca-4f98-90bf-21ed0b2562ca';\r\n readonly GestationalAge38Weeks = '25e2e7af-44dd-4711-9109-613af18aca92';\r\n readonly GestationalAge39Weeks = '6cd6e108-9266-4bc6-aa2d-046ea54e65cc';\r\n\r\n // history active state\r\n readonly HistoryStateActive = '506b5714-4dda-4080-81af-e2b37d4c4f19';\r\n readonly HistoryStateInactive = '8984ba72-9122-4cde-8627-33e740ec0c7c';\r\n readonly HistoryStateResolved = '9415899e-91ea-4be1-a7c3-d2c44bc0acb1';\r\n readonly HistoryStateChronic = '044fade0-a022-48a8-9f8d-9a2b14e60580';\r\n\r\n // eRx Job\r\n readonly JobeRxPollMessageUID = 'c7491df5-12b6-4a94-ac8a-7e238d2e3ac7';\r\n readonly JobeRxSendMessageUID = '592f87ec-356c-484d-924b-9229d769fa87';\r\n readonly JobeRxProcessScriptUID = '183495cc-9b64-4f1b-a3c9-e3b728621079';\r\n readonly JobeRxProcessPharmacyUID = 'fdee0da3-1319-430a-9164-63bf273cc4b2';\r\n readonly JobeRxSendRXHMessageUID = 'c0c5dab1-abc4-4a44-9df0-cb97e6013b51';\r\n readonly JobeRxSendELGMessageUID = '38684974-e91a-494b-9f0d-64765f4e0196';\r\n readonly JobeRxCreateRXHMessagesFromCalendarUID = '160c2f70-efd0-476a-8ca9-8a97340af073';\r\n readonly JobeRxCreateELGMessagesFromCalendarUID = 'a9b1ec6a-c4ac-44bf-846d-69a3cd13aedf';\r\n readonly JobeRxProcessPRVBRDUpdateMessagesUID = '5a696db7-0632-4979-981e-8460bc6ff8be';\r\n readonly JobeRxProcessX12ScriptUID = 'e95ebece-e069-44a6-9a5f-7566db1785e7';\r\n readonly JobeRxProccessePrescribingActivityReportUID = 'a0010916-897a-4ff1-8e3d-bd567054a7a5';\r\n\r\n readonly JobScheduleeRxPollAllUID = 'c7a28bc3-9b4a-4832-a64c-947f24d4c2b6';\r\n readonly JobScheduleeRxPollPrescriptionUID = 'bf2aab37-3656-453e-89f8-358e18503793';\r\n readonly JobScheduleeRxPollPharmacyUID = 'eaff3043-e1ae-437a-833e-b24295b12b69';\r\n readonly JobScheduleeRxPollPrescriberUID = '4bda1f87-b348-4404-bfbe-5560bee4235d';\r\n\r\n readonly JobScheduleeRxServiceCreateeMedHxMessagesUID = '54556fee-0696-4c52-a4e3-4e9d4e9a3fb3';\r\n readonly JobScheduleeRxServiceDownloadPrescriberOrganizationDirectoryUID = '4bda1f87-b348-4404-bfbe-5560bee4235d';\r\n readonly JobScheduleeRxServiceCreateRxBenefitsMessagesUID = 'c45aa546-acf7-4496-a2cc-9da49d173e27';\r\n readonly JobScheduleeRxServiceDownloadPharmacyDirectoryUID = 'eaff3043-e1ae-437a-833e-b24295b12b69';\r\n\r\n // Audit type from ListMisc\r\n readonly AuditTypeSecurity = 'b6d3b9f2-1847-4061-a8bb-36c1dbc2ab87';\r\n\r\n // Audit Event types from ListAuditEventConfiguration\r\n readonly AuditEventTypeFindControl = 'e4482728-322a-4f68-b71f-66a3f27f4ec3';\r\n readonly AuditEventTypeWorkflow = 'b5ba8723-6011-45fc-9d42-9c3af3c07b9d';\r\n\r\n // ListControlType guids for controls used for observations\r\n readonly Control_Type_Blood_Pressure = '34c77b17-5978-478a-a584-85905652e705';\r\n readonly Control_Type_Generic_Kilogram = 'e7648055-dd5c-4852-8e36-af37daff8478';\r\n readonly Control_Type_Generic_Length = '4d5c3bd5-1f2a-4936-b5bc-2a8b648596fc';\r\n readonly Control_Type_Generic_Observation = 'b8df29b0-1df3-42d6-b2d3-a2952313a3fc';\r\n readonly Control_Type_Head_Circumference = '8b8671a1-c984-4928-add7-9de4b2dabf62';\r\n readonly Control_Type_Heart_Rate = '16e1d982-3d5f-4a74-8abe-6179b46705dd';\r\n readonly Control_Type_Height = 'afeb48db-4ac4-45d2-a3fc-aa6dd2a94d03';\r\n readonly Control_Type_Respiratory_Rate = '731cd44f-50e3-460d-9d75-0c221506279d';\r\n readonly Control_Type_SpO2 = '4fc9c432-4b6a-4971-99b9-84160cb1b579';\r\n readonly Control_Type_Temperature = '17912814-2d13-4b9a-ab26-089ba658917e';\r\n readonly Control_Type_Weight = '9bd6af71-120e-4d58-a99a-c52ef2fd4676';\r\n readonly Control_Type_Generic_Number = '2219e1a3-3919-43e5-9964-decb281fe826';\r\n readonly Control_Type_Generic_Date = 'c3ee6e69-c4e8-4b29-b17e-b59de3d0280b';\r\n readonly Control_Type_Eyeglass_Prescription = '1e10fbd4-37c5-4265-baf5-501904f863f5';\r\n\r\n // general guids needed by observations\r\n readonly ObservationItemSource = '50ab9c8d-9945-4867-879f-d17ef43f9f2b';\r\n readonly StandardCustomVitals = '67f9360a-5b25-4b12-83c2-3c10a76f7792';\r\n readonly GAFObservation = '84a5ff1d-eb34-4528-9e92-c5fc912a279d';\r\n\r\n // default FormattingTemplate uids\r\n readonly DefaultOPSTemplate = 'f20ee29a-2eab-4be2-bd1c-210c0da89606';\r\n readonly DefaultVisitTemplate = 'c0b27735-8ad2-4397-bf68-272eb7c1dc86';\r\n readonly DefaultRPNTemplate = 'e84d2316-2ca1-425b-9955-d8b31b045c2f';\r\n readonly DefaultRPNPrintAttachmentTemplate = 'abf1577a-9efa-490a-8b5b-cd084a3408d0';\r\n readonly AccessDeniedTemplate = 'a1382f72-d478-45ab-9524-2618aab76032';\r\n readonly AccessDeniedTemplatePatientChart = '1d78f979-28ac-4911-8184-9612ad8101e0';\r\n readonly DefaultPatientWelcomeEmailTemplate = '7c8b6a18-2eed-47c4-80b3-4f092600ce13';\r\n readonly DefaultPortalMessageNotificationEmailTemplate = 'e5949ce7-84f4-40b2-a9fb-c9a2b83ca126';\r\n readonly DefaultPortalWelcomeEmailTemplate = '09a0cd36-5ec9-454a-9b36-c8de4a4e9507';\r\n readonly DefaultPortalChangePasswordEmailTemplate = '14b2a33d-31da-4845-aff1-ce50f731ebae';\r\n readonly DefaultPortalNewMessageFromPrmEmailTemplate = '6f9a8978-bca6-4a8f-8a68-f83d8d673457';\r\n readonly DefaultPortalResetPasswordFromPortalTemplate = '2017c0f9-19b0-41fa-8f08-572de811ff93';\r\n readonly DefaultPortalAccountResponsiblePartyStatementEmailTemplate = 'c1608427-2fbd-4660-8931-54b990c449b7';\r\n readonly DefaultCheckoutTemplate = '68452037-77d6-4499-91f3-f5533bf9ddcc';\r\n readonly DefaultOPSPrintHeader = 'a8ae8ca1-e854-40b9-976c-10e86a9f7ced';\r\n readonly DefaultOPSPrintFilteredHeader = 'd69082ee-8c88-458b-a71c-8cb2d9414b3f';\r\n readonly CompleteChartZippedAttachment = 'e60e42c0-e9fe-4373-a7d3-5536e2b22b9a';\r\n readonly CompleteChartNotIncludedAttachment = '1a38397e-9aa1-47a5-9e98-6385f9c35088';\r\n readonly DefaultClinicalSummaryTemplateUid = '7bc0cad4-06d2-4f5c-8e96-d8df589db6ec';\r\n // default Complete Chart Print definitions\r\n readonly DefaultRPNPrintButton = 'bd75524a-378b-4fdc-b7f8-e7cb438aaf27';\r\n readonly DefaultOPSPrintButton = 'ae48142a-e4bd-42a6-a34b-b82cad46acdf';\r\n readonly AllFileTypesToFiles = 'cd57cf3c-d2f9-44f6-8366-a4708a9d88fb';\r\n\r\n // Chart Access Security Uids\r\n readonly ChartAccessControlsSecurityUid = '426ecfd5-7259-414e-81c7-a7edbccb1b66';\r\n readonly EmergencyChartAccessSecurityUid = '0e0b6e89-614e-4ee6-a8c4-c6e818cb7f9b';\r\n\r\n // ListVaccineAdmin\r\n readonly ListVaccineAdmin_PediatricVaccineCard = '6b1b35b9-85a8-499e-83d9-11ebb24cea04';\r\n readonly ListVaccineAdmin_AdultVaccineCard = '187d09c3-f59f-446f-af14-3d8e1a3bd920';\r\n\r\n //ListImmzCompletion\r\n readonly ListImmzCompletion_Refused = 'd656418e-f475-4b76-a624-d4697b2b7d7b';\r\n readonly ListImmzCompletion_NotAdministered = 'a1949f85-01b8-4128-a39c-d0d916ffb2d6';\r\n\r\n // ListProductParameter\r\n readonly ProductParameter_PatientPortalRouteMessagesByServiceSite = 'ba5d6df9-8124-4a90-94c3-2fe739597f1c';\r\n readonly ProductParameter_PatientPortalUpdateDemographics = 'db28aa45-8e4e-4646-bd98-332c718ace12';\r\n readonly ProductParameter_PatientPortalUpdateDemographicsPhoto = '6a47f7f6-41d6-467b-8a7a-be36d6c92d9b';\r\n readonly ProductParameter_PatientPortalTagLine = '72af95ce-12f5-450a-8c0a-3941a3256ac7';\r\n readonly ProductParameter_PatientPortalPracticeConsent = '1d1fe66b-54b1-46cd-9d6d-aeeff9e411e3';\r\n readonly ProductParameter_PatientPortalChartConsent = '8d3b926a-d237-4ba1-99c8-1c40bd5d7dd5';\r\n readonly ProductParameter_PatientPortalURL = 'd0df5185-9f23-4d2b-8bf3-0e6c48442861';\r\n readonly ProductParameter_PatientPortal_ViewClinicalSummary = '27d5a4b8-1c68-45bb-a89f-023fbc5fc370';\r\n readonly ProductParameter_PatientPortal_ViewCompleteChart = 'aa04ca02-089b-4455-8566-cf9d766487b6';\r\n readonly ProductParameter_PatientPortal_ViewImmunizations = '0354d96b-e135-4753-b06c-1634e6745299';\r\n readonly ProductParameter_PatientPortal_ViewEducationalMaterial = 'aaad592b-0bff-4141-9f1c-504786cfe873';\r\n readonly ProductParameter_PatientPortal_UpdateInsurance = '349cdc7a-781c-4586-8414-12f79b1b6d1d';\r\n readonly ProductParameter_PatientPortal_MakeAPayment = 'a3978397-4796-43b3-9586-7f24e41aee33';\r\n readonly ProductParameter_PatientPortal_UpdateDemographics = 'db28aa45-8e4e-4646-bd98-332c718ace12';\r\n readonly ProductParameter_Practice_Email = 'ecdf36fc-d8ae-460c-ad3d-8ebbdef9abe1';\r\n readonly ProductParameter_Practice_Website = 'da6121e9-0978-4526-9052-ee4e844f0456';\r\n readonly ProductParameter_Practice_From_Email = 'efbb66f7-afbb-421d-8a99-697d36ff5625';\r\n readonly ProductParameter_AutoAddOnSetToDX = '0f1a6e38-41f4-48b2-8713-5688c222c9ee';\r\n readonly ProductParameter_DocumentLinkingWarningNumber = '86a89f8b-6cf1-42ad-be0c-2cfc0a663536';\r\n readonly ProductParameter_PatientPortalSecurityQuestions = '8c66bafa-eb42-472b-b89c-8b8de09218f1';\r\n readonly ProductParameter_PatientPortalContentAttributes = '1c190aa8-df1e-49b7-8fff-901d28046d22';\r\n readonly ProductParameter_PatientPortalMessageSubHeading = 'b348f800-1fcb-4397-9e1a-2226afd836e4';\r\n readonly ProductParameter_PatientPortalPracticeName = '2ad081a3-a195-4093-9c7f-1563bd3179a3';\r\n readonly ProductParameterDPNActionPrint = 'dbface34-6154-488d-8f44-c13dcb64b165';\r\n readonly ProductParameterDPNActionGenerateCCD = 'a6845a5d-2fb1-494c-81c6-1e57fd4eb02e';\r\n readonly ProductParameterDPNActionSendDocument = '134d73d3-f594-48af-be75-84ebcbd76e99';\r\n readonly ProductParameterDPNActionCreateReferral = 'a336390a-5c72-4ca5-a9f6-40ee9a741cce';\r\n // fix for bug #26797\r\n readonly ProductParameter_ApexAffinity = '5ae76288-3801-4c71-b943-370e7239bbc0';\r\n readonly ProductParameterFacilityAccountEditingEnabled = '274cf86f-edf0-4b61-ac12-ed5edcfec653';\r\n readonly ProductParameterDirectMailUserAccountCreationWarning = '96354ac3-d38a-46cc-afae-bf0b532d995e';\r\n readonly ProductParameterDirectMailUserAccountDeletionWarning = '4fefe5bb-55d0-4275-96e3-9afc101e9f15';\r\n readonly ProductParameterDirectMailNitorOneFacilityPerDomain = '0de075f1-fddc-4cb6-a5f1-6c30af39b544';\r\n readonly ProductParameterDirectMailNitorFacilityInactivePollSeconds = '0fecddc7-5174-4311-a7ba-524377e6da3d';\r\n readonly ProductParameterDirectMailNitorFacilityActivePollSeconds = '78b5d74a-d9ca-4611-981b-74e6275af6e0';\r\n\r\n readonly ProductParameterDiagnosisOneUrl = '719523ee-c072-495d-8e37-4e97d3a832a5';\r\n readonly ProductParameterDiagnosisOnePassword = '0d3ab0ca-dd67-4870-b8a6-62216481d613';\r\n readonly ProductParameterDiagnosisOneUserName = '2134b723-15ce-4147-884b-e0f0c2669f89';\r\n readonly ProductParameterDiagnosisOneRuleSet = '9106f134-b471-487b-a48f-bd69e465e1ca';\r\n readonly ProductParameterDiagnosisOneSaveToFileEnabled = '924496a8-b7a9-46ed-b59d-ce052c076eef';\r\n readonly ProductParameterDiagnosisOneMaxBatchSize = 'f0db6d11-ec84-447b-adb4-70fc3485a60b';\r\n readonly ProductParameterDiagnosisOneOAuthPath = 'ba5e0d70-7bf6-46bd-9646-acc5536b9b5f';\r\n readonly ProductParameterDiagnosisOneBaseINROrderUrl = '55b1f554-1699-4796-88c1-4821ca3a165b';\r\n readonly ProductParameterDiagnosisOneBaseINRReportUrl = '777f29c5-122e-41f6-9b4e-31933fa63b21';\r\n readonly ProductParameterDiagnosisOneEnterpriseID = 'e227b015-4a0e-4397-af18-a1478e438613';\r\n readonly ProductParameterDiagnosisOneINROrderUsername = '4baeecea-a4bf-4470-bb7b-c6b2138e1aff';\r\n readonly ProductParameterDiagnosisOneINROrderPassword = '2d2b9c78-d37d-4625-b5dd-018d8dc5491a';\r\n readonly ProductParameterDiagnosisOneTokenGeneratorUsername = 'b59cb0ee-f4e4-4dd2-9e46-a6bc8f7a97ba';\r\n readonly ProductParameterDiagnosisOneTokenGeneratorPassword = '9be8782f-bfc2-453f-92a2-67cd4ee62d80';\r\n readonly ProductParameterDefualtCCM_CPOTime = '680f3ffb-096f-4cdf-a84d-fc68d9da1557';\r\n // fix for bug #38595.\r\n readonly ProductParameterValidePAPayors = '5397bb02-9803-4639-9c85-dbff48739e88';\r\n readonly ProductParameterInfoResponseReviewed = '125f71db-c197-45e1-9c39-3e7561638fab'; // Scenario 39254\r\n readonly ProductParameterTransmissionSettingsCreateNewMailbox = '783fbc03-825b-4fb6-b8e8-5e84c25275cd';\r\n readonly ProductParameterAprimaNowLockoutTimeout = 'aab069b0-5b64-44ef-8963-371dfeff4edc';\r\n readonly ProductParameterFoxitLicenseSN = '2522a9aa-f38c-42f8-9b82-e5ac1a3fa6bf';\r\n readonly ProductParameterFoxitLicenseKey = '5f867a48-f16e-4d06-b8b7-d786e640eb7f';\r\n readonly ProductParameterFoxitDefaultTool = 'a407ba56-9179-482c-82cf-7222f028fb78';\r\n readonly ProductParameterFoxitDefaultViewMode = '48e4746a-bec4-4bef-ab78-0f813d6625dc';\r\n\r\n // Order Result Status\r\n readonly ResultStatus_Approved = '53bdc86c-2839-4066-9821-c20c214967b1';\r\n readonly ResultStatus_Resulted = 'e4861953-d5f3-4d86-be78-530b394ae39e';\r\n readonly ResultStatus_Received = '0017db73-34cc-42fe-974d-555f72088690';\r\n readonly ResultStatus_Reviewed = '40040bb9-3e07-4829-adf6-55bc637142e1';\r\n readonly ResultStatus_Collected = '71812cbc-af6d-4c84-aac9-70d0c024f282';\r\n readonly ResultStatus_Performed = '537aeecc-d952-4b66-831a-c4d6531906b1';\r\n readonly ResultStatus_Cancelled = '6b6a1578-26d1-452d-a198-dccfbcd9094f';\r\n readonly ResultStatus_Pending = 'd8acd15c-4f00-41fc-93c2-e1ba0a4edaa8';\r\n readonly ResultStatus_Ordered = '9114caee-042b-4b2c-a505-e70ba934000f';\r\n readonly ResultStatus_PendingResulted = 'dd6bc606-fa5f-47ea-a2a2-fd0f3938931c';\r\n\r\n // User Settings\r\n readonly UserSetting_Default = '10101010-1111-1000-0000-000000000001';\r\n readonly UserSetting_ICS = '10101010-1111-1000-0000-000000000002';\r\n readonly UserSetting_Midmark = '10101010-1111-1000-0000-000000000003';\r\n\r\n // Service Site Types\r\n readonly ServiceSiteType_Home = 'e5cbbaff-919a-44f7-912e-07b014b27bcd';\r\n\r\n // Report Designer - Relational Operators\r\n readonly RelationalOperator_IsNull = '75c59d5e-d1d6-4cfe-bb3b-1897fb56c268';\r\n readonly RelationalOperator_IsNotNull = 'ead36730-d30a-49db-b900-d2d9b67ad770';\r\n readonly RelationalOperator_InList = 'a7203de7-eb48-419d-b8de-5197e60e8a63';\r\n readonly RelationalOperator_NotInList = '4b1f614c-ce33-4614-90bf-0ce2718cd23c';\r\n readonly RelationalOperator_GreaterThan = '48eb6b68-552e-453f-ba8b-50ccb2a0988f';\r\n readonly RelationalOperator_GreaterThanOrEqual = '5fcf409e-2137-4630-886c-e928057dac36';\r\n readonly RelationalOperator_NotLike = '0885c3fa-be9b-4752-935c-51166f5cb199';\r\n readonly RelationalOperator_NotEqualTo = 'f4977c61-7ad6-4a4f-ad94-9a858a6a5760';\r\n readonly RelationalOperator_LessThan = 'e935c919-6b45-417a-a569-c4ad0b719a02';\r\n readonly RelationalOperator_LessThanOrEqualTo = 'aa3f54b6-f4e9-4031-bffa-ce067e0196f4';\r\n readonly RelationalOperator_EqualTo = '127889ba-7c69-4f1a-9657-de3bf969a7eb';\r\n readonly RelationalOperator_Like = 'f4bed64e-be68-4a57-9fb1-fbe242643a36';\r\n\r\n // Report Designer - User Defined Controls\r\n readonly UserDefinedControl_Find = '8a957d7c-8b86-4a67-8336-b830c30fd123';\r\n readonly UserDefinedControl_TextRange = '9b225d53-0cbd-4f0d-bd0a-54d05685ccca';\r\n readonly UserDefinedControl_DateRange = 'f81b4b08-d296-4ee9-b1f3-e61f85644a88';\r\n readonly UserDefinedControl_NumericRange = 'def86050-eef6-4577-9d2c-f7c172a0f6ea';\r\n readonly UserDefinedControl_Timespan = 'df87d0d5-bf48-49fb-abbc-cb75cc29eb64';\r\n\r\n // External Patient Type\r\n readonly CPOExternalType = 'cdb32bb9-25b8-4598-85c2-eca33d3b854c';\r\n\r\n // Patient Care Management Types\r\n readonly ChronicCareManagementType = '14e95bcd-a9bc-41e4-9743-ecdbad35fb6a';\r\n readonly CarePlanOversightType = '928a4f18-ff1f-4bba-90d9-66aee2233c9a';\r\n\r\n // HM Rules \"ListMisc\" Types\r\n readonly HMRules_OperandUid_LessThan = '3eebb69d-3bc4-4ce9-97fc-815c70f314a8';\r\n readonly HMRules_OperandUid_GreaterThan = '1263504f-77e8-41e2-aabb-75b10647d7f7';\r\n readonly HMRules_ConjUid_AND = '8637cc01-aab8-4e8a-a971-9cd91d0ef1eb';\r\n readonly HMRules_ConjUid_OR = '578cbd26-44df-4b86-b119-c2c4b759042f';\r\n\r\n // Scrub Types\r\n readonly Scrub_Superbills = '3e6dafcf-ebf1-4dc5-90b5-f596a9ef8498';\r\n readonly Scrub_Claims = '5bac9c30-6387-4359-9c39-42e2850d924c';\r\n\r\n // TimeFrames\r\n readonly TimeFrame_Clear = '2ec8c22d-49a2-4289-829d-017457bebfc0';\r\n readonly TimeFrame_Default = '444e6dc7-df0f-45bc-b8c1-c8b4122eed97';\r\n readonly TimeFrame_FreeText = 'd6153566-df35-42ae-8cba-b36544c53133';\r\n readonly TimeFrame_Calendar = '2a65cc34-b700-4be1-bc0c-bc3947abdbb4';\r\n readonly TimeFrame_Birth = '86317d78-c519-4fe3-8f02-b794ffb00357';\r\n readonly TimeFrame_Childhood = '4ce23cf0-c9bb-4016-900f-76a567a3c82c';\r\n readonly TimeFrame_Teenage = '3ff31d6d-0706-429d-9acf-c54e081ecd29';\r\n\r\n // problem status\r\n readonly ProblemStatus_Active = '613cd9a8-4e48-41d2-9c91-41eb7d5885b4';\r\n readonly ProblemStatus_Resolved = '116e88e8-daf1-4289-b354-e4cbc8a0103d';\r\n readonly ProblemStatus_Inactive = '92aeb1dc-a874-4c7a-bee1-53653161266d';\r\n\r\n // problem history control guid; used in ControlDx\r\n readonly ProblemHistoryCategory = 'df10c01a-d56a-4d97-aeca-5616ff05314a';\r\n\r\n // ListEthnicity\r\n readonly ListEthnicity_Hispanic = '304621ec-0958-4dc1-ae4d-2438e1d0dbdf';\r\n readonly ListEthnicity_Hispanic_Or_Latino = 'f34dad44-e417-47b3-b338-515954d242e3';\r\n\r\n // problem diagnosis history sort options\r\n readonly ProblemDiagnosisSortName = '624601c5-0b33-4c6a-91e6-69ddb47200ee';\r\n readonly ProblemDiagnosisSortOnset = '97226c02-8856-4d93-88fa-9bf71c9d9c04';\r\n readonly ProblemDiagnosisSortResolved = '9322c9ee-2ddd-49a1-bb54-308b7b501077';\r\n readonly ProblemDiagnosisSortProblemStatus = '59afd3b8-36de-4575-ba33-dea43720c2f5';\r\n readonly ProblemDiagnosisSortProblemDuration = '6d2632e1-8b63-48b9-994a-244a67a3fa7f';\r\n readonly ProblemDiagnosisSortRecordDate = '33c9190f-8f4b-4f1d-a56f-782759d3202f';\r\n\r\n // problem diagnosis history sort duration options\r\n readonly ProblemDiagnosisDurationSortUnknown = '187ad067-794a-45f0-b954-f6816668bc54';\r\n readonly ProblemDiagnosisDurationSortAcute = '38379dd8-cd7a-45af-a7b2-ba3aa4507ba3';\r\n readonly ProblemDiagnosisDurationSortChronic = '983c3ad7-3524-40cc-816b-1b942236dffd';\r\n\r\n // problem diagnosis history sort level options\r\n readonly ProblemDiagnosisNameSortLevel = '624601c5-0b33-4c6a-91e6-69ddb47200ee';\r\n readonly ProblemDiagnosisOnsetSortLevel = '97226c02-8856-4d93-88fa-9bf71c9d9c04';\r\n readonly ProblemDiagnosisResolvedSortLevel = '9322c9ee-2ddd-49a1-bb54-308b7b501077';\r\n readonly ProblemDiagnosisProblemStatusSortLevel = '59afd3b8-36de-4575-ba33-dea43720c2f5';\r\n readonly ProblemDiagnosisProblemDurationSortLevel = '6d2632e1-8b63-48b9-994a-244a67a3fa7f';\r\n readonly ProblemDiagnosisRecordDateSortLevel = '33c9190f-8f4b-4f1d-a56f-782759d3202f';\r\n\r\n // problem diagnosis status\r\n readonly ProblemDiagnosisStatusInactive = '92aeb1dc-a874-4c7a-bee1-53653161266d';\r\n readonly ProblemDiagnosisStatusActive = '613cd9a8-4e48-41d2-9c91-41eb7d5885b4';\r\n readonly ProblemDiagnosisStatusChronic = 'e7e822a8-edd9-45f9-80b8-dfb3d2383122';\r\n readonly ProblemDiagnosisStatusResolved = '116e88e8-daf1-4289-b354-e4cbc8a0103d';\r\n readonly ProblemDiagnosisStatusDeleted = '0ee6820d-a8f8-4364-b0b1-25aab505959a';\r\n\r\n // Collection Status Global\r\n readonly CollectionStatusGlobal = 'd497b60d-5bd2-414d-aa1e-4f8e558c5ce5';\r\n\r\n // List Disclosure Reasons\r\n readonly ListDisclosureReasonReleasedToPatient = '23453773-db8a-47bc-b3f5-5d915fa2b313';\r\n readonly ListDisclosureReasonCompleteChartSummary = 'dc3160a4-95f4-4224-a3f6-eff5d33dd61b';\r\n readonly ListDisclosureReasonReferral = 'e4b426a5-59aa-416d-b37b-ac7bd782b780';\r\n readonly ListDisclosureReasonReleasedByPatient = 'f296c968-14d2-4616-a526-1acd35527801';\r\n\r\n // List Custom Note Print\r\n readonly ListCustomNotePrintCompleteChart = '893996ba-e098-4239-885d-7e3252bba8f9';\r\n\r\n // Fax Servers\r\n readonly FaxServer_Interfax = 'cc7d8447-2def-4b56-b7fe-675f4f9e7dac';\r\n readonly FaxServer_Fax2Mail = '3c85e316-d741-4c67-9cdd-fec603be7bc6';\r\n readonly FaxServer_GFIFaxMaker = '4e064089-ab4a-4015-9ab0-8fdc9d18a99b';\r\n readonly FaxServer_Biscomfax = 'a1fb09d9-5ef0-492b-945e-b524ee47d5c1';\r\n readonly FaxServer_RightFax = '1f955d28-c5bd-467b-93c9-fe9c83f95cbf';\r\n readonly FaxServer_FaXit = 'd9a693f0-e780-4427-a6e3-2a578025f8b8';\r\n readonly FaxServer_Kno2 = '586f8db3-fdf7-4639-af4f-b5865a6f670f';\r\n\r\n // document linking folders\r\n readonly DocumentLinkingGeneralFolder = '9e6422c4-3f95-4ce6-bc84-79d068b93135';\r\n readonly DocumentLinkingIgnoreFolder = 'd762799d-1d5a-4546-9ead-fdfdc2021fc5';\r\n readonly DocumentLinkingRejectedFolder = 'e38fcf0c-75b9-4624-95c6-346c78fccb2c';\r\n readonly DocumentLinkingDirectMailFolder = '2dea85bb-503f-40a6-85ac-b2b199f63dcf';\r\n readonly DocumentLinkingFaXitFolder = '47688f38-cdfb-4b76-b73c-b2f69e36713a';\r\n\r\n // map sources\r\n readonly MapSource_ClaimsMapping = '18b56921-1614-4e0a-af7f-edd311e682e4';\r\n readonly MapSource_BeaconCarrierMapping = '45193380-4dcc-4837-99bb-fd145f1cf420';\r\n readonly MapSource_FromSurescriptsPhoneType = 'b41b3296-f1be-4f41-b90d-6aec99299ff3';\r\n readonly MapSource_ToSurescriptsPhoneType = '8a2fe4ae-25fd-42eb-9b2a-9b68e1795206';\r\n\r\n // UI Control Type\r\n readonly UIControlType_ChargeTicket = '362af25f-7a3b-4b37-83d2-3f316d87f8b1';\r\n readonly UIControlType_DataInput = '1232ccd0-b254-4cb0-af95-bf482de4f1c8';\r\n readonly UIControlType_ClinicalNoteTab = '26c21b2e-3aec-4cb5-9bc2-c9dc7dc9e34c';\r\n readonly UIControlType_ClinicalNoteSlider = '690c5ea2-3345-4785-ad1c-a1787feafe1d';\r\n readonly UIControlType_ClinicalAssessmentForm = 'd5b6f824-c839-4bd5-b660-042a74c43ebc';\r\n\r\n // UI Control\r\n readonly UIControl_ChargeTicket_Designer = 'f7992625-529f-4862-b984-23fc76a6740b';\r\n readonly UIControl_ChargeTicket_Standard = '4277e604-1ed7-4d19-b0e6-fc1acd09f10d';\r\n readonly UIControl_DataEntry_Designer = 'a71ae324-02b7-47e9-bd32-b96dde7e779e';\r\n readonly UIControl_Note_DesignerInput = '2ff8df13-6adf-497a-87c5-4bf34047b2ea';\r\n readonly UIControl_Note_DesignerCaseInput = '5ef07c48-9b2e-4551-8199-26e0cdfaaa70';\r\n readonly UIControl_Note_Plan = '892d6a04-149b-4283-abeb-12495ab3c560';\r\n readonly UIControl_Note_CC = 'c7aa99b0-b9aa-4570-9357-145f175fad62';\r\n readonly UIControl_Note_SO = 'd558a00e-a0b8-4425-b6ca-18cfcdd4e5e6';\r\n readonly UIControl_Note_HPI = '7480235f-7012-4c04-ba36-1aefc1697593';\r\n readonly UIControl_Note_PE = '32bf6c13-ed87-48de-9fef-52a5143d444d';\r\n readonly UIControl_Note_VisitText = 'bd6530dc-2373-49de-b284-56ea3d79cc46';\r\n readonly UIControl_Note_AssessmentForms = 'eca5fc07-e1bf-4325-8dec-5bff94d40925';\r\n readonly UIControl_Note_Vitals = '7a048322-ab0e-45a1-91be-64b25276950c';\r\n readonly UIControl_Note_ROS = 'c16a0788-f5af-4b93-b23e-82ecd52aea52';\r\n readonly UIControl_Note_Confidential = '56d27dff-e1cd-4428-b790-8d5738b020f5';\r\n readonly UIControl_Note_Results = 'a3aedf6d-720c-4da2-9b9a-945b8d490d37';\r\n readonly UIControl_Note_CCHPI = '4f22cd53-53a7-4d55-8fde-a3d52561c817';\r\n readonly UIControl_Note_RX = '79434f26-2cdd-48ad-9295-b03a3a5f02e9';\r\n readonly UIControl_Note_ROSPE = 'dbe463a3-ab72-44f2-9756-b07f0e1f853c';\r\n readonly UIControl_Note_DX = '71ba0a7e-39e4-4e94-8edb-c364fe7f736b';\r\n readonly UIControl_Note_DXDSM = 'a3dfeab4-6579-4743-8873-f96311e07589';\r\n readonly UIControl_Note_GeneralNote = '8b40d89b-3511-42a4-b07b-decadc72647e';\r\n readonly UIControl_Note_SP = '5db71e56-0da7-4480-a277-e4f796cbff67';\r\n readonly UIControl_Note_HX = '7eca6fd5-b1ca-408b-b073-f6feff45e8eb';\r\n\r\n //CYS SC\r\n readonly PrimaryInsType_IsPrimary = '10101010-0000-7777-0000-000000000001';\r\n //CYS SC - System Defaults\r\n readonly CHCSystemDefault = '10101010-0000-0000-1001-000000000001';\r\n\r\n //Qatalys - built in provider for review/approve messages assignment\r\n readonly DefaultOrderingProvider = '87ccdbcd-4df2-4212-a7dc-33006c98f92e';\r\n\r\n readonly LanguageEnglish = 'e76c7b0b-d485-4307-9921-b2f65c5ba718';\r\n readonly LanguageSpanish = '311d2501-d8ca-45e5-a171-c7126b4fdd5c';\r\n\r\n // ListClaimBatchStatus\r\n readonly ListClaimBatchStatus_InProgress = '37671b78-bec4-44cf-babc-5a60cfa25f50';\r\n readonly ListClaimBatchStatus_ReadyToSend = 'f4ae1494-47d5-4404-bb9d-d2ed4da9fba7';\r\n readonly ListClaimBatchStatus_Sent = '08076914-83e5-48dd-9260-c56c5ec73412';\r\n readonly ListClaimBatchStatus_Failed = 'c1e377d7-7948-4473-a9d4-1038887b322b';\r\n\r\n //Declined to specify information - for MU II demographics where patient did not specify information. This guid currently resides in ListEthnicity, ListRace & ListLanguage.\r\n //Add it to any other table that needs it for a selected item in a findcontrol.\r\n readonly DeclinedToSpecify = '4176e3b5-c69d-4df0-8d9b-2a059459d859';\r\n\r\n // CallPointe person uid; fixed bug #20423\r\n readonly CallPointePerson = 'af8f2184-6591-4df8-86be-e91ccf2506e7';\r\n\r\n // ListNotificationMethod\r\n readonly NotificationMethodEmail = 'd804e208-8525-459d-aa9d-613b174939b0';\r\n readonly NotificationMethodMail = '6e5a8ab2-4779-4ab6-9a69-09a266da6ba0';\r\n readonly NotificationMethodPhone = '262854e9-0dfa-46d8-a3b1-ac83cebda18a';\r\n readonly NotificationMethodText = 'c0edfc41-134b-49b1-b3ab-872def185a76';\r\n readonly NotificationMethodUnknown = '79f84471-3104-48dc-9331-4cfa1e78c158';\r\n\r\n // ListRecallType\r\n readonly RecallTypeClinicalDecisionSupport = 'a35165d7-78cc-4aac-b130-7f945a92c35f';\r\n readonly RecallTypePatientsByCondition = '17eb9743-ac60-4c6f-b6c7-246983b9c69f';\r\n\r\n // ListRuleMeasure\r\n readonly ListRuleMeasure_HEDIS = '86e6b8d1-a851-4f16-8c33-cfdedcc5c888';\r\n readonly ListRuleMeasure_MUII_QRDA_Aggregate = '627c0740-381e-4c43-9db5-42cc66ba1969';\r\n readonly ListRuleMeasure_MUII_QRDA_Aggregate_2014 = 'cf6ef5da-1cb0-4af3-ab1a-48444562ea2e';\r\n readonly ListRuleMeasure_PQRS = '1c7684c7-fef4-48fd-9b3d-dee660a6e8f8';\r\n\r\n // ListEligibilityStatus\r\n readonly ListEligibilityStatusCannotProcess = 'a9d72b1e-42fc-495e-ae92-74e6c68ffa6b';\r\n\r\n // ListIntegrationPartner\r\n readonly ListIntegrationPartnerSurescriptseRxServiceUid = '118422aa-c165-4a2e-8389-e5b7e89636ea';\r\n readonly ListIntegrationPartnerSurescriptsDirectMessageUid = '4d1bc44b-31f5-4b41-8f50-a95047266ffc';\r\n readonly ListIntegrationPartnerSurescriptsRLEUid = '0609c279-d522-4596-aeb8-51eda485ad49';\r\n readonly ListIntegrationPartnerNitorDirectMessageWithCertificateUid = '8053bc8f-0bea-41da-8a2f-4fc7d6da65d5';\r\n readonly ListIntegrationPartnereTacticsUid = 'da11fe70-9b5a-4318-ae16-550ba170a9b3';\r\n readonly ListIntegrationPartnerCommonWellUid = '01178549-2cef-462b-89b0-e41ea99ee57a';\r\n readonly ListIntegrationPartnerCircleLinkUid = '60157d55-360b-4505-bb1a-f09e538826c9';\r\n readonly ListIntegrationPartnerPersiviaUid = 'c75bd792-315c-425f-8a01-7ba85510d616';\r\n\r\n // TransmissionConfiguration\r\n readonly TransmissionConfigurationSurescriptsDirectMessageUid = '55ef6d4c-23a2-4ecd-a4e9-b6cd6f8350f2';\r\n readonly TransmissionConfigurationeRxOrganizationDirectoryUid = '1fd91627-0d23-43ac-a8db-cfca9ec19af0';\r\n readonly TransmissionConfigurationeRxProviderDirectoryUid = 'd081543c-8f64-4c66-85b0-955eb8f944d0';\r\n readonly TransmissionConfigurationSurescriptsDirectMessageInboundUid = '1d370169-a34b-45ae-b029-b4ebeb549c4b';\r\n\r\n// ClinicalDelgateSecurityAllow\r\n readonly ClinicalDelgateSecurityCanCreateOrder = '5be7f005-87a8-4dfa-b2a8-7f01db80ab21';\r\n readonly ClinicalDelgateSecurityCanCanCreatePrescription = '91012e30-80b9-4b68-a719-9e4f65dc606f';\r\n readonly ClinicalDelgateSecurityCanSendDirectMail = '6247f22f-fbba-4949-ba3c-b44f4a5db747';\r\n readonly ClinicalDelgateSecurityCanCompleteNote = '1b48ba6e-4799-4975-ab68-f7a91b85c0a6';\r\n\r\n // ListRuleMeasure CCDA Type Documents\r\n readonly ListRuleMeasureCcdaCcdDocumentTypeUid = 'd2acb40b-b670-4283-b803-88e91f2a18d7';\r\n readonly ListRuleMeasureC32CcdDocumentTypeUid = '3de2dbe0-f202-4d12-964f-aaf46bfaa347';\r\n readonly ListRuleMeasureCcrDocumentTypeUid = '56b481a8-7947-4a65-8692-feb7519516e2';\r\n readonly ListRuleMeasureCqmDocumentTypeUid = '627c0740-381e-4c43-9db5-42cc66ba1969';\r\n\r\n // Procedure Refused NegationReason\r\n readonly ProcedureNegationReasonUid = 'cc03cd94-0f99-40fb-9c56-fc9649b416c3';\r\n\r\n // ImmunizationRefusal\r\n readonly ImmzRefusalOtherUid = '15655cf4-170f-4c4a-9dc0-e0cebf51c42b';\r\n readonly ImmzRefusalParentalDecisionUid = '4d38e0be-33f4-478b-87b2-4239b508a81e';\r\n readonly ImmzRefusalPatientDecisionUid = 'f2facba0-29f1-42a2-b584-a8f07e4d2435';\r\n\r\n // ListCdaSection\r\n readonly CdaSectionC32 = '2cb025a2-3918-4988-8f78-5187897ade8e';\r\n readonly CdaSectionCcda = 'f1d05427-2c72-456a-a45b-a01b08728b5c';\r\n\r\n // ABNStatus\r\n readonly ABNNotRequiredUid = 'dbf01d6f-5582-4f03-a3f2-23e137f9f9c0';\r\n readonly ABNRequiredUid = 'abfeae05-10b9-45ff-9139-14276f138790';\r\n readonly ABNCompletedUid = '52045ae5-a3d2-49bc-8180-b690157954d7';\r\n\r\n //FormTitle\r\n readonly FormTitleGeneric = '99999999-0000-0000-0000-000000000000';\r\n readonly FormTitleFNC = '99999999-0000-0000-0000-000000000001';\r\n readonly FormTitleDemographics = '99999999-0000-0000-0000-000000000002';\r\n\r\n //PatientStatus\r\n readonly PatientStatus_TestPatient = '77a41e18-5554-4874-9454-54dc3d7a33a0';\r\n readonly PatientStatus_Transfer = 'a2582df2-e663-4a79-9464-11da43f9bd53';\r\n readonly PatientStatus_Deceased = '40bad38d-146f-4314-95fc-5388151a4f38';\r\n readonly PatientStatus_Consult = 'a83dd048-b972-4578-a21d-586b65d563ce';\r\n readonly PatientStatus_Relocated = '785cc385-0635-47b7-a8c4-7717ca3bbddd';\r\n readonly PatientStatus_Inactive = 'ecea6163-dc76-4741-b6d0-9101037d2a0b';\r\n\r\n //HMRULE Decline Reasons\r\n readonly HMRULEPatientDeclineUid = '755dc7cc-affe-4da4-a2e5-1f050f3230c3';\r\n readonly HMRULENoInsuranceUid = '85868f64-30b2-46e9-a22a-22ca00e916cf';\r\n readonly HMRULENotNecessaryUid = '4088dace-5ac9-44dc-a428-24ce90cc417b';\r\n\r\n //ListNegationReason\r\n readonly NegationReasonProcRefusedUid = 'cc03cd94-0f99-40fb-9c56-fc9649b416c3';\r\n readonly NegationReasonUninsuredUid = 'c59fd3dd-684f-4f27-840d-f7c2538d1d4b';\r\n readonly NegationReasonProcNotIndicatedUid = '533c24a6-a5f7-4e21-a449-d216420f4e02';\r\n\r\n // fixed bugs #40099 & #40120\r\n //ListAgeGroup\r\n readonly AdultAgeGroupUid = '00000000-0000-0000-0000-000000000001';\r\n readonly PediatricAgeGroupUid = '00000000-0000-0000-0000-000000000002';\r\n\r\n // MedicalServicesProvider types for CCM/CPO\r\n readonly MedicalServicesProviderTypeHospice = 'b502c7e7-226a-446d-89ad-1627bba55504';\r\n readonly MedicalServicesProviderTypeInHome = '144b3ba7-e61c-49be-aaa7-9012317a9ca8';\r\n\r\n // AddressHistoryType - ListMisc\r\n readonly AddressType_Home = 'a9b8c13f-822b-4f20-8f13-306db46a4c59';\r\n readonly AddressType_Homeless = 'c27fc3db-4071-4380-acf6-7672bb9521c9';\r\n readonly AddressType_BirthPlace = '7c111fb1-6fa5-47cc-b888-34982b6d3bf1';\r\n\r\n // Patient Portal Message Routing\r\n readonly PatientPortalMessageRoutingDefaultMessageSubTypeUid = 'df0201ea-814b-4f2b-852a-8fef5834ed70';\r\n readonly PatientPortalMessageRoutingDefaultServiceSiteUid = '9fab7f69-127e-4bc3-b0cd-df5de7c96e88';\r\n readonly PatientPortalMessageRoutingDefaultProviderUid = 'b4f160ea-f938-40e4-9c34-28bdd14952d2';\r\n readonly PatientPortalDefaultMessageRoutingUid = '1e4a73da-6b53-41ad-b172-b5e29670dbb3';\r\n\r\n // BatchProcesType\r\n readonly CCDABatchProcessTypeUid = '10000101-0000-0000-0000-000000000001';\r\n readonly CQMBatchProcessTypeUid = '10000101-0000-0000-0000-000000000002';\r\n readonly ClaimsBatchProcessTypeUid = '10000101-0000-0000-0000-000000000003';\r\n readonly RemittanceBatchProcessTypeUid = '10000101-0000-0000-0000-000000000004';\r\n readonly StatementsBatchProcessTypeUid = '10000101-0000-0000-0000-000000000005';\r\n readonly CreditCardConsentsBatchProcessTypeUid = '10000101-0000-0000-0000-000000000006';\r\n readonly BPatientChartsatchProcessTypeUid = '10000101-0000-0000-0000-000000000007';\r\n readonly CancerRegistryBatchProcessTypeUid = '10000101-0000-0000-0000-000000000077';\r\n\r\n // Plan Now\r\n readonly DpnGroupGenericNos = '4cae9a8d-baa8-4d5f-a6ad-1b628e575cc7';\r\n readonly DpnNodePlanRecall = '2bd193b7-7904-4261-8073-4d5308ada0ee';\r\n readonly DpnNodePlanPatientInstructions = 'e4e7edd0-2b55-47de-a746-3cf134cecd1c';\r\n readonly DpnNodePlanPlanNotes = '136cf736-82ff-44e0-8cbd-1a52f839aa1a';\r\n readonly DpnNodePlanInternalNotes = '2552419f-81b6-41eb-8804-8b35652c9778';\r\n\r\n // ListUIConfiguration\r\n readonly Default_ListUIConfigurationUid = '5175CAF7-9F06-4017-9E4A-506FE7EC110E';\r\n\r\n // ListDxTileConfiguration\r\n readonly NOS_ListDxTileConfigurationUid = 'C02D67C1-BACB-491E-906E-E7DA411297AA';\r\n\r\n // Full Note Dashboard\r\n readonly FndHardBreakUid = '6693557C-26AB-4E29-BE0A-22158D9D2598';\r\n readonly FndActiveProblemsTileUid = '983A37AE-290C-4C42-98B9-30B1067E1F52';\r\n readonly FndMedicationTileUid = '5cce721e-010e-40ee-a454-baa141b1ef47';\r\n readonly FndPatientStoryTileUid = 'bd843b3c-0e2e-49d4-8a32-524937f6928b';\r\n readonly FndVisitActionItemTileUid = '8ac73cea-6c89-4fb4-9b75-fce23b4b252c';\r\n readonly FndRecentVisitsTileUid = '2f25632e-1923-48aa-8d17-13700b7ba91b';\r\n readonly FndActivitySinceLastVisitTileUid = '30ae8a3f-c087-7c1e-2a97-3ad809bef893';\r\n readonly FndVisitInformationTileUid = 'F5E34A86-78F7-4E39-8580-0AABC2133AA9';\r\n readonly FndClinicalDecisionSupportTileUid = 'DEFB1F1A-C488-4459-A6B2-7D9092D8F9CB';\r\n readonly FndCCHPITileUid = 'CE149DAB-2B63-455E-B68E-975D1964399E';\r\n readonly FndROSTileUid = '5858CFCC-7403-4E2C-ABA1-C8543FDF2BDC';\r\n readonly FndPhysicalExamTileUid = 'A454338B-4319-4E97-A9BD-DF66AA598E9A';\r\n readonly FndPlanTileUid = 'AF046BF1-3317-4D62-847C-2EECD804667D';\r\n readonly FndVitalsResultsTileUid = 'c9d5765b-8949-4325-bae8-c1c614ce3b07';\r\n readonly FndDiagnosisSpecificTileUid = 'e00d6551-5021-471a-8737-30d15407be29';\r\n readonly FndEducationFormTileUid = '1EB8E5B8-6815-41FC-BF9A-43C31959D4BE';\r\n readonly FndNoteActionTileUid = '83B586CF-EED4-41EA-84B9-D755EFF8161D';\r\n readonly FndVisitDiagnosisTileUid = 'c7df9a1e-d8ff-4644-a4be-0a9ce0b1f6f5';\r\n readonly FndAttachmentsTileUid = '81c59f62-b75b-486c-95f5-20c3810783a4';\r\n readonly FndServicesOrderedTileUid = '720df3b2-0c8e-4952-aacd-3bc31f2d187f';\r\n readonly FndServicesPerformedTileUid = '9b0c2d86-9991-4651-bbed-8abd27263d19';\r\n readonly FndAllergiesTileUid = '83679BFB-575A-4A33-9E41-C5AF9B4DBCEF';\r\n readonly FndAppointmentHistoryTileUid = '776263E9-2F1B-4CCE-BF5E-B8C3976FC80A';\r\n readonly FndHistoryTileUid = 'C47A8B76-4B96-4DEB-A9EE-FD645BAEFA08';\r\n readonly FndPatientCarePlanTileUid = '80FF4AE7-330A-4BD4-A0AE-62DC935092F3';\r\n readonly FndAssessmentTileUid = '14bd46e7-84db-4269-8d0b-6dfb9fab05d0';\r\n readonly FndFhirClientsTileUid = '5511954E-1036-4B87-BF22-9F2221F0CD53';\r\n\r\n // Macro Groups\r\n readonly MacroGroupSystemUid = 'D5ECBD0A-5DCF-4E76-B1F9-B490A00AC60B';\r\n readonly MacroGroupCommonUid = 'CFC5875B-FD3D-4EDC-BAA8-5CA0291B64ED';\r\n\r\n // Home Dashboard\r\n readonly HdUnsentPrescriptionsTileUid = 'DAD2A405-8AF3-4831-8BC6-52B5C8959558';\r\n readonly HdPatientAllergiesTileUid = '2D5F5A45-F25D-4B2F-A779-A8C0A800F6A4';\r\n readonly HdPatientMedicationsTileUid = '761F9AC2-0B0F-447C-9968-E79737F41874';\r\n readonly HdPatientActiveProblemsTileUid = '75727057-82A0-412A-BD19-7EDCE6DC1DAF';\r\n readonly HdPatientVitalsTileUid = 'C9ECFED3-2CB1-44C1-80CA-4895322453E6';\r\n readonly HdPatientInfoVisitsTileUid = 'D9687CFE-DCC9-435C-B379-5D24941DCCB5';\r\n readonly HdRecentVisitsTileUid = '7F95EE5A-DC73-4F00-944B-27B8BF022894';\r\n readonly HdReplicationMonitorTileUid = 'DFEE9D62-92D6-4068-845F-CB11C528D95D';\r\n readonly HdWaitingListTileUid = 'C68E9C15-86C4-473F-A123-021F6CAE4B97';\r\n readonly HdDocumentLinkingTileUid = '973B8745-2931-46B9-8BEE-565385B64E84';\r\n readonly HdMessageCountsTileUid = '0D30D1A6-D56F-4404-BA37-221531FDFE9B';\r\n readonly HdMessagesTileUid = '4EED7F56-6A65-41E5-B568-80A4701C33E1';\r\n readonly HdAppointmentQueueTileUid = '72214A6B-49C5-4D11-8303-D08B23FF58F5';\r\n readonly HdExternalPatientsTileUid = '9AD5225E-4E56-4916-8E27-C7B1DC154520';\r\n readonly HdVisitNotesTileUid = 'C7B0C52D-C2B3-43E8-A28F-8031D81F29BA';\r\n readonly HdPromotingInteroperabilityTileUid = '8200F46B-A734-409B-9B14-25E8204EED48';\r\n readonly HdProviderEMTileUid = '1947C8B8-050E-465C-8217-91EF525BC1EC';\r\n readonly HdFhirClientsTileUid = 'C5597BE5-A524-420A-AF61-956652479B21';\r\n\r\n // Rx Workflow Rx Pending ePA\r\n readonly RxWorkflowPendingEpaUid = '2A360B72-2B79-4539-A264-3FDB799FCF64';\r\n readonly RxWorkflowPendingSpeUid = '8C0970A8-7373-4395-AB4A-101B757BE584';\r\n readonly RxWorkflowPendingFormularyUid = 'AB18D690-5635-466E-8B45-E0D70B81877F';\r\n\r\n // Homepage\r\n readonly HomepageDefaultConfiguration = 'ef5b52e3-cb68-4fa7-8894-3d66d5cbc5c5';\r\n readonly HomepageClinicalConfiguration = 'b415487a-4616-45a4-8b9a-d501fc83508b';\r\n readonly HomepageAdministratorConfiguration = '816b8edd-3243-4c17-a151-47ca1e1d02f8';\r\n\r\n readonly hdAppointmentQueueSortOptionAppointmentTimeUid = '0AD174FE-014E-496C-8BE1-3ECEDFEBE6D8';\r\n\r\n // External Material Source Categories\r\n\r\n readonly EmsCategoryHomepageQuickStartGuide = 'F296B042-3353-4E62-9BEB-2A605529922A';\r\n readonly EmsCategoryAprimaToday = 'F05A959D-142E-4028-8E1D-59A213436CCA';\r\n readonly EmsCategoryTutorial = 'BF2A0FD9-B0A4-4C9B-B07A-D0DB34DE531F';\r\n\r\n // Find Controls\r\n readonly HomepageConfigurationFindControl = '60fdb299-887b-4530-b979-9efc5c3105f0';\r\n readonly FndConfigurationFindControl = '01a60c01-dbb6-405e-9cf1-14a9f56b6f7a';\r\n readonly ListFindControlBehaviorFindControl = '6cf2b96a-de25-4959-924c-7cdba9ea7572';\r\n\r\n // For retrieving User Settings\r\n readonly UserSettingAngularHomepageUid = 'f18c92dc-1852-4f05-9d79-875e3838717d';\r\n readonly UserSettingPrintSetUid = '29a7b66b-479c-4b74-ab2e-c73b7a26399f';\r\n readonly UserSettingArBatchUid = '110da9c8-ae18-4961-81e4-9abc766594e7';\r\n\r\n // Well known Angular Homepage menu items\r\n readonly AngularHomepagePatientCenterMenuItemUid = '9832cd10-bfa6-4d79-85a4-c83f0f90d1ee';\r\n readonly AngularHomepagePatientProviderTrackingMenuItemUid = 'c968cebe-4c2d-4ed4-859d-c70b8353d2bb';\r\n readonly AngularHomepagePatientRecallsMenuItemUid = 'aade84b7-2b8a-4f65-a08d-219259ee0814';\r\n readonly AngularHomepageCareManagementReviewMenuItemUid = '074e0921-d9b6-4042-8e44-993236bfbee0';\r\n readonly AngularHomepageSchedulerMenuItemUid = 'd8936d29-b44f-4205-8d17-3a39037ae1f2';\r\n readonly AngularHomepageMassAppointmentsUpdateMenuItemUid = 'afd6616f-eac4-4c34-94f4-2c11c71a8073';\r\n readonly AngularHomepageExternalPatientsMenuItemUid = 'ff15d366-d9f4-4f6a-89b3-50ea243c90dc';\r\n readonly AngularHomepageNewMessageParentMenuItemUid = '15d5b603-56ca-4ccd-8d7e-81b3e23200fd';\r\n readonly AngularHomepageMessageCenterMenuItemUid = 'a560dc13-b972-4035-b95b-530626a4ea23';\r\n readonly AngularHomepageInstantMessageMenuItemUid = 'ff48c058-70cc-4dab-9273-c89a7abf406b';\r\n readonly AngularHomepageListEditorMenuItemUid = 'f61b1d5e-9323-4315-9a44-81567d23458f';\r\n readonly AngularHomepageConfigureQuickSearchMenuItemUid = '3555fc70-0f76-45fe-bc62-3657800fca30';\r\n readonly AngularHomepagePracticeSettingsMenuItemUid = 'd6247b7e-a0bf-45a3-a2f9-8f7b1258e078';\r\n readonly AngularHomepagePatientPortalSettingsMenuItemUid = '97239d2c-f567-4b97-93bd-b35347e1a36d';\r\n readonly AngularHomepageFacilityPortalSettingsMenuItemUid = '9230f482-5710-4c47-8d45-c2774f12b4ef';\r\n readonly AngularHomepageConfigurePatientConnectMenuItemUid = '136e2e8f-0890-4c69-8fdf-c21f2f98b02e';\r\n readonly AngularHomepageConfigureSignaturePadMenuItemUid = 'f5c6ef8c-20e2-4250-8338-d87228c4cf67';\r\n readonly AngularHomepageConfigureRequiredFieldsMenuItemUid = 'a0db3620-5a7b-4dad-bb52-71425dba9922';\r\n readonly AngularHomepageModifyCurrentUserMenuItemUid = '8ae3677b-a391-4437-a1f9-713d55289ceb';\r\n readonly AngularHomepageModifyCurrentSettingsMenuItemUid = 'b6f91c62-b60d-4b29-a4ef-9a0404a6f848';\r\n readonly AngularHomepageResetMyConfigurationMenuItemUid = '21b01412-9ce7-425f-a49b-0b765420711e';\r\n readonly AngularHomepageConfigureMyPrintSetMenuItemUid = '6a170afd-10b0-41b0-893b-1cba6dcf86b2';\r\n readonly AngularHomepageHomeConfigurationMenuItemUid = '9b9ee7a6-d261-42ac-9b33-fd13ff5f66b6';\r\n readonly AngularHomepageFndConfigurationMenuItemUid = '018898a6-7317-4b56-97ed-f99fa6298bd0';\r\n readonly AngularHomepageConfigureFndDstMenuItemUid = '9af238e8-dc8b-439d-bbdb-7d42e5aeedf2';\r\n readonly AngularHomepageReviewPriorAuthMenuItemUid = '1386d47f-c72c-45da-aade-9b4022f037c7';\r\n readonly AngularHomepageTrackRxMenuItemUid = '0eee3625-e7d2-4bbc-9cbb-62707ed8c2f4';\r\n readonly AngularHomepageReferralTrackingMenuItemUid = 'd97cbf35-7f88-4e83-b104-26df1a948f68';\r\n readonly AngularHomepageTrackOutstandingOrdersMenuItemUid = '9db52eab-61e4-4f76-bc92-8a95520e14dc';\r\n readonly AngularHomepageTrackResultsMenuItemUid = '0ce29f82-c43e-43de-bf78-e2072467f7fd';\r\n readonly AngularHomepageInterfaceDataDetailMenuItemUid = '3b89f81a-8f79-4c46-ac75-7caf872c2fb4';\r\n readonly AngularHomepageTrackEMedHxMenuItemUid = '5f339210-e2d6-46ff-bfc2-26841d27cef4';\r\n readonly AngularHomepageTrackRxBenefitsMenuItemUid = 'fc329a9b-93cb-47e8-a037-7e86643f5162';\r\n readonly AngularHomepageTrackFaxMenuItemUid = 'a42699e1-9a98-4ab1-be58-7c912f6bdb41';\r\n readonly AngularHomepageTrackVoiceTranscriptionsMenuItemUid = 'a81e986f-84b5-4a5e-ab72-e0b9fd9dcb81';\r\n readonly AngularHomepageTrackingVisitCenterMenuItemUid = '4437fad9-7462-4418-a8e2-3109cf67fa58';\r\n readonly AngularHomepageFinancialBatchMenuItemUid = '0c9805ad-6672-40b8-872d-1719bdc89f98';\r\n readonly AngularHomepageTrackSuperbillsMenuItemUid = 'db7b8034-7674-46d1-819f-60feb5dce4c0';\r\n readonly AngularHomepageTrackSBProceduresMenuItemUid = '993fc6a6-540f-44cf-a6e4-b567e4d6da07';\r\n readonly AngularHomepageTrackVisitWithoutSBMenuItemUid = '0b78d46d-3c2c-4087-b0ae-6e4ebe4366f6';\r\n readonly AngularHomepageTrackAppointmentWithoutSBMenuItemUid = '3e6b7a8b-8ec4-4605-8eb2-c1df50bed339';\r\n readonly AngularHomepageTrackFinancialsMenuItemUid = 'd7217946-d2c8-4923-8279-12e0bc5aa1b3';\r\n readonly AngularHomepageProcessClaimsMenuItemUid = 'f3873ea3-9b3b-47b9-811d-096f71374c80';\r\n readonly AngularHomepageSuperbillReportsMenuItemUid = 'dcb976c6-07c3-4359-8b1a-8cd883e484b4';\r\n readonly AngularHomepageFilingHistoryMenuItemUid = 'be9e9820-0d15-4c57-b36c-24b2701f05db';\r\n readonly AngularHomepageAlignHcfaMenuItemUid = '1f04248d-4167-4a5c-babb-e39030f404c4';\r\n readonly AngularHomepageCopayLogMenuItemUid = 'b2bc531c-dcf3-4f30-af7d-e957f77dc94b';\r\n readonly AngularHomepageTrackPaymentsMenuItemUid = 'c27e3075-29d8-4c4e-a1ee-93c130af96f0';\r\n readonly AngularHomepageTrackPayerCreditsMenuItemUid = '986779ee-031b-4cc2-929d-d9e3122e1711';\r\n readonly AngularHomepageTrackTransactionsMenuItemUid = '5488b18f-68d6-4080-ba3a-95866188e075';\r\n readonly AngularHomepageEdiResponsesMenuItemUid = 'c9786f81-6d2c-45e9-b23f-45465f320a44';\r\n readonly AngularHomepageCreditCardSettlementsMenuItemUid = '32ee5027-9327-4748-bde7-7ed2e419b4e3';\r\n readonly AngularHomepageCreditCardTransactionsMenuItemUid = 'c43e2e70-ffa1-4a80-bfdb-ea91f7ec5500';\r\n readonly AngularHomepageCreditCardPaymentsMenuItemUid = 'f59a19dd-c0f7-4ee2-9356-af7f00f583cd';\r\n readonly AngularHomepageBatchCreditCardConsentProcessingMenuItemUid = '591bfcdf-007c-4494-94ab-00fed9070939';\r\n readonly AngularHomepageResponsiblePartyCollectionsMenuItemUid = '22cbeefb-6012-4d6a-9253-266a7189704d';\r\n readonly AngularHomepageAccountReceivableInsurancePromisesMenuItemUid = '4abaa812-75fc-4e3a-a449-216ba7951dfa';\r\n readonly AngularHomepagePrintCollectionLettersMenuItemUid = 'd7de2f91-5788-4b58-8dcb-820d366e7105';\r\n readonly AngularHomepageAccountReceivableStatementMenuItemUid = '4e3a9deb-721f-496e-a0de-5999098d7de3';\r\n readonly AngularHomepageBillingUpdateClosingDateMenuItemUid = '3defe1ee-a99d-44b3-a47d-a63f29ae1e1a';\r\n readonly AngularHomepageInsurancePayerPlanCenterMenuItemUid = '7fe863bf-5ade-4adb-ae85-6795b82d9de3';\r\n readonly AngularHomepageDocumentManagementMenuItemUid = 'fd8ef512-5479-4dbf-b74d-9f68f796bb67';\r\n readonly AngularHomepageDocumentImportingMenuItemUid = '589334b3-0042-48b8-9bdb-1b0330467d43';\r\n readonly AngularHomepageDocumentLinkingV1MenuItemUid = 'ed589716-a8af-46c2-a745-a2bd30f0d11f';\r\n readonly AngularHomepageDocumentLinkingV2MenuItemUid = '0ec3642f-45fc-4e45-9867-711b5bb43dc8';\r\n readonly AngularHomepageDicomImageViewerMenuItemUid = '468f7594-c7f1-4e04-b4ed-2ce0d95385cd';\r\n readonly AngularHomepageDocumentBatchProcessingMenuItemUid = '2d2eb653-bf57-4b66-b258-2b40b83cf295';\r\n readonly AngularHomepageBulkPatientImportMenuItemUid = '00232875-ebad-43ad-83cc-a3ab4949f00d';\r\n readonly AngularHomepageReportsMenuItemUid = 'bcfbc606-9f2a-441d-b2fc-d7e01b805975';\r\n readonly AngularHomepageDocBatchMgmtCqmMenuItemUid = '8cca41ef-4fc5-4fe7-8359-efbc6e0c6454';\r\n readonly AngularHomepageAuditTrailMenuItemUid = '8a65279b-80c3-43ed-86a2-b46fede1e451';\r\n readonly AngularHomepageJobHistoryMenuItemUid = '69c9dfec-f415-4b2d-8a02-51e3b9722409';\r\n readonly AngularHomepageReplicationClientMenuItemUid = 'd91047de-57dc-4e11-a7a5-2d51e72f21f7';\r\n readonly AngularHomepageUnlockPatientMenuItemUid = 'e6205482-3a56-4db4-99cf-0881e5a921c8';\r\n readonly AngularHomepageReloadLicenseMenuItemUid = '3e8efbb1-9637-4399-be36-b3228a8a21bb';\r\n readonly AngularHomepageReloadUserMenuItemUid = '31d2c176-7736-440a-973d-680f4b82d31a';\r\n readonly AngularHomepageQuickStartGuideMenuItemUid = '274f6471-3b48-4cd0-9042-852ac5546c0c';\r\n readonly AngularHomepageHelpContentsMenuItemUid = '7c1851fc-38e4-4d45-8246-260a35b178c1';\r\n readonly AngularHomepageReleaseNotesMenuItemUid = '867c08ea-298e-43ed-9734-8aef96b3816d';\r\n readonly AngularHomepageHelpFaqMenuItemUid = '99f208a8-3928-456a-b9a7-6dc86c9cdc25';\r\n readonly AngularHomepageHelpSupportMenuItemUid = '17e46679-a5be-4b4a-8585-52f2ebca571c';\r\n readonly AngularHomepageHelpCgmPortalMenuItemUid = 'C477664E-307D-40EE-AEEA-9B524636275E';\r\n readonly AngularHomepageHelpEngageMenuItemUid = '1bb99f87-6d0b-47c1-9afc-62b922ee63be';\r\n readonly AngularHomepageHelpDocumentationMenuItemUid = 'ff7e2d42-d34d-42b4-9872-e37d8d870969';\r\n readonly AngularHomepageHelpAboutMenuItemUid = '4f88d7d3-a179-47b5-9f63-482f9179739d';\r\n readonly AngularHomepageFindPatientMenuItemUid = '6ce28061-bcfe-49bb-805a-adee7755133d';\r\n readonly AngularHomepageFindPatientAndOpenOpsMenuItemUid = '48bfaa93-0fa6-48a7-a333-25f7386f49ea';\r\n readonly AngularHomepageFindPatientAndOpenRpnMenuItemUid = 'cbf1cee8-c27c-4aa3-b245-a43077cee701';\r\n readonly AngularHomepageExternalSiteParentMenuItemUid = '49e8dff8-d6be-4038-984f-3e45e09addc1';\r\n readonly AngularHomepageDisplaySettingMenuItemUid = '8a4e6195-efe9-4dbe-8678-fffe25b6c7d5';\r\n readonly AngularHomePageSetLocalLogin = '94979B06-4F9A-4987-83EC-31C7A042FCDA';\r\n}\r\n","/**\r\n * GUID class for Typescript\r\n * Author:Tom A. Vibeto see https://gist.github.com/emptyother/1fd97db034ef848f38eca3354fa9ee90\r\n *\r\n * A Version 4 UUID \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\" is a universally unique identifier\r\n * that is generated using random numbers.\r\n */\r\nimport {GuidStrValue} from './GuidStrValue';\r\n\r\nexport class Guid {\r\n\r\n private static guidPattern = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\r\n\r\n public static replaceRegex = new RegExp('[xy]', 'g');\r\n // this regex currently doesn't allow empty guid\r\n public static validRegex = new RegExp('^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', 'i');\r\n\r\n private value: GuidStrValue = this.empty;\r\n\r\n /**\r\n * Creates instance of Guid class\r\n */\r\n public static createInstance(): Guid {\r\n return new Guid(Guid.create());\r\n }\r\n\r\n /**\r\n * Creates guid as a string\r\n */\r\n public static create(): GuidStrValue {\r\n return Guid._coerceToGuidStr(Guid.guidPattern.replace(Guid.replaceRegex, Guid.replacer));\r\n }\r\n\r\n /**\r\n * Determines whether valid is valid Guid\r\n */\r\n public static isValid(str: string): str is GuidStrValue {\r\n return Guid.validRegex.test(str);\r\n }\r\n\r\n public static empty(): GuidStrValue {\r\n return Guid._coerceToGuidStr('00000000-0000-0000-0000-000000000000');\r\n }\r\n\r\n // added this function, so we don't spread this type assertion everywhere\r\n // only call this when you know for sure the value is a guid\r\n public static _coerceToGuidStr(str: string): GuidStrValue {\r\n return str as GuidStrValue;\r\n }\r\n\r\n private static replacer(c: string): string {\r\n // tslint:disable-next-line:no-bitwise\r\n const r = Math.random() * 16 | 0;\r\n // tslint:disable-next-line:no-bitwise\r\n const v = (c === 'x') ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n }\r\n\r\n constructor(value?: string) {\r\n if (value && Guid.isValid(value)) {\r\n this.value = value;\r\n }\r\n }\r\n public get empty(): GuidStrValue {\r\n return Guid.empty();\r\n }\r\n\r\n public toString(): GuidStrValue {\r\n return this.value;\r\n }\r\n\r\n public toJSON(): GuidStrValue {\r\n return this.value;\r\n }\r\n}\r\n","// This does not necessarily correspond to the file extension of the document\r\n// but instead it refers to what type of data is in the document (because it could have been converted).\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport enum ApDocumentType {\r\n html,\r\n image,\r\n pdf,\r\n text,\r\n unknown,\r\n CCD,\r\n audio,\r\n}\r\n","import {ApDocumentType} from './ApDocumentType';\r\n\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport class ApDocumentBase {\r\n readonly isImage: boolean = false;\r\n readonly isText: boolean = false;\r\n readonly isHtml: boolean = false;\r\n readonly isPdf: boolean = false;\r\n readonly isCCD: boolean = false;\r\n readonly isAudio: boolean = false;\r\n readonly isSupported: boolean;\r\n\r\n // should reference this in html in places that need\r\n // trusted urls, like <iframe>, <object>, etc.\r\n readonly trustedData: any;\r\n\r\n constructor(\r\n readonly data: string,\r\n readonly dataIsObjectUrl: boolean,\r\n readonly documentType: ApDocumentType,\r\n readonly extension: string,\r\n readonly pageCount?: number | null,\r\n trustedData?: any,\r\n ) {\r\n if (documentType === ApDocumentType.html) {\r\n this.isHtml = true;\r\n }\r\n if (documentType === ApDocumentType.image) {\r\n this.isImage = true;\r\n }\r\n if (documentType === ApDocumentType.pdf) {\r\n this.isPdf = true;\r\n }\r\n if (documentType === ApDocumentType.text) {\r\n this.isText = true;\r\n }\r\n if (documentType === ApDocumentType.CCD) {\r\n this.isCCD = true;\r\n }\r\n if (documentType === ApDocumentType.audio) {\r\n this.isAudio = true;\r\n }\r\n this.isSupported = documentType !== ApDocumentType.unknown;\r\n\r\n this.trustedData = trustedData || data;\r\n }\r\n}\r\n","import {ApDocumentBase} from './ApDocumentBase';\r\nimport {ApDocumentType} from './ApDocumentType';\r\n\r\nimport {SafeResourceUrl} from '@angular/platform-browser';\r\n\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport class ApAudioDocument extends ApDocumentBase {\r\n constructor(\r\n dataUrl: string,\r\n // this property refers to whether this dataUrl is created using URL.createObjectURL\r\n dataIsObjectUrl: boolean,\r\n extension: string,\r\n pageCount?: number | null,\r\n readonly trustedUrl?: SafeResourceUrl,\r\n ) {\r\n super(\r\n dataUrl,\r\n dataIsObjectUrl,\r\n ApDocumentType.audio,\r\n extension,\r\n pageCount,\r\n trustedUrl,\r\n );\r\n }\r\n}\r\n","import {ApDocumentBase} from './ApDocumentBase';\r\nimport {ApDocumentType} from './ApDocumentType';\r\n\r\nimport {SafeResourceUrl} from '@angular/platform-browser';\r\n\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport class ApHtmlDocument extends ApDocumentBase {\r\n constructor(\r\n dataUrl: string,\r\n // this property refers to whether this dataUrl is created using URL.createObjectURL\r\n dataIsObjectUrl: boolean,\r\n extension: string,\r\n pageCount?: number | null,\r\n readonly trustedUrl?: SafeResourceUrl,\r\n ) {\r\n super(\r\n dataUrl,\r\n dataIsObjectUrl,\r\n ApDocumentType.html,\r\n extension,\r\n pageCount,\r\n trustedUrl,\r\n );\r\n }\r\n}\r\n","import {ApDocumentBase} from './ApDocumentBase';\r\nimport {ApDocumentType} from './ApDocumentType';\r\n\r\nimport {SafeResourceUrl} from '@angular/platform-browser';\r\n\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport class ApImageDocument extends ApDocumentBase {\r\n constructor(\r\n dataUrl: string,\r\n // this property refers to whether this dataUrl is created using URL.createObjectURL\r\n dataIsObjectUrl: boolean,\r\n extension: string,\r\n pageCount?: number | null,\r\n readonly trustedUrl?: SafeResourceUrl,\r\n ) {\r\n super(\r\n dataUrl,\r\n dataIsObjectUrl,\r\n ApDocumentType.image,\r\n extension,\r\n pageCount,\r\n trustedUrl,\r\n );\r\n }\r\n}\r\n","import {ApDocumentBase} from './ApDocumentBase';\r\nimport {ApDocumentType} from './ApDocumentType';\r\n\r\nimport {SafeResourceUrl} from '@angular/platform-browser';\r\n\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport class ApPdfDocument extends ApDocumentBase {\r\n constructor(\r\n dataUrl: string,\r\n // this property refers to whether this dataUrl is created using URL.createObjectURL\r\n dataIsObjectUrl: boolean,\r\n extension: string,\r\n pageCount?: number | null,\r\n readonly trustedUrl?: SafeResourceUrl,\r\n ) {\r\n super(\r\n dataUrl,\r\n dataIsObjectUrl,\r\n ApDocumentType.pdf,\r\n extension,\r\n pageCount,\r\n trustedUrl,\r\n );\r\n }\r\n}\r\n","import {ApDocumentBase} from './ApDocumentBase';\r\nimport {ApDocumentType} from './ApDocumentType';\r\n\r\n// This is prefixed so that it should never conflict with some built-in type.\r\nexport class ApTextDocument extends ApDocumentBase {\r\n constructor(\r\n data: string,\r\n extension: string,\r\n pageCount?: number | null,\r\n ) {\r\n super(\r\n data,\r\n false,\r\n ApDocumentType.text,\r\n extension,\r\n pageCount,\r\n );\r\n }\r\n}\r\n","import {InjectionToken} from '@angular/core';\r\nimport { STATE_HANDLER_NAMES, ViewModes } from 'webcommon/foxit';\r\n\r\n// this is necessary, to just allow this as a constructor parameter\r\nexport const FoxitLicenseDtoToken = new InjectionToken<FoxitLicenseDto>('FoxitLicenseDto');\r\n\r\nexport interface FoxitLicenseDto {\r\n LicenseSN: string;\r\n LicenseKey: string;\r\n DefaultTool: STATE_HANDLER_NAMES;\r\n DefaultViewMode: ViewModes;\r\n}\r\n","// add to this when adding more features that need to be referenced on the client side\r\n// these all come from VersionService.cs on the server\r\nexport enum ServerFeature {\r\n AllowCustomFreqAndDosageUom,\r\n Appointments_DifferentScheduleTypes,\r\n Appointments_FinancialCenter,\r\n CalendarOfficeHoursWarning,\r\n ChargeCaptureDesktopTile,\r\n ChargeCaptureSessions,\r\n ConfigurableUserLockoutTimeout,\r\n DefaultFinancialCenter,\r\n DiagnosisSummary,\r\n DosingCalculation,\r\n DrugDocumentationV2,\r\n DrugHistoryDrugs,\r\n EnhancedDrugSearch,\r\n EnhancedPharmacySearch,\r\n SendEpaRequest,\r\n ExternalPatientType,\r\n FNC,\r\n FND_Demographics,\r\n GeneralNotes,\r\n GetPatientInsurance,\r\n GroupVisitAppointment_PatientName,\r\n HandleAppointmentBlockedSlots,\r\n HeaderDetails,\r\n ImoProblem,\r\n InitUser,\r\n LockManagement,\r\n MedicationTypes,\r\n Messages_PharmacyRefill,\r\n Messages_PharmacyRefill_ERxMedication,\r\n Messages_RxRefill,\r\n NddDrugScreening,\r\n NewPatientSSN,\r\n NotesDashboardTile,\r\n PatientAttachments,\r\n PatientDiagnosisCodes,\r\n PatientDosingDetails,\r\n PatientDosingDetails_Comprehensive,\r\n PatientPortalMessageRoutingType,\r\n PatientMedicationStatus,\r\n PersonPhoto,\r\n PhoneMessageCreation,\r\n ProviderAttachments_DisplaySeparateTab,\r\n ProviderAuthorization,\r\n ProviderInsuranceExclusionWarning,\r\n Settings_KdbConfiguration,\r\n StartRefillWithoutVisit,\r\n SaveSettings,\r\n SendPriorAuthIsSpecialty,\r\n SigMetadata,\r\n SigWriter_ChronicMed,\r\n SigwriterResults,\r\n SurescriptsRFSPMBC,\r\n VisitByAppointment,\r\n VisitMedicationStatus,\r\n Visits,\r\n Visits_RX,\r\n V18_DrugScreening,\r\n}\r\n","\r\nimport {\r\n AddressDto,\r\n ConditionDto,\r\n PatientProgramDto,\r\n PharmacyDto,\r\n PhoneNumberDto,\r\n} from '../../webapi';\r\nimport {ContactPersonDto} from './ContactPersonDto';\r\n\r\nexport class PatientDemographicsDto {\r\n Address: AddressDto;\r\n Address2: AddressDto;\r\n Age: string | null;\r\n AkaFirstName: string | null;\r\n AkaLastName: string | null;\r\n Condition: ConditionDto[];\r\n Contacts: ContactPersonDto[];\r\n DateOfBirth: Date | null;\r\n DominantHand: string | null;\r\n DriversLicenseNumber: string | null;\r\n EmailAddress1: string | null;\r\n EmailAddress2: string | null;\r\n Ethnicity: string | null;\r\n ExternalId: string | null;\r\n FirstName: string;\r\n Gender: string | null;\r\n HasPortalAccount: boolean;\r\n Id: string;\r\n Language: string | null;\r\n LastName: string;\r\n MaritalStatus: string | null;\r\n MedicalRecordNumber: string | null;\r\n Notes: string | null;\r\n OriginalChartScanned: Date | null;\r\n PatientStatus: string | null;\r\n Pharmacies: PharmacyDto[];\r\n Phone1Number: string | null;\r\n Phone1Type: string | null;\r\n PhoneNumber1: PhoneNumberDto;\r\n PhoneNumber2: PhoneNumberDto;\r\n PhoneNumber3: PhoneNumberDto;\r\n PhoneNumber4: PhoneNumberDto;\r\n PrimaryCareProviderName: string | null;\r\n PrimaryInsuranceCarrier: string | null;\r\n PrimaryInsurancePlan: string | null;\r\n PrimaryProviderName: string | null;\r\n Programs: PatientProgramDto[];\r\n Race: string | null;\r\n ReferringProviderName: string | null;\r\n ReleaseSignedDate: Date | null;\r\n SocialSecurityNumber: string | null;\r\n}\r\n","import {Injectable, NgZone} from '@angular/core';\r\nimport {ApZoneAwareObject} from './ApZoneAwareObject';\r\n\r\n// This is a layer of abstraction on top of NgZone, that can provide more specific functionality for interacting with it\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class NgZoneService {\r\n static readonly ajsFactoryName = 'NgZoneService';\r\n\r\n constructor(\r\n private readonly zone: NgZone,\r\n ) {\r\n }\r\n\r\n wrapToRun<T>(fn: (...args: any[]) => T): (...args: any[]) => T {\r\n return (...innerArgs: any[]) => {\r\n return this.zone.run(() => {\r\n return fn(...innerArgs);\r\n });\r\n };\r\n }\r\n\r\n wrapToRunOutsideNg<T>(fn: (...args: any[]) => T): (...args: any[]) => T {\r\n return (...innerArgs: any[]) => {\r\n return this.zone.runOutsideAngular(() => {\r\n return fn(...innerArgs);\r\n });\r\n };\r\n }\r\n\r\n // This function does contextual zone invoking, to allow 'fn' to be invoked outside of the Ng Zone (if necessary),\r\n // while callbacks will be able to re-enter the zone properly (if necessary).\r\n //\r\n // There are 2 cases to handle:\r\n // 1. If we are currently in the Ng Zone, then 'fn' IS invoked in runOutsideAngular(),\r\n // and it will provide functions to 'fn' to be able to enter back into the Ng Zone for a callback\r\n // that happens inside of 'fn' (like a click handler).\r\n //\r\n // 2. If we are not currently in the Ng Zone, then 'fn' IS NOT invoked in runOutsideAngular(), because we are already outside.\r\n // Consequently, the functions that are then provided to 'fn'\r\n // don't try to re-enter the Ng Zone for a callback, instead they just invoke the callback normally.\r\n // This is mainly because in this case, we were not in Ng Zone to start with, so it doesn't really make sense\r\n // to enter it for a callback.\r\n contextRun<T>(fn: (zoneAwareObject: ApZoneAwareObject) => T): T {\r\n if (!NgZone.isInAngularZone()) {\r\n const zoneObj: ApZoneAwareObject = {\r\n runInZoneIfNecessary: <U>(callback: () => U) => callback(),\r\n wrapToRunInZoneIfNecessary: <U>(callback: (...args: any[]) => U) => callback,\r\n };\r\n return fn(zoneObj);\r\n }\r\n\r\n const enterZoneObj: ApZoneAwareObject = {\r\n runInZoneIfNecessary: <U>(callback: () => U) => this.run(callback),\r\n wrapToRunInZoneIfNecessary: <U>(callback: (...args: any[]) => U) => this.wrapToRun(callback),\r\n };\r\n return this.zone.runOutsideAngular(() => {\r\n return fn(enterZoneObj);\r\n });\r\n }\r\n\r\n run<T>(fn: (...args: any[]) => T): T {\r\n return this.zone.run(fn);\r\n }\r\n\r\n}\r\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor;\n\n/**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\nfunction baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n}\n\nexport default baseRepeat;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseSlice from './_baseSlice.js';\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nexport default castSlice;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nexport default baseSlice;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nexport default hasUnicode;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default baseProperty;\n","import baseProperty from './_baseProperty.js';\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nexport default asciiSize;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nexport default unicodeSize;\n","import asciiSize from './_asciiSize.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeSize from './_unicodeSize.js';\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nexport default stringSize;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n","import asciiToArray from './_asciiToArray.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeToArray from './_unicodeToArray.js';\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nexport default stringToArray;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nexport default asciiToArray;\n","import baseRepeat from './_baseRepeat.js';\nimport baseToString from './_baseToString.js';\nimport castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringSize from './_stringSize.js';\nimport stringToArray from './_stringToArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil;\n\n/**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\nfunction createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n}\n\nexport default createPadding;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import toNumber from './toNumber.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nexport default toFinite;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import createPadding from './_createPadding.js';\nimport stringSize from './_stringSize.js';\nimport toInteger from './toInteger.js';\nimport toString from './toString.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeFloor = Math.floor;\n\n/**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\nfunction pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n}\n\nexport default pad;\n","import toFinite from './toFinite.js';\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nexport default toInteger;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nexport default baseForOwn;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nexport default baseIsMatch;\n","import isObject from './isObject.js';\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nexport default isStrictComparable;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nexport default matchesStrictComparable;\n","import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nexport default baseMatches;\n","import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nexport default getMatchData;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nexport default baseHasIn;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nexport default hasPath;\n","import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nexport default baseMatchesProperty;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nexport default hasIn;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nexport default property;\n","import baseGet from './_baseGet.js';\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nexport default basePropertyDeep;\n","import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nexport default baseIteratee;\n","import baseAssignValue from './_baseAssignValue.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nexport default mapValues;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import assignValue from './_assignValue.js';\nimport copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport isArrayLike from './isArrayLike.js';\nimport isPrototype from './_isPrototype.js';\nimport keys from './keys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nexport default assign;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import baseRest from './_baseRest.js';\nimport eq from './eq.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport keysIn from './keysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n});\n\nexport default defaults;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nexport default baseEach;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nexport default baseIsNaN;\n","import baseIndexOf from './_baseIndexOf.js';\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nexport default arrayIncludes;\n","import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nexport default baseIndexOf;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nexport default strictIndexOf;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseFindIndex;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nexport default arrayIncludesWith;\n","import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport arrayMap from './_arrayMap.js';\nimport baseUnary from './_baseUnary.js';\nimport cacheHas from './_cacheHas.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseIntersection;\n","import isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nexport default castArrayLikeObject;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","import arrayMap from './_arrayMap.js';\nimport baseIntersection from './_baseIntersection.js';\nimport baseRest from './_baseRest.js';\nimport castArrayLikeObject from './_castArrayLikeObject.js';\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nexport default intersection;\n","/**\n * @private\n * @param {array} heap The heap.\n * @param {function} weightFunc The weight function.\n * @param {number} n The index of the element to bubble up.\n */\nconst bubbleUp = function (heap, weightFunc, n) {\n const element = heap[n]\n const weight = weightFunc(element)\n // When at 0, an element can not go up any further.\n while (n > 0) {\n // Compute the parent element's index, and fetch it.\n let parentN = Math.floor((n + 1) / 2) - 1\n let parent = heap[parentN]\n // If the parent has a lesser weight, things are in order and we\n // are done.\n if (weight >= weightFunc(parent)) {\n break\n } else {\n heap[parentN] = element\n heap[n] = parent\n n = parentN\n }\n }\n}\n\n/**\n * @private\n * @param {array} heap The heap.\n * @param {function} weightFunc The weight function.\n * @param {number} n The index of the element to sink down.\n */\nconst bubbleDown = function (heap, weightFunc, n) {\n var length = heap.length\n let node = heap[n]\n let nodeWeight = weightFunc(node)\n\n while (true) {\n let child2N = (n + 1) * 2\n let child1N = child2N - 1\n let swap = null\n if (child1N < length) {\n let child1 = heap[child1N]\n let child1Weight = weightFunc(child1)\n // If the score is less than our node's, we need to swap.\n if (child1Weight < nodeWeight) {\n swap = child1N\n }\n }\n // Do the same checks for the other child.\n if (child2N < length) {\n let child2 = heap[child2N]\n let child2Weight = weightFunc(child2)\n if (child2Weight < (swap === null ? nodeWeight : weightFunc(heap[child1N]))) {\n swap = child2N\n }\n }\n\n if (swap === null) {\n break\n } else {\n heap[n] = heap[swap]\n heap[swap] = node\n n = swap\n }\n }\n}\n\n/**\n * @class BinaryHeap\n * @example\n * import { BinaryHeap } from 'cachefactory';\n *\n * const queue = new BinaryHeap();\n * queue.push(2);\n * queue.push(77);\n * queue.push(8);\n * queue.push(33);\n * queue.push(5);\n * queue.pop(); // 2\n * queue.pop(); // 5\n * queue.pop(); // 8\n * queue.pop(); // 33\n * queue.pop(); // 77\n *\n * const userQueue = new BinaryHeap(\n * (user) => user.age,\n * (userOne, userTwo) => userOne.id === userTwo.id\n * );\n * queue.push({ id: 1, age: 34 });\n * queue.push({ id: 2, age: 29 });\n * queue.push({ id: 3, age: 25 });\n * queue.push({ id: 3, age: 28 });\n * queue.push({ id: 3, age: 27 });\n * queue.push({ id: 4, age: 42 });\n * queue.push({ id: 5, age: 19 });\n * queue.pop(); // { id: 5, age: 19 }\n * queue.pop(); // { id: 3, age: 27 }\n * queue.pop(); // { id: 2, age: 29 }\n * queue.pop(); // { id: 1, age: 34 }\n * queue.pop(); // { id: 4, age: 42 }\n *\n * @param {function} [weightFunc] See {@link BinaryHeap#weightFunc}.\n * @param {function} [compareFunc] See {@link BinaryHeap#compareFunc}.\n */\nexport default class BinaryHeap {\n constructor (weightFunc, compareFunc) {\n if (!weightFunc) {\n weightFunc = (x) => x\n }\n if (!compareFunc) {\n compareFunc = (x, y) => x === y\n }\n if (typeof weightFunc !== 'function') {\n throw new Error('BinaryHeap([weightFunc][, compareFunc]): \"weightFunc\" must be a function!')\n }\n if (typeof compareFunc !== 'function') {\n throw new Error('BinaryHeap([weightFunc][, compareFunc]): \"compareFunc\" must be a function!')\n }\n\n /**\n * The heap's configured weight function.\n *\n * Default:\n * ```js\n * function (x) {\n * return x;\n * }\n * ```\n *\n * @name BinaryHeap#weightFunc\n * @type {function}\n */\n this.weightFunc = weightFunc\n\n /**\n * The heap's configured compare function.\n *\n * Default:\n * ```js\n * function (x, y) {\n * return x === y;\n * }\n * ```\n *\n * @name BinaryHeap#compareFunc\n * @type {function}\n */\n this.compareFunc = compareFunc\n\n /**\n * The heap's data.\n *\n * @name BinaryHeap#heap\n * @type {Array<*>}\n */\n this.heap = []\n }\n\n /**\n * Push an item into the queue.\n *\n * @method BinaryHeap#push\n * @param {*} node\n */\n push (node) {\n this.heap.push(node)\n bubbleUp(this.heap, this.weightFunc, this.heap.length - 1)\n }\n\n /**\n * Look at the item at the front of the queue.\n *\n * @method BinaryHeap#peek\n * @returns {*}\n */\n peek () {\n return this.heap[0]\n }\n\n /**\n * Pop an item off the front of the queue.\n *\n * @method BinaryHeap#pop\n * @returns {*}\n */\n pop () {\n const front = this.heap[0]\n const end = this.heap.pop()\n if (this.heap.length > 0) {\n this.heap[0] = end\n bubbleDown(this.heap, this.weightFunc, 0)\n }\n return front\n }\n\n /**\n * Remove the given item from the queue.\n *\n * @method BinaryHeap#remove\n * @param {*} node\n */\n remove (node) {\n const length = this.heap.length\n for (let i = 0; i < length; i++) {\n if (this.compareFunc(this.heap[i], node)) {\n let removed = this.heap[i]\n let end = this.heap.pop()\n if (i !== length - 1) {\n this.heap[i] = end\n bubbleUp(this.heap, this.weightFunc, i)\n bubbleDown(this.heap, this.weightFunc, i)\n }\n return removed\n }\n }\n return null\n }\n\n /**\n * Clear the heap.\n *\n * @method BinaryHeap#removeAll\n */\n removeAll () {\n this.heap = []\n }\n\n /**\n * Return the length of the queue.\n *\n * @method BinaryHeap#size\n * @returns {number}\n */\n size () {\n return this.heap.length\n }\n}\n","export default {\n capacity: Number.MAX_VALUE,\n cacheFlushInterval: null,\n deleteOnExpire: 'none',\n enabled: true,\n onExpire: null,\n maxAge: Number.MAX_VALUE,\n recycleFreq: 1000,\n storageMode: 'memory',\n storageImpl: null,\n storagePrefix: 'cachefactory.caches.',\n storeOnReject: false,\n storeOnResolve: false\n}\n","let _Promise = null\ntry {\n _Promise = window.Promise\n} catch (e) {}\n\n/**\n * Utility methods used by CacheFactory.\n *\n * @example\n * import { utils } from 'cachefactory'\n * console.log(utils.isString('foo')) // true\n *\n * @namespace utils\n * @type {object}\n */\nconst utils = {\n /**\n * Returns whether the two values are strictly equal.\n *\n * @example\n * import { utils } from 'cachefactory'\n *\n * console.log(utils.equals(4, 4) // true\n * console.log(utils.equals(4, '4') // false\n *\n * @method utils.equals\n * @param {*} a The first value.\n * @param {*} a The second value.\n * @returns {booleal} Whether the two values are strictly equal.\n */\n equals (a, b) {\n return a === b\n },\n\n /**\n * Proxy for `JSON.parse`.\n *\n * @example\n * import { utils } from 'cachefactory'\n *\n * const a = utils.fromJson('{\"name\":\"John\"}')\n * console.log(a) // { name: 'John' }\n *\n * @method utils.fromJson\n * @param {string} json JSON to parse.\n * @returns {object} The parsed object.\n * @see utils.toJson\n */\n fromJson (value) {\n return JSON.parse(value)\n },\n\n /**\n * Returns whether the provided value is a function.\n *\n * @example\n * import { utils } from 'cachefactory'\n * const a = function (){ console.log('foo bar')}\n * const b = { foo: \"bar\" }\n * console.log(utils.isFunction(a)) // true\n * console.log(utils.isFunction(b)) // false\n *\n * @method utils.isFunction\n * @param {*} value The value to test.\n * @returns {boolean} Whether the provided value is a function.\n */\n isFunction (value) {\n return typeof value === 'function'\n },\n\n /**\n * Returns whether the provided value is a number.\n *\n * @example\n * import { utils } from 'js-data'\n * const a = 1\n * const b = -1.25\n * const c = '1'\n * console.log(utils.isNumber(a)) // true\n * console.log(utils.isNumber(b)) // true\n * console.log(utils.isNumber(c)) // false\n *\n * @method utils.isNumber\n * @param {*} value The value to test.\n * @returns {boolean} Whether the provided value is a number.\n */\n isNumber (value) {\n return typeof value === 'number'\n },\n\n /**\n * Returns whether the provided value is an object.\n *\n * @example\n * import { utils } from 'cachefactory'\n * const a = { foo: \"bar\" }\n * const b = 'foo bar'\n * console.log(utils.isObject(a)) // true\n * console.log(utils.isObject(b)) // false\n *\n * @method utils.isObject\n * @param {*} value The value to test.\n * @returns {boolean} Whether the provided value is an object.\n */\n isObject (value) {\n return value !== null && typeof value === 'object'\n },\n\n isPromise (value) {\n return value && utils.isFunction(value.then)\n },\n\n /**\n * Returns whether the provided value is a string.\n *\n * @example\n * import { utils } from 'cachefactory'\n * console.log(utils.isString('')) // true\n * console.log(utils.isString('my string')) // true\n * console.log(utils.isString(100)) // false\n * console.log(utils.isString([1,2,4])) // false\n *\n * @method utils.isString\n * @param {*} value The value to test.\n * @returns {boolean} Whether the provided value is a string.\n */\n isString (value) {\n return typeof value === 'string'\n },\n\n /**\n * Proxy for `JSON.stringify`.\n *\n * @example\n * import { utils } from 'cachefactory'\n *\n * const a = { name: 'John' }\n * console.log(utils.toJson(a)) // '{\"name\":\"John\"}'\n *\n * @method utils.toJson\n * @param {*} value Value to serialize to JSON.\n * @returns {string} JSON string.\n * @see utils.fromJson\n */\n toJson (value) {\n return JSON.stringify(value)\n },\n\n Promise: _Promise\n}\n\nexport default utils\n","import BinaryHeap from './BinaryHeap'\nimport defaults from './defaults'\nimport utils from './utils'\n\nconst assignMsg = `Cannot assign to read only property`\n\n/**\n * Provide a custom storage medium, e.g. a polyfill for `localStorage`. Default: `null`.\n *\n * Must implement:\n *\n * - `setItem` - Same API as `localStorage.setItem(key, value)`\n * - `getItem` - Same API as `localStorage.getItem(key)`\n * - `removeItem` - Same API as `localStorage.removeItem(key)`\n *\n * @name Cache~StorageImpl\n * @type {object}\n * @property {function} setItem Implementation of `setItem(key, value)`.\n * @property {function} getItem Implementation of `getItem(key)`.\n * @property {function} removeItem Implementation of `removeItem(key)`.\n */\n\n/**\n * Instances of this class represent a \"cache\"—a synchronous key-value store.\n * Each instance holds the settings for the cache, and provides methods for\n * manipulating the cache and its data.\n *\n * Generally you don't creates instances of `Cache` directly, but instead create\n * instances of `Cache` via {@link CacheFactory#createCache}.\n *\n * @example\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const options = {...};\n * const cache = cacheFactory.createCache('my-cache', options);\n *\n * cache.put('foo', 'bar');\n * console.log(cache.get('foo')); // \"bar\"\n *\n * @class Cache\n * @param {string} id A unique identifier for the cache.\n * @param {object} [options] Configuration options.\n * @param {number} [options.cacheFlushInterval=null] See {@link Cache#cacheFlushInterval}.\n * @param {number} [options.capacity=Number.MAX_VALUE] See {@link Cache#capacity}.\n * @param {string} [options.deleteOnExpire=\"none\"] See {@link Cache#deleteOnExpire}.\n * @param {boolean} [options.enabled=true] See {@link Cache#enabled}.\n * @param {number} [options.maxAge=Number.MAX_VALUE] See {@link Cache#maxAge}.\n * @param {function} [options.onExpire=null] See {@link Cache#onExpire}.\n * @param {number} [options.recycleFreq=1000] See {@link Cache#recycleFreq}.\n * @param {Cache~StorageImpl} [options.storageImpl=null] See {@link Cache~StorageImpl}.\n * @param {string} [options.storageMode=\"memory\"] See {@link Cache#storageMode}.\n * @param {string} [options.storagePrefix=\"cachefactory.caches.\"] See {@link Cache#storagePrefix}.\n * @param {boolean} [options.storeOnReject=false] See {@link Cache#storeOnReject}.\n * @param {boolean} [options.storeOnResolve=false] See {@link Cache#storeOnResolve}.\n */\nexport default class Cache {\n constructor (id, options = {}) {\n if (!utils.isString(id)) {\n throw new TypeError(`\"id\" must be a string!`)\n }\n\n Object.defineProperties(this, {\n // Writable\n $$cacheFlushInterval: { writable: true, value: undefined },\n $$cacheFlushIntervalId: { writable: true, value: undefined },\n $$capacity: { writable: true, value: undefined },\n $$data: { writable: true, value: {} },\n $$deleteOnExpire: { writable: true, value: undefined },\n $$enabled: { writable: true, value: undefined },\n $$expiresHeap: { writable: true, value: new BinaryHeap((x) => x.accessed, utils.equals) },\n $$initializing: { writable: true, value: true },\n $$lruHeap: { writable: true, value: new BinaryHeap((x) => x.accessed, utils.equals) },\n $$maxAge: { writable: true, value: undefined },\n $$onExpire: { writable: true, value: undefined },\n $$prefix: { writable: true, value: '' },\n $$promises: { writable: true, value: {} },\n $$recycleFreq: { writable: true, value: undefined },\n $$recycleFreqId: { writable: true, value: undefined },\n $$storage: { writable: true, value: undefined },\n $$storageMode: { writable: true, value: undefined },\n $$storagePrefix: { writable: true, value: undefined },\n $$storeOnReject: { writable: true, value: undefined },\n $$storeOnResolve: { writable: true, value: undefined },\n\n // Read-only\n $$parent: { value: options.parent },\n\n /**\n * The interval (in milliseconds) on which the cache should remove all of\n * its items. Setting this to `null` disables the interval. The default is\n * `null`.\n *\n * @example <caption>Create a cache the clears itself every 15 minutes</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * cacheFlushInterval: 15 * 60 * 1000\n * });\n *\n * @name Cache#cacheFlushInterval\n * @default null\n * @public\n * @readonly\n * @type {number|null}\n */\n cacheFlushInterval: {\n enumerable: true,\n get: () => this.$$cacheFlushInterval,\n set: () => { throw new Error(`${assignMsg} 'cacheFlushInterval'`) }\n },\n\n /**\n * The maximum number of items that can be stored in the cache. When the\n * capacity is exceeded the least recently accessed item will be removed.\n * The default is `Number.MAX_VALUE`.\n *\n * @example <caption>Create a cache with a capacity of 100</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * capacity: 100\n * });\n *\n * @name Cache#capacity\n * @default Number.MAX_VALUE\n * @public\n * @readonly\n * @type {number}\n */\n capacity: {\n enumerable: true,\n get: () => this.$$capacity,\n set: () => { throw new Error(`${assignMsg} 'capacity'`) }\n },\n\n /**\n * Determines the behavior of a cache when an item expires. The default is\n * `\"none\"`.\n *\n * Possible values:\n *\n * - `\"none\"` - Cache will do nothing when an item expires.\n * - `\"passive\"` - Cache will do nothing when an item expires. Expired\n * items will remain in the cache until requested, at which point they are\n * removed, and `undefined` is returned.\n * - `\"aggressive\"` - Cache will remove expired items as soon as they are\n * discovered.\n *\n * @example <caption>Create a cache that deletes items as soon as they expire</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * deleteOnExpire: 'aggressive'\n * });\n *\n * @example <caption>Create a cache that doesn't delete expired items until they're accessed</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * deleteOnExpire: 'passive'\n * });\n *\n * @name Cache#deleteOnExpire\n * @default \"none\"\n * @public\n * @readonly\n * @type {string}\n */\n deleteOnExpire: {\n enumerable: true,\n get: () => this.$$deleteOnExpire,\n set: () => { throw new Error(`${assignMsg} 'deleteOnExpire'`) }\n },\n\n /**\n * Marks whether the cache is enabled or not. For a disabled cache,\n * {@link Cache#put} is a no-op. The default is `true`.\n *\n * @example <caption>Create a cache that starts out disabled</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * enabled: false\n * });\n *\n * // The cache is disabled, this is a no-op\n * cache.put('foo', 'bar');\n * console.log(cache.get('foo')); // undefined\n *\n * @name Cache#enabled\n * @default true\n * @public\n * @readonly\n * @type {boolean}\n */\n enabled: {\n enumerable: true,\n get: () => this.$$enabled,\n set: () => { throw new Error(`${assignMsg} 'enabled'`) }\n },\n\n /**\n * Then unique identifier given to this cache when it was created.\n *\n * @name Cache#id\n * @public\n * @readonly\n * @type {string}\n */\n id: {\n enumerable: true,\n value: id\n },\n\n /**\n * Represents how long an item can be in the cache before expires. The\n * cache's behavior toward expired items is determined by\n * {@link Cache#deleteOnExpire}. The default value for `maxAge` is\n * `Number.MAX_VALUE`.\n *\n * @example <caption>Create a cache where items expire after 15 minutes</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * // Items expire after 15 minutes\n * maxAge: 15 * 60 * 1000\n * });\n * const cache2 = cacheFactory.createCache('my-cache2', {\n * // Items expire after 15 minutes\n * maxAge: 15 * 60 * 1000,\n * // Expired items will only be deleted once they are accessed\n * deleteOnExpire: 'passive'\n * });\n * const cache3 = cacheFactory.createCache('my-cache3', {\n * // Items expire after 15 minutes\n * maxAge: 15 * 60 * 1000,\n * // Items will be deleted from the cache as soon as they expire\n * deleteOnExpire: 'aggressive'\n * });\n *\n * @name Cache#maxAge\n * @default Number.MAX_VALUE\n * @public\n * @readonly\n * @type {number}\n */\n maxAge: {\n enumerable: true,\n get: () => this.$$maxAge,\n set: () => { throw new Error(`${assignMsg} 'maxAge'`) }\n },\n\n /**\n * The `onExpire` callback.\n *\n * @callback Cache~onExpireCallback\n * @param {string} key The key of the expired item.\n * @param {*} value The value of the expired item.\n * @param {function} [done] If in `\"passive\"` mode and you pass an\n * `onExpire` callback to {@link Cache#get}, then the `onExpire` callback\n * you passed to {@link Cache#get} will be passed to your global\n * `onExpire` callback.\n */\n\n /**\n * A callback to be executed when expired items are removed from the\n * cache when the cache is in `\"passive\"` or `\"aggressive\"` mode. The\n * default is `null`. See {@link Cache~onExpireCallback} for the signature\n * of the `onExpire` callback.\n *\n * @example <caption>Create a cache where items expire after 15 minutes</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * // Items expire after 15 minutes\n * maxAge: 15 * 60 * 1000,\n * // Expired items will only be deleted once they are accessed\n * deleteOnExpire: 'passive',\n * // Try to rehydrate cached items as they expire\n * onExpire: function (key, value, done) {\n * // Do something with key and value\n *\n * // Will received \"done\" callback if in \"passive\" mode and passing\n * // an onExpire option to Cache#get.\n * if (done) {\n * done(); // You can pass whatever you want to done\n * }\n * }\n * });\n *\n * @name Cache#onExpire\n * @default null\n * @public\n * @readonly\n * @see Cache~onExpireCallback\n * @type {function}\n */\n onExpire: {\n enumerable: true,\n get: () => this.$$onExpire,\n set: () => { throw new Error(`${assignMsg} 'onExpire'`) }\n },\n\n /**\n * The frequency (in milliseconds) with which the cache should check for\n * expired items. The default is `1000`. The value of this interval only\n * matters if {@link Cache#deleteOnExpire} is set to `\"aggressive\"`.\n *\n * @example <caption>Create a cache where items expire after 15 minutes checking every 10 seconds</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * // Items expire after 15 minutes\n * maxAge: 15 * 60 * 1000,\n * // Items will be deleted from the cache as soon as they expire\n * deleteOnExpire: 'aggressive',\n * // Check for expired items every 10 seconds\n * recycleFreq: 10 * 1000\n * });\n *\n * @name Cache#recycleFreq\n * @default 1000\n * @public\n * @readonly\n * @type {number|null}\n */\n recycleFreq: {\n enumerable: true,\n get: () => this.$$recycleFreq,\n set: () => { throw new Error(`${assignMsg} 'recycleFreq'`) }\n },\n\n /**\n * Determines the storage medium used by the cache. The default is\n * `\"memory\"`.\n *\n * Possible values:\n *\n * - `\"memory\"`\n * - `\"localStorage\"`\n * - `\"sessionStorage\"`\n *\n * @example <caption>Create a cache that stores its data in localStorage</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * storageMode: 'localStorage'\n * });\n *\n * @example <caption>Provide a custom storage implementation</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * storageMode: 'localStorage',\n * storageImpl: {\n * setItem: function (key, value) {\n * console.log('setItem', key, value);\n * localStorage.setItem(key, value);\n * },\n * getItem: function (key) {\n * console.log('getItem', key);\n * localStorage.getItem(key);\n * },\n * removeItem: function (key) {\n * console.log('removeItem', key);\n * localStorage.removeItem(key);\n * }\n * }\n * });\n *\n * @name Cache#storageMode\n * @default \"memory\"\n * @public\n * @readonly\n * @type {string}\n */\n storageMode: {\n enumerable: true,\n get: () => this.$$storageMode,\n set: () => { throw new Error(`${assignMsg} 'storageMode'`) }\n },\n\n /**\n * The prefix used to namespace the keys for items stored in\n * `localStorage` or `sessionStorage`. The default is\n * `\"cachefactory.caches.\"` which is conservatively long in order any\n * possible conflict with other data in storage. Set to a shorter value\n * to save storage space.\n *\n * @example\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * storageMode: 'localStorage',\n * // Completely remove the prefix to save the most space\n * storagePrefix: ''\n * });\n * cache.put('foo', 'bar');\n * console.log(localStorage.get('my-cache.data.foo')); // \"bar\"\n *\n * @name Cache#storagePrefix\n * @default \"cachefactory.caches.\"\n * @public\n * @readonly\n * @type {string}\n */\n storagePrefix: {\n enumerable: true,\n get: () => this.$$storagePrefix,\n set: () => { throw new Error(`${assignMsg} 'storagePrefix'`) }\n },\n\n /**\n * If set to `true`, when a promise is inserted into the cache and is then\n * rejected, then the rejection value will overwrite the promise in the\n * cache. The default is `false`.\n *\n * @name Cache#storeOnReject\n * @default false\n * @public\n * @readonly\n * @type {boolean}\n */\n storeOnReject: {\n enumerable: true,\n get: () => this.$$storeOnReject,\n set: () => { throw new Error(`${assignMsg} 'storeOnReject'`) }\n },\n\n /**\n * If set to `true`, when a promise is inserted into the cache and is then\n * resolved, then the resolution value will overwrite the promise in the\n * cache. The default is `false`.\n *\n * @name Cache#storeOnResolve\n * @default false\n * @public\n * @readonly\n * @type {boolean}\n */\n storeOnResolve: {\n enumerable: true,\n get: () => this.$$storeOnResolve,\n set: () => { throw new Error(`${assignMsg} 'storeOnResolve'`) }\n }\n })\n\n this.setOptions(options, true)\n this.$$initializing = false\n }\n\n /**\n * Destroys this cache and all its data and renders it unusable.\n *\n * @example\n * cache.destroy();\n *\n * @method Cache#destroy\n */\n destroy () {\n clearInterval(this.$$cacheFlushIntervalId)\n clearInterval(this.$$recycleFreqId)\n this.removeAll()\n if (this.$$storage) {\n this.$$storage().removeItem(`${this.$$prefix}.keys`)\n this.$$storage().removeItem(this.$$prefix)\n }\n this.$$storage = null\n this.$$data = null\n this.$$lruHeap = null\n this.$$expiresHeap = null\n this.$$prefix = null\n if (this.$$parent) {\n this.$$parent.caches[this.id] = undefined\n }\n }\n\n /**\n * Disables this cache. For a disabled cache, {@link Cache#put} is a no-op.\n *\n * @example\n * cache.disable();\n *\n * @method Cache#disable\n */\n disable () {\n this.$$enabled = false\n }\n\n /**\n * Enables this cache. For a disabled cache, {@link Cache#put} is a no-op.\n *\n * @example\n * cache.enable();\n *\n * @method Cache#enable\n */\n enable () {\n this.$$enabled = true\n }\n\n /**\n * Retrieve an item from the cache, it it exists.\n *\n * @example <caption>Retrieve an item from the cache</caption>\n * cache.put('foo', 'bar');\n * cache.get('foo'); // \"bar\"\n *\n * @example <caption>Retrieve a possibly expired item while in passive mode</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * deleteOnExpire: 'passive',\n * maxAge: 15 * 60 * 1000\n * });\n * cache.get('foo', {\n * // Called if \"foo\" is expired\n * onExpire: function (key, value) {\n * // Do something with key and value\n * }\n * });\n *\n * @example <caption>Retrieve a possibly expired item while in passive mode with global onExpire callback</caption>\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache', {\n * deleteOnExpire: 'passive',\n * maxAge: 15 * 60 * 1000\n * onExpire: function (key, value, done) {\n * console.log('Expired item:', key);\n * if (done) {\n * done('foo', key, value);\n * }\n * }\n * });\n * cache.get('foo', {\n * // Called if \"foo\" is expired\n * onExpire: function (msg, key, value) {\n * console.log(msg); // \"foo\"\n * // Do something with key and value\n * }\n * });\n *\n * @method Cache#get\n * @param {string|string[]} key The key of the item to retrieve.\n * @param {object} [options] Configuration options.\n * @param {function} [options.onExpire] TODO\n * @returns {*} The value for the specified `key`, if any.\n */\n get (key, options = {}) {\n if (Array.isArray(key)) {\n const keys = key\n const values = []\n\n keys.forEach((key) => {\n const value = this.get(key, options)\n if (value !== null && value !== undefined) {\n values.push(value)\n }\n })\n\n return values\n } else {\n if (utils.isNumber(key)) {\n key = '' + key\n }\n\n if (!this.enabled) {\n return\n }\n }\n\n if (!utils.isString(key)) {\n throw new TypeError(`\"key\" must be a string!`)\n } else if (!options || !utils.isObject(options)) {\n throw new TypeError(`\"options\" must be an object!`)\n } else if (options.onExpire && !utils.isFunction(options.onExpire)) {\n throw new TypeError(`\"options.onExpire\" must be a function!`)\n }\n\n let item\n\n if (this.$$storage) {\n if (this.$$promises[key]) {\n return this.$$promises[key]\n }\n\n const itemJson = this.$$storage().getItem(`${this.$$prefix}.data.${key}`)\n\n if (itemJson) {\n item = utils.fromJson(itemJson)\n }\n } else if (utils.isObject(this.$$data)) {\n item = this.$$data[key]\n }\n\n if (!item) {\n return\n }\n\n let value = item.value\n let now = new Date().getTime()\n\n if (this.$$storage) {\n this.$$lruHeap.remove({\n key: key,\n accessed: item.accessed\n })\n item.accessed = now\n this.$$lruHeap.push({\n key: key,\n accessed: now\n })\n } else {\n this.$$lruHeap.remove(item)\n item.accessed = now\n this.$$lruHeap.push(item)\n }\n\n if (this.$$deleteOnExpire === 'passive' && 'expires' in item && item.expires < now) {\n this.remove(key)\n\n if (this.$$onExpire) {\n this.$$onExpire(key, item.value, options.onExpire)\n } else if (options.onExpire) {\n options.onExpire.call(this, key, item.value)\n }\n value = undefined\n } else if (this.$$storage) {\n this.$$storage().setItem(`${this.$$prefix}.data.${key}`, utils.toJson(item))\n }\n\n return value\n }\n\n /**\n * Retrieve information about the whole cache or about a particular item in\n * the cache.\n *\n * @example <caption>Retrieve info about the cache</caption>\n * const info = cache.info();\n * info.id; // \"my-cache\"\n * info.capacity; // 100\n * info.maxAge; // 600000\n * info.deleteOnExpire; // \"aggressive\"\n * info.cacheFlushInterval; // null\n * info.recycleFreq; // 10000\n * info.storageMode; // \"localStorage\"\n * info.enabled; // false\n * info.size; // 1234\n *\n * @example <caption>Retrieve info about an item in the cache</caption>\n * const info = cache.info('foo');\n * info.created; // 1234567890\n * info.accessed; // 1234567990\n * info.expires; // 1234569999\n * info.isExpired; // false\n *\n * @method Cache#info\n * @param {string} [key] If specified, retrieve info for a particular item in\n * the cache.\n * @returns {*} The information object.\n */\n info (key) {\n if (key) {\n let item\n if (this.$$storage) {\n const itemJson = this.$$storage().getItem(`${this.$$prefix}.data.${key}`)\n if (itemJson) {\n item = utils.fromJson(itemJson)\n }\n } else if (utils.isObject(this.$$data)) {\n item = this.$$data[key]\n }\n if (item) {\n return {\n created: item.created,\n accessed: item.accessed,\n expires: item.expires,\n isExpired: (new Date().getTime() - item.created) > (item.maxAge || this.$$maxAge)\n }\n }\n } else {\n return {\n id: this.id,\n capacity: this.capacity,\n maxAge: this.maxAge,\n deleteOnExpire: this.deleteOnExpire,\n onExpire: this.onExpire,\n cacheFlushInterval: this.cacheFlushInterval,\n recycleFreq: this.recycleFreq,\n storageMode: this.storageMode,\n storageImpl: this.$$storage ? this.$$storage() : undefined,\n enabled: this.enabled,\n size: this.$$lruHeap && this.$$lruHeap.size() || 0\n }\n }\n }\n\n /**\n * Retrieve a list of the keys of items currently in the cache.\n *\n * @example\n * const keys = cache.keys();\n *\n * @method Cache#keys\n * @returns {string[]} The keys of the items in the cache\n */\n keys () {\n if (this.$$storage) {\n const keysJson = this.$$storage().getItem(`${this.$$prefix}.keys`)\n\n if (keysJson) {\n return utils.fromJson(keysJson)\n } else {\n return []\n }\n } else {\n return Object.keys(this.$$data).filter((key) => this.$$data[key])\n }\n }\n\n /**\n * Retrieve an object of the keys of items currently in the cache.\n *\n * @example\n * const keySet = cache.keySet();\n *\n * @method Cache#keySet\n * @returns {object} The keys of the items in the cache.\n */\n keySet () {\n const set = {}\n this.keys().forEach((key) => {\n set[key] = key\n })\n return set\n }\n\n /**\n * Insert an item into the cache.\n *\n * @example\n * const inserted = cache.put('foo', 'bar');\n *\n * @method Cache#put\n * @param {string} key The key under which to insert the item.\n * @param {*} value The value to insert.\n * @param {object} [options] Configuration options.\n * @param {boolean} [options.storeOnReject] See {@link Cache#storeOnReject}.\n * @param {boolean} [options.storeOnResolve] See {@link Cache#storeOnResolve}.\n * @returns {*} The inserted value.\n */\n put (key, value, options = {}) {\n const storeOnResolve = options.storeOnResolve !== undefined ? !!options.storeOnResolve : this.$$storeOnResolve\n const storeOnReject = options.storeOnReject !== undefined ? !!options.storeOnReject : this.$$storeOnReject\n\n const getHandler = (shouldStore, isError) => {\n return (v) => {\n if (shouldStore) {\n this.$$promises[key] = undefined\n if (utils.isObject(v) && 'status' in v && 'data' in v) {\n v = [v.status, v.data, v.headers(), v.statusText]\n this.put(key, v)\n } else {\n this.put(key, v)\n }\n }\n if (isError) {\n if (utils.Promise) {\n return utils.Promise.reject(v)\n } else {\n throw v\n }\n } else {\n return v\n }\n }\n }\n\n if (!this.$$enabled || !utils.isObject(this.$$data) || value === null || value === undefined) {\n return\n }\n if (utils.isNumber(key)) {\n key = '' + key\n }\n\n if (!utils.isString(key)) {\n throw new TypeError(`\"key\" must be a string!`)\n }\n\n const now = new Date().getTime()\n const item = {\n key: key,\n value: utils.isPromise(value) ? value.then(getHandler(storeOnResolve, false), getHandler(storeOnReject, true)) : value,\n created: options.created === undefined ? now : options.created,\n accessed: options.accessed === undefined ? now : options.accessed\n }\n if (utils.isNumber(options.maxAge)) {\n item.maxAge = options.maxAge\n }\n\n if (options.expires === undefined) {\n item.expires = item.created + (item.maxAge || this.$$maxAge)\n } else {\n item.expires = options.expires\n }\n\n if (this.$$storage) {\n if (utils.isPromise(item.value)) {\n this.$$promises[key] = item.value\n return this.$$promises[key]\n }\n const keysJson = this.$$storage().getItem(`${this.$$prefix}.keys`)\n const keys = keysJson ? utils.fromJson(keysJson) : []\n const itemJson = this.$$storage().getItem(`${this.$$prefix}.data.${key}`)\n\n // Remove existing\n if (itemJson) {\n this.remove(key)\n }\n // Add to expires heap\n this.$$expiresHeap.push({\n key: key,\n expires: item.expires\n })\n // Add to lru heap\n this.$$lruHeap.push({\n key: key,\n accessed: item.accessed\n })\n // Set item\n this.$$storage().setItem(`${this.$$prefix}.data.${key}`, utils.toJson(item))\n let exists = false\n keys.forEach((_key) => {\n if (_key === key) {\n exists = true\n return false\n }\n })\n if (!exists) {\n keys.push(key)\n }\n this.$$storage().setItem(`${this.$$prefix}.keys`, utils.toJson(keys))\n } else {\n // Remove existing\n if (this.$$data[key]) {\n this.remove(key)\n }\n // Add to expires heap\n this.$$expiresHeap.push(item)\n // Add to lru heap\n this.$$lruHeap.push(item)\n // Set item\n this.$$data[key] = item\n this.$$promises[key] = undefined\n }\n\n // Handle exceeded capacity\n if (this.$$lruHeap.size() > this.$$capacity) {\n this.remove(this.$$lruHeap.peek().key)\n }\n\n return value\n }\n\n /**\n * Remove an item from the cache.\n *\n * @example\n * const removed = cache.remove('foo');\n *\n * @method Cache#remove\n * @param {string} key The key of the item to remove.\n * @returns {*} The value of the removed item, if any.\n */\n remove (key) {\n if (utils.isNumber(key)) {\n key = '' + key\n }\n this.$$promises[key] = undefined\n if (this.$$storage) {\n const itemJson = this.$$storage().getItem(`${this.$$prefix}.data.${key}`)\n\n if (itemJson) {\n let item = utils.fromJson(itemJson)\n this.$$lruHeap.remove({\n key: key,\n accessed: item.accessed\n })\n this.$$expiresHeap.remove({\n key: key,\n expires: item.expires\n })\n this.$$storage().removeItem(`${this.$$prefix}.data.${key}`)\n let keysJson = this.$$storage().getItem(`${this.$$prefix}.keys`)\n let keys = keysJson ? utils.fromJson(keysJson) : []\n let index = keys.indexOf(key)\n\n if (index >= 0) {\n keys.splice(index, 1)\n }\n this.$$storage().setItem(`${this.$$prefix}.keys`, utils.toJson(keys))\n return item.value\n }\n } else if (utils.isObject(this.$$data)) {\n let value = this.$$data[key] ? this.$$data[key].value : undefined\n this.$$lruHeap.remove(this.$$data[key])\n this.$$expiresHeap.remove(this.$$data[key])\n this.$$data[key] = undefined\n return value\n }\n }\n\n /**\n * Remove all items from the cache.\n *\n * @example\n * cache.removeAll();\n *\n * @method Cache#removeAll\n */\n removeAll () {\n const storage = this.$$storage\n const keys = this.keys()\n this.$$lruHeap.removeAll()\n this.$$expiresHeap.removeAll()\n\n if (storage) {\n storage().setItem(`${this.$$prefix}.keys`, utils.toJson([]))\n keys.forEach((key) => {\n storage().removeItem(`${this.$$prefix}.data.${key}`)\n })\n } else if (utils.isObject(this.$$data)) {\n this.$$data = {}\n }\n this.$$promises = {}\n }\n\n /**\n * Remove expired items from the cache, if any.\n *\n * @example\n * const expiredItems = cache.removeExpired();\n *\n * @method Cache#removeExpired\n * @returns {object} The expired items, if any.\n */\n removeExpired () {\n const now = new Date().getTime()\n const expired = {}\n let expiredItem\n\n while ((expiredItem = this.$$expiresHeap.peek()) && expiredItem.expires <= now) {\n expired[expiredItem.key] = expiredItem.value ? expiredItem.value : null\n this.$$expiresHeap.pop()\n }\n\n Object.keys(expired).forEach((key) => {\n this.remove(key)\n })\n\n if (this.$$onExpire) {\n Object.keys(expired).forEach((key) => {\n this.$$onExpire(key, expired[key])\n })\n }\n\n return expired\n }\n\n /**\n * Update the {@link Cache#cacheFlushInterval} for the cache. Pass in `null`\n * to disable the interval.\n *\n * @example\n * cache.setCacheFlushInterval(60 * 60 * 1000);\n *\n * @method Cache#setCacheFlushInterval\n * @param {number|null} cacheFlushInterval The new {@link Cache#cacheFlushInterval}.\n */\n setCacheFlushInterval (cacheFlushInterval) {\n if (cacheFlushInterval === null) {\n this.$$cacheFlushInterval = null\n } else if (!utils.isNumber(cacheFlushInterval)) {\n throw new TypeError(`\"cacheFlushInterval\" must be a number!`)\n } else if (cacheFlushInterval <= 0) {\n throw new Error(`\"cacheFlushInterval\" must be greater than zero!`)\n }\n this.$$cacheFlushInterval = cacheFlushInterval\n clearInterval(this.$$cacheFlushIntervalId)\n this.$$cacheFlushIntervalId = undefined\n if (this.$$cacheFlushInterval) {\n this.$$cacheFlushIntervalId = setInterval(() => this.removeAll(), this.$$cacheFlushInterval)\n }\n }\n\n /**\n * Update the {@link Cache#capacity} for the cache. Pass in `null` to reset\n * to `Number.MAX_VALUE`.\n *\n * @example\n * cache.setCapacity(1000);\n *\n * @method Cache#setCapacity\n * @param {number|null} capacity The new {@link Cache#capacity}.\n */\n setCapacity (capacity) {\n if (capacity === null) {\n this.$$capacity = Number.MAX_VALUE\n } else if (!utils.isNumber(capacity)) {\n throw new TypeError(`\"capacity\" must be a number!`)\n } else if (capacity <= 0) {\n throw new Error(`\"capacity\" must be greater than zero!`)\n } else {\n this.$$capacity = capacity\n }\n const removed = {}\n while (this.$$lruHeap.size() > this.$$capacity) {\n removed[this.$$lruHeap.peek().key] = this.remove(this.$$lruHeap.peek().key)\n }\n return removed\n }\n\n /**\n * Update the {@link Cache#deleteOnExpire} for the cache. Pass in `null` to\n * reset to `\"none\"`.\n *\n * @example\n * cache.setDeleteOnExpire('passive');\n *\n * @method Cache#setDeleteOnExpire\n * @param {string|null} deleteOnExpire The new {@link Cache#deleteOnExpire}.\n */\n setDeleteOnExpire (deleteOnExpire, setRecycleFreq) {\n if (deleteOnExpire === null) {\n deleteOnExpire = 'none'\n } else if (!utils.isString(deleteOnExpire)) {\n throw new TypeError(`\"deleteOnExpire\" must be a string!`)\n } else if (deleteOnExpire !== 'none' && deleteOnExpire !== 'passive' && deleteOnExpire !== 'aggressive') {\n throw new Error(`\"deleteOnExpire\" must be \"none\", \"passive\" or \"aggressive\"!`)\n }\n this.$$deleteOnExpire = deleteOnExpire\n if (setRecycleFreq !== false) {\n this.setRecycleFreq(this.$$recycleFreq)\n }\n }\n\n /**\n * Update the {@link Cache#maxAge} for the cache. Pass in `null` to reset to\n * to `Number.MAX_VALUE`.\n *\n * @example\n * cache.setMaxAge(60 * 60 * 1000);\n *\n * @method Cache#setMaxAge\n * @param {number|null} maxAge The new {@link Cache#maxAge}.\n */\n setMaxAge (maxAge) {\n if (maxAge === null) {\n this.$$maxAge = Number.MAX_VALUE\n } else if (!utils.isNumber(maxAge)) {\n throw new TypeError(`\"maxAge\" must be a number!`)\n } else if (maxAge <= 0) {\n throw new Error(`\"maxAge\" must be greater than zero!`)\n } else {\n this.$$maxAge = maxAge\n }\n const keys = this.keys()\n\n this.$$expiresHeap.removeAll()\n\n if (this.$$storage) {\n keys.forEach((key) => {\n const itemJson = this.$$storage().getItem(`${this.$$prefix}.data.${key}`)\n if (itemJson) {\n const item = utils.fromJson(itemJson)\n if (this.$$maxAge === Number.MAX_VALUE) {\n item.expires = Number.MAX_VALUE\n } else {\n item.expires = item.created + (item.maxAge || this.$$maxAge)\n }\n this.$$expiresHeap.push({\n key: key,\n expires: item.expires\n })\n }\n })\n } else {\n keys.forEach((key) => {\n const item = this.$$data[key]\n if (item) {\n if (this.$$maxAge === Number.MAX_VALUE) {\n item.expires = Number.MAX_VALUE\n } else {\n item.expires = item.created + (item.maxAge || this.$$maxAge)\n }\n this.$$expiresHeap.push(item)\n }\n })\n }\n\n if (this.$$deleteOnExpire === 'aggressive') {\n return this.removeExpired()\n } else {\n return {}\n }\n }\n\n /**\n * Update the {@link Cache#onExpire} for the cache. Pass in `null` to unset\n * the global `onExpire` callback of the cache.\n *\n * @example\n * cache.setOnExpire(function (key, value, done) {\n * // Do something\n * });\n *\n * @method Cache#setOnExpire\n * @param {function|null} onExpire The new {@link Cache#onExpire}.\n */\n setOnExpire (onExpire) {\n if (onExpire === null) {\n this.$$onExpire = null\n } else if (!utils.isFunction(onExpire)) {\n throw new TypeError(`\"onExpire\" must be a function!`)\n } else {\n this.$$onExpire = onExpire\n }\n }\n\n /**\n * Update multiple cache options at a time.\n *\n * @example\n * cache.setOptions({\n * maxAge: 60 * 60 * 1000,\n * deleteOnExpire: 'aggressive'\n * });\n *\n * @example <caption>Set two options, and reset the rest to the configured defaults</caption>\n * cache.setOptions({\n * maxAge: 60 * 60 * 1000,\n * deleteOnExpire: 'aggressive'\n * }, true);\n *\n * @method Cache#setOptions\n * @param {object} options The options to set.\n * @param {boolean} [strict] Reset options not passed to `options` to the\n * configured defaults.\n */\n setOptions (options = {}, strict = false) {\n if (!utils.isObject(options)) {\n throw new TypeError(`\"options\" must be an object!`)\n }\n\n if (options.storagePrefix !== undefined) {\n this.$$storagePrefix = options.storagePrefix\n } else if (strict) {\n this.$$storagePrefix = defaults.storagePrefix\n }\n\n this.$$prefix = this.$$storagePrefix + this.id\n\n if (options.enabled !== undefined) {\n this.$$enabled = !!options.enabled\n } else if (strict) {\n this.$$enabled = defaults.enabled\n }\n\n if (options.deleteOnExpire !== undefined) {\n this.setDeleteOnExpire(options.deleteOnExpire, false)\n } else if (strict) {\n this.setDeleteOnExpire(defaults.deleteOnExpire, false)\n }\n\n if (options.recycleFreq !== undefined) {\n this.setRecycleFreq(options.recycleFreq)\n } else if (strict) {\n this.setRecycleFreq(defaults.recycleFreq)\n }\n\n if (options.maxAge !== undefined) {\n this.setMaxAge(options.maxAge)\n } else if (strict) {\n this.setMaxAge(defaults.maxAge)\n }\n\n if (options.storeOnResolve !== undefined) {\n this.$$storeOnResolve = !!options.storeOnResolve\n } else if (strict) {\n this.$$storeOnResolve = defaults.storeOnResolve\n }\n\n if (options.storeOnReject !== undefined) {\n this.$$storeOnReject = !!options.storeOnReject\n } else if (strict) {\n this.$$storeOnReject = defaults.storeOnReject\n }\n\n if (options.capacity !== undefined) {\n this.setCapacity(options.capacity)\n } else if (strict) {\n this.setCapacity(defaults.capacity)\n }\n\n if (options.cacheFlushInterval !== undefined) {\n this.setCacheFlushInterval(options.cacheFlushInterval)\n } else if (strict) {\n this.setCacheFlushInterval(defaults.cacheFlushInterval)\n }\n\n if (options.onExpire !== undefined) {\n this.setOnExpire(options.onExpire)\n } else if (strict) {\n this.setOnExpire(defaults.onExpire)\n }\n\n if (options.storageMode !== undefined || options.storageImpl !== undefined) {\n this.setStorageMode(options.storageMode || defaults.storageMode, options.storageImpl || defaults.storageImpl)\n } else if (strict) {\n this.setStorageMode(defaults.storageMode, defaults.storageImpl)\n }\n }\n\n /**\n * Update the {@link Cache#recycleFreq} for the cache. Pass in `null` to\n * disable the interval.\n *\n * @example\n * cache.setRecycleFreq(10000);\n *\n * @method Cache#setRecycleFreq\n * @param {number|null} recycleFreq The new {@link Cache#recycleFreq}.\n */\n setRecycleFreq (recycleFreq) {\n if (recycleFreq === null) {\n this.$$recycleFreq = null\n } else if (!utils.isNumber(recycleFreq)) {\n throw new TypeError(`\"recycleFreq\" must be a number!`)\n } else if (recycleFreq <= 0) {\n throw new Error(`\"recycleFreq\" must be greater than zero!`)\n } else {\n this.$$recycleFreq = recycleFreq\n }\n clearInterval(this.$$recycleFreqId)\n if (this.$$deleteOnExpire === 'aggressive' && this.$$recycleFreq) {\n this.$$recycleFreqId = setInterval(() => this.removeExpired(), this.$$recycleFreq)\n } else {\n this.$$recycleFreqId = undefined\n }\n }\n\n /**\n * Update the {@link Cache#storageMode} for the cache.\n *\n * @method Cache#setStorageMode\n * @param {string} storageMode The new {@link Cache#storageMode}.\n * @param {object} storageImpl The new {@link Cache~StorageImpl}.\n */\n setStorageMode (storageMode, storageImpl) {\n if (!utils.isString(storageMode)) {\n throw new TypeError(`\"storageMode\" must be a string!`)\n } else if (storageMode !== 'memory' && storageMode !== 'localStorage' && storageMode !== 'sessionStorage') {\n throw new Error(`\"storageMode\" must be \"memory\", \"localStorage\", or \"sessionStorage\"!`)\n }\n\n const prevStorage = this.$$storage\n const prevData = this.$$data\n let shouldReInsert = false\n let items = {}\n\n const load = (prevStorage, prevData) => {\n const keys = this.keys()\n const prevDataIsObject = utils.isObject(prevData)\n keys.forEach((key) => {\n if (prevStorage) {\n const itemJson = prevStorage().getItem(`${this.$$prefix}.data.${key}`)\n if (itemJson) {\n items[key] = utils.fromJson(itemJson)\n }\n } else if (prevDataIsObject) {\n items[key] = prevData[key]\n }\n this.remove(key)\n shouldReInsert || (shouldReInsert = true)\n })\n }\n\n if (!this.$$initializing) {\n load(prevStorage, prevData)\n }\n\n this.$$storageMode = storageMode\n\n if (storageImpl) {\n if (!utils.isObject(storageImpl)) {\n throw new TypeError(`\"storageImpl\" must be an object!`)\n } else if (typeof storageImpl.setItem !== 'function') {\n throw new Error(`\"storageImpl\" must implement \"setItem(key, value)\"!`)\n } else if (typeof storageImpl.getItem !== 'function') {\n throw new Error(`\"storageImpl\" must implement \"getItem(key)\"!`)\n } else if (typeof storageImpl.removeItem !== 'function') {\n throw new Error(`\"storageImpl\" must implement \"removeItem(key)\"!`)\n }\n this.$$storage = () => storageImpl\n } else if (this.$$storageMode === 'localStorage') {\n try {\n localStorage.setItem('cachefactory', 'cachefactory')\n localStorage.removeItem('cachefactory')\n this.$$storage = () => localStorage\n } catch (e) {\n this.$$storage = null\n this.$$storageMode = 'memory'\n }\n } else if (this.$$storageMode === 'sessionStorage') {\n try {\n sessionStorage.setItem('cachefactory', 'cachefactory')\n sessionStorage.removeItem('cachefactory')\n this.$$storage = () => sessionStorage\n } catch (e) {\n this.$$storage = null\n this.$$storageMode = 'memory'\n }\n } else {\n this.$$storage = null\n this.$$storageMode = 'memory'\n }\n\n if (this.$$initializing) {\n load(this.$$storage, this.$$data)\n }\n\n if (shouldReInsert) {\n Object.keys(items).forEach((key) => {\n const item = items[key]\n this.put(key, item.value, {\n created: item.created,\n accessed: item.accessed,\n expires: item.expires\n })\n })\n }\n }\n\n /**\n * Reset an item's age in the cache, or if `key` is unspecified, touch all\n * items in the cache.\n *\n * @example\n * cache.touch('foo');\n *\n * @method Cache#touch\n * @param {string} [key] The key of the item to touch.\n * @param {object} [options] Options to pass to {@link Cache#put} if\n * necessary.\n */\n touch (key, options) {\n if (key) {\n const val = this.get(key, {\n onExpire: (k, v) => this.put(k, v)\n })\n if (val) {\n this.put(key, val, options)\n }\n } else {\n const keys = this.keys()\n for (var i = 0; i < keys.length; i++) {\n this.touch(keys[i], options)\n }\n }\n }\n\n /**\n * Retrieve the values of all items in the cache.\n *\n * @example\n * const values = cache.values();\n *\n * @method Cache#values\n * @returns {array} The values of the items in the cache.\n */\n values () {\n return this.keys().map((key) => this.get(key))\n }\n}\n","import defaults from './defaults'\n/**\n * A instance of `CacheFactory` holds multiple caches, and provides methods for\n * manipulating all of the caches at once.\n *\n * @example\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const cache = cacheFactory.createCache('my-cache');\n *\n * @class CacheFactory\n */\nexport default class CacheFactory {\n constructor () {\n Object.defineProperty(this, 'caches', {\n writable: true,\n value: {}\n })\n }\n\n /**\n * Calls {@link Cache#removeAll} on each {@link Cache} in this\n * {@link CacheFactory}.\n *\n * @example\n * cacheFactory.clearAll();\n *\n * @method CacheFactory#clearAll\n */\n clearAll () {\n this.keys().forEach((cacheId) => {\n this.get(cacheId).removeAll()\n })\n }\n\n /**\n * Create a new {@link Cache}. If a cache with the same `id` had been created\n * in a previous browser session, then it will attempt to load any data that\n * had been saved previously.\n *\n * @example\n * import CacheFactory from 'cachefactory';\n *\n * const cacheFactory = new CacheFactory();\n * const options = {...};\n * const cache = cacheFactory.createCache('my-cache', options);\n *\n * cache.put('foo', 'bar');\n * console.log(cache.get('foo')); // \"bar\"\n *\n * @method CacheFactory#createCache\n * @param {string} id A unique identifier for the new {@link Cache}.\n * @param {object} [options] Configuration options. See {@link Cache}.\n * @returns {Cache} The new {@link Cache} instance.\n */\n createCache (id, options = {}) {\n if (this.caches[id]) {\n throw new Error(`cache \"${id}\" already exists!`)\n }\n options.parent = this\n this.caches[id] = new CacheFactory.Cache(id, options)\n return this.caches[id]\n }\n\n /**\n * Calls {@link Cache#destroy} on the {@link Cache} in this\n * {@link CacheFactory} that has the specified `id`.\n *\n * @example\n * cacheFactory.destroy('my-cache');\n *\n * @method CacheFactory#destroy\n * @param {string} id TODO\n */\n destroy (id) {\n this.get(id).destroy()\n this.caches[id] = undefined\n }\n\n /**\n * Calls {@link Cache#destroy} on each {@link Cache} in this\n * {@link CacheFactory}.\n *\n * @example\n * cacheFactory.destroyAll();\n *\n * @method CacheFactory#destroyAll\n */\n destroyAll () {\n this.keys().forEach((id) => {\n this.get(id).destroy()\n })\n this.caches = {}\n }\n\n /**\n * Calls {@link Cache#disable} on each {@link Cache} in this\n * {@link CacheFactory}.\n *\n * @example\n * cacheFactory.disableAll();\n *\n * @method CacheFactory#disableAll\n */\n disableAll () {\n this.keys().forEach((cacheId) => {\n this.get(cacheId).disable()\n })\n }\n\n /**\n * Calls {@link Cache#enable} on each {@link Cache} in this\n * {@link CacheFactory}.\n *\n * @example\n * cacheFactory.enableAll();\n *\n * @method CacheFactory#enableAll\n */\n enableAll () {\n this.keys().forEach((cacheId) => {\n this.get(cacheId).enable()\n })\n }\n\n /**\n * Returns whether the {@link Cache} with the specified `id` exists in this\n * {@link CacheFactory}.\n *\n * @example\n * const exists = cacheFactory.exists('my-cache');\n *\n * @method CacheFactory#exists\n * @returns {boolean} Whether the {@link Cache} with the specified `id` exists\n * in this {@link CacheFactory}.\n */\n exists (id) {\n return !!this.caches[id]\n }\n\n /**\n * Returns a reference to the {@link Cache} in this {@link CacheFactory} that\n * has the specified `id`.\n *\n * @example\n * const cache = cacheFactory.get('my-cache');\n *\n * @method CacheFactory#get\n * @param {string} id The `id` of the {@link Cache} to retrieve.\n * @returns {Cache} The {@link Cache} instance.\n * @throws {ReferenceError} Throws a `ReferenceError` if the {@link Cache}\n * does not exist.\n */\n get (id) {\n const cache = this.caches[id]\n if (!cache) {\n throw new ReferenceError(`Cache \"${id}\" does not exist!`)\n }\n return cache\n }\n\n /**\n * Returns information on this {@link CacheFactory} and its {@link Cache}\n * instance.\n *\n * @example\n * const info = cacheFactory.info();\n * info.size; // 3\n * info.caches['my-cache']; // { size: 1234, ... }\n * info.caches['my-cache2']; // { size: 51, ... }\n * info.caches['my-cache3']; // { size: 43, ... }\n *\n * @method CacheFactory#info\n * @returns {object} The detailed information.\n */\n info () {\n const keys = this.keys()\n const info = {\n size: keys.length,\n caches: {}\n }\n keys.forEach((cacheId) => {\n info.caches[cacheId] = this.get(cacheId).info()\n })\n Object.keys(defaults).forEach((key, value) => {\n info[key] = defaults[key]\n })\n return info\n }\n\n /**\n * Returns an array of identifiers of the {@link Cache} instances in this\n * {@link CacheFactory}.\n *\n * @example\n * const keys = cacheFactory.keys();\n *\n * @method CacheFactory#keys\n * @returns {string[]} The {@link Cache} identifiers.\n */\n keys () {\n return Object.keys(this.caches).filter((key) => this.caches[key])\n }\n\n /**\n * Returns an object of key-value pairs representing the identifiers of the\n * {@link Cache} instances in this {@link CacheFactory}.\n *\n * @example\n * const keySet = cacheFactory.keySet();\n *\n * @method CacheFactory#keySet\n * @returns {object} The {@link Cache} identifiers.\n */\n keySet () {\n const set = {}\n this.keys().forEach((key) => {\n set[key] = key\n })\n return set\n }\n\n /**\n * Calls {@link Cache#removeExpired} on each {@link Cache} in this\n * {@link CacheFactory} and returns the removed items, if any.\n *\n * @example\n * const expired = cacheFactory.removeExpiredFromAll();\n *\n * @method CacheFactory#removeExpiredFromAll\n * @returns {object} The removed items, if any.\n */\n removeExpiredFromAll () {\n const expired = {}\n this.keys().forEach((id) => {\n expired[id] = this.get(id).removeExpired()\n })\n return expired\n }\n\n /**\n * Calls {@link Cache#touch} on each {@link Cache} in this\n * {@link CacheFactory}.\n *\n * @example\n * cacheFactory.touchAll();\n *\n * @method CacheFactory#touchAll\n */\n touchAll () {\n this.keys().forEach((cacheId) => {\n this.get(cacheId).touch()\n })\n }\n}\n","import BinaryHeap from './BinaryHeap'\nimport Cache from './Cache'\nimport CacheFactory from './CacheFactory'\nimport defaults from './defaults'\nimport utils from './utils'\n\nCacheFactory.Cache = Cache\n\nexport {\n /**\n * Registered as `cachefactory` in NPM and Bower.\n *\n * @module cachefactory\n *\n * @example <caption>Install from NPM</caption>\n * npm i --save cachefactory\n * @example <caption>Install from Bower</caption>\n * bower i --save cachefactory\n * @example <caption>Load into your app via script tag</caption>\n * <script src=\"/path/to/cachefactory.min.js\"></script>\n * @example <caption>Load into your app via CommonJS</caption>\n * var cacheFactory = new require('cachefactory').CacheFactory();\n * @example <caption>Load into your app via ES2015 Modules</caption>\n * import { CacheFactory } from 'cachefactory';\n * @example <caption>Load into your app via AMD</caption>\n * define('myApp', ['cachefactory'], function (cachefactory) {\n * const cacheFactory = new cachefactory.CacheFactory();\n * });\n */\n CacheFactory,\n\n /**\n * The `BinaryHeap` constructor function.\n *\n * @example\n * import { BinaryHeap, CacheFactory } from 'cachefactory';\n *\n * @name BinaryHeap\n * @memberof module:cachefactory\n * @see https://github.com/jmdobry/yabh\n * @type {function}\n */\n BinaryHeap,\n\n /**\n * The {@link Cache} constructor function.\n *\n * @example\n * import { Cache, CacheFactory } from 'cachefactory';\n *\n * @name Cache\n * @memberof module:cachefactory\n * @see Cache\n * @type {function}\n */\n Cache,\n\n /**\n * The default cache values. Modify this object to change the default values.\n *\n * @example\n * import { CacheFactory, defaults } from 'cachefactory';\n *\n * // Change the default \"maxAge\" for caches that will be instantiated\n * // after this point.\n * defaults.maxAge = 60 * 60 * 1000;\n *\n * @name defaults\n * @memberof module:cachefactory\n * @see Cache\n * @type {object}\n */\n defaults,\n\n /**\n * Utility functions used throughout this library.\n *\n * @example\n * import Promise from 'bluebird';\n * import { CacheFactory, utils } from 'cachefactory';\n *\n * // Make this library use your Promise lib\n * utils.Promise = Promise;\n *\n * @name utils\n * @memberof module:cachefactory\n * @type {object}\n */\n utils\n}\n","class TranslateHttpLoader {\r\n constructor(http, prefix = \"/assets/i18n/\", suffix = \".json\") {\r\n this.http = http;\r\n this.prefix = prefix;\r\n this.suffix = suffix;\r\n }\r\n /**\r\n * Gets the translations from the server\r\n */\r\n getTranslation(lang) {\r\n return this.http.get(`${this.prefix}${lang}${this.suffix}`);\r\n }\r\n}\n\n/**\r\n * Generated bundle index. Do not edit.\r\n */\n\nexport { TranslateHttpLoader };\n","import {\r\n HttpContextToken,\r\n} from '@angular/common/http';\r\n\r\nimport { AprimaCacheInstance } from '../services/AprimaCacheService';\r\n\r\nexport const APRIMA_HTTP_CONTEXT_CACHE_INSTANCE = new HttpContextToken<AprimaCacheInstance | undefined>(() => undefined);\r\n","import {\r\n HTTP_INTERCEPTORS,\r\n} from '@angular/common/http';\r\nimport {\r\n Provider,\r\n} from '@angular/core';\r\n\r\nimport {\r\n CacheInterceptor,\r\n} from './index';\r\n\r\nexport const webcommonHttpInterceptorProviders: Provider[] = [\r\n { provide: HTTP_INTERCEPTORS, useClass: CacheInterceptor, multi: true },\r\n];\r\n","import {\r\n HttpEvent,\r\n HttpHandler,\r\n HttpInterceptor,\r\n HttpRequest,\r\n HttpResponse,\r\n} from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport { tap } from 'rxjs/operators';\r\n\r\nimport { APRIMA_HTTP_CONTEXT_CACHE_INSTANCE } from './context-tokens';\r\n\r\nfunction httpLogPrefix(cacheId: string) {\r\n return 'AprimaCache-' + cacheId + '-Http';\r\n}\r\n\r\nexport class CacheInterceptor implements HttpInterceptor {\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n let cacheInstance = req.context.get(APRIMA_HTTP_CONTEXT_CACHE_INSTANCE);\r\n\r\n if (cacheInstance && req.method.toLowerCase() !== 'get') {\r\n console.error(`Ignoring cacheInstance for ${req.method} to ${req.url}`);\r\n cacheInstance = undefined;\r\n }\r\n\r\n if (!cacheInstance) {\r\n return next.handle(req);\r\n }\r\n\r\n const cachedValue = cacheInstance.get(req.url);\r\n const cacheInfo = cacheInstance.info();\r\n if (typeof cachedValue !== 'undefined') {\r\n // tslint:disable-next-line:no-console\r\n console.debug(httpLogPrefix(cacheInfo.name), '-- Retrieved \"' + req.url + '\" from cache. Result:', cachedValue);\r\n\r\n return of(cachedValue);\r\n }\r\n\r\n // TODO: The AngularJS implementation handled the scenario where two simultaneous requests\r\n // were made for the same URL and only sent one request.\r\n // This implementation doesn't do that yet.\r\n return next.handle(req).pipe(\r\n tap(event => {\r\n // There may be other events besides the response.\r\n if (event instanceof HttpResponse && cacheInstance) {\r\n cacheInstance.put(req.url, event); // Update the cache.\r\n }\r\n })\r\n );\r\n }\r\n}\r\n","import {\r\n AppRoutesDeclaration,\r\n} from 'webcommon/shared';\r\n\r\nexport abstract class AppRouteService {\r\n abstract getAppRoutes(): AppRoutesDeclaration;\r\n abstract setupAppRoutes(newAppRoutes: AppRoutesDeclaration): void;\r\n}\r\n\r\nexport function AppRouteServiceFactory(i: angular.auto.IInjectorService) {\r\n return i.get<AppRouteService>('AppRoutes');\r\n}\r\n\r\nexport const AppRoutesAjsProvider = {\r\n deps: ['$injector'],\r\n provide: AppRouteService,\r\n useFactory: AppRouteServiceFactory,\r\n};\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { Bridge } from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class BridgeService implements Bridge {\r\n private bridge: Bridge | null = null;\r\n\r\n public loadConfiguration(configuration: Bridge): void {\r\n if (this.bridge !== null) {\r\n throw new Error('bridge has already been set');\r\n }\r\n this.bridge = configuration;\r\n }\r\n\r\n private validateConfiguration(): Bridge {\r\n if (this.bridge === null) {\r\n throw new Error('bridge has not been set');\r\n }\r\n return this.bridge;\r\n }\r\n\r\n public hasConfiguration(): boolean {\r\n return this.bridge !== null;\r\n }\r\n\r\n public fireEvent(eventName: string, data: any = null): void {\r\n const bridge = this.validateConfiguration();\r\n bridge.fireEvent(eventName, data === null ? {} : data);\r\n }\r\n\r\n addEventListener(eventName: string, callbackFn: (data: any) => void): void {\r\n const bridge = this.validateConfiguration();\r\n bridge.addEventListener(eventName, callbackFn);\r\n }\r\n\r\n removeEventListener(eventName: string, callbackFn: (data: any) => void): void {\r\n const bridge = this.validateConfiguration();\r\n bridge.removeEventListener(eventName, callbackFn);\r\n }\r\n\r\n on<T>(eventName: string): Observable<T> {\r\n const bridge = this.validateConfiguration();\r\n return bridge.on<T>(eventName);\r\n }\r\n\r\n once<T>(eventName: string): Observable<T> {\r\n const bridge = this.validateConfiguration();\r\n return bridge.once<T>(eventName);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { pad } from 'lodash-es';\r\nimport moment from 'moment';\r\n\r\nimport { BridgeService } from './BridgeService';\r\n\r\nexport interface AprimaAnalyticsTiming {\r\n stop(): void;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AprimaAnalyticsService {\r\n static readonly ajsFactoryName = 'AprimaAnalytics';\r\n\r\n constructor(\r\n private bridge: BridgeService,\r\n ) {\r\n }\r\n\r\n sendEvent(category: string, action: string, label: string, value?: string) {\r\n setTimeout(() => {\r\n // tslint:disable-next-line:no-console\r\n console.debug('Event: ' + pad(category, 20) + ' | ' + pad(action, 20) + ' | ' + pad(label, 20) + ' | ' + pad(value, 20));\r\n this.bridge.fireEvent('trackEvent', {\r\n category: category || '',\r\n action: action || '',\r\n label: label || '',\r\n value: value || '',\r\n });\r\n }, 0);\r\n }\r\n\r\n sendPageView(location: string) {\r\n setTimeout(() => {\r\n // tslint:disable-next-line:no-console\r\n console.debug('Page Change: ' + pad(location, 30));\r\n this.bridge.fireEvent('trackPageChange', {\r\n page: location,\r\n });\r\n }, 0);\r\n }\r\n\r\n sendException(message: string) {\r\n setTimeout(() => {\r\n // tslint:disable-next-line:no-console\r\n console.debug('Exception: ' + message);\r\n this.bridge.fireEvent('trackException', {\r\n message,\r\n });\r\n }, 0);\r\n }\r\n\r\n startTiming(page: string, category: string, label: string): AprimaAnalyticsTiming {\r\n const startTime = new Date().getTime();\r\n\r\n return {\r\n stop: () => {\r\n const endTime = new Date().getTime();\r\n setTimeout(() => {\r\n this.stopTiming(page, category, label, startTime, endTime);\r\n }, 0);\r\n },\r\n };\r\n }\r\n\r\n private stopTiming(page: string, category: string, label: string, startTime: number, endTime: number): void {\r\n const elapsedTime = moment(endTime).diff(moment(startTime), 'millisecond');\r\n const timingValue = elapsedTime.toString();\r\n\r\n // tslint:disable-next-line:no-console\r\n console.debug('Timing: ' + pad(page, 30) + ' | ' + pad(category, 7) + ' | ' + pad(label, 30) + ' | ' + pad(timingValue, 5) + 'ms');\r\n this.bridge.fireEvent('trackTiming', {\r\n category: category || '',\r\n label: label || '',\r\n value: timingValue || '',\r\n page: page || '',\r\n });\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { isObject, mapValues } from 'lodash-es';\r\n\r\n// TODO: research how to avoid using the any type here\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ObjUtilService {\r\n static readonly ajsFactoryName = 'ObjUtil';\r\n\r\n defineReadonlyProps(obj: any, propertiesObj: any): any {\r\n if (!isObject(propertiesObj)) {\r\n throw new Error('Expected defineReadonlyProps to be called with object instead of ' + propertiesObj);\r\n }\r\n\r\n const properties = mapValues(propertiesObj, (val) => {\r\n return {\r\n value: val,\r\n writable: false,\r\n enumerable: true,\r\n configurable: false,\r\n };\r\n }) as any;\r\n return Object.defineProperties(obj, properties);\r\n }\r\n\r\n defineStaticProps(obj: any, propertiesObj: any): any {\r\n if (!isObject(propertiesObj)) {\r\n throw new Error('Expected defineStaticProps to be called with object instead of ' + propertiesObj);\r\n }\r\n\r\n const properties = mapValues(propertiesObj, (val) => {\r\n return {\r\n value: val,\r\n writable: false,\r\n enumerable: false,\r\n configurable: false,\r\n };\r\n }) as any;\r\n return Object.defineProperties(obj, properties);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n CacheFactory,\r\n DeleteOnExpire,\r\n GetPutOptions,\r\n ItemInfo,\r\n OnExpireCallback,\r\n StorageImpl,\r\n StorageMode,\r\n} from 'cachefactory';\r\nimport {\r\n assign,\r\n cloneDeep,\r\n defaults,\r\n isArray,\r\n mapValues,\r\n} from 'lodash-es';\r\n\r\nimport { ObjUtilService } from './ObjUtilService';\r\n\r\nexport interface AprimaCacheOptions {\r\n // From CacheOptions\r\n cacheFlushInterval?: number;\r\n capacity?: number;\r\n deleteOnExpire?: DeleteOnExpire;\r\n enable?: boolean;\r\n maxAge?: number;\r\n onExpire?: OnExpireCallback;\r\n recycleFreq?: number;\r\n storageMode?: StorageMode;\r\n storageImpl?: StorageImpl;\r\n storagePrefix?: string;\r\n storeOnResolve?: boolean;\r\n storeOnReject?: boolean;\r\n\r\n // Custom\r\n description: string;\r\n name: string;\r\n}\r\n\r\nexport interface AprimaAdditionalCacheOptions {\r\n [key: string]: AprimaCacheOptions;\r\n}\r\n\r\nexport interface AprimaCacheFactoryInfo extends AprimaCacheOptions {\r\n // From CacheFactoryInfo with some custom types\r\n size: number;\r\n caches: {[id: string]: AprimaCacheInfo};\r\n}\r\n\r\nexport interface AprimaCacheInfo extends AprimaCacheOptions {\r\n // From CacheInfo\r\n id: string;\r\n size: number;\r\n}\r\n\r\nexport interface AprimaCacheInstance {\r\n // From Cache with some custom types\r\n id: string;\r\n destroy(): void;\r\n disable(): void;\r\n enable(): void;\r\n get(key: string|number, options?: GetPutOptions): any;\r\n info(): AprimaCacheInfo;\r\n info(key: string|number): ItemInfo;\r\n keys(): Array<(string|number)>;\r\n keySet(): {[key: string]: string|number};\r\n put(key: string|number, value: any, options?: GetPutOptions): any;\r\n remove(key: string|number): any;\r\n removeAll(): void;\r\n removeExpired(): {[key: string]: any};\r\n setCacheFlushInterval(cacheFlushInterval: number): void;\r\n setCapacity(capacity: number): void;\r\n setDeleteOnExpire(deleteOnExpire: DeleteOnExpire, setRecycleFreq?: boolean): void;\r\n setMaxAge(maxAge: number): void;\r\n setOnExpire(onExpire: () => void): any;\r\n setOptions(cacheOptions: AprimaCacheOptions, strict?: boolean): void;\r\n setRecycleFreq(recycleFreq: boolean): void;\r\n setStorageMode(storageMode: StorageMode, storageImpl?: StorageImpl): void;\r\n touch(key: string|number): void;\r\n values(): any[];\r\n\r\n // Custom\r\n getClone(key: string|number, options?: GetPutOptions): any;\r\n}\r\n\r\n// One of the reasons this is necessary is because sometimes it is useful to have more control over the caching,\r\n// and because iOS doesn't handle Cache-Control headers correctly\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AprimaCacheService {\r\n static readonly ajsFactoryName = 'AprimaCache';\r\n\r\n cacheFactory: CacheFactory | null = null;\r\n disableAllCaches = false;\r\n\r\n constructor(\r\n private objUtilService: ObjUtilService,\r\n ) {\r\n // If you want to configure one of these caches to be different than what is set here\r\n // or to add another cache then do something like this example in your root project:\r\n // AprimaCacheService.initialize({\r\n // Lists: {\r\n // maxAge: 10 * 60 * 1000,\r\n // },\r\n // Default: {\r\n // maxAge: 5 * 60 * 1000,\r\n // deleteOnExpire: 'aggressive',\r\n // },\r\n // NewCache: {\r\n // maxAge: 10 * 60 * 1000,\r\n // deleteOnExpire: 'passive',\r\n // },\r\n // NewCache2: {\r\n // maxAge: 10 * 60 * 1000,\r\n // deleteOnExpire: 'passive',\r\n // }\r\n // });\r\n }\r\n\r\n initialize(additionalCaches?: AprimaAdditionalCacheOptions, disableAllCaches: boolean = false): void {\r\n if (this.cacheFactory !== null) {\r\n throw new Error('AprimaCacheService has already been intialized');\r\n }\r\n\r\n this.cacheFactory = new CacheFactory();\r\n this.disableAllCaches = disableAllCaches;\r\n\r\n // IMPORTANT:\r\n // Using localStorage or sessionStorage for storageMode doesn't work right with promises,\r\n // because of a bug where the item never gets removed from storage\r\n // even after it's supposed to be expired (https://github.com/jmdobry/angular-cache/issues/224)\r\n\r\n // These caches are global, so if you change one, it will be changed for everywhere that uses it\r\n // These below are the common ones\r\n const cacheSettings: AprimaAdditionalCacheOptions = {\r\n // cache to be used for lists\r\n Lists: {\r\n maxAge: 1 * 60 * 60 * 1000, // 60 minutes (1 hour)\r\n deleteOnExpire: 'passive',\r\n capacity: 200,\r\n description: 'All Lists',\r\n name: 'Lists',\r\n },\r\n // default http cache\r\n Default: {\r\n maxAge: 2 * 60 * 60 * 1000, // 2 hours\r\n deleteOnExpire: 'passive',\r\n capacity: 200,\r\n description: 'General Data Cache',\r\n name: 'Default',\r\n },\r\n Permissions: {\r\n maxAge: 30 * 60 * 1000, // 30 minutes\r\n deleteOnExpire: 'passive',\r\n capacity: 100,\r\n description: 'Security Permissions',\r\n name: 'Permissions',\r\n },\r\n\r\n // I don't believe any IMO data will change more than once per day (24 hours)\r\n ImoTerms: {\r\n maxAge: 24 * 60 * 60 * 1000, // 24 hours\r\n deleteOnExpire: 'passive',\r\n storageMode: 'localStorage',\r\n capacity: 200,\r\n description: 'Diagnosis Terms',\r\n name: 'ImoTerms',\r\n },\r\n ImoDetails: {\r\n maxAge: 24 * 60 * 60 * 1000, // 24 hours\r\n deleteOnExpire: 'passive',\r\n storageMode: 'localStorage',\r\n capacity: 100,\r\n description: 'Diagnosis Details',\r\n name: 'ImoDetails',\r\n }\r\n };\r\n\r\n if (additionalCaches) {\r\n assign(cacheSettings, additionalCaches);\r\n }\r\n\r\n const caches = mapValues(cacheSettings, (settings, cacheName) => {\r\n const newCache = this.createNew(cacheName, settings);\r\n return newCache;\r\n });\r\n\r\n this.objUtilService.defineReadonlyProps(this, caches);\r\n }\r\n\r\n private validateConfiguration(): CacheFactory {\r\n if (this.cacheFactory === null) {\r\n throw new Error('AprimaCacheService has not been intialized');\r\n }\r\n return this.cacheFactory;\r\n }\r\n\r\n clearAll(): void {\r\n const cacheFactory = this.validateConfiguration();\r\n cacheFactory.clearAll();\r\n }\r\n\r\n createNew(cacheName: string, options?: AprimaCacheOptions | undefined): AprimaCacheInstance {\r\n const cache = this.createNewClean(cacheName, options);\r\n if (this.disableAllCaches) {\r\n cache.disable();\r\n }\r\n return cache;\r\n }\r\n\r\n createNewOverride(cacheName: string, options?: AprimaCacheOptions | undefined): AprimaCacheInstance {\r\n return this.createNewClean(cacheName, options);\r\n }\r\n\r\n destroy(id: string): void {\r\n const cacheFactory = this.validateConfiguration();\r\n try {\r\n cacheFactory.destroy(id);\r\n } catch (err: any) {\r\n if (err instanceof ReferenceError) {\r\n return undefined;\r\n }\r\n throw err;\r\n }\r\n }\r\n\r\n destroyAll(): void {\r\n const cacheFactory = this.validateConfiguration();\r\n cacheFactory.destroyAll();\r\n }\r\n\r\n disableAll(): void {\r\n const cacheFactory = this.validateConfiguration();\r\n cacheFactory.disableAll();\r\n }\r\n\r\n enableAll(): void {\r\n const cacheFactory = this.validateConfiguration();\r\n cacheFactory.enabledAll();\r\n }\r\n\r\n get(id: string): AprimaCacheInstance | undefined {\r\n const cacheFactory = this.validateConfiguration();\r\n\r\n try {\r\n return cacheFactory.get(id) as AprimaCacheInstance;\r\n } catch (err: any) {\r\n if (err instanceof ReferenceError) {\r\n return undefined;\r\n }\r\n throw err;\r\n }\r\n }\r\n\r\n getOrCreate(cacheName: string, options?: AprimaCacheOptions | undefined): AprimaCacheInstance {\r\n const cache = this.getOrCreateClean(cacheName, options);\r\n if (this.disableAllCaches) {\r\n cache.disable();\r\n }\r\n return cache;\r\n }\r\n\r\n getOrCreateOverride(cacheName: string, options?: AprimaCacheOptions | undefined): AprimaCacheInstance {\r\n return this.getOrCreateClean(cacheName, options);\r\n }\r\n\r\n info(): AprimaCacheFactoryInfo {\r\n const cacheFactory = this.validateConfiguration();\r\n return cacheFactory.info() as AprimaCacheFactoryInfo;\r\n }\r\n\r\n keys() {\r\n const cacheFactory = this.validateConfiguration();\r\n return cacheFactory.keys();\r\n }\r\n\r\n keySet() {\r\n const cacheFactory = this.validateConfiguration();\r\n return cacheFactory.keySet();\r\n }\r\n\r\n removeExpiredFromAll() {\r\n const cacheFactory = this.validateConfiguration();\r\n return cacheFactory.removeExpiredFromAll();\r\n }\r\n\r\n touchAll(): void {\r\n const cacheFactory = this.validateConfiguration();\r\n cacheFactory.touchAll();\r\n }\r\n\r\n private createNewClean(cacheName: string, options?: AprimaCacheOptions | undefined): AprimaCacheInstance {\r\n this.destroy(cacheName);\r\n\r\n const cacheFactory = this.validateConfiguration();\r\n\r\n // TODO: figure out how to make this work without casting.\r\n // This code was ported from AngularJS so it needs to continue to work as it did before.\r\n const cache = cacheFactory.createCache(cacheName, options) as AprimaCacheInstance;\r\n\r\n // This code below used to be in a decorator of CacheFactory,\r\n // but because CacheFactory is defined as a singleton outside of angular,\r\n // the singleton is not re-created each time the modules are reloaded.\r\n // Because of this, making changes to methods on the singleton was causing issues in the unit tests,\r\n // since those changes were persisting between tests.\r\n // That is why it was just simply moved to this wrapper service.\r\n const description = options?.description ?? cacheName;\r\n const name = options?.name ?? cacheName;\r\n\r\n const infoFn = cache.info;\r\n // tslint:disable-next-line:only-arrow-functions\r\n cache.info = function() {\r\n const infoFnResult = infoFn.apply(cache, arguments);\r\n if (infoFnResult) {\r\n infoFnResult.description = description;\r\n infoFnResult.name = name;\r\n }\r\n return infoFnResult;\r\n };\r\n\r\n // tslint:disable-next-line:only-arrow-functions\r\n cache.getClone = function() {\r\n const getFnResult = cache.get.apply(cache, arguments);\r\n const clone = cloneDeep(getFnResult);\r\n return clone;\r\n };\r\n\r\n this.addHttpModes(cache, cacheName);\r\n\r\n return cache;\r\n }\r\n\r\n private getOrCreateClean(cacheName: string, options?: AprimaCacheOptions | undefined) {\r\n const cache = this.get(cacheName) || this.createNewClean(cacheName, options);\r\n return cache;\r\n }\r\n\r\n // adds httpMode and httpIgnoreMode properties to the cache\r\n // that will add more logging when passing in to restangular and/or $http\r\n // These are only for AngularJS so remove this when WebCommon is pure Angular.\r\n private addHttpModes(cache: AprimaCacheInstance, cacheName: string) {\r\n if (!cache) {\r\n return;\r\n }\r\n\r\n const httpSubset = {\r\n get: getWithHttpLogging,\r\n put: wrap(cache, 'put'),\r\n remove: wrap(cache, 'remove'),\r\n removeAll: wrap(cache, 'removeAll'),\r\n info: wrap(cache, 'info'),\r\n destroy: wrap(cache, 'destroy'),\r\n };\r\n\r\n const httpIgnoreSubset = defaults({\r\n get: getIgnoreCacheWithHttpLogging,\r\n }, httpSubset);\r\n\r\n // pass these into $http or restangular, instead of just the normal cache object\r\n this.objUtilService.defineReadonlyProps(cache, {\r\n httpMode: httpSubset,\r\n httpIgnoreMode: httpIgnoreSubset,\r\n });\r\n\r\n return cache;\r\n\r\n // adds logging for when it is using a cached value\r\n function getWithHttpLogging(url: string) {\r\n const result = cache.get.apply(cache, arguments);\r\n if (typeof result !== 'undefined') {\r\n const msg = isArray(result) ? '($http format: [statusCode, data, headers, statusText])' : '';\r\n\r\n // tslint:disable-next-line:no-console\r\n console.debug(httpLogPrefix(cacheName), '-- Retrieved \"' + url + '\" from cache. Result' + msg + ':', result);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n // have $http ignore the cached value by just returning undefined instead\r\n // and log when a value is ignored\r\n function getIgnoreCacheWithHttpLogging(url: string) {\r\n // tslint:disable-next-line:no-console\r\n console.debug(httpLogPrefix(cacheName), '-- Ignored cache for \"' + url + '\".');\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\nfunction httpLogPrefix(cacheId: string) {\r\n return 'AprimaCache-' + cacheId + '-Http';\r\n}\r\n\r\nfunction wrap(obj: any, methodName: string) {\r\n // tslint:disable-next-line:only-arrow-functions\r\n return function() {\r\n return obj[methodName].apply(obj, arguments);\r\n };\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { BrowserConfig } from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class BrowserService {\r\n // Properties can be defined here for what browser, version, etc should be intentionally private.\r\n // Users of this service should ask for features, not type/version of a browser.\r\n\r\n // Because of the browsers defined in browserslist, and angular dropping support for IE,\r\n // we don't need to detect some of this stuff anymore.\r\n\r\n constructor(\r\n // tslint:disable-next-line:no-empty\r\n ) {\r\n }\r\n\r\n getConfig(): BrowserConfig {\r\n const navigatorObj = this.getNavigator();\r\n const windowObj = this.getWindow();\r\n const userAgent = navigatorObj.userAgent;\r\n\r\n // I updated this iOS logic in Oct 2020 based on these answers on SO:\r\n // https://stackoverflow.com/a/58979271/5335355\r\n // https://stackoverflow.com/a/58065241/5335355\r\n // TODO: we need to eventually refactor this logic and dependent logic, since navigator.platform is deprecated\r\n // tslint:disable:deprecation-2\r\n const isIphone = /iPhone|iPod/.test(navigatorObj.platform) &&\r\n !(windowObj as any).MSStream;\r\n const isIpad = (/iPad/.test(navigatorObj.platform) ||\r\n (navigatorObj.platform === 'MacIntel' && navigatorObj.maxTouchPoints > 2)) &&\r\n !(windowObj as any).MSStream;\r\n const isIosOS = isIphone || isIpad;\r\n // tslint:enable:deprecation-2\r\n\r\n // android detection mentioned here\r\n // http://googlewebmastercentral.blogspot.com/2011/03/mo-better-to-also-detect-mobile-user.html\r\n const isAndroidOS = (/android/im).test(userAgent);\r\n const isAndroidPhone = isAndroidOS && (/mobile/im).test(userAgent);\r\n const isAndroidTablet = isAndroidOS && !isAndroidPhone;\r\n\r\n const isPhone = isIphone || isAndroidPhone;\r\n const isTablet = isIpad || isAndroidTablet;\r\n\r\n const isMobileDevice = isPhone || isTablet;\r\n\r\n const settings: BrowserConfig = {\r\n isAndroidOS,\r\n isIosOS,\r\n isMobileDevice,\r\n isPhone,\r\n isTablet,\r\n };\r\n return settings;\r\n }\r\n\r\n base64ToBlob(base64String: string, contentType: string) {\r\n const windowObj = this.getWindow();\r\n\r\n const byteCharacters = windowObj.atob(base64String);\r\n const byteArrayBuffer = new ArrayBuffer(byteCharacters.length);\r\n const byteArrayInt = new Uint8Array(byteArrayBuffer);\r\n\r\n for (let i = 0; i < byteCharacters.length; i++) {\r\n byteArrayInt[i] = byteCharacters.charCodeAt(i);\r\n }\r\n\r\n return new Blob([byteArrayInt], {type: contentType});\r\n }\r\n\r\n downloadDocumentToFile(fileNameToSaveAs: string, base64String: string, contentType: string) {\r\n const blob = this.base64ToBlob(base64String, contentType);\r\n this.saveBlob(document, blob, fileNameToSaveAs);\r\n }\r\n\r\n tryDownloadDocumentToFile(fileNameToSaveAs: string, base64String: string, contentType: string): boolean {\r\n if (!this.supportsDownloadToFile()) {\r\n return false;\r\n }\r\n\r\n this.downloadDocumentToFile(fileNameToSaveAs, base64String, contentType);\r\n return true;\r\n }\r\n\r\n getDefaultSpinnerName(): string {\r\n // this originially returned 'android' for IE\r\n return 'bubbles';\r\n }\r\n\r\n getDocument(): Document {\r\n return document;\r\n }\r\n\r\n getLocation(): Location {\r\n return location;\r\n }\r\n\r\n getNavigator(): Navigator {\r\n return navigator;\r\n }\r\n\r\n getWindow(): Window & typeof globalThis {\r\n return window;\r\n }\r\n\r\n isBlobCompatible(): boolean {\r\n // this was originally only false for older versions of IE, I think <10\r\n return true;\r\n }\r\n\r\n saveBlob(document: Document, blobObj: Blob, fileName: string): void {\r\n const downloadLink = document.createElement('a');\r\n downloadLink.download = fileName;\r\n const objectUrl = URL.createObjectURL(blobObj);\r\n downloadLink.href = objectUrl;\r\n downloadLink.onclick = (e: MouseEvent) => {\r\n document.body.removeChild(e.target as Node);\r\n };\r\n downloadLink.style.display = 'none';\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n // We should want to call URL.revokeObjectURL() on this objectUrl when it's done downloading,\r\n // or when the objectUrl is safe to clean up,\r\n // but it's not clear when that will be.\r\n // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL#memory_management\r\n // Theoretically, the download could take a while.\r\n // Even FileSaver just uses an arbitrary time:\r\n // https://github.com/eligrey/FileSaver.js/issues/205\r\n // https://github.com/eligrey/FileSaver.js/commit/62d219a0fac54b94cd4f230e7bfc55aa3f8dcfa4\r\n // https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047\r\n // current code for FileSaver:\r\n // https://github.com/eligrey/FileSaver.js/blob/master/src/FileSaver.js#L105-L107\r\n }\r\n\r\n shouldAlwaysIgnoreCache(): boolean {\r\n // this was originally only true for IE\r\n return false;\r\n }\r\n\r\n // separating this logic to a different method will allow us to expand this logic if necessary\r\n // without having to call isBlobCompatible() before calling downloadDocumentToFile()\r\n supportsDownloadToFile(): boolean {\r\n const supported = this.isBlobCompatible();\r\n return supported;\r\n }\r\n\r\n // ported from old BrowserService.js\r\n supportsInlinePdf(): boolean {\r\n // this was originally only false for IE and Legacy Edge (before Chromium)\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { AppConfiguration, GatewayConfiguration } from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ConfigurationRepository implements AppConfiguration {\r\n static readonly ajsFactoryName = 'ConfigurationRepository';\r\n\r\n private appConfiguration: AppConfiguration | null = null;\r\n\r\n loadConfiguration(configuration: AppConfiguration): void {\r\n if (this.appConfiguration !== null) {\r\n throw new Error('configuration has already been loaded');\r\n }\r\n this.appConfiguration = configuration;\r\n }\r\n\r\n private validateConfiguration(): AppConfiguration {\r\n if (this.appConfiguration === null) {\r\n throw new Error('configuration has not been loaded');\r\n }\r\n return this.appConfiguration;\r\n }\r\n\r\n public get API_KEY(): string {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.API_KEY;\r\n }\r\n\r\n public get CLIENT_FEATURES(): string[] | undefined {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.CLIENT_FEATURES;\r\n }\r\n\r\n public get CLIENT_VERSION(): string {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.CLIENT_VERSION;\r\n }\r\n\r\n public get DEV_HOSTED(): boolean {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.DEV_HOSTED;\r\n }\r\n\r\n public get EXPERIMENTAL_FEATURES(): string[] | undefined {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.EXPERIMENTAL_FEATURES;\r\n }\r\n\r\n public get GATEWAYS(): GatewayConfiguration[] {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.GATEWAYS;\r\n }\r\n\r\n public get GIT_COMMIT_HASH(): string {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.GIT_COMMIT_HASH;\r\n }\r\n\r\n public get MIN_PRM_DASHBOARD_VERSION(): string | undefined {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.MIN_PRM_DASHBOARD_VERSION;\r\n }\r\n\r\n public get SERVER_API_VERSION(): string {\r\n const appConfiguration = this.validateConfiguration();\r\n return appConfiguration.SERVER_API_VERSION;\r\n }\r\n}\r\n","export interface StorageRepository {\r\n /**\r\n * Empties the list associated with the object of all key/value pairs, if there are any.\r\n */\r\n clear(): void;\r\n /**\r\n * value = storage[key] ?? throw\r\n * This method allows the return type to be string if there's some situation\r\n * where we don't want to have to handle null.\r\n */\r\n getItemOrThrow(key: string): string;\r\n /**\r\n * value = storage[key]\r\n */\r\n getItem(key: string): string | null;\r\n /**\r\n * delete storage[key]\r\n */\r\n removeItem(key: string): void;\r\n /**\r\n * storage[key] = value\r\n */\r\n setItem(key: string, value: string): void;\r\n}\r\n\r\nexport function throwInvalidKeyError(key: string): never {\r\n throw new Error(`key ${key} does not exist`);\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport {StorageRepository, throwInvalidKeyError} from './IStorageRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class StorageInMemoryRepository implements StorageRepository {\r\n constructor() {\r\n this.clear();\r\n }\r\n\r\n private storage: { [key: string]: string; };\r\n\r\n clear(): void {\r\n this.storage = {};\r\n }\r\n\r\n getItemOrThrow(key: string): string {\r\n return this.getItem(key) ?? throwInvalidKeyError(key);\r\n }\r\n\r\n getItem(key: string): string | null {\r\n return this.storage[key] ?? null;\r\n }\r\n\r\n removeItem(key: string): void {\r\n delete this.storage[key];\r\n }\r\n\r\n setItem(key: string, value: string): void {\r\n this.storage[key] = value;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { BrowserService } from './BrowserService';\r\nimport {StorageRepository, throwInvalidKeyError} from './IStorageRepository';\r\nimport { StorageInMemoryRepository } from './StorageInMemoryRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class StoragePerSessionRepository implements StorageRepository {\r\n constructor(\r\n browserService: BrowserService,\r\n private storageInMemoryRepository: StorageInMemoryRepository,\r\n ) {\r\n this.windowObj = browserService.getWindow();\r\n this.supported = this.isSessionStorageSupported();\r\n }\r\n\r\n private readonly supported: boolean;\r\n private readonly windowObj: Window;\r\n\r\n private isSessionStorageSupported(): boolean {\r\n // https://gist.github.com/paulirish/5558557#gistcomment-1755099\r\n try {\r\n const storage = this.windowObj.sessionStorage;\r\n const x = '__storage_test__';\r\n storage.setItem(x, x);\r\n storage.removeItem(x);\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n clear(): void {\r\n if (this.supported) {\r\n this.windowObj.sessionStorage.clear();\r\n } else {\r\n this.storageInMemoryRepository.clear();\r\n }\r\n }\r\n\r\n getItemOrThrow(key: string): string {\r\n return this.getItem(key) ?? throwInvalidKeyError(key);\r\n }\r\n\r\n getItem(key: string): string | null {\r\n if (this.supported) {\r\n return this.windowObj.sessionStorage.getItem(key);\r\n } else {\r\n return this.storageInMemoryRepository.getItem(key);\r\n }\r\n }\r\n\r\n removeItem(key: string): void {\r\n if (this.supported) {\r\n this.windowObj.sessionStorage.removeItem(key);\r\n } else {\r\n this.storageInMemoryRepository.removeItem(key);\r\n }\r\n }\r\n\r\n setItem(key: string, value: string): void {\r\n if (this.supported) {\r\n this.windowObj.sessionStorage.setItem(key, value);\r\n } else {\r\n this.storageInMemoryRepository.setItem(key, value);\r\n }\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { BrowserService } from './BrowserService';\r\nimport { StorageRepository, throwInvalidKeyError } from './IStorageRepository';\r\nimport { StoragePerSessionRepository } from './StoragePerSessionRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class StorageAcrossSessionRepository implements StorageRepository {\r\n constructor(\r\n browserService: BrowserService,\r\n private storagePerSessionRepository: StoragePerSessionRepository,\r\n ) {\r\n this.windowObj = browserService.getWindow();\r\n this.supported = this.isLocalStorageSupported();\r\n }\r\n\r\n private readonly supported: boolean;\r\n private readonly windowObj: Window;\r\n\r\n private isLocalStorageSupported(): boolean {\r\n // https://gist.github.com/paulirish/5558557#gistcomment-1755099\r\n try {\r\n const storage = this.windowObj.localStorage;\r\n const x = '__storage_test__';\r\n storage.setItem(x, x);\r\n storage.removeItem(x);\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n clear(): void {\r\n if (this.supported) {\r\n this.windowObj.localStorage.clear();\r\n } else {\r\n this.storagePerSessionRepository.clear();\r\n }\r\n }\r\n\r\n getItemOrThrow(key: string): string {\r\n return this.getItem(key) ?? throwInvalidKeyError(key);\r\n }\r\n\r\n getItem(key: string): string | null {\r\n if (this.supported) {\r\n return this.windowObj.localStorage.getItem(key);\r\n } else {\r\n return this.storagePerSessionRepository.getItem(key);\r\n }\r\n }\r\n\r\n removeItem(key: string): void {\r\n if (this.supported) {\r\n this.windowObj.localStorage.removeItem(key);\r\n } else {\r\n this.storagePerSessionRepository.removeItem(key);\r\n }\r\n }\r\n\r\n setItem(key: string, value: string): void {\r\n if (this.supported) {\r\n this.windowObj.localStorage.setItem(key, value);\r\n } else {\r\n this.storagePerSessionRepository.setItem(key, value);\r\n }\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { assign, defaults } from 'lodash-es';\r\n\r\nimport {\r\n ActivePatient,\r\n AppointmentListSettings,\r\n AppointmentsBadgeSettings,\r\n MessagesListSettings,\r\n ProviderDashboardSettingsDto,\r\n ProviderSettingsDto,\r\n SiteSettingsDto,\r\n} from 'webcommon/shared';\r\n\r\nimport { StorageAcrossSessionRepository } from './StorageAcrossSessionRepository';\r\nimport { StorageInMemoryRepository } from './StorageInMemoryRepository';\r\nimport { StoragePerSessionRepository } from './StoragePerSessionRepository';\r\n\r\nconst trueRegex = /^true$/i;\r\nconst falseRegex = /^false$/i;\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WebCommonStorageRepository {\r\n static readonly ajsFactoryName = 'WebCommonStorageRepository';\r\n\r\n constructor(\r\n private storageAcrossSessionRepository: StorageAcrossSessionRepository,\r\n private storageInMemoryRepository: StorageInMemoryRepository,\r\n private storagePerSessionRepository: StoragePerSessionRepository,\r\n ) { }\r\n\r\n private remove(key: string): void {\r\n this.storageAcrossSessionRepository.removeItem(key);\r\n }\r\n\r\n private setOrRemove(key: string, value: string | null): void {\r\n if (!value) {\r\n this.remove(key);\r\n return;\r\n }\r\n\r\n this.set(key, value);\r\n }\r\n\r\n private setOrRemoveObj<T>(key: string, value: T): void {\r\n if (!value) {\r\n this.remove(key);\r\n return;\r\n }\r\n\r\n this.setObj(key, value);\r\n }\r\n\r\n private setObj<T>(key: string, value: T): void {\r\n const json = JSON.stringify(value);\r\n this.set(key, json);\r\n }\r\n\r\n private set(key: string, value: string): void {\r\n this.storageAcrossSessionRepository.setItem(key, value);\r\n }\r\n\r\n private get(key: string): string | null {\r\n return this.storageAcrossSessionRepository.getItem(key);\r\n }\r\n\r\n private getOrThrow(key: string): string {\r\n return this.storageAcrossSessionRepository.getItemOrThrow(key);\r\n }\r\n\r\n private getObj<T>(key: string): T | null {\r\n const obj = this.get(key);\r\n const value = obj ? JSON.parse(obj) : null;\r\n return value;\r\n }\r\n\r\n private getObjOrDefault<T>(key: string, defaultValue: T): T {\r\n const obj = this.get(key);\r\n if (!obj) {\r\n return defaultValue;\r\n }\r\n\r\n const value = JSON.parse(obj) as T;\r\n return value;\r\n }\r\n\r\n private overwritePropertiesAndSave<T>(destinationGetter: () => T | null, source: T, storageKey: string) {\r\n let destination = destinationGetter() || {};\r\n destination = assign(destination, source);\r\n this.setObj(storageKey, destination);\r\n }\r\n\r\n private defaultPropertiesAndSave<T>(destinationGetter: () => T | null, source: T, storageKey: string) {\r\n let destination = destinationGetter() || {};\r\n destination = defaults(destination, source);\r\n this.setObj(storageKey, destination);\r\n }\r\n\r\n clearAll(): void {\r\n this.storageAcrossSessionRepository.clear();\r\n this.storagePerSessionRepository.clear();\r\n this.storageInMemoryRepository.clear();\r\n }\r\n\r\n getUserIdOrThrow(): string {\r\n return this.getOrThrow('userId');\r\n }\r\n\r\n getUserId(): string | null {\r\n return this.get('userId');\r\n }\r\n\r\n removeUserId(): void {\r\n this.remove('userId');\r\n }\r\n\r\n setUserId(userId: string | null): void {\r\n this.setOrRemove('userId', userId);\r\n }\r\n\r\n getIsActiveDirectoryUser(): boolean {\r\n return this.getObjOrDefault('activeDirectoryUser', false);\r\n }\r\n\r\n setIsActiveDirectoryUser(isActiveDirectoryUser: boolean): void {\r\n this.setObj('activeDirectoryUser', isActiveDirectoryUser);\r\n }\r\n\r\n getPatientPortalActivePatient(): ActivePatient | null {\r\n return this.getObj<ActivePatient>('activePatient');\r\n }\r\n\r\n getDeviceId(): string | null {\r\n return this.get('deviceId');\r\n }\r\n\r\n setDeviceId(deviceId: string): void {\r\n this.setOrRemove('deviceId', deviceId);\r\n }\r\n\r\n getUserFullName(): string | null {\r\n return this.get('userFullName');\r\n }\r\n\r\n setUserFullName(fullName: string | null): void {\r\n this.setOrRemove('userFullName', fullName);\r\n }\r\n\r\n getClientId(): string | null {\r\n return this.get('clientID');\r\n }\r\n\r\n setClientId(clientId: string): void {\r\n this.set('clientID', clientId);\r\n }\r\n\r\n private formatClientUrl(clientUrl: string | null): string | null {\r\n return clientUrl ? clientUrl.replace(/\\/$/, '') : null;\r\n }\r\n\r\n getClientUrl(): string | null {\r\n const clientUrl = this.get('clientURL');\r\n return this.formatClientUrl(clientUrl);\r\n }\r\n\r\n setClientUrl(clientUrl: string | null): void {\r\n if (!clientUrl) {\r\n this.remove('clientURL');\r\n } else {\r\n // tslint:disable-next-line:no-non-null-assertion\r\n const formattedClientUrl = this.formatClientUrl(clientUrl)!;\r\n this.set('clientURL', formattedClientUrl);\r\n }\r\n }\r\n\r\n getJsonWebToken(): string | null {\r\n return this.get('json-web-token');\r\n }\r\n\r\n removeJsonWebToken(): void {\r\n this.remove('json-web-token');\r\n }\r\n\r\n setJsonWebToken(jwt: string): void {\r\n this.set('json-web-token', jwt);\r\n }\r\n\r\n setProviderSettings(providerSettings: ProviderSettingsDto): void {\r\n this.setOrRemoveObj('ProviderSettings', providerSettings);\r\n }\r\n\r\n getProviderSettings(): ProviderSettingsDto | null {\r\n return this.getObj('ProviderSettings');\r\n }\r\n\r\n getPrmAssemblyVersion(): string | null {\r\n return this.get('prmAssemblyVersion');\r\n }\r\n\r\n setPrmAssemblyVersion(assemblyVersion: string | null): void {\r\n this.setOrRemove('prmAssemblyVersion', assemblyVersion);\r\n }\r\n\r\n getPrmDatabaseVersion(): string | null {\r\n return this.get('prmDatabaseVersion');\r\n }\r\n\r\n setPrmDatabaseVersion(databaseVersion: string | null): void {\r\n this.setOrRemove('prmDatabaseVersion', databaseVersion);\r\n }\r\n\r\n getPrmDatabaseBuild(): string | null {\r\n return this.get('prmDatabaseBuild');\r\n }\r\n\r\n setPrmDatabaseBuild(databaseBuild: string | null): void {\r\n this.setOrRemove('prmDatabaseBuild', databaseBuild);\r\n }\r\n\r\n getMobileAssemblyVersion(): string | null {\r\n return this.get('mobileAssemblyVerion');\r\n }\r\n\r\n setMobileAssemblyVersion(assemblyVersion: string | null): void {\r\n this.setOrRemove('mobileAssemblyVerion', assemblyVersion);\r\n }\r\n\r\n getSupportedFeatures(): string[] | null {\r\n return this.getObj('apiSupportedFeatures');\r\n }\r\n\r\n setSupportedFeatures(supportedFeatures: string[]): void {\r\n this.setOrRemoveObj('apiSupportedFeatures', supportedFeatures);\r\n }\r\n\r\n getDatabaseName(): string | null {\r\n return this.get('databasename');\r\n }\r\n\r\n setDatabaseName(databaseName: string | null): void {\r\n this.setOrRemove('databasename', databaseName);\r\n }\r\n\r\n getUserName(): string | null {\r\n return this.get('userName');\r\n }\r\n\r\n setUserName(userName: string): void {\r\n this.setOrRemove('userName', userName);\r\n }\r\n\r\n setSiteSettings(siteSettings: SiteSettingsDto): void {\r\n this.setOrRemoveObj('SiteSettings', siteSettings);\r\n }\r\n\r\n getSiteSettings(): SiteSettingsDto | null {\r\n return this.getObj('SiteSettings');\r\n }\r\n\r\n getUserPermissions(): { [key: string]: boolean } | null {\r\n return this.getObj('userPermissions');\r\n }\r\n\r\n setUserPermissions(permissions: { [key: string]: string }) {\r\n const mappedPermissions = this.mapPermissions(permissions);\r\n this.setObj('userPermissions', mappedPermissions);\r\n }\r\n\r\n private mapPermissions(permissions: any): any {\r\n const permissionObj: any = permissions || {};\r\n\r\n // fix the issue with the backend not returning actually bool values, for some properties here\r\n // it can return things like 'True' and 'False'\r\n // this will coerce those to actual bool values\r\n for (const prop in permissionObj) {\r\n if (trueRegex.test(permissionObj[prop])) {\r\n permissionObj[prop] = true;\r\n }\r\n else if (falseRegex.test(permissionObj[prop])) {\r\n permissionObj[prop] = false;\r\n }\r\n }\r\n\r\n return permissionObj;\r\n }\r\n\r\n getDashboardTileSettings(): ProviderDashboardSettingsDto | null {\r\n return this.getObj('settings.dashboard.tiles');\r\n }\r\n\r\n setDashboardTileSettings(settings: ProviderDashboardSettingsDto): void {\r\n return this.overwritePropertiesAndSave(() => this.getDashboardTileSettings(), settings, 'settings.dashboard.tiles');\r\n }\r\n\r\n setDefaultDashboardTileSettings(settings: ProviderDashboardSettingsDto): void {\r\n return this.defaultPropertiesAndSave(() => this.getDashboardTileSettings(), settings, 'settings.dashboard.tiles');\r\n }\r\n\r\n getAppointmentsListSettings(): AppointmentListSettings | null {\r\n return this.getObj('settings.appointmentslist');\r\n }\r\n\r\n setAppointmentsListSettings(settings: AppointmentListSettings): void {\r\n this.overwritePropertiesAndSave(() => this.getAppointmentsListSettings(), settings, 'settings.appointmentslist');\r\n }\r\n\r\n setDefaultAppointmentsListSettings(settings: AppointmentListSettings): void {\r\n this.defaultPropertiesAndSave(() => this.getAppointmentsListSettings(), settings, 'settings.appointmentslist');\r\n }\r\n\r\n getMessagesListSettings(): MessagesListSettings | null {\r\n return this.getObj('settings.messageslist');\r\n }\r\n\r\n setMessagesListSettings(settings: MessagesListSettings): void {\r\n return this.overwritePropertiesAndSave(() => this.getMessagesListSettings(), settings, 'settings.messageslist');\r\n }\r\n\r\n setDefaultMessagesListSettings(settings: MessagesListSettings): void {\r\n const messageSettings = this.getMessagesListSettings() as any;\r\n if (messageSettings?.messageFilterId) {\r\n // for legacy\r\n this.setOrRemoveObj('settings.messageslist', settings);\r\n } else {\r\n return this.defaultPropertiesAndSave(() => this.getMessagesListSettings(), settings, 'settings.messageslist');\r\n }\r\n }\r\n\r\n getAppointmentsBadgeSettings(): AppointmentsBadgeSettings | null {\r\n return this.getObj('settings.appointments.badge.settings');\r\n }\r\n\r\n setAppointmentsBadgeSettings(settings: AppointmentsBadgeSettings): void {\r\n this.overwritePropertiesAndSave(() => this.getAppointmentsBadgeSettings(), settings, 'settings.appointments.badge.settings');\r\n }\r\n\r\n setDefaultAppointmentsBadgeSettings(settings: AppointmentsBadgeSettings): void {\r\n this.defaultPropertiesAndSave(() => this.getAppointmentsBadgeSettings(), settings, 'settings.appointments.badge.settings');\r\n }\r\n\r\n getPhoneMessageGeneralNoteTypeId(): string | null {\r\n return this.get('settings.phoneMessageGeneralNoteTypeId');\r\n }\r\n\r\n setPhoneMessageGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.phoneMessageGeneralNoteTypeId', id);\r\n }\r\n\r\n getTaskMessageGeneralNoteTypeId(): string | null {\r\n return this.get('settings.taskMessageGeneralNoteTypeId');\r\n }\r\n\r\n setTaskMessageGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.taskMessageGeneralNoteTypeId', id);\r\n }\r\n\r\n getPharmacyGeneralNoteTypeId(): string | null {\r\n return this.get('settings.pharmacyGeneralNoteTypeId');\r\n }\r\n\r\n setPharmacyGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.pharmacyGeneralNoteTypeId', id);\r\n }\r\n\r\n getPortalMessageGeneralNoteTypeId(): string | null {\r\n return this.get('settings.portalMessageGeneralNoteTypeId');\r\n }\r\n\r\n setPortalMessageGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.portalMessageGeneralNoteTypeId', id);\r\n }\r\n\r\n getRxRefillMessageGeneralNoteTypeId(): string | null {\r\n return this.get('settings.rxRefillMessageGeneralNoteTypeId');\r\n }\r\n\r\n setRxRefillMessageGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.rxRefillMessageGeneralNoteTypeId', id);\r\n }\r\n\r\n getPharmacyRefillMessageGeneralNoteTypeId(): string | null {\r\n return this.get('settings.pharmacyRefillMessageGeneralNoteTypeId');\r\n }\r\n\r\n setPharmacyRefillMessageGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.pharmacyRefillMessageGeneralNoteTypeId', id);\r\n }\r\n\r\n getMedicationOverrideGeneralNoteTypeId(): string | null {\r\n return this.get('settings.medicationOverrideGeneralNoteTypeId');\r\n }\r\n\r\n setMedicationOverrideGeneralNoteTypeId(id: string | null): void {\r\n this.setOrRemove('settings.medicationOverrideGeneralNoteTypeId', id);\r\n }\r\n\r\n getPatientVitalsDefaultSettingId(): string | null {\r\n return this.get('settings.patientVitalsDefaultSettingId');\r\n }\r\n\r\n setPatientVitalsDefaultSettingId(id: string | null): void {\r\n this.setOrRemove('settings.patientVitalsDefaultSettingId', id);\r\n }\r\n\r\n getIsCacheUser(): boolean {\r\n const provSettings = this.getProviderSettings();\r\n const result = provSettings?.DesktopSettings?.IsCacheUser ?? false;\r\n return result;\r\n }\r\n\r\n getIsCacheClient(): boolean {\r\n return this.getObjOrDefault('settings.iscacheclient', false);\r\n }\r\n\r\n setIsCacheClient(isCacheClient: boolean): void {\r\n this.setObj('settings.iscacheclient', isCacheClient);\r\n }\r\n}\r\n","import {\r\n HttpClient,\r\n HttpContext,\r\n HttpHeaders,\r\n HttpParams,\r\n} from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { APRIMA_HTTP_CONTEXT_CACHE_INSTANCE } from '../http-interceptors/index';\r\nimport { AprimaCacheInstance } from './AprimaCacheService';\r\nimport { BridgeService } from './BridgeService';\r\nimport { BrowserService } from './BrowserService';\r\nimport { ConfigurationRepository } from './ConfigurationRepository';\r\nimport { WebCommonStorageRepository } from './WebCommonStorageRepository';\r\n\r\nexport interface ApRequestConfig {\r\n cache?: AprimaCacheInstance;\r\n ignoreCache?: boolean;\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AprimaHttpClientService {\r\n constructor(\r\n private bridge: BridgeService,\r\n private browserService: BrowserService,\r\n private configurationRepository: ConfigurationRepository,\r\n private httpClient: HttpClient,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n ) { }\r\n\r\n getFullUrl(endpointBase?: string, endpointUrl?: string): string {\r\n const urlComponents = [\r\n this.webCommonStorageRepository.getClientUrl(),\r\n 'api',\r\n ];\r\n if (endpointBase) {\r\n urlComponents.push(endpointBase);\r\n }\r\n urlComponents.push(this.configurationRepository.SERVER_API_VERSION);\r\n if (endpointUrl) {\r\n urlComponents.push(endpointUrl);\r\n }\r\n\r\n const baseUrl = urlComponents.join('/');\r\n return baseUrl;\r\n }\r\n\r\n private buildRequestParams(endpointBase: string, endpointUrl: string, params?: HttpParams, config?: ApRequestConfig) {\r\n const url = this.getFullUrl(endpointBase, endpointUrl);\r\n const jwt = this.webCommonStorageRepository.getJsonWebToken();\r\n const context = new HttpContext();\r\n let headers = new HttpHeaders({\r\n ApiKey: this.configurationRepository.API_KEY,\r\n });\r\n if (jwt != null) {\r\n headers = headers.append('Auth-Token', jwt);\r\n }\r\n\r\n if (this.browserService.shouldAlwaysIgnoreCache() || config?.ignoreCache) {\r\n this.bridge.fireEvent('clear-cache');\r\n headers = headers.append('Cache-Control', 'no-cache, no-store, must-revalidate');\r\n headers = headers.append('Pragma', 'no-cache');\r\n headers = headers.append('Expires', new Date().toString());\r\n } else if (config?.cache) {\r\n context.set(APRIMA_HTTP_CONTEXT_CACHE_INSTANCE, config.cache);\r\n }\r\n\r\n const options = {\r\n context,\r\n headers,\r\n params,\r\n };\r\n return {\r\n options,\r\n url,\r\n };\r\n }\r\n\r\n sendGetRequest<T>(endpointBase: string, endpointUrl: string, params?: HttpParams, config?: ApRequestConfig): Observable<T> {\r\n const requestParams = this.buildRequestParams(endpointBase, endpointUrl, params, config);\r\n return this.httpClient.get<T>(requestParams.url, requestParams.options);\r\n }\r\n\r\n sendPostRequest<T>(endpointBase: string, endpointUrl: string, body: any, params?: HttpParams): Observable<T> {\r\n const requestParams = this.buildRequestParams(endpointBase, endpointUrl, params);\r\n return this.httpClient.post<T>(requestParams.url, body, requestParams.options);\r\n }\r\n\r\n sendPutRequest<T>(endpointBase: string, endpointUrl: string, body: any, params?: HttpParams): Observable<T> {\r\n const requestParams = this.buildRequestParams(endpointBase, endpointUrl, params);\r\n return this.httpClient.put<T>(requestParams.url, body, requestParams.options);\r\n }\r\n\r\n sendDeleteRequest<T>(endpointBase: string, endpointUrl: string, params?: HttpParams): Observable<T> {\r\n const requestParams = this.buildRequestParams(endpointBase, endpointUrl, params);\r\n return this.httpClient.delete<T>(requestParams.url, requestParams.options);\r\n }\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { TranslateHttpLoader } from '@ngx-translate/http-loader';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AprimaTranslateLoader extends TranslateHttpLoader {\r\n constructor(httpClient: HttpClient) {\r\n super(httpClient);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport {\r\n ConfigurationRepository,\r\n} from './ConfigurationRepository';\r\n\r\nimport { DeviceSettings } from 'webcommon/shared';\r\nimport { BrowserService } from './BrowserService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DeviceSettingsRepository implements DeviceSettings {\r\n static readonly ajsFactoryName = 'DeviceSettingsRepository';\r\n\r\n constructor(\r\n private browserService: BrowserService,\r\n private configurationRepository: ConfigurationRepository,\r\n ) { }\r\n\r\n private deviceSettings: DeviceSettings | null = null;\r\n\r\n loadConfiguration(configuration: DeviceSettings): void {\r\n if (this.deviceSettings !== null) {\r\n throw new Error('deviceSettings has already been loaded');\r\n }\r\n this.deviceSettings = configuration;\r\n }\r\n\r\n // Fill in DeviceSettings based on the current browser environment\r\n // (navigator.userAgent, navigator.platform, etc)\r\n loadBasedOnBrowser(): void {\r\n // overrides provided for easy testing in a browser. Do not ever commit changes with true values for these properties.\r\n const isPhoneOverride = false;\r\n const isTabletOverride = false;\r\n const isBrowserOverride = false;\r\n\r\n const browserConfig = this.browserService.getConfig();\r\n const isIos = browserConfig.isIosOS;\r\n const isAndroid = browserConfig.isAndroidOS;\r\n const isPhone = browserConfig.isPhone;\r\n const isTablet = browserConfig.isTablet;\r\n const isDevice = browserConfig.isMobileDevice;\r\n\r\n const isBrowser = !isDevice;\r\n const isStandaloneBrowser = isBrowser || this.configurationRepository.DEV_HOSTED;\r\n\r\n const configuration: DeviceSettings = {\r\n isBrowser,\r\n isBrowserOrOverride: isBrowser || isBrowserOverride,\r\n isDevice,\r\n isDeviceOrOverride: isDevice || isPhoneOverride || isTabletOverride,\r\n isPhone,\r\n isPhoneOrOverride: isPhone || isPhoneOverride,\r\n isTablet,\r\n isTabletOrOverride: isTablet || isTabletOverride,\r\n\r\n isAndroid,\r\n isIos,\r\n isPrm: false,\r\n isStandaloneBrowser,\r\n };\r\n this.loadConfiguration(configuration);\r\n }\r\n\r\n private validateConfiguration(): DeviceSettings {\r\n if (this.deviceSettings === null) {\r\n throw new Error('deviceSettings has not been loaded');\r\n }\r\n return this.deviceSettings;\r\n }\r\n\r\n public get isDevice(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isDevice;\r\n }\r\n\r\n public get isDeviceOrOverride(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isDeviceOrOverride;\r\n }\r\n\r\n public get isPhone(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isPhone;\r\n }\r\n\r\n public get isPhoneOrOverride(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isPhoneOrOverride;\r\n }\r\n\r\n public get isTablet(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isTablet;\r\n }\r\n\r\n public get isTabletOrOverride(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isTabletOrOverride;\r\n }\r\n\r\n public get isBrowser(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isBrowser;\r\n }\r\n\r\n public get isBrowserOrOverride(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isBrowserOrOverride;\r\n }\r\n\r\n public get isIos(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isIos;\r\n }\r\n\r\n public get isAndroid(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isAndroid;\r\n }\r\n\r\n public get isPrm(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isPrm;\r\n }\r\n\r\n public get isStandaloneBrowser(): boolean {\r\n const deviceSettings = this.validateConfiguration();\r\n return deviceSettings.isStandaloneBrowser;\r\n }\r\n\r\n // This should correspond to the environment when the app is hosted inside of prm,\r\n // which can affect how things like sigwriter or fnc plan work.\r\n // Currently though, this property is passed into the plan and sigwriter\r\n // via a binding that is just always set to true in PrmWeb.\r\n // If this doesn't cover all cases, then it could be updated.\r\n public get hostedFromDesktop(): boolean {\r\n return this.isPrm && !this.isStandaloneBrowser;\r\n }\r\n\r\n // ported from old BrowserService.js\r\n // TODO: this should really be determined based on whether the OS is Android or iOS,\r\n // not just whether we are in the Android app or iOS app, which is what the logic is currently.\r\n // It was left this way when being ported from angularjs to keep the logic consistent for now, but should be refactored at some point.\r\n supportsInlinePdf(): boolean {\r\n if (!this.browserService.supportsInlinePdf() || this.isIos || this.isAndroid) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { AprimaTransitionRequest } from 'webcommon/shared';\r\n\r\nimport { DeviceSettingsRepository } from './DeviceSettingsRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class LogInService {\r\n static readonly ajsFactoryName = 'LogInService';\r\n\r\n private redirectState = 'landing';\r\n private redirectParams: any | null = null;\r\n private isCustomRedirect = false;\r\n private customTransition: AprimaTransitionRequest | undefined;\r\n\r\n constructor(\r\n private deviceSettingsRepository: DeviceSettingsRepository,\r\n ) {\r\n }\r\n\r\n setDefaultRedirect(): void {\r\n this.isCustomRedirect = false;\r\n\r\n if (!this.deviceSettingsRepository.isDevice) {\r\n this.redirectState = 'landing';\r\n }\r\n else {\r\n this.redirectState = 'dashboard';\r\n }\r\n\r\n this.redirectParams = null;\r\n }\r\n\r\n setRedirect(transition: AprimaTransitionRequest): void {\r\n this.isCustomRedirect = true;\r\n this.customTransition = transition;\r\n\r\n if (!this.customTransition.opts) {\r\n this.customTransition.opts = {\r\n replaceCurrentState: true,\r\n };\r\n } else {\r\n this.customTransition.opts.replaceCurrentState = true;\r\n }\r\n }\r\n\r\n getRedirect(): AprimaTransitionRequest {\r\n if (this.isCustomRedirect && this.customTransition) {\r\n return this.customTransition;\r\n }\r\n\r\n const redirect = {\r\n appRoute: this.redirectState,\r\n opts: this.redirectParams || {},\r\n };\r\n\r\n redirect.opts.replaceCurrentState = true;\r\n\r\n return redirect;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { AprimaAnalyticsService } from './AprimaAnalyticsService';\r\nimport { BridgeService } from './BridgeService';\r\nimport { WebCommonStorageRepository } from './WebCommonStorageRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class LogOffService {\r\n static readonly ajsFactoryName = 'LogOffService';\r\n\r\n constructor(\r\n private aprimaAnalyticsService: AprimaAnalyticsService,\r\n private bridge: BridgeService,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n ) {\r\n }\r\n\r\n logoff() {\r\n this.webCommonStorageRepository.removeJsonWebToken();\r\n this.webCommonStorageRepository.removeUserId();\r\n this.aprimaAnalyticsService.sendEvent('user', 'click', 'logoff', '0');\r\n\r\n this.bridge.fireEvent('logoff', {\r\n message: 'logoff',\r\n });\r\n\r\n return Promise.resolve();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport {\r\n AprimaTransitionRequest,\r\n TransitionManager,\r\n} from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class TransitionManagerService implements TransitionManager {\r\n static readonly ajsFactoryName = 'TransitionManager';\r\n\r\n private transitionManager: TransitionManager | null = null;\r\n\r\n public loadConfiguration(configuration: TransitionManager): void {\r\n if (this.transitionManager !== null) {\r\n throw new Error('transitionManager has already been set');\r\n }\r\n this.transitionManager = configuration;\r\n }\r\n\r\n private validateConfiguration(): TransitionManager {\r\n if (this.transitionManager === null) {\r\n throw new Error('transitionManager has not been set');\r\n }\r\n return this.transitionManager;\r\n }\r\n\r\n public transition(transition: AprimaTransitionRequest, replaceState?: boolean): boolean {\r\n const transitionManager = this.validateConfiguration();\r\n return transitionManager.transition(transition, replaceState);\r\n }\r\n\r\n replaceCurrentState(transition: AprimaTransitionRequest): void {\r\n const transitionManager = this.validateConfiguration();\r\n transitionManager.replaceCurrentState(transition);\r\n }\r\n\r\n goBack(): void {\r\n const transitionManager = this.validateConfiguration();\r\n transitionManager.goBack();\r\n }\r\n\r\n getPreviousTransition(): AprimaTransitionRequest {\r\n const transitionManager = this.validateConfiguration();\r\n return transitionManager.getPreviousTransition();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { LogInService } from './LogInService';\r\nimport { LogOffService } from './LogOffService';\r\nimport { TransitionManagerService } from './TransitionManagerService';\r\nimport { WebCommonStorageRepository } from './WebCommonStorageRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class CurrentUserService {\r\n static readonly ajsFactoryName = 'CurrentUser';\r\n\r\n constructor(\r\n private logInService: LogInService,\r\n private logOffService: LogOffService,\r\n private transitionManagerService: TransitionManagerService,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n ) {\r\n }\r\n\r\n forceLogoffUser(): void {\r\n const previousTransition = this.transitionManagerService.getPreviousTransition();\r\n this.logInService.setRedirect(previousTransition);\r\n\r\n this.logOffService.logoff().then(() => {\r\n this.transitionManagerService.transition({appRoute: 'login', opts: {replaceCurrentState: true}});\r\n });\r\n }\r\n\r\n isAuthenticated(): boolean {\r\n const jwt = this.webCommonStorageRepository.getJsonWebToken();\r\n return !!jwt;\r\n }\r\n\r\n get() {\r\n return {\r\n name: this.webCommonStorageRepository.getUserName(),\r\n fullName: this.webCommonStorageRepository.getUserFullName(),\r\n userId: this.webCommonStorageRepository.getUserId(),\r\n token: this.webCommonStorageRepository.getJsonWebToken(),\r\n clientId: this.webCommonStorageRepository.getClientId(),\r\n clientURL: this.webCommonStorageRepository.getClientUrl(),\r\n deviceId: this.webCommonStorageRepository.getDeviceId(),\r\n permissions: this.webCommonStorageRepository.getUserPermissions(),\r\n };\r\n }\r\n}\r\n","\r\nexport abstract class ErrorServiceUpgrade {\r\n abstract convertToErrorMessages(\r\n error: unknown,\r\n ): string[];\r\n}\r\n\r\nexport function ErrorServiceFactory(i: angular.auto.IInjectorService) {\r\n return i.get<ErrorServiceUpgrade>('ErrorService');\r\n}\r\n\r\nexport const ErrorServiceAjsProvider = {\r\n deps: ['$injector'],\r\n provide: ErrorServiceUpgrade,\r\n useFactory: ErrorServiceFactory,\r\n};\r\n","import { Injectable } from '@angular/core';\r\nimport {intersection, isArray} from 'lodash-es';\r\n\r\nimport { WebCommonStorageRepository } from './WebCommonStorageRepository';\r\nimport {\r\n ServerFeature,\r\n} from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ServerInfoRepository {\r\n static readonly ajsFactoryName = 'ServerInfoRepository';\r\n\r\n constructor(\r\n private readonly webCommonStorageRepository: WebCommonStorageRepository,\r\n ) {\r\n }\r\n\r\n // ==========================================================================================\r\n // All of this below is currently used in angularjs as well, so be careful when changing the interface of it.\r\n getPrmAssemblyVersion(): string | null {\r\n return this.webCommonStorageRepository.getPrmAssemblyVersion();\r\n }\r\n\r\n setPrmAssemblyVersion(assemblyVersion: string | null): void {\r\n this.webCommonStorageRepository.setPrmAssemblyVersion(assemblyVersion);\r\n }\r\n\r\n getPrmDatabaseVersion(): string | null {\r\n return this.webCommonStorageRepository.getPrmDatabaseVersion();\r\n }\r\n\r\n setPrmDatabaseVersion(databaseVersion: string | null): void {\r\n this.webCommonStorageRepository.setPrmDatabaseVersion(databaseVersion);\r\n }\r\n\r\n getPrmDatabaseBuild(): string | null {\r\n return this.webCommonStorageRepository.getPrmDatabaseBuild();\r\n }\r\n\r\n setPrmDatabaseBuild(databaseBuild: string | null): void {\r\n this.webCommonStorageRepository.setPrmDatabaseBuild(databaseBuild);\r\n }\r\n\r\n getMobileAssemblyVersion(): string | null {\r\n return this.webCommonStorageRepository.getMobileAssemblyVersion();\r\n }\r\n\r\n setMobileAssemblyVersion(assemblyVersion: string | null): void {\r\n this.webCommonStorageRepository.setMobileAssemblyVersion(assemblyVersion);\r\n }\r\n\r\n getSupportedFeatures(): string[] | null {\r\n return this.webCommonStorageRepository.getSupportedFeatures();\r\n }\r\n\r\n setSupportedFeatures(supportedFeatures: string[]): void {\r\n this.webCommonStorageRepository.setSupportedFeatures(supportedFeatures);\r\n }\r\n\r\n getDatabaseName(): string | null {\r\n return this.webCommonStorageRepository.getDatabaseName();\r\n }\r\n\r\n setDatabaseName(databaseName: string | null): void {\r\n this.webCommonStorageRepository.setDatabaseName(databaseName);\r\n }\r\n\r\n isFeatureSupported(features: string[] | string): boolean {\r\n const supportedFeatures = this.getSupportedFeatures();\r\n if (!supportedFeatures) {\r\n return false;\r\n }\r\n\r\n const featuresToCheck = isArray(features) ? features : [features];\r\n const matchedValues = intersection(featuresToCheck, supportedFeatures);\r\n\r\n return matchedValues.length === featuresToCheck.length;\r\n }\r\n\r\n // End of stuff currently used in angularjs\r\n // ==========================================================================================\r\n\r\n isSupported(...features: ServerFeature[]): boolean {\r\n const supportedFeatures = this.getSupportedFeatures();\r\n if (!supportedFeatures) {\r\n return false;\r\n }\r\n\r\n const featureStrings = features.map((x) => ServerFeature[x]);\r\n const matchedValues = intersection(featureStrings, supportedFeatures);\r\n\r\n return matchedValues.length === features.length;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { PortalUrlComponents } from 'webcommon/shared';\r\n\r\nimport { BrowserService } from './BrowserService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class UrlParsingService {\r\n static readonly ajsFactoryName = 'UrlParsingService';\r\n\r\n constructor(\r\n browserService: BrowserService,\r\n ) {\r\n this.locationObj = browserService.getLocation();\r\n }\r\n\r\n private locationObj: Location;\r\n\r\n getParameterByName(name: string): string {\r\n const regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\r\n const results = regex.exec(this.locationObj.search);\r\n\r\n return results == null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\r\n }\r\n\r\n parsePortalUrl(marker: string): Promise<PortalUrlComponents> {\r\n const url = this.locationObj.href;\r\n const markerIndex = url.indexOf(marker);\r\n const restOfUrlIndex = markerIndex + marker.length;\r\n if (markerIndex > 0 && restOfUrlIndex < url.length) {\r\n const hostUrl = url.substring(0, markerIndex);\r\n const restOfUrl = url.substring(restOfUrlIndex);\r\n const firstSlashIndex = restOfUrl.indexOf('/');\r\n if (firstSlashIndex > 0) {\r\n const clientId = restOfUrl.substring(0, firstSlashIndex);\r\n const clientConfig = {\r\n clientId,\r\n hostUrl,\r\n };\r\n return Promise.resolve(clientConfig);\r\n }\r\n }\r\n return Promise.reject();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport {\r\n AppRoute,\r\n AprimaTransitionRequest,\r\n WebViewManager,\r\n} from 'webcommon/shared';\r\n\r\nimport {\r\n DeviceSettingsRepository,\r\n} from './DeviceSettingsRepository';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WebViewManagerService implements WebViewManager {\r\n static readonly ajsFactoryName = 'WebViewManager';\r\n\r\n private webViewManager: WebViewManager | null = null;\r\n\r\n constructor(\r\n private deviceSettingsRepository: DeviceSettingsRepository,\r\n ) {\r\n\r\n }\r\n\r\n loadConfiguration(browserWebViewManager: WebViewManager, hostedWebViewManager: WebViewManager): void {\r\n if (this.webViewManager !== null) {\r\n throw new Error('webViewManager has already been set');\r\n }\r\n\r\n if (this.deviceSettingsRepository.isStandaloneBrowser) {\r\n // tslint:disable-next-line:no-console\r\n console.info('Using browser WebViewManager for standalone browser');\r\n this.webViewManager = browserWebViewManager;\r\n } else if (this.deviceSettingsRepository.isDevice || this.deviceSettingsRepository.isPrm) {\r\n // tslint:disable-next-line:no-console\r\n console.info('Using hosted WebViewManager');\r\n this.webViewManager = hostedWebViewManager;\r\n } else {\r\n // tslint:disable-next-line:no-console\r\n console.info('Using browser WebViewManager');\r\n this.webViewManager = browserWebViewManager;\r\n }\r\n }\r\n\r\n private validateConfiguration(): WebViewManager {\r\n if (this.webViewManager === null) {\r\n throw new Error('webViewManager has not been set');\r\n }\r\n return this.webViewManager;\r\n }\r\n\r\n activateView(appRoute: AppRoute, transition: AprimaTransitionRequest): boolean {\r\n const webViewManager = this.validateConfiguration();\r\n return webViewManager.activateView(appRoute, transition);\r\n }\r\n\r\n goBack(): void {\r\n const webViewManager = this.validateConfiguration();\r\n webViewManager.goBack();\r\n }\r\n}\r\n","// This has to be used as:\r\n// a provider for a component that extends UpgradeComponent\r\n// or\r\n// a provider for the module that such component is declared in\r\n// or\r\n// a provider inside the Injector that is passed into the constructor of UpgradeComponent.\r\n// HOWEVER, This is only necessary if the UpgradeComponent is loaded dynamically though,\r\n// like by a component modal loaded by ngx-boostrap.\r\n// Using ApModalService will handle this properly though, so that this doesn't need to be used anywhere else for now.\r\nexport const ScopeProvider = {\r\n deps: ['$injector'],\r\n provide: '$scope',\r\n useFactory: scopeFunction,\r\n};\r\n\r\nexport function scopeFunction(i: angular.auto.IInjectorService) {\r\n return i.get('$rootScope').$new();\r\n}\r\n","export abstract class UnitConversionServiceUpgrade {\r\n abstract usToKg(lbs: any, oz: any): any;\r\n abstract usToKgRounded(lbs: any, oz: any): any;\r\n abstract roundKg(kg: any): any;\r\n abstract usToCm(ft: any, inches: any): any;\r\n abstract usToCmRounded(ft: any, inches: any): any;\r\n abstract roundCm(cm: any): any;\r\n abstract kgToUs(kg: any): {pounds: number, ounces: any};\r\n abstract kgToUsRounded(kg: any): {ounces: number, pounds: any};\r\n abstract cmToUsRounded(cm: any): {feet: number, inches: any};\r\n abstract cmToUs(cm: any): {feet: number, inches: any};\r\n abstract getBodySurfaceArea(heightCm: any, weightKg: any): any;\r\n}\r\n\r\nexport function UnitConversionServiceFactory(i: angular.auto.IInjectorService) {\r\n return i.get<UnitConversionServiceUpgrade>('UnitConvert');\r\n}\r\n\r\nexport const UnitConversionServiceAjsProvider = {\r\n deps: ['$injector'],\r\n provide: UnitConversionServiceUpgrade,\r\n useFactory: UnitConversionServiceFactory,\r\n};\r\n","import { HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {AprimaHttpClientService, ApRequestConfig} from 'webcommon/legacy-common';\r\n\r\nconst endpointBase = '';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PrmHttpClientService {\r\n constructor(\r\n private aprimaHttpClientService: AprimaHttpClientService,\r\n ) { }\r\n\r\n getFullUrl(endpointUrl?: string): string {\r\n const baseUrl = this.aprimaHttpClientService.getFullUrl(endpointBase, endpointUrl);\r\n return baseUrl;\r\n }\r\n\r\n sendGetRequest<T>(endpointUrl: string, params?: HttpParams, config?: ApRequestConfig): Observable<T> {\r\n return this.aprimaHttpClientService.sendGetRequest<T>(endpointBase, endpointUrl, params, config);\r\n }\r\n\r\n sendPostRequest<T>(endpointUrl: string, body: any, params?: HttpParams): Observable<T> {\r\n return this.aprimaHttpClientService.sendPostRequest<T>(endpointBase, endpointUrl, body, params);\r\n }\r\n\r\n sendPutRequest<T>(endpointUrl: string, body: any, params?: HttpParams): Observable<T> {\r\n return this.aprimaHttpClientService.sendPutRequest<T>(endpointBase, endpointUrl, body, params);\r\n }\r\n\r\n sendDeleteRequest<T>(endpointUrl: string, params?: HttpParams): Observable<T> {\r\n return this.aprimaHttpClientService.sendDeleteRequest<T>(endpointBase, endpointUrl, params);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport {\r\n AdvancedDirectiveAttachmentGroupDto,\r\n AttachmentDto,\r\n AttachmentHandlerOptionsDto,\r\n AttachmentRequestConfig,\r\n EditAttachmentDto,\r\n PatientAttachmentGroupDto,\r\n} from 'webcommon/shared';\r\nimport { PrmHttpClientService } from '../PrmHttpClientService';\r\n\r\nimport { DeviceSettingsRepository } from 'webcommon/legacy-common';\r\n\r\nimport { HttpParams } from '@angular/common/http';\r\n\r\n// not sure where else to put this for now, but it could certainly be moved\r\nexport const AttachmentHandlerSignatureAQN = 'iMedica.Prm.Client.UI.Attachments.ControlAttachment_SignatureViewer';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AttachmentRepository {\r\n constructor(\r\n private httpClientService: PrmHttpClientService,\r\n private readonly deviceSettingsRepository: DeviceSettingsRepository,\r\n ) {\r\n }\r\n\r\n getAttachmentGroup(attachmentGroupId: string): Observable<PatientAttachmentGroupDto> {\r\n const endpointUrl = `fnd/attachmentgroupdetail/${attachmentGroupId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n // retainPdfFormat means don't convert pdfs to images\r\n getAttachment(attachmentId: string, requestConfig: AttachmentRequestConfig, retainPdfFormat?: boolean): Observable<AttachmentDto> {\r\n // the default logic is that it will only convert the pdfs if on Android\r\n const retainPdf = retainPdfFormat === undefined ? !this.deviceSettingsRepository.isAndroid : retainPdfFormat;\r\n let params = new HttpParams({ fromObject: requestConfig as any });\r\n params = params.set('inLinePDF', retainPdf.toString());\r\n params = params.set('forceDBRead', 'true');\r\n const endpointUrl = `attachments/${attachmentId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl, params);\r\n }\r\n\r\n getAttachmentStaticUrl(attachmentId: string): Observable<string> {\r\n const endpointUrl = `attachments-url/${attachmentId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n setAttachmentContent(attachmentId: string, editAttachmentDto: EditAttachmentDto): Observable<string> {\r\n const endpointUrl = `attachments/${attachmentId}/save`;\r\n return this.httpClientService.sendPostRequest(endpointUrl, editAttachmentDto);\r\n }\r\n\r\n getAttachmentContent(attachmentId: string): Observable<AttachmentDto> {\r\n const endpointUrl = `attachments/${attachmentId}/content`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getPatientAdvancedDirective(patientId: string): Observable<AdvancedDirectiveAttachmentGroupDto> {\r\n const endpointUrl = `fnd/patients/${patientId}/advanced-directive`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getAttachmentHandler(documentId: string): Observable<AttachmentHandlerOptionsDto> {\r\n const endpointUrl = `attachment-handler/${documentId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getAttachmentContentRaw(documentId: string): Observable<string> {\r\n const endpointUrl = `attachments/${documentId}/content-raw`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { FoxitLicenseDto } from 'webcommon/shared';\r\nimport { PrmHttpClientService } from '../PrmHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class FoxitLicenseRepository {\r\n constructor(\r\n private httpClientService: PrmHttpClientService,\r\n ) {\r\n }\r\n\r\n getFoxitLicense(\r\n licenseSNId: string, licenseKeyId: string,\r\n defaultToolId: string, defaultViewModeId: string,\r\n ): Observable<FoxitLicenseDto> {\r\n const endpointUrl = `foxitLicense/${licenseSNId}/${licenseKeyId}/${defaultToolId}/${defaultViewModeId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n}\r\n","import { HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {ApRequestConfig, AprimaHttpClientService} from 'webcommon/legacy-common';\r\n\r\nconst endpointBase = 'patient';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PatientPortalHttpClientService {\r\n constructor(\r\n private aprimaHttpClientService: AprimaHttpClientService,\r\n ) { }\r\n\r\n getFullUrl(endpointUrl?: string): string {\r\n const baseUrl = this.aprimaHttpClientService.getFullUrl(endpointBase, endpointUrl);\r\n return baseUrl;\r\n }\r\n\r\n sendGetRequest<T>(endpointUrl: string, params?: HttpParams, config?: ApRequestConfig): Observable<T> {\r\n return this.aprimaHttpClientService.sendGetRequest<T>(endpointBase, endpointUrl, params, config);\r\n }\r\n\r\n sendPostRequest<T>(endpointUrl: string, body: any, params?: HttpParams): Observable<T> {\r\n return this.aprimaHttpClientService.sendPostRequest<T>(endpointBase, endpointUrl, body, params);\r\n }\r\n}\r\n","import { HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport {\r\n AttachmentDto,\r\n DownloadableDocument,\r\n PatientPortalAttachmentDto,\r\n} from 'webcommon/shared';\r\nimport { PatientDocumentSet } from 'webcommon/shared';\r\nimport { PatientPortalHttpClientService } from '../PatientPortalHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PatientPortalAttachmentRepository {\r\n constructor(\r\n private httpClientService: PatientPortalHttpClientService\r\n ) {\r\n }\r\n\r\n getDocumentList(patientId: string): Observable<PatientDocumentSet> {\r\n const endpointUrl = `/person/${patientId}/documents`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getAttachmentContent(patientId: string, attachmentId: string): Observable<PatientPortalAttachmentDto> {\r\n const endpointUrl = `person/${patientId}/attachment/${attachmentId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getAttachmentForViewing(\r\n patientId: string,\r\n attachmentId: string,\r\n height: number,\r\n width: number,\r\n page: number,\r\n ): Observable<AttachmentDto> {\r\n const httpParams = new HttpParams()\r\n .append('height', height.toString())\r\n .append('width', width.toString())\r\n .append('page', page.toString());\r\n const endpointUrl = `person/${patientId}/view-attachment/${attachmentId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl, httpParams);\r\n }\r\n\r\n getAttachmentForDownload(\r\n patientId: string,\r\n attachmentId: string\r\n ): Observable<DownloadableDocument> {\r\n const endpointUrl = `person/${patientId}/download-attachment/${attachmentId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { ProviderDto, ProviderSignatureDto } from 'webcommon/shared';\r\nimport { PrmHttpClientService } from '../PrmHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ProviderRepository {\r\n constructor(\r\n private httpClientService: PrmHttpClientService,\r\n ) { }\r\n\r\n getProviders(): Observable<ProviderDto[]> {\r\n const endpointUrl = `providers`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getProvidersInternal(): Observable<ProviderDto[]> {\r\n const endpointUrl = `providersInternal`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n GetCurrentProviderSigningSignature(): Observable<ProviderSignatureDto> {\r\n const endpointUrl = `provider/signing-signature`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n getProviderCCMLicensing(): Observable<boolean> {\r\n const endpointUrl = `provider/licensed-ccm-cpo-professional`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n}\r\n","import { HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {\r\n AprimaCacheInstance,\r\n} from 'webcommon/legacy-common';\r\nimport { PrmHttpClientService } from '../PrmHttpClientService';\r\n\r\n@Injectable({\r\nprovidedIn: 'root',\r\n})\r\nexport class ListRepository {\r\n static readonly ajsFactoryName = 'ListRepository';\r\n\r\n constructor(\r\n private httpClientService: PrmHttpClientService,\r\n ) { }\r\n\r\n getListJs(listName: string, params?: any, cache?: AprimaCacheInstance): Promise<any> {\r\n return this.getList(listName, params, cache).toPromise();\r\n }\r\n\r\n getList(listName: any, params?: any, cache?: AprimaCacheInstance): Observable<any> {\r\n const endpointUrl = 'lists/' + listName;\r\n let httpParams: HttpParams | undefined;\r\n if (params) {\r\n httpParams = new HttpParams({ fromObject: params });\r\n }\r\n return this.httpClientService.sendGetRequest(endpointUrl, httpParams, { cache });\r\n }\r\n}\r\n","import { HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {\r\n ApplyPaymentToAppointmentRequestDto,\r\n PaymentResponseDto,\r\n ReceiptDto,\r\n ReceiptRequestDto,\r\n TelehealthBillingOptionsDto,\r\n} from 'webcommon/shared';\r\nimport { PatientPortalHttpClientService } from '../PatientPortalHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class BillingRepository {\r\n constructor(\r\n private readonly httpClientService: PatientPortalHttpClientService,\r\n ) { }\r\n\r\n getTelehealthBilling(appointmentId: string, redirectUrl: string): Observable<TelehealthBillingOptionsDto> {\r\n const endpointUrl = `billing/telehealth/${appointmentId}/payment-options`;\r\n const params = new HttpParams({fromObject: {redirectUrl}});\r\n\r\n return this.httpClientService.sendGetRequest(endpointUrl, params);\r\n }\r\n\r\n postApplyTelehealthPayment( request: ApplyPaymentToAppointmentRequestDto): Observable<PaymentResponseDto> {\r\n const endpointUrl = `billing/${request.LoginUserPatientId}/apply-appointment-payment`;\r\n return this.httpClientService.sendPostRequest(endpointUrl, request);\r\n }\r\n\r\n getReceiptHtml(request: ReceiptRequestDto): Observable<ReceiptDto> {\r\n const endpointUrl = `billing/${request.LoginUserPatientId}/receipt`;\r\n const params = new HttpParams({fromObject: request as any});\r\n\r\n return this.httpClientService.sendGetRequest(endpointUrl, params);\r\n }\r\n}\r\n","import { HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {\r\n LoginAssistanceDto,\r\n LoginAssistanceResultDto,\r\n} from 'webcommon/shared';\r\nimport { PatientPortalHttpClientService } from '../PatientPortalHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class LoginAssistanceRepository {\r\n static readonly ajsFactoryName = 'NgxLoginAssistanceRepository';\r\n\r\n constructor(\r\n private httpClientService: PatientPortalHttpClientService,\r\n ) { }\r\n\r\n getLoginAssistanceInformation(request: LoginAssistanceDto): Observable<LoginAssistanceResultDto> {\r\n const params = new HttpParams({ fromObject: request as any });\r\n return this.httpClientService.sendGetRequest('login/login-assistance', params);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { PatientLoginInfoDto, TelehealthAppointmentLoginDto } from 'webcommon/shared';\r\nimport { PatientPortalHttpClientService } from '../PatientPortalHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class TelehealthRepository {\r\n constructor(\r\n private readonly httpClientService: PatientPortalHttpClientService,\r\n ) { }\r\n\r\n postTelehealthLogin( request: TelehealthAppointmentLoginDto): Observable<PatientLoginInfoDto> {\r\n const endpointUrl = `telehealth-appointment-login`;\r\n return this.httpClientService.sendPostRequest(endpointUrl, request);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport {\r\n PatientIdentityResponseDto,\r\n} from 'webcommon/shared';\r\nimport { PatientPortalHttpClientService } from '../PatientPortalHttpClientService';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PatientIdentityRepository {\r\n constructor(\r\n private readonly httpClientService: PatientPortalHttpClientService,\r\n ) { }\r\n\r\n getPersonIdentitySubject(personId: string): Observable<PatientIdentityResponseDto> {\r\n const endpointUrl = `identity/person/${personId}`;\r\n return this.httpClientService.sendGetRequest(endpointUrl);\r\n }\r\n\r\n registerPersonIdentity(personId: string): Observable<PatientIdentityResponseDto> {\r\n const endpointUrl = `identity/person/${personId}/register`;\r\n return this.httpClientService.sendPostRequest(endpointUrl, null);\r\n }\r\n}\r\n","import { Observable } from '../Observable';\nimport { isArray } from '../util/isArray';\nimport { isFunction } from '../util/isFunction';\nimport { NodeEventHandler } from './fromEvent';\nimport { map } from '../operators/map';\n\n/* tslint:disable:max-line-length */\nexport function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void): Observable<T>;\n/** @deprecated resultSelector no longer supported, pipe to map instead */\nexport function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable<T>;\n/* tslint:enable:max-line-length */\n\n/**\n * Creates an Observable from an arbitrary API for registering event handlers.\n *\n * <span class=\"informal\">When that method for adding event handler was something {@link fromEvent}\n * was not prepared for.</span>\n *\n * \n *\n * `fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions\n * for events. It is similar to {@link fromEvent}, but far\n * more flexible. In fact, all use cases of {@link fromEvent} could be easily handled by\n * `fromEventPattern` (although in slightly more verbose way).\n *\n * This operator accepts as a first argument an `addHandler` function, which will be injected with\n * handler parameter. That handler is actually an event handler function that you now can pass\n * to API expecting it. `addHandler` will be called whenever Observable\n * returned by the operator is subscribed, so registering handler in API will not\n * necessarily happen when `fromEventPattern` is called.\n *\n * After registration, every time an event that we listen to happens,\n * Observable returned by `fromEventPattern` will emit value that event handler\n * function was called with. Note that if event handler was called with more\n * then one argument, second and following arguments will not appear in the Observable.\n *\n * If API you are using allows to unregister event handlers as well, you can pass to `fromEventPattern`\n * another function - `removeHandler` - as a second parameter. It will be injected\n * with the same handler function as before, which now you can use to unregister\n * it from the API. `removeHandler` will be called when consumer of resulting Observable\n * unsubscribes from it.\n *\n * In some APIs unregistering is actually handled differently. Method registering an event handler\n * returns some kind of token, which is later used to identify which function should\n * be unregistered or it itself has method that unregisters event handler.\n * If that is the case with your API, make sure token returned\n * by registering method is returned by `addHandler`. Then it will be passed\n * as a second argument to `removeHandler`, where you will be able to use it.\n *\n * If you need access to all event handler parameters (not only the first one),\n * or you need to transform them in any way, you can call `fromEventPattern` with optional\n * third parameter - project function which will accept all arguments passed to\n * event handler when it is called. Whatever is returned from project function will appear on\n * resulting stream instead of usual event handlers first argument. This means\n * that default project can be thought of as function that takes its first parameter\n * and ignores the rest.\n *\n * ## Example\n * ### Emits clicks happening on the DOM document\n *\n * ```ts\n * import { fromEventPattern } from 'rxjs';\n *\n * function addClickHandler(handler) {\n * document.addEventListener('click', handler);\n * }\n *\n * function removeClickHandler(handler) {\n * document.removeEventListener('click', handler);\n * }\n *\n * const clicks = fromEventPattern(\n * addClickHandler,\n * removeClickHandler\n * );\n * clicks.subscribe(x => console.log(x));\n *\n * // Whenever you click anywhere in the browser, DOM MouseEvent\n * // object will be logged.\n * ```\n *\n * ## Example\n * ### Use with API that returns cancellation token\n *\n * ```ts\n * import { fromEventPattern } from 'rxjs';\n *\n * const token = someAPI.registerEventHandler(function() {});\n * someAPI.unregisterEventHandler(token); // this APIs cancellation method accepts\n * // not handler itself, but special token.\n *\n * const someAPIObservable = fromEventPattern(\n * function(handler) { return someAPI.registerEventHandler(handler); }, // Note that we return the token here...\n * function(handler, token) { someAPI.unregisterEventHandler(token); } // ...to then use it here.\n * );\n * ```\n *\n * ## Example\n * ### Use with project function\n *\n * ```ts\n * import { fromEventPattern } from 'rxjs';\n *\n * someAPI.registerEventHandler((eventType, eventMessage) => {\n * console.log(eventType, eventMessage); // Logs \"EVENT_TYPE\" \"EVENT_MESSAGE\" to console.\n * });\n *\n * const someAPIObservable = fromEventPattern(\n * handler => someAPI.registerEventHandler(handler),\n * handler => someAPI.unregisterEventHandler(handler)\n * (eventType, eventMessage) => eventType + \" --- \" + eventMessage // without that function only \"EVENT_TYPE\"\n * ); // would be emitted by the Observable\n *\n * someAPIObservable.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"EVENT_TYPE --- EVENT_MESSAGE\"\n * ```\n *\n * @see {@link fromEvent}\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n *\n * @param {function(handler: Function): any} addHandler A function that takes\n * a `handler` function as argument and attaches it somehow to the actual\n * source of events.\n * @param {function(handler: Function, token?: any): void} [removeHandler] A function that\n * takes a `handler` function as an argument and removes it from the event source. If `addHandler`\n * returns some kind of token, `removeHandler` function will have it as a second parameter.\n * @param {function(...args: any): T} [project] A function to\n * transform results. It takes the arguments from the event handler and\n * should return a single value.\n * @return {Observable<T>} Observable which, when an event happens, emits first parameter\n * passed to registered event handler. Alternatively it emits whatever project function returns\n * at that moment.\n * @static true\n * @name fromEventPattern\n * @owner Observable\n */\n\nexport function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any,\n removeHandler?: (handler: NodeEventHandler, signal?: any) => void,\n resultSelector?: (...args: any[]) => T): Observable<T | T[]> {\n\n if (resultSelector) {\n // DEPRECATED PATH\n return fromEventPattern<T>(addHandler, removeHandler).pipe(\n map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))\n );\n }\n\n return new Observable<T | T[]>(subscriber => {\n const handler = (...e: T[]) => subscriber.next(e.length === 1 ? e[0] : e);\n\n let retValue: any;\n try {\n retValue = addHandler(handler);\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n\n if (!isFunction(removeHandler)) {\n return undefined;\n }\n\n return () => removeHandler(handler, retValue) ;\n });\n}\n","import {\r\n Injectable,\r\n NgZone,\r\n} from '@angular/core';\r\nimport {\r\n fromEventPattern,\r\n Observable,\r\n} from 'rxjs';\r\nimport {take} from 'rxjs/operators';\r\n\r\nimport { BrowserService } from 'webcommon/legacy-common';\r\nimport { Bridge } from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class HostedBridgeService implements Bridge {\r\n static readonly ajsFactoryName = 'HostedBridgeService';\r\n\r\n constructor(\r\n browserService: BrowserService,\r\n private ngZone: NgZone,\r\n ) {\r\n this.windowObj = browserService.getWindow();\r\n }\r\n\r\n private bridge: Bridge | null = null;\r\n private readonly windowObj: any;\r\n\r\n private getBridge(): Bridge {\r\n if (this.bridge !== null) {\r\n return this.bridge;\r\n }\r\n\r\n this.bridge = this.windowObj.bridge && this.windowObj.bridge.app ? this.windowObj.bridge.app : null;\r\n if (this.bridge === null) {\r\n throw new Error('bridge has not been set');\r\n }\r\n return this.bridge;\r\n }\r\n\r\n fireEvent(eventName: string, data: any = null): void {\r\n const bridge = this.getBridge();\r\n bridge.fireEvent(eventName, data === null ? {} : data);\r\n }\r\n\r\n addEventListener(eventName: string, callbackFn: (data: any) => void): void {\r\n const bridge = this.getBridge();\r\n bridge.addEventListener(eventName, callbackFn);\r\n }\r\n\r\n removeEventListener(eventName: string, callbackFn: (data: any) => void): void {\r\n const bridge = this.getBridge();\r\n bridge.removeEventListener(eventName, callbackFn);\r\n }\r\n\r\n // this not multicast, so it would need to be piped to share() or something similar to achieve that\r\n on<T>(eventName: string): Observable<T> {\r\n let ngZoneHandler: (data: any) => void;\r\n const observable = fromEventPattern<T>(\r\n (handler) => {\r\n ngZoneHandler = (data: any) => {\r\n this.ngZone.run(() => {\r\n handler(data);\r\n });\r\n };\r\n this.addEventListener(eventName, ngZoneHandler);\r\n },\r\n () => {\r\n if (!ngZoneHandler) return;\r\n this.removeEventListener(eventName, ngZoneHandler);\r\n },\r\n );\r\n return observable;\r\n }\r\n\r\n // this not multicast, so it would need to be piped to share() or something similar to achieve that\r\n once<T>(eventName: string): Observable<T> {\r\n return this.on<T>(eventName).pipe(\r\n take(1),\r\n );\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n EMPTY,\r\n Observable,\r\n} from 'rxjs';\r\n\r\nimport { Bridge } from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WebBridgeService implements Bridge {\r\n fireEvent(): void {\r\n // Do nothing because the only thing listening for a bridge event fired from JS should not be JS.\r\n }\r\n\r\n addEventListener(): void {\r\n // Do nothing because the only thing listening for a bridge event fired from JS should not be JS.\r\n }\r\n\r\n removeEventListener(): void {\r\n // Do nothing because the only thing listening for a bridge event fired from JS should not be JS.\r\n }\r\n\r\n on<T>(): Observable<T> {\r\n // Do nothing useful because the only thing listening for a bridge event fired from JS should not be JS.\r\n return EMPTY;\r\n }\r\n\r\n once<T>(): Observable<T> {\r\n // Do nothing useful because the only thing listening for a bridge event fired from JS should not be JS.\r\n return EMPTY;\r\n }\r\n}\r\n","// Put common functions for Foxit library in here, so that it's not referenced everywhere,\r\n// and it will allow it to be easier to use and more reusable.\r\n// Don't statically import or export anything other than types here though, or it will cause the whole library to get included,\r\n// which defeats the purpose of lazy-loading this in the first place.\r\n\r\n// It is important to note that tree-shaking doesn't work the same for dynamic imports,\r\n// so they should ideally be used to only import exactly what you need.\r\n// So when adding them, you kinda have to analyze exactly everything you're pulling in.\r\n// References: https://github.com/webpack/webpack.js.org/issues/2684\r\n// Also, foxit-pdf-sdk-for-web isn't even tree-shakeable at all in its current state,\r\n// so we could re-evaluate this code if that actually changes at some point.\r\n\r\nimport {InjectionToken} from '@angular/core';\r\nimport type {Annot, Markup} from '@wrappers/foxit-pdf-sdk-for-web/UIExtension.full';\r\n\r\nexport type FoxitModule = typeof import('@wrappers/foxit-pdf-sdk-for-web/UIExtension.full');\r\n\r\n// this is necessary, to just allow FoxitModule as a constructor parameter\r\nexport const FoxitModuleToken = new InjectionToken<FoxitModule>('FoxitModule');\r\n\r\nexport type {\r\n Annot,\r\n AnnotationIcon,\r\n AnnotJson,\r\n DeviceRect,\r\n Markup,\r\n PDFDoc,\r\n PDFPage,\r\n PDFPageRender,\r\n PDFRect,\r\n PDFUI,\r\n PDFViewCtrl,\r\n STATE_HANDLER_NAMES,\r\n ViewModes,\r\n} from '@wrappers/foxit-pdf-sdk-for-web/UIExtension.full';\r\n\r\n// this is pointing to where the lib folder for foxit will be available at runtime\r\n// (where it's copied to)\r\nexport const foxitLibPath = './node_modules_assets/foxit-pdf-sdk-for-web/lib';\r\n\r\n// todo: could use /* webpackPrefetch: true */ if necessary\r\n// todo: use webpackExports to only include part of dynamic import\r\n// when we are on webpack 5.x\r\n// https://webpack.js.org/api/module-methods/#magic-comments\r\nexport function importFoxit(): Promise<FoxitModule> {\r\n return import(\r\n /* webpackChunkName: \"foxit-UIExtension-full\" */\r\n '@wrappers/foxit-pdf-sdk-for-web/UIExtension.full'\r\n );\r\n}\r\n\r\nexport function isMarkup(value: Annot): value is Markup {\r\n return value && 'getIntent' in value;\r\n}\r\n\r\n// This has to be the name of the chunk that has this css file\r\n// It will be bundleName in the \"styles\" attribute in angular.json\r\nexport const foxitCssChunkName = 'foxit-UIExtension';\r\n\r\n\r\n\r\n//\r\n// Previously, this was doing a dynamic import of a css file,\r\n// but since that is webpack specific behavior that was never fully supported,\r\n// it became a build error in ng 14 to do this.\r\n// for reference:\r\n// https://github.com/angular/angular-cli/issues/22358\r\n// https://github.com/angular/angular-cli/issues/23273\r\n// https://github.com/angular/angular-cli/issues/12552\r\n// https://github.com/ag-grid/ag-grid/issues/5381\r\n\r\n// Leaving this here for documentation purposes:\r\n// export const foxitCssUniqueId = '@wrappers/foxit-pdf-sdk-for-web/UIExtension.css';\r\n// // todo: could use /* webpackPrefetch: true */ if necessary\r\n// export function importFoxitCss(): Promise<string> {\r\n// return import(\r\n// /* webpackChunkName: \"foxit-UIExtension-css\" */\r\n// '@wrappers/foxit-pdf-sdk-for-web/UIExtension.css'\r\n// ).then((x) => x.default);\r\n// }\r\n","import {Injectable} from '@angular/core';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\nimport {shareReplay} from 'rxjs/operators';\r\n\r\n// this file contains utilities for accessing runtime stuff,\r\n// like hashed file names from a manifest\r\n\r\n// Represents the structure of the json outputted by webpack-manifest-plugin,\r\n// but I think it's actually a format that is more generic than just that plugin.\r\n// I'm not sure if it could be possible that the value would an []\r\n// but i haven't seen that so far, so just typing it as string for now\r\nexport type AssetManifest = Partial<{\r\n [chunkName: string]: string;\r\n}>;\r\n\r\nconst manifestJsonUrl = './manifest.json';\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class RuntimeUtils {\r\n // This could be converted to use fetch and moved to js, if we wanted to use to reference the manifest in\r\n // the index.html file, or something like that.\r\n // This expects manifest.json to be at the root directory of the build output.\r\n private assetManifest$ = this.httpClient.get<AssetManifest>(manifestJsonUrl, {\r\n // we are only loading this once, and don't want a cached file that would cause issues\r\n // after loading from a new build\r\n headers: createIgnoreCacheHeaders(),\r\n }).pipe(\r\n shareReplay({\r\n refCount: false,\r\n bufferSize: 1,\r\n })\r\n );\r\n\r\n constructor(\r\n private httpClient: HttpClient,\r\n ) {\r\n }\r\n\r\n // pass in chunkName, return actual fileUrl\r\n async getFileUrlByChunk(chunkName: string): Promise<string> {\r\n const manifest = await this.assetManifest$.toPromise();\r\n const fileUrl = manifest[chunkName];\r\n if (!fileUrl) {\r\n throw new Error(`Key '${chunkName}' doesn't exist in manifest.json.` +\r\n ` Some possible causes: A \"bundleName\" in angular.json or a chunkName in a dynamic import() may have been changed`);\r\n }\r\n return fileUrl;\r\n }\r\n}\r\n\r\n// not sure where this function really belongs, i guess leave it here for now\r\n// just basically copied the logic from AprimaHttpClientService\r\nfunction createIgnoreCacheHeaders(): HttpHeaders {\r\n // tslint:disable:object-literal-key-quotes\r\n return new HttpHeaders({\r\n 'Cache-Control': 'no-cache, no-store, must-revalidate',\r\n 'Pragma': 'no-cache',\r\n 'Expires': new Date().toString(),\r\n });\r\n // tslint:enable:object-literal-key-quotes\r\n}\r\n","import { ElementRef, EventEmitter, OnDestroy, Output, ViewChild, Directive } from '@angular/core';\r\nimport { Observable, Subscription } from 'rxjs';\r\nimport { debounceTime, skipWhile, take, takeUntil } from 'rxjs/operators';\r\nimport { ApBaseClass } from 'webcommon/shared';\r\n\r\n// This can contain stuff shared across ui components\r\n@Directive()\r\n// tslint:disable-next-line:directive-class-suffix\r\nexport class ApBaseComponent extends ApBaseClass implements OnDestroy {\r\n readonly MAX_HEIGHT = '100%';\r\n // Base class for all components\r\n @Output() loadingChange: EventEmitter<boolean> = new EventEmitter();\r\n\r\n @ViewChild('loadElement') el: ElementRef;\r\n\r\n firstHeightSet = false; // used to tell when first load has been called\r\n delayObs: Observable<any> | null;\r\n delaySub: Subscription;\r\n\r\n tempHeight = 0;\r\n _HEIGHT = this.MAX_HEIGHT;\r\n _LOADING = false;\r\n get loading(): boolean {\r\n return this._LOADING;\r\n }\r\n set loading(value: boolean) {\r\n if (this._LOADING === value) { return; }\r\n this.setLoadingHeight(value);\r\n this._LOADING = value;\r\n this.loadingChange.emit(this.loading);\r\n }\r\n\r\n setLoadingHeight(value: boolean) {\r\n if (!this.el) { return; }\r\n\r\n if (!this.firstHeightSet) {\r\n this.firstHeightSet = true;\r\n return;\r\n }\r\n\r\n if (value) {\r\n this._HEIGHT = this.el.nativeElement.offsetHeight + 'px';\r\n } else {\r\n this.setMaxHeightWhenDone();\r\n }\r\n }\r\n\r\n getHeight() {\r\n return this._HEIGHT;\r\n }\r\n\r\n waitForLoadingHeightChange(): Observable<any> | null { // This is meant to be overridden\r\n return null;\r\n }\r\n\r\n setMaxHeightWhenDone(): void {\r\n if (this.delaySub && !this.delaySub.closed) {\r\n this.delaySub.unsubscribe();\r\n }\r\n this.delayObs = this.waitForLoadingHeightChange();\r\n if (!this.delayObs) {\r\n this._HEIGHT = this.MAX_HEIGHT;\r\n return;\r\n }\r\n\r\n this.delaySub = this.delayObs.pipe(\r\n debounceTime(0),\r\n skipWhile(() => this.loading),\r\n take(1),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n () => this._HEIGHT = this.MAX_HEIGHT,\r\n () => {/*Error*/},\r\n );\r\n }\r\n\r\n override ngOnDestroy() {\r\n if (this.loading) {\r\n this.loadingChange.emit(false);\r\n }\r\n super.ngOnDestroy();\r\n }\r\n}\r\n","import { ApBaseClass } from 'webcommon/shared';\r\nimport { Directive } from '@angular/core';\r\n\r\n// This can contain stuff shared across ui directives\r\n@Directive()\r\nexport class ApBaseDirective extends ApBaseClass {\r\n}\r\n","// essentially a port of ViewportInfo that we created in AngularJS, with some minor changes\r\n\r\nimport {\r\n Injectable,\r\n} from '@angular/core';\r\n\r\nimport { BrowserService } from 'webcommon/legacy-common';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ViewportService {\r\n private readonly documentObj: Document;\r\n private readonly windowObj: Window;\r\n\r\n // todo: inject window and document here\r\n constructor(\r\n browserService: BrowserService,\r\n ) {\r\n this.documentObj = browserService.getDocument();\r\n this.windowObj = browserService.getWindow();\r\n }\r\n\r\n // page width\r\n getWidth(): number {\r\n const bodyElement = this.documentObj.body;\r\n const docElement = this.documentObj.documentElement;\r\n const pageWidth = Math.max(\r\n Math.max(bodyElement.scrollWidth, docElement.scrollWidth),\r\n Math.max(bodyElement.offsetWidth, docElement.offsetWidth),\r\n Math.max(bodyElement.clientWidth, docElement.clientWidth));\r\n\r\n return pageWidth;\r\n }\r\n\r\n // page height\r\n getHeight(): number {\r\n const bodyElement = this.documentObj.body;\r\n const docElement = this.documentObj.documentElement;\r\n const pageHeight = Math.max(\r\n Math.max(bodyElement.scrollHeight, docElement.scrollHeight),\r\n Math.max(bodyElement.offsetHeight, docElement.offsetHeight),\r\n Math.max(bodyElement.clientHeight, docElement.clientHeight));\r\n\r\n return pageHeight;\r\n }\r\n\r\n getWindowWidth(): number {\r\n return this.windowObj.innerWidth;\r\n }\r\n\r\n getWindowHeight(): number {\r\n return this.windowObj.innerHeight;\r\n }\r\n\r\n getScrollY(): number {\r\n return this.windowObj.scrollY;\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n Renderer2,\r\n} from '@angular/core';\r\n\r\nimport { BrowserService } from 'webcommon/legacy-common';\r\nimport { SpinnerConfiguration } from 'webcommon/shared';\r\n\r\n// adapted from ionic library: https://github.com/driftyco/ionic\r\n// MIT license\r\n// taken from commit 6c9bc15\r\n/* tslint:disable:object-literal-sort-keys */\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SpinnerService {\r\n static readonly ajsFactoryName = 'SpinnerService';\r\n\r\n constructor(\r\n private browserService: BrowserService,\r\n ) {\r\n this.documentObj = this.browserService.getDocument();\r\n }\r\n\r\n private readonly documentObj: Document;\r\n\r\n applySpinner(element: Element, renderer: Renderer2, specifiedSpinnerName?: string, specifiedSize?: string) {\r\n const spinnerConfiguration = this.getSpinner(specifiedSpinnerName);\r\n const spinnerName = spinnerConfiguration.name;\r\n const spinnerHtml = spinnerConfiguration.html;\r\n const size = specifiedSize || '1';\r\n renderer.addClass(element, 'spinner');\r\n renderer.addClass(element, 'spinner-' + spinnerName);\r\n renderer.addClass(element, 'spinner-' + size + 'x');\r\n\r\n // Specifically for animations to work,\r\n // Android 4.3 and below requires the element to be\r\n // added as an html string, rather than dynamically\r\n // building up the svg element and appending it.\r\n renderer.setProperty(element, 'innerHTML', spinnerHtml);\r\n\r\n this.startSpinner(element, spinnerName);\r\n }\r\n\r\n getSpinner(specifiedSpinnerName?: string): SpinnerConfiguration {\r\n const override = this.browserService.getDefaultSpinnerName();\r\n let spinnerName = specifiedSpinnerName || override;\r\n let spinner = spinners[spinnerName];\r\n if (!spinner) {\r\n // default to bubbles instead of ios\r\n spinnerName = 'bubbles';\r\n spinner = spinners[spinnerName];\r\n }\r\n\r\n const container = this.documentObj.createElement('div');\r\n createSvgElement('svg', {\r\n viewBox: '0 0 64 64',\r\n g: [spinner],\r\n }, container, spinnerName);\r\n\r\n return {\r\n html: container.innerHTML,\r\n name: spinnerName,\r\n };\r\n }\r\n\r\n startSpinner(element: Element, spinnerName: string) {\r\n const animation = animations[spinnerName];\r\n if (animation) {\r\n animation(element)();\r\n }\r\n }\r\n}\r\n\r\nfunction fallbackRequestAnimationFrame(callback: FrameRequestCallback) {\r\n return window.setTimeout(callback, 16);\r\n}\r\n\r\n// polyfilled requestAnimationFrame. taken from ionic /js/utils/dom.js\r\nconst defaultRequestAnimationFrame: (callback: FrameRequestCallback) => number =\r\n window.requestAnimationFrame ||\r\n (window as any).mozRequestAnimationFrame ||\r\n fallbackRequestAnimationFrame;\r\n\r\nfunction setSvgAttribute(ele: Element, k: string, v: any) {\r\n ele.setAttribute(SHORTCUTS[k] || k, v);\r\n}\r\n\r\nfunction createSvgElement(tagName: string, data: any, parent: Element, spinnerName: string) {\r\n const ele = document.createElement(SHORTCUTS[tagName] || tagName);\r\n\r\n for (const k in data) {\r\n if (Array.isArray(data[k])) {\r\n for (const subData of data[k]) {\r\n if (subData.fn) {\r\n for (let y = 0; y < subData.t; y++) {\r\n createSvgElement(k, subData.fn(y, spinnerName), ele, spinnerName);\r\n }\r\n } else {\r\n createSvgElement(k, subData, ele, spinnerName);\r\n }\r\n }\r\n } else {\r\n setSvgAttribute(ele, k, data[k]);\r\n }\r\n }\r\n\r\n parent.appendChild(ele);\r\n}\r\n\r\nfunction easeInOutCubic(t: number, c: number) {\r\n t /= c / 2;\r\n if (t < 1) return 1 / 2 * t * t * t;\r\n t -= 2;\r\n return 1 / 2 * (t * t * t + 2);\r\n}\r\n\r\nconst SHORTCUTS: { [key: string]: string } = {\r\n a: 'animate',\r\n an: 'attributeName',\r\n at: 'animateTransform',\r\n c: 'circle',\r\n da: 'stroke-dasharray',\r\n os: 'stroke-dashoffset',\r\n f: 'fill',\r\n lc: 'stroke-linecap',\r\n rc: 'repeatCount',\r\n sw: 'stroke-width',\r\n t: 'transform',\r\n v: 'values',\r\n};\r\n\r\nconst animations: { [key: string]: (ele: Element) => () => void } = {\r\n android: (ele: Element) => {\r\n let rIndex = 0;\r\n let rotateCircle = 0;\r\n let startTime: number;\r\n // tslint:disable-next-line:no-non-null-assertion\r\n const svgEle = ele.querySelector('g')!;\r\n // tslint:disable-next-line:no-non-null-assertion\r\n const circleEle = ele.querySelector('circle')!;\r\n\r\n function run() {\r\n const v = easeInOutCubic(Date.now() - startTime, 650);\r\n let scaleX = 1;\r\n let translateX = 0;\r\n let dasharray = (188 - (58 * v));\r\n let dashoffset = (182 - (182 * v));\r\n\r\n if (rIndex % 2) {\r\n scaleX = -1;\r\n translateX = -64;\r\n dasharray = (128 - (-58 * v));\r\n dashoffset = (182 * v);\r\n }\r\n\r\n const rotateLine = [0, -101, -90, -11, -180, 79, -270, -191][rIndex];\r\n\r\n setSvgAttribute(circleEle, 'da', Math.max(Math.min(dasharray, 188), 128));\r\n setSvgAttribute(circleEle, 'os', Math.max(Math.min(dashoffset, 182), 0));\r\n setSvgAttribute(circleEle, 't', 'scale(' + scaleX + ',1) translate(' + translateX + ',0) rotate(' + rotateLine + ',32,32)');\r\n\r\n rotateCircle += 4.1;\r\n if (rotateCircle > 359) rotateCircle = 0;\r\n setSvgAttribute(svgEle, 't', 'rotate(' + rotateCircle + ',32,32)');\r\n\r\n if (v >= 1) {\r\n rIndex++;\r\n if (rIndex > 7) rIndex = 0;\r\n startTime = Date.now();\r\n }\r\n\r\n return defaultRequestAnimationFrame(run);\r\n }\r\n\r\n function start() {\r\n startTime = Date.now();\r\n run();\r\n }\r\n\r\n return start;\r\n },\r\n};\r\n\r\nconst TRANSLATE32 = 'translate(32,32)';\r\nconst STROKE_OPACITY = 'stroke-opacity';\r\nconst ROUND = 'round';\r\nconst INDEFINITE = 'indefinite';\r\nconst DURATION = '750ms';\r\nconst NONE = 'none';\r\n\r\nfunction animationValues(strValues: string, i: number) {\r\n let values = strValues.split(';');\r\n const back = values.slice(i);\r\n const front = values.slice(0, values.length - back.length);\r\n values = back.concat(front).reverse();\r\n return values.join(';') + ';' + values[0];\r\n}\r\n\r\nconst SPIN_ANIMATION = {\r\n v: '0,32,32;360,32,32',\r\n an: 'transform',\r\n type: 'rotate',\r\n rc: INDEFINITE,\r\n dur: DURATION,\r\n};\r\n\r\nconst IOS_SPINNER = {\r\n sw: 4,\r\n lc: ROUND,\r\n line: [{\r\n fn(i: number, spinnerName: string) {\r\n return {\r\n y1: spinnerName === 'ios' ? 17 : 12,\r\n y2: spinnerName === 'ios' ? 29 : 20,\r\n t: TRANSLATE32 + ' rotate(' + (30 * i + (i < 6 ? 180 : -180)) + ')',\r\n a: [{\r\n fn() {\r\n return {\r\n an: STROKE_OPACITY,\r\n dur: DURATION,\r\n v: animationValues('0;.1;.15;.25;.35;.45;.55;.65;.7;.85;1', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }],\r\n };\r\n },\r\n t: 12,\r\n }],\r\n};\r\n\r\nconst spinners: { [key: string]: any } = {\r\n android: {\r\n c: [{\r\n sw: 6,\r\n da: 128,\r\n os: 82,\r\n r: 26,\r\n cx: 32,\r\n cy: 32,\r\n f: NONE,\r\n }],\r\n },\r\n\r\n ios: IOS_SPINNER,\r\n\r\n 'ios-small': IOS_SPINNER,\r\n\r\n bubbles: {\r\n sw: 0,\r\n c: [{\r\n fn(i: number) {\r\n return {\r\n cx: 24 * Math.cos(2 * Math.PI * i / 8),\r\n cy: 24 * Math.sin(2 * Math.PI * i / 8),\r\n t: TRANSLATE32,\r\n a: [{\r\n fn() {\r\n return {\r\n an: 'r',\r\n dur: DURATION,\r\n v: animationValues('1;2;3;4;5;6;7;8', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }],\r\n };\r\n },\r\n t: 8,\r\n }],\r\n },\r\n\r\n circles: {\r\n c: [{\r\n fn(i: number) {\r\n return {\r\n r: 5,\r\n cx: 24 * Math.cos(2 * Math.PI * i / 8),\r\n cy: 24 * Math.sin(2 * Math.PI * i / 8),\r\n t: TRANSLATE32,\r\n sw: 0,\r\n a: [{\r\n fn() {\r\n return {\r\n an: 'fill-opacity',\r\n dur: DURATION,\r\n v: animationValues('.3;.3;.3;.4;.7;.85;.9;1', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }],\r\n };\r\n },\r\n t: 8,\r\n }],\r\n },\r\n\r\n crescent: {\r\n c: [{\r\n sw: 4,\r\n da: 128,\r\n os: 82,\r\n r: 26,\r\n cx: 32,\r\n cy: 32,\r\n f: NONE,\r\n at: [SPIN_ANIMATION],\r\n }],\r\n },\r\n\r\n dots: {\r\n c: [{\r\n fn(i: number) {\r\n return {\r\n cx: 16 + (16 * i),\r\n cy: 32,\r\n sw: 0,\r\n a: [{\r\n fn() {\r\n return {\r\n an: 'fill-opacity',\r\n dur: DURATION,\r\n v: animationValues('.5;.6;.8;1;.8;.6;.5', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }, {\r\n fn() {\r\n return {\r\n an: 'r',\r\n dur: DURATION,\r\n v: animationValues('4;5;6;5;4;3;3', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }],\r\n };\r\n },\r\n t: 3,\r\n }],\r\n },\r\n\r\n lines: {\r\n sw: 7,\r\n lc: ROUND,\r\n line: [{\r\n fn(i: number) {\r\n return {\r\n x1: 10 + (i * 14),\r\n x2: 10 + (i * 14),\r\n a: [{\r\n fn() {\r\n return {\r\n an: 'y1',\r\n dur: DURATION,\r\n v: animationValues('16;18;28;18;16', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }, {\r\n fn() {\r\n return {\r\n an: 'y2',\r\n dur: DURATION,\r\n v: animationValues('48;44;36;46;48', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }, {\r\n fn() {\r\n return {\r\n an: STROKE_OPACITY,\r\n dur: DURATION,\r\n v: animationValues('1;.8;.5;.4;1', i),\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }],\r\n };\r\n },\r\n t: 4,\r\n }],\r\n },\r\n\r\n ripple: {\r\n f: NONE,\r\n 'fill-rule': 'evenodd',\r\n sw: 3,\r\n circle: [{\r\n fn(i: number) {\r\n return {\r\n cx: 32,\r\n cy: 32,\r\n a: [{\r\n fn() {\r\n return {\r\n an: 'r',\r\n begin: (i * -1) + 's',\r\n dur: '2s',\r\n v: '0;24',\r\n keyTimes: '0;1',\r\n keySplines: '0.1,0.2,0.3,1',\r\n calcMode: 'spline',\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }, {\r\n fn() {\r\n return {\r\n an: STROKE_OPACITY,\r\n begin: (i * -1) + 's',\r\n dur: '2s',\r\n v: '.2;1;.2;0',\r\n rc: INDEFINITE,\r\n };\r\n },\r\n t: 1,\r\n }],\r\n };\r\n },\r\n t: 2,\r\n }],\r\n },\r\n\r\n spiral: {\r\n defs: [{\r\n linearGradient: [{\r\n id: 'sGD',\r\n gradientUnits: 'userSpaceOnUse',\r\n x1: 55, y1: 46, x2: 2, y2: 46,\r\n stop: [{\r\n offset: 0.1,\r\n class: 'stop1',\r\n }, {\r\n offset: 1,\r\n class: 'stop2',\r\n }],\r\n }],\r\n }],\r\n g: [{\r\n sw: 4,\r\n lc: ROUND,\r\n f: NONE,\r\n path: [{\r\n stroke: 'url(#sGD)',\r\n d: 'M4,32 c0,15,12,28,28,28c8,0,16-4,21-9',\r\n }, {\r\n d: 'M60,32 C60,16,47.464,4,32,4S4,16,4,32',\r\n }],\r\n at: [SPIN_ANIMATION],\r\n }],\r\n },\r\n};\r\n","import {\r\n Injectable,\r\n} from '@angular/core';\r\nimport {BrowserService} from 'webcommon/legacy-common';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class StyleService {\r\n private readonly documentObj: Document;\r\n constructor(\r\n browserService: BrowserService,\r\n ) {\r\n this.documentObj = browserService.getDocument();\r\n }\r\n\r\n // The current use-case for this method is to add a style that is lazy-loaded with dynamic import(),\r\n // that only needs to get added to the DOM once.\r\n // replaceCurrent:\r\n // true => if a style exists with this id,\r\n // replace the current style content with this content\r\n // false => if a style exists with this id, do nothing\r\n async addStyleToDom(\r\n id: string,\r\n content: () => (Promise<string> | string),\r\n replaceCurrent = false,\r\n ): Promise<void> {\r\n const fullId = `ap-lazystyle-${id}`;\r\n let element = this.documentObj.getElementById(fullId);\r\n if (element) {\r\n if (replaceCurrent) {\r\n element.textContent = await content();\r\n }\r\n return;\r\n }\r\n\r\n element = this.documentObj.createElement('style');\r\n element.id = fullId;\r\n element.textContent = await content();\r\n this.documentObj.head.appendChild(element);\r\n }\r\n\r\n // The current use-case for this method is to add a style that is lazy-loaded via assets (inject: false)\r\n // that only needs to get added to the DOM once.\r\n // If there is already a link element with this file, then it won't get added again.\r\n async addStyleUrlToDom(\r\n id: string,\r\n stylesheetUrl: Promise<string> | string\r\n ): Promise<void> {\r\n const fullId = `ap-lazystyle-${id}`;\r\n if (this.documentObj.getElementById(fullId)) {\r\n return;\r\n }\r\n\r\n const _stylesheetUrl = await stylesheetUrl;\r\n return new Promise<void>((resolve, reject) => {\r\n const link = this.documentObj.createElement('link');\r\n link.onload = () => {\r\n resolve();\r\n };\r\n link.onerror = (e) => {\r\n reject(e);\r\n };\r\n link.id = fullId;\r\n link.rel = 'stylesheet';\r\n link.href = _stylesheetUrl;\r\n this.documentObj.head.appendChild(link);\r\n });\r\n }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n Input,\r\n OnInit,\r\n Renderer2,\r\n} from '@angular/core';\r\n\r\nimport { SpinnerService } from '../services/index';\r\n\r\n// ApSpinner is an unusual directive since it needs to be an element but can't be a component.\r\n@Directive({\r\n // tslint:disable-next-line\r\n selector: 'ap-spinner',\r\n})\r\nexport class ApSpinnerDirective implements OnInit {\r\n constructor(\r\n private elementRef: ElementRef,\r\n private renderer: Renderer2,\r\n private spinnerService: SpinnerService,\r\n ) { }\r\n\r\n @Input() icon: string;\r\n @Input() size: string;\r\n\r\n ngOnInit() {\r\n const specifiedSpinnerName = this.icon;\r\n const specifiedSize = this.size;\r\n const element = this.elementRef.nativeElement as Element;\r\n this.spinnerService.applySpinner(element, this.renderer, specifiedSpinnerName, specifiedSize);\r\n }\r\n}\r\n","import {ApBsModalRef} from 'webcommon/shared';\r\n\r\nexport class ApActiveModal<T> {\r\n constructor(\r\n private _close: (value: T | PromiseLike<T>) => void,\r\n private _dismiss: (reason?: any) => void,\r\n ) { }\r\n\r\n bsModalRef: ApBsModalRef;\r\n\r\n private closedOrDismissed = false;\r\n private readyToHide = false;\r\n\r\n private onHide: () => void = () => {\r\n this._dismiss(undefined);\r\n }\r\n\r\n // close the modal with a specific return value\r\n emitAndClose(result: T | PromiseLike<T>): void {\r\n this.onHide = () => {\r\n this._close(result);\r\n };\r\n this.closedOrDismissed = true;\r\n this.tryHide();\r\n }\r\n\r\n dismiss(reason?: any): void {\r\n this.onHide = () => {\r\n this._dismiss(reason);\r\n };\r\n this.closedOrDismissed = true;\r\n this.tryHide();\r\n }\r\n\r\n markReadyToHide(): void {\r\n this.readyToHide = true;\r\n this.tryHide();\r\n }\r\n\r\n // Don't hide the modal until it's ready to be hidden,\r\n // and there has been a call to close or dismiss it.\r\n private tryHide() {\r\n if (this.closedOrDismissed && this.readyToHide) {\r\n this.bsModalRef.hide();\r\n this.onHide();\r\n }\r\n }\r\n}\r\n","import {Inject, Injectable, OnDestroy} from '@angular/core';\r\n\r\nimport {BsModalService, ModalContainerComponent} from 'ngx-bootstrap/modal';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\nimport {ApBaseClass, BsComponentLoader, lastDismissReasonT} from 'webcommon/shared';\r\n\r\nimport {ApActiveModal} from './ApActiveModal';\r\n\r\n// the actual type for BsModalService.loaders for the current version of ngx-bootstrap\r\nexport type loadersT = Array<BsComponentLoader<ModalContainerComponent>>;\r\n\r\n// This class contains common logic that needs to be run inside of ngx-bootstrap modals.\r\n// It previously existed in class ApBaseModalComponent, but was moved here to allow it to be shared\r\n// with ApLockingBaseModalComponent (previously FndBaseModalComponent), etc.\r\n// This class is not actually injectable because FakeHideHandlerInjectionToken doesn't have a service registered for it.\r\n// The decorator is required because it relies on the OnDestroy lifecycle hook and Angular requires a decorator to implement the hook.\r\n@Injectable()\r\nexport class ApModalHelper<T> extends ApBaseClass implements OnDestroy {\r\n\r\n private containerComponent: ModalContainerComponent | undefined;\r\n private isShownPreviousVal = false;\r\n\r\n // Default this to true to assume the normal case where there is a ModalContainerComponent,\r\n // and we need to wait for it to be shown before closing this modal.\r\n private readonly hasContainerComponent: boolean;\r\n\r\n constructor(\r\n // i guess these can be changed to be not private, if necessary\r\n private activeModal: ApActiveModal<T>,\r\n private bsModalService: BsModalService,\r\n @Inject('FakeHideHandlerInjectionToken') private hideHandler: (reason: lastDismissReasonT) => void,\r\n ) {\r\n super();\r\n\r\n // There is a ComponentLoader created by ngx-bootstrap for each modal component we load.\r\n // The one used for the current class is the last one in the 'loaders' property.\r\n // This is definitely hacky, but I couldn't figure out another way to keep the modals from trying to close too early.\r\n // I would argue this is a bug with ngx-bootstrap that it doesn't handle this case.\r\n // tslint:disable-next-line:no-string-literal\r\n const loaders = this.bsModalService['loaders'] as loadersT;\r\n // todo: use no-uncheckedindexed access flag in TS 4.1 to have this type be correct\r\n const thisLoader = loaders[loaders.length - 1] as typeof loaders[number] | undefined;\r\n // We need to get access to the ModalContainerComponent for this component,\r\n // and to do that, we can subscribe to 'onShown' for the loader.\r\n // This allows us to check the value of 'isShown' on the ModalContainerComponent,\r\n // to keep from calling hide() until it is === true.\r\n if (thisLoader) {\r\n this.hasContainerComponent = true;\r\n thisLoader.onShown.pipe(\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(() => {\r\n this.containerComponent = thisLoader.instance;\r\n });\r\n\r\n // This event will get emitted only when this modal is hiding, instead of when any modal is hiding.\r\n thisLoader.onBeforeHide.pipe(\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(() => {\r\n // tslint:disable-next-line:no-string-literal\r\n this.hideHandler(this.bsModalService['lastDismissReason'] as lastDismissReasonT);\r\n });\r\n } else {\r\n this.hasContainerComponent = false;\r\n\r\n // I don't actually think there's a real scenario where there won't be a container component,\r\n // which would then cause this to be used.\r\n this.activeModal.bsModalRef.onHide.pipe(\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n () => {\r\n // tslint:disable-next-line:no-string-literal\r\n this.hideHandler(this.bsModalService['lastDismissReason'] as lastDismissReasonT);\r\n },\r\n );\r\n }\r\n }\r\n\r\n // call from ngDoCheck in component\r\n doCheck(): void {\r\n // When the ModalContainerComponent.isShown is true, then we can successfully hide it.\r\n // (if 'isShown' is still false when calling BsModalRef.hide(), it just won't even try to hide the modal))\r\n // We should only need to mark the modal readyToHide once.\r\n if (this.hasContainerComponent && !this.isShownPreviousVal && this.containerComponent && this.containerComponent.isShown) {\r\n this.activeModal.markReadyToHide();\r\n this.isShownPreviousVal = true;\r\n }\r\n }\r\n\r\n // call from ngOnInit in component\r\n onInit(): void {\r\n if (!this.hasContainerComponent) {\r\n // If there is no container component to wait on for whatever reason,\r\n // then just mark the modal readyToHide now.\r\n this.activeModal.markReadyToHide();\r\n }\r\n }\r\n\r\n // resolve the promise because the user is done and there is a successful result\r\n emitAndClose(result: T | PromiseLike<T>): void {\r\n return this.activeModal.emitAndClose(result);\r\n }\r\n // reject the promise\r\n dismiss(reason?: any): void {\r\n return this.activeModal.dismiss(reason);\r\n }\r\n\r\n override ngOnDestroy(): void {\r\n super.ngOnDestroy();\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n Injector,\r\n} from '@angular/core';\r\nimport {\r\n BsModalRef,\r\n BsModalService,\r\n} from 'ngx-bootstrap/modal';\r\nimport { ApBsModalRef, lastDismissReasonT } from 'webcommon/shared';\r\nimport {ApActiveModal} from './ApActiveModal';\r\n\r\nimport {ApModalHelper} from './ApModalHelper';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ApModalHelperFactory {\r\n\r\n // This should be the injector from the component, not an Injector\r\n // injected directly into a service.\r\n create<T>(\r\n elementInjector: Injector,\r\n hideHandler: (reason: lastDismissReasonT) => void,\r\n ): ApModalHelper<T> {\r\n\r\n const bsModalService = elementInjector.get(BsModalService);\r\n const bsModalRef = elementInjector.get(BsModalRef) as ApBsModalRef;\r\n const activeModal = elementInjector.get<ApActiveModal<T>>(ApActiveModal);\r\n activeModal.bsModalRef = bsModalRef;\r\n const modalHelper = new ApModalHelper<T>(activeModal, bsModalService, hideHandler);\r\n return modalHelper;\r\n }\r\n}\r\n","import { DoCheck, ElementRef, Injector, OnDestroy, OnInit, Renderer2, Type, Directive } from '@angular/core';\r\n\r\nimport { lastDismissReasonT } from 'webcommon/shared';\r\n\r\nimport { ApBaseComponent } from '../ap-base-component/index';\r\n\r\nimport {ApModalHelper} from './ApModalHelper';\r\nimport {ApModalHelperFactory} from './ApModalHelperFactory';\r\n\r\n@Directive()\r\n// tslint:disable-next-line:directive-class-suffix\r\nexport abstract class ApBaseModalComponent<T> extends ApBaseComponent implements OnInit, DoCheck, OnDestroy {\r\n private readonly modalHelper: ApModalHelper<T>;\r\n\r\n protected constructor(\r\n // For a component, this Injector is actually an instance of NodeInjector at runtime\r\n // which will have providers specific to this element or parents, and the providers in the root module Injector.\r\n // (https://github.com/angular/angular/blob/main/packages/core/src/render3/di.ts)\r\n elementInjector: Injector,\r\n ) {\r\n super();\r\n this.modalHelper = elementInjector.get(ApModalHelperFactory).create<T>(elementInjector, r => this.onHide(r));\r\n // Add a class here, so that flex styles could be applied to this element,\r\n // in case it needs to contain a scrollable container, which could require nested flex containers all the way down.\r\n // ex: making the .modal-body element scrollable\r\n // (theoretically this could be used for other situations as well, that don't have to do with scrolling)\r\n elementInjector.get<Renderer2>(Renderer2 as Type<Renderer2>).addClass(elementInjector.get(ElementRef).nativeElement, 'ap-modal-component-host');\r\n }\r\n\r\n ngDoCheck(): void {\r\n this.modalHelper.doCheck();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.modalHelper.onInit();\r\n }\r\n\r\n override ngOnDestroy(): void {\r\n this.modalHelper.ngOnDestroy();\r\n super.ngOnDestroy();\r\n }\r\n\r\n // close the activeModal because the user is done and there is a successful result\r\n closeModal(result: T | PromiseLike<T>): void {\r\n return this.modalHelper.emitAndClose(result);\r\n }\r\n\r\n // dismiss the activeModal (which rejects the promise)\r\n dismissModal(reason?: any): void {\r\n return this.modalHelper.dismiss(reason);\r\n }\r\n\r\n protected onHide(reason: lastDismissReasonT): void {\r\n // if the reason is a string, then this hide was called because of a user action, like escape, or back button\r\n if (reason) {\r\n this.modalHelper.dismiss(`Modal dismissed because of: '${reason}'`);\r\n return;\r\n }\r\n\r\n // else, we programmatically called hide, so we don't need to do anything\r\n }\r\n}\r\n","export enum ApModalReason {\r\n Closed,\r\n UserCancel,\r\n Unknown,\r\n}\r\n","import { Observable } from 'rxjs';\r\nimport { filter, map } from 'rxjs/operators';\r\nimport {ApModalReason} from './ApModalReason';\r\n\r\nexport type ApModalResult<T> =\r\n ApModalResultSuccess<T> |\r\n ApModalResultFailure;\r\n\r\nexport interface ApModalResultSuccess<TResult> {\r\n readonly isSuccess: true;\r\n readonly reason: ApModalReason.Closed;\r\n readonly resultValue: TResult;\r\n}\r\n\r\nexport interface ApModalResultFailure {\r\n readonly isSuccess: false;\r\n readonly reason: ApModalReason.UserCancel | ApModalReason.Unknown;\r\n}\r\n\r\n// This a guard to help for narrowing to ApModalResultSuccess or ApModalResultFailure\r\nexport function isModalSuccess<T>(modalResult: ApModalResult<T>): modalResult is ApModalResultSuccess<T> {\r\n return modalResult.isSuccess;\r\n}\r\n\r\nexport function mapToModalSuccessValue<T>() {\r\n return (source: Observable<ApModalResult<T>>): Observable<T> => {\r\n return source.pipe(\r\n filter(isModalSuccess),\r\n map(r => r.resultValue),\r\n );\r\n };\r\n}\r\n\r\nexport function apModalClosed<T>(result: T): ApModalResult<T> {\r\n return {\r\n isSuccess: true,\r\n reason: ApModalReason.Closed,\r\n resultValue: result,\r\n };\r\n}\r\n\r\nexport function apModalCancelled<T>(reason: ApModalReason.UserCancel | ApModalReason.Unknown): ApModalResult<T> {\r\n return {\r\n isSuccess: false,\r\n reason,\r\n };\r\n}\r\n","import { Injector, Directive } from '@angular/core';\r\nimport { lastDismissReasonT } from 'webcommon/shared';\r\nimport {ApBaseModalComponent} from './ap-base-modal.component';\r\nimport {apModalCancelled, apModalClosed, ApModalResult} from './ApModalResult';\r\n\r\nimport {ApModalReason} from './ApModalReason';\r\n\r\n// Allows modal to return a more comprehensive result, including how it was closed, etc\r\n@Directive()\r\n// tslint:disable-next-line:directive-class-suffix\r\nexport abstract class ApComplexModal<T> extends ApBaseModalComponent<ApModalResult<T>> {\r\n protected constructor(\r\n elementInjector: Injector,\r\n ) {\r\n super(elementInjector);\r\n }\r\n\r\n // I prefixed these methods, so they are less likely\r\n // to conflict with methods defined in inheriting classes\r\n\r\n // close the activeModal because the user is done and there is a successful result\r\n apClose(result: T): void {\r\n const modalResult = apModalClosed(result);\r\n return this.closeModal(modalResult);\r\n }\r\n\r\n // close the activeModal because the user is done and there is a successful result (which is a promise)\r\n apCloseWithPromise(result: PromiseLike<T>): void {\r\n const modalResultPromise = result.then((x) => {\r\n const modalResult = apModalClosed(x);\r\n return modalResult;\r\n });\r\n\r\n return this.closeModal(modalResultPromise);\r\n }\r\n\r\n // close the activeModal because the user has cancelled the operation,\r\n // but there is not an error that should be passed along\r\n apUserCancel(): void {\r\n const modalResult = apModalCancelled<T>(\r\n ApModalReason.UserCancel,\r\n );\r\n return this.closeModal(modalResult);\r\n }\r\n\r\n protected override onHide(reason: lastDismissReasonT): void {\r\n // if the reason is a string, then this hide was called because of a user action, like escape, or back button\r\n if (reason) {\r\n const modalResult = apModalCancelled<T>(\r\n ApModalReason.Unknown,\r\n );\r\n return this.closeModal(modalResult);\r\n }\r\n\r\n // else, we programmatically called hide, so we don't need to do anything\r\n }\r\n}\r\n","import { ModalOptions } from 'ngx-bootstrap/modal';\r\n\r\nimport {Injectable, Injector} from '@angular/core';\r\n\r\n// This class adds typing around the initial state so that it will have to actually match the component\r\n// you are using for the modal.\r\n@Injectable()\r\nexport class ApModalComponentOptions<T> extends ModalOptions<T> {\r\n override initialState?: T;\r\n\r\n // injector that can provide $scope for UpgradeComponents\r\n elementInjector?: Injector;\r\n}\r\n","import {\r\n Injectable, Injector, StaticProvider, Type, ɵstringify as stringify,\r\n} from '@angular/core';\r\nimport {from, Observable} from 'rxjs';\r\nimport {ApModalTokens} from './ApModalComponentType';\r\nimport {AnyModalComponent} from './AnyModalComponent';\r\n\r\nimport {ApActiveModal} from './ApActiveModal';\r\nimport {ApModalComponentOptions} from './ApModalComponentOptions';\r\n\r\nimport {BsModalService} from 'ngx-bootstrap/modal';\r\nimport {ExactlyPartial} from 'webcommon/shared';\r\n\r\nimport {ScopeProvider} from 'webcommon/legacy-common';\r\n\r\n// This is a type useful for situations where you need to reference the generic type of a class via type inferencing\r\n// when there are multiple generic types declared on a function or class.\r\n// Ideally, the function below would have the type parameters like this:\r\n// <TComponent extends ApBaseModalComponent<TResult>, TResult>\r\n// but then TResult will not get inferred correctly, meaning you would have to tell the function\r\n// what type it needs to be in the <> when calling it.\r\n// see https://stackoverflow.com/q/58847047/5335355 for an example\r\ntype ExtractGeneric<T> = T extends AnyModalComponent<infer TResult> ? TResult : never;\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\n// This is a wrapper around BsModalService to provide more specific\r\n// for our use of the modals.\r\n// Also, it provides typing around stuff that ngx-boostrap doesn't have types for!\r\nexport class ApModalService {\r\n constructor(\r\n private bsModalService: BsModalService,\r\n // For a root service like this, this is a module Injector, which is actually an instance of R3Injector at runtime.\r\n // Unless it's provided separately than the 'root' module, then that specific case have a different instance.\r\n // (https://github.com/angular/angular/blob/main/packages/core/src/di/r3_injector.ts)\r\n private moduleInjector: Injector,\r\n ) {\r\n }\r\n\r\n // If you see an error for\r\n // \"Types of property 'someProperty' are incompatible. Type 'someType' is not assignable to type 'never'\",\r\n // then it's because 'someProperty' doesn't exist on TComponent.\r\n // So it's probably a typo, or you haven't yet added that property to 'TComponent'.\r\n //\r\n // If you see an error for\r\n // \"Types of property 'someProperty2' are incompatible. Type 'someType2' is not assignable to type 'someOtherType'\",\r\n // then it's because 'someProperty2' probably does exist on 'TComponent', but you're giving it the wrong type.\r\n //\r\n // This is essentially making sure that the properties passed on the 'initialState' match 'TComponent',\r\n // which is most likely necessary for 'TComponent' to function properly.\r\n // The type that 'TComponentState' extends from has to be an intersection with some variant of a 'Partial<TComponent>'\r\n // so as to not require the instance methods to be filled in on the partial type.\r\n //\r\n // More notes:\r\n // If 'TComponentState' just only extended 'Partial<TComponent>',\r\n // then it would allow excess properties on the 'initialState' that don't match 'TComponent'\r\n // (This is intended behavior by TypeScript: https://github.com/microsoft/TypeScript/issues/31872).\r\n // I can't think of a reason for why it would ever be necessary to allow excess properties on the 'initialState'\r\n // for whatever modal component is being used here, but i guess this could be changed in the future.\r\n showComponentModal<TComponent extends AnyModalComponent<any>, TComponentState extends ExactlyPartial<TComponent, TComponentState>>(\r\n component: Type<TComponent>,\r\n config?: ApModalComponentOptions<TComponentState>,\r\n ): Promise<ExtractGeneric<TComponent>> {\r\n const resultPromise = new Promise<ExtractGeneric<TComponent>>((resolve, reject) => {\r\n const activeModal = new ApActiveModal<ExtractGeneric<TComponent>>(resolve, reject);\r\n\r\n // Create a new simulated element Injector specifically for UpgradeComponents that may exist inside of this modal,\r\n // so that they can access the $scope properly.\r\n // (I'm calling it a simulated element injector, because it's not really an element injector,\r\n // like the one that would get injected into a component, but it does the necessary task of providing $scope)\r\n // And by creating a new Injector each time through here, means that the ScopeProvider will provide a new child scope\r\n // linked to the $rootScope for each new modal, which is what we want.\r\n // Then each UpgradeComponent inside of this modal will have this new scope as a parent, which is correct.\r\n // (as opposed to depending on the ScopeProvider being a provider for the whole module, which means a single scope gets created\r\n // the first time an UpgradeComponent needs one, and then is shared with all future ones after that in the same module,\r\n // which feels wrong)\r\n // The Injector that is injected into this class, and into the modal class is a module injector,\r\n // which doesn't provide $scope.\r\n const elementInjector = Injector.create({\r\n name: 'ApModalService-ElementInjector',\r\n parent: this.moduleInjector,\r\n providers: [\r\n ScopeProvider,\r\n ],\r\n });\r\n\r\n // ApActiveModal always needs to get filled in on the initialState for the modal component to return properly back to the caller\r\n const completeConfig = config || new ApModalComponentOptions<TComponentState>();\r\n completeConfig.elementInjector = elementInjector;\r\n const providers = completeConfig.providers = completeConfig.providers || [];\r\n providers.unshift({\r\n provide: ApActiveModal,\r\n useValue: activeModal,\r\n });\r\n\r\n try {\r\n this.bsModalService.show(component, completeConfig);\r\n } catch (e) {\r\n const messagePrefix = `Error trying to open modal '${stringify(component)}'`;\r\n console.error(messagePrefix, e);\r\n activeModal.dismiss(e);\r\n throw e;\r\n }\r\n });\r\n\r\n return resultPromise;\r\n }\r\n\r\n showComponentModal$<TComponent extends AnyModalComponent<any>, TComponentState extends ExactlyPartial<TComponent, TComponentState>>(\r\n component: Type<TComponent>,\r\n config?: ApModalComponentOptions<TComponentState>,\r\n ): Observable<ExtractGeneric<TComponent>> {\r\n return from(this.showComponentModal(component, config));\r\n }\r\n\r\n // use this to more easily fill in providers property in ModalOptions with stateful services\r\n provideClasses(\r\n elementInjector: Injector,\r\n ...tokens: ApModalTokens\r\n ): StaticProvider[] {\r\n return tokens.map((token) => {\r\n return {\r\n provide: token,\r\n useFactory: () => {\r\n return elementInjector.get(token);\r\n },\r\n };\r\n });\r\n }\r\n}\r\n","import { Directive, ElementRef, Input, OnInit, Renderer2 } from '@angular/core';\r\nimport { IColor } from 'webcommon/shared';\r\n\r\nexport enum BorderDirection {\r\n Top = 'Top',\r\n Bottom = 'Bottom',\r\n Left = 'Left',\r\n Right = 'Right',\r\n}\r\n\r\n@Directive({\r\n selector: '[apColorBorder]',\r\n})\r\nexport class ApColorBorderDirective implements OnInit {\r\n constructor(\r\n private el: ElementRef,\r\n private renderer: Renderer2,\r\n ) { }\r\n\r\n @Input() apColorBorder: IColor;\r\n @Input() borderDirection?: BorderDirection;\r\n\r\n ngOnInit(): void {\r\n if (this.apColorBorder && this.apColorBorder.Color) {\r\n switch (this.borderDirection) {\r\n case BorderDirection.Top: {\r\n this.renderer.addClass(this.el.nativeElement, 'top-border');\r\n this.renderer.setStyle(this.el.nativeElement, 'border-top-color', this.apColorBorder.Color);\r\n break;\r\n }\r\n case BorderDirection.Bottom: {\r\n this.renderer.addClass(this.el.nativeElement, 'bottom-border');\r\n this.renderer.setStyle(this.el.nativeElement, 'border-bottom-color', this.apColorBorder.Color);\r\n break;\r\n }\r\n case BorderDirection.Left: {\r\n this.renderer.addClass(this.el.nativeElement, 'left-border');\r\n this.renderer.setStyle(this.el.nativeElement, 'border-left-color', this.apColorBorder.Color);\r\n break;\r\n }\r\n case BorderDirection.Right: {\r\n this.renderer.addClass(this.el.nativeElement, 'right-border');\r\n this.renderer.setStyle(this.el.nativeElement, 'border-right-color', this.apColorBorder.Color);\r\n break;\r\n }\r\n default: {\r\n this.renderer.addClass(this.el.nativeElement, 'left-border');\r\n this.renderer.setStyle(this.el.nativeElement, 'border-left-color', this.apColorBorder.Color);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n HostListener,\r\n Input,\r\n OnChanges,\r\n Renderer2,\r\n SimpleChanges,\r\n} from '@angular/core';\r\n\r\nimport {\r\n ApHammerInput,\r\n ElementZoomState,\r\n} from 'webcommon/shared';\r\n\r\n// The main logic for this class was ported from apImageViewer.js in angularjs into this generic directive.\r\n@Directive({\r\n selector: '[apZoomable]',\r\n})\r\nexport class ApZoomableDirective implements OnChanges {\r\n private readonly element: HTMLElement;\r\n\r\n // this input is meant to be changed by the parent when you need to trigger a reset of the position and scale of the element\r\n // ex: for an <img> element, this input could be bound to the same value as the [src]\r\n @Input() resetSrc: any;\r\n\r\n private readonly zoomState: ElementZoomState = {\r\n initScale: 1,\r\n // The initial x and y coordinates will hold the offset for the image before any drag or zoom events occur.\r\n // Once a touch event is released, these values will get updated with the new position, but during a drag, they won't be updated.\r\n initialXCoordinate: 0,\r\n initialYCoordinate: 0,\r\n minOffsetX: 0,\r\n // tslint:disable-next-line:object-literal-sort-keys\r\n maxOffsetX: 0,\r\n minOffsetY: 0,\r\n maxOffsetY: 0,\r\n transform: {\r\n scale: 1,\r\n translate: {\r\n x: 0,\r\n y: 0,\r\n },\r\n },\r\n };\r\n\r\n constructor(\r\n elementRef: ElementRef,\r\n private readonly renderer: Renderer2,\r\n ) {\r\n this.element = elementRef.nativeElement as HTMLElement;\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes.resetSrc && changes.resetSrc.currentValue) {\r\n this.resetElement(this.element, this.zoomState);\r\n }\r\n }\r\n\r\n // Listening for these events and calling 'preventDefault' is necessary to make sure the\r\n // touch events don't interfere with these hammer events below.\r\n // Some mobile browsers (like on Android) allow doubletap to zoom or pinch to zoom for the page, and this logic will prevent that.\r\n @HostListener('touchstart', ['$event'])\r\n @HostListener('touchmove', ['$event'])\r\n @HostListener('touchend', ['$event'])\r\n // This is supposed to receive a TouchEvent, but TouchEvent isn't universally supported\r\n // across browsers, so it's using the parent of TouchEvent instead (UIEvent) to be safe.\r\n // TouchEvent as the type causes 'ReferenceError: TouchEvent is not defined.' in FireFox: https://stackoverflow.com/q/51124242/5335355\r\n // I THINK using TouchEvent as the event type in HostListener can cause issues because the transpiled js\r\n // of this includes the type of the parameter. (for FireFox, and i think Safari as well this type doesn't exist)\r\n touchHandlerDummy(e: UIEvent) {\r\n e.preventDefault();\r\n return false;\r\n }\r\n\r\n // on pinch, scale the element according to the scale from the event\r\n @HostListener('pinch', ['$event'])\r\n onPinch(ev: ApHammerInput) {\r\n const currentState = this.zoomState;\r\n const elem = this.element;\r\n\r\n this.renderer.removeClass(elem, 'animate');\r\n\r\n currentState.transform.scale = Math.max(currentState.initScale * ev.scale, 1);\r\n\r\n this.requestElementUpdate(elem, currentState);\r\n }\r\n\r\n @HostListener('pinchend', ['$event'])\r\n @HostListener('panend', ['$event'])\r\n onRelease(ev?: ApHammerInput) {\r\n // It was checking for the existence of this event in the previous version of this in angularjs,\r\n // but I'm not sure why.\r\n if (!ev) {\r\n return;\r\n }\r\n\r\n const currentState = this.zoomState;\r\n const elem = this.element;\r\n\r\n currentState.initScale = currentState.transform.scale;\r\n currentState.initialXCoordinate = currentState.transform.translate.x;\r\n currentState.initialYCoordinate = currentState.transform.translate.y;\r\n\r\n currentState.minOffsetX = -1 * (elem.offsetWidth * ((currentState.transform.scale - 1) / 2));\r\n currentState.maxOffsetX = currentState.minOffsetX + (elem.offsetWidth * (currentState.transform.scale - 1));\r\n currentState.minOffsetY = -1 * (elem.offsetHeight * ((currentState.transform.scale - 1) / 2));\r\n currentState.maxOffsetY = currentState.minOffsetY + (elem.offsetHeight * (currentState.transform.scale - 1));\r\n\r\n this.snapToContainer(elem, currentState);\r\n }\r\n\r\n // on doubletap, reset the element back to its original state\r\n @HostListener('doubletap')\r\n onDoubleTap() {\r\n this.resetElement(this.element, this.zoomState);\r\n }\r\n\r\n // on pan, move the element around\r\n // (makes more sense when you're zoomed in, and you want to see a different part of the\r\n // element that is off screen)\r\n @HostListener('panmove', ['$event'])\r\n onDrag(ev: ApHammerInput) {\r\n const currentState = this.zoomState;\r\n const elem = this.element;\r\n\r\n this.renderer.removeClass(elem, 'animate');\r\n\r\n const targetX = currentState.initialXCoordinate + ev.deltaX;\r\n const targetY = currentState.initialYCoordinate + ev.deltaY;\r\n\r\n currentState.transform.translate.x = targetX;\r\n currentState.transform.translate.y = targetY;\r\n\r\n this.requestElementUpdate(elem, currentState);\r\n }\r\n\r\n private snapToContainer(elem: HTMLElement, state: ElementZoomState) {\r\n state.transform.translate.x = state.initialXCoordinate =\r\n Math.min(\r\n Math.max(state.transform.translate.x, state.minOffsetX),\r\n state.maxOffsetX,\r\n );\r\n\r\n state.transform.translate.y = state.initialYCoordinate =\r\n Math.min(\r\n Math.max(state.transform.translate.y, state.minOffsetY),\r\n state.maxOffsetY,\r\n );\r\n\r\n this.requestElementUpdate(elem, state);\r\n }\r\n\r\n private resetElement(elem: HTMLElement, state: ElementZoomState) {\r\n this.renderer.addClass(elem, 'animate');\r\n\r\n state.initScale = 1;\r\n state.initialXCoordinate = 0;\r\n state.initialYCoordinate = 0;\r\n state.minOffsetX = 0;\r\n state.maxOffsetX = 0;\r\n state.minOffsetY = 0;\r\n state.maxOffsetY = 0;\r\n state.transform = {\r\n scale: 1,\r\n translate: {\r\n x: state.initialXCoordinate,\r\n y: state.initialYCoordinate,\r\n },\r\n };\r\n\r\n this.requestElementUpdate(elem, state);\r\n }\r\n\r\n private requestElementUpdate(elem: HTMLElement, state: ElementZoomState) {\r\n this.updateElementTransform(elem, state);\r\n }\r\n\r\n private updateElementTransform(elem: HTMLElement, state: ElementZoomState) {\r\n // This comment below was added years ago to the angularjs apIamgeViewer.js, and I'm not 100% sure it still applies,\r\n // but setting the css properties in this way seems to still work fine, so I am leaving this logic the same.\r\n // ============================================================================================================================\r\n // Even though we're only translating in 2 dimensions, we want to continue using the translate3D function. The browsers in\r\n // Android and iOS use GPU acceleration for the 3D transforms but not for 2D ones, so translate3D ends up being more performant\r\n // than just calling translate. Run http://jsperf.com/translate3d-vs-xy/28 to verify.\r\n // ============================================================================================================================\r\n\r\n const translate = `translate3d(${state.transform.translate.x}px, ${state.transform.translate.y}px, 0)`;\r\n const scale = `scale(${state.transform.scale}, ${state.transform.scale})`;\r\n const fullTransform = translate + ' ' + scale;\r\n\r\n this.renderer.setStyle(elem, 'webkit-transform', fullTransform);\r\n this.renderer.setStyle(elem, 'transform', fullTransform);\r\n this.renderer.setStyle(elem, 'moz-transform', fullTransform);\r\n }\r\n}\r\n","<object *ngIf=\"src\"\r\n type=\"application/pdf\"\r\n [data]=\"src\"\r\n width=\"100%\"\r\n height=\"800\">\r\n</object>","import {\r\n Component,\r\n Input,\r\n} from '@angular/core';\r\n\r\nimport {SafeResourceUrl} from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'ap-pdf',\r\n templateUrl: './ap-pdf.component.html',\r\n})\r\nexport class ApPdfComponent {\r\n @Input() src: string | SafeResourceUrl;\r\n}\r\n","import {\r\n Injectable,\r\n} from '@angular/core';\r\n\r\nimport {\r\n ApBaseClass,\r\n DocumentHelper,\r\n} from 'webcommon/shared';\r\n\r\nimport {BridgeService} from 'webcommon/legacy-common';\r\n\r\nimport {Observable} from 'rxjs';\r\n\r\nimport {\r\n take,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class IosDocumentHelper extends ApBaseClass implements DocumentHelper {\r\n constructor(\r\n private readonly bridge: BridgeService,\r\n ) {\r\n super();\r\n }\r\n\r\n openUrlInSeparateTab(url$: Observable<string>) {\r\n url$.pipe(\r\n take(1),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (url) => this.openInSeparateTab(url),\r\n );\r\n }\r\n\r\n private openInSeparateTab(url: string) {\r\n this.bridge.fireEvent('OpenLinkInBrowser', {\r\n url,\r\n });\r\n }\r\n\r\n supportsOpenInSeparateTab(): boolean {\r\n return true;\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n} from '@angular/core';\r\n\r\nimport {\r\n ApBaseClass,\r\n DocumentHelper,\r\n} from 'webcommon/shared';\r\n\r\nimport {BrowserService} from 'webcommon/legacy-common';\r\n\r\nimport {Observable} from 'rxjs';\r\n\r\nimport {\r\n take,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WebDocumentHelper extends ApBaseClass implements DocumentHelper {\r\n private readonly windowObj: Window;\r\n\r\n constructor(\r\n browserService: BrowserService,\r\n ) {\r\n super();\r\n this.windowObj = browserService.getWindow();\r\n }\r\n\r\n openUrlInSeparateTab(url$: Observable<string>) {\r\n // Need to open the window directly from click handler to avoid popup blockers.\r\n // Go ahead and open tab in IE even though it probably won't load,\r\n // because other browsers might behave the same way in certain configurations.\r\n\r\n const newWindow = this.windowObj.open('');\r\n if (!newWindow) {\r\n // window.open() can return null if the window wasn't able to open.\r\n // For now, just return back if that's the case.\r\n return;\r\n }\r\n newWindow.document.write('loading...');\r\n newWindow.document.close();\r\n\r\n url$.pipe(\r\n take(1),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (url) => {\r\n // IE will leave the window/tab open, so clear the loading message.\r\n newWindow.document.write('');\r\n newWindow.document.close();\r\n newWindow.location.href = url;\r\n },\r\n () => {\r\n newWindow.close();\r\n },\r\n );\r\n }\r\n\r\n supportsOpenInSeparateTab(): boolean {\r\n return true;\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n} from '@angular/core';\r\n\r\nimport {DocumentHelper} from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DefaultDocumentHelper implements DocumentHelper {\r\n openUrlInSeparateTab() {\r\n throw new Error('opening documents in a separate tab is not supported on this device');\r\n }\r\n\r\n supportsOpenInSeparateTab(): boolean {\r\n return false;\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n} from '@angular/core';\r\nimport {DeviceSettingsRepository} from 'webcommon/legacy-common';\r\n\r\nimport {DefaultDocumentHelper} from './DefaultDocumentHelper';\r\nimport {IosDocumentHelper} from './IosDocumentHelper';\r\nimport {WebDocumentHelper} from './WebDocumentHelper';\r\n\r\nimport {DocumentHelper} from 'webcommon/shared';\r\n\r\nimport {Observable} from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DocumentHelperBase implements DocumentHelper {\r\n private readonly innerHelper: DocumentHelper;\r\n\r\n constructor(\r\n deviceSettingsRepository: DeviceSettingsRepository,\r\n iosDocumentHelper: IosDocumentHelper,\r\n webDocumentHelper: WebDocumentHelper,\r\n defaultDocumentHelper: DefaultDocumentHelper,\r\n ) {\r\n if (deviceSettingsRepository.isIos) {\r\n this.innerHelper = iosDocumentHelper;\r\n } else if (deviceSettingsRepository.isStandaloneBrowser) {\r\n this.innerHelper = webDocumentHelper;\r\n } else {\r\n this.innerHelper = defaultDocumentHelper;\r\n }\r\n }\r\n\r\n openUrlInSeparateTab(url$: Observable<string>) {\r\n this.innerHelper.openUrlInSeparateTab(url$);\r\n }\r\n\r\n supportsOpenInSeparateTab(): boolean {\r\n return this.innerHelper.supportsOpenInSeparateTab();\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n} from '@angular/core';\r\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\r\nimport {Observable} from 'rxjs';\r\n\r\nimport {\r\n BrowserService,\r\n ServerInfoRepository,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n ApAudioDocument,\r\n ApDocumentBase,\r\n ApDocumentType,\r\n ApHtmlDocument,\r\n ApImageDocument,\r\n ApPdfDocument,\r\n ApTextDocument,\r\n AttachmentDto,\r\n DocumentHelper,\r\n DownloadableDocument,\r\n ServerFeature,\r\n} from 'webcommon/shared';\r\n\r\nimport {DocumentHelperBase} from './DocumentHelperBase';\r\n\r\n// start with 1 so none of these return a falsy value\r\nenum ImageFormats {\r\n bmp = 1,\r\n doc,\r\n docx,\r\n gif,\r\n jpeg,\r\n jpg,\r\n png,\r\n rtf,\r\n tif,\r\n tiff,\r\n}\r\nenum HtmlFormats {\r\n htm = 1,\r\n html,\r\n}\r\nenum TextFormats {\r\n txt = 1,\r\n}\r\nenum PdfFormats {\r\n pdf = 1,\r\n}\r\n\r\nenum CCDFormats {\r\n ccd = 1,\r\n ccda,\r\n xml,\r\n}\r\n\r\nenum AudioFormats {\r\n wav = 1,\r\n}\r\n\r\nexport const pdfMimeType = 'application/pdf';\r\n\r\nconst htmlDownloadContentType = 'text/html; charset=utf-8';\r\nconst audioContentType = 'audio/vnd.wav';\r\n// const xmlContentType = 'text/xml';\r\n\r\n// The logic in this service is a combination of document-related logic that has been cleaned up a bit, and used to exist\r\n// in old apSaveToFile.js, apDocumentViewer.js, apDocumentViewerWithDownload.js, PatientAttachmentCtrl.js,\r\n// IosDocumentHelper.js, WebDocumentHelper.js, and maybe more\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class DocumentService {\r\n private readonly windowObj: Window & typeof globalThis;\r\n private readonly documentHelper: DocumentHelper;\r\n\r\n private static getImageDataUrl(base64Data: string, extension: string): string {\r\n const dataUrl = `data:image/${extension};base64,${base64Data}`;\r\n return dataUrl;\r\n }\r\n\r\n constructor(\r\n private readonly browserService: BrowserService,\r\n private readonly domSanitizer: DomSanitizer,\r\n private readonly serverInfoRepository: ServerInfoRepository,\r\n documentHelper: DocumentHelperBase,\r\n ) {\r\n this.windowObj = browserService.getWindow();\r\n this.documentHelper = documentHelper;\r\n }\r\n\r\n hasStaticUrl(doc: ApDocumentBase): boolean {\r\n // Currently, for the static url to work for a document/attachment,\r\n // it needs to be a pdf, and have the feature that guarantees the static url endpoint will be there\r\n // on the server.\r\n // This can be updated as necessary in the future.\r\n const result = doc.isPdf && this.serverInfoRepository.isSupported(ServerFeature.ProviderAttachments_DisplaySeparateTab);\r\n return result;\r\n }\r\n\r\n openUrlInSeparateTab(url$: Observable<string>) {\r\n this.documentHelper.openUrlInSeparateTab(url$);\r\n }\r\n\r\n supportsOpenInSeparateTab(): boolean {\r\n return this.documentHelper.supportsOpenInSeparateTab();\r\n }\r\n\r\n supportsDownloadToFile(): boolean {\r\n return this.browserService.supportsDownloadToFile();\r\n }\r\n\r\n tryDownloadToFile(doc: DownloadableDocument, defaultFileName: string): boolean {\r\n if (!this.supportsDownloadToFile()) {\r\n return false;\r\n }\r\n\r\n const result = this.downloadToFile(doc, defaultFileName);\r\n return result;\r\n }\r\n\r\n downloadToFile(doc: DownloadableDocument, defaultFileName: string): boolean {\r\n const extension = doc.Extension;\r\n const data = doc.Data;\r\n if (!extension || !data) {\r\n return false;\r\n }\r\n\r\n const fileName = doc.FileName || defaultFileName;\r\n\r\n const isImage = !!ImageFormats[extension as any];\r\n if (isImage) {\r\n const fullName = `${fileName}.${extension}`;\r\n const contentType = `image/${extension}`;\r\n this.browserService.downloadDocumentToFile(fullName, data, contentType);\r\n return true;\r\n }\r\n\r\n const isHtml = !!HtmlFormats[extension as any];\r\n if (isHtml) {\r\n const fullName = `${fileName}.html`;\r\n this.browserService.downloadDocumentToFile(fullName, data, htmlDownloadContentType);\r\n return true;\r\n }\r\n\r\n const isText = !!TextFormats[extension as any];\r\n if (isText) {\r\n const fullName = `${fileName}.txt`;\r\n this.browserService.downloadDocumentToFile(fullName, data, htmlDownloadContentType);\r\n return true;\r\n }\r\n\r\n const isPdf = !!PdfFormats[extension as any];\r\n if (isPdf) {\r\n const fullName = `${fileName}.pdf`;\r\n this.browserService.downloadDocumentToFile(fullName, data, pdfMimeType);\r\n return true;\r\n }\r\n\r\n const isCCD = !!CCDFormats[extension as any];\r\n if (isCCD) {\r\n const fullName = `${fileName}.ccd`;\r\n this.browserService.downloadDocumentToFile(fullName, data, htmlDownloadContentType);\r\n return true;\r\n }\r\n\r\n const isAudio = !!AudioFormats[extension as any];\r\n if (isAudio) {\r\n const fullName = `${fileName}.wav`;\r\n this.browserService.downloadDocumentToFile(fullName, data, audioContentType);\r\n console.log('This attachment is an audio file');\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n mapFromAttachment(attachment: AttachmentDto): ApDocumentBase | null {\r\n const extension = attachment.Extension;\r\n const data = attachment.Data;\r\n if (!extension || !data) {\r\n return null;\r\n }\r\n const isImage = !!ImageFormats[extension as any];\r\n if (isImage) {\r\n const imageDataUrl = DocumentService.getImageDataUrl(data, extension);\r\n const imageDoc = new ApImageDocument(\r\n imageDataUrl,\r\n false,\r\n extension,\r\n attachment.PageCount,\r\n );\r\n return imageDoc;\r\n }\r\n\r\n const isHtml = !!HtmlFormats[extension as any];\r\n if (isHtml) {\r\n const htmlData = this.getHtmlData(data);\r\n const htmlDoc = new ApHtmlDocument(\r\n htmlData.dataUrl,\r\n false,\r\n extension,\r\n attachment.PageCount,\r\n htmlData.trustedUrl,\r\n );\r\n return htmlDoc;\r\n }\r\n\r\n const isText = !!TextFormats[extension as any];\r\n if (isText) {\r\n const textData = this.getText(data);\r\n const textDoc = new ApTextDocument(\r\n textData,\r\n extension,\r\n attachment.PageCount,\r\n );\r\n return textDoc;\r\n }\r\n\r\n // If Blob isn't compatible, then don't treat is a normal pdf,\r\n // because with our current logic, it won't be able to be displayed.\r\n const isPdf = !!PdfFormats[extension as any] && this.browserService.isBlobCompatible();\r\n if (isPdf) {\r\n const pdfData = this.getPdfData(data);\r\n const pdfDoc = new ApPdfDocument(\r\n pdfData.dataUrl,\r\n true,\r\n extension,\r\n attachment.PageCount,\r\n pdfData.trustedUrl,\r\n );\r\n return pdfDoc;\r\n }\r\n\r\n const isCCD = !!CCDFormats[extension as any];\r\n if (isCCD) {\r\n const ccdData = this.getHtmlData(data);\r\n const ccdDoc = new ApHtmlDocument(\r\n ccdData.dataUrl,\r\n false,\r\n extension,\r\n attachment.PageCount,\r\n ccdData.trustedUrl,\r\n );\r\n return ccdDoc;\r\n }\r\n\r\n const isAudio = !!AudioFormats[extension as any];\r\n if (isAudio) {\r\n const audioData = this.getAudioData(data);\r\n const audioDoc = new ApAudioDocument(\r\n audioData.dataUrl,\r\n false,\r\n extension,\r\n attachment.PageCount,\r\n audioData.trustedUrl,\r\n );\r\n console.log('Audio extension: ', audioDoc.extension);\r\n console.log('Audio trusted Url: ', audioDoc.trustedUrl);\r\n return audioDoc;\r\n }\r\n\r\n const genericDoc = new ApDocumentBase(\r\n attachment.Data,\r\n false,\r\n ApDocumentType.unknown,\r\n extension,\r\n attachment.PageCount,\r\n );\r\n\r\n return genericDoc;\r\n }\r\n\r\n disposeDocument(document: ApDocumentBase | null) {\r\n // revoke the objectUrl when we are done with the document to\r\n // let the browser know not to keep the reference to the file any longer\r\n if (document && document.dataIsObjectUrl) {\r\n this.windowObj.URL.revokeObjectURL(document.data);\r\n }\r\n }\r\n\r\n private getPdfData(base64Data: string): {\r\n dataUrl: string,\r\n trustedUrl: SafeResourceUrl,\r\n } {\r\n const blob = this.browserService.base64ToBlob(base64Data, pdfMimeType);\r\n const objectUrl = this.windowObj.URL.createObjectURL(blob);\r\n const trustedUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(objectUrl);\r\n return {\r\n dataUrl: objectUrl,\r\n trustedUrl,\r\n };\r\n }\r\n\r\n private getHtmlData(base64Data: string): {\r\n dataUrl: string,\r\n trustedUrl: SafeResourceUrl,\r\n } {\r\n const dataUrl = `data:text/html;charset=utf-8; base64,${base64Data}`;\r\n const trustedUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(dataUrl);\r\n return {\r\n dataUrl,\r\n trustedUrl,\r\n };\r\n }\r\n\r\n private getText(base64Data: string): string {\r\n const text = this.windowObj.atob(base64Data);\r\n return text;\r\n }\r\n\r\n private getAudioData(base64Data: string): {\r\n dataUrl: string,\r\n trustedUrl: SafeResourceUrl,\r\n } {\r\n console.log('Getting audio data');\r\n const blob = this.browserService.base64ToBlob(base64Data, audioContentType);\r\n const objectUrl = URL.createObjectURL(blob);\r\n const trustedUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(objectUrl);\r\n console.log('Returning audio data');\r\n return {\r\n dataUrl: objectUrl,\r\n trustedUrl,\r\n };\r\n }\r\n\r\n}\r\n","import {\r\n Inject,\r\n Injectable,\r\n NgZone,\r\n OnDestroy,\r\n} from '@angular/core';\r\nimport {\r\n AnnotationIcon,\r\n AnnotJson,\r\n DeviceRect,\r\n foxitLibPath,\r\n FoxitModule, FoxitModuleToken,\r\n isMarkup,\r\n PDFDoc,\r\n PDFPage,\r\n PDFPageRender,\r\n PDFRect,\r\n PDFUI,\r\n} from 'webcommon/foxit';\r\nimport { BrowserService } from 'webcommon/legacy-common';\r\n\r\nimport {\r\n ApBaseClass,\r\n EditAttachmentDto,\r\n FoxitLicenseDto,\r\n FoxitLicenseDtoToken,\r\n} from 'webcommon/shared';\r\n\r\nimport {\r\n AttachmentRepository, ProviderRepository,\r\n} from 'webcommon/webapi';\r\n\r\nimport { forkJoin, from, fromEvent, Observable, of, throwError } from 'rxjs';\r\nimport { concatMap, filter, map, switchMap, withLatestFrom } from 'rxjs/operators';\r\nimport { pdfMimeType } from '../DocumentService';\r\nimport {IPdfRenderer} from './IPdfRenderer';\r\nimport moment from 'moment';\r\n\r\n@Injectable()\r\nexport class FoxitPdfRenderer extends ApBaseClass implements IPdfRenderer, OnDestroy {\r\n protected readonly pdfUI: PDFUI;\r\n attachmentsToSave = new Map<string, string>();\r\n isDirty = false;\r\n pageCount = 0;\r\n pageIndex = 0;\r\n currentAttachmentUid?: string;\r\n providerSignatureWidth = 0;\r\n providerSignatureHeight = 0;\r\n providerName: string;\r\n\r\n readonly template = `\r\n <webpdf>\r\n <toolbar name=\"toolbar\" class=\"fv__ui-toolbar-scrollable\">\r\n <tabs name=\"toolbar-tabs\">\r\n <tab title=\"toolbar.tabs.home.title\" name=\"home-tab\"><group-list name=\"home-toolbar-group-list\">\r\n <group name=\"home-tab-group-hand\" retain-count=\"10\">\r\n <hand-button></hand-button>\r\n <selection-button></selection-button>\r\n <create-typewriter-button></create-typewriter-button>\r\n <create-stamp-dialog></create-stamp-dialog>\r\n <download-file-button></download-file-button>\r\n </group>\r\n <group name=\"comment-tab-group-stamp\" retain-count=\"5\">\r\n <single-page-button id=\"spb\"></single-page-button>\r\n <continuous-page-button></continuous-page-button>\r\n <double-page-button></double-page-button>\r\n <stamp-dropdown></stamp-dropdown>\r\n <!-- <editable-zoom-dropdown></editable-zoom-dropdown> -->\r\n </group>\r\n </tab>\r\n </tab>\r\n </toolbar>\r\n <viewer></viewer>\r\n <template name=\"template-container\">\r\n <create-stamp-dialog></create-stamp-dialog>\r\n <! -- contextmenus -->\r\n <markup-contextmenu name=\"fv--stamp-contextmenu\"></markup-contextmenu>\r\n </template>\r\n </webpdf>`;\r\n\r\n constructor(\r\n private readonly zone: NgZone,\r\n private readonly browserService: BrowserService,\r\n private readonly attachmentRepository: AttachmentRepository,\r\n private readonly providerRepository: ProviderRepository,\r\n @Inject(FoxitModuleToken) foxitModule: FoxitModule,\r\n @Inject(FoxitLicenseDtoToken) foxitSetup: FoxitLicenseDto,\r\n private element: HTMLElement,\r\n ) {\r\n super();\r\n this.pdfUI = this.createPDFUI(\r\n foxitModule,\r\n foxitSetup,\r\n element,\r\n );\r\n }\r\n\r\n // element: HTMLElement to mount the pdf viewer on\r\n protected createPDFUI(\r\n foxitModule: FoxitModule,\r\n foxitSetup: FoxitLicenseDto,\r\n element: HTMLElement,\r\n ): PDFUI {\r\n this.isDirty = false;\r\n\r\n const pdfUI = new foxitModule.PDFUI({\r\n addons: [],\r\n customs: { defaultStateHandler: foxitSetup.DefaultTool },\r\n fragments: [\r\n {\r\n config: {\r\n callback: this.saveAttachment.bind(this),\r\n tooltip: {\r\n title: 'Save PDF',\r\n },\r\n },\r\n target: 'download-file-button',\r\n },\r\n ],\r\n renderTo: element,\r\n template: this.template,\r\n viewerOptions: {\r\n // If we want to reference stuff from 'external' folder in foxit package (like in the examples),\r\n // then that needs to be setup to be copied to somewhere in the output directory,\r\n // just like the 'lib' folder currently is.\r\n // Currently, we aren't referencing anything in that folder.\r\n jr: {\r\n licenseKey: foxitSetup.LicenseKey,\r\n licenseSN: foxitSetup.LicenseSN,\r\n },\r\n libPath: foxitLibPath,\r\n },\r\n });\r\n\r\n pdfUI.eventEmitter.on('page-number-change', async (newPageNumber) => {\r\n this.pageIndex = newPageNumber - 1;\r\n });\r\n pdfUI.getPDFViewer().then((viewer) => {\r\n viewer.eventEmitter.on('annotation-add', async (annotAdd) => {\r\n if ((annotAdd[0].getTitle() === 'Foxit Web')\r\n && (annotAdd[0].getType() === 'stamp')\r\n ) {\r\n const stampId = annotAdd[0].getUniqueID();\r\n const pageRender = await pdfUI.getPDFPageRender(this.pageIndex);\r\n if (!pageRender) {\r\n return;\r\n }\r\n const page = await pageRender.getPDFPage();\r\n const signatureRect = annotAdd[0].getRect();\r\n await page.removeAnnotById(stampId);\r\n await this.addProviderSignatureWithTimestampMessage(page, signatureRect, pageRender);\r\n }\r\n this.isDirty = true;\r\n });\r\n });\r\n pdfUI.addViewerEventListener('render-file-success', () => {\r\n pdfUI.getPDFViewer().then((viewer) => {\r\n this.pageCount = viewer.currentPDFDoc.getPageCount();\r\n\r\n // Temp fix to satisfy customer for hotfix\r\n // This should more than likely be addressed in another way but this will perform the same\r\n // function.\r\n if (this.pageCount === 1) {\r\n const singlePageModeButton = document.getElementById('spb');\r\n if (!singlePageModeButton) return;\r\n (singlePageModeButton as HTMLAnchorElement).setAttribute('style',\r\n (singlePageModeButton as HTMLAnchorElement).style + ';pointer-events: none; opacity: 50%');\r\n }\r\n });\r\n\r\n pdfUI.getViewModeManager().then((viewModeMgr) => {\r\n if (this.pageCount === 1) {\r\n viewModeMgr.switchTo('continuous-view-mode');\r\n } else {\r\n viewModeMgr.switchTo(foxitSetup.DefaultViewMode);\r\n }\r\n });\r\n });\r\n pdfUI.getPDFViewer().then((viewer) => {\r\n viewer.eventEmitter.on('annotation-appearance-updated', async (annotUpdate) => {\r\n const firstAnnot = annotUpdate[0];\r\n if (isMarkup(firstAnnot)) {\r\n if (firstAnnot.getTitle() === 'ProviderSignature') {\r\n const groupElements = firstAnnot.getGroupElements();\r\n const signatureAnnot = groupElements[0];\r\n const datetimeStampAnnot = groupElements[1];\r\n const signatureRect = signatureAnnot.getRect();\r\n const datetimeStampAnnotRect = datetimeStampAnnot.getRect();\r\n datetimeStampAnnotRect.top = signatureRect.bottom;\r\n datetimeStampAnnotRect.left = signatureRect.left;\r\n datetimeStampAnnotRect.right = signatureRect.right;\r\n datetimeStampAnnotRect.bottom = datetimeStampAnnotRect.top - 30;\r\n const success = await datetimeStampAnnot.setRect(datetimeStampAnnotRect);\r\n if (success) {\r\n const pageRender = await pdfUI.getPDFPageRender(this.pageIndex);\r\n if (!pageRender) {\r\n return;\r\n }\r\n const component = pageRender.getAnnotRender(datetimeStampAnnot.getUniqueID())?.getComponent();\r\n component?.active();\r\n }\r\n }\r\n }\r\n });\r\n });\r\n pdfUI.registerMatchRule((annot, ParentClass) => {\r\n if ('stamp' === annot.getType()) {\r\n // tslint:disable-next-line:max-classes-per-file\r\n return class CustomMarkupAnnotClass extends ParentClass {\r\n constructor(...args: any[]) {\r\n super(...args);\r\n }\r\n onDoubleTap(e: any) {\r\n // console.info(e, e.center);\r\n console.log(e);\r\n return false; // to prevent default behavior\r\n }\r\n showReplyDialog() {\r\n return false;\r\n }\r\n };\r\n }\r\n return ParentClass;\r\n });\r\n\r\n pdfUI.getPDFViewer().then((viewer) => {\r\n viewer.setDefaultAnnotConfig((type) => {\r\n const config: Partial<AnnotJson> = {};\r\n config.borderInfo = {};\r\n config.defaultAppearance = {};\r\n switch (type) {\r\n case 'freetext':\r\n config.color = 'ffffff';\r\n config.opacity = 1;\r\n config.fillColor = 0x000000;\r\n config.borderInfo.width = 0;\r\n config.intent = 'FreeTextTypewriter';\r\n config.defaultAppearance.textColor = 0;\r\n config.defaultAppearance.textSize = 14;\r\n break;\r\n }\r\n return config;\r\n });\r\n });\r\n return pdfUI;\r\n }\r\n\r\n override ngOnDestroy(): void {\r\n this.destroyViewer(this.pdfUI);\r\n super.ngOnDestroy();\r\n }\r\n\r\n async openPDFData(data: string): Promise<void> {\r\n this.pageIndex = 0;\r\n const blob = this.browserService.base64ToBlob(data, pdfMimeType);\r\n await this.pdfUI.openPDFByFile(blob);\r\n await this.removeDefaultStamps();\r\n await this.setProviderStamp();\r\n }\r\n\r\n async setProviderStamp(): Promise<void> {\r\n const providerSignatureData = await this.getProviderSignatureBase64();\r\n\r\n this.providerName = providerSignatureData[1];\r\n const src = 'data:image/bmp;base64,' + providerSignatureData[0];\r\n const i = await this.loadImage(src);\r\n const icon: AnnotationIcon = {\r\n annotType: 'stamp',\r\n category: 'Provider Signature',\r\n fileType: 'bmp',\r\n height: i.height,\r\n name: 'Signature Icon',\r\n url: i.src,\r\n width: i.width,\r\n };\r\n this.providerSignatureHeight = i.height;\r\n this.providerSignatureWidth = i.width;\r\n await this.pdfUI.pdfViewer.addAnnotationIcon(icon);\r\n }\r\n\r\n // currently this appears to be used to just get the height and width\r\n // of the Image, but it's possible it could be used for other things\r\n loadImage(src: string): Promise<HTMLImageElement> {\r\n return new Promise<HTMLImageElement>((resolve, reject) => {\r\n const i = new Image();\r\n i.onload = () => {\r\n resolve(i);\r\n };\r\n i.onerror = (e) => {\r\n reject(e);\r\n };\r\n i.src = src;\r\n });\r\n }\r\n\r\n async removeDefaultStamps(): Promise<void> {\r\n // this.pdfUI.removeAnnotationIcon('stamp', null, null);\r\n await this.pdfUI.pdfViewer.removeAnnotationIcon('stamp', null, null);\r\n // this.pdfUI.pdfViewer.removeAnnotationIcon('stamp', 'Dynamic Stamps', 'Approved');\r\n // this.pdfUI.pdfViewer.removeAnnotationIcon('stamp', 'Dynamic Stamps', 'Revised');\r\n // this.pdfUI.pdfViewer.removeAnnotationIcon('stamp', 'Dynamic Stamps', 'Reviewed');\r\n }\r\n\r\n async pdfDocumentStream(pdfDoc: PDFDoc): Promise<Blob> {\r\n const bufferArray: BlobPart[] = [];\r\n await pdfDoc.getStream(({ arrayBuffer }) => {\r\n bufferArray.push(arrayBuffer);\r\n });\r\n return new Blob(bufferArray, { type: 'application/pdf' });\r\n }\r\n\r\n async saveAttachment(): Promise<void> {\r\n const currentAttachmentUid = this.currentAttachmentUid;\r\n if (!currentAttachmentUid) {\r\n return;\r\n }\r\n\r\n const pdfDoc = await this.pdfUI.getCurrentPDFDoc();\r\n if (!pdfDoc) {\r\n return;\r\n }\r\n\r\n await pdfDoc.flatten(0);\r\n const pdfBlob = await this.pdfDocumentStream(pdfDoc);\r\n const pdfBase64 = await this.blobToBase64(pdfBlob);\r\n const editedAttachment: EditAttachmentDto = {\r\n Data: pdfBase64,\r\n AttachmentUid: currentAttachmentUid,\r\n };\r\n await this.attachmentRepository.setAttachmentContent(\r\n (editedAttachment.AttachmentUid).toString(),\r\n editedAttachment,\r\n ).toPromise();\r\n }\r\n\r\n setAttachment(id: string) {\r\n this.currentAttachmentUid = id;\r\n }\r\n\r\n blobToBase64(data: Blob): Promise<string> {\r\n return new Promise<string>((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.onloadend = () => {\r\n if (reader.result) {\r\n const base64dataUrl = reader.result.toString();\r\n\r\n // Note: The blob's result cannot be directly decoded as Base64 without first\r\n // removing the Data-URL declaration preceding the Base64-encoded data.\r\n // To retrieve only the Base64 encoded string, first remove data:/;base64, from the result.\r\n const base64data = base64dataUrl.substring(base64dataUrl.indexOf(',') + 1);\r\n\r\n resolve(base64data);\r\n } else {\r\n reject();\r\n }\r\n };\r\n reader.onerror = (e) => {\r\n reject(e);\r\n };\r\n reader.readAsDataURL(data);\r\n });\r\n }\r\n\r\n // todo: foxit PDFUI.destroy returns a promise;\r\n // may have to await that at some point if necessary\r\n private destroyViewer(pdfViewer: PDFUI | null): void {\r\n if (pdfViewer) {\r\n this.zone.runOutsideAngular(() => {\r\n pdfViewer.destroy();\r\n });\r\n }\r\n }\r\n\r\n async getProviderSignatureBase64(): Promise<[string, string]> {\r\n const { Signature: signatureString, ProviderName: providerName } =\r\n await this.providerRepository.GetCurrentProviderSigningSignature().toPromise();\r\n if (!signatureString) {\r\n throw new Error();\r\n }\r\n\r\n return [ signatureString, providerName ];\r\n }\r\n\r\n // setup behavior to drag down-right for provider signature, and up right to add the date\r\n setupDragBehavior(): void {\r\n const mousedown$ = fromEvent<MouseEvent>(this.element, 'mousedown');\r\n fromEvent<MouseEvent>(this.element, 'mouseup').pipe(\r\n // get the latest mousedown event for each mouseup\r\n withLatestFrom(mousedown$),\r\n // wait isRegularPageDrag() to emit,\r\n // and because this is switchMap, it will properly unsubscribe to the last call and move on with a new\r\n // call to isRegularPageDrag(), if a new mouseup event comes thru.\r\n // This will support the behavior we currently want, which is that if there has been no\r\n // future event (select-text, pdfui-end-scrolling-page) after the mouse events to confirm that this could be a valid drag event,\r\n // then cancel it.\r\n switchMap(([endEvent, startEvent]) => {\r\n return this.isRegularPageDrag().pipe(\r\n map((isRegularDrag) => {\r\n return {\r\n isRegularDrag,\r\n startEvent,\r\n endEvent,\r\n };\r\n }),\r\n );\r\n }),\r\n // filter out invalid drag events\r\n filter((value) => value.isRegularDrag),\r\n concatMap((value) => {\r\n // the set of events is now valid to process\r\n return this.handleDrag(value.startEvent, value.endEvent);\r\n }),\r\n this.takeUntilDestroy(),\r\n ).subscribe();\r\n }\r\n\r\n async handleDrag(startEvent: MouseEvent, endEvent: MouseEvent): Promise<void> {\r\n let pageScale = 1;\r\n const pageRender = await this.pdfUI.getPDFPageRender(this.pageIndex);\r\n if (!pageRender) {\r\n return;\r\n }\r\n\r\n const eHandler = pageRender.getHandlerDOM();\r\n const pageRect = eHandler.getBoundingClientRect();\r\n // TODO: is this supposed to be using offsetX/offsetY or clientX/clientY, or a mix of both\r\n // this logic seems like it could be wrong; it was introduced in 73f975d\r\n const startPoints = [startEvent.offsetX, startEvent.offsetY] as const;\r\n const endPoints = [endEvent.clientX, endEvent.clientY] as const;\r\n const rect = this.getRect(startPoints, pageRect, endPoints);\r\n pageScale = pageRender.getScale();\r\n const page = await pageRender.getPDFPage();\r\n const reversedRect = page.reverseDeviceRect(rect, pageScale);\r\n if ((startEvent.clientY < endEvent.clientY) && (startEvent.clientX < endEvent.clientX)) {\r\n reversedRect.right = reversedRect.left + this.providerSignatureWidth;\r\n reversedRect.bottom = reversedRect.top - this.providerSignatureHeight;\r\n await this.addProviderSignatureWithTimestampMessage(page, reversedRect, pageRender);\r\n } else if ((startEvent.clientY > endEvent.clientY) && (startEvent.clientX < endEvent.clientX)) {\r\n await this.addDate(page, reversedRect, pageRender);\r\n }\r\n }\r\n\r\n // return true if this event is a drag on the page without it being for resizing or moving annotations,\r\n // or anything like that.\r\n // To see all events in foxit, prettify UIExtension.full.js,\r\n // and put logpoint right after \"u.prototype.emit = function(e, t, n, o, i, a) {\"\r\n // This is the emit call in eventemitter3\r\n isRegularPageDrag(): Observable<boolean> {\r\n return new Observable<boolean>((observer) => {\r\n // there could also be events that we listen to that definitely cancel these other events\r\n // and return false, if we deem that necessary\r\n const teardown1 = this.pdfUI.addViewerEventListener({\r\n 'select-text': () => {\r\n // for STATE_HANDLER_SELECT_ANNOTATION, we expect a single select-text event after the drag\r\n teardown1();\r\n observer.next(true);\r\n observer.complete();\r\n },\r\n 'pdfui-end-scrolling-page': () => {\r\n // for STATE_HANDLER_HAND, we expect a single pdfui-end-scrolling-page event after the drag\r\n teardown1();\r\n observer.next(true);\r\n observer.complete();\r\n },\r\n });\r\n return teardown1;\r\n });\r\n }\r\n\r\n async addProviderSignatureWithTimestampMessage(page: PDFPage, rect: PDFRect, pageRender: PDFPageRender): Promise<void> {\r\n const providerSignature: AnnotJson = {\r\n icon: 'Signature Icon',\r\n iconCategory: 'Provider Signature',\r\n opacity: 1,\r\n rect: {\r\n bottom: rect.bottom,\r\n left: rect.left,\r\n right: rect.right,\r\n top: rect.top,\r\n },\r\n rotate: page.getRotation(),\r\n title: 'ProviderSignature',\r\n type: 'stamp',\r\n };\r\n const timestampMessage: AnnotJson = {\r\n color: 'ffffff',\r\n contents: 'Electronically signed by ' + this.providerName + ' on ' + this.formatDate(true),\r\n 'interior-color': 0x00000000,\r\n rect: {\r\n bottom: rect.bottom - 30,\r\n left: rect.left,\r\n right: rect.right,\r\n top: rect.bottom,\r\n },\r\n rotate: page.getRotation(),\r\n subject: 'FreeTextTypeWriter',\r\n 'text-color': 0x000000,\r\n title: 'ElectronicSignatureTimestamp',\r\n type: 'freetext',\r\n defaultAppearance: {\r\n textColor: 0,\r\n textSize: 10\r\n }\r\n };\r\n\r\n const annotArray = [ providerSignature, timestampMessage ];\r\n const annots = await page.addAnnotGroup(annotArray, 0);\r\n annots.forEach((a) => {\r\n const component = pageRender.getAnnotRender(a.getUniqueID())?.getComponent();\r\n component?.active();\r\n });\r\n }\r\n\r\n async addDate(page: PDFPage, rect: PDFRect, pageRender: PDFPageRender): Promise<void> {\r\n const date = this.formatDate();\r\n const annotJson: AnnotJson = {\r\n color: 'ffffff',\r\n contents: date,\r\n 'interior-color': 0x00000000,\r\n rect: {\r\n bottom: rect.bottom,\r\n left: rect.left,\r\n right: rect.right,\r\n top: rect.top,\r\n },\r\n rotate: page.getRotation(),\r\n subject: 'FreeTextTypeWriter',\r\n 'text-color': 0x000000,\r\n title: 'DateSigned',\r\n type: 'freetext',\r\n };\r\n const annots = await page.addAnnot(annotJson);\r\n const annot = annots[0];\r\n const component = pageRender.getAnnotRender(annot.getUniqueID())?.getComponent();\r\n component?.active();\r\n this.isDirty = true;\r\n }\r\n\r\n addTextBox(page: PDFPage, rect: PDFRect, pageRender: PDFPageRender) {\r\n const annotJson: AnnotJson = {\r\n color: 'ffffff',\r\n defaultAppearance: {\r\n textColor: 0,\r\n textSize: 24,\r\n },\r\n 'interior-color': 0x00000000,\r\n rect: {\r\n bottom: rect.bottom,\r\n left: rect.left,\r\n right: rect.right,\r\n top: rect.top,\r\n },\r\n rotate: page.getRotation(),\r\n subject: 'FreeTextTypeWriter',\r\n 'text-color': 0x000000,\r\n type: 'freetext',\r\n };\r\n page.addAnnot(annotJson).then((annots) => {\r\n const annot = annots[0];\r\n const component = pageRender.getAnnotRender(annot.getUniqueID())?.getComponent();\r\n component?.active();\r\n });\r\n this.isDirty = true;\r\n }\r\n\r\n // Takes each attachment for the current message that has been modified (signed or dated), and saves it to the database\r\n batchSaveAttachments(): Observable<string[]> {\r\n const obv: Array<Observable<string>> = [];\r\n this.attachmentsToSave.forEach((value: string, key: string) => {\r\n const editedAttachment: EditAttachmentDto = {\r\n Data: value,\r\n AttachmentUid: key,\r\n };\r\n obv.push(this.attachmentRepository.setAttachmentContent((editedAttachment.AttachmentUid).toString(), editedAttachment));\r\n });\r\n this.isDirty = false;\r\n this.attachmentsToSave.clear();\r\n return forkJoin(obv);\r\n }\r\n\r\n // If an attachment has been modified, we want to add it to our map (attachmentsToSave) to keep the modified data stored until we save\r\n // it to the database.\r\n attachmentModified(docId: string): Observable<boolean> {\r\n return this.getModifiedAttachmentData().pipe(\r\n switchMap((modifiedData: string) => {\r\n if (modifiedData) {\r\n this.attachmentsToSave.set(docId, modifiedData);\r\n this.isDirty = false;\r\n return of(true);\r\n } else {\r\n return throwError(new Error('Modified attachment data not retrieved'));\r\n }\r\n }),\r\n );\r\n }\r\n\r\n // To get the new attachment data that includes signatures/dates, we need to use several Foxit methods/objects to pull the final data.\r\n // The attachment must also be flattened, otherwise faxes and other attachment export functions will not include the signature/date,\r\n // despite the attachment displaying normally in PRM.\r\n getModifiedAttachmentData(): Observable<string> {\r\n const promise = new Promise<string>((resolve, reject) => {\r\n this.pdfUI.getCurrentPDFDoc().then((pdfDoc) => {\r\n if (!pdfDoc) {\r\n reject();\r\n return;\r\n }\r\n\r\n pdfDoc.flatten(0).then(() => {\r\n this.pdfDocumentStream(pdfDoc).then((pdfBlob) => {\r\n this.blobToBase64(pdfBlob).then((pdfBase64) => {\r\n if (pdfBase64 != null) {\r\n resolve(pdfBase64);\r\n } else {\r\n reject();\r\n }\r\n });\r\n });\r\n });\r\n });\r\n });\r\n return from(promise);\r\n }\r\n\r\n // Used when switching between attachments in a message\r\n checkIfAttachmentDirty(docId: string): Promise<void> {\r\n return new Promise<void>((resolve) => {\r\n if (this.isDirty === true) {\r\n return this.attachmentModified(docId).subscribe(() => resolve());\r\n }\r\n resolve();\r\n });\r\n }\r\n\r\n // Used when moving to the next message\r\n checkIfAttachmentGroupDirty(docId: string): Observable<string[]> {\r\n if (this.isDirty) {\r\n return of(docId).pipe(\r\n switchMap(() => this.attachmentModified(docId)),\r\n switchMap(() => this.batchSaveAttachments()),\r\n );\r\n } else if (this.attachmentsToSave.size > 0) {\r\n return of(docId).pipe(\r\n switchMap(() => this.batchSaveAttachments()),\r\n );\r\n } else {\r\n return of([]);\r\n }\r\n }\r\n\r\n getRect(\r\n startPoints: readonly [x: number, y: number],\r\n pageRect: DOMRect,\r\n endPoints: readonly [x: number, y: number],\r\n ): DeviceRect {\r\n let left = startPoints[0];\r\n let top = startPoints[1];\r\n let right = endPoints[0] - pageRect.left;\r\n let bottom = endPoints[1] - pageRect.top;\r\n let temp: number;\r\n if (right < left) {\r\n temp = left;\r\n left = right;\r\n right = temp;\r\n }\r\n if (bottom < top) {\r\n temp = top;\r\n top = bottom;\r\n bottom = temp;\r\n }\r\n return {\r\n left,\r\n top,\r\n right,\r\n bottom,\r\n };\r\n }\r\n\r\n formatDate(includeTime?: boolean): string {\r\n const formatString = 'MM/DD/YYYY' + ((includeTime) ? ' hh:mm A' : '');\r\n return moment().format(formatString);\r\n }\r\n\r\n adjustZoom() {\r\n this.pdfUI.pdfViewer.zoomTo('fitHeight').then(() => {\r\n this.pdfUI.pdfViewer.zoomTo('fitWidth');\r\n });\r\n }\r\n}\r\n","import {\r\n Injectable,\r\n NgZone,\r\n OnDestroy,\r\n} from '@angular/core';\r\nimport {Subject} from 'rxjs';\r\nimport {StyleService} from '../../services/index';\r\nimport {FoxitPdfRenderer} from './FoxitPdfRenderer';\r\nimport {\r\n foxitCssChunkName,\r\n importFoxit,\r\n} from 'webcommon/foxit';\r\nimport { BrowserService } from 'webcommon/legacy-common';\r\n\r\nimport {\r\n ApBaseClass,\r\n FoxitLicenseDto,\r\n} from 'webcommon/shared';\r\n\r\nimport {\r\n AttachmentRepository, ProviderRepository,\r\n} from 'webcommon/webapi';\r\n\r\nimport {IPdfRenderer} from './IPdfRenderer';\r\nimport {RuntimeUtils} from 'webcommon/runtime-info';\r\n\r\nexport interface DeferredFoxitPdfRendererBase {\r\n // use result when you want to take an action on the renderer if it's initialized,\r\n // but if it's not, then you're fine with skipping the action\r\n result?: FoxitPdfRenderer;\r\n\r\n // use resultPromise, if you want to wait until the renderer is initialized (it could already be initialized),\r\n // then take some action on it,\r\n // This promise resolves to the same instance as what is returned from init().\r\n resultPromise: Promise<FoxitPdfRenderer>;\r\n\r\n // initialize the renderer, returns a promise that resolves when it's done\r\n // element: HTMLElement to mount the pdf viewer on\r\n // The returned promise resolves to the same instance as resultPromise.\r\n init: (\r\n foxitSetup: FoxitLicenseDto,\r\n element: HTMLElement,\r\n ) => Promise<FoxitPdfRenderer>;\r\n}\r\n\r\nexport type DeferredFoxitPdfRenderer = Readonly<DeferredFoxitPdfRendererBase>;\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PdfRendererFactory extends ApBaseClass implements OnDestroy {\r\n private pdfRenderers = new Set<IPdfRenderer>();\r\n\r\n constructor(\r\n private readonly zone: NgZone,\r\n private readonly browserService: BrowserService,\r\n private readonly attachmentRepository: AttachmentRepository,\r\n private readonly providerRepository: ProviderRepository,\r\n private readonly styleService: StyleService,\r\n private readonly runtimeUtils: RuntimeUtils\r\n ) {\r\n super();\r\n }\r\n\r\n // This method should be preferred over createOnElement() because the result is easier to work with.\r\n // return initialization function to be called in ngOnInit, when HtmlElement is available\r\n // This allows this function to be called in the constructor, and immediately provide a promise\r\n // that can be referenced elsewhere in the code\r\n createDeferred(): DeferredFoxitPdfRenderer {\r\n const subject = new Subject<FoxitPdfRenderer>();\r\n const pdfRendererPromise = subject.toPromise();\r\n const deferred: DeferredFoxitPdfRendererBase = {\r\n resultPromise: pdfRendererPromise,\r\n init: async (\r\n foxitSetup: FoxitLicenseDto,\r\n element: HTMLElement,\r\n ) => {\r\n if (deferred.result) {\r\n return deferred.result;\r\n }\r\n\r\n const pdfRenderer = await this.createOnElement(\r\n foxitSetup,\r\n element,\r\n ).catch((e) => {\r\n subject.error(e);\r\n return Promise.reject(e);\r\n });\r\n\r\n subject.next(pdfRenderer);\r\n subject.complete();\r\n deferred.result = pdfRenderer;\r\n return pdfRenderer;\r\n },\r\n };\r\n return deferred;\r\n }\r\n\r\n // element: HTMLElement to mount the pdf viewer on\r\n // IMPORTANT: when taking actions based on data coming from this viewer, it will not be in ng zone.\r\n // It's allowing the import() of the library, and the creation of the PDFUI class to occur outside the ng zone,\r\n // because it's not related to angular at all, and could have performance issues if run in the ng zone.\r\n // In classes using this viewer where you're affecting bindings or other Angular stuff,\r\n // you need to call NgZone.run().\r\n async createOnElement(\r\n foxitSetup: FoxitLicenseDto,\r\n element: HTMLElement,\r\n ): Promise<FoxitPdfRenderer> {\r\n const pdfRenderer = await this.zone.runOutsideAngular(async () => {\r\n // await dynamic import resolution in parallel\r\n const [foxitModule] = await Promise.all([\r\n importFoxit(),\r\n this.styleService.addStyleUrlToDom(foxitCssChunkName, this.runtimeUtils.getFileUrlByChunk(foxitCssChunkName)),\r\n ]);\r\n\r\n return new FoxitPdfRenderer(\r\n this.zone,\r\n this.browserService,\r\n this.attachmentRepository,\r\n this.providerRepository,\r\n foxitModule,\r\n foxitSetup,\r\n element,\r\n );\r\n });\r\n\r\n this.pdfRenderers.add(pdfRenderer);\r\n pdfRenderer.onDestroy$.subscribe(() => {\r\n this.pdfRenderers.delete(pdfRenderer);\r\n });\r\n return pdfRenderer;\r\n }\r\n\r\n override ngOnDestroy(): void {\r\n this.pdfRenderers.forEach((pdfRenderer, _key, set) => {\r\n pdfRenderer.ngOnDestroy();\r\n set.delete(pdfRenderer);\r\n });\r\n super.ngOnDestroy();\r\n }\r\n}\r\n","import {\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { Observable, Subscription } from 'rxjs';\r\nimport { finalize, takeUntil } from 'rxjs/operators';\r\nimport {ApDocumentBase, AttachmentDto, AttachmentRequestConfig, SystemGuid} from 'webcommon/shared';\r\nimport { FoxitLicenseRepository } from 'webcommon/webapi';\r\nimport { ApBaseComponent } from '../../ap-base-component/index';\r\nimport { ViewportService } from '../../services/index';\r\nimport { DocumentService } from '../DocumentService';\r\nimport {DeferredFoxitPdfRenderer, PdfRendererFactory} from './PdfRendererFactory';\r\n\r\n@Component({\r\n selector: 'ap-sign-pdf',\r\n templateUrl: './ap-sign-pdf.component.html',\r\n})\r\nexport class ApSignPdfComponent extends ApBaseComponent implements OnInit, OnDestroy, OnChanges {\r\n static readonly ajsComponentName = 'apSignPdf';\r\n\r\n get document(): ApDocumentBase | null {\r\n return this.documentValue;\r\n }\r\n set document(val) {\r\n this.documentValue = val;\r\n if (val) {\r\n this.currentDocumentChange.emit(val);\r\n }\r\n }\r\n\r\n constructor(\r\n viewportService: ViewportService,\r\n private readonly pdfRendererFactory: PdfRendererFactory,\r\n private readonly documentService: DocumentService,\r\n private readonly foxitLicenseRepository: FoxitLicenseRepository,\r\n private readonly systemGuid: SystemGuid,\r\n ) {\r\n super();\r\n this.pageWidth = viewportService.getWidth();\r\n this.pageHeight = viewportService.getHeight();\r\n this.deferredPdfRenderer = this.pdfRendererFactory.createDeferred();\r\n }\r\n\r\n private readonly pageWidth: number;\r\n private readonly pageHeight: number;\r\n @Input() disableFullscreen = false;\r\n @Input() disableInlinePdf?: boolean;\r\n @Input() documentId: string;\r\n @Input() loadDocument: (documentId: string, requestConfig: AttachmentRequestConfig) => Observable<AttachmentDto>;\r\n @Input() documentGetStaticUrl?: (documentId: string) => Observable<string>;\r\n @Input() documentLoad: (documentId: string, requestConfig: AttachmentRequestConfig) => Observable<AttachmentDto>;\r\n\r\n downloadingDocument = false;\r\n\r\n // ap-document-viewer\r\n private documentValue: ApDocumentBase | null = null;\r\n @Output() currentDocumentChange = new EventEmitter<ApDocumentBase>();\r\n\r\n loadError: any = null;\r\n loadingDocument = false;\r\n initialized = false;\r\n\r\n readonly deferredPdfRenderer: DeferredFoxitPdfRenderer;\r\n private currentAttachment: AttachmentDto;\r\n\r\n @ViewChild('foxitPdfViewer', { static: true }) pdfViewerRef: ElementRef<HTMLElement>;\r\n\r\n // IMPORTANT: this returned promise from ngOnInit is not waited on\r\n async ngOnInit(): Promise<void> {\r\n const foxitLicense = await this.foxitLicenseRepository.getFoxitLicense(\r\n this.systemGuid.ProductParameterFoxitLicenseSN,\r\n this.systemGuid.ProductParameterFoxitLicenseKey,\r\n this.systemGuid.ProductParameterFoxitDefaultTool,\r\n this.systemGuid.ProductParameterFoxitDefaultViewMode,\r\n ).toPromise();\r\n\r\n\r\n const pdfRenderer = await this.deferredPdfRenderer.init(\r\n foxitLicense,\r\n this.pdfViewerRef.nativeElement,\r\n );\r\n pdfRenderer.setupDragBehavior();\r\n\r\n console.log('Document ID: ' + this.documentId);\r\n this.initialized = true;\r\n this.loadDocumentInternal(this.documentId, '', 1);\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (!this.initialized) {\r\n return;\r\n }\r\n const documentIdChanges = changes.documentId;\r\n if (documentIdChanges) {\r\n this.loadDocumentInternal(documentIdChanges.currentValue, documentIdChanges.previousValue, 1);\r\n }\r\n }\r\n\r\n override ngOnDestroy(): void {\r\n this.deferredPdfRenderer.result?.ngOnDestroy();\r\n super.ngOnDestroy();\r\n }\r\n\r\n loadDocumentInternal(documentId: string, previousDocumentId: string, page: number): Subscription {\r\n if (documentId !== previousDocumentId) {\r\n // dispose of previous document, since we are replacing it\r\n this.documentService.disposeDocument(this.document);\r\n this.loadError = null;\r\n this.document = null;\r\n }\r\n\r\n if (!documentId) {\r\n return Subscription.EMPTY;\r\n }\r\n\r\n this.loadingDocument = true;\r\n\r\n // Request double the device's resolution so we have a little give in the zooming department.\r\n // ^ this comment came from legacy ap-document-viewer in angularjs\r\n const request: AttachmentRequestConfig = {\r\n height: this.pageHeight * 2,\r\n page,\r\n width: this.pageWidth * 2,\r\n };\r\n\r\n const sub = this.loadDocument(documentId, request).pipe(\r\n finalize(() => this.documentLoadComplete()),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data) => this.documentLoadSuccess(data),\r\n (error) => this.documentLoadError(error),\r\n );\r\n return sub;\r\n }\r\n\r\n getAttachment() {\r\n return this.currentAttachment;\r\n }\r\n\r\n onDocumentLoadRef = (documentId: string, requestConfig: AttachmentRequestConfig) => {\r\n return this.onDocumentLoad(documentId, requestConfig);\r\n }\r\n\r\n private onDocumentLoad(documentId: string, requestConfig: AttachmentRequestConfig): Observable<AttachmentDto> {\r\n this.loadingDocument = true;\r\n const load$ = this.documentLoad(documentId, requestConfig).pipe(\r\n finalize(() => this.documentLoadComplete()),\r\n );\r\n return load$;\r\n }\r\n\r\n private documentLoadComplete() {\r\n this.loadingDocument = false;\r\n }\r\n\r\n private async documentLoadSuccess(attachment: AttachmentDto): Promise<void> {\r\n // dispose of previous document, since we are replacing it\r\n this.currentAttachment = attachment;\r\n this.documentService.disposeDocument(this.document);\r\n this.loadError = null;\r\n this.document = this.documentService.mapFromAttachment(attachment);\r\n\r\n const pdfRenderer = await this.deferredPdfRenderer.resultPromise;\r\n if (pdfRenderer.attachmentsToSave.has(this.documentId)) {\r\n const existingData = pdfRenderer.attachmentsToSave.get(this.documentId);\r\n if (existingData) {\r\n pdfRenderer.openPDFData(existingData).then(() => {\r\n pdfRenderer.setAttachment(this.documentId);\r\n });\r\n }\r\n } else {\r\n pdfRenderer.openPDFData(attachment.Data).then(() => {\r\n pdfRenderer.setAttachment(this.documentId);\r\n });\r\n }\r\n }\r\n\r\n blobToBase64(data: Blob) {\r\n const reader = new FileReader();\r\n let base64data: string;\r\n reader.readAsDataURL(data);\r\n reader.onloadend = () => {\r\n if (reader.result) {\r\n if (typeof reader.result === 'string') {\r\n base64data = reader.result;\r\n } else {\r\n base64data = reader.result.toString();\r\n }\r\n } else {\r\n console.log('Reader result is empty');\r\n }\r\n return base64data;\r\n };\r\n }\r\n\r\n private documentLoadError(error: any) {\r\n this.loadError = error;\r\n }\r\n}\r\n","<div #foxitPdfViewer class=\"ap-foxit-pdf-web-parent\" style=\"width:100%;height:800px;\">\r\n</div>\r\n","<div class=\"image-viewer\">\r\n <div class=\"image-container\">\r\n <div *ngIf=\"!loadingImage\" class=\"image-display-host\">\r\n <img class=\"image-display\"\r\n [src]=\"imageData\"\r\n apZoomable [resetSrc]=\"imageData\"\r\n (swipe)=\"onSwipeImg($event)\"/>\r\n <div *ngIf=\"!disableFullscreen\" class=\"fullscreen-overlay\">\r\n <i class=\"pull-right fa fa-arrows-alt\" (click)=\"isFullscreenMode = true\"></i>\r\n </div>\r\n </div>\r\n <div *ngIf=\"loadingImage\" class=\"flex-col center-h\">\r\n <ap-spinner size=\"3\"></ap-spinner>\r\n </div>\r\n </div>\r\n <div class=\"text-center image-footer\" *ngIf=\"pageCount && (pageCount > 1)\">\r\n <nav>\r\n <div>Pages:</div>\r\n <pagination [totalItems]=\"pageCount\"\r\n [(ngModel)]=\"currentPage\"\r\n [maxSize]=\"4\"\r\n [itemsPerPage]=\"1\"\r\n (ngModelChange)=\"pageChanged()\"\r\n class=\"pagination-sm image-viewer-paginator\"\r\n [boundaryLinks]=\"true\">\r\n </pagination>\r\n </nav>\r\n </div>\r\n <div *ngIf=\"isFullscreenMode\" class=\"fullscreen-image-viewer\">\r\n <div class=\"fullscreen-overlay\">\r\n <i class=\"pull-right fa fa-times\" (click)=\"isFullscreenMode = false\"></i>\r\n </div>\r\n <img class=\"fullscreen-image-display\"\r\n *ngIf=\"!loadingImage\"\r\n [src]=\"imageData\"\r\n apZoomable [resetSrc]=\"imageData\"\r\n (swipe)=\"onSwipeImg($event)\"/>\r\n </div>\r\n</div>\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n Output,\r\n SimpleChanges,\r\n} from '@angular/core';\r\n\r\nimport { ApHammerInput } from 'webcommon/shared';\r\n\r\n// The main logic for this class was ported from apImageViewer.js in angularjs\r\n@Component({\r\n selector: 'ap-image-viewer',\r\n templateUrl: './ap-image-viewer.component.html',\r\n})\r\nexport class ApImageViewerComponent implements OnChanges {\r\n @Input() imageData: string;\r\n @Input() pageCount?: number | null = 1;\r\n @Input() disableFullscreen = false;\r\n\r\n private currentPageValue = 1;\r\n\r\n // 2-way binding\r\n @Output() currentPageChange = new EventEmitter<number>();\r\n @Input()\r\n get currentPage() {\r\n return this.currentPageValue;\r\n }\r\n set currentPage(val) {\r\n if (val === this.currentPageValue) return;\r\n this.currentPageValue = val;\r\n this.loadingImage = true;\r\n this.currentPageChange.emit(this.currentPageValue);\r\n }\r\n\r\n isFullscreenMode = false;\r\n loadingImage = false;\r\n\r\n pageChanged() {\r\n // this.loadingImage = true;\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n if (changes.imageData && changes.imageData.currentValue) {\r\n this.loadingImage = false;\r\n\r\n }\r\n }\r\n\r\n // on swipe, change the page of the image to be current + 1, or current - 1\r\n onSwipeImg(ev: ApHammerInput) {\r\n const pageCount = this.pageCount;\r\n // if there is no pageCount, or it's <= 1, or the swipe was more of a vertical swipe,\r\n // then don't do anything\r\n if (!pageCount || pageCount <= 1 || Math.abs(ev.deltaX) <= Math.abs(ev.deltaY)) {\r\n return;\r\n }\r\n\r\n // swipe right => prev page, swipe left => next page\r\n // This is because when you're swiping to the right, you are pulling the image off the right side\r\n // of the screen, which means that you want to to go to the prev page.\r\n if (ev.deltaX > 0 && this.currentPage > 1) {\r\n this.currentPage--;\r\n this.pageChanged();\r\n } else if (ev.deltaX < 0 && this.currentPage < pageCount) {\r\n this.currentPage++;\r\n this.pageChanged();\r\n }\r\n }\r\n}\r\n","<div class=\"attachment-viewer\">\r\n <div *ngIf=\"document?.isImage\"\r\n name=\"attachment-viewer-image\">\r\n <ap-image-viewer\r\n (currentPageChange)=\"loadPage($event)\"\r\n [disableFullscreen]=\"disableFullscreen\"\r\n [imageData]=\"document?.data\"\r\n [pageCount]=\"document?.pageCount\"\r\n ></ap-image-viewer>\r\n </div>\r\n\r\n <div *ngIf=\"document?.isText\"\r\n name=\"attachment-viewer-text\">\r\n {{document?.data}}\r\n </div>\r\n\r\n <div *ngIf=\"document?.isHtml\"\r\n name=\"attachment-viewer-html\">\r\n <!-- tried to dynamically set the height of the frame using http://stackoverflow.com/questions/25880671/how-to-set-the-iframe-content-height-in-my-case\r\n This did not work because this page is loaded over http:// and the iframe is loaded with data: and browsers do not allow you to access\r\n the contents of iframes when the protocols don't match. -->\r\n <iframe [src]=\"document?.trustedData\" \r\n class=\"attachment-viewer-html\">\r\n </iframe>\r\n </div>\r\n\r\n <div *ngIf=\"document?.isCCD\"\r\n name=\"attachment-viewer-html\">\r\n <iframe [src]=\"document?.trustedData\"\r\n class=\"attachment-viewer-html\">\r\n </iframe>\r\n </div>\r\n\r\n <div *ngIf=\"document?.isPdf\"\r\n name=\"attachment-viewer-pdf\"\r\n class=\"attachment-viewer-pdf\">\r\n <p *ngIf=\"disableInlinePdf\" class=\"text-center\">\r\n This pdf document is unable to be displayed.\r\n </p>\r\n <ap-pdf *ngIf=\"!disableInlinePdf\" [src]=\"document?.trustedData\"></ap-pdf>\r\n </div>\r\n\r\n <div *ngIf=\"document?.isAudio\"\r\n name=\"attachment-viewer-audio\"\r\n class=\"attachment-viewer-audio\">\r\n <span>Audio File:<br></span>\r\n <audio id=\"audio\" controls>\r\n <source id=\"source\" [src]=\"document?.trustedData\"/>\r\n </audio>\r\n </div>\r\n\r\n <div *ngIf=\"!document?.isSupported && !loadingDocument && !loadError\"\r\n name=\"attachment-viewer-unsupported\"\r\n class=\"attachment-viewer-unsupported\">\r\n\r\n <span *ngIf=\"document?.extension\" class=\"warning\">\r\n Attachment file type is not supported. Type: ({{document?.extension}}).\r\n </span>\r\n <span *ngIf=\"!document?.extension\" class=\"warning\">\r\n Attachment file type is not known and cannot be displayed.\r\n </span>\r\n </div>\r\n\r\n <div *ngIf=\"loadingDocument && !document?.isImage\" class=\"flex-col center-h\">\r\n <ap-spinner size=\"3\"></ap-spinner>\r\n </div>\r\n\r\n <div *ngIf=\"loadError\"\r\n name=\"attachment-viewer-error\">\r\n <alert type=\"danger\">\r\n An error has occurred and the document could not be loaded.\r\n </alert>\r\n </div>\r\n</div>\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n} from '@angular/core';\r\nimport { ViewportService } from '../services/index';\r\n\r\nimport {\r\n ApDocumentBase,\r\n AttachmentDto,\r\n AttachmentRequestConfig, SystemGuid,\r\n} from 'webcommon/shared';\r\n\r\nimport { ApBaseComponent } from '../ap-base-component/index';\r\n\r\nimport {\r\n finalize,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\n\r\nimport {\r\n Observable,\r\n Subscription,\r\n} from 'rxjs';\r\n\r\nimport { DeviceSettingsRepository } from 'webcommon/legacy-common';\r\nimport { DocumentService } from './DocumentService';\r\n@Component({\r\n selector: 'ap-document-viewer',\r\n templateUrl: './ap-document-viewer.component.html',\r\n})\r\nexport class ApDocumentViewerComponent extends ApBaseComponent implements OnChanges, OnDestroy, OnInit {\r\n @Input() disableFullscreen = false;\r\n @Input() disableInlinePdf?: boolean;\r\n @Input() documentId: string;\r\n @Input() loadDocument: (documentId: string, requestConfig: AttachmentRequestConfig) => Observable<AttachmentDto>;\r\n\r\n private documentValue: ApDocumentBase | null = null;\r\n @Output() currentDocumentChange = new EventEmitter<ApDocumentBase>();\r\n\r\n private readonly pageWidth: number;\r\n private readonly pageHeight: number;\r\n\r\n loadError: any = null;\r\n\r\n @Output() loadingDocumentChange = new EventEmitter<boolean>(true);\r\n private loadingDocumentValue = false;\r\n get loadingDocument(): boolean {\r\n return this.loadingDocumentValue;\r\n }\r\n set loadingDocument(val) {\r\n this.loadingDocumentValue = val;\r\n this.loadingDocumentChange.emit(val);\r\n }\r\n\r\n get document(): ApDocumentBase | null {\r\n return this.documentValue;\r\n }\r\n set document(val) {\r\n this.documentValue = val;\r\n if (val) {\r\n this.currentDocumentChange.emit(val);\r\n }\r\n }\r\n\r\n constructor(\r\n viewportService: ViewportService,\r\n private readonly documentService: DocumentService,\r\n private readonly deviceSettingsRepository: DeviceSettingsRepository,\r\n private readonly systemGuid: SystemGuid,\r\n ) {\r\n super();\r\n this.pageWidth = viewportService.getWidth();\r\n this.pageHeight = viewportService.getHeight();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges) {\r\n const documentIdChanges = changes.documentId;\r\n if (documentIdChanges) {\r\n this.loadDocumentInternal(documentIdChanges.currentValue, documentIdChanges.previousValue, 1);\r\n }\r\n }\r\n\r\n ngOnInit() {\r\n // If there is no value specified for disableInlinePdf,\r\n // then use the default logic to determine the value.\r\n // This essentially means that if you want to use the default logic, then don't fill in this binding.\r\n if (this.disableInlinePdf === undefined) {\r\n this.disableInlinePdf = !this.deviceSettingsRepository.supportsInlinePdf();\r\n }\r\n }\r\n\r\n loadPage(page: number) {\r\n this.loadDocumentInternal(this.documentId, this.documentId, page);\r\n }\r\n\r\n override ngOnDestroy() {\r\n this.documentService.disposeDocument(this.document);\r\n super.ngOnDestroy();\r\n }\r\n\r\n loadDocumentInternal(documentId: string, previousDocumentId: string, page: number): Subscription {\r\n if (documentId !== previousDocumentId) {\r\n // dispose of previous document, since we are replacing it\r\n this.documentService.disposeDocument(this.document);\r\n\r\n this.loadError = null;\r\n this.document = null;\r\n }\r\n\r\n if (!documentId || documentId === this.systemGuid.GuidEmpty) {\r\n return Subscription.EMPTY;\r\n }\r\n\r\n this.loadingDocument = true;\r\n\r\n // Request double the device's resolution so we have a little give in the zooming department.\r\n // ^ this comment came from legacy ap-document-viewer in angularjs\r\n const request: AttachmentRequestConfig = {\r\n height: this.pageHeight * 2,\r\n page,\r\n width: this.pageWidth * 2,\r\n };\r\n\r\n const sub = this.loadDocument(documentId, request).pipe(\r\n finalize(() => this.documentLoadComplete()),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data) => this.documentLoadSuccess(data),\r\n (error) => this.documentLoadError(error),\r\n );\r\n\r\n return sub;\r\n }\r\n\r\n private documentLoadSuccess(attachment: AttachmentDto) {\r\n // dispose of previous document, since we are replacing it\r\n this.documentService.disposeDocument(this.document);\r\n\r\n this.loadError = null;\r\n this.document = this.documentService.mapFromAttachment(attachment);\r\n }\r\n\r\n private documentLoadComplete() {\r\n this.loadingDocument = false;\r\n }\r\n\r\n private documentLoadError(error: any) {\r\n this.loadError = error;\r\n }\r\n}\r\n","import {\r\n Directive,\r\n HostListener,\r\n Input,\r\n} from '@angular/core';\r\n\r\nimport { ApBaseDirective } from '../ap-base-component/index';\r\n\r\nimport { takeUntil } from 'rxjs/operators';\r\n\r\nimport { DownloadableDocument } from 'webcommon/shared';\r\n\r\nimport { DocumentService } from './DocumentService';\r\n\r\nimport { Observable } from 'rxjs';\r\n\r\n// this is used if there is no specified FileName\r\nconst defaultFileName = 'document';\r\n\r\n@Directive({\r\n selector: '[apSaveToFile]',\r\n})\r\nexport class ApSaveToFileDirective extends ApBaseDirective {\r\n @Input() documentDownload: () => Observable<DownloadableDocument>;\r\n @Input() fileName?: string;\r\n\r\n constructor(\r\n private readonly documentService: DocumentService,\r\n ) {\r\n super();\r\n }\r\n\r\n @HostListener('click')\r\n onClick() {\r\n this.documentDownload().pipe(\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (doc) => this.documentLoaded(doc),\r\n (err) => console.error(err),\r\n );\r\n }\r\n\r\n private documentLoaded(doc: DownloadableDocument) {\r\n // if a fileName is passed in, it will be used instead of the FileName from the document\r\n if (this.fileName) {\r\n doc.FileName = this.fileName;\r\n }\r\n this.documentService.tryDownloadToFile(doc, defaultFileName);\r\n }\r\n}\r\n","<!-- Non-PDF attachments are being converted to PDF, but unless the message gets reloaded from the DB, the extensions don't get updated.\r\n Despite this, the converted attachements need to load in Foxit. It checks which extensions are being converted, if it's being converted,\r\n it will open in Foxit. -->\r\n<!-- <div *ngIf=\"!attachmentHandlerLoading\"> -->\r\n<div class=\"ap-enhanced-document-viewer\" *ngIf=\"!attachmentHandlerLoading\" [ngSwitch]=\"currentView\">\r\n <ap-sign-pdf *ngSwitchCase=\"1\"\r\n [disableFullscreen]=\"disableFullscreen\"\r\n [disableInlinePdf]=\"disableInlinePdf\"\r\n [loadDocument]=\"onDocumentLoadRef\"\r\n [documentId]=\"documentId\"\r\n (currentDocumentChange)=\"currentDocumentChanged($event)\">\r\n </ap-sign-pdf>\r\n <ap-document-viewer *ngSwitchCase=\"2\"\r\n [disableFullscreen]=\"disableFullscreen\"\r\n [disableInlinePdf]=\"disableInlinePdf\"\r\n [loadDocument]=\"onDocumentLoadRef\"\r\n [documentId]=\"documentId\"\r\n (currentDocumentChange)=\"currentDocumentChanged($event)\"\r\n (loadingDocumentChange)=\"loadingDocument = $event\"\r\n ></ap-document-viewer>\r\n <div *ngSwitchCase=\"0\">\r\n <button class=\"windows-viewer-button\" mat-raised-button *ngIf=\"isPrm; else notPrm\" (click)=\"openWindowsViewer()\">Open in external viewer</button>\r\n <ng-template #notPrm>\r\n <span>Windows viewer is not available in FND</span>\r\n </ng-template>\r\n </div>\r\n <ng-template *ngSwitchCase=\"null\">\r\n <!-- Remove this in the future -->\r\n </ng-template>\r\n</div>\r\n<div class=\"text-center\" *ngIf=\"canOpenInSeparateTab() && !loadingDocument\">\r\n <span>\r\n <a (click)=\"onDocumentOpenInSeparateTab(documentId)\"\r\n class=\"clickable\">View in a separate tab</a>\r\n </span>\r\n</div>\r\n<div class=\"text-center\" *ngIf=\"canDownloadDocument() && !loadingDocument\">\r\n <span [hidden]=\"downloadingDocument\">\r\n Download\r\n <a class=\"clickable\"\r\n apSaveToFile\r\n [documentDownload]=\"onDocumentDownloadRef\"\r\n [fileName]=\"downloadFileName\">here</a>.\r\n </span>\r\n <ap-spinner *ngIf=\"downloadingDocument\"></ap-spinner>\r\n</div>\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n Output,\r\n SimpleChanges, ViewChild,\r\n} from '@angular/core';\r\nimport {\r\n Observable,\r\n of,\r\n} from 'rxjs';\r\nimport {\r\n finalize, takeUntil,\r\n} from 'rxjs/operators';\r\nimport { BridgeService, DeviceSettingsRepository } from 'webcommon/legacy-common';\r\nimport {\r\n ApDocumentBase,\r\n AttachmentDto,\r\n AttachmentHandlerOptionsDto,\r\n AttachmentRequestConfig,\r\n DownloadableDocument,\r\n} from 'webcommon/shared';\r\nimport {AttachmentHandlerSignatureAQN} from 'webcommon/webapi';\r\nimport { ApBaseComponent } from '../ap-base-component/index';\r\nimport { DocumentService } from './DocumentService';\r\nimport {ApSignPdfComponent, DeferredFoxitPdfRenderer} from './pdfs/index';\r\n\r\n@Component({\r\n selector: 'ap-enhanced-document-viewer',\r\n templateUrl: './ap-enhanced-document-viewer.component.html',\r\n})\r\nexport class ApEnhancedDocumentViewerComponent extends ApBaseComponent implements OnChanges {\r\n\r\n @Input() disableFullscreen = false;\r\n @Input() disableInlinePdf?: boolean;\r\n @Input() documentId: string;\r\n @Input() documentLoad: (documentId: string, requestConfig: AttachmentRequestConfig) => Observable<AttachmentDto>;\r\n @Input() getAttachmentHandler?: (documentId: string) => Observable<AttachmentHandlerOptionsDto>;\r\n\r\n @Input() enableDownload = false;\r\n @Input() downloadFileName?: string;\r\n @Input() documentDownload?: (documentId: string) => Observable<DownloadableDocument>;\r\n @Input() isReadOnly: boolean;\r\n @Input() messageStatus: string | null = null;\r\n\r\n @Input() hasStaticUrl?: boolean;\r\n @Input() documentGetStaticUrl?: (documentId: string) => Observable<string>;\r\n @Input() documentExtension?: string;\r\n\r\n @Input() useViewerOverride?: 0 | 1 | 2;\r\n\r\n @Output() attachmentHandlerChanged: EventEmitter<string> = new EventEmitter();\r\n\r\n @ViewChild(ApSignPdfComponent) private apSignPdf?: ApSignPdfComponent;\r\n get deferredPdfRenderer(): DeferredFoxitPdfRenderer | undefined {\r\n return this.apSignPdf?.deferredPdfRenderer;\r\n }\r\n\r\n // tslint:disable-next-line: variable-name\r\n private _attachmentHandler: string;\r\n get attachmentHandler(): string {\r\n return this._attachmentHandler;\r\n }\r\n set attachmentHandler(val: string) {\r\n this._attachmentHandler = val;\r\n this.attachmentHandlerChanged.emit(val);\r\n }\r\n\r\n attachmentHandlerLoading = false;\r\n attachmentAutoOpen = false;\r\n\r\n downloadingDocument = false;\r\n loadingDocument = false;\r\n foxitConvertableExtensions = [\r\n 'pdf',\r\n 'jpg',\r\n 'jpeg',\r\n 'png',\r\n 'tiff',\r\n 'tif',\r\n 'docx',\r\n 'doc',\r\n 'rtf',\r\n ];\r\n readonly isPrm: boolean;\r\n currentView: 0 | 1 | 2 | null = null;\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.documentId && changes.documentId.currentValue) {\r\n this.setAttachmentHandler(changes.documentId.currentValue);\r\n }\r\n if (changes.isReadOnly) {\r\n this.currentView = this.getViewer();\r\n }\r\n }\r\n\r\n private onDocumentLoad(documentId: string, requestConfig: AttachmentRequestConfig): Observable<AttachmentDto> {\r\n return this.documentLoad(documentId, requestConfig);\r\n }\r\n\r\n // Have to do this to be able to pass a reference to this function without losing the 'this' binding.\r\n // These are essentially just wrapper functions over the actual logic.\r\n onDocumentLoadRef = (documentId: string, requestConfig: AttachmentRequestConfig) => {\r\n return this.onDocumentLoad(documentId, requestConfig);\r\n }\r\n\r\n private onDocumentDownload(): Observable<DownloadableDocument> {\r\n if (!this.documentDownload) {\r\n return of({\r\n Data: '',\r\n });\r\n }\r\n\r\n this.downloadingDocument = true;\r\n const download$ = this.documentDownload(this.documentId).pipe(\r\n finalize(() => this.documentDownloadComplete()),\r\n );\r\n return download$;\r\n }\r\n\r\n onDocumentDownloadRef = () => {\r\n return this.onDocumentDownload();\r\n }\r\n\r\n constructor(\r\n private readonly documentService: DocumentService,\r\n private readonly bridgeService: BridgeService,\r\n private readonly deviceSettingsRepository: DeviceSettingsRepository,\r\n ) {\r\n super();\r\n this.isPrm = this.deviceSettingsRepository.isPrm;\r\n }\r\n\r\n // 0 - Windows viewer\r\n // 1 - Foxit viewer\r\n // 2 - Other viewer\r\n getViewer(): 0 | 1 | 2 {\r\n if (this.useViewerOverride) return this.useViewerOverride;\r\n if (!this.attachmentHandler) {\r\n return 0;\r\n }\r\n if (this.attachmentHandler === AttachmentHandlerSignatureAQN &&\r\n this.isReadOnly === false &&\r\n this.messageStatus !== 'Approve'\r\n ) {\r\n return 1;\r\n }\r\n return 2;\r\n }\r\n\r\n openWindowsViewer(): void {\r\n this.bridgeService.fireEvent('openAttachment', { attachmentId: this.documentId });\r\n }\r\n\r\n setAttachmentHandler(documentId: string) {\r\n if (!this.getAttachmentHandler) {\r\n return;\r\n }\r\n this.attachmentHandlerLoading = true;\r\n this.getAttachmentHandler(documentId).pipe(\r\n finalize(() => this.onHandlerLoadComplete()),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data) => this.onHandlerLoadSuccess(data),\r\n );\r\n }\r\n\r\n private onHandlerLoadComplete() {\r\n this.attachmentHandlerLoading = false;\r\n }\r\n\r\n private onHandlerLoadSuccess(data: AttachmentHandlerOptionsDto) {\r\n this.attachmentHandler = data.HandlerAQN;\r\n this.attachmentAutoOpen = data.AutoOpen;\r\n\r\n this.currentView = this.getViewer();\r\n\r\n if (this.currentView === 0) {\r\n this.currentDocumentChanged(null);\r\n\r\n // Auto open the attachment in the windows viewer\r\n if (this.attachmentAutoOpen) {\r\n this.openWindowsViewer();\r\n }\r\n }\r\n }\r\n\r\n currentDocumentChanged(doc: ApDocumentBase | null) {\r\n // don't try to update hasStaticUrl unless a value wasn't passed in\r\n if (this.hasStaticUrl !== undefined) {\r\n return;\r\n }\r\n\r\n if (!doc) {\r\n this.hasStaticUrl = false;\r\n return;\r\n }\r\n\r\n this.hasStaticUrl = this.documentService.hasStaticUrl(doc);\r\n }\r\n\r\n canDownloadDocument() {\r\n return this.enableDownload && this.documentDownload && this.documentService.supportsDownloadToFile();\r\n }\r\n\r\n canOpenInSeparateTab() {\r\n return this.hasStaticUrl && this.documentGetStaticUrl && this.documentService.supportsOpenInSeparateTab();\r\n }\r\n\r\n private documentDownloadComplete() {\r\n this.downloadingDocument = false;\r\n }\r\n\r\n onDocumentOpenInSeparateTab(documentId: string) {\r\n if (!this.documentGetStaticUrl) {\r\n return;\r\n }\r\n this.documentService.openUrlInSeparateTab(this.documentGetStaticUrl(documentId));\r\n }\r\n}\r\n","import { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { ScrollingModule } from '@angular/cdk/scrolling';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { EditorModule } from '@tinymce/tinymce-angular';\r\nimport {\r\n AlertModule,\r\n} from 'ngx-bootstrap/alert';\r\nimport {\r\n CollapseModule,\r\n} from 'ngx-bootstrap/collapse';\r\nimport {\r\n BsDatepickerModule,\r\n} from 'ngx-bootstrap/datepicker';\r\nimport {\r\n ModalModule,\r\n} from 'ngx-bootstrap/modal';\r\nimport {\r\n PaginationModule,\r\n} from 'ngx-bootstrap/pagination';\r\nimport {\r\n TabsModule,\r\n} from 'ngx-bootstrap/tabs';\r\n\r\nimport { ToastaModule } from 'ngx-toasta';\r\n\r\nimport { MatLegacyAutocompleteModule as MatAutocompleteModule } from '@angular/material/legacy-autocomplete';\r\nimport { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';\r\nimport { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';\r\nimport { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';\r\nimport { MatLegacyChipsModule as MatChipsModule } from '@angular/material/legacy-chips';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatExpansionModule } from '@angular/material/expansion';\r\nimport { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';\r\nimport { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';\r\nimport { MatLegacyRadioModule as MatRadioModule } from '@angular/material/legacy-radio';\r\nimport { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';\r\nimport { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';\r\nimport { MatLegacyTableModule as MatTableModule } from '@angular/material/legacy-table';\r\nimport { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';\r\nimport { MatLegacyTabsModule as MatTabsModule } from '@angular/material/legacy-tabs';\r\nimport { MatLegacySliderModule as MatSliderModule } from '@angular/material/legacy-slider';\r\n\r\nimport {\r\n ReactiveFormsModule,\r\n} from '@angular/forms';\r\n\r\nimport {\r\n ApAlertComponent,\r\n} from './ap-alert';\r\nimport {\r\n ApComboboxComponent,\r\n} from './ap-combobox';\r\nimport {\r\n ApUIConfigurationSaveHeaderComponent,\r\n} from './ap-configuration';\r\nimport {\r\n ApConfirmModalComponent,\r\n} from './ap-confirm';\r\nimport {\r\n ApDatePickerComponent,\r\n} from './ap-date-picker';\r\nimport {\r\n ApDatePickerNextPrevComponent,\r\n} from './ap-datepicker-next-prev';\r\nimport {\r\n ApErrorMessageComponent,\r\n} from './ap-error-message';\r\nimport {\r\n ApFileUploadComponent,\r\n} from './ap-file-upload';\r\nimport {\r\n ApNumericUpDownComponent,\r\n} from './ap-numeric-up-down';\r\nimport {\r\n ApSearchListComponent,\r\n} from './ap-search-list';\r\nimport {\r\n ApSelectComponent,\r\n} from './ap-select';\r\nimport {\r\n ApSingleFieldEditorModalComponent,\r\n} from './ap-single-field-editor-modal';\r\nimport {\r\n ApTimeFrameComponent,\r\n ApTimeFrameSelectorModalComponent,\r\n} from './ap-timeframe';\r\nimport {\r\n ApWarningUnsavedChangesModalComponent,\r\n ApWarningModalComponent,\r\n} from './ap-warning';\r\nimport {\r\n ApAutofocusDirective,\r\n ApCheckboxDirective,\r\n ApColorBorderDirective,\r\n ApFixedHeaderDirective,\r\n ApFormFocusDirective,\r\n ApLongTouchDirective,\r\n ApMaxHeightDirective,\r\n ApPhoneNumberMaskDirective,\r\n ApRequiredDirective,\r\n ApRequiredFromMetadataDirective,\r\n ApResizedDirective,\r\n ApSpinnerDirective,\r\n ApZoomableDirective,\r\n} from './directives';\r\nimport {\r\n ApDocumentViewerComponent,\r\n ApEnhancedDocumentViewerComponent,\r\n ApImageViewerComponent,\r\n ApPdfComponent,\r\n ApSaveToFileDirective,\r\n ApSignPdfComponent,\r\n} from './document-viewing';\r\nimport {\r\n InactiveFilterPipe,\r\n SafeHtmlPipe,\r\n CoerceToNullPipe,\r\n} from './pipes';\r\nimport {\r\n ApCheckSizeDirective,\r\n} from './virtual-scrolling';\r\nimport { ApTileComponent } from './ap-tile/ap-tile.component';\r\nimport { ApDropdownItemMenuComponent } from './ap-dropdown-item-menu';\r\nimport { ApIframeComponent } from './ap-iframe';\r\nimport { ApIframeModalComponent } from './ap-iframe-modal';\r\nimport { ApSliderComponent } from './ap-slider';\r\nimport { ApPillComponent } from './ap-pill';\r\nimport {\r\n ToCurrentlyLoadingPipe,\r\n ToLoadedValuePipe,\r\n ToLoadingFailurePipe,\r\n ToErrorMessagesPipe,\r\n} from './loading-util';\r\nimport { ApDynamicComponentViewerComponent } from './ap-dynamic-component-viewer';\r\nimport { ApInputClearComponent } from './ap-input-clear';\r\n\r\nconst ajsComponents = [\r\n ApSignPdfComponent,\r\n];\r\n\r\n\r\nconst documentViewingExports = [\r\n ApDocumentViewerComponent,\r\n ApEnhancedDocumentViewerComponent,\r\n ApImageViewerComponent,\r\n ApPdfComponent,\r\n ApSaveToFileDirective,\r\n];\r\n\r\nconst modalComponents = [\r\n ApConfirmModalComponent,\r\n ApIframeModalComponent,\r\n ApSingleFieldEditorModalComponent,\r\n ApTimeFrameSelectorModalComponent,\r\n ApWarningModalComponent,\r\n ApWarningUnsavedChangesModalComponent,\r\n];\r\n\r\nconst angularMaterialComponents = [\r\n MatCheckboxModule,\r\n MatAutocompleteModule,\r\n MatButtonModule,\r\n MatCardModule,\r\n MatCheckboxModule,\r\n MatChipsModule,\r\n MatDividerModule,\r\n MatExpansionModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatMenuModule,\r\n MatSelectModule,\r\n MatSliderModule,\r\n MatSnackBarModule,\r\n MatRadioModule,\r\n MatTableModule,\r\n MatTooltipModule,\r\n MatTabsModule,\r\n ReactiveFormsModule,\r\n];\r\n\r\nconst myExports = [\r\n ...ajsComponents,\r\n ...documentViewingExports,\r\n ...modalComponents,\r\n ApAlertComponent,\r\n ApAutofocusDirective,\r\n ApCheckboxDirective,\r\n ApCheckSizeDirective,\r\n ApColorBorderDirective,\r\n ApComboboxComponent,\r\n ApConfirmModalComponent,\r\n ApDatePickerComponent,\r\n ApDatePickerNextPrevComponent,\r\n ApDropdownItemMenuComponent,\r\n ApDynamicComponentViewerComponent,\r\n ApErrorMessageComponent,\r\n ApFileUploadComponent,\r\n ApFixedHeaderDirective,\r\n ApFormFocusDirective,\r\n ApIframeComponent,\r\n ApLongTouchDirective,\r\n ApMaxHeightDirective,\r\n ApNumericUpDownComponent,\r\n ApPhoneNumberMaskDirective,\r\n ApPillComponent,\r\n ApRequiredDirective,\r\n ApRequiredFromMetadataDirective,\r\n ApResizedDirective,\r\n ApSearchListComponent,\r\n ApSelectComponent,\r\n ApSliderComponent,\r\n ApSpinnerDirective,\r\n ApTileComponent,\r\n ApTimeFrameComponent,\r\n ApTimeFrameSelectorModalComponent,\r\n ApUIConfigurationSaveHeaderComponent,\r\n ApWarningModalComponent,\r\n ApZoomableDirective,\r\n CoerceToNullPipe,\r\n InactiveFilterPipe,\r\n SafeHtmlPipe,\r\n ToCurrentlyLoadingPipe,\r\n ToErrorMessagesPipe,\r\n ToLoadedValuePipe,\r\n ToLoadingFailurePipe,\r\n ApInputClearComponent,\r\n];\r\n\r\n@NgModule({\r\n declarations: myExports,\r\n exports: [\r\n ...angularMaterialComponents,\r\n CommonModule,\r\n AlertModule,\r\n BsDatepickerModule,\r\n CollapseModule,\r\n DragDropModule,\r\n EditorModule,\r\n FormsModule,\r\n ModalModule,\r\n PaginationModule,\r\n ScrollingModule,\r\n ToastaModule,\r\n TranslateModule,\r\n TabsModule,\r\n ...myExports\r\n ],\r\n imports: [\r\n ...angularMaterialComponents,\r\n CommonModule,\r\n AlertModule,\r\n BsDatepickerModule,\r\n CollapseModule,\r\n EditorModule,\r\n FormsModule,\r\n ModalModule,\r\n PaginationModule,\r\n ScrollingModule,\r\n TranslateModule,\r\n TabsModule,\r\n DragDropModule,\r\n ToastaModule\r\n ],\r\n})\r\nexport class CoreUiModule {\r\n}\r\n","import { HammerGestureConfig } from '@angular/platform-browser';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class BaseHammerConfig extends HammerGestureConfig {\r\n // In this class, put overrides for events, or add other events that should be handled by Hammer,\r\n // or default options for Hammer.\r\n // Also this can be configured further by implementing buildHammer like this:\r\n // buildHammer(element: HTMLElement): HammerInstance {\r\n // return super.buildHammer(element);\r\n // }\r\n\r\n // This adds the ability to listen for the 'doubletap' event.\r\n // Simply adding this event to the list of ones that this config supports works for the 'doubletap' event\r\n // because the current version of hammerjs already has a default recognizer setup for the 'doubletap' event.\r\n // This means it won't necessarily be this simple for other custom events we may want to handle in hammerjs.\r\n override events = ['doubletap'];\r\n\r\n // Currently we are not using the 'rotate' event anywhere, so this will disable it for now\r\n override overrides = {\r\n rotate: { enable: false },\r\n };\r\n}\r\n","import {\r\n Component, EventEmitter, HostListener, Input, OnInit, Output, ViewChild, ElementRef,\r\n} from '@angular/core';\r\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\n\r\nimport {\r\n ApBaseComponent,\r\n} from 'webcommon/core-ui';\r\n\r\nimport {\r\n BrowserService,\r\n} from 'webcommon/legacy-common';\r\n\r\nexport interface TransactionCompleteEvent {\r\n eventName: 'tc-redirectUrl';\r\n data: string;\r\n}\r\n\r\nexport function isTCEvent(value: any): value is TransactionCompleteEvent {\r\n return value && (value as TransactionCompleteEvent).eventName === 'tc-redirectUrl';\r\n}\r\n\r\n@Component({\r\n selector: 'ap-payment-frame',\r\n templateUrl: './ap-payment-frame.component.html',\r\n})\r\nexport class ApPaymentFrameComponent extends ApBaseComponent implements OnInit {\r\n static readonly ajsComponentName = 'apPaymentFrame';\r\n @Input() url: string;\r\n @Output() applyPayment = new EventEmitter<string>();\r\n\r\n safeUrl: SafeResourceUrl;\r\n\r\n private readonly expectedMessageOrigin: string;\r\n\r\n // If we change around the view, it may affect this ViewChild,\r\n // and whether we need static: true, or static: false;\r\n // which would when also affect the message handler below.\r\n @ViewChild('paymentWidget', {static: true}) paymentWidgetFrame: ElementRef<HTMLIFrameElement>;\r\n\r\n constructor(\r\n private sanitizer: DomSanitizer,\r\n browserService: BrowserService\r\n ) {\r\n super();\r\n // in this case we are expecting to redirect to the same origin as the current window\r\n this.expectedMessageOrigin = browserService.getLocation().origin;\r\n }\r\n\r\n ngOnInit() {\r\n this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.url);\r\n }\r\n\r\n // For documentation purposes:\r\n // This previously used the 'load' event on the iframe to intercept the redirect that EasyPay does.\r\n // This is documented in ApEasyPayOnloadDirective as an alternative to this strategy.\r\n @HostListener('window:message', ['$event'])\r\n onPostMessage(event: MessageEvent) {\r\n // Return if the origin doesn't match what we expect/trust\r\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#notes\r\n if (event.origin !== this.expectedMessageOrigin) {\r\n return;\r\n }\r\n // Return if the source doesn't match what we expect/trust\r\n if (event.source !== this.paymentWidgetFrame.nativeElement.contentWindow) {\r\n return;\r\n }\r\n\r\n const eventObj = event.data;\r\n // Handle an event specifically for providing the redirect url returned by a completed EasyPay transaction.\r\n // Currently, this is only coming from TransactionCompleteCtrl.\r\n if (isTCEvent(eventObj)) {\r\n const redirectUrl = eventObj.data;\r\n if (!redirectUrl) {\r\n throw new Error('Invalid redirect from completed transaction');\r\n }\r\n this.applyPayment.emit(redirectUrl);\r\n }\r\n }\r\n}\r\n","<div>\r\n <iframe #paymentWidget id=\"paymentWidget\"\r\n width=\"100%\"\r\n height=\"500\"\r\n [src]=\"safeUrl\"></iframe>\r\n</div>\r\n","import { ClientConfig } from './ClientConfig';\r\n\r\nexport abstract class ContentAttributeServiceUpgrade {\r\n abstract getClientConfig(): Promise<ClientConfig>;\r\n abstract getPaymentRedirectUrl(): string;\r\n}\r\n\r\nexport function ContentAttributeServiceUpgradeFactory(i: angular.auto.IInjectorService) {\r\n return i.get<ContentAttributeServiceUpgrade>('ContentAttributeService');\r\n}\r\n\r\nexport const ContentAttributeServiceUpgradeAjsProvider = {\r\n deps: ['$injector'],\r\n provide: ContentAttributeServiceUpgrade,\r\n useFactory: ContentAttributeServiceUpgradeFactory,\r\n};\r\n","import { baseEnvironment } from './base-environment';\r\n\r\nconst prodEnvironment = {\r\n devHosted: false,\r\n production: true,\r\n};\r\n\r\nexport const environment = {\r\n ...baseEnvironment,\r\n ...prodEnvironment,\r\n};\r\n","// The file contents for the current environment will overwrite these during build.\r\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\r\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\r\n// The list of which env maps to which file can be found in `angular.json`.\r\n\r\nexport const baseEnvironment = {\r\n API_KEY: 'C83BBF42-DA17-4F58-9AA0-68F417419313',\r\n CLIENT_VERSION: '0.2.0.1114',\r\n GATEWAYS: [{url: 'https://gateway.aprima.com/api', prefix: 'prod'}, {url: 'http://gateway-dev.aprima.com:8310/api', prefix: 'dev'}],\r\n GIT_COMMIT_HASH: '18eb9439c5d936bcf3cc84057a0ff1d80878bdaa',\r\n SERVER_API_VERSION: 'v1',\r\n};\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { environment } from 'source/web/src/environments/environment';\r\nimport { AppConfiguration, GatewayConfiguration } from 'webcommon/shared';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PatientPortalConfigurationRepository implements AppConfiguration {\r\n public get API_KEY(): string {\r\n return environment.API_KEY;\r\n }\r\n\r\n public get CLIENT_VERSION(): string {\r\n return environment.CLIENT_VERSION;\r\n }\r\n\r\n public get DEV_HOSTED(): boolean {\r\n return environment.devHosted;\r\n }\r\n\r\n public get GATEWAYS(): GatewayConfiguration[] {\r\n return environment.GATEWAYS;\r\n }\r\n\r\n public get GIT_COMMIT_HASH(): string {\r\n return environment.GIT_COMMIT_HASH;\r\n }\r\n\r\n public get SERVER_API_VERSION(): string {\r\n return environment.SERVER_API_VERSION;\r\n }\r\n}\r\n","import {\r\n AppRoute,\r\n AprimaTransitionRequest,\r\n WebViewManager,\r\n} from 'webcommon/shared';\r\n\r\nexport abstract class BrowserWebViewManagerJs implements WebViewManager {\r\n abstract activateView(appRoute: AppRoute, transition: AprimaTransitionRequest): boolean;\r\n abstract goBack(): void;\r\n}\r\n\r\nexport function BrowserWebViewManagerJsFactory(i: angular.auto.IInjectorService) {\r\n return i.get<BrowserWebViewManagerJs>('BrowserWebViewManager');\r\n}\r\n\r\nexport const BrowserWebViewManagerJsFactoryAjsProvider = {\r\n deps: ['$injector'],\r\n provide: BrowserWebViewManagerJs,\r\n useFactory: BrowserWebViewManagerJsFactory,\r\n};\r\n","import {\r\n AprimaTransitionRequest,\r\n TransitionManager,\r\n} from 'webcommon/shared';\r\n\r\nexport abstract class TransitionManagerJs implements TransitionManager {\r\n abstract transition(transition: AprimaTransitionRequest, replaceState?: boolean): boolean;\r\n abstract replaceCurrentState(transition: AprimaTransitionRequest): void;\r\n abstract goBack(): void;\r\n abstract getPreviousTransition(): AprimaTransitionRequest;\r\n}\r\n\r\nexport function TransitionManagerJsFactory(i: angular.auto.IInjectorService) {\r\n return i.get<TransitionManagerJs>('TransitionManagerJs');\r\n}\r\n\r\nexport const TransitionManagerJsFactoryAjsProvider = {\r\n deps: ['$injector'],\r\n provide: TransitionManagerJs,\r\n useFactory: TransitionManagerJsFactory,\r\n};\r\n","import {\r\n AppRoute,\r\n AprimaTransitionRequest,\r\n WebViewManager,\r\n} from 'webcommon/shared';\r\n\r\nexport abstract class XamarinWebViewManagerJs implements WebViewManager {\r\n abstract activateView(appRoute: AppRoute, transition: AprimaTransitionRequest): boolean;\r\n abstract goBack(): void;\r\n}\r\n\r\nexport function XamarinWebViewManagerJsFactory(i: angular.auto.IInjectorService) {\r\n return i.get<XamarinWebViewManagerJs>('XamarinWebViewManager');\r\n}\r\n\r\nexport const XamarinWebViewManagerJsFactoryAjsProvider = {\r\n deps: ['$injector'],\r\n provide: XamarinWebViewManagerJs,\r\n useFactory: XamarinWebViewManagerJsFactory,\r\n};\r\n","import {\r\n Component,\r\n EventEmitter,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport {\r\n BrowserWebViewManagerJs,\r\n TransitionManagerJs,\r\n XamarinWebViewManagerJs,\r\n} from './services/index';\r\nimport {\r\n TransitionManagerService,\r\n WebViewManagerService,\r\n} from 'webcommon/legacy-common';\r\n\r\n@Component({\r\n selector: 'ap-force-load-angular',\r\n template: '',\r\n})\r\nexport class ForceLoadAngularComponent implements OnInit {\r\n static readonly ajsComponentName = 'apForceLoadAngular';\r\n @Output() angularInitialized = new EventEmitter();\r\n\r\n constructor(\r\n private browserWebViewManagerJs: BrowserWebViewManagerJs,\r\n private transitionManagerJs: TransitionManagerJs,\r\n private transitionManagerService: TransitionManagerService,\r\n private webViewManagerService: WebViewManagerService,\r\n private xamarinWebViewManagerJs: XamarinWebViewManagerJs,\r\n ) {\r\n this.transitionManagerService.loadConfiguration(this.transitionManagerJs);\r\n this.webViewManagerService.loadConfiguration(this.browserWebViewManagerJs, this.xamarinWebViewManagerJs);\r\n }\r\n\r\n ngOnInit() {\r\n this.angularInitialized.emit();\r\n }\r\n}\r\n","import {NgModule, Optional, SkipSelf} from '@angular/core';\r\nimport type {\r\n IModule,\r\n} from 'angular';\r\nimport {\r\n downgradeComponent,\r\n downgradeInjectable,\r\n} from '@angular/upgrade/static';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport {\r\n AppRoutesAjsProvider,\r\n AprimaAnalyticsService,\r\n AprimaCacheService,\r\n ConfigurationRepository,\r\n CurrentUserService,\r\n DeviceSettingsRepository,\r\n ErrorServiceAjsProvider,\r\n LogInService,\r\n LogOffService,\r\n ObjUtilService,\r\n ServerInfoRepository,\r\n TransitionManagerService,\r\n UnitConversionServiceAjsProvider,\r\n WebCommonStorageRepository,\r\n WebViewManagerService,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n NgZoneService,\r\n SystemGuid,\r\n} from 'webcommon/shared';\r\nimport {\r\n SpinnerService,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n HostedBridgeService,\r\n} from 'webcommon/common-api';\r\nimport {\r\n ListRepository,\r\n} from 'webcommon/webapi';\r\n\r\nimport { ForceLoadAngularComponent } from './force-load-angular.component';\r\nimport {\r\n BrowserWebViewManagerJsFactoryAjsProvider,\r\n TransitionManagerJsFactoryAjsProvider,\r\n XamarinWebViewManagerJsFactoryAjsProvider,\r\n} from './services/index';\r\n\r\n@NgModule({\r\n declarations: [\r\n ForceLoadAngularComponent,\r\n ],\r\n providers: [\r\n // AjsProviders are meant to be singletons, so they should be added here for now, instead of spread across other modules.\r\n // This will allow these to even be singletons across lazy-loaded modules.\r\n // This is so that they are NOT instantiated via the useFactory multiple times,\r\n // which can happen if the module they are provided in is imported in multiple feature modules.\r\n // (Although, this only appears to cause an issue with lazy-loaded modules, not eager modules)\r\n // Currently, this module is not imported multiple times, and the constructor below is used to enforce that.\r\n // See https://angular.io/guide/singleton-services\r\n // This type of behavior is still possible to achieve if the module is imported multiple times, but then you\r\n // have to use the forRoot() pattern (https://angular.io/guide/singleton-services#the-forroot-pattern).\r\n // I guess if for some reason, we don't want an upgraded ajs service to have this behavior,\r\n // then it could be provided elsewhere, but there aren't any of those currently.\r\n AppRoutesAjsProvider,\r\n BrowserWebViewManagerJsFactoryAjsProvider,\r\n ErrorServiceAjsProvider,\r\n TransitionManagerJsFactoryAjsProvider,\r\n UnitConversionServiceAjsProvider,\r\n XamarinWebViewManagerJsFactoryAjsProvider,\r\n ],\r\n})\r\nexport class WebCommonAngularJSModule {\r\n // This is using the same constructor pattern as BrowserModule\r\n constructor(\r\n @Optional() @SkipSelf() parentModule: WebCommonAngularJSModule | null,\r\n ) {\r\n if (parentModule) {\r\n throw new Error(\r\n `WebCommonAngularJSModule is already loaded. Import it only once, usually in the AppModule only`);\r\n }\r\n }\r\n\r\n // tslint:disable:max-line-length\r\n static registerAngularJS(module: IModule): void {\r\n module\r\n .factory(AprimaAnalyticsService.ajsFactoryName, downgradeInjectable(AprimaAnalyticsService))\r\n .factory(AprimaCacheService.ajsFactoryName, downgradeInjectable(AprimaCacheService))\r\n .factory(ConfigurationRepository.ajsFactoryName, downgradeInjectable(ConfigurationRepository))\r\n .factory(CurrentUserService.ajsFactoryName, downgradeInjectable(CurrentUserService))\r\n .factory(DeviceSettingsRepository.ajsFactoryName, downgradeInjectable(DeviceSettingsRepository))\r\n .factory(HostedBridgeService.ajsFactoryName, downgradeInjectable(HostedBridgeService))\r\n .factory(ListRepository.ajsFactoryName, downgradeInjectable(ListRepository))\r\n .factory(LogInService.ajsFactoryName, downgradeInjectable(LogInService))\r\n .factory(LogOffService.ajsFactoryName, downgradeInjectable(LogOffService))\r\n .factory(ObjUtilService.ajsFactoryName, downgradeInjectable(ObjUtilService))\r\n .factory(ServerInfoRepository.ajsFactoryName, downgradeInjectable(ServerInfoRepository))\r\n .factory(SpinnerService.ajsFactoryName, downgradeInjectable(SpinnerService))\r\n .factory(SystemGuid.ajsFactoryName, downgradeInjectable(SystemGuid))\r\n .factory('TranslateService', downgradeInjectable(TranslateService))\r\n .factory(WebCommonStorageRepository.ajsFactoryName, downgradeInjectable(WebCommonStorageRepository))\r\n .factory(TransitionManagerService.ajsFactoryName, downgradeInjectable(TransitionManagerService))\r\n .factory(WebViewManagerService.ajsFactoryName, downgradeInjectable(WebViewManagerService));\r\n\r\n // NgZone is downgraded here, so it can be injected in AngularJS to keep certain parts\r\n // of the application from running in the Angular zone, mainly for performance reasons.\r\n // The only use case for it right now is so that the Hammer stuff (and a few other event listeners) will\r\n // not be impacted by the Angular change detection.\r\n // If at some point the files using NgZoneService in ajs were ported to Angular or something,\r\n // then this obviously would not need to be downgraded anymore.\r\n // But also, when porting those files over, they wouldn't need to retain a reference to this service most likely.\r\n // The main reason is because those files using it in ajs need it because\r\n // of the fact that they are in a hybrid app that uses UpgradeComponents and stuff,\r\n // but if they exist in Angular instead of ajs, they shouldn't need these zone utilities to work.\r\n module.factory(NgZoneService.ajsFactoryName, downgradeInjectable(NgZoneService));\r\n\r\n // Currently, ForceLoadAngularComponent is downgraded with propagateDigest = true,\r\n // which causes the Angular change detection to run on every $digest.\r\n // If the downgradeComponent logic changes below to be propagateDigest: false, then there are some places\r\n // in AngularJS that need to be updated to be wrapped in NgZoneService.run(),\r\n // so that they work correctly with the Angular change detection.\r\n // This includes places where we are injecting NgZoneService,\r\n // and specifically running certain code outside of the Angular Zone,\r\n // and then calling scope.$apply, or maybe even $eval, etc to initiate the AngularJS change detection.\r\n // For reference: https://angular.io/api/upgrade/static/downgradeComponent#downgradecomponent\r\n module.directive(ForceLoadAngularComponent.ajsComponentName, downgradeComponent({ component: ForceLoadAngularComponent }));\r\n }\r\n // tslint:enable:max-line-length\r\n}\r\n","import { Component, Injector, Input, OnInit } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { PatientPortalAttachmentRepository } from 'webcommon/webapi';\r\nimport { AttachmentDto, AttachmentRequestConfig, DownloadableDocument, Document } from 'webcommon/shared';\r\nimport { ApBaseModalComponent } from 'webcommon/core-ui';\r\n\r\n@Component({\r\n styleUrls: [\r\n 'patient-document-viewer-modal.component.less',\r\n ],\r\n templateUrl: './patient-document-viewer-modal.component.html',\r\n})\r\nexport class PatientDocumentViewerModalComponent extends ApBaseModalComponent<string> implements OnInit {\r\n @Input() patientId: string;\r\n @Input() document: Document;\r\n @Input() requestConfig: AttachmentRequestConfig;\r\n\r\n constructor(\r\n elementInjector: Injector,\r\n private patientPortalAttachmentRepository: PatientPortalAttachmentRepository,\r\n ) {\r\n super(elementInjector);\r\n }\r\n\r\n override ngOnInit(): void {\r\n super.ngOnInit();\r\n }\r\n\r\n loadAttachmentRef = (documentId: string, requestConfig: AttachmentRequestConfig) => {\r\n return this.loadAttachment(documentId, requestConfig);\r\n }\r\n\r\n private loadAttachment(documentId: string, requestConfig: AttachmentRequestConfig): Observable<AttachmentDto> {\r\n const { height, width, page } = requestConfig;\r\n const loadAttachment$ = this.patientPortalAttachmentRepository\r\n .getAttachmentForViewing(this.patientId, documentId, height, width, page);\r\n return loadAttachment$;\r\n }\r\n\r\n downloadAttachmentRef = () => {\r\n return this.downloadAttachment();\r\n }\r\n\r\n private downloadAttachment(): Observable<DownloadableDocument> {\r\n return this.patientPortalAttachmentRepository.getAttachmentForDownload(this.patientId, this.document.AttachmentUid);\r\n }\r\n\r\n close(): void {\r\n super.closeModal('');\r\n }\r\n\r\n cancel(): void {\r\n super.dismissModal();\r\n }\r\n}\r\n","<!-- using fnd modal styling here as it matches what is being used in the portal currently -->\r\n<div class=\"fnd-modal\">\r\n <div class=\"fnd-modal-header\">{{document.FileName}}\r\n <div class=\"fnd-close\" (click)=\"cancel()\">×</div>\r\n </div>\r\n <div class=\"fnd-modal-body\">\r\n <div>\r\n <ap-enhanced-document-viewer\r\n [documentId]=\"document.AttachmentUid\"\r\n [documentLoad]=\"loadAttachmentRef\"\r\n [documentDownload]=\"downloadAttachmentRef\"\r\n [isReadOnly]=\"'true'\"\r\n [useViewerOverride]=\"2\"\r\n [enableDownload]=\"'true'\"\r\n ></ap-enhanced-document-viewer>\r\n </div>\r\n\r\n </div>\r\n <div class=\"fnd-modal-footer\">\r\n <button class=\"center-btn-lg btn btn-default2 btn-lg\" (click)=\"close()\">Close</button>\r\n </div>\r\n</div>\r\n","import { Injectable } from '@angular/core';\r\nimport { AttachmentRequestConfig, Document } from 'webcommon/shared';\r\n\r\nimport { ApModalService } from 'webcommon/core-ui';\r\nimport { PatientDocumentViewerModalComponent } from './patient-document-viewer-modal.component';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PatientDocumentsViewerModalService {\r\n constructor(private apModalService: ApModalService) { }\r\n\r\n openModal(patientId: string, document: Document, requestConfig: AttachmentRequestConfig): Promise<string> {\r\n const initialState = { patientId, document, requestConfig };\r\n const p = this.apModalService.showComponentModal(PatientDocumentViewerModalComponent, {\r\n class: 'modal-lg',\r\n initialState,\r\n });\r\n return p;\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'fileExt',\r\n})\r\nexport class FileExtension implements PipeTransform {\r\n transform(extension: string | null): string | null {\r\n if (!extension || extension.length < 1) return extension;\r\n if (extension[0] === '.') {\r\n extension = extension.substring(1);\r\n }\r\n return extension.toUpperCase();\r\n }\r\n}\r\n","<div class=\"panel panel-default panel-flush table-responsive\" id=\"patient-documents-panel\">\r\n <div class=\"panel-content\">\r\n\r\n <div class=\"panel-heading\">\r\n {{'Documents' | translate}}\r\n <div class=\"dropdown header-menu pull-right\">\r\n <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"dropdownMenu1\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"true\">\r\n <span>{{'View' | translate }} </span>\r\n <span class=\"title-text\">{{ activeFilter.name| translate }}</span>\r\n <span class=\"caret\"></span>\r\n </button>\r\n <ul class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"dropdownMenu1\">\r\n <li *ngFor=\"let filter of filters\">\r\n <a (click)=\"updateFilter(filter)\">{{filter.name}}</a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <table id=\"ap-patient-documents-table\" class=\"table table-striped ap-patient-documents-table\">\r\n <thead>\r\n <tr>\r\n <th>{{'Date' | translate}}</th>\r\n <th>{{'Name' | translate}}</th>\r\n <th>{{'Document' | translate}}</th>\r\n <th>{{'' | translate}}</th> <!-- download -->\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-template [ngIf]=\"hasDocuments()\" [ngIfElse]=\"noDocumentsNotice\">\r\n <tr *ngFor=\"let document of documentClone\">\r\n <td>\r\n {{document.FileDate | date : 'MMMM d, yyyy'}}\r\n </td>\r\n <td>\r\n <div>\r\n {{document.FileName}}\r\n </div>\r\n <div class=\"column-subtext\">\r\n {{document.AttachmentTypeName}}\r\n </div>\r\n </td>\r\n <td>\r\n <span class=\"view-document\">\r\n <i class=\"fa fa-file fa-lg\"></i>\r\n <div>\r\n <a class=\"underline\" (click)=\"viewDocument(document)\">View Document</a>\r\n <div class=\"column-subtext\">{{document.FileExtension | fileExt}}</div>\r\n </div>\r\n </span>\r\n </td>\r\n <td>\r\n <button\r\n (click)=\"setDocumentDownloading(document)\"\r\n apSaveToFile\r\n [documentDownload]=\"onDocumentDownloadRef.bind(undefined, document.AttachmentUid)\"\r\n [fileName]=\"document.FileName\">\r\n <i *ngIf=\"!document.Downloading\" class=\"fa fa-download\"></i>\r\n <ap-spinner *ngIf=\"document.Downloading\"></ap-spinner>\r\n </button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #noDocumentsNotice>\r\n <tr>\r\n <td colspan=\"4\"><p>No documents were found.</p></td>\r\n </tr>\r\n </ng-template>\r\n </tbody>\r\n </table>\r\n </div>\r\n</div>\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { PatientPortalAttachmentRepository } from 'webcommon/webapi';\r\nimport { WebCommonStorageRepository } from 'webcommon/legacy-common';\r\nimport { PatientDocumentsViewerModalService } from './patient-document-viewer-modal/index';\r\nimport { AttachmentType, Filter, Guid, PatientDocumentSet, Document, DownloadableDocument } from 'webcommon/shared';\r\nimport { ApBaseComponent } from 'webcommon/core-ui';\r\nimport { finalize } from 'rxjs/operators';\r\nimport { Observable } from 'rxjs';\r\n\r\nconst ALL_FILTER: Filter = { name: 'All', id: Guid.empty() };\r\n\r\nclass DocumentWithDownload implements Document {\r\n Downloading = false;\r\n AttachmentTypeName: string;\r\n AttachmentTypeUid: string;\r\n PatientUid: string;\r\n AttachmentUid: string;\r\n FileName: string;\r\n FileExtension: string;\r\n FileDate: Date;\r\n LastModifiedDate: Date;\r\n\r\n constructor(doc: Document) {\r\n this.AttachmentTypeName = doc.AttachmentTypeName;\r\n this.AttachmentTypeUid = doc.AttachmentTypeUid;\r\n this.AttachmentUid = doc.AttachmentUid;\r\n this.PatientUid = doc.PatientUid;\r\n this.FileName = doc.FileName;\r\n this.FileExtension = doc.FileExtension;\r\n this.FileDate = doc.FileDate;\r\n this.LastModifiedDate = doc.LastModifiedDate;\r\n }\r\n}\r\n\r\n// tslint:disable-next-line: max-classes-per-file\r\n@Component({\r\n selector: 'patient-documents',\r\n templateUrl: './patient-documents.component.html',\r\n styleUrls: ['./patient-documents.component.less']\r\n})\r\nexport class PatientDocumentsComponent extends ApBaseComponent implements OnInit {\r\n static ajsComponentName = 'apPatientDocuments';\r\n\r\n activePatientId: string;\r\n title = 'Patient Documents';\r\n activeFilter = ALL_FILTER;\r\n documentClone: DocumentWithDownload[] = [];\r\n\r\n // DO NOT MODIFY documents\r\n readonly documents: Document[] = [];\r\n readonly filters: Filter[] = [];\r\n\r\n constructor(\r\n private patientDocumentViewerModalService: PatientDocumentsViewerModalService,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n private patientPortalAttachmentRepository: PatientPortalAttachmentRepository,\r\n ) {\r\n super();\r\n this.activePatientId = this.webCommonStorageRepository.getPatientPortalActivePatient()?.id ?? '';\r\n }\r\n\r\n private restoreDocuments(): void {\r\n Object.assign(this.documentClone, this.documents.map((doc) => new DocumentWithDownload(doc)));\r\n }\r\n\r\n private populateFilters(attachmentTypes: AttachmentType[]): void {\r\n this.filters.push(ALL_FILTER);\r\n this.filters.push(...attachmentTypes.map((x) => {\r\n return {\r\n name: x.AttachmentTypeName,\r\n id: x.AttachmentTypeUid,\r\n };\r\n }));\r\n }\r\n\r\n ngOnInit() {\r\n this.patientPortalAttachmentRepository.getDocumentList(this.activePatientId)\r\n .pipe(\r\n this.takeUntilDestroy(),\r\n ).subscribe(\r\n (response: PatientDocumentSet) => {\r\n this.documents.push(...response.Documents);\r\n this.restoreDocuments();\r\n this.populateFilters(response.AttachmentTypes);\r\n },\r\n () => { /* noop */ },\r\n );\r\n }\r\n\r\n updateFilter(filter: Filter): void {\r\n this.activeFilter = filter;\r\n\r\n if (filter.id === ALL_FILTER.id) {\r\n this.restoreDocuments();\r\n return;\r\n }\r\n\r\n this.documentClone = this.documents.filter(\r\n (x) => filter.id === x.AttachmentTypeUid,\r\n ).map(\r\n (doc) => new DocumentWithDownload(doc),\r\n );\r\n }\r\n\r\n viewDocument(document: Document): void {\r\n this.patientDocumentViewerModalService.openModal(this.activePatientId, document, {\r\n page: 1,\r\n height: 800,\r\n width: 800,\r\n }).then(\r\n () => { /* noop */ },\r\n () => { /* noop */ },\r\n );\r\n }\r\n\r\n onDocumentDownload(attachmentId: string): Observable<DownloadableDocument> {\r\n return this.patientPortalAttachmentRepository.getAttachmentForDownload(this.activePatientId, attachmentId)\r\n .pipe(finalize(() => {\r\n const document = this.documentClone.find((doc) => doc.AttachmentUid === attachmentId);\r\n if (!document) return;\r\n document.Downloading = false;\r\n }));\r\n }\r\n\r\n onDocumentDownloadRef = (attachmentId: string) => {\r\n return this.onDocumentDownload(attachmentId);\r\n }\r\n\r\n setDocumentDownloading(document: DocumentWithDownload): void {\r\n document.Downloading = true;\r\n }\r\n\r\n hasDocuments(): boolean {\r\n return (this.documentClone && (this.documentClone.length > 0));\r\n }\r\n\r\n}\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a re-layout. This re-layout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * re-layout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement | undefined;\n\n constructor(text: string, private readonly _document: Document) {\n const textarea = (this._textarea = this._document.createElement('textarea'));\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n // Making the textarea `readonly` prevents the screen from jumping on iOS Safari (see #25169).\n textarea.readOnly = true;\n this._document.body.appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try {\n // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n textarea.remove();\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document: Document;\n\n constructor(@Inject(DOCUMENT) document: any) {\n this._document = document;\n }\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","<div class=\"modal-default\">\r\n <div class=\"modal-header\">\r\n <button id=\"{{Id}}-close-button\" type=\"button\" class=\"close\" (click)=\"close()\"><span>×</span></button>\r\n <span id=\"{{Id}}-header-text\" class=\"modal-subtitle\" translate>Link Personal Health Apps - FHIR Integration</span>\r\n </div>\r\n\r\n <div class=\"modal-body modal-max-height body-text\">\r\n <div *ngIf=\"!loading && !loadError\">\r\n <div id=\"{{Id}}-registration-text\">\r\n <p translate>\r\n You can link your personal medical-records data to one or more health apps on your smartphone or other digital devices, through the FHIR protocol.\r\n </p>\r\n </div>\r\n\r\n <div *ngIf=\"!isPatientRegistered\">\r\n <div id=\"{{Id}}-registration-directions-text\">\r\n <p translate>\r\n In order to give health apps access to your medical records you must first create a FHIR account.\r\n </p>\r\n </div>\r\n\r\n <div *ngIf=\"!displayRegistrationResponse\">\r\n <button id=\"{{Id}}-registration-button\"\r\n class=\"btn btn-primary\"\r\n (click)=\"register()\"\r\n [disabled]=\"registeringPatient\"\r\n translate>\r\n <span translate [hidden]=\"registeringPatient\">Register</span>\r\n <ap-spinner *ngIf=\"registeringPatient\" size=\"1\"></ap-spinner>\r\n </button>\r\n </div>\r\n\r\n <div *ngIf=\"displayRegistrationResponse\" id=\"{{Id}}-registration-response-text\">\r\n <p class=\"registration-success\" translate>\r\n Thank you! You will receive a registration email shortly.\r\n </p>\r\n </div>\r\n\r\n <div *ngIf=\"registrationError\" id=\"{{Id}}-registration-error-text\">\r\n <p class=\"registration-failure\" translate>\r\n {{ registrationErrorMessage }}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"loading\">\r\n <div class=\"text-center\">\r\n <ap-spinner size=\"3\"></ap-spinner>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!loading && loadError\">\r\n <alert type=\"danger\" translate>An error has occurred while checking FHIR registration.</alert>\r\n </div>\r\n <div *ngIf=\"isPatientRegistered\" class=\"registeredMessage\">\r\n <p>As a Registered FHIR account user, you may copy/paste this URL into your health app to grant it access to your medical records.</p>\r\n <div>\r\n <div class=\"copy-field\">{{ fhirResourceUrl }}</div> \r\n <button id=\"{{Id}}-copy-button\"\r\n class=\"btn btn-primary\"\r\n (click)=\"copyToClipboard()\"\r\n translate title=\"COPY LINK\">\r\n <span translate>COPY LINK</span>\r\n </button>\r\n </div>\r\n <div class=\"revoke-field\"><a (click)=\"revoke()\" title=\"View your linked apps - or - unlink apps\">View your linked apps - or - unlink apps</a></div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-footer\"></div>\r\n</div>\r\n","import { Component, Injector, OnInit } from '@angular/core';\r\nimport { finalize, takeUntil } from 'rxjs/operators';\r\nimport { ApComplexModal } from 'webcommon/core-ui';\r\nimport { PatientIdentityRepository } from 'webcommon/webapi';\r\nimport { PatientIdentityResponseDto } from 'webcommon/shared';\r\nimport {Clipboard} from '@angular/cdk/clipboard';\r\n\r\n@Component\r\n({\r\n selector: 'ap-personal-health-apps-modal',\r\n templateUrl: './ap-personal-health-apps-modal.component.html',\r\n styleUrls: ['./ap-personal-health-apps-modal.component.less'],\r\n})\r\nexport class ApPersonalHealthAppsModalComponent extends ApComplexModal<boolean> implements OnInit {\r\n public baseId: string;\r\n public patientId: string;\r\n public isPatientRegisteredForFHIR: boolean;\r\n fhirResourceUrl = '';\r\n fhirUserRevokeUrl = '';\r\n\r\n displayRegistrationResponse: boolean;\r\n Id: string;\r\n isPatientRegistered: boolean;\r\n loadError = false;\r\n registrationError = false;\r\n registrationErrorMessage = 'The registration process could not be completed.';\r\n registeringPatient = false;\r\n\r\n constructor(\r\n elementInjector: Injector,\r\n private patientIdentityRepository: PatientIdentityRepository,\r\n private clipboard: Clipboard\r\n ) {\r\n super(elementInjector);\r\n this.loading = false;\r\n }\r\n\r\n override ngOnInit() {\r\n super.ngOnInit();\r\n\r\n this.isPatientRegistered = this.isPatientRegisteredForFHIR;\r\n this.displayRegistrationResponse = false;\r\n this.setId();\r\n this.load();\r\n }\r\n\r\n private load() {\r\n this.registeringPatient = false;\r\n this.loading = true;\r\n this.getPersonIdentitySubject();\r\n }\r\n\r\n private getPersonIdentitySubject() {\r\n this.patientIdentityRepository.getPersonIdentitySubject(this.patientId).pipe(\r\n finalize(() => { this.loading = false; }),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data: PatientIdentityResponseDto) => this.onGetPersonIdentitySubjectSuccess(data),\r\n (error: unknown) => {\r\n this.loadError = true;\r\n throw error;\r\n },\r\n );\r\n }\r\n\r\n private onGetPersonIdentitySubjectSuccess(result: PatientIdentityResponseDto) {\r\n if (result) {\r\n this.isPatientRegistered = true;\r\n this.fhirUserRevokeUrl = result.FhirUserRevokeUrl;\r\n this.fhirResourceUrl = result.FhirResourceUrl;\r\n }\r\n this.loadError = false;\r\n }\r\n\r\n register() {\r\n this.registeringPatient = true;\r\n this.registrationError = false;\r\n this.patientIdentityRepository.registerPersonIdentity(this.patientId).pipe(\r\n finalize(() => { this.registeringPatient = false; }),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n () => {\r\n this.displayRegistrationResponse = true;\r\n },\r\n (error: any) => {\r\n if (error &&\r\n error.error &&\r\n error.error.ModelState &&\r\n error.error.ModelState.commandResult &&\r\n error.error.ModelState.commandResult.length > 0) {\r\n this.registrationErrorMessage = error.error.ModelState.commandResult[0];\r\n this.registrationErrorMessage += ' Patient registration request was not submitted.';\r\n }\r\n\r\n this.registrationError = true;\r\n throw error;\r\n },\r\n );\r\n }\r\n\r\n revoke() {\r\n window.open(this.fhirUserRevokeUrl);\r\n }\r\n\r\n copyToClipboard() {\r\n this.clipboard.copy(this.fhirResourceUrl);\r\n }\r\n\r\n // There is no save button on this page.\r\n // save() {\r\n // this.apClose(this.isRegistrated());\r\n // }\r\n\r\n close() {\r\n this.apClose(this.isRegistrated());\r\n }\r\n\r\n private isRegistrated(): boolean {\r\n return (this.isPatientRegistered || this.displayRegistrationResponse);\r\n }\r\n\r\n private setId() {\r\n this.Id = `${this.baseId}-pham`;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ApModalResult, ApModalService } from 'webcommon/core-ui';\r\nimport { ApPersonalHealthAppsModalComponent } from './ap-personal-health-apps-modal.component';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\n\r\nexport class ApPersonalHealthAppsModalService {\r\n static readonly ajsFactoryName = 'ApPersonalHealthAppsModalService';\r\n\r\n constructor(\r\n private apModalService: ApModalService,\r\n ) { }\r\n\r\n openModal(\r\n baseId: string,\r\n patientId: string,\r\n isPatientRegisteredForFHIR: boolean,\r\n ): Promise<ApModalResult<boolean>> {\r\n\r\n const initialState = {\r\n baseId,\r\n patientId,\r\n isPatientRegisteredForFHIR,\r\n };\r\n\r\n const p = this.apModalService.showComponentModal(ApPersonalHealthAppsModalComponent, {\r\n class: 'modal-lg',\r\n ignoreBackdropClick: true,\r\n initialState,\r\n });\r\n\r\n return p;\r\n }\r\n}\r\n","import { NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport {downgradeComponent, downgradeInjectable} from '@angular/upgrade/static';\r\nimport {ApPaymentFrameComponent, ContentAttributeServiceUpgradeAjsProvider} from '@app/core';\r\n\r\nimport {\r\n WebCommonAngularJSModule,\r\n} from 'webcommon/ajs';\r\nimport {PatientDocumentsComponent} from 'webcommon/patient';\r\nimport {UrlParsingService} from 'webcommon/legacy-common';\r\nimport {LoginAssistanceRepository} from 'webcommon/webapi';\r\nimport {ApPersonalHealthAppsModalService} from '../dashboard/third-party/ap-personal-health-apps-modal.service';\r\n\r\n@NgModule({\r\n imports: [\r\n WebCommonAngularJSModule,\r\n ],\r\n providers: [\r\n ContentAttributeServiceUpgradeAjsProvider,\r\n ],\r\n})\r\nexport class PatientPortalAngularJSModule {\r\n // This is using the same constructor pattern as BrowserModule\r\n constructor(\r\n @Optional() @SkipSelf() parentModule: PatientPortalAngularJSModule | null,\r\n ) {\r\n if (parentModule) {\r\n throw new Error(\r\n `PatientPortalAngularJSModule is already loaded. Import it only once, usually in the AppModule only`);\r\n }\r\n }\r\n\r\n // tslint:disable:max-line-length\r\n static registerAngularJS(module: angular.IModule): void {\r\n WebCommonAngularJSModule.registerAngularJS(module);\r\n\r\n module\r\n .factory(UrlParsingService.ajsFactoryName, downgradeInjectable(UrlParsingService))\r\n .factory(LoginAssistanceRepository.ajsFactoryName, downgradeInjectable(LoginAssistanceRepository))\r\n .factory(ApPersonalHealthAppsModalService.ajsFactoryName, downgradeInjectable(ApPersonalHealthAppsModalService));\r\n\r\n module\r\n .directive(PatientDocumentsComponent.ajsComponentName, downgradeComponent({ component: PatientDocumentsComponent }))\r\n .directive(ApPaymentFrameComponent.ajsComponentName, downgradeComponent({ component: ApPaymentFrameComponent }));\r\n }\r\n // tslint:enable:max-line-length\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { ApPaymentFrameComponent } from './components/index';\r\n\r\nconst ajsComponents = [\r\n ApPaymentFrameComponent,\r\n];\r\n\r\nconst exportComponents = [\r\n ...ajsComponents,\r\n];\r\n\r\nconst declareComponents = [\r\n ...exportComponents,\r\n];\r\n\r\n@NgModule({\r\n declarations: declareComponents,\r\n exports: [\r\n exportComponents,\r\n ],\r\n providers: [\r\n ],\r\n})\r\nexport class CoreModule {\r\n}\r\n","/** @packageDocumentation @publicapi @module rx */\n\nimport { StateDeclaration, Transition, UIRouter, UIRouterPlugin } from '@uirouter/core';\nimport { ReplaySubject } from 'rxjs';\nimport { filter, map, mergeMap } from 'rxjs/operators';\n\nexport interface StatesChangedEvent {\n currentStates: StateDeclaration[];\n registered: StateDeclaration[];\n deregistered: StateDeclaration[];\n}\n\n/** Augments UIRouterGlobals with observables for transition starts, successful transitions, and state parameters */\nexport class UIRouterRx implements UIRouterPlugin {\n name = '@uirouter/rx';\n private deregisterFns: Function[] = [];\n\n constructor(router: UIRouter) {\n let start$ = new ReplaySubject<Transition>(1);\n let success$ = start$.pipe(\n mergeMap(t =>\n t.promise.then(\n () => t,\n () => null\n )\n ),\n filter(t => !!t)\n );\n let params$ = success$.pipe(map((transition: Transition) => transition.params()));\n\n let states$ = new ReplaySubject<StatesChangedEvent>(1);\n\n function onStatesChangedEvent(event: string, states: StateDeclaration[]) {\n let changeEvent = {\n currentStates: router.stateRegistry.get(),\n registered: [],\n deregistered: [],\n };\n\n if (event) changeEvent[event] = states;\n states$.next(changeEvent);\n }\n\n this.deregisterFns.push(router.transitionService.onStart({}, transition => start$.next(transition)));\n this.deregisterFns.push(router.stateRegistry.onStatesChanged(onStatesChangedEvent));\n onStatesChangedEvent(null, null);\n Object.assign(router.globals, { start$, success$, params$, states$ });\n }\n\n dispose() {\n this.deregisterFns.forEach(deregisterFn => deregisterFn());\n this.deregisterFns = [];\n }\n}\n\nexport const UIRouterRxPlugin = UIRouterRx;\n","import { isFunction, StateObject } from '@uirouter/core';\r\nimport { PathNode } from '@uirouter/core';\r\nimport { pick, forEach } from '@uirouter/core';\r\nimport { ViewConfig } from '@uirouter/core';\r\nimport { Ng2ViewDeclaration } from '../interface';\r\nimport { services } from '@uirouter/core';\r\nimport { ViewService } from '@uirouter/core';\r\n\r\n/**\r\n * This is a [[StateBuilder.builder]] function for Angular `views`.\r\n *\r\n * When the [[StateBuilder]] builds a [[State]] object from a raw [[StateDeclaration]], this builder\r\n * handles the `views` property with logic specific to @uirouter/angular.\r\n *\r\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object and\r\n * applies the state-level configuration to a view named `$default`.\r\n */\r\nexport function ng2ViewsBuilder(state: StateObject) {\r\n const views: { [key: string]: Ng2ViewDeclaration } = {},\r\n viewsObject = state.views || { $default: pick(state, ['component', 'bindings']) };\r\n\r\n forEach(viewsObject, function (config: Ng2ViewDeclaration, name: string) {\r\n name = name || '$default'; // Account for views: { \"\": { template... } }\r\n if (isFunction(config)) config = { component: config as any };\r\n if (Object.keys(config).length === 0) return;\r\n\r\n config.$type = 'ng2';\r\n config.$context = state;\r\n config.$name = name;\r\n\r\n const normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\r\n config.$uiViewName = normalized.uiViewName;\r\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\r\n\r\n views[name] = config;\r\n });\r\n return views;\r\n}\r\n\r\nlet id = 0;\r\nexport class Ng2ViewConfig implements ViewConfig {\r\n $id: number = id++;\r\n loaded = true;\r\n\r\n constructor(public path: PathNode[], public viewDecl: Ng2ViewDeclaration) {}\r\n\r\n load() {\r\n return services.$q.when(this);\r\n }\r\n}\r\n","import { Injector } from '@angular/core';\r\n\r\n/**\r\n * Merge two injectors\r\n *\r\n * This class implements the Injector ng2 interface but delegates\r\n * to the Injectors provided in the constructor.\r\n */\r\nexport class MergeInjector implements Injector {\r\n static NOT_FOUND = {};\r\n private injectors: Injector[];\r\n constructor(...injectors: Injector[]) {\r\n if (injectors.length < 2) throw new Error('pass at least two injectors');\r\n this.injectors = injectors;\r\n }\r\n\r\n /**\r\n * Get the token from the first injector which contains it.\r\n *\r\n * Delegates to the first Injector.get().\r\n * If not found, then delegates to the second Injector (and so forth).\r\n * If no Injector contains the token, return the `notFoundValue`, or throw.\r\n *\r\n * @param token the DI token\r\n * @param notFoundValue the value to return if none of the Injectors contains the token.\r\n * @returns {any} the DI value\r\n */\r\n get(token: any, notFoundValue?: any): any {\r\n for (let i = 0; i < this.injectors.length; i++) {\r\n const val = this.injectors[i].get(token, MergeInjector.NOT_FOUND);\r\n if (val !== MergeInjector.NOT_FOUND) return val;\r\n }\r\n\r\n if (arguments.length >= 2) return notFoundValue;\r\n\r\n // This will throw the DI Injector error\r\n this.injectors[0].get(token);\r\n }\r\n}\r\n","import {\r\n Component,\r\n ComponentFactory,\r\n ComponentFactoryResolver,\r\n ComponentRef,\r\n Inject,\r\n Injector,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n ReflectiveInjector,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport {\r\n ActiveUIView,\r\n filter,\r\n inArray,\r\n isFunction,\r\n NATIVE_INJECTOR_TOKEN,\r\n Param,\r\n parse,\r\n PathNode,\r\n ResolveContext,\r\n StateDeclaration,\r\n trace,\r\n Transition,\r\n TransitionHookFn,\r\n UIRouter,\r\n unnestR,\r\n ViewConfig,\r\n ViewContext,\r\n} from '@uirouter/core';\r\nimport { Ng2ViewConfig } from '../statebuilders/views';\r\nimport { MergeInjector } from '../mergeInjector';\r\n\r\n/** @hidden */\r\nlet id = 0;\r\n\r\n/** @internal These are provide()d as the string UIView.PARENT_INJECT */\r\nexport interface ParentUIViewInject {\r\n context: ViewContext;\r\n fqn: string;\r\n}\r\n\r\n/** @internal */\r\ninterface InputMapping {\r\n token: string;\r\n prop: string;\r\n}\r\n\r\n/**\r\n * Given a component class, gets the inputs of styles:\r\n *\r\n * - @Input('foo') _foo\r\n * - `inputs: ['foo']`\r\n *\r\n * @internal\r\n */\r\nconst ng2ComponentInputs = (factory: ComponentFactory<any>): InputMapping[] => {\r\n return factory.inputs.map((input) => ({ prop: input.propName, token: input.templateName }));\r\n};\r\n\r\n/**\r\n * A UI-Router viewport directive, which is filled in by a view (component) on a state.\r\n *\r\n * ### Selector\r\n *\r\n * A `ui-view` directive can be created as an element: `<ui-view></ui-view>` or as an attribute: `<div ui-view></div>`.\r\n *\r\n * ### Purpose\r\n *\r\n * This directive is used in a Component template (or as the root component) to create a viewport. The viewport\r\n * is filled in by a view (as defined by a [[Ng2ViewDeclaration]] inside a [[Ng2StateDeclaration]]) when the view's\r\n * state has been activated.\r\n *\r\n * #### Example:\r\n * ```js\r\n * // This app has two states, 'foo' and 'bar'\r\n * stateRegistry.register({ name: 'foo', url: '/foo', component: FooComponent });\r\n * stateRegistry.register({ name: 'bar', url: '/bar', component: BarComponent });\r\n * ```\r\n * ```html\r\n * <!-- This ui-view will be filled in by the foo state's component or\r\n * the bar state's component when the foo or bar state is activated -->\r\n * <ui-view></ui-view>\r\n * ```\r\n *\r\n * ### Named ui-views\r\n *\r\n * A `ui-view` may optionally be given a name via the attribute value: `<div ui-view='header'></div>`. *Note:\r\n * an unnamed `ui-view` is internally named `$default`*. When a `ui-view` has a name, it will be filled in\r\n * by a matching named view.\r\n *\r\n * #### Example:\r\n * ```js\r\n * stateRegistry.register({\r\n * name: 'foo',\r\n * url: '/foo',\r\n * views: { header: HeaderComponent, $default: FooComponent });\r\n * ```\r\n * ```html\r\n * <!-- When 'foo' state is active, filled by HeaderComponent -->\r\n * <div ui-view=\"header\"></div>\r\n *\r\n * <!-- When 'foo' state is active, filled by FooComponent -->\r\n * <ui-view></ui-view>\r\n * ```\r\n */\r\n@Component({\r\n selector: 'ui-view, [ui-view]',\r\n exportAs: 'uiView',\r\n template: `\r\n <ng-template #componentTarget></ng-template>\r\n <ng-content *ngIf=\"!_componentRef\"></ng-content>\r\n `,\r\n})\r\nexport class UIView implements OnInit, OnDestroy {\r\n static PARENT_INJECT = 'UIView.PARENT_INJECT';\r\n\r\n @ViewChild('componentTarget', { read: ViewContainerRef, static: true })\r\n _componentTarget: ViewContainerRef;\r\n @Input('name') name: string;\r\n\r\n @Input('ui-view')\r\n set _name(val: string) {\r\n this.name = val;\r\n }\r\n\r\n /** The reference to the component currently inside the viewport */\r\n _componentRef: ComponentRef<any>;\r\n /** Deregisters the ui-view from the view service */\r\n private _deregisterUIView: Function;\r\n /** Deregisters the master uiCanExit transition hook */\r\n private _deregisterUiCanExitHook: Function;\r\n /** Deregisters the master uiOnParamsChanged transition hook */\r\n private _deregisterUiOnParamsChangedHook: Function;\r\n /** Data about the this UIView */\r\n private _uiViewData: ActiveUIView = <any>{};\r\n private _parent: ParentUIViewInject;\r\n\r\n constructor(\r\n public router: UIRouter,\r\n @Inject(UIView.PARENT_INJECT) parent,\r\n public viewContainerRef: ViewContainerRef\r\n ) {\r\n this._parent = parent;\r\n }\r\n\r\n /**\r\n * @returns the UI-Router `state` that is filling this uiView, or `undefined`.\r\n */\r\n public get state(): StateDeclaration {\r\n return parse('_uiViewData.config.viewDecl.$context.self')(this);\r\n }\r\n\r\n ngOnInit() {\r\n const router = this.router;\r\n const parentFqn = this._parent.fqn;\r\n const name = this.name || '$default';\r\n\r\n this._uiViewData = {\r\n $type: 'ng2',\r\n id: id++,\r\n name: name,\r\n fqn: parentFqn ? parentFqn + '.' + name : name,\r\n creationContext: this._parent.context,\r\n configUpdated: this._viewConfigUpdated.bind(this),\r\n config: undefined,\r\n };\r\n\r\n this._deregisterUiCanExitHook = router.transitionService.onBefore({}, (trans) => {\r\n return this._invokeUiCanExitHook(trans);\r\n });\r\n\r\n this._deregisterUiOnParamsChangedHook = router.transitionService.onSuccess({}, (trans) =>\r\n this._invokeUiOnParamsChangedHook(trans)\r\n );\r\n\r\n this._deregisterUIView = router.viewService.registerUIView(this._uiViewData);\r\n }\r\n\r\n /**\r\n * For each transition, checks the component loaded in the ui-view for:\r\n *\r\n * - has a uiCanExit() component hook\r\n * - is being exited\r\n *\r\n * If both are true, adds the uiCanExit component function as a hook to that singular Transition.\r\n */\r\n private _invokeUiCanExitHook(trans: Transition) {\r\n const instance = this._componentRef && this._componentRef.instance;\r\n const uiCanExitFn: TransitionHookFn = instance && instance.uiCanExit;\r\n\r\n if (isFunction(uiCanExitFn)) {\r\n const state: StateDeclaration = this.state;\r\n\r\n if (trans.exiting().indexOf(state) !== -1) {\r\n trans.onStart({}, function () {\r\n return uiCanExitFn.call(instance, trans);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * For each transition, checks if any param values changed and notify component\r\n */\r\n private _invokeUiOnParamsChangedHook($transition$: Transition) {\r\n const instance = this._componentRef && this._componentRef.instance;\r\n const uiOnParamsChanged: TransitionHookFn = instance && instance.uiOnParamsChanged;\r\n\r\n if (isFunction(uiOnParamsChanged)) {\r\n const viewState: StateDeclaration = this.state;\r\n const resolveContext: ResolveContext = new ResolveContext(this._uiViewData.config.path);\r\n const viewCreationTrans = resolveContext.getResolvable('$transition$').data;\r\n\r\n // Exit early if the $transition$ is the same as the view was created within.\r\n // Exit early if the $transition$ will exit the state the view is for.\r\n if ($transition$ === viewCreationTrans || $transition$.exiting().indexOf(viewState as StateDeclaration) !== -1)\r\n return;\r\n\r\n const toParams: { [paramName: string]: any } = $transition$.params('to');\r\n const fromParams: { [paramName: string]: any } = $transition$.params('from');\r\n const getNodeSchema = (node: PathNode) => node.paramSchema;\r\n const toSchema: Param[] = $transition$.treeChanges('to').map(getNodeSchema).reduce(unnestR, []);\r\n const fromSchema: Param[] = $transition$.treeChanges('from').map(getNodeSchema).reduce(unnestR, []);\r\n\r\n // Find the to params that have different values than the from params\r\n const changedToParams = toSchema.filter((param: Param) => {\r\n const idx = fromSchema.indexOf(param);\r\n return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]);\r\n });\r\n\r\n // Only trigger callback if a to param has changed or is new\r\n if (changedToParams.length) {\r\n const changedKeys: string[] = changedToParams.map((x) => x.id);\r\n // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params.\r\n const newValues = filter(toParams, (val, key) => changedKeys.indexOf(key) !== -1);\r\n instance.uiOnParamsChanged(newValues, $transition$);\r\n }\r\n }\r\n }\r\n\r\n private _disposeLast() {\r\n if (this._componentRef) this._componentRef.destroy();\r\n this._componentRef = null;\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this._deregisterUIView) this._deregisterUIView();\r\n if (this._deregisterUiCanExitHook) this._deregisterUiCanExitHook();\r\n if (this._deregisterUiOnParamsChangedHook) this._deregisterUiOnParamsChangedHook();\r\n this._deregisterUIView = this._deregisterUiCanExitHook = this._deregisterUiOnParamsChangedHook = null;\r\n this._disposeLast();\r\n }\r\n\r\n /**\r\n * The view service is informing us of an updated ViewConfig\r\n * (usually because a transition activated some state and its views)\r\n */\r\n _viewConfigUpdated(config: ViewConfig) {\r\n // The config may be undefined if there is nothing currently targeting this UIView.\r\n // Dispose the current component, if there is one\r\n if (!config) return this._disposeLast();\r\n\r\n // Only care about Ng2 configs\r\n if (!(config instanceof Ng2ViewConfig)) return;\r\n\r\n // The \"new\" viewconfig is already applied, so exit early\r\n if (this._uiViewData.config === config) return;\r\n\r\n // This is a new ViewConfig. Dispose the previous component\r\n this._disposeLast();\r\n trace.traceUIViewConfigUpdated(this._uiViewData, config && config.viewDecl.$context);\r\n\r\n this._applyUpdatedConfig(config);\r\n\r\n // Initiate change detection for the newly created component\r\n this._componentRef.changeDetectorRef.markForCheck();\r\n }\r\n\r\n private _applyUpdatedConfig(config: Ng2ViewConfig) {\r\n this._uiViewData.config = config;\r\n // Create the Injector for the routed component\r\n const context = new ResolveContext(config.path);\r\n const componentInjector = this._getComponentInjector(context);\r\n\r\n // Get the component class from the view declaration. TODO: allow promises?\r\n const componentClass = config.viewDecl.component;\r\n\r\n // Create the component\r\n const compFactoryResolver = componentInjector.get(ComponentFactoryResolver);\r\n const compFactory = compFactoryResolver.resolveComponentFactory(componentClass);\r\n this._componentRef = this._componentTarget.createComponent(compFactory, undefined, componentInjector);\r\n\r\n // Wire resolves to @Input()s\r\n this._applyInputBindings(compFactory, this._componentRef.instance, context, componentClass);\r\n }\r\n\r\n /**\r\n * Creates a new Injector for a routed component.\r\n *\r\n * Adds resolve values to the Injector\r\n * Adds providers from the NgModule for the state\r\n * Adds providers from the parent Component in the component tree\r\n * Adds a PARENT_INJECT view context object\r\n *\r\n * @returns an Injector\r\n */\r\n private _getComponentInjector(context: ResolveContext): Injector {\r\n // Map resolves to \"useValue: providers\"\r\n const resolvables = context\r\n .getTokens()\r\n .map((token) => context.getResolvable(token))\r\n .filter((r) => r.resolved);\r\n\r\n const newProviders = resolvables.map((r) => ({ provide: r.token, useValue: context.injector().get(r.token) }));\r\n\r\n const parentInject = { context: this._uiViewData.config.viewDecl.$context, fqn: this._uiViewData.fqn };\r\n newProviders.push({ provide: UIView.PARENT_INJECT, useValue: parentInject });\r\n\r\n const parentComponentInjector = this.viewContainerRef.injector;\r\n const moduleInjector = context.getResolvable(NATIVE_INJECTOR_TOKEN).data;\r\n const mergedParentInjector = new MergeInjector(moduleInjector, parentComponentInjector);\r\n\r\n return ReflectiveInjector.resolveAndCreate(newProviders, mergedParentInjector);\r\n }\r\n\r\n /**\r\n * Supplies component inputs with resolve data\r\n *\r\n * Finds component inputs which match resolves (by name) and sets the input value\r\n * to the resolve data.\r\n */\r\n private _applyInputBindings(factory: ComponentFactory<any>, component: any, context: ResolveContext, componentClass) {\r\n const bindings = this._uiViewData.config.viewDecl['bindings'] || {};\r\n const explicitBoundProps = Object.keys(bindings);\r\n\r\n // Returns the actual component property for a renamed an input renamed using `@Input('foo') _foo`.\r\n // return the `_foo` property\r\n const renamedInputProp = (prop: string) => {\r\n const input = factory.inputs.find((i) => i.templateName === prop);\r\n return (input && input.propName) || prop;\r\n };\r\n\r\n // Supply resolve data to component as specified in the state's `bindings: {}`\r\n const explicitInputTuples = explicitBoundProps.reduce(\r\n (acc, key) => acc.concat([{ prop: renamedInputProp(key), token: bindings[key] }]),\r\n []\r\n );\r\n\r\n // Supply resolve data to matching @Input('prop') or inputs: ['prop']\r\n const implicitInputTuples = ng2ComponentInputs(factory).filter((tuple) => !inArray(explicitBoundProps, tuple.prop));\r\n\r\n const addResolvable = (tuple: InputMapping) => ({\r\n prop: tuple.prop,\r\n resolvable: context.getResolvable(tuple.token),\r\n });\r\n\r\n const injector = context.injector();\r\n\r\n explicitInputTuples\r\n .concat(implicitInputTuples)\r\n .map(addResolvable)\r\n .filter((tuple) => tuple.resolvable && tuple.resolvable.resolved)\r\n .forEach((tuple) => {\r\n component[tuple.prop] = injector.get(tuple.resolvable.token);\r\n });\r\n }\r\n}\r\n","import { UISref, AnchorUISref } from './uiSref';\r\nimport { UISrefActive } from './uiSrefActive';\r\nimport { UIView } from './uiView';\r\nimport { UISrefStatus } from './uiSrefStatus';\r\n\r\nexport * from './uiView';\r\nexport * from './uiSref';\r\nexport * from './uiSrefStatus';\r\nexport * from './uiSrefActive';\r\n\r\n/** @internal */\r\nexport const _UIROUTER_DIRECTIVES = [UISref, AnchorUISref, UIView, UISrefActive, UISrefStatus];\r\n\r\n/**\r\n * References to the UI-Router directive classes, for use within a @Component's `directives:` property\r\n * @deprecated use [[UIRouterModule]]\r\n * @internal\r\n */\r\nexport const UIROUTER_DIRECTIVES = _UIROUTER_DIRECTIVES;\r\n","import { InjectionToken } from '@angular/core';\r\n/** @hidden */ export const UIROUTER_ROOT_MODULE = new InjectionToken('UIRouter Root Module');\r\n/** @hidden */ export const UIROUTER_MODULE_TOKEN = new InjectionToken('UIRouter Module');\r\n/** @hidden */ export const UIROUTER_STATES = new InjectionToken('UIRouter States');\r\n","import { UIRouter, isFunction, StateObject } from '@uirouter/core';\r\nimport { StatesModule, RootModule } from './uiRouterNgModule';\r\nimport { Injector } from '@angular/core';\r\nimport { isDefined } from '@uirouter/core';\r\n\r\nexport function applyModuleConfig(uiRouter: UIRouter, injector: Injector, module: StatesModule = {}): StateObject[] {\r\n if (isFunction(module.config)) {\r\n module.config(uiRouter, injector, module);\r\n }\r\n\r\n const states = module.states || [];\r\n return states.map((state) => uiRouter.stateRegistry.register(state));\r\n}\r\n\r\nexport function applyRootModuleConfig(uiRouter: UIRouter, injector: Injector, module: RootModule) {\r\n isDefined(module.deferIntercept) && uiRouter.urlService.deferIntercept(module.deferIntercept);\r\n isDefined(module.otherwise) && uiRouter.urlService.rules.otherwise(module.otherwise);\r\n isDefined(module.initial) && uiRouter.urlService.rules.initial(module.initial);\r\n}\r\n","import { NgModuleRef, Injector, NgModuleFactory, Type, Compiler } from '@angular/core';\r\nimport {\r\n Transition,\r\n LazyLoadResult,\r\n UIRouter,\r\n Resolvable,\r\n NATIVE_INJECTOR_TOKEN,\r\n isString,\r\n unnestR,\r\n inArray,\r\n StateObject,\r\n uniqR,\r\n StateDeclaration,\r\n} from '@uirouter/core';\r\nimport { UIROUTER_MODULE_TOKEN, UIROUTER_ROOT_MODULE } from '../injectionTokens';\r\nimport { RootModule, StatesModule } from '../uiRouterNgModule';\r\nimport { applyModuleConfig } from '../uiRouterConfig';\r\n\r\n/**\r\n * A function that returns an NgModule, or a promise for an NgModule\r\n *\r\n * #### Example:\r\n * ```js\r\n * export function loadFooModule() {\r\n * return import('../foo/foo.module').then(result => result.FooModule);\r\n * }\r\n * ```\r\n */\r\nexport type ModuleTypeCallback = () => Type<any> | Promise<Type<any>>;\r\n\r\n/**\r\n * Returns a function which lazy loads a nested module\r\n *\r\n * This is primarily used by the [[ng2LazyLoadBuilder]] when processing [[Ng2StateDeclaration.loadChildren]].\r\n *\r\n * It could also be used manually as a [[StateDeclaration.lazyLoad]] property to lazy load an `NgModule` and its state(s).\r\n *\r\n * #### Example:\r\n * Using `import()` and named export of `HomeModule`\r\n * ```js\r\n * declare var System;\r\n * var futureState = {\r\n * name: 'home.**',\r\n * url: '/home',\r\n * lazyLoad: loadNgModule(() => import('./home/home.module').then(result => result.HomeModule))\r\n * }\r\n * ```\r\n *\r\n * #### Example:\r\n * Using a path (string) to the module\r\n * ```js\r\n * var futureState = {\r\n * name: 'home.**',\r\n * url: '/home',\r\n * lazyLoad: loadNgModule('./home/home.module#HomeModule')\r\n * }\r\n * ```\r\n *\r\n *\r\n * @param moduleToLoad a path (string) to the NgModule to load.\r\n * Or a function which loads the NgModule code which should\r\n * return a reference to the `NgModule` class being loaded (or a `Promise` for it).\r\n *\r\n * @returns A function which takes a transition, which:\r\n * - Gets the Injector (scoped properly for the destination state)\r\n * - Loads and creates the NgModule\r\n * - Finds the \"replacement state\" for the target state, and adds the new NgModule Injector to it (as a resolve)\r\n * - Returns the new states array\r\n */\r\nexport function loadNgModule(\r\n moduleToLoad: ModuleTypeCallback\r\n): (transition: Transition, stateObject: StateDeclaration) => Promise<LazyLoadResult> {\r\n return (transition: Transition, stateObject: StateDeclaration) => {\r\n const ng2Injector = transition.injector().get(NATIVE_INJECTOR_TOKEN);\r\n\r\n const createModule = (factory: NgModuleFactory<any>) => factory.create(ng2Injector);\r\n\r\n const applyModule = (moduleRef: NgModuleRef<any>) => applyNgModule(transition, moduleRef, ng2Injector, stateObject);\r\n\r\n return loadModuleFactory(moduleToLoad, ng2Injector).then(createModule).then(applyModule);\r\n };\r\n}\r\n\r\n/**\r\n * Returns the module factory that can be used to instantiate a module\r\n *\r\n * For a Type<any> or Promise<Type<any>> this:\r\n * - Compiles the component type (if not running with AOT)\r\n * - Returns the NgModuleFactory resulting from compilation (or direct loading if using AOT) as a Promise\r\n *\r\n * @internal\r\n */\r\nexport function loadModuleFactory(\r\n moduleToLoad: ModuleTypeCallback,\r\n ng2Injector: Injector\r\n): Promise<NgModuleFactory<any>> {\r\n const compiler: Compiler = ng2Injector.get(Compiler);\r\n\r\n const unwrapEsModuleDefault = (x) => (x && x.__esModule && x['default'] ? x['default'] : x);\r\n\r\n return Promise.resolve(moduleToLoad())\r\n .then(unwrapEsModuleDefault)\r\n .then((t: NgModuleFactory<any> | Type<any>) => {\r\n if (t instanceof NgModuleFactory) {\r\n return t;\r\n }\r\n return compiler.compileModuleAsync(t);\r\n });\r\n}\r\n\r\n/**\r\n * Apply the UI-Router Modules found in the lazy loaded module.\r\n *\r\n * Apply the Lazy Loaded NgModule's newly created Injector to the right state in the state tree.\r\n *\r\n * Lazy loading uses a placeholder state which is removed (and replaced) after the module is loaded.\r\n * The NgModule should include a state with the same name as the placeholder.\r\n *\r\n * Find the *newly loaded state* with the same name as the *placeholder state*.\r\n * The NgModule's Injector (and ComponentFactoryResolver) will be added to that state.\r\n * The Injector/Factory are used when creating Components for the `replacement` state and all its children.\r\n *\r\n * @internal\r\n */\r\nexport function applyNgModule(\r\n transition: Transition,\r\n ng2Module: NgModuleRef<any>,\r\n parentInjector: Injector,\r\n lazyLoadState: StateDeclaration\r\n): LazyLoadResult {\r\n const injector = ng2Module.injector;\r\n const uiRouter: UIRouter = injector.get(UIRouter);\r\n const registry = uiRouter.stateRegistry;\r\n\r\n const originalName = lazyLoadState.name;\r\n const originalState = registry.get(originalName);\r\n // Check if it's a future state (ends with .**)\r\n const isFuture = /^(.*)\\.\\*\\*$/.exec(originalName);\r\n // Final name (without the .**)\r\n const replacementName = isFuture && isFuture[1];\r\n\r\n const newRootModules = multiProviderParentChildDelta(parentInjector, injector, UIROUTER_ROOT_MODULE).reduce(\r\n uniqR,\r\n []\r\n ) as RootModule[];\r\n const newChildModules = multiProviderParentChildDelta(parentInjector, injector, UIROUTER_MODULE_TOKEN).reduce(\r\n uniqR,\r\n []\r\n ) as StatesModule[];\r\n\r\n if (newRootModules.length) {\r\n console.log(newRootModules); // tslint:disable-line:no-console\r\n throw new Error('Lazy loaded modules should not contain a UIRouterModule.forRoot() module');\r\n }\r\n\r\n const newStateObjects: StateObject[] = newChildModules\r\n .map((module) => applyModuleConfig(uiRouter, injector, module))\r\n .reduce(unnestR, [])\r\n .reduce(uniqR, []);\r\n\r\n if (isFuture) {\r\n const replacementState = registry.get(replacementName);\r\n if (!replacementState || replacementState === originalState) {\r\n throw new Error(\r\n `The Future State named '${originalName}' lazy loaded an NgModule. ` +\r\n `The lazy loaded NgModule must have a state named '${replacementName}' ` +\r\n `which replaces the (placeholder) '${originalName}' Future State. ` +\r\n `Add a '${replacementName}' state to the lazy loaded NgModule ` +\r\n `using UIRouterModule.forChild({ states: CHILD_STATES }).`\r\n );\r\n }\r\n }\r\n\r\n // Supply the newly loaded states with the Injector from the lazy loaded NgModule.\r\n // If a tree of states is lazy loaded, only add the injector to the root of the lazy loaded tree.\r\n // The children will get the injector by resolve inheritance.\r\n const newParentStates = newStateObjects.filter((state) => !inArray(newStateObjects, state.parent));\r\n\r\n // Add the Injector to the top of the lazy loaded state tree as a resolve\r\n newParentStates.forEach((state) => state.resolvables.push(Resolvable.fromData(NATIVE_INJECTOR_TOKEN, injector)));\r\n\r\n return {};\r\n}\r\n\r\n/**\r\n * Returns the new dependency injection values from the Child Injector\r\n *\r\n * When a DI token is defined as multi: true, the child injector\r\n * can add new values for the token.\r\n *\r\n * This function returns the values added by the child injector, and excludes all values from the parent injector.\r\n *\r\n * @internal\r\n */\r\nexport function multiProviderParentChildDelta(parent: Injector, child: Injector, token: any) {\r\n const childVals: RootModule[] = child.get(token, []);\r\n const parentVals: RootModule[] = parent.get(token, []);\r\n return childVals.filter((val) => parentVals.indexOf(val) === -1);\r\n}\r\n","import { LazyLoadResult, Transition, StateDeclaration } from '@uirouter/core'; // has or is using\r\nimport { BuilderFunction, StateObject } from '@uirouter/core';\r\nimport { loadNgModule } from '../lazyLoad/lazyLoadNgModule';\r\n\r\n/**\r\n * This is a [[StateBuilder.builder]] function for ngModule lazy loading in Angular.\r\n *\r\n * When the [[StateBuilder]] builds a [[State]] object from a raw [[StateDeclaration]], this builder\r\n * decorates the `lazyLoad` property for states that have a [[Ng2StateDeclaration.ngModule]] declaration.\r\n *\r\n * If the state has a [[Ng2StateDeclaration.ngModule]], it will create a `lazyLoad` function\r\n * that in turn calls `loadNgModule(loadNgModuleFn)`.\r\n *\r\n * #### Example:\r\n * A state that has a `ngModule`\r\n * ```js\r\n * var decl = {\r\n * ngModule: () => import('./childModule.ts')\r\n * }\r\n * ```\r\n * would build a state with a `lazyLoad` function like:\r\n * ```js\r\n * import { loadNgModule } from \"@uirouter/angular\";\r\n * var decl = {\r\n * lazyLoad: loadNgModule(() => import('./childModule.ts')\r\n * }\r\n * ```\r\n *\r\n * If the state has both a `ngModule:` *and* a `lazyLoad`, then the `lazyLoad` is run first.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var decl = {\r\n * lazyLoad: () => import('third-party-library'),\r\n * ngModule: () => import('./childModule.ts')\r\n * }\r\n * ```\r\n * would build a state with a `lazyLoad` function like:\r\n * ```js\r\n * import { loadNgModule } from \"@uirouter/angular\";\r\n * var decl = {\r\n * lazyLoad: () => import('third-party-library')\r\n * .then(() => loadNgModule(() => import('./childModule.ts'))\r\n * }\r\n * ```\r\n *\r\n */\r\nexport function ng2LazyLoadBuilder(state: StateObject, parent: BuilderFunction) {\r\n const loadNgModuleFn = state['loadChildren'];\r\n return loadNgModuleFn ? loadNgModule(loadNgModuleFn) : state.lazyLoad;\r\n}\r\n","import { BaseLocationServices, parseUrl, UIRouter } from '@uirouter/core';\r\nimport { LocationStrategy } from '@angular/common';\r\n\r\n/** A `LocationServices` that delegates to the Angular LocationStrategy */\r\nexport class Ng2LocationServices extends BaseLocationServices {\r\n constructor(router: UIRouter, private _locationStrategy: LocationStrategy, isBrowser: boolean) {\r\n super(router, isBrowser);\r\n\r\n this._locationStrategy.onPopState((evt) => {\r\n if (evt.type !== 'hashchange') {\r\n this._listener(evt);\r\n }\r\n });\r\n }\r\n\r\n _get() {\r\n return this._locationStrategy.path(true).replace(this._locationStrategy.getBaseHref().replace(/\\/$/, ''), '');\r\n }\r\n\r\n _set(state: any, title: string, url: string, replace: boolean): any {\r\n const { path, search, hash } = parseUrl(url);\r\n\r\n const hashWithPrefix = hash ? '#' + hash : '';\r\n let urlPath = path;\r\n let urlParams = search;\r\n\r\n if (search) {\r\n urlParams += hashWithPrefix;\r\n } else {\r\n urlPath += hashWithPrefix;\r\n }\r\n\r\n if (replace) {\r\n this._locationStrategy.replaceState(state, title, urlPath, urlParams);\r\n } else {\r\n this._locationStrategy.pushState(state, title, urlPath, urlParams);\r\n }\r\n }\r\n\r\n dispose(router: UIRouter) {\r\n super.dispose(router);\r\n }\r\n}\r\n","import { UIRouter, is, BrowserLocationConfig } from '@uirouter/core';\r\nimport { LocationStrategy, PathLocationStrategy } from '@angular/common';\r\n\r\nexport class Ng2LocationConfig extends BrowserLocationConfig {\r\n constructor(router: UIRouter, private _locationStrategy: LocationStrategy) {\r\n super(router, is(PathLocationStrategy)(_locationStrategy));\r\n }\r\n\r\n baseHref(href?: string): string {\r\n return this._locationStrategy.getBaseHref();\r\n }\r\n}\r\n","/**\r\n * # UI-Router for Angular (v2+)\r\n *\r\n * - [@uirouter/angular home page](https://ui-router.github.io/ng2)\r\n * - [tutorials](https://ui-router.github.io/tutorial/ng2/helloworld)\r\n * - [quick start repository](http://github.com/ui-router/quickstart-ng2)\r\n *\r\n * Getting started:\r\n *\r\n * - Use npm. Add a dependency on latest `@uirouter/angular`\r\n * - Import UI-Router classes directly from `\"@uirouter/angular\"`\r\n *\r\n * ```js\r\n * import {StateRegistry} from \"@uirouter/angular\";\r\n * ```\r\n *\r\n * - Create application states (as defined by [[Ng2StateDeclaration]]).\r\n *\r\n * ```js\r\n * export let state1: Ng2StateDeclaration = {\r\n * name: 'state1',\r\n * component: State1Component,\r\n * url: '/one'\r\n * }\r\n *\r\n * export let state2: Ng2StateDeclaration = {\r\n * name: 'state2',\r\n * component: State2Component,\r\n * url: '/two'\r\n * }\r\n * ```\r\n *\r\n * - Import a [[UIRouterModule.forChild]] module into your feature `NgModule`s.\r\n *\r\n * ```js\r\n * @ NgModule({\r\n * imports: [\r\n * SharedModule,\r\n * UIRouterModule.forChild({ states: [state1, state2 ] })\r\n * ],\r\n * declarations: [\r\n * State1Component,\r\n * State2Component,\r\n * ]\r\n * })\r\n * export class MyFeatureModule {}\r\n * ```\r\n *\r\n * - Import a [[UIRouterModule.forRoot]] module into your application root `NgModule`\r\n * - Either bootstrap a [[UIView]] component, or add a `<ui-view></ui-view>` viewport to your root component.\r\n *\r\n * ```js\r\n * @ NgModule({\r\n * imports: [\r\n * BrowserModule,\r\n * UIRouterModule.forRoot({ states: [ homeState ] }),\r\n * MyFeatureModule,\r\n * ],\r\n * declarations: [\r\n * HomeComponent\r\n * ]\r\n * bootstrap: [ UIView ]\r\n * })\r\n * class RootAppModule {}\r\n *\r\n * browserPlatformDynamic.bootstrapModule(RootAppModule);\r\n * ```\r\n *\r\n * - Optionally specify a configuration class [[ChildModule.configClass]] for any module\r\n * to perform any router configuration during bootstrap or lazyload.\r\n * Pass the class to [[UIRouterModule.forRoot]] or [[UIRouterModule.forChild]].\r\n *\r\n * ```js\r\n * import {UIRouter} from \"@uirouter/angular\";\r\n *\r\n * @ Injectable()\r\n * export class MyUIRouterConfig {\r\n * // Constructor is injectable\r\n * constructor(uiRouter: UIRouter) {\r\n * uiRouter.urlMatcherFactory.type('datetime', myDateTimeParamType);\r\n * }\r\n * }\r\n * ```\r\n */\r\nimport { Injector, Provider, PLATFORM_ID, APP_INITIALIZER } from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport {\r\n UIRouter,\r\n PathNode,\r\n StateRegistry,\r\n StateService,\r\n TransitionService,\r\n UrlMatcherFactory,\r\n UrlRouter,\r\n ViewService,\r\n UrlService,\r\n UIRouterGlobals,\r\n services,\r\n Resolvable,\r\n NATIVE_INJECTOR_TOKEN,\r\n} from '@uirouter/core';\r\nimport { UIView, ParentUIViewInject } from './directives/uiView';\r\nimport { UIROUTER_MODULE_TOKEN, UIROUTER_ROOT_MODULE } from './injectionTokens';\r\nimport { ng2ViewsBuilder, Ng2ViewConfig } from './statebuilders/views';\r\nimport { Ng2ViewDeclaration } from './interface';\r\nimport { applyRootModuleConfig, applyModuleConfig } from './uiRouterConfig';\r\nimport { RootModule, StatesModule } from './uiRouterNgModule';\r\nimport { servicesPlugin, ServicesPlugin } from '@uirouter/core';\r\nimport { ng2LazyLoadBuilder } from './statebuilders/lazyLoad';\r\nimport { UIRouterRx } from '@uirouter/rx';\r\nimport { LocationStrategy } from '@angular/common';\r\nimport { Ng2LocationServices } from './location/locationService';\r\nimport { Ng2LocationConfig } from './location/locationConfig';\r\n\r\n/**\r\n * This is a factory function for a UIRouter instance\r\n *\r\n * Creates a UIRouter instance and configures it for Angular, then invokes router bootstrap.\r\n * This function is used as an Angular `useFactory` Provider.\r\n */\r\nexport function uiRouterFactory(\r\n locationStrategy: LocationStrategy,\r\n rootModules: RootModule[],\r\n modules: StatesModule[],\r\n injector: Injector\r\n) {\r\n if (rootModules.length !== 1) {\r\n throw new Error(\"Exactly one UIRouterModule.forRoot() should be in the bootstrapped app module's imports: []\");\r\n }\r\n\r\n // ----------------- Create router -----------------\r\n // Create a new ng2 UIRouter and configure it for ng2\r\n const router = new UIRouter();\r\n\r\n // Add RxJS plugin\r\n router.plugin(UIRouterRx);\r\n\r\n // Add $q-like and $injector-like service APIs\r\n router.plugin<ServicesPlugin>(servicesPlugin);\r\n\r\n // ----------------- Monkey Patches ----------------\r\n // Monkey patch the services.$injector to use the root ng2 Injector\r\n services.$injector.get = injector.get.bind(injector);\r\n\r\n // ----------------- Configure for ng2 -------------\r\n router.locationService = new Ng2LocationServices(\r\n router,\r\n locationStrategy,\r\n isPlatformBrowser(injector.get(PLATFORM_ID))\r\n );\r\n router.locationConfig = new Ng2LocationConfig(router, locationStrategy);\r\n\r\n // Apply ng2 ui-view handling code\r\n const viewConfigFactory = (path: PathNode[], config: Ng2ViewDeclaration) => new Ng2ViewConfig(path, config);\r\n router.viewService._pluginapi._viewConfigFactory('ng2', viewConfigFactory);\r\n\r\n // Apply statebuilder decorator for ng2 NgModule registration\r\n const registry = router.stateRegistry;\r\n registry.decorator('views', ng2ViewsBuilder);\r\n registry.decorator('lazyLoad', ng2LazyLoadBuilder);\r\n\r\n // Prep the tree of NgModule by placing the root NgModule's Injector on the root state.\r\n const ng2InjectorResolvable = Resolvable.fromData(NATIVE_INJECTOR_TOKEN, injector);\r\n registry.root().resolvables.push(ng2InjectorResolvable);\r\n\r\n // Auto-flush the parameter type queue\r\n router.urlMatcherFactory.$get();\r\n\r\n // ----------------- Initialize router -------------\r\n rootModules.forEach((moduleConfig) => applyRootModuleConfig(router, injector, moduleConfig));\r\n modules.forEach((moduleConfig) => applyModuleConfig(router, injector, moduleConfig));\r\n\r\n return router;\r\n}\r\n\r\n// Start monitoring the URL when the app starts\r\nexport function appInitializer(router: UIRouter) {\r\n return () => {\r\n if (!router.urlRouter.interceptDeferred) {\r\n router.urlService.listen();\r\n router.urlService.sync();\r\n }\r\n };\r\n}\r\n\r\nexport function parentUIViewInjectFactory(r: StateRegistry) {\r\n return { fqn: null, context: r.root() } as ParentUIViewInject;\r\n}\r\n\r\nexport const _UIROUTER_INSTANCE_PROVIDERS: Provider[] = [\r\n {\r\n provide: UIRouter,\r\n useFactory: uiRouterFactory,\r\n deps: [LocationStrategy, UIROUTER_ROOT_MODULE, UIROUTER_MODULE_TOKEN, Injector],\r\n },\r\n { provide: UIView.PARENT_INJECT, useFactory: parentUIViewInjectFactory, deps: [StateRegistry] },\r\n { provide: APP_INITIALIZER, useFactory: appInitializer, deps: [UIRouter], multi: true },\r\n];\r\n\r\nexport function fnStateService(r: UIRouter) {\r\n return r.stateService;\r\n}\r\nexport function fnTransitionService(r: UIRouter) {\r\n return r.transitionService;\r\n}\r\nexport function fnUrlMatcherFactory(r: UIRouter) {\r\n return r.urlMatcherFactory;\r\n}\r\nexport function fnUrlRouter(r: UIRouter) {\r\n return r.urlRouter;\r\n}\r\nexport function fnUrlService(r: UIRouter) {\r\n return r.urlService;\r\n}\r\nexport function fnViewService(r: UIRouter) {\r\n return r.viewService;\r\n}\r\nexport function fnStateRegistry(r: UIRouter) {\r\n return r.stateRegistry;\r\n}\r\nexport function fnGlobals(r: any) {\r\n return r.globals;\r\n}\r\n\r\nexport const _UIROUTER_SERVICE_PROVIDERS: Provider[] = [\r\n { provide: StateService, useFactory: fnStateService, deps: [UIRouter] },\r\n { provide: TransitionService, useFactory: fnTransitionService, deps: [UIRouter] },\r\n { provide: UrlMatcherFactory, useFactory: fnUrlMatcherFactory, deps: [UIRouter] },\r\n { provide: UrlRouter, useFactory: fnUrlRouter, deps: [UIRouter] },\r\n { provide: UrlService, useFactory: fnUrlService, deps: [UIRouter] },\r\n { provide: ViewService, useFactory: fnViewService, deps: [UIRouter] },\r\n { provide: StateRegistry, useFactory: fnStateRegistry, deps: [UIRouter] },\r\n { provide: UIRouterGlobals, useFactory: fnGlobals, deps: [UIRouter] },\r\n];\r\n\r\n/**\r\n * The UI-Router providers, for use in your application bootstrap\r\n *\r\n * @deprecated use [[UIRouterModule.forRoot]]\r\n */\r\nexport const UIROUTER_PROVIDERS: Provider[] = _UIROUTER_INSTANCE_PROVIDERS.concat(_UIROUTER_SERVICE_PROVIDERS);\r\n","import { UIROUTER_MODULE_TOKEN, UIROUTER_ROOT_MODULE } from './injectionTokens';\r\nimport { Ng2StateDeclaration } from './interface';\r\nimport {\r\n NgModule,\r\n ModuleWithProviders,\r\n ANALYZE_FOR_ENTRY_COMPONENTS,\r\n Provider,\r\n Injector,\r\n APP_INITIALIZER,\r\n} from '@angular/core';\r\nimport { CommonModule, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';\r\nimport { _UIROUTER_DIRECTIVES } from './directives/directives';\r\nimport { UIView } from './directives/uiView';\r\nimport { UrlRuleHandlerFn, TargetState, TargetStateDef, UIRouter, TransitionService } from '@uirouter/core';\r\nimport { _UIROUTER_INSTANCE_PROVIDERS, _UIROUTER_SERVICE_PROVIDERS } from './providers';\r\n\r\n// Delay angular bootstrap until first transition is successful, for SSR.\r\n// See https://github.com/ui-router/angular/pull/127\r\nexport function onTransitionReady(transitionService: TransitionService, root: RootModule[]) {\r\n const mod = root[0];\r\n if (!mod || !mod.deferInitialRender) {\r\n return () => Promise.resolve();\r\n }\r\n\r\n return () =>\r\n new Promise((resolve) => {\r\n const hook = (trans) => {\r\n trans.promise.then(resolve, resolve);\r\n };\r\n transitionService.onStart({}, hook, { invokeLimit: 1 });\r\n });\r\n}\r\n\r\nexport function makeRootProviders(module: RootModule): Provider[] {\r\n return [\r\n { provide: UIROUTER_ROOT_MODULE, useValue: module, multi: true },\r\n { provide: UIROUTER_MODULE_TOKEN, useValue: module, multi: true },\r\n { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: module.states || [], multi: true },\r\n {\r\n provide: APP_INITIALIZER,\r\n useFactory: onTransitionReady,\r\n deps: [TransitionService, UIROUTER_ROOT_MODULE],\r\n multi: true,\r\n },\r\n ];\r\n}\r\n\r\nexport function makeChildProviders(module: StatesModule): Provider[] {\r\n return [\r\n { provide: UIROUTER_MODULE_TOKEN, useValue: module, multi: true },\r\n { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: module.states || [], multi: true },\r\n ];\r\n}\r\n\r\nexport function locationStrategy(useHash) {\r\n return { provide: LocationStrategy, useClass: useHash ? HashLocationStrategy : PathLocationStrategy };\r\n}\r\n\r\n/**\r\n * Creates UI-Router Modules\r\n *\r\n * This class has two static factory methods which create UIRouter Modules.\r\n * A UI-Router Module is an [Angular NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)\r\n * with support for UI-Router.\r\n *\r\n * ### UIRouter Directives\r\n *\r\n * When a UI-Router Module is imported into a `NgModule`, that module's components\r\n * can use the UIRouter Directives such as [[UIView]], [[UISref]], [[UISrefActive]].\r\n *\r\n * ### State Definitions\r\n *\r\n * State definitions found in the `states:` property are provided to the Dependency Injector.\r\n * This enables UI-Router to automatically register the states with the [[StateRegistry]] at bootstrap (and during lazy load).\r\n *\r\n * ### Entry Components\r\n *\r\n * Any routed components are added as `entryComponents:` so they will get compiled.\r\n */\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [_UIROUTER_DIRECTIVES],\r\n exports: [_UIROUTER_DIRECTIVES],\r\n entryComponents: [UIView],\r\n})\r\nexport class UIRouterModule {\r\n /**\r\n * Creates a UI-Router Module for the root (bootstrapped) application module to import\r\n *\r\n * This factory function creates an [Angular NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)\r\n * with UI-Router support.\r\n *\r\n * The `forRoot` module should be added to the `imports:` of the `NgModule` being bootstrapped.\r\n * An application should only create and import a single `NgModule` using `forRoot()`.\r\n * All other modules should be created using [[UIRouterModule.forChild]].\r\n *\r\n * Unlike `forChild`, an `NgModule` returned by this factory provides the [[UIRouter]] singleton object.\r\n * This factory also accepts root-level router configuration.\r\n * These are the only differences between `forRoot` and `forChild`.\r\n *\r\n * Example:\r\n * ```js\r\n * let routerConfig = {\r\n * otherwise: '/home',\r\n * states: [homeState, aboutState]\r\n * };\r\n *\r\n * @ NgModule({\r\n * imports: [\r\n * BrowserModule,\r\n * UIRouterModule.forRoot(routerConfig),\r\n * FeatureModule1\r\n * ]\r\n * })\r\n * class MyRootAppModule {}\r\n *\r\n * browserPlatformDynamic.bootstrapModule(MyRootAppModule);\r\n * ```\r\n *\r\n * @param config declarative UI-Router configuration\r\n * @returns an `NgModule` which provides the [[UIRouter]] singleton instance\r\n */\r\n static forRoot(config: RootModule = {}): ModuleWithProviders<UIRouterModule> {\r\n return {\r\n ngModule: UIRouterModule,\r\n providers: [\r\n _UIROUTER_INSTANCE_PROVIDERS,\r\n _UIROUTER_SERVICE_PROVIDERS,\r\n locationStrategy(config.useHash),\r\n ...makeRootProviders(config),\r\n ],\r\n };\r\n }\r\n\r\n /**\r\n * Creates an `NgModule` for a UIRouter module\r\n *\r\n * This function creates an [Angular NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html)\r\n * with UI-Router support.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var homeState = { name: 'home', url: '/home', component: Home };\r\n * var aboutState = { name: 'about', url: '/about', component: About };\r\n *\r\n * @ NgModule({\r\n * imports: [\r\n * UIRouterModule.forChild({ states: [ homeState, aboutState ] }),\r\n * SharedModule,\r\n * ],\r\n * declarations: [ Home, About ],\r\n * })\r\n * export class AppModule {};\r\n * ```\r\n *\r\n * @param module UI-Router module options\r\n * @returns an `NgModule`\r\n */\r\n static forChild(module: StatesModule = {}): ModuleWithProviders<UIRouterModule> {\r\n return {\r\n ngModule: UIRouterModule,\r\n providers: makeChildProviders(module),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * UI-Router declarative configuration which can be provided to [[UIRouterModule.forRoot]]\r\n */\r\nexport interface RootModule extends StatesModule {\r\n /**\r\n * Chooses a `LocationStrategy`.\r\n *\r\n * The location strategy enables either HTML5 Push State\r\n * (Requires server-side support) or \"HashBang\" URLs.\r\n *\r\n * When `false`, uses [`PathLocationStrategy`](https://angular.io/docs/ts/latest/api/common/index/PathLocationStrategy-class.html)\r\n * When `true`, uses [`HashLocationStrategy`](https://angular.io/docs/ts/latest/api/common/index/HashLocationStrategy-class.html)\r\n *\r\n * Defaults to `false`\r\n */\r\n useHash?: boolean;\r\n\r\n /**\r\n * Configures the `otherwise` rule, which chooses the state or URL to activate when no other routes matched.\r\n *\r\n * See: [[UrlRulesApi.otherwise]].\r\n */\r\n otherwise?: string | UrlRuleHandlerFn | TargetState | TargetStateDef;\r\n\r\n /**\r\n * Configures the `initial` rule, which chooses the state or URL to activate when the\r\n * application initially starts, and no other routes matched.\r\n *\r\n * See: [[UrlRulesApi.initial]].\r\n */\r\n initial?: string | UrlRuleHandlerFn | TargetState | TargetStateDef;\r\n\r\n /**\r\n * Sets [[UrlRouterProvider.deferIntercept]]\r\n */\r\n deferIntercept?: boolean;\r\n\r\n /**\r\n * Tells Angular to defer the first render until after the initial transition is complete.\r\n *\r\n * When `true`, adds an async `APP_INITIALIZER` which is resolved after any `onSuccess` or `onError`.\r\n * The initializer stops angular from rendering the root component until after the first transition completes.\r\n * This may prevent initial page flicker while the state is being loaded.\r\n *\r\n * Defaults to `false`\r\n */\r\n deferInitialRender?: boolean;\r\n}\r\n\r\n/**\r\n * UI-Router Module declarative configuration which can be passed to [[UIRouterModule.forChild]]\r\n */\r\nexport interface StatesModule {\r\n /**\r\n * The module's UI-Router states\r\n *\r\n * This list of [[Ng2StateDeclaration]] objects will be registered with the [[StateRegistry]].\r\n * Also, the components that the states route to will be added to `entryComponents` so they will be compiled.\r\n */\r\n states?: Ng2StateDeclaration[];\r\n\r\n /**\r\n * A UI-Router Module's imperative configuration\r\n *\r\n * If a UI-Router Module needs to perform some configuration (such as registering\r\n * parameter types or Transition Hooks) a `configFn` should be supplied.\r\n * The function will be passed the `UIRouter` instance, the module's `Injector`,\r\n * and the module object.\r\n *\r\n * #### Example:\r\n * ```js\r\n * import { Injector } from \"@angular/core\";\r\n * import { UIRouter } from \"@uirouter/angular\";\r\n * import { requireAuthHook } from \"./requireAuthHook\";\r\n * import { MyService } from \"./myService\";\r\n *\r\n * export function configureMyModule(uiRouter: UIRouter, injector: Injector, module: StatesModule) {\r\n * // Get UIRouter services off the UIRouter object\r\n * let urlConfig = uiRouter.urlService.config;\r\n * let transitionService = uiRouter.transitionService;\r\n * uiRouter.trace.enable(\"TRANSITION\");\r\n *\r\n * transitionService.onBefore({ to: (state) => state.requiresAuth }, requireAuthHook);\r\n *\r\n * // Create a slug type based on the string type\r\n * let builtInStringType = urlConfig.type('string');\r\n * let slugType = Object.assign({}, builtInStringType, { encode: (str) => str, decode: (str) => str });\r\n * urlConfig.type('slug', slugType);\r\n *\r\n * // Inject arbitrary services from DI using the Injector argument\r\n * let myService: MyService = injector.get(MyService)\r\n * myService.useFastMode();\r\n * }\r\n * ```\r\n *\r\n * ```js\r\n * @NgModule({\r\n * imports: [\r\n * UIRouterModule.forChild({ states: STATES, config: configureMyModule });\r\n * ]\r\n * })\r\n * class MyModule {}\r\n * ```\r\n */\r\n config?: (uiRouterInstance: UIRouter, injector: Injector, module: StatesModule) => any;\r\n}\r\n","/** @publicapi @module ng1 */ /** */\nimport * as ng_from_import from 'angular';\n/** @hidden */ declare let angular;\n/** @hidden */ const ng_from_global = angular;\n/** @hidden */ export const ng = ng_from_import && ng_from_import.module ? ng_from_import : ng_from_global;\n","/** @publicapi @module ng1 */ /** */\nimport {\n StateObject,\n pick,\n forEach,\n tail,\n extend,\n isArray,\n isInjectable,\n isDefined,\n isString,\n services,\n trace,\n ViewConfig,\n ViewService,\n ViewConfigFactory,\n PathNode,\n ResolveContext,\n Resolvable,\n IInjectable,\n} from '@uirouter/core';\nimport { Ng1ViewDeclaration } from '../interface';\nimport { TemplateFactory } from '../templateFactory';\n\n/** @internalapi */\nexport function getNg1ViewConfigFactory(): ViewConfigFactory {\n let templateFactory: TemplateFactory = null;\n return (path, view) => {\n templateFactory = templateFactory || services.$injector.get('$templateFactory');\n return [new Ng1ViewConfig(path, view, templateFactory)];\n };\n}\n\n/** @internalapi */\nconst hasAnyKey = (keys, obj) => keys.reduce((acc, key) => acc || isDefined(obj[key]), false);\n\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `views`.\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * handles the `views` property with logic specific to @uirouter/angularjs (ng1).\n *\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object\n * and applies the state-level configuration to a view named `$default`.\n *\n * @internalapi\n */\nexport function ng1ViewsBuilder(state: StateObject) {\n // Do not process root state\n if (!state.parent) return {};\n\n const 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\n // Do not allow a state to have both state-level props and also a `views: {}` property.\n // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.\n // However, the `$default` approach should not be mixed with a separate `views: ` block.\n if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {\n throw new Error(\n `State '${state.name}' has a 'views' object. ` +\n `It cannot also have \"view properties\" at the state level. ` +\n `Move the following properties into a view (in the 'views' object): ` +\n ` ${allViewKeys.filter((key) => isDefined(state[key])).join(', ')}`\n );\n }\n\n const views: { [key: string]: Ng1ViewDeclaration } = {},\n viewsObject = state.views || { $default: pick(state, allViewKeys) };\n\n forEach(viewsObject, function (config: Ng1ViewDeclaration, name: string) {\n // Account for views: { \"\": { template... } }\n name = name || '$default';\n // Account for views: { header: \"headerComponent\" }\n if (isString(config)) config = { component: <string>config };\n\n // Make a shallow copy of the config object\n config = extend({}, config);\n\n // Do not allow a view to mix props for component-style view with props for template/controller-style view\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\n throw new Error(\n `Cannot combine: ${compKeys.join('|')} with: ${nonCompKeys.join('|')} in stateview: '${name}@${state.name}'`\n );\n }\n\n config.resolveAs = config.resolveAs || '$resolve';\n config.$type = 'ng1';\n config.$context = state;\n config.$name = name;\n\n const normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\n config.$uiViewName = normalized.uiViewName;\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\n\n views[name] = config;\n });\n return views;\n}\n\n/** @hidden */\nlet id = 0;\n\n/** @internalapi */\nexport class Ng1ViewConfig implements ViewConfig {\n $id = id++;\n loaded = false;\n controller: Function; // actually IInjectable|string\n template: string;\n component: string;\n locals: any; // TODO: delete me\n\n constructor(public path: PathNode[], public viewDecl: Ng1ViewDeclaration, public factory: TemplateFactory) {}\n\n load() {\n const $q = services.$q;\n const context = new ResolveContext(this.path);\n const params = this.path.reduce((acc, node) => extend(acc, node.paramValues), {});\n\n const promises: any = {\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\n controller: $q.when(this.getController(context)),\n };\n\n return $q.all(promises).then((results) => {\n trace.traceViewServiceEvent('Loaded', this);\n this.controller = results.controller;\n extend(this, results.template); // Either { template: \"tpl\" } or { component: \"cmpName\" }\n return this;\n });\n }\n\n getTemplate = (uiView, context: ResolveContext) =>\n this.component\n ? this.factory.makeComponentTemplate(uiView, context, this.component, this.viewDecl.bindings)\n : this.template;\n\n /**\n * Gets the controller for a view configuration.\n *\n * @returns {Function|Promise.<Function>} Returns a controller, or a promise that resolves to a controller.\n */\n getController(context: ResolveContext): IInjectable | string | Promise<IInjectable | string> {\n const provider = this.viewDecl.controllerProvider;\n if (!isInjectable(provider)) return this.viewDecl.controller;\n const deps = services.$injector.annotate(provider);\n const providerFn = isArray(provider) ? tail(<any>provider) : provider;\n const resolvable = new Resolvable('', <any>providerFn, deps);\n return resolvable.get(context);\n }\n}\n","/** @publicapi @module view */ /** */\nimport { ng as angular } from './angular';\nimport { IAugmentedJQuery } from 'angular';\nimport {\n isArray,\n isDefined,\n isFunction,\n isObject,\n services,\n Obj,\n IInjectable,\n tail,\n kebobString,\n unnestR,\n ResolveContext,\n Resolvable,\n RawParams,\n} from '@uirouter/core';\nimport { Ng1ViewDeclaration, TemplateFactoryProvider } from './interface';\n\n/**\n * Service which manages loading of templates from a ViewConfig.\n */\nexport class TemplateFactory implements TemplateFactoryProvider {\n /** @hidden */ private _useHttp = angular.version.minor < 3;\n /** @hidden */ private $templateRequest;\n /** @hidden */ private $templateCache;\n /** @hidden */ private $http;\n\n /** @hidden */ $get = [\n '$http',\n '$templateCache',\n '$injector',\n ($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\n /** @hidden */\n useHttpService(value: boolean) {\n this._useHttp = value;\n }\n\n /**\n * Creates a template from a configuration object.\n *\n * @param config Configuration object for which to load a template.\n * The following properties are search in the specified order, and the first one\n * that is defined is used to create the template:\n *\n * @param params Parameters to pass to the template function.\n * @param context The resolve context associated with the template's view\n *\n * @return {string|object} The template html as a string, or a promise for\n * that string,or `null` if no template is configured.\n */\n fromConfig(\n config: Ng1ViewDeclaration,\n params: any,\n context: ResolveContext\n ): Promise<{ template?: string; component?: string }> {\n const defaultTemplate = '<ui-view></ui-view>';\n\n const asTemplate = (result) => services.$q.when(result).then((str) => ({ template: str }));\n const asComponent = (result) => services.$q.when(result).then((str) => ({ component: str }));\n\n return isDefined(config.template)\n ? asTemplate(this.fromString(config.template, params))\n : isDefined(config.templateUrl)\n ? asTemplate(this.fromUrl(config.templateUrl, params))\n : isDefined(config.templateProvider)\n ? asTemplate(this.fromProvider(config.templateProvider, params, context))\n : isDefined(config.component)\n ? asComponent(config.component)\n : isDefined(config.componentProvider)\n ? asComponent(this.fromComponentProvider(config.componentProvider, params, context))\n : asTemplate(defaultTemplate);\n }\n\n /**\n * Creates a template from a string or a function returning a string.\n *\n * @param template html template as a string or function that returns an html template as a string.\n * @param params Parameters to pass to the template function.\n *\n * @return {string|object} The template html as a string, or a promise for that\n * string.\n */\n fromString(template: string | Function, params?: RawParams) {\n return isFunction(template) ? (<any>template)(params) : template;\n }\n\n /**\n * Loads a template from the a URL via `$http` and `$templateCache`.\n *\n * @param {string|Function} url url of the template to load, or a function\n * that returns a url.\n * @param {Object} params Parameters to pass to the url function.\n * @return {string|Promise.<string>} The template html as a string, or a promise\n * for that string.\n */\n fromUrl(url: string | Function, params: any) {\n if (isFunction(url)) url = (<any>url)(params);\n if (url == null) return null;\n\n if (this._useHttp) {\n return this.$http\n .get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })\n .then(function (response) {\n return response.data;\n });\n }\n\n return this.$templateRequest(url);\n }\n\n /**\n * Creates a template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string|Promise.<string>} The template html as a string, or a promise\n * for that string.\n */\n fromProvider(provider: IInjectable, params: any, context: ResolveContext) {\n const deps = services.$injector.annotate(provider);\n const providerFn = isArray(provider) ? tail(<any[]>provider) : provider;\n const resolvable = new Resolvable('', <Function>providerFn, deps);\n return resolvable.get(context);\n }\n\n /**\n * Creates a component's template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string} The template html as a string: \"<component-name input1='::$resolve.foo'></component-name>\".\n */\n fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext) {\n const deps = services.$injector.annotate(provider);\n const providerFn = isArray(provider) ? tail(<any[]>provider) : provider;\n const resolvable = new Resolvable('', <Function>providerFn, deps);\n return resolvable.get(context);\n }\n\n /**\n * Creates a template from a component's name\n *\n * This implements route-to-component.\n * It works by retrieving the component (directive) metadata from the injector.\n * It analyses the component's bindings, then constructs a template that instantiates the component.\n * The template wires input and output bindings to resolves or from the parent component.\n *\n * @param uiView {object} The parent ui-view (for binding outputs to callbacks)\n * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)\n * @param component {string} Component's name in camel case.\n * @param bindings An object defining the component's bindings: {foo: '<'}\n * @return {string} The template as a string: \"<component-name input1='::$resolve.foo'></component-name>\".\n */\n makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any) {\n bindings = bindings || {};\n\n // Bind once prefix\n const prefix = angular.version.minor >= 3 ? '::' : '';\n // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`\n const kebob = (camelCase: string) => {\n const kebobed = kebobString(camelCase);\n return /^(x|data)-/.exec(kebobed) ? `x-${kebobed}` : kebobed;\n };\n\n const attributeTpl = (input: BindingTuple) => {\n const { name, type } = input;\n const attrName = kebob(name);\n // If the ui-view has an attribute which matches a binding on the routed component\n // then pass that attribute through to the routed component template.\n // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`\n if (uiView.attr(attrName) && !bindings[name]) return `${attrName}='${uiView.attr(attrName)}'`;\n\n const resolveName = bindings[name] || name;\n // Pre-evaluate the expression for \"@\" bindings by enclosing in {{ }}\n // some-attr=\"{{ ::$resolve.someResolveName }}\"\n if (type === '@') return `${attrName}='{{${prefix}$resolve.${resolveName}}}'`;\n\n // Wire \"&\" callbacks to resolves that return a callback function\n // Get the result of the resolve (should be a function) and annotate it to get its arguments.\n // some-attr=\"$resolve.someResolveResultName(foo, bar)\"\n if (type === '&') {\n const res = context.getResolvable(resolveName);\n const fn = res && res.data;\n const args = (fn && services.$injector.annotate(fn)) || [];\n // account for array style injection, i.e., ['foo', function(foo) {}]\n const arrayIdxStr = isArray(fn) ? `[${fn.length - 1}]` : '';\n return `${attrName}='$resolve.${resolveName}${arrayIdxStr}(${args.join(',')})'`;\n }\n\n // some-attr=\"::$resolve.someResolveName\"\n return `${attrName}='${prefix}$resolve.${resolveName}'`;\n };\n\n const attrs = getComponentBindings(component).map(attributeTpl).join(' ');\n const kebobName = kebob(component);\n return `<${kebobName} ${attrs}></${kebobName}>`;\n }\n}\n\n// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')\nfunction getComponentBindings(name: string) {\n const cmpDefs = <any[]>services.$injector.get(name + 'Directive'); // could be multiple\n if (!cmpDefs || !cmpDefs.length) throw new Error(`Unable to find component named '${name}'`);\n return cmpDefs.map(getBindings).reduce(unnestR, []);\n}\n\n// Given a directive definition, find its object input attributes\n// Use different properties, depending on the type of directive (component, bindToController, normal)\nconst getBindings = (def: any) => {\n if (isObject(def.bindToController)) return scopeBindings(def.bindToController);\n return scopeBindings(def.scope);\n};\n\ninterface BindingTuple {\n name: string;\n type: string;\n}\n\n// for ng 1.2 style, process the scope: { input: \"=foo\" }\n// for ng 1.3 through ng 1.5, process the component's bindToController: { input: \"=foo\" } object\nconst scopeBindings = (bindingsObj: Obj) =>\n Object.keys(bindingsObj || {})\n // [ 'input', [ '=foo', '=', 'foo' ] ]\n .map((key) => [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])])\n // skip malformed values\n .filter((tuple) => isDefined(tuple) && isArray(tuple[1]))\n // { name: ('foo' || 'input'), type: '=' }\n .map((tuple) => ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] } as BindingTuple));\n","/** @publicapi @module ng1 */ /** */\nimport {\n val,\n isObject,\n createProxyFunctions,\n BuilderFunction,\n StateRegistry,\n StateService,\n OnInvalidCallback,\n} from '@uirouter/core';\nimport { Ng1StateDeclaration } from './interface';\n\n/**\n * The Angular 1 `StateProvider`\n *\n * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\nexport class StateProvider {\n constructor(private stateRegistry: StateRegistry, private stateService: StateService) {\n createProxyFunctions(val(StateProvider.prototype), this, val(this));\n }\n\n /**\n * Decorates states when they are registered\n *\n * Allows you to extend (carefully) or override (at your own peril) the\n * `stateBuilder` object used internally by [[StateRegistry]].\n * This can be used to add custom functionality to ui-router,\n * for example inferring templateUrl based on the state name.\n *\n * When passing only a name, it returns the current (original or decorated) builder\n * function that matches `name`.\n *\n * The builder functions that can be decorated are listed below. Though not all\n * necessarily have a good use case for decoration, that is up to you to decide.\n *\n * In addition, users can attach custom decorators, which will generate new\n * properties within the state's internal definition. There is currently no clear\n * use-case for this beyond accessing internal states (i.e. $state.$current),\n * however, expect this to become increasingly relevant as we introduce additional\n * meta-programming features.\n *\n * **Warning**: Decorators should not be interdependent because the order of\n * execution of the builder functions in non-deterministic. Builder functions\n * should only be dependent on the state definition object and super function.\n *\n *\n * Existing builder functions and current return values:\n *\n * - **parent** `{object}` - returns the parent state object.\n * - **data** `{object}` - returns state data, including any inherited data that is not\n * overridden by own values (if any).\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n * or `null`.\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is\n * navigable).\n * - **params** `{object}` - returns an array of state params that are ensured to\n * be a super-set of parent's params.\n * - **views** `{object}` - returns a views object where each key is an absolute view\n * name (i.e. \"viewName@stateName\") and each value is the config object\n * (template, controller) for the view. Even when you don't use the views object\n * explicitly on a state config, one is still created for you internally.\n * So by decorating this builder function you have access to decorating template\n * and controller properties.\n * - **ownParams** `{object}` - returns an array of params that belong to the state,\n * not including any params defined by ancestor states.\n * - **path** `{string}` - returns the full path from the root down to this state.\n * Needed for state activation.\n * - **includes** `{object}` - returns an object that includes every state that\n * would pass a `$state.includes()` test.\n *\n * #### Example:\n * Override the internal 'views' builder with a function that takes the state\n * definition, and a reference to the internal function being overridden:\n * ```js\n * $stateProvider.decorator('views', function (state, parent) {\n * let result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * let autoName = (state.name + '.' + name).replace('.', '/');\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n * result[name] = config;\n * });\n * return result;\n * });\n *\n * $stateProvider.state('home', {\n * views: {\n * 'contact.list': { controller: 'ListController' },\n * 'contact.item': { controller: 'ItemController' }\n * }\n * });\n * ```\n *\n *\n * ```js\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * $state.go('home');\n * ```\n *\n * @param {string} name The name of the builder function to decorate.\n * @param {object} func A function that is responsible for decorating the original\n * builder function. The function receives two parameters:\n *\n * - `{object}` - state - The state config object.\n * - `{object}` - super - The original builder function.\n *\n * @return {object} $stateProvider - $stateProvider instance\n */\n decorator(name: string, func: BuilderFunction) {\n return this.stateRegistry.decorator(name, func) || this;\n }\n\n /**\n * Registers a state\n *\n * ### This is a passthrough to [[StateRegistry.register]].\n *\n * Registers a state configuration under a given state name.\n * The stateConfig object has the following acceptable properties.\n *\n * <a id='template'></a>\n *\n * - **`template`** - {string|function=} - html template as a string or a function that returns\n * an html template as a string which should be used by the uiView directives. This property\n * takes precedence over templateUrl.\n *\n * If `template` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * <a id='templateUrl'></a>\n *\n * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html\n * template that should be used by uiView.\n *\n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * <a id='templateProvider'></a>\n *\n * - **`templateProvider`** - {function=} - Provider function that returns HTML content\n * string.\n *\n * <a id='controller'></a>\n *\n * - **`controller`** - {string|function=} - Controller fn that should be associated with newly\n * related scope or the name of a registered controller if passed as a string.\n *\n * <a id='controllerProvider'></a>\n *\n * - **`controllerProvider`** - {function=} - Injectable provider function that returns\n * the actual controller or string.\n *\n * <a id='controllerAs'></a>\n *\n * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be\n * published to scope under the controllerAs name.\n *\n * <a id='resolve'></a>\n *\n * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which\n * should be injected into the controller. If any of these dependencies are promises,\n * the router will wait for them all to be resolved or one to be rejected before the\n * controller is instantiated. If all the promises are resolved successfully, the values\n * of the resolved promises are injected and $stateChangeSuccess event is fired. If any\n * of the promises are rejected the $stateChangeError event is fired. The map object is:\n *\n * - key - {string}: name of dependency to be injected into controller\n * - factory - {string|function}: If string then it is alias for service. Otherwise if function,\n * it is injected and return value it treated as dependency. If result is a promise, it is\n * resolved before its value is injected into controller.\n *\n * <a id='url'></a>\n *\n * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or\n * transitioned to, the `$stateParams` service will be populated with any\n * parameters that were passed.\n *\n * <a id='params'></a>\n *\n * - **`params`** - {object=} - An array of parameter names or regular expressions. Only\n * use this within a state if you are not using url. Otherwise you can specify your\n * parameters within the url. When a state is navigated or transitioned to, the\n * $stateParams service will be populated with any parameters that were passed.\n *\n * <a id='views'></a>\n *\n * - **`views`** - {object=} - Use the views property to set up multiple views or to target views\n * manually/explicitly.\n *\n * <a id='abstract'></a>\n *\n * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,\n * but can provide inherited properties to its common children states.\n *\n * <a id='onEnter'></a>\n *\n * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way\n * to trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.\n *\n * <a id='onExit'></a>\n *\n * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to\n * trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.\n *\n * <a id='reloadOnSearch'></a>\n *\n * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state\n * just because a search/query parameter has changed (via $location.search() or $location.hash()).\n * Useful for when you'd like to modify $location.search() without triggering a reload.\n *\n * <a id='data'></a>\n *\n * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.\n *\n * #### Example:\n * Some state name examples\n * ```js\n * // stateName can be a single top-level name (must be unique).\n * $stateProvider.state(\"home\", {});\n *\n * // Or it can be a nested state name. This state is a child of the\n * // above \"home\" state.\n * $stateProvider.state(\"home.newest\", {});\n *\n * // Nest states as deeply as needed.\n * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n *\n * // state() returns $stateProvider, so you can chain state declarations.\n * $stateProvider\n * .state(\"home\", {})\n * .state(\"about\", {})\n * .state(\"contacts\", {});\n * ```\n *\n * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n * @param {object} definition State configuration object.\n */\n state(name: string, definition: Ng1StateDeclaration): StateProvider;\n state(definition: Ng1StateDeclaration): StateProvider;\n state(name: any, definition?: any) {\n if (isObject(name)) {\n definition = name;\n } else {\n definition.name = name;\n }\n this.stateRegistry.register(definition);\n return this;\n }\n\n /**\n * Registers an invalid state handler\n *\n * This is a passthrough to [[StateService.onInvalid]] for ng1.\n */\n\n onInvalid(callback: OnInvalidCallback): Function {\n return this.stateService.onInvalid(callback);\n }\n}\n","/** @publicapi @module ng1 */ /** */\nimport {\n StateObject,\n TransitionStateHookFn,\n HookResult,\n Transition,\n services,\n ResolveContext,\n extend,\n} from '@uirouter/core';\nimport { getLocals } from '../services';\nimport { Ng1StateDeclaration } from '../interface';\n\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,\n * `onRetain` callback hooks on a [[Ng1StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * ensures that those hooks are injectable for @uirouter/angularjs (ng1).\n *\n * @internalapi\n */\nexport const getStateHookBuilder = (hookName: 'onEnter' | 'onExit' | 'onRetain') =>\n function stateHookBuilder(stateObject: StateObject): TransitionStateHookFn {\n const hook = stateObject[hookName];\n const pathname = hookName === 'onExit' ? 'from' : 'to';\n\n function decoratedNg1Hook(trans: Transition, state: Ng1StateDeclaration): HookResult {\n const resolveContext = new ResolveContext(trans.treeChanges(pathname));\n const subContext = resolveContext.subContext(state.$$state());\n const locals = extend(getLocals(subContext), { $state$: state, $transition$: trans });\n return services.$injector.invoke(hook, this, locals);\n }\n\n return hook ? decoratedNg1Hook : undefined;\n };\n","/** @publicapi @module ng1 */ /** */\nimport { LocationConfig, LocationServices, UIRouter, ParamType, isDefined } from '@uirouter/core';\nimport { val, createProxyFunctions, removeFrom, isObject } from '@uirouter/core';\nimport { ILocationService, ILocationProvider, IWindowService } from 'angular';\n\n/**\n * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service\n * @internalapi\n */\nexport class Ng1LocationServices implements LocationConfig, LocationServices {\n private $locationProvider: ILocationProvider;\n private $location: ILocationService;\n private $sniffer: any;\n private $browser: any;\n private $window: IWindowService;\n\n path;\n search;\n hash;\n hashPrefix;\n port;\n protocol;\n host;\n\n private _baseHref: string;\n\n // .onChange() registry\n private _urlListeners: Function[] = [];\n\n /**\n * Applys ng1-specific path parameter encoding\n *\n * The Angular 1 `$location` service is a bit weird.\n * It doesn't allow slashes to be encoded/decoded bi-directionally.\n *\n * See the writeup at https://github.com/angular-ui/ui-router/issues/2598\n *\n * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F\n *\n * @param router\n */\n static monkeyPatchPathParameterType(router: UIRouter) {\n const pathType: ParamType = router.urlMatcherFactory.type('path');\n\n pathType.encode = (x: any) =>\n x != null ? x.toString().replace(/(~|\\/)/g, (m) => ({ '~': '~~', '/': '~2F' }[m])) : x;\n\n pathType.decode = (x: string) =>\n x != null ? x.toString().replace(/(~~|~2F)/g, (m) => ({ '~~': '~', '~2F': '/' }[m])) : x;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n dispose() {}\n\n constructor($locationProvider: ILocationProvider) {\n this.$locationProvider = $locationProvider;\n const _lp = val($locationProvider);\n createProxyFunctions(_lp, this, _lp, ['hashPrefix']);\n }\n\n onChange(callback: Function) {\n this._urlListeners.push(callback);\n return () => removeFrom(this._urlListeners)(callback);\n }\n\n html5Mode() {\n let html5Mode: any = this.$locationProvider.html5Mode();\n html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;\n return html5Mode && this.$sniffer.history;\n }\n\n baseHref() {\n return this._baseHref || (this._baseHref = this.$browser.baseHref() || this.$window.location.pathname);\n }\n\n url(newUrl?: string, replace = false, state?) {\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\n _runtimeServices($rootScope, $location: ILocationService, $sniffer, $browser, $window: IWindowService) {\n this.$location = $location;\n this.$sniffer = $sniffer;\n this.$browser = $browser;\n this.$window = $window;\n\n // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange\n $rootScope.$on('$locationChangeSuccess', (evt) => this._urlListeners.forEach((fn) => fn(evt)));\n const _loc = val($location);\n\n // Bind these LocationService functions to $location\n createProxyFunctions(_loc, this, _loc, ['replace', 'path', 'search', 'hash']);\n // Bind these LocationConfig functions to $location\n createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);\n }\n}\n","/** @publicapi @module url */ /** */\nimport {\n UIRouter,\n LocationServices,\n $InjectorLike,\n BaseUrlRule,\n UrlRuleHandlerFn,\n UrlMatcher,\n IInjectable,\n UrlRouter,\n} from '@uirouter/core';\nimport { services, isString, isFunction, isArray, identity } from '@uirouter/core';\n\nexport interface RawNg1RuleFunction {\n ($injector: $InjectorLike, $location: LocationServices): string | void;\n}\n\n/**\n * Manages rules for client-side URL\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\n *\n * This class manages the router rules for what to do when the URL changes.\n *\n * This provider remains for backwards compatibility.\n *\n * @internalapi\n * @deprecated\n */\nexport class UrlRouterProvider {\n static injectableHandler(router: UIRouter, handler: IInjectable): UrlRuleHandlerFn {\n return (match) => services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });\n }\n\n /** @hidden */\n constructor(/** @hidden */ private router: UIRouter) {}\n\n /** @hidden */\n $get(): UrlRouter {\n const urlService = this.router.urlService;\n this.router.urlRouter.update(true);\n if (!urlService.interceptDeferred) urlService.listen();\n return this.router.urlRouter;\n }\n\n /**\n * Registers a url handler function.\n *\n * Registers a low level url handler (a `rule`).\n * A rule detects specific URL patterns and returns a redirect, or performs some action.\n *\n * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Here's an example of how you might allow case insensitive urls\n * $urlRouterProvider.rule(function ($injector, $location) {\n * var path = $location.path(),\n * normalized = path.toLowerCase();\n *\n * if (path !== normalized) {\n * return normalized;\n * }\n * });\n * });\n * ```\n *\n * @param ruleFn\n * Handler function that takes `$injector` and `$location` services as arguments.\n * You can use them to detect a url and return a different url as a string.\n *\n * @return [[UrlRouterProvider]] (`this`)\n */\n rule(ruleFn: RawNg1RuleFunction): UrlRouterProvider {\n if (!isFunction(ruleFn)) throw new Error(\"'rule' must be a function\");\n\n const match = () => ruleFn(services.$injector, this.router.locationService);\n\n const rule = new BaseUrlRule(match, identity);\n this.router.urlService.rules.rule(rule);\n return this;\n }\n\n /**\n * Defines the path or behavior to use when no url can be matched.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // if the path doesn't match any of the urls you configured\n * // otherwise will take care of routing the user to the\n * // specified url\n * $urlRouterProvider.otherwise('/index');\n *\n * // Example of using function rule as param\n * $urlRouterProvider.otherwise(function ($injector, $location) {\n * return '/a/valid/url';\n * });\n * });\n * ```\n *\n * @param rule\n * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.\n * The function version is passed two params: `$injector` and `$location` services, and should return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n otherwise(rule: string | RawNg1RuleFunction): UrlRouterProvider {\n const urlRules = this.router.urlService.rules;\n if (isString(rule)) {\n urlRules.otherwise(rule);\n } else if (isFunction(rule)) {\n urlRules.otherwise(() => rule(services.$injector, this.router.locationService));\n } else {\n throw new Error(\"'rule' must be a string or function\");\n }\n\n return this;\n }\n\n /**\n * Registers a handler for a given url matching.\n *\n * If the handler is a string, it is\n * treated as a redirect, and is interpolated according to the syntax of match\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n *\n * If the handler is a function, it is injectable.\n * It gets invoked if `$location` matches.\n * You have the option of inject the match object as `$match`.\n *\n * The handler can return\n *\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n * will continue trying to find another one that matches.\n * - **string** which is treated as a redirect and passed to `$location.url()`\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n * if ($state.$current.navigable !== state ||\n * !equalForKeys($match, $stateParams) {\n * $state.transitionTo(state, $match, false);\n * }\n * });\n * });\n * ```\n *\n * @param what A pattern string to match, compiled as a [[UrlMatcher]].\n * @param handler The path (or function that returns a path) that you want to redirect your user to.\n * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]\n *\n * Note: the handler may also invoke arbitrary code, such as `$state.go()`\n */\n when(what: RegExp | UrlMatcher | string, handler: string | IInjectable): this {\n if (isArray(handler) || isFunction(handler)) {\n handler = UrlRouterProvider.injectableHandler(this.router, handler);\n }\n\n this.router.urlService.rules.when(what, handler as any);\n return this;\n }\n\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * $urlRouterProvider.deferIntercept();\n * })\n *\n * app.run(function (MyService, $urlRouter, $http) {\n * $http.get(\"/stuff\").then(function(resp) {\n * MyService.doStuff(resp.data);\n * $urlRouter.listen();\n * $urlRouter.sync();\n * });\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n deferIntercept(defer?: boolean): void {\n this.router.urlService.deferIntercept(defer);\n }\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * # Angular 1 types\n *\n * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.\n * The customizations to the core types for Angular UI-Router are documented here.\n *\n * The optional [[$resolve]] service is also documented here.\n *\n * @preferred @publicapi @module ng1\n */ /** */\nimport { ng as angular } from './angular';\nimport {\n IRootScopeService,\n IQService,\n ILocationService,\n ILocationProvider,\n IHttpService,\n ITemplateCacheService,\n} from 'angular';\nimport {\n services,\n applyPairs,\n isString,\n trace,\n extend,\n UIRouter,\n StateService,\n UrlRouter,\n UrlMatcherFactory,\n ResolveContext,\n unnestR,\n TypedMap,\n} from '@uirouter/core';\nimport { ng1ViewsBuilder, getNg1ViewConfigFactory } from './statebuilders/views';\nimport { TemplateFactory } from './templateFactory';\nimport { StateProvider } from './stateProvider';\nimport { getStateHookBuilder } from './statebuilders/onEnterExitRetain';\nimport { Ng1LocationServices } from './locationServices';\nimport { UrlRouterProvider } from './urlRouterProvider';\nimport IInjectorService = angular.auto.IInjectorService;\n\nangular.module('ui.router.angular1', []);\nconst mod_init = angular.module('ui.router.init', ['ng']);\nconst mod_util = angular.module('ui.router.util', ['ui.router.init']);\nconst mod_rtr = angular.module('ui.router.router', ['ui.router.util']);\nconst mod_state = angular.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\nconst mod_main = angular.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\nconst mod_cmpt = angular.module('ui.router.compat', ['ui.router']);\n\ndeclare module '@uirouter/core/lib/router' {\n interface UIRouter {\n /** @hidden */\n stateProvider: StateProvider;\n /** @hidden */\n urlRouterProvider: UrlRouterProvider;\n }\n}\n\nlet router: UIRouter = null;\n\n$uiRouterProvider.$inject = ['$locationProvider'];\n/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */\nfunction $uiRouterProvider($locationProvider: ILocationProvider) {\n // Create a new instance of the Router when the $uiRouterProvider is initialized\n router = this.router = new UIRouter();\n router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);\n\n // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties\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\n router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());\n\n // Disable decoding of params by UrlMatcherFactory because $location already handles this\n router.urlService.config._decodeParams = false;\n\n const ng1LocationService = (router.locationService = router.locationConfig = new Ng1LocationServices(\n $locationProvider\n ));\n\n Ng1LocationServices.monkeyPatchPathParameterType(router);\n\n // backwards compat: also expose router instance as $uiRouterProvider.router\n router['router'] = router;\n router['$get'] = $get;\n $get.$inject = ['$location', '$browser', '$window', '$sniffer', '$rootScope', '$http', '$templateCache'];\n function $get(\n $location: ILocationService,\n $browser: any,\n $window: any,\n $sniffer: any,\n $rootScope: ng.IScope,\n $http: IHttpService,\n $templateCache: ITemplateCacheService\n ) {\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser, $window);\n delete router['router'];\n delete router['$get'];\n return router;\n }\n return router;\n}\n\nconst getProviderFor = (serviceName) => [\n '$uiRouterProvider',\n ($urp) => {\n const service = $urp.router[serviceName];\n service['$get'] = () => service;\n return service;\n },\n];\n\n// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\nfunction runBlock($injector: IInjectorService, $q: IQService, $uiRouter: UIRouter) {\n services.$injector = $injector;\n services.$q = <any>$q;\n\n // https://github.com/angular-ui/ui-router/issues/3678\n if (!Object.prototype.hasOwnProperty.call($injector, 'strictDi')) {\n try {\n $injector.invoke(function (checkStrictDi) {});\n } catch (error) {\n $injector.strictDi = !!/strict mode/.exec(error && error.toString());\n }\n }\n\n // The $injector is now available.\n // Find any resolvables that had dependency annotation deferred\n $uiRouter.stateRegistry\n .get()\n .map((x) => x.$$state().resolvables)\n .reduce(unnestR, [])\n .filter((x) => x.deps === 'deferred')\n .forEach((resolvable) => (resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi)));\n}\n\n// $urlRouter service and $urlRouterProvider\nconst getUrlRouterProvider = (uiRouter: UIRouter) => (uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter));\n\n// $state service and $stateProvider\n// $urlRouter service and $urlRouterProvider\nconst getStateProvider = () => extend(router.stateProvider, { $get: () => router.stateService });\n\nwatchDigests.$inject = ['$rootScope'];\nexport function watchDigests($rootScope: IRootScopeService) {\n $rootScope.$watch(function () {\n trace.approximateDigests++;\n });\n}\n\nmod_init.provider('$uiRouter', <any>$uiRouterProvider);\nmod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\nmod_util.provider('$urlService', getProviderFor('urlService'));\nmod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', () => router.urlMatcherFactory]);\nmod_util.provider('$templateFactory', () => new TemplateFactory());\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\nmod_state.provider('$transitions', getProviderFor('transitionService'));\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\n\nmod_state.factory('$stateParams', ['$uiRouter', ($uiRouter: UIRouter) => $uiRouter.globals.params]);\nmod_main.factory('$view', () => router.viewService);\nmod_main.service('$trace', () => trace);\n\nmod_main.run(watchDigests);\nmod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory: UrlMatcherFactory) {}]);\nmod_state.run(['$state', function ($state: StateService) {}]);\nmod_rtr.run(['$urlRouter', function ($urlRouter: UrlRouter) {}]);\nmod_init.run(runBlock);\n\n/** @hidden TODO: find a place to move this */\nexport const getLocals = (ctx: ResolveContext): TypedMap<any> => {\n const tokens = ctx.getTokens().filter(isString);\n\n const tuples = tokens.map((key) => {\n const resolvable = ctx.getResolvable(key);\n const waitPolicy = ctx.getPolicy(resolvable).async;\n return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];\n });\n\n return tuples.reduce(applyPairs, {});\n};\n","/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable prefer-const */\n/**\n * # Angular 1 Directives\n *\n * These are the directives included in UI-Router for Angular 1.\n * These directives are used in templates to create viewports and link/navigate to states.\n *\n * @preferred @publicapi @module directives\n */ /** */\nimport { ng as angular } from '../angular';\nimport { IAugmentedJQuery, ITimeoutService, IScope, IInterpolateService } from 'angular';\n\nimport {\n Obj,\n extend,\n forEach,\n tail,\n isString,\n isObject,\n isArray,\n parse,\n noop,\n unnestR,\n identity,\n uniqR,\n inArray,\n removeFrom,\n RawParams,\n PathNode,\n StateOrName,\n StateService,\n StateDeclaration,\n UIRouter,\n} from '@uirouter/core';\nimport { UIViewData } from './viewDirective';\n\n/** @hidden Used for typedoc */\nexport interface ng1_directive {}\n\n/** @hidden */\nfunction parseStateRef(ref: string) {\n const paramsOnly = ref.match(/^\\s*({[^}]*})\\s*$/);\n if (paramsOnly) ref = '(' + paramsOnly[1] + ')';\n\n const parsed = ref.replace(/\\n/g, ' ').match(/^\\s*([^(]*?)\\s*(\\((.*)\\))?\\s*$/);\n if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n return { state: parsed[1] || null, paramExpr: parsed[3] || null };\n}\n\n/** @hidden */\nfunction stateContext(el: IAugmentedJQuery) {\n const $uiView: UIViewData = (el.parent() as IAugmentedJQuery).inheritedData('$uiView');\n const path: PathNode[] = parse('$cfg.path')($uiView);\n return path ? tail(path).state.name : undefined;\n}\n\n/** @hidden */\nfunction processedDef($state: StateService, $element: IAugmentedJQuery, def: Def): Def {\n const uiState = def.uiState || $state.current.name;\n const uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {});\n const href = $state.href(uiState, def.uiStateParams, uiStateOpts);\n return { uiState, uiStateParams: def.uiStateParams, uiStateOpts, href };\n}\n\n/** @hidden */\ninterface TypeInfo {\n attr: string;\n isAnchor: boolean;\n clickable: boolean;\n}\n\n/** @hidden */\nfunction getTypeInfo(el: IAugmentedJQuery): TypeInfo {\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n const isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\n const isForm = el[0].nodeName === 'FORM';\n\n return {\n attr: isForm ? 'action' : isSvg ? 'xlink:href' : 'href',\n isAnchor: el.prop('tagName').toUpperCase() === 'A',\n clickable: !isForm,\n };\n}\n\n/** @hidden */\nfunction clickHook(\n el: IAugmentedJQuery,\n $state: StateService,\n $timeout: ITimeoutService,\n type: TypeInfo,\n getDef: () => Def\n) {\n return function (e: JQueryMouseEventObject) {\n const button = e.which || e.button,\n target = getDef();\n\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || el.attr('target'))) {\n // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n const transition = $timeout(function () {\n if (!el.attr('disabled')) {\n $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);\n }\n });\n e.preventDefault();\n\n // if the state has no URL, ignore one preventDefault from the <a> directive.\n let ignorePreventDefaultCount = type.isAnchor && !target.href ? 1 : 0;\n\n e.preventDefault = function () {\n if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition);\n };\n }\n };\n}\n\n/** @hidden */\nfunction defaultOpts(el: IAugmentedJQuery, $state: StateService) {\n return {\n relative: stateContext(el) || $state.$current,\n inherit: true,\n source: 'sref',\n };\n}\n\n/** @hidden */\nfunction bindEvents(element: IAugmentedJQuery, scope: IScope, hookFn: EventListener, uiStateOpts: any): void {\n let events;\n\n if (uiStateOpts) {\n events = uiStateOpts.events;\n }\n\n if (!isArray(events)) {\n events = ['click'];\n }\n\n const on = element.on ? 'on' : 'bind';\n for (const event of events) {\n element[on](event, hookFn);\n }\n\n scope.$on('$destroy', function () {\n const off = element.off ? 'off' : 'unbind';\n for (const event of events) {\n element[off](event, hookFn as any);\n }\n });\n}\n\n/**\n * `ui-sref`: A directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of the `ui-sref` is the name of the state to link to.\n *\n * #### Example:\n * This will activate the `home` state when the link is clicked.\n * ```html\n * <a ui-sref=\"home\">Home</a>\n * ```\n *\n * ### Relative Links\n * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create a relative `ui-sref` which always targets the same destination.\n *\n * #### Example:\n * Both these links are relative to the parent state, even when a child state is currently active.\n * ```html\n * <a ui-sref=\".child1\">child 1 state</a>\n * <a ui-sref=\".child2\">child 2 state</a>\n * ```\n *\n * This link activates the parent state.\n * ```html\n * <a ui-sref=\"^\">Return</a>\n * ```\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * #### Example:\n * Assuming the `users` state has a url of `/users/`\n * ```html\n * <a ui-sref=\"users\" href=\"/users/\">Users</a>\n * ```\n *\n * ### Parameter Values\n * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.\n * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.\n * The content inside the parentheses is an expression, evaluated to the parameter values.\n *\n * #### Example:\n * This example renders a list of links to users.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n * <li ng-repeat=\"user in users\">\n * <a ui-sref=\"users.detail({ userId: user.id })\">{{ user.displayName }}</a>\n * </li>\n * ```\n *\n * Note:\n * The parameter values expression is `$watch`ed for updates.\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n *\n * #### Example:\n * ```html\n * <a ui-sref=\"home\" ui-sref-opts=\"{ reload: true }\">Home</a>\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-sref-opts` attribute.\n *\n * #### Example:\n * ```html\n * <input type=\"text\" ui-sref=\"contacts\" ui-sref-opts=\"{ events: ['change', 'blur'] }\">\n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Examples\n * If you have the following template:\n *\n * ```html\n * <a ui-sref=\"home\">Home</a>\n * <a ui-sref=\"about\">About</a>\n * <a ui-sref=\"{page: 2}\">Next page</a>\n *\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <a ui-sref=\"contacts.detail({ id: contact.id })\">{{ contact.name }}</a>\n * </li>\n * </ul>\n * ```\n *\n * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:\n *\n * ```html\n * <a href=\"#/home\" ui-sref=\"home\">Home</a>\n * <a href=\"#/about\" ui-sref=\"about\">About</a>\n * <a href=\"#/contacts?page=2\" ui-sref=\"{page: 2}\">Next page</a>\n *\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/1\" ui-sref=\"contacts.detail({ id: contact.id })\">Joe</a>\n * </li>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/2\" ui-sref=\"contacts.detail({ id: contact.id })\">Alice</a>\n * </li>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/3\" ui-sref=\"contacts.detail({ id: contact.id })\">Bob</a>\n * </li>\n * </ul>\n *\n * <a href=\"#/home\" ui-sref=\"home\" ui-sref-opts=\"{reload: true}\">Home</a>\n * ```\n *\n * ### Notes\n *\n * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * <a ui-sref=\"{ lang: 'en' }\">English</a>\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n *\n * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).\n * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.\n */\nlet uiSrefDirective: ng1_directive;\nuiSrefDirective = [\n '$uiRouter',\n '$timeout',\n function $StateRefDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {\n const $state = $uiRouter.stateService;\n\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope: IScope, element: IAugmentedJQuery, attrs: any, uiSrefActive: any) {\n const type = getTypeInfo(element);\n const active = uiSrefActive[1] || uiSrefActive[0];\n let unlinkInfoFn: Function = null;\n\n const rawDef = {} as Def;\n const getDef = () => processedDef($state, element, rawDef);\n\n const ref = parseStateRef(attrs.uiSref);\n rawDef.uiState = ref.state;\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\n\n function update() {\n const 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\n if (ref.paramExpr) {\n scope.$watch(\n ref.paramExpr,\n function (val) {\n rawDef.uiStateParams = extend({}, val);\n update();\n },\n true\n );\n rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));\n }\n\n update();\n\n scope.$on('$destroy', <any>$uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', <any>$uiRouter.transitionService.onSuccess({}, update));\n\n if (!type.clickable) return;\n const hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n },\n };\n },\n];\n\n/**\n * `ui-state`: A fully dynamic directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.\n * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**\n *\n * #### Example:\n * Create a list of links.\n * ```html\n * <li ng-repeat=\"link in navlinks\">\n * <a ui-state=\"link.state\">{{ link.displayName }}</a>\n * </li>\n * ```\n *\n * ### Relative Links\n * If the expression evaluates to a relative path, it is processed like [[uiSref]].\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create relative `ui-state` which always targets the same destination.\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * ### Parameter Values\n * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.\n * Param values should be provided using the `ui-state-params` attribute.\n * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * This example renders a list of links with param values.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n * <li ng-repeat=\"link in navlinks\">\n * <a ui-state=\"link.state\" ui-state-params=\"link.params\">{{ link.displayName }}</a>\n * </li>\n * ```\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * ```html\n * <a ui-state=\"returnto.state\" ui-state-opts=\"{ reload: true }\">Home</a>\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-state-opts` attribute.\n *\n * #### Example:\n * ```html\n * <input type=\"text\" ui-state=\"contacts\" ui-state-opts=\"{ events: ['change', 'blur'] }\">\n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Notes\n *\n * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.\n * However, it might be simpler to use [[uiSref]] parameter-only links.\n *\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * <a ui-state=\"\" ui-state-params=\"{ lang: 'en' }\">English</a>\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n * ```\n */\nlet uiStateDirective: ng1_directive;\nuiStateDirective = [\n '$uiRouter',\n '$timeout',\n function $StateRefDynamicDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {\n const $state = $uiRouter.stateService;\n\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope: IScope, element: IAugmentedJQuery, attrs: any, uiSrefActive: any) {\n const type = getTypeInfo(element);\n const active = uiSrefActive[1] || uiSrefActive[0];\n let unlinkInfoFn: Function = null;\n let hookFn;\n\n const rawDef = {} as Def;\n const getDef = () => processedDef($state, element, rawDef);\n\n const inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\n const watchDeregFns = inputAttrs.reduce((acc, attr) => ((acc[attr] = noop), acc), {});\n\n function update() {\n const 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\n inputAttrs.forEach((field) => {\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\n\n attrs.$observe(field, (expr) => {\n watchDeregFns[field]();\n watchDeregFns[field] = scope.$watch(\n expr,\n (newval) => {\n rawDef[field] = newval;\n update();\n },\n true\n );\n });\n });\n\n update();\n\n scope.$on('$destroy', <any>$uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', <any>$uiRouter.transitionService.onSuccess({}, update));\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n },\n };\n },\n];\n\n/**\n * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active\n *\n * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the\n * related directive's state is active (and remove them when it is inactive).\n *\n * The primary use-case is to highlight the active link in navigation menus,\n * distinguishing it from the inactive menu items.\n *\n * ### Linking to a `ui-sref` or `ui-state`\n * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.\n * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.\n *\n * ### Matching\n *\n * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.\n * This is a \"fuzzy match\" which uses [[StateService.includes]].\n *\n * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).\n * This is an \"exact match\" which uses [[StateService.is]].\n *\n * ### Parameter values\n * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.\n * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.\n *\n * #### Example:\n * ```html\n * <li ng-repeat=\"user in users\" ui-sref-active=\"active\">\n * <a ui-sref=\"user.details({ userId: user.id })\">{{ user.lastName }}</a>\n * </li>\n * ```\n *\n * ### Examples\n *\n * Given the following template:\n * #### Example:\n * ```html\n * <ul>\n * <li ui-sref-active=\"active\" class=\"item\">\n * <a href ui-sref=\"app.user({user: 'bilbobaggins'})\">@bilbobaggins</a>\n * </li>\n * </ul>\n * ```\n *\n * When the app state is `app.user` (or any child state),\n * and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n *\n * ```html\n * <ul>\n * <li ui-sref-active=\"active\" class=\"item active\">\n * <a ui-sref=\"app.user({user: 'bilbobaggins'})\" href=\"/users/bilbobaggins\">@bilbobaggins</a>\n * </li>\n * </ul>\n * ```\n *\n * ### Glob mode\n *\n * It is possible to pass `ui-sref-active` an expression that evaluates to an object.\n * The objects keys represent active class names and values represent the respective state names/globs.\n * `ui-sref-active` will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * #### Example:\n * Given the following template, with \"admin\" being an abstract state:\n * ```html\n * <div ui-sref-active=\"{'active': 'admin.**'}\">\n * <a ui-sref-active=\"active\" ui-sref=\"admin.roles\">Roles</a>\n * </div>\n * ```\n *\n * Arrays are also supported as values in the `ngClass`-like interface.\n * This allows multiple states to add `active` class.\n *\n * #### Example:\n * Given the following template, with \"admin.roles\" being the current state, the class will be added too:\n * ```html\n * <div ui-sref-active=\"{'active': ['owner.**', 'admin.**']}\">\n * <a ui-sref-active=\"active\" ui-sref=\"admin.roles\">Roles</a>\n * </div>\n * ```\n *\n * When the current state is \"admin.roles\" the \"active\" class will be applied to both the `<div>` and `<a>` elements.\n * It is important to note that the state names/globs passed to `ui-sref-active` override any state provided by a linked `ui-sref`.\n *\n * ### Notes:\n *\n * - The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'`\n */\nlet uiSrefActiveDirective: ng1_directive;\nuiSrefActiveDirective = [\n '$state',\n '$stateParams',\n '$interpolate',\n '$uiRouter',\n function $StateRefActiveDirective(\n $state: StateService,\n $stateParams: Obj,\n $interpolate: IInterpolateService,\n $uiRouter: UIRouter\n ) {\n return {\n restrict: 'A',\n controller: [\n '$scope',\n '$element',\n '$attrs',\n function ($scope: IScope, $element: IAugmentedJQuery, $attrs: any) {\n let states: StateData[] = [];\n let activeEqClass: string;\n let uiSrefActive: any;\n\n // There probably isn't much point in $observing this\n // uiSrefActive and uiSrefActiveEq share the same directive object with some\n // slight difference in logic routing\n activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\n\n try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n } catch (e) {\n // Do nothing. uiSrefActive is not a valid expression.\n // Fall back to using $interpolate below\n }\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\n setStatesFromDefinitionObject(uiSrefActive);\n\n // Allow uiSref to communicate with uiSrefActive[Equals]\n this.$$addStateInfo = function (newState: string, newParams: Obj) {\n // we already got an explicit state provided by ui-sref-active, so we\n // shadow the one that comes from ui-sref\n if (isObject(uiSrefActive) && states.length > 0) {\n return;\n }\n const deregister = addState(newState, newParams, uiSrefActive);\n update();\n return deregister;\n };\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\n function setupEventListeners() {\n const deregisterStatesChangedListener = $uiRouter.stateRegistry.onStatesChanged(handleStatesChanged);\n const deregisterOnStartListener = $uiRouter.transitionService.onStart({}, updateAfterTransition);\n const deregisterStateChangeSuccessListener = $scope.$on('$stateChangeSuccess', update);\n return function cleanUp() {\n deregisterStatesChangedListener();\n deregisterOnStartListener();\n deregisterStateChangeSuccessListener();\n };\n }\n\n function handleStatesChanged() {\n setStatesFromDefinitionObject(uiSrefActive);\n }\n\n function setStatesFromDefinitionObject(statesDefinition: Obj) {\n if (isObject(statesDefinition)) {\n states = [];\n forEach(statesDefinition, function (stateOrName: StateOrName | Array<StateOrName>, activeClass: string) {\n // Helper function to abstract adding state.\n const addStateForClass = function (stateOrName: string, activeClass: string) {\n const ref = parseStateRef(stateOrName);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n };\n\n if (isString(stateOrName)) {\n // If state is string, just add it.\n addStateForClass(stateOrName as string, activeClass);\n } else if (isArray(stateOrName)) {\n // If state is an array, iterate over it and add each array item individually.\n forEach(stateOrName, function (stateOrName: string) {\n addStateForClass(stateOrName, activeClass);\n });\n }\n });\n }\n }\n\n function addState(stateName: string, stateParams: Obj, activeClass: string) {\n const state = $state.get(stateName, stateContext($element));\n\n const stateInfo = {\n state: state || { name: stateName },\n params: stateParams,\n activeClass: activeClass,\n };\n\n states.push(stateInfo);\n\n return function removeState() {\n removeFrom(states)(stateInfo);\n };\n }\n\n // Update route state\n function update() {\n const splitClasses = (str) => str.split(/\\s/).filter(identity);\n const getClasses = (stateList: StateData[]) =>\n stateList\n .map((x) => x.activeClass)\n .map(splitClasses)\n .reduce(unnestR, []);\n\n const allClasses = getClasses(states).concat(splitClasses(activeEqClass)).reduce(uniqR, []);\n const fuzzyClasses = getClasses(states.filter((x) => $state.includes(x.state.name, x.params)));\n const exactlyMatchesAny = !!states.filter((x) => $state.is(x.state.name, x.params)).length;\n const exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : [];\n\n const addClasses = fuzzyClasses.concat(exactClasses).reduce(uniqR, []);\n const removeClasses = allClasses.filter((cls) => !inArray(addClasses, cls));\n\n $scope.$evalAsync(() => {\n addClasses.forEach((className) => $element.addClass(className));\n removeClasses.forEach((className) => $element.removeClass(className));\n });\n }\n\n update();\n },\n ],\n };\n },\n];\n\n/** @hidden */\ninterface Def {\n uiState: string;\n href: string;\n uiStateParams: Obj;\n uiStateOpts: any;\n}\n/** @hidden */\ninterface StateData {\n state: StateDeclaration;\n params: RawParams;\n activeClass: string;\n}\n\nangular\n .module('ui.router.state')\n .directive('uiSref', uiSrefDirective)\n .directive('uiSrefActive', uiSrefActiveDirective)\n .directive('uiSrefActiveEq', uiSrefActiveDirective)\n .directive('uiState', uiStateDirective);\n","/** @publicapi @module directives */ /** */\nimport {\n $QLike,\n ActiveUIView,\n extend,\n filter,\n HookRegOptions,\n isDefined,\n isFunction,\n isString,\n kebobString,\n noop,\n Obj,\n Param,\n parse,\n PathNode,\n ResolveContext,\n StateDeclaration,\n tail,\n trace,\n Transition,\n TransitionService,\n TypedMap,\n unnestR,\n ViewService,\n} from '@uirouter/core';\nimport { IAugmentedJQuery, IInterpolateService, IScope, ITranscludeFunction } from 'angular';\nimport { ng as angular } from '../angular';\nimport { Ng1Controller, Ng1StateDeclaration } from '../interface';\nimport { getLocals } from '../services';\nimport { Ng1ViewConfig } from '../statebuilders/views';\nimport { ng1_directive } from './stateDirectives';\n\n/** @hidden */\nexport type UIViewData = {\n $cfg: Ng1ViewConfig;\n $uiView: ActiveUIView;\n};\n\n/** @hidden */\nexport type UIViewAnimData = {\n $animEnter: Promise<any>;\n $animLeave: Promise<any>;\n $$animLeave: { resolve: () => any }; // \"deferred\"\n};\n\n/**\n * `ui-view`: A viewport directive which is filled in by a view from the active state.\n *\n * ### Attributes\n *\n * - `name`: (Optional) A view name.\n * The name should be unique amongst the other views in the same state.\n * You can have views of the same name that live in different states.\n * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]).\n *\n * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated.\n * Uses [[$uiViewScroll]] to do the scrolling.\n *\n * - `onload`: Expression to evaluate whenever the view updates.\n *\n * #### Example:\n * A view can be unnamed or named.\n * ```html\n * <!-- Unnamed -->\n * <div ui-view></div>\n *\n * <!-- Named -->\n * <div ui-view=\"viewName\"></div>\n *\n * <!-- Named (different style) -->\n * <ui-view name=\"viewName\"></ui-view>\n * ```\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a\n * single view and it is unnamed then you can populate it like so:\n *\n * ```html\n * <div ui-view></div>\n * $stateProvider.state(\"home\", {\n * template: \"<h1>HELLO!</h1>\"\n * })\n * ```\n *\n * The above is a convenient shortcut equivalent to specifying your view explicitly with the\n * [[Ng1StateDeclaration.views]] config property, by name, in this case an empty name:\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"<h1>HELLO!</h1>\"\n * }\n * }\n * })\n * ```\n *\n * But typically you'll only use the views property if you name your view or have more than one view\n * in the same template. There's not really a compelling reason to name a view if its the only one,\n * but you could if you wanted, like so:\n *\n * ```html\n * <div ui-view=\"main\"></div>\n * ```\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"main\": {\n * template: \"<h1>HELLO!</h1>\"\n * }\n * }\n * })\n * ```\n *\n * Really though, you'll use views to set up multiple views:\n *\n * ```html\n * <div ui-view></div>\n * <div ui-view=\"chart\"></div>\n * <div ui-view=\"data\"></div>\n * ```\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"<h1>HELLO!</h1>\"\n * },\n * \"chart\": {\n * template: \"<chart_thing/>\"\n * },\n * \"data\": {\n * template: \"<data_thing/>\"\n * }\n * }\n * })\n * ```\n *\n * #### Examples for `autoscroll`:\n * ```html\n * <!-- If autoscroll present with no expression,\n * then scroll ui-view into view -->\n * <ui-view autoscroll/>\n *\n * <!-- If autoscroll present with valid expression,\n * then scroll ui-view into view if expression evaluates to true -->\n * <ui-view autoscroll='true'/>\n * <ui-view autoscroll='false'/>\n * <ui-view autoscroll='scopeVariable'/>\n * ```\n *\n * Resolve data:\n *\n * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this\n * can be customized using [[Ng1ViewDeclaration.resolveAs]]). This can be then accessed from the template.\n *\n * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the\n * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which\n * depends on `$resolve` data.\n *\n * #### Example:\n * ```js\n * $stateProvider.state('home', {\n * template: '<my-component user=\"$resolve.user\"></my-component>',\n * resolve: {\n * user: function(UserService) { return UserService.fetchUser(); }\n * }\n * });\n * ```\n */\nexport let uiView: ng1_directive;\n// eslint-disable-next-line prefer-const\nuiView = [\n '$view',\n '$animate',\n '$uiViewScroll',\n '$interpolate',\n '$q',\n function $ViewDirective(\n $view: ViewService,\n $animate: any,\n $uiViewScroll: any,\n $interpolate: IInterpolateService,\n $q: $QLike\n ) {\n function getRenderer() {\n return {\n enter: function (element: JQuery, target: any, cb: Function) {\n if (angular.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: JQuery, cb: Function) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n },\n };\n }\n\n function configsEqual(config1: Ng1ViewConfig, config2: Ng1ViewConfig) {\n return config1 === config2;\n }\n\n const rootData = {\n $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } },\n $uiView: {},\n };\n\n const directive = {\n count: 0,\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n compile: function (tElement: JQuery, tAttrs: Obj, $transclude: ITranscludeFunction) {\n return function (scope: IScope, $element: IAugmentedJQuery, attrs: Obj) {\n const 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\n let previousEl: JQuery, currentEl: JQuery, currentScope: IScope, viewConfig: Ng1ViewConfig;\n\n const activeUIView: ActiveUIView = {\n $type: 'ng1',\n id: directive.count++, // Global sequential ID for ui-view tags added to DOM\n name: name, // ui-view name (<div ui-view=\"name\"></div>\n fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name, // fully qualified name, describes location in DOM\n config: null, // The ViewConfig loaded (from a state.views definition)\n configUpdated: configUpdatedCallback, // Called when the matching ViewConfig changes\n get creationContext() {\n // The context in which this ui-view \"tag\" was created\n const fromParentTagConfig = parse('$cfg.viewDecl.$context')(inherited);\n // Allow <ui-view name=\"foo\"><ui-view name=\"bar\"></ui-view></ui-view>\n // See https://github.com/angular-ui/ui-router/issues/3355\n const fromParentTag = parse('$uiView.creationContext')(inherited);\n return fromParentTagConfig || fromParentTag;\n },\n };\n\n trace.traceUIViewEvent('Linking', activeUIView);\n\n function configUpdatedCallback(config?: Ng1ViewConfig) {\n if (config && !(config instanceof Ng1ViewConfig)) return;\n if (configsEqual(viewConfig, config)) return;\n trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context);\n\n viewConfig = config;\n updateView(config);\n }\n\n $element.data('$uiView', { $uiView: activeUIView });\n\n updateView();\n\n const unregister = $view.registerUIView(activeUIView);\n scope.$on('$destroy', function () {\n trace.traceUIViewEvent('Destroying/Unregistering', activeUIView);\n unregister();\n });\n\n function cleanupLastView() {\n if (previousEl) {\n trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView'));\n previousEl.remove();\n previousEl = null;\n }\n\n if (currentScope) {\n trace.traceUIViewEvent('Destroying scope', activeUIView);\n currentScope.$destroy();\n currentScope = null;\n }\n\n if (currentEl) {\n const _viewData = currentEl.data('$uiViewAnim');\n trace.traceUIViewEvent('Animate out', _viewData);\n renderer.leave(currentEl, function () {\n _viewData.$$animLeave.resolve();\n previousEl = null;\n });\n\n previousEl = currentEl;\n currentEl = null;\n }\n }\n\n function updateView(config?: Ng1ViewConfig) {\n const newScope = scope.$new();\n const animEnter = $q.defer(),\n animLeave = $q.defer();\n\n const $uiViewData: UIViewData = {\n $cfg: config,\n $uiView: activeUIView,\n };\n\n const $uiViewAnim: UIViewAnimData = {\n $animEnter: animEnter.promise,\n $animLeave: animLeave.promise,\n $$animLeave: animLeave,\n };\n\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoading\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description\n *\n * Fired once the view **begins loading**, *before* the DOM is rendered.\n *\n * @param {Object} event Event object.\n * @param {string} viewName Name of the view.\n */\n newScope.$emit('$viewContentLoading', name);\n\n const 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\n if ((isDefined(autoScrollExp) && !autoScrollExp) || scope.$eval(autoScrollExp)) {\n $uiViewScroll(clone);\n }\n });\n\n cleanupLastView();\n });\n\n currentEl = cloned;\n currentScope = newScope;\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoaded\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description *\n * Fired once the view is **loaded**, *after* the DOM is rendered.\n *\n * @param {Object} event Event object.\n */\n currentScope.$emit('$viewContentLoaded', config || viewConfig);\n currentScope.$eval(onloadExp);\n }\n };\n },\n };\n\n return directive;\n },\n];\n\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q'];\n\n/** @hidden */\nfunction $ViewDirectiveFill(\n $compile: angular.ICompileService,\n $controller: angular.IControllerService,\n $transitions: TransitionService,\n $view: ViewService,\n $q: angular.IQService\n) {\n const getControllerAs = parse('viewDecl.controllerAs');\n const getResolveAs = parse('viewDecl.resolveAs');\n\n return {\n restrict: 'ECA',\n priority: -400,\n compile: function (tElement: JQuery) {\n const initial = tElement.html();\n tElement.empty();\n\n return function (scope: IScope, $element: JQuery) {\n const data: UIViewData = $element.data('$uiView');\n if (!data) {\n $element.html(initial);\n $compile($element.contents() as any)(scope);\n return;\n }\n\n const cfg: Ng1ViewConfig = data.$cfg || <any>{ viewDecl: {}, getTemplate: noop };\n const resolveCtx: ResolveContext = cfg.path && new ResolveContext(cfg.path);\n $element.html(cfg.getTemplate($element, resolveCtx) || initial);\n trace.traceUIViewFill(data.$uiView, $element.html());\n\n const link = $compile($element.contents() as any);\n const controller = cfg.controller as angular.IControllerService;\n const controllerAs: string = getControllerAs(cfg);\n const resolveAs: string = getResolveAs(cfg);\n const locals = resolveCtx && getLocals(resolveCtx);\n\n scope[resolveAs] = locals;\n\n if (controller) {\n const controllerInstance = <Ng1Controller>(\n $controller(controller, extend({}, locals, { $scope: scope, $element: $element }))\n );\n if (controllerAs) {\n scope[controllerAs] = controllerInstance;\n scope[controllerAs][resolveAs] = locals;\n }\n\n // TODO: Use $view service as a central point for registering component-level hooks\n // Then, when a component is created, tell the $view service, so it can invoke hooks\n // $view.componentLoaded(controllerInstance, { $scope: scope, $element: $element });\n // scope.$on('$destroy', () => $view.componentUnloaded(controllerInstance, { $scope: scope, $element: $element }));\n\n $element.data('$ngControllerController', controllerInstance);\n $element.children().data('$ngControllerController', controllerInstance);\n\n registerControllerCallbacks($q, $transitions, controllerInstance, scope, cfg);\n }\n\n // Wait for the component to appear in the DOM\n if (isString(cfg.component)) {\n const kebobName = kebobString(cfg.component);\n const tagRegexp = new RegExp(`^(x-|data-)?${kebobName}$`, 'i');\n\n const getComponentController = () => {\n const directiveEl = [].slice\n .call($element[0].children)\n .filter((el: Element) => el && el.tagName && tagRegexp.exec(el.tagName));\n\n return directiveEl && angular.element(directiveEl).data(`$${cfg.component}Controller`);\n };\n\n const deregisterWatch = scope.$watch(getComponentController, function (ctrlInstance) {\n if (!ctrlInstance) return;\n registerControllerCallbacks($q, $transitions, ctrlInstance, scope, cfg);\n deregisterWatch();\n });\n }\n\n link(scope);\n };\n },\n };\n}\n\n/** @hidden */\nconst hasComponentImpl = typeof (angular as any).module('ui.router')['component'] === 'function';\n/** @hidden incrementing id */\nlet _uiCanExitId = 0;\n\n/** @hidden TODO: move these callbacks to $view and/or `/hooks/components.ts` or something */\nfunction registerControllerCallbacks(\n $q: angular.IQService,\n $transitions: TransitionService,\n controllerInstance: Ng1Controller,\n $scope: IScope,\n cfg: Ng1ViewConfig\n) {\n // Call $onInit() ASAP\n if (\n isFunction(controllerInstance.$onInit) &&\n !((cfg.viewDecl.component || cfg.viewDecl.componentProvider) && hasComponentImpl)\n ) {\n controllerInstance.$onInit();\n }\n\n const viewState: Ng1StateDeclaration = tail(cfg.path).state.self;\n\n const hookOptions: HookRegOptions = { bind: controllerInstance };\n // Add component-level hook for onUiParamsChanged\n if (isFunction(controllerInstance.uiOnParamsChanged)) {\n const resolveContext: ResolveContext = new ResolveContext(cfg.path);\n const viewCreationTrans = resolveContext.getResolvable('$transition$').data;\n\n // Fire callback on any successful transition\n const paramsUpdated = ($transition$: Transition) => {\n // Exit early if the $transition$ is the same as the view was created within.\n // Exit early if the $transition$ will exit the state the view is for.\n if ($transition$ === viewCreationTrans || $transition$.exiting().indexOf(viewState as StateDeclaration) !== -1)\n return;\n\n const toParams = $transition$.params('to') as TypedMap<any>;\n const fromParams = $transition$.params<TypedMap<any>>('from') as TypedMap<any>;\n const getNodeSchema = (node: PathNode) => node.paramSchema;\n const toSchema: Param[] = $transition$.treeChanges('to').map(getNodeSchema).reduce(unnestR, []);\n const fromSchema: Param[] = $transition$.treeChanges('from').map(getNodeSchema).reduce(unnestR, []);\n\n // Find the to params that have different values than the from params\n const changedToParams = toSchema.filter((param: Param) => {\n const idx = fromSchema.indexOf(param);\n return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]);\n });\n\n // Only trigger callback if a to param has changed or is new\n if (changedToParams.length) {\n const changedKeys: string[] = changedToParams.map((x) => x.id);\n // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params.\n const newValues = filter(toParams, (val, key) => changedKeys.indexOf(key) !== -1);\n controllerInstance.uiOnParamsChanged(newValues, $transition$);\n }\n };\n $scope.$on('$destroy', <any>$transitions.onSuccess({}, paramsUpdated, hookOptions));\n }\n\n // Add component-level hook for uiCanExit\n if (isFunction(controllerInstance.uiCanExit)) {\n const id = _uiCanExitId++;\n const cacheProp = '_uiCanExitIds';\n\n // Returns true if a redirect transition already answered truthy\n const prevTruthyAnswer = (trans: Transition) =>\n !!trans && ((trans[cacheProp] && trans[cacheProp][id] === true) || prevTruthyAnswer(trans.redirectedFrom()));\n\n // If a user answered yes, but the transition was later redirected, don't also ask for the new redirect transition\n const wrappedHook = (trans: Transition) => {\n let promise;\n const ids = (trans[cacheProp] = trans[cacheProp] || {});\n\n if (!prevTruthyAnswer(trans)) {\n promise = $q.when(controllerInstance.uiCanExit(trans));\n promise.then((val) => (ids[id] = val !== false));\n }\n return promise;\n };\n\n const criteria = { exiting: viewState.name };\n $scope.$on('$destroy', <any>$transitions.onBefore(criteria, wrappedHook, hookOptions));\n }\n}\n\nangular.module('ui.router.state').directive('uiView', <any>uiView);\nangular.module('ui.router.state').directive('uiView', <any>$ViewDirectiveFill);\n","/** @publicapi @module ng1 */ /** */\n\nimport { ng as angular } from './angular';\nimport { Obj, StateService, StateOrName } from '@uirouter/core';\n\n/**\n * `isState` Filter: truthy if the current state is the parameter\n *\n * Translates to [[StateService.is]] `$state.is(\"stateName\")`.\n *\n * #### Example:\n * ```html\n * <div ng-if=\"'stateName' | isState\">show if state is 'stateName'</div>\n * ```\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state: StateService) {\n const isFilter: any = function (state: StateOrName, params: Obj, options?: { relative?: StateOrName }) {\n return $state.is(state, params, options);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n\n/**\n * `includedByState` Filter: truthy if the current state includes the parameter\n *\n * Translates to [[StateService.includes]]` $state.is(\"fullOrPartialStateName\")`.\n *\n * #### Example:\n * ```html\n * <div ng-if=\"'fullOrPartialStateName' | includedByState\">show if state includes 'fullOrPartialStateName'</div>\n * ```\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state: StateService) {\n const includesFilter: any = function (state: StateOrName, params: Obj, options: { relative?: StateOrName }) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\n\nangular.module('ui.router.state').filter('isState', $IsStateFilter).filter('includedByState', $IncludedByStateFilter);\n\nexport { $IsStateFilter, $IncludedByStateFilter };\n","/** @publicapi @module ng1 */ /** */\nimport { ng as angular } from './angular';\nimport { IServiceProviderFactory } from 'angular';\nimport IAnchorScrollService = angular.IAnchorScrollService;\nimport ITimeoutService = angular.ITimeoutService;\n\nexport interface UIViewScrollProvider {\n /**\n * Uses standard anchorScroll behavior\n *\n * Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * service for scrolling based on the url anchor.\n */\n useAnchorScroll(): void;\n}\n\n/** @hidden */\nfunction $ViewScrollProvider() {\n let useAnchorScroll = false;\n\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n\n this.$get = [\n '$anchorScroll',\n '$timeout',\n function ($anchorScroll: IAnchorScrollService, $timeout: ITimeoutService): Function {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n\n return function ($element: JQuery) {\n return $timeout(\n function () {\n $element[0].scrollIntoView();\n },\n 0,\n false\n );\n };\n },\n ];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', <IServiceProviderFactory>$ViewScrollProvider);\n","/**\n * Main entry point for angular 1.x build\n * @publicapi @module ng1\n */ /** */\nexport * from './interface';\nexport * from './services';\nexport * from './statebuilders/views';\nexport * from './stateProvider';\nexport * from './urlRouterProvider';\n\nimport './injectables';\nimport './directives/stateDirectives';\nimport './stateFilters';\nimport './directives/viewDirective';\nimport './viewScroll';\n\nexport default 'ui.router';\n\nimport * as core from '@uirouter/core';\nexport { core };\nexport * from '@uirouter/core';\n","import { Component, ElementRef, Inject, Injector, Input, ModuleWithProviders, NgModule } from '@angular/core';\r\nimport { downgradeComponent, UpgradeModule, getAngularJSGlobal, getAngularLib } from '@angular/upgrade/static';\r\n\r\nimport {\r\n StateObject,\r\n forEach,\r\n PathNode,\r\n Resolvable,\r\n StateRegistry,\r\n UIRouter,\r\n ViewConfig,\r\n ViewService,\r\n} from '@uirouter/core';\r\n\r\nimport {\r\n applyModuleConfig,\r\n NATIVE_INJECTOR_TOKEN,\r\n ng2LazyLoadBuilder,\r\n Ng2ViewConfig,\r\n UIView,\r\n _UIROUTER_SERVICE_PROVIDERS,\r\n Ng2ViewDeclaration,\r\n ParentUIViewInject,\r\n StatesModule,\r\n UIROUTER_MODULE_TOKEN,\r\n UIROUTER_ROOT_MODULE,\r\n UIRouterModule,\r\n makeChildProviders,\r\n} from '@uirouter/angular';\r\n\r\nimport { $InjectorLike, Ng1ViewConfig } from '@uirouter/angularjs';\r\n\r\nimport { UIRouterRx } from '@uirouter/rx';\r\nimport { NgHybridStatesModule } from './interfaces';\r\n\r\nconst getAngularJS = getAngularJSGlobal || getAngularLib;\r\nconst angular = getAngularJS();\r\n\r\nif (!angular) {\r\n throw new Error(\r\n 'AngularJS not found on window. https://github.com/ui-router/angular-hybrid/wiki/AngularJS-not-found-on-window'\r\n );\r\n}\r\n\r\n/**\r\n * Create a ng1 module for the ng1 half of the hybrid application to depend on.\r\n *\r\n * Example:\r\n * const myApp = angular.module('myApp', ['ui.router.upgrade']);\r\n */\r\nexport const upgradeModule = angular.module('ui.router.upgrade', ['ui.router']);\r\n\r\nexport function objectFactory() {\r\n return {};\r\n}\r\n\r\n/**\r\n * UIViewNgUpgrade is a component bridge from ng1 ui-view to ng2 ui-view\r\n *\r\n * When a ui-router for ng1 is registering a state it checks if a view's\r\n * `component:` is an ng2 Component class. If so, it creates a special ng1 template\r\n * which references this component, i.e., <ui-view-ng-upgrade></ui-view-ng-upgrade>\r\n *\r\n * See that code by searching ng1-to-ng2 source for: \"$stateProvider.decorator\"\r\n *\r\n * ---\r\n *\r\n * ng1-to-ng2 component bridge process:\r\n *\r\n * 1)\r\n * When an ng1 template creates a ui-view which is targeted by a ng2 Component,\r\n *\r\n * ```\r\n * <a ui-sref=\"foo\">Go to foo</a>\r\n * <div ui-view> <!-- ui-view created in ng1 template -->\r\n * </div> <!-- targeted with { component: Ng2RoutedComponent } -->\r\n * ```\r\n *\r\n * the state decorator spits out a custom template. That template loads this\r\n * ng2 Component adapter as a downgraded-to-ng1 directive.\r\n *\r\n * ```\r\n * <a ui-sref=\"foo\">Go to foo</a>\r\n * <div ui-view> <!-- decorated template references the downgraded component -->\r\n * <ui-view-ng-upgrade> <!-- downgraded adapter component -->\r\n * </ui-view-ng-upgrade>\r\n * </div>\r\n * ```\r\n *\r\n * This downgraded ng2 Component then creates a child UIView (ng2 component)\r\n *\r\n * ```\r\n * <a ui-sref=\"foo\">Go to foo</a>\r\n * <div ui-view> <!-- custom template references the downgraded component -->\r\n * <ui-view-ng-upgrade> <!-- ng2 component adapter downgraded to ng1-->\r\n * <ui-view> <!-- pure ng2 ui-view -->\r\n * </ui-view>\r\n * </ui-view-ng-upgrade>\r\n * </div>\r\n * ```\r\n *\r\n * which in turn is filled with the routed ng2 component.\r\n *\r\n * ```\r\n * <a ui-sref=\"foo\">Go to foo</a>\r\n * <div ui-view> <!-- ng1 ui-view -->\r\n * <ui-view-ng-upgrade> <!-- ng2 component adapter (downgraded to ng1)-->\r\n * <ui-view> <!-- pure ng2 ui-view -->\r\n * <ng2-routed-component> <!-- ng2 component hosted in ng2 ui-view -->\r\n * <h1>ng2 routed component contents</h1>\r\n * </ng2-routed-component>\r\n * </ui-view>\r\n * </ui-view-ng-upgrade>\r\n * </div>\r\n * ```\r\n *\r\n * This adapter exposes exposes the parent view context (ParentUIViewInject)\r\n * as an ng2 DI Provider, which the nested ng2 UIView requires.\r\n *\r\n * It gets the ParentUIViewContext information (from the parent ng1 ui-view) by walking\r\n * up the DOM and grabbing the .data('$uiView') which the ng1 ui-view directive exposes.\r\n */\r\n@Component({\r\n selector: 'ui-view-ng-upgrade',\r\n template: ` <ui-view [name]=\"name\"></ui-view> `,\r\n // provide a blank object as PARENT_INJECT.\r\n // The component will add property getters when it is constructed.\r\n viewProviders: [{ provide: UIView.PARENT_INJECT, useFactory: objectFactory }],\r\n})\r\nexport class UIViewNgUpgrade {\r\n // The ui-view's name (or '$default')\r\n @Input()\r\n name: string;\r\n\r\n constructor(\r\n ref: ElementRef,\r\n @Inject(UIView.PARENT_INJECT) parent: ParentUIViewInject,\r\n registry: StateRegistry // access the root state\r\n ) {\r\n // From the ui-view-ng-upgrade component's element ref, walk up the DOM two elements...\r\n // There will first be an ng1 ui-view which hosts this element, and then that ui-view's parent element.\r\n // That (parent) element has access to the proper \"parent viewcontext\"\r\n\r\n // The ng2 ui-view component is inside this ui-view-ng-upgrade directive, which is inside the ng1 \"host\" ui-view.\r\n // Both ui-views share the same \"view context\" information (the view's fqn and created-by-state context information)\r\n const ng1elem = angular.element(ref.nativeElement).parent().parent();\r\n\r\n // Expose getters on PARENT_INJECT for context (creation state) and fqn (view address)\r\n // These will be used by further nested UIView\r\n Object.defineProperty(parent, 'context', {\r\n get: function () {\r\n const data = ng1elem['inheritedData']('$uiView');\r\n return data && data.$cfg ? data.$cfg.viewDecl.$context : registry.root();\r\n },\r\n enumerable: true,\r\n });\r\n\r\n Object.defineProperty(parent, 'fqn', {\r\n get: function () {\r\n const data = ng1elem['inheritedData']('$uiView');\r\n return data && data.$uiView ? data.$uiView.fqn : null;\r\n },\r\n enumerable: true,\r\n });\r\n }\r\n}\r\n\r\n/**********************************\r\n * Ng2 @NgModule and bootstrap code\r\n **********************************/\r\n\r\n// Register the ng1 DI '$uiRouter' object as an ng2 Provider.\r\nexport function uiRouterUpgradeFactory(router: UIRouter, injector: Injector) {\r\n const modules: StatesModule[] = injector.get<StatesModule[]>(UIROUTER_MODULE_TOKEN, []);\r\n modules.forEach((module) => applyModuleConfig(router, injector, module));\r\n return router;\r\n}\r\n\r\nexport function getUIRouter($injector: any) {\r\n return $injector.get('$uiRouter');\r\n}\r\n\r\nexport function getParentUIViewInject(r: StateRegistry): ParentUIViewInject {\r\n return { fqn: null, context: r.root() };\r\n}\r\n\r\n/**\r\n * This NgModule should be added to the root module of the hybrid app.\r\n */\r\n@NgModule({\r\n imports: [UIRouterModule, UpgradeModule],\r\n declarations: [UIViewNgUpgrade],\r\n providers: [\r\n // @uirouter/angular code will use the ng1 $uiRouter instance instead of creating its own.\r\n { provide: '$uiRouter', useFactory: getUIRouter, deps: ['$injector'] },\r\n\r\n { provide: UIRouter, useFactory: uiRouterUpgradeFactory, deps: ['$uiRouter', Injector] },\r\n\r\n { provide: UIROUTER_ROOT_MODULE, useValue: {}, multi: true },\r\n\r\n { provide: UIView.PARENT_INJECT, useFactory: getParentUIViewInject, deps: [StateRegistry] },\r\n\r\n ..._UIROUTER_SERVICE_PROVIDERS,\r\n ],\r\n entryComponents: [UIViewNgUpgrade],\r\n exports: [UIViewNgUpgrade, UIRouterModule],\r\n})\r\nexport class UIRouterUpgradeModule {\r\n static forRoot(module: NgHybridStatesModule = {}): ModuleWithProviders<UIRouterUpgradeModule> {\r\n return {\r\n ngModule: UIRouterUpgradeModule,\r\n providers: makeChildProviders(module as StatesModule),\r\n };\r\n }\r\n\r\n static forChild(module: NgHybridStatesModule = {}): ModuleWithProviders<UIRouterUpgradeModule> {\r\n return {\r\n ngModule: UIRouterModule,\r\n providers: makeChildProviders(module as StatesModule),\r\n };\r\n }\r\n}\r\n\r\n// Downgrade the UIViewNgUpgrade ng2 Component to an ng1 directive.\r\n// The directive is used in a (generated) view template by the (host) ng1 ui-router,\r\n// whenever it finds a view configured with a `component: <Ng2ComponentClass>`\r\nupgradeModule.directive(\r\n 'uiViewNgUpgrade',\r\n <any>downgradeComponent({\r\n component: UIViewNgUpgrade,\r\n inputs: ['name'],\r\n })\r\n);\r\n\r\nupgradeModule.run([\r\n '$injector',\r\n (ng1Injector: $InjectorLike) => {\r\n const $uiRouter: UIRouter = ng1Injector.get('$uiRouter');\r\n\r\n /** Add support for observable state and param changes */\r\n $uiRouter.plugin(UIRouterRx);\r\n\r\n // Expose a merged ng1/ng2 injector as a Resolvable (on the root state).\r\n // This mimics how ui-router-ng2 exposes the root ng2 Injector, but\r\n // it retrieves from ng1 injector first, then ng2 injector if the token isn't found.\r\n const mergedInjector = {\r\n get: function (token: any, ng2NotFoundValue?: any) {\r\n if (ng1Injector.has(token)) {\r\n return ng1Injector.get(token);\r\n }\r\n const ng2Injector = ng1Injector.get('$$angularInjector');\r\n return ng2Injector.get(token, ng2NotFoundValue);\r\n },\r\n };\r\n\r\n const ng2InjectorResolvable = Resolvable.fromData(NATIVE_INJECTOR_TOKEN, mergedInjector);\r\n $uiRouter.stateRegistry.root().resolvables.push(ng2InjectorResolvable);\r\n },\r\n]);\r\n\r\n/** Adds support for `loadChildren`: Angular NgModule lazy loading via @gntools/webpack */\r\nupgradeModule.config([\r\n '$stateRegistryProvider',\r\n ($stateRegistry: StateRegistry) => {\r\n $stateRegistry.decorator('lazyLoad', ng2LazyLoadBuilder);\r\n },\r\n]);\r\n\r\n/**\r\n * Define a stateProvider `views` builder decorator.\r\n * The decorator first applies the standard views builder function.\r\n * Then it finds any view components which are **actually** a Ng2 Component Class.\r\n * It overwrites that view's config with a ng1-to-ng2 hybrid config.\r\n *\r\n * In place of the template provider, it simply puts a <ui-view-ng-upgrade/> component\r\n * which that provides a ng1 -> ng2 boundary in the component tree.\r\n */\r\nupgradeModule.config([\r\n '$stateRegistryProvider',\r\n ($stateRegistry: StateRegistry) => {\r\n $stateRegistry.decorator('views', function (state: StateObject, parentFn: Function) {\r\n const views = parentFn(state);\r\n\r\n forEach(views, (viewDecl: any, viewName: string) => {\r\n if (viewDecl.$type === 'ng1-to-ng2' || typeof viewDecl.component === 'function') {\r\n // Update the view config.\r\n // Override default ng1 `component:` behavior (of defining a templateProvider)\r\n // with a <ui-view-ng-upgrade> adapter directive template\r\n viewDecl.$type = 'ng1-to-ng2';\r\n viewDecl.templateProvider = null;\r\n viewDecl.template = `<ui-view-ng-upgrade name='${viewDecl.$uiViewName}'></ui-view-ng-upgrade>`;\r\n }\r\n });\r\n return views;\r\n });\r\n },\r\n]);\r\n\r\n// UI-Router ViewConfig factories take a view declaration object from a state.views: { foo: <ViewDeclaration> }\r\n// and return a runtime config object (a ViewConfig)\r\nupgradeModule.run([\r\n '$view',\r\n '$templateFactory',\r\n ($view: ViewService, $templateFactory: any) => {\r\n // Register a ViewConfig factory for views of type `ng2`\r\n $view._pluginapi._viewConfigFactory(\r\n 'ng2',\r\n (path: PathNode[], config: Ng2ViewDeclaration) => new Ng2ViewConfig(path, config)\r\n );\r\n\r\n // Register a ViewConfig factory for views of type `ng1-to-ng2`.\r\n // Returns both an ng1 config and an ng2 config allowing either ng1 or ng2 ui-view components to be targeted.\r\n $view._pluginapi._viewConfigFactory('ng1-to-ng2', (path: PathNode[], config: Ng2ViewDeclaration) => {\r\n const ng1ViewConfig: ViewConfig = <any>(\r\n new Ng1ViewConfig(<any>path, <any>Object.assign({}, config, { $type: 'ng1' }), $templateFactory)\r\n );\r\n const ng2ViewConfig: ViewConfig = <any>(\r\n new Ng2ViewConfig(<any>path, <any>Object.assign({}, config, { $type: 'ng2' }))\r\n );\r\n\r\n return [ng2ViewConfig, ng1ViewConfig];\r\n });\r\n },\r\n]);\r\n","<div id=\"contact-us\" class=\"container-fluid container-flush\">\r\n <div class=\"panel panel-demo non-mychart chart-label\">\r\n <div class=\"panel-heading panel-flush\">\r\n <div class=\"panel-title\" translate>Contact Us</div>\r\n </div>\r\n <div *ngIf=\"!loading && !loadError\">\r\n <div class=\"row modal-content-lowercase\">\r\n <p translate>Please contact our office if you need assistance or have any questions about the information available here.</p>\r\n <div>\r\n <p>\r\n <div>{{loginAssistanceInfo.PracticeName}}</div>\r\n <div>{{loginAssistanceInfo.Address1}}</div>\r\n <div *ngIf=\"loginAssistanceInfo.Address2\">{{loginAssistanceInfo.Address2}}</div>\r\n <div>{{loginAssistanceInfo.City}}, {{loginAssistanceInfo.State}} {{loginAssistanceInfo.Zip}}</div>\r\n <div>{{loginAssistanceInfo.PhoneNumber}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"loading\">\r\n <div class=\"text-center\">\r\n <ap-spinner size=\"3\"></ap-spinner>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!loading && loadError\">\r\n <alert type=\"danger\" translate>An error has occurred and Contact Us could not be loaded.</alert>\r\n </div>\r\n </div>\r\n</div>\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport {\r\n finalize,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\n\r\nimport {\r\n ApBaseComponent,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n WebCommonStorageRepository,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n LoginAssistanceRepository,\r\n} from 'webcommon/webapi';\r\nimport {\r\n LoginAssistanceResultDto,\r\n} from 'webcommon/shared';\r\n\r\n@Component({\r\n selector: 'portal-contact-us',\r\n templateUrl: './contact-us.component.html',\r\n})\r\nexport class ContactUsComponent extends ApBaseComponent implements OnInit {\r\n static readonly ajsComponentName = 'portalContactUs';\r\n loadError = false;\r\n loginAssistanceInfo: LoginAssistanceResultDto;\r\n\r\n constructor(\r\n private loginAssistanceRepository: LoginAssistanceRepository,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n ) {\r\n super();\r\n this.loading = false;\r\n }\r\n\r\n ngOnInit() {\r\n this.load();\r\n }\r\n\r\n private load() {\r\n const clientId = this.webCommonStorageRepository.getClientId();\r\n if (!clientId) {\r\n this.loadError = true;\r\n return;\r\n }\r\n\r\n this.loading = true;\r\n this.loginAssistanceRepository.getLoginAssistanceInformation({\r\n clientId,\r\n }).pipe(\r\n finalize(() => this.onLoadComplete()),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data) => this.onLoadSuccess(data),\r\n () => this.onLoadError(),\r\n );\r\n }\r\n\r\n private onLoadComplete() {\r\n this.loading = false;\r\n }\r\n\r\n private onLoadError() {\r\n this.loadError = true;\r\n }\r\n\r\n private onLoadSuccess(loginAssistanceInfo: LoginAssistanceResultDto) {\r\n this.loadError = false;\r\n this.loginAssistanceInfo = loginAssistanceInfo;\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport {\r\n NgHybridStatesModule,\r\n UIRouterUpgradeModule,\r\n} from '@uirouter/angular-hybrid';\r\n\r\nimport {\r\n CoreUiModule,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n AppRouteService,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n AppRoutesDeclaration,\r\n} from 'webcommon/shared';\r\n\r\nimport {\r\n ContactUsComponent,\r\n} from './index';\r\n\r\nconst declareComponents = [\r\n ContactUsComponent,\r\n];\r\n\r\nconst loginAppRoutes: AppRoutesDeclaration = {\r\n contactus: {\r\n portalSettings: {\r\n hideHeader: false,\r\n hideToolbar: false,\r\n toolbarItem: 'blank',\r\n },\r\n route: '/contactus',\r\n state: 'contactus',\r\n },\r\n};\r\n\r\nconst loginRoutes: NgHybridStatesModule = {\r\n states: [\r\n {\r\n component: ContactUsComponent,\r\n name: loginAppRoutes.contactus.state,\r\n resolve: [\r\n {\r\n deps: [ TranslateService ],\r\n provide: '$title',\r\n useFactory: (translateService: TranslateService) => {\r\n return translateService.get('Contact Us').toPromise();\r\n },\r\n },\r\n ],\r\n url: loginAppRoutes.contactus.route,\r\n },\r\n ],\r\n};\r\n\r\n@NgModule({\r\n declarations: declareComponents,\r\n imports: [\r\n CommonModule,\r\n CoreUiModule,\r\n UIRouterUpgradeModule.forChild(loginRoutes),\r\n ],\r\n})\r\nexport class LoginModule {\r\n constructor(appRouteService: AppRouteService) {\r\n appRouteService.setupAppRoutes(loginAppRoutes);\r\n }\r\n}\r\n","<div class=\"body\">\r\n <!-- ap-login-background client-Id=\"model.clientID\" -->\r\n <div id=\"th-login-container\" class=\"container-fluid\">\r\n <form #thLoginForm=\"ngForm\" name=\"thLoginForm\" (ngSubmit)=\"telehealthLogin()\" novalidate>\r\n <div class=\"row\">\r\n <div class=\"col-xs-12 col-xs-flush col-md-6 col-md-offset-3\">\r\n <div id=\"login-header\" class=\"logo-group\">\r\n <div class=\"row\"> </div>\r\n <div class=\"modal-dialog modal-dialog-login\">\r\n <div class=\"row\">\r\n <div class=\"col-xs-12 col-xs-flush col-md-10\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <div class=\"text-center\">\r\n <div class=\"login-payment-portal header-padding-5\">\r\n Payment P<em>o</em>rtal\r\n </div>\r\n <div class=\"modal-subtitle header-padding-5\" id=\"thModalLabel2\" *ngIf=\"practiceName\">\r\n {{practiceName}}\r\n </div>\r\n <div class=\"modal-tagline\" id=\"thModalLabel3\">\r\n In order to protect your privacy and preserve security, we require authentication\r\n for access to our secure payment form.\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"modal-body\">\r\n\r\n <div class=\"form-group\" [class.has-error]=\"thLoginForm.form.controls.zipCode && !thLoginForm.form.controls.zipCode.valid && submitted\">\r\n <label for=\"zipCode\">ZipCode</label>\r\n\r\n <input class=\"form-control\" name=\"zipCode\" [(ngModel)]=\"zipCode\" id=\"zipCode\"\r\n placeholder=\"12345\" [pattern]=\"zipCodeRegex\" [required]=\"true\">\r\n <span *ngIf=\"thLoginForm.form.controls.zipCode && !thLoginForm.form.controls.zipCode.valid && submitted\" class=\"help-block\">\r\n Not valid format.<br />\r\n 12345\r\n </span>\r\n </div>\r\n <div class=\"form-group\"\r\n [class.has-error]=\"thLoginForm.form.controls.birthDate && !thLoginForm.form.controls.birthDate.valid && submitted\">\r\n\r\n <label for=\"birthDate\">BirthDate</label>\r\n\r\n <input type=\"text\" class=\"form-control\" name=\"birthDate\" [(ngModel)]=\"birthDate\"\r\n placeholder=\"yyyy-mm-dd\" id=\"birthDate\" [pattern]=\"birthDateRegex\" [required]=\"true\">\r\n\r\n <span *ngIf=\"thLoginForm.form.controls.birthDate && !thLoginForm.form.controls.birthDate.valid && submitted\"\r\n class=\"text-danger\">\r\n Not valid format.<br />\r\n yyyy-mm-dd\r\n </span>\r\n </div>\r\n\r\n <div class=\"text-center\">\r\n <div class=\"col-xs-12 col-flush\">\r\n <div class=\"row\">\r\n <div *ngIf=\"hasLoginError\" class=\"text-danger\">\r\n <div class=\"pre\">The information provided is incorrect.<br />Please try agian.</div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div>\r\n <button type=\"submit\" class=\"btn btn-primary btn-lg btn-block btn-login\" [disabled]=\"submitting\">\r\n <span *ngIf=\"submitting\">\r\n <ap-spinner></ap-spinner>\r\n </span>\r\n Login\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n <!-- Below is a hack to get the android webview to behave properly while logging in.\r\n If this is removed, it will cause random whitespace to appear after login. Please don't remove. -->\r\n <div class=\"row\" style=\"overflow: hidden; min-height: 1px;\">\r\n <div class=\"col-xs-12 col-sm-10 col-sm-offset-1 col-md-6 col-md-offset-3\"\r\n style=\"margin-bottom: -99999px; padding-bottom: 99999px;\"></div>\r\n </div>\r\n </div>\r\n</div>\r\n","import {\r\n Component,\r\n OnInit,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { NgForm } from '@angular/forms';\r\nimport { StateService, Transition } from '@uirouter/core';\r\n\r\nimport {\r\n ClientConfig,\r\n ContentAttributeServiceUpgrade,\r\n PatientPortalConfigurationRepository,\r\n} from '@app/core';\r\n\r\nimport {\r\n finalize,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\nimport {\r\n ApBaseComponent,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n WebCommonStorageRepository,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n TelehealthRepository,\r\n} from 'webcommon/webapi';\r\nimport {\r\n LoginAssistanceResultDto,\r\n PatientLoginInfoDto,\r\n TelehealthAppointmentLoginDto,\r\n} from 'webcommon/shared';\r\n\r\n@Component({\r\n selector: 'th-login',\r\n templateUrl: './th-login.component.html',\r\n})\r\nexport class ThLoginComponent extends ApBaseComponent implements OnInit {\r\n loadError = false;\r\n hasLoginError = false;\r\n loginAssistanceInfo: LoginAssistanceResultDto;\r\n url = '';\r\n appointmentId: string;\r\n userId: string;\r\n billingCoPayAmount: number;\r\n billingBalance: number;\r\n zipCode: string;\r\n birthDate: any;\r\n clientId: string;\r\n practiceName = '';\r\n submitted = false;\r\n submitting = false;\r\n birthDateRegex = /^$|\\d{4}\\-\\d{2}\\-\\d{2}/;\r\n zipCodeRegex = /^$|\\d{5}/;\r\n\r\n constructor(\r\n private patientPortalConfigurationRepository: PatientPortalConfigurationRepository,\r\n private contentAttributeService: ContentAttributeServiceUpgrade,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n private telehealthRepository: TelehealthRepository,\r\n private transition: Transition,\r\n private stateService: StateService,\r\n ) {\r\n super();\r\n this.loading = false;\r\n }\r\n\r\n @ViewChild('thLoginForm', { static: true }) thLoginForm: NgForm;\r\n\r\n ngOnInit() {\r\n this.appointmentId = this.transition.params().apptId;\r\n this.webCommonStorageRepository.clearAll();\r\n this.load();\r\n }\r\n\r\n private load() {\r\n this.loading = true;\r\n if (!this.patientPortalConfigurationRepository.DEV_HOSTED) {\r\n this.contentAttributeService.getClientConfig()\r\n .then((data: ClientConfig) => {\r\n this.webCommonStorageRepository.setClientUrl(data.hostUrl);\r\n this.webCommonStorageRepository.setClientId(data.clientId);\r\n this.clientId = data.clientId;\r\n\r\n }).catch(function() {\r\n this.loadError = true;\r\n });\r\n } else {\r\n this.loadError = true;\r\n return;\r\n }\r\n }\r\n\r\n telehealthLogin() {\r\n this.submitting = true;\r\n this.submitted = true;\r\n if (this.thLoginForm && !this.thLoginForm.valid) {\r\n this.submitting = false;\r\n return;\r\n }\r\n\r\n const loginRequestDto: TelehealthAppointmentLoginDto = {\r\n AppointmentId: this.appointmentId,\r\n BirthDate: this.birthDate,\r\n ClientFeatures: [],\r\n ClientId: this.clientId,\r\n DeviceId: '',\r\n ZipCode: this.zipCode,\r\n };\r\n this.telehealthRepository.postTelehealthLogin(loginRequestDto).pipe(\r\n finalize(() => { this.submitting = false; }),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data: PatientLoginInfoDto) => {\r\n\r\n this.webCommonStorageRepository.setJsonWebToken(data.JsonWebToken);\r\n this.webCommonStorageRepository.setUserId(data.Id);\r\n this.stateService.go('thPayment', { apptId: this.appointmentId });\r\n },\r\n () => {\r\n this.hasLoginError = true;\r\n },\r\n );\r\n }\r\n}\r\n","<div class=\"container-center\">\r\n <div class=\"paper paper-th\">\r\n <div class=\"paper-header hidden-print\">\r\n <div class=\"paper-title\" translate>\r\n Your payment has been submitted.\r\n </div>\r\n </div>\r\n <hr/>\r\n <div class=\"paper-body\">\r\n <div *ngIf=\"!loading\">\r\n <div *ngIf=\"!continueClicked\" class=\"receipt-padding\" [innerHTML]=\"receiptHtml\"></div>\r\n <div *ngIf=\"continueClicked\">\r\n Please close this tab and return to the Aprima Telehealth Visit tab of your browser to continue your telehealth call.\r\n </div>\r\n <div class=\"hidden-print\">\r\n <button class=\"btn btn-primary pull-right\" *ngIf=\"!continueClicked\" (click)=\"done()\" translate>\r\n Continue\r\n </button>\r\n <button class=\"btn\" *ngIf=\"!continueClicked\" (click)=\"print()\" translate>\r\n Print\r\n </button>\r\n </div>\r\n </div>\r\n <div *ngIf=\"loading\">\r\n <div class=\"text-center\">\r\n <ap-spinner size=\"3\"></ap-spinner>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!loading && loadError\">\r\n <alert type=\"danger\" translate>An error has occurred and payment could not be loaded.</alert>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { Transition } from '@uirouter/core';\r\nimport {\r\n finalize,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\n\r\nimport {\r\n ApBaseComponent,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n WebCommonStorageRepository,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n BillingRepository,\r\n} from 'webcommon/webapi';\r\nimport {\r\n LoginAssistanceResultDto,\r\n ReceiptDto,\r\n ReceiptRequestDto,\r\n} from 'webcommon/shared';\r\n\r\n@Component({\r\n selector: 'th-payment-summary',\r\n templateUrl: './th-payment-summary.component.html',\r\n})\r\nexport class ThPaymentSummaryComponent extends ApBaseComponent implements OnInit {\r\n loadError = false;\r\n errorMessage = '';\r\n loginAssistanceInfo: LoginAssistanceResultDto;\r\n url = '';\r\n receiptHtml = '';\r\n userId: string | null;\r\n txId: string;\r\n continueClicked = false;\r\n\r\n constructor(\r\n private billingRepository: BillingRepository,\r\n private transition: Transition,\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n ) {\r\n super();\r\n this.loading = false;\r\n }\r\n\r\n ngOnInit() {\r\n this.userId = this.webCommonStorageRepository.getUserId();\r\n this.txId = this.transition.params().txId;\r\n this.load();\r\n }\r\n\r\n private load() {\r\n this.loading = true;\r\n\r\n this.loadReciept();\r\n\r\n }\r\n\r\n private loadReciept() {\r\n const receiptRequestDto: ReceiptRequestDto = {\r\n LoginUserPatientId: this.userId,\r\n RecipientEnumText: 'CUST',\r\n RemoteSessionId: this.userId + new Date().toLocaleDateString(),\r\n TxId: +this.txId,\r\n };\r\n this.billingRepository.getReceiptHtml(receiptRequestDto).pipe(\r\n finalize(() => this.onLoadComplete()),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data: ReceiptDto) => this.onLoadSuccess(data),\r\n () => this.onLoadError(),\r\n );\r\n }\r\n\r\n private onLoadComplete() {\r\n this.loading = false;\r\n }\r\n\r\n private onLoadError() {\r\n this.loadError = true;\r\n }\r\n\r\n private onLoadSuccess(result: ReceiptDto) {\r\n this.loadError = false;\r\n this.receiptHtml = result.ReceiptHtml;\r\n }\r\n\r\n print() {\r\n window.print();\r\n }\r\n\r\n done() {\r\n window.close();\r\n this.continueClicked = true;\r\n }\r\n}\r\n","<div class=\"container-center\">\r\n <div class=\"paper paper-th\">\r\n <div class=\"paper-header\">\r\n <div class=\"paper-title\" translate>Pay For Today's Visit</div>\r\n </div>\r\n <hr/>\r\n <div class=\"paper-body\">\r\n <div *ngIf=\"!loading\">\r\n <div class=\"info-box text-center\">\r\n Your current balance is {{isNegativeBalance && '-$'+billingBalanceString+' (credit)' || '$'+billingBalanceString}}\r\n <br>\r\n Your estimated copay is ${{billingCoPayAmount}}\r\n </div>\r\n <p class=\"billing-warn\">\r\n We have estimated your copay for this visit. This amount is not the final bill, which may be more or less depending upon the final services rendered and any insurance coverage benefits. Payments may not be reflected in the current balance shown.\r\n </p>\r\n <div *ngIf=\"!loading && loadError\" class=\"text-danger\">\r\n <alert type=\"danger\" translate>An error has occurred and payment could not be loaded.</alert>\r\n </div>\r\n <div *ngIf=\"!loading && hasPaymentError\" class=\"text-danger\">\r\n <alert type=\"danger\" translate>An error has occurred and your payment may not have been applied to your account. Please contact the office.</alert>\r\n </div>\r\n <ap-payment-frame [url]=\"url\" (applyPayment)=\"applyPayment($event)\"></ap-payment-frame>\r\n </div>\r\n <div *ngIf=\"loading\">\r\n <div class=\"text-center\">\r\n <ap-spinner size=\"3\"></ap-spinner>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { StateService, Transition } from '@uirouter/core';\r\n\r\nimport {\r\n ContentAttributeServiceUpgrade,\r\n} from '@app/core';\r\n\r\nimport {\r\n finalize,\r\n takeUntil,\r\n} from 'rxjs/operators';\r\nimport {\r\n ApBaseComponent,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n WebCommonStorageRepository,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n BillingRepository,\r\n} from 'webcommon/webapi';\r\nimport {\r\n ApplyPaymentToAppointmentRequestDto,\r\n LoginAssistanceResultDto,\r\n PaymentResponseDto,\r\n TelehealthBillingOptionsDto,\r\n} from 'webcommon/shared';\r\n\r\n@Component({\r\n selector: 'th-payment',\r\n templateUrl: './th-payment.component.html',\r\n})\r\nexport class ThPaymentComponent extends ApBaseComponent implements OnInit {\r\n loadError = false;\r\n errorMessage = '';\r\n loginAssistanceInfo: LoginAssistanceResultDto;\r\n url = '';\r\n appointmentId: string;\r\n userId: string | null;\r\n billingCoPayAmount: number;\r\n billingBalance: number;\r\n billingBalanceString: string;\r\n hasPaymentError = false;\r\n isNegativeBalance = false;\r\n\r\n constructor(\r\n private webCommonStorageRepository: WebCommonStorageRepository,\r\n private billingRepository: BillingRepository,\r\n private transition: Transition,\r\n private stateService: StateService,\r\n private contentAttributeService: ContentAttributeServiceUpgrade,\r\n ) {\r\n super();\r\n this.loading = false;\r\n }\r\n\r\n ngOnInit() {\r\n this.appointmentId = this.transition.params().apptId;\r\n this.userId = this.webCommonStorageRepository.getUserId();\r\n this.load();\r\n }\r\n\r\n private load() {\r\n this.loading = true;\r\n this.loadBilling();\r\n }\r\n\r\n private loadBilling() {\r\n const redirectUrl = this.contentAttributeService.getPaymentRedirectUrl();\r\n this.billingRepository.getTelehealthBilling(this.appointmentId, redirectUrl).pipe(\r\n finalize(() => this.onLoadComplete()),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data: TelehealthBillingOptionsDto) => this.onLoadSuccess(data),\r\n () => this.onLoadError(),\r\n );\r\n }\r\n\r\n private onLoadComplete() {\r\n this.loading = false;\r\n }\r\n\r\n private onLoadError() {\r\n this.loadError = true;\r\n }\r\n\r\n private onLoadSuccess(result: TelehealthBillingOptionsDto) {\r\n this.loadError = false;\r\n this.url = result.PaymentUrl;\r\n this.billingCoPayAmount = result.BillingCoPayAmount;\r\n if (result.BillingBalance) {\r\n this.billingBalance = result.BillingBalance;\r\n this.billingBalanceString = this.billingBalance.toString();\r\n } else {\r\n this.billingBalance = 0;\r\n }\r\n\r\n if (this.billingBalance && this.billingBalanceString.startsWith('-')) {\r\n this.isNegativeBalance = true;\r\n this.billingBalanceString = this.billingBalanceString.substring(1);\r\n }\r\n }\r\n\r\n applyPayment(redirectUrlString: string) {\r\n\r\n const ApplicationSubmittingPayment = 4;\r\n\r\n const parameters: ApplyPaymentToAppointmentRequestDto = {\r\n ApplicationSubmittingPayment,\r\n AppointmentGuid: this.appointmentId,\r\n LoginUserPatientId: this.userId,\r\n PaymentResponseString: redirectUrlString,\r\n RemoteSessionId: this.userId + new Date().toLocaleDateString(),\r\n };\r\n const result = this.billingRepository.postApplyTelehealthPayment(parameters);\r\n result.pipe(\r\n finalize(() => { this.url = redirectUrlString; }),\r\n takeUntil(this.onDestroy$),\r\n ).subscribe(\r\n (data: PaymentResponseDto) => {\r\n if (data.IsCanceled) {\r\n window.close();\r\n } else {\r\n this.stateService.go('thPaymentSummary', {apptId: this.appointmentId, txId: data.TxId});\r\n }\r\n },\r\n () => {\r\n this.hasPaymentError = true;\r\n },\r\n );\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport {\r\n NgHybridStatesModule,\r\n UIRouterUpgradeModule,\r\n} from '@uirouter/angular-hybrid';\r\n\r\nimport {\r\n CoreUiModule,\r\n} from 'webcommon/core-ui';\r\nimport {\r\n AppRouteService,\r\n} from 'webcommon/legacy-common';\r\nimport {\r\n AppRoutesDeclaration,\r\n} from 'webcommon/shared';\r\nimport { CoreModule } from '../core/core.module';\r\nimport {\r\n ThLoginComponent, ThPaymentComponent, ThPaymentSummaryComponent,\r\n} from './index';\r\n\r\nconst declareComponents = [\r\n ThLoginComponent,\r\n ThPaymentComponent,\r\n ThPaymentSummaryComponent,\r\n];\r\n\r\nconst telehealthAppRoutes: AppRoutesDeclaration = {\r\n telehealth: {\r\n portalSettings: {\r\n hideFooter: false,\r\n hideHeader: true,\r\n hideToolbar: true,\r\n toolbarItem: 'blank',\r\n },\r\n route: '/telehealth/:apptId',\r\n state: 'telehealth',\r\n },\r\n thPayment: {\r\n portalSettings: {\r\n hideFooter: false,\r\n hideHeader: true,\r\n hideToolbar: true,\r\n toolbarItem: 'blank',\r\n },\r\n route: '/thPayment/:apptId',\r\n state: 'thPayment',\r\n },\r\n thPaymentSummary: {\r\n portalSettings: {\r\n hideFooter: false,\r\n hideHeader: true,\r\n hideToolbar: true,\r\n toolbarItem: 'blank',\r\n },\r\n route: '/thPaymentSummary/:apptId?txId',\r\n state: 'thPaymentSummary',\r\n },\r\n};\r\n\r\nconst telehealthRoutes: NgHybridStatesModule = {\r\n states: [\r\n {\r\n component: ThLoginComponent,\r\n name: telehealthAppRoutes.telehealth.state,\r\n resolve: [\r\n {\r\n deps: [ TranslateService ],\r\n provide: '$title',\r\n useFactory: (translateService: TranslateService) => {\r\n return translateService.get('Payment Portal').toPromise();\r\n },\r\n },\r\n ],\r\n url: telehealthAppRoutes.telehealth.route,\r\n },\r\n {\r\n component: ThPaymentComponent,\r\n name: telehealthAppRoutes.thPayment.state,\r\n resolve: [\r\n {\r\n deps: [ TranslateService ],\r\n provide: '$title',\r\n useFactory: (translateService: TranslateService) => {\r\n return translateService.get('Payment Portal').toPromise();\r\n },\r\n },\r\n ],\r\n url: telehealthAppRoutes.thPayment.route,\r\n },\r\n {\r\n component: ThPaymentSummaryComponent,\r\n name: telehealthAppRoutes.thPaymentSummary.state,\r\n resolve: [\r\n {\r\n deps: [ TranslateService ],\r\n provide: '$title',\r\n useFactory: (translateService: TranslateService) => {\r\n return translateService.get('Payment Portal').toPromise();\r\n },\r\n },\r\n ],\r\n url: telehealthAppRoutes.thPaymentSummary.route,\r\n },\r\n ],\r\n};\r\n\r\n@NgModule({\r\n declarations: declareComponents,\r\n imports: [\r\n CommonModule,\r\n CoreModule,\r\n CoreUiModule,\r\n UIRouterUpgradeModule.forChild(telehealthRoutes),\r\n ],\r\n})\r\nexport class TelehealthModule {\r\n constructor(appRouteService: AppRouteService) {\r\n appRouteService.setupAppRoutes(telehealthAppRoutes);\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { CoreUiModule } from 'webcommon/core-ui';\r\nimport { ApPersonalHealthAppsModalComponent } from './third-party/ap-personal-health-apps-modal.component';\r\n\r\nconst declareComponents = [\r\n ApPersonalHealthAppsModalComponent,\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n declareComponents,\r\n ],\r\n exports: [\r\n ],\r\n imports: [\r\n CommonModule,\r\n CoreUiModule,\r\n ],\r\n providers: [\r\n ],\r\n})\r\nexport class DashboardModule {\r\n}\r\n","import type {NgModule} from '@angular/core';\r\n\r\nexport const imports: Exclude<NgModule['imports'], undefined> = [\r\n];\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from './errors';\n\nconst LINE_START = '\\n - ';\n\nexport function invalidTimingValue(exp: string|number): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_TIMING_VALUE,\n ngDevMode && `The provided timing value \"${exp}\" is invalid.`);\n}\n\nexport function negativeStepValue(): Error {\n return new RuntimeError(\n RuntimeErrorCode.NEGATIVE_STEP_VALUE,\n ngDevMode && 'Duration values below 0 are not allowed for this animation step.');\n}\n\nexport function negativeDelayValue(): Error {\n return new RuntimeError(\n RuntimeErrorCode.NEGATIVE_DELAY_VALUE,\n ngDevMode && 'Delay values below 0 are not allowed for this animation step.');\n}\n\nexport function invalidStyleParams(varName: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STYLE_PARAMS,\n ngDevMode &&\n `Unable to resolve the local animation param ${varName} in the given list of values`);\n}\n\nexport function invalidParamValue(varName: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PARAM_VALUE,\n ngDevMode && `Please provide a value for the animation param ${varName}`);\n}\n\nexport function invalidNodeType(nodeType: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_NODE_TYPE,\n ngDevMode && `Unable to resolve animation metadata node #${nodeType}`);\n}\n\nexport function invalidCssUnitValue(userProvidedProperty: string, value: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_CSS_UNIT_VALUE,\n ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);\n}\n\nexport function invalidTrigger(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_TRIGGER,\n ngDevMode &&\n 'animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\\'@foo\\', [...]))');\n}\n\nexport function invalidDefinition(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_DEFINITION,\n ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()');\n}\n\nexport function invalidState(metadataName: string, missingSubs: string[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STATE,\n ngDevMode &&\n `state(\"${\n metadataName}\", ...) must define default values for all the following style substitutions: ${\n missingSubs.join(', ')}`);\n}\n\nexport function invalidStyleValue(value: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STYLE_VALUE,\n ngDevMode && `The provided style string value ${value} is not allowed.`);\n}\n\nexport function invalidProperty(prop: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PROPERTY,\n ngDevMode &&\n `The provided animation property \"${\n prop}\" is not a supported CSS property for animations`);\n}\n\nexport function invalidParallelAnimation(\n prop: string, firstStart: number, firstEnd: number, secondStart: number,\n secondEnd: number): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PARALLEL_ANIMATION,\n ngDevMode &&\n `The CSS property \"${prop}\" that exists between the times of \"${firstStart}ms\" and \"${\n firstEnd}ms\" is also being animated in a parallel animation between the times of \"${\n secondStart}ms\" and \"${secondEnd}ms\"`);\n}\n\nexport function invalidKeyframes(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_KEYFRAMES,\n ngDevMode && `keyframes() must be placed inside of a call to animate()`);\n}\n\nexport function invalidOffset(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_OFFSET,\n ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`);\n}\n\nexport function keyframeOffsetsOutOfOrder(): Error {\n return new RuntimeError(\n RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER,\n ngDevMode && `Please ensure that all keyframe offsets are in order`);\n}\n\nexport function keyframesMissingOffsets(): Error {\n return new RuntimeError(\n RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS,\n ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`);\n}\n\nexport function invalidStagger(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STAGGER,\n ngDevMode && `stagger() can only be used inside of query()`);\n}\n\nexport function invalidQuery(selector: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_QUERY,\n ngDevMode &&\n `\\`query(\"${selector}\")\\` returned zero elements. (Use \\`query(\"${\n selector}\", { optional: true })\\` if you wish to allow this.)`);\n}\n\nexport function invalidExpression(expr: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_EXPRESSION,\n ngDevMode && `The provided transition expression \"${expr}\" is not supported`);\n}\n\nexport function invalidTransitionAlias(alias: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_TRANSITION_ALIAS,\n ngDevMode && `The transition alias value \"${alias}\" is not supported`);\n}\n\nexport function validationFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.VALIDATION_FAILED,\n ngDevMode && `animation validation failed:\\n${errors.map(err => err.message).join('\\n')}`);\n}\n\nexport function buildingFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.BUILDING_FAILED,\n ngDevMode && `animation building failed:\\n${errors.map(err => err.message).join('\\n')}`);\n}\n\nexport function triggerBuildFailed(name: string, errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRIGGER_BUILD_FAILED,\n ngDevMode &&\n `The animation trigger \"${name}\" has failed to build due to the following errors:\\n - ${\n errors.map(err => err.message).join('\\n - ')}`);\n}\n\nexport function animationFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.ANIMATION_FAILED,\n ngDevMode &&\n `Unable to animate due to the following errors:${LINE_START}${\n errors.map(err => err.message).join(LINE_START)}`);\n}\n\nexport function registerFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.REGISTRATION_FAILED,\n ngDevMode &&\n `Unable to build the animation due to the following errors: ${\n errors.map(err => err.message).join('\\n')}`);\n}\n\nexport function missingOrDestroyedAnimation(): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION,\n ngDevMode && 'The requested animation doesn\\'t exist or has already been destroyed');\n}\n\nexport function createAnimationFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.CREATE_ANIMATION_FAILED,\n ngDevMode &&\n `Unable to create the animation due to the following errors:${\n errors.map(err => err.message).join('\\n')}`);\n}\n\nexport function missingPlayer(id: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_PLAYER,\n ngDevMode && `Unable to find the timeline player referenced by ${id}`);\n}\n\nexport function missingTrigger(phase: string, name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_TRIGGER,\n ngDevMode &&\n `Unable to listen on the animation trigger event \"${\n phase}\" because the animation trigger \"${name}\" doesn\\'t exist!`);\n}\n\nexport function missingEvent(name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_EVENT,\n ngDevMode &&\n `Unable to listen on the animation trigger \"${\n name}\" because the provided event is undefined!`);\n}\n\nexport function unsupportedTriggerEvent(phase: string, name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT,\n ngDevMode &&\n `The provided animation trigger event \"${phase}\" for the animation trigger \"${\n name}\" is not supported!`);\n}\n\nexport function unregisteredTrigger(name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.UNREGISTERED_TRIGGER,\n ngDevMode && `The provided animation trigger \"${name}\" has not been registered!`);\n}\n\nexport function triggerTransitionsFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED,\n ngDevMode &&\n `Unable to process animations due to the following failed trigger transitions\\n ${\n errors.map(err => err.message).join('\\n')}`);\n}\n\nexport function triggerParsingFailed(name: string, errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRIGGER_PARSING_FAILED,\n ngDevMode &&\n `Animation parsing for the ${name} trigger have failed:${LINE_START}${\n errors.map(err => err.message).join(LINE_START)}`);\n}\n\nexport function transitionFailed(name: string, errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRANSITION_FAILED,\n ngDevMode && `@${name} has failed due to:\\n ${errors.map(err => err.message).join('\\n- ')}`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationEvent, AnimationPlayer, AUTO_STYLE, NoopAnimationPlayer, ɵAnimationGroupPlayer, ɵPRE_STYLE as PRE_STYLE, ɵStyleDataMap} from '@angular/animations';\n\nimport {AnimationStyleNormalizer} from '../../src/dsl/style_normalization/animation_style_normalizer';\nimport {AnimationDriver} from '../../src/render/animation_driver';\nimport {animationFailed} from '../error_helpers';\n\nimport {ANIMATABLE_PROP_SET} from './web_animations/animatable_props_set';\n\n// We don't include ambient node types here since @angular/animations/browser\n// is meant to target the browser so technically it should not depend on node\n// types. `process` is just declared locally here as a result.\ndeclare const process: any;\n\nexport function isBrowser(): boolean {\n return (typeof window !== 'undefined' && typeof window.document !== 'undefined');\n}\n\nexport function isNode(): boolean {\n // Checking only for `process` isn't enough to identify whether or not we're in a Node\n // environment, because Webpack by default will polyfill the `process`. While we can discern\n // that Webpack polyfilled it by looking at `process.browser`, it's very Webpack-specific and\n // might not be future-proof. Instead we look at the stringified version of `process` which\n // is `[object process]` in Node and `[object Object]` when polyfilled.\n return typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n}\n\nexport function optimizeGroupPlayer(players: AnimationPlayer[]): AnimationPlayer {\n switch (players.length) {\n case 0:\n return new NoopAnimationPlayer();\n case 1:\n return players[0];\n default:\n return new ɵAnimationGroupPlayer(players);\n }\n}\n\nexport function normalizeKeyframes(\n driver: AnimationDriver, normalizer: AnimationStyleNormalizer, element: any,\n keyframes: Array<ɵStyleDataMap>, preStyles: ɵStyleDataMap = new Map(),\n postStyles: ɵStyleDataMap = new Map()): Array<ɵStyleDataMap> {\n const errors: Error[] = [];\n const normalizedKeyframes: Array<ɵStyleDataMap> = [];\n let previousOffset = -1;\n let previousKeyframe: ɵStyleDataMap|null = null;\n keyframes.forEach(kf => {\n const offset = kf.get('offset') as number;\n const isSameOffset = offset == previousOffset;\n const normalizedKeyframe: ɵStyleDataMap = (isSameOffset && previousKeyframe) || new Map();\n kf.forEach((val, prop) => {\n let normalizedProp = prop;\n let normalizedValue = val;\n if (prop !== 'offset') {\n normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);\n switch (normalizedValue) {\n case PRE_STYLE:\n normalizedValue = preStyles.get(prop)!;\n break;\n\n case AUTO_STYLE:\n normalizedValue = postStyles.get(prop)!;\n break;\n\n default:\n normalizedValue =\n normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);\n break;\n }\n }\n normalizedKeyframe.set(normalizedProp, normalizedValue);\n });\n if (!isSameOffset) {\n normalizedKeyframes.push(normalizedKeyframe);\n }\n previousKeyframe = normalizedKeyframe;\n previousOffset = offset;\n });\n if (errors.length) {\n throw animationFailed(errors);\n }\n\n return normalizedKeyframes;\n}\n\nexport function listenOnPlayer(\n player: AnimationPlayer, eventName: string, event: AnimationEvent|undefined,\n callback: (event: any) => any) {\n switch (eventName) {\n case 'start':\n player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player)));\n break;\n case 'done':\n player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player)));\n break;\n case 'destroy':\n player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player)));\n break;\n }\n}\n\nexport function copyAnimationEvent(\n e: AnimationEvent, phaseName: string, player: AnimationPlayer): AnimationEvent {\n const totalTime = player.totalTime;\n const disabled = (player as any).disabled ? true : false;\n const event = makeAnimationEvent(\n e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName,\n totalTime == undefined ? e.totalTime : totalTime, disabled);\n const data = (e as any)['_data'];\n if (data != null) {\n (event as any)['_data'] = data;\n }\n return event;\n}\n\nexport function makeAnimationEvent(\n element: any, triggerName: string, fromState: string, toState: string, phaseName: string = '',\n totalTime: number = 0, disabled?: boolean): AnimationEvent {\n return {element, triggerName, fromState, toState, phaseName, totalTime, disabled: !!disabled};\n}\n\nexport function getOrSetDefaultValue<T, V>(map: Map<T, V>, key: T, defaultValue: V) {\n let value = map.get(key);\n if (!value) {\n map.set(key, value = defaultValue);\n }\n return value;\n}\n\nexport function parseTimelineCommand(command: string): [string, string] {\n const separatorPos = command.indexOf(':');\n const id = command.substring(1, separatorPos);\n const action = command.slice(separatorPos + 1);\n return [id, action];\n}\n\nlet _contains: (elm1: any, elm2: any) => boolean = (elm1: any, elm2: any) => false;\nlet _query: (element: any, selector: string, multi: boolean) => any[] =\n (element: any, selector: string, multi: boolean) => {\n return [];\n };\nlet _documentElement: unknown|null = null;\n\nexport function getParentElement(element: any): unknown|null {\n const parent = element.parentNode || element.host; // consider host to support shadow DOM\n if (parent === _documentElement) {\n return null;\n }\n return parent;\n}\n\n// Define utility methods for browsers and platform-server(domino) where Element\n// and utility methods exist.\nconst _isNode = isNode();\nif (_isNode || typeof Element !== 'undefined') {\n if (!isBrowser()) {\n _contains = (elm1, elm2) => elm1.contains(elm2);\n } else {\n // Read the document element in an IIFE that's been marked pure to avoid a top-level property\n // read that may prevent tree-shaking.\n _documentElement = /* @__PURE__ */ (() => document.documentElement)();\n _contains = (elm1, elm2) => {\n while (elm2) {\n if (elm2 === elm1) {\n return true;\n }\n elm2 = getParentElement(elm2);\n }\n return false;\n };\n }\n\n _query = (element: any, selector: string, multi: boolean): any[] => {\n if (multi) {\n return Array.from(element.querySelectorAll(selector));\n }\n const elem = element.querySelector(selector);\n return elem ? [elem] : [];\n };\n}\n\nfunction containsVendorPrefix(prop: string): boolean {\n // Webkit is the only real popular vendor prefix nowadays\n // cc: http://shouldiprefix.com/\n return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit\n}\n\nlet _CACHED_BODY: {style: any}|null = null;\nlet _IS_WEBKIT = false;\nexport function validateStyleProperty(prop: string): boolean {\n if (!_CACHED_BODY) {\n _CACHED_BODY = getBodyNode() || {};\n _IS_WEBKIT = _CACHED_BODY!.style ? ('WebkitAppearance' in _CACHED_BODY!.style) : false;\n }\n\n let result = true;\n if (_CACHED_BODY!.style && !containsVendorPrefix(prop)) {\n result = prop in _CACHED_BODY!.style;\n if (!result && _IS_WEBKIT) {\n const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1);\n result = camelProp in _CACHED_BODY!.style;\n }\n }\n\n return result;\n}\n\nexport function validateWebAnimatableStyleProperty(prop: string): boolean {\n return ANIMATABLE_PROP_SET.has(prop);\n}\n\nexport function getBodyNode(): any|null {\n if (typeof document != 'undefined') {\n return document.body;\n }\n return null;\n}\n\nexport const containsElement = _contains;\nexport const invokeQuery = _query;\n\nexport function hypenatePropsKeys(original: ɵStyleDataMap): ɵStyleDataMap {\n const newMap: ɵStyleDataMap = new Map();\n original.forEach((val, prop) => {\n const newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');\n newMap.set(newProp, val);\n });\n return newMap;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationPlayer, NoopAnimationPlayer} from '@angular/animations';\nimport {Injectable} from '@angular/core';\n\nimport {containsElement, getParentElement, invokeQuery, validateStyleProperty} from './shared';\n\n/**\n * @publicApi\n */\n@Injectable()\nexport class NoopAnimationDriver implements AnimationDriver {\n validateStyleProperty(prop: string): boolean {\n return validateStyleProperty(prop);\n }\n\n matchesElement(_element: any, _selector: string): boolean {\n // This method is deprecated and no longer in use so we return false.\n return false;\n }\n\n containsElement(elm1: any, elm2: any): boolean {\n return containsElement(elm1, elm2);\n }\n\n getParentElement(element: unknown): unknown {\n return getParentElement(element);\n }\n\n query(element: any, selector: string, multi: boolean): any[] {\n return invokeQuery(element, selector, multi);\n }\n\n computeStyle(element: any, prop: string, defaultValue?: string): string {\n return defaultValue || '';\n }\n\n animate(\n element: any, keyframes: Array<Map<string, string|number>>, duration: number, delay: number,\n easing: string, previousPlayers: any[] = [],\n scrubberAccessRequested?: boolean): AnimationPlayer {\n return new NoopAnimationPlayer(duration, delay);\n }\n}\n\n/**\n * @publicApi\n */\nexport abstract class AnimationDriver {\n static NOOP: AnimationDriver = (/* @__PURE__ */ new NoopAnimationDriver());\n\n abstract validateStyleProperty(prop: string): boolean;\n\n abstract validateAnimatableStyleProperty?: (prop: string) => boolean;\n\n /**\n * @deprecated No longer in use. Will be removed.\n */\n abstract matchesElement(element: any, selector: string): boolean;\n\n abstract containsElement(elm1: any, elm2: any): boolean;\n\n /**\n * Obtains the parent element, if any. `null` is returned if the element does not have a parent.\n */\n abstract getParentElement(element: unknown): unknown;\n\n abstract query(element: any, selector: string, multi: boolean): any[];\n\n abstract computeStyle(element: any, prop: string, defaultValue?: string): string;\n\n abstract animate(\n element: any, keyframes: Array<Map<string, string|number>>, duration: number, delay: number,\n easing?: string|null, previousPlayers?: any[], scrubberAccessRequested?: boolean): any;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimateTimings, AnimationMetadata, AnimationMetadataType, AnimationOptions, sequence, ɵStyleData, ɵStyleDataMap} from '@angular/animations';\n\nimport {Ast as AnimationAst, AstVisitor as AnimationAstVisitor} from './dsl/animation_ast';\nimport {AnimationDslVisitor} from './dsl/animation_dsl_visitor';\nimport {invalidNodeType, invalidParamValue, invalidStyleParams, invalidTimingValue, negativeDelayValue, negativeStepValue} from './error_helpers';\nimport {isNode} from './render/shared';\n\nexport const ONE_SECOND = 1000;\n\nexport const SUBSTITUTION_EXPR_START = '{{';\nexport const SUBSTITUTION_EXPR_END = '}}';\nexport const ENTER_CLASSNAME = 'ng-enter';\nexport const LEAVE_CLASSNAME = 'ng-leave';\nexport const NG_TRIGGER_CLASSNAME = 'ng-trigger';\nexport const NG_TRIGGER_SELECTOR = '.ng-trigger';\nexport const NG_ANIMATING_CLASSNAME = 'ng-animating';\nexport const NG_ANIMATING_SELECTOR = '.ng-animating';\n\nexport function resolveTimingValue(value: string|number) {\n if (typeof value == 'number') return value;\n\n const matches = value.match(/^(-?[\\.\\d]+)(m?s)/);\n if (!matches || matches.length < 2) return 0;\n\n return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n}\n\nfunction _convertTimeValueToMS(value: number, unit: string): number {\n switch (unit) {\n case 's':\n return value * ONE_SECOND;\n default: // ms or something else\n return value;\n }\n}\n\nexport function resolveTiming(\n timings: string|number|AnimateTimings, errors: Error[], allowNegativeValues?: boolean) {\n return timings.hasOwnProperty('duration') ?\n <AnimateTimings>timings :\n parseTimeExpression(<string|number>timings, errors, allowNegativeValues);\n}\n\nfunction parseTimeExpression(\n exp: string|number, errors: Error[], allowNegativeValues?: boolean): AnimateTimings {\n const regex = /^(-?[\\.\\d]+)(m?s)(?:\\s+(-?[\\.\\d]+)(m?s))?(?:\\s+([-a-z]+(?:\\(.+?\\))?))?$/i;\n let duration: number;\n let delay: number = 0;\n let easing: string = '';\n if (typeof exp === 'string') {\n const matches = exp.match(regex);\n if (matches === null) {\n errors.push(invalidTimingValue(exp));\n return {duration: 0, delay: 0, easing: ''};\n }\n\n duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n\n const delayMatch = matches[3];\n if (delayMatch != null) {\n delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);\n }\n\n const easingVal = matches[5];\n if (easingVal) {\n easing = easingVal;\n }\n } else {\n duration = exp;\n }\n\n if (!allowNegativeValues) {\n let containsErrors = false;\n let startIndex = errors.length;\n if (duration < 0) {\n errors.push(negativeStepValue());\n containsErrors = true;\n }\n if (delay < 0) {\n errors.push(negativeDelayValue());\n containsErrors = true;\n }\n if (containsErrors) {\n errors.splice(startIndex, 0, invalidTimingValue(exp));\n }\n }\n\n return {duration, delay, easing};\n}\n\nexport function copyObj(\n obj: {[key: string]: any}, destination: {[key: string]: any} = {}): {[key: string]: any} {\n Object.keys(obj).forEach(prop => {\n destination[prop] = obj[prop];\n });\n return destination;\n}\n\nexport function convertToMap(obj: ɵStyleData): ɵStyleDataMap {\n const styleMap: ɵStyleDataMap = new Map();\n Object.keys(obj).forEach(prop => {\n const val = obj[prop];\n styleMap.set(prop, val);\n });\n return styleMap;\n}\n\nexport function normalizeKeyframes(keyframes: Array<ɵStyleData>|\n Array<ɵStyleDataMap>): Array<ɵStyleDataMap> {\n if (!keyframes.length) {\n return [];\n }\n if (keyframes[0] instanceof Map) {\n return keyframes as Array<ɵStyleDataMap>;\n }\n return keyframes.map(kf => convertToMap(kf as ɵStyleData));\n}\n\nexport function normalizeStyles(styles: ɵStyleDataMap|Array<ɵStyleDataMap>): ɵStyleDataMap {\n const normalizedStyles: ɵStyleDataMap = new Map();\n if (Array.isArray(styles)) {\n styles.forEach(data => copyStyles(data, normalizedStyles));\n } else {\n copyStyles(styles, normalizedStyles);\n }\n return normalizedStyles;\n}\n\nexport function copyStyles(\n styles: ɵStyleDataMap, destination: ɵStyleDataMap = new Map(),\n backfill?: ɵStyleDataMap): ɵStyleDataMap {\n if (backfill) {\n for (let [prop, val] of backfill) {\n destination.set(prop, val);\n }\n }\n for (let [prop, val] of styles) {\n destination.set(prop, val);\n }\n return destination;\n}\n\nfunction getStyleAttributeString(element: any, key: string, value: string) {\n // Return the key-value pair string to be added to the style attribute for the\n // given CSS style key.\n if (value) {\n return key + ':' + value + ';';\n } else {\n return '';\n }\n}\n\nfunction writeStyleAttribute(element: any) {\n // Read the style property of the element and manually reflect it to the\n // style attribute. This is needed because Domino on platform-server doesn't\n // understand the full set of allowed CSS properties and doesn't reflect some\n // of them automatically.\n let styleAttrValue = '';\n for (let i = 0; i < element.style.length; i++) {\n const key = element.style.item(i);\n styleAttrValue += getStyleAttributeString(element, key, element.style.getPropertyValue(key));\n }\n for (const key in element.style) {\n // Skip internal Domino properties that don't need to be reflected.\n if (!element.style.hasOwnProperty(key) || key.startsWith('_')) {\n continue;\n }\n const dashKey = camelCaseToDashCase(key);\n styleAttrValue += getStyleAttributeString(element, dashKey, element.style[key]);\n }\n element.setAttribute('style', styleAttrValue);\n}\n\nexport function setStyles(element: any, styles: ɵStyleDataMap, formerStyles?: ɵStyleDataMap) {\n if (element['style']) {\n styles.forEach((val, prop) => {\n const camelProp = dashCaseToCamelCase(prop);\n if (formerStyles && !formerStyles.has(prop)) {\n formerStyles.set(prop, element.style[camelProp]);\n }\n element.style[camelProp] = val;\n });\n // On the server set the 'style' attribute since it's not automatically reflected.\n if (isNode()) {\n writeStyleAttribute(element);\n }\n }\n}\n\nexport function eraseStyles(element: any, styles: ɵStyleDataMap) {\n if (element['style']) {\n styles.forEach((_, prop) => {\n const camelProp = dashCaseToCamelCase(prop);\n element.style[camelProp] = '';\n });\n // On the server set the 'style' attribute since it's not automatically reflected.\n if (isNode()) {\n writeStyleAttribute(element);\n }\n }\n}\n\nexport function normalizeAnimationEntry(steps: AnimationMetadata|\n AnimationMetadata[]): AnimationMetadata {\n if (Array.isArray(steps)) {\n if (steps.length == 1) return steps[0];\n return sequence(steps);\n }\n return steps as AnimationMetadata;\n}\n\nexport function validateStyleParams(\n value: string|number|null|undefined, options: AnimationOptions, errors: Error[]) {\n const params = options.params || {};\n const matches = extractStyleParams(value);\n if (matches.length) {\n matches.forEach(varName => {\n if (!params.hasOwnProperty(varName)) {\n errors.push(invalidStyleParams(varName));\n }\n });\n }\n}\n\nconst PARAM_REGEX =\n new RegExp(`${SUBSTITUTION_EXPR_START}\\\\s*(.+?)\\\\s*${SUBSTITUTION_EXPR_END}`, 'g');\nexport function extractStyleParams(value: string|number|null|undefined): string[] {\n let params: string[] = [];\n if (typeof value === 'string') {\n let match: any;\n while (match = PARAM_REGEX.exec(value)) {\n params.push(match[1] as string);\n }\n PARAM_REGEX.lastIndex = 0;\n }\n return params;\n}\n\nexport function interpolateParams(\n value: string|number, params: {[name: string]: any}, errors: Error[]): string|number {\n const original = value.toString();\n const str = original.replace(PARAM_REGEX, (_, varName) => {\n let localVal = params[varName];\n // this means that the value was never overridden by the data passed in by the user\n if (localVal == null) {\n errors.push(invalidParamValue(varName));\n localVal = '';\n }\n return localVal.toString();\n });\n\n // we do this to assert that numeric values stay as they are\n return str == original ? value : str;\n}\n\nexport function iteratorToArray(iterator: any): any[] {\n const arr: any[] = [];\n let item = iterator.next();\n while (!item.done) {\n arr.push(item.value);\n item = iterator.next();\n }\n return arr;\n}\n\nconst DASH_CASE_REGEXP = /-+([a-z0-9])/g;\nexport function dashCaseToCamelCase(input: string): string {\n return input.replace(DASH_CASE_REGEXP, (...m: any[]) => m[1].toUpperCase());\n}\n\nexport function camelCaseToDashCase(input: string): string {\n return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nexport function allowPreviousPlayerStylesMerge(duration: number, delay: number) {\n return duration === 0 || delay === 0;\n}\n\nexport function balancePreviousStylesIntoKeyframes(\n element: any, keyframes: Array<ɵStyleDataMap>, previousStyles: ɵStyleDataMap) {\n if (previousStyles.size && keyframes.length) {\n let startingKeyframe = keyframes[0];\n let missingStyleProps: string[] = [];\n previousStyles.forEach((val, prop) => {\n if (!startingKeyframe.has(prop)) {\n missingStyleProps.push(prop);\n }\n startingKeyframe.set(prop, val);\n });\n\n if (missingStyleProps.length) {\n for (let i = 1; i < keyframes.length; i++) {\n let kf = keyframes[i];\n missingStyleProps.forEach(prop => kf.set(prop, computeStyle(element, prop)));\n }\n }\n }\n return keyframes;\n}\n\nexport function visitDslNode(\n visitor: AnimationDslVisitor, node: AnimationMetadata, context: any): any;\nexport function visitDslNode(\n visitor: AnimationAstVisitor, node: AnimationAst<AnimationMetadataType>, context: any): any;\nexport function visitDslNode(visitor: any, node: any, context: any): any {\n switch (node.type) {\n case AnimationMetadataType.Trigger:\n return visitor.visitTrigger(node, context);\n case AnimationMetadataType.State:\n return visitor.visitState(node, context);\n case AnimationMetadataType.Transition:\n return visitor.visitTransition(node, context);\n case AnimationMetadataType.Sequence:\n return visitor.visitSequence(node, context);\n case AnimationMetadataType.Group:\n return visitor.visitGroup(node, context);\n case AnimationMetadataType.Animate:\n return visitor.visitAnimate(node, context);\n case AnimationMetadataType.Keyframes:\n return visitor.visitKeyframes(node, context);\n case AnimationMetadataType.Style:\n return visitor.visitStyle(node, context);\n case AnimationMetadataType.Reference:\n return visitor.visitReference(node, context);\n case AnimationMetadataType.AnimateChild:\n return visitor.visitAnimateChild(node, context);\n case AnimationMetadataType.AnimateRef:\n return visitor.visitAnimateRef(node, context);\n case AnimationMetadataType.Query:\n return visitor.visitQuery(node, context);\n case AnimationMetadataType.Stagger:\n return visitor.visitStagger(node, context);\n default:\n throw invalidNodeType(node.type);\n }\n}\n\nexport function computeStyle(element: any, prop: string): string {\n return (<any>window.getComputedStyle(element))[prop];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {invalidExpression, invalidTransitionAlias} from '../error_helpers';\n\nexport const ANY_STATE = '*';\nexport declare type TransitionMatcherFn =\n (fromState: any, toState: any, element: any, params: {[key: string]: any}) => boolean;\n\nexport function parseTransitionExpr(\n transitionValue: string|TransitionMatcherFn, errors: Error[]): TransitionMatcherFn[] {\n const expressions: TransitionMatcherFn[] = [];\n if (typeof transitionValue == 'string') {\n transitionValue.split(/\\s*,\\s*/).forEach(\n str => parseInnerTransitionStr(str, expressions, errors));\n } else {\n expressions.push(<TransitionMatcherFn>transitionValue);\n }\n return expressions;\n}\n\nfunction parseInnerTransitionStr(\n eventStr: string, expressions: TransitionMatcherFn[], errors: Error[]) {\n if (eventStr[0] == ':') {\n const result = parseAnimationAlias(eventStr, errors);\n if (typeof result == 'function') {\n expressions.push(result);\n return;\n }\n eventStr = result;\n }\n\n const match = eventStr.match(/^(\\*|[-\\w]+)\\s*(<?[=-]>)\\s*(\\*|[-\\w]+)$/);\n if (match == null || match.length < 4) {\n errors.push(invalidExpression(eventStr));\n return expressions;\n }\n\n const fromState = match[1];\n const separator = match[2];\n const toState = match[3];\n expressions.push(makeLambdaFromStates(fromState, toState));\n\n const isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;\n if (separator[0] == '<' && !isFullAnyStateExpr) {\n expressions.push(makeLambdaFromStates(toState, fromState));\n }\n}\n\nfunction parseAnimationAlias(alias: string, errors: Error[]): string|TransitionMatcherFn {\n switch (alias) {\n case ':enter':\n return 'void => *';\n case ':leave':\n return '* => void';\n case ':increment':\n return (fromState: any, toState: any): boolean => parseFloat(toState) > parseFloat(fromState);\n case ':decrement':\n return (fromState: any, toState: any): boolean => parseFloat(toState) < parseFloat(fromState);\n default:\n errors.push(invalidTransitionAlias(alias));\n return '* => *';\n }\n}\n\n// DO NOT REFACTOR ... keep the follow set instantiations\n// with the values intact (closure compiler for some reason\n// removes follow-up lines that add the values outside of\n// the constructor...\nconst TRUE_BOOLEAN_VALUES = new Set<string>(['true', '1']);\nconst FALSE_BOOLEAN_VALUES = new Set<string>(['false', '0']);\n\nfunction makeLambdaFromStates(lhs: string, rhs: string): TransitionMatcherFn {\n const LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);\n const RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);\n\n return (fromState: any, toState: any): boolean => {\n let lhsMatch = lhs == ANY_STATE || lhs == fromState;\n let rhsMatch = rhs == ANY_STATE || rhs == toState;\n\n if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {\n lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);\n }\n if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {\n rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);\n }\n\n return lhsMatch && rhsMatch;\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimateTimings, AnimationAnimateChildMetadata, AnimationAnimateMetadata, AnimationAnimateRefMetadata, AnimationGroupMetadata, AnimationKeyframesSequenceMetadata, AnimationMetadata, AnimationMetadataType, AnimationOptions, AnimationQueryMetadata, AnimationQueryOptions, AnimationReferenceMetadata, AnimationSequenceMetadata, AnimationStaggerMetadata, AnimationStateMetadata, AnimationStyleMetadata, AnimationTransitionMetadata, AnimationTriggerMetadata, AUTO_STYLE, style, ɵStyleDataMap} from '@angular/animations';\n\nimport {invalidDefinition, invalidKeyframes, invalidOffset, invalidParallelAnimation, invalidProperty, invalidStagger, invalidState, invalidStyleValue, invalidTrigger, keyframeOffsetsOutOfOrder, keyframesMissingOffsets} from '../error_helpers';\nimport {AnimationDriver} from '../render/animation_driver';\nimport {getOrSetDefaultValue} from '../render/shared';\nimport {convertToMap, copyObj, extractStyleParams, iteratorToArray, NG_ANIMATING_SELECTOR, NG_TRIGGER_SELECTOR, normalizeAnimationEntry, resolveTiming, SUBSTITUTION_EXPR_START, validateStyleParams, visitDslNode} from '../util';\nimport {pushUnrecognizedPropertiesWarning} from '../warning_helpers';\n\nimport {AnimateAst, AnimateChildAst, AnimateRefAst, Ast, DynamicTimingAst, GroupAst, KeyframesAst, QueryAst, ReferenceAst, SequenceAst, StaggerAst, StateAst, StyleAst, TimingAst, TransitionAst, TriggerAst} from './animation_ast';\nimport {AnimationDslVisitor} from './animation_dsl_visitor';\nimport {parseTransitionExpr} from './animation_transition_expr';\n\nconst SELF_TOKEN = ':self';\nconst SELF_TOKEN_REGEX = new RegExp(`\\s*${SELF_TOKEN}\\s*,?`, 'g');\n\n/*\n * [Validation]\n * The visitor code below will traverse the animation AST generated by the animation verb functions\n * (the output is a tree of objects) and attempt to perform a series of validations on the data. The\n * following corner-cases will be validated:\n *\n * 1. Overlap of animations\n * Given that a CSS property cannot be animated in more than one place at the same time, it's\n * important that this behavior is detected and validated. The way in which this occurs is that\n * each time a style property is examined, a string-map containing the property will be updated with\n * the start and end times for when the property is used within an animation step.\n *\n * If there are two or more parallel animations that are currently running (these are invoked by the\n * group()) on the same element then the validator will throw an error. Since the start/end timing\n * values are collected for each property then if the current animation step is animating the same\n * property and its timing values fall anywhere into the window of time that the property is\n * currently being animated within then this is what causes an error.\n *\n * 2. Timing values\n * The validator will validate to see if a timing value of `duration delay easing` or\n * `durationNumber` is valid or not.\n *\n * (note that upon validation the code below will replace the timing data with an object containing\n * {duration,delay,easing}.\n *\n * 3. Offset Validation\n * Each of the style() calls are allowed to have an offset value when placed inside of keyframes().\n * Offsets within keyframes() are considered valid when:\n *\n * - No offsets are used at all\n * - Each style() entry contains an offset value\n * - Each offset is between 0 and 1\n * - Each offset is greater to or equal than the previous one\n *\n * Otherwise an error will be thrown.\n */\nexport function buildAnimationAst(\n driver: AnimationDriver, metadata: AnimationMetadata|AnimationMetadata[], errors: Error[],\n warnings: string[]): Ast<AnimationMetadataType> {\n return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings);\n}\n\nconst ROOT_SELECTOR = '';\n\nexport class AnimationAstBuilderVisitor implements AnimationDslVisitor {\n constructor(private _driver: AnimationDriver) {}\n\n build(metadata: AnimationMetadata|AnimationMetadata[], errors: Error[], warnings: string[]):\n Ast<AnimationMetadataType> {\n const context = new AnimationAstBuilderContext(errors);\n this._resetContextStyleTimingState(context);\n const ast =\n <Ast<AnimationMetadataType>>visitDslNode(this, normalizeAnimationEntry(metadata), context);\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (context.unsupportedCSSPropertiesFound.size) {\n pushUnrecognizedPropertiesWarning(\n warnings,\n [...context.unsupportedCSSPropertiesFound.keys()],\n );\n }\n }\n\n return ast;\n }\n\n private _resetContextStyleTimingState(context: AnimationAstBuilderContext) {\n context.currentQuerySelector = ROOT_SELECTOR;\n context.collectedStyles = new Map<string, Map<string, StyleTimeTuple>>();\n context.collectedStyles.set(ROOT_SELECTOR, new Map());\n context.currentTime = 0;\n }\n\n visitTrigger(metadata: AnimationTriggerMetadata, context: AnimationAstBuilderContext):\n TriggerAst {\n let queryCount = context.queryCount = 0;\n let depCount = context.depCount = 0;\n const states: StateAst[] = [];\n const transitions: TransitionAst[] = [];\n if (metadata.name.charAt(0) == '@') {\n context.errors.push(invalidTrigger());\n }\n\n metadata.definitions.forEach(def => {\n this._resetContextStyleTimingState(context);\n if (def.type == AnimationMetadataType.State) {\n const stateDef = def as AnimationStateMetadata;\n const name = stateDef.name;\n name.toString().split(/\\s*,\\s*/).forEach(n => {\n stateDef.name = n;\n states.push(this.visitState(stateDef, context));\n });\n stateDef.name = name;\n } else if (def.type == AnimationMetadataType.Transition) {\n const transition = this.visitTransition(def as AnimationTransitionMetadata, context);\n queryCount += transition.queryCount;\n depCount += transition.depCount;\n transitions.push(transition);\n } else {\n context.errors.push(invalidDefinition());\n }\n });\n\n return {\n type: AnimationMetadataType.Trigger,\n name: metadata.name,\n states,\n transitions,\n queryCount,\n depCount,\n options: null\n };\n }\n\n visitState(metadata: AnimationStateMetadata, context: AnimationAstBuilderContext): StateAst {\n const styleAst = this.visitStyle(metadata.styles, context);\n const astParams = (metadata.options && metadata.options.params) || null;\n if (styleAst.containsDynamicStyles) {\n const missingSubs = new Set<string>();\n const params = astParams || {};\n styleAst.styles.forEach(style => {\n if (style instanceof Map) {\n style.forEach(value => {\n extractStyleParams(value).forEach(sub => {\n if (!params.hasOwnProperty(sub)) {\n missingSubs.add(sub);\n }\n });\n });\n }\n });\n if (missingSubs.size) {\n const missingSubsArr = iteratorToArray(missingSubs.values());\n context.errors.push(invalidState(metadata.name, missingSubsArr));\n }\n }\n\n return {\n type: AnimationMetadataType.State,\n name: metadata.name,\n style: styleAst,\n options: astParams ? {params: astParams} : null\n };\n }\n\n visitTransition(metadata: AnimationTransitionMetadata, context: AnimationAstBuilderContext):\n TransitionAst {\n context.queryCount = 0;\n context.depCount = 0;\n const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);\n const matchers = parseTransitionExpr(metadata.expr, context.errors);\n\n return {\n type: AnimationMetadataType.Transition,\n matchers,\n animation,\n queryCount: context.queryCount,\n depCount: context.depCount,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitSequence(metadata: AnimationSequenceMetadata, context: AnimationAstBuilderContext):\n SequenceAst {\n return {\n type: AnimationMetadataType.Sequence,\n steps: metadata.steps.map(s => visitDslNode(this, s, context)),\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitGroup(metadata: AnimationGroupMetadata, context: AnimationAstBuilderContext): GroupAst {\n const currentTime = context.currentTime;\n let furthestTime = 0;\n const steps = metadata.steps.map(step => {\n context.currentTime = currentTime;\n const innerAst = visitDslNode(this, step, context);\n furthestTime = Math.max(furthestTime, context.currentTime);\n return innerAst;\n });\n\n context.currentTime = furthestTime;\n return {\n type: AnimationMetadataType.Group,\n steps,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitAnimate(metadata: AnimationAnimateMetadata, context: AnimationAstBuilderContext):\n AnimateAst {\n const timingAst = constructTimingAst(metadata.timings, context.errors);\n context.currentAnimateTimings = timingAst;\n let styleAst: StyleAst|KeyframesAst;\n let styleMetadata: AnimationStyleMetadata|AnimationKeyframesSequenceMetadata =\n metadata.styles ? metadata.styles : style({});\n if (styleMetadata.type == AnimationMetadataType.Keyframes) {\n styleAst = this.visitKeyframes(styleMetadata as AnimationKeyframesSequenceMetadata, context);\n } else {\n let styleMetadata = metadata.styles as AnimationStyleMetadata;\n let isEmpty = false;\n if (!styleMetadata) {\n isEmpty = true;\n const newStyleData: {[prop: string]: string|number} = {};\n if (timingAst.easing) {\n newStyleData['easing'] = timingAst.easing;\n }\n styleMetadata = style(newStyleData);\n }\n context.currentTime += timingAst.duration + timingAst.delay;\n const _styleAst = this.visitStyle(styleMetadata, context);\n _styleAst.isEmptyStep = isEmpty;\n styleAst = _styleAst;\n }\n\n context.currentAnimateTimings = null;\n return {\n type: AnimationMetadataType.Animate,\n timings: timingAst,\n style: styleAst,\n options: null\n };\n }\n\n visitStyle(metadata: AnimationStyleMetadata, context: AnimationAstBuilderContext): StyleAst {\n const ast = this._makeStyleAst(metadata, context);\n this._validateStyleAst(ast, context);\n return ast;\n }\n\n private _makeStyleAst(metadata: AnimationStyleMetadata, context: AnimationAstBuilderContext):\n StyleAst {\n const styles: Array<(ɵStyleDataMap | string)> = [];\n const metadataStyles = Array.isArray(metadata.styles) ? metadata.styles : [metadata.styles];\n\n for (let styleTuple of metadataStyles) {\n if (typeof styleTuple === 'string') {\n if (styleTuple === AUTO_STYLE) {\n styles.push(styleTuple);\n } else {\n context.errors.push(invalidStyleValue(styleTuple));\n }\n } else {\n styles.push(convertToMap(styleTuple));\n }\n }\n\n let containsDynamicStyles = false;\n let collectedEasing: string|null = null;\n styles.forEach(styleData => {\n if (styleData instanceof Map) {\n if (styleData.has('easing')) {\n collectedEasing = styleData.get('easing') as string;\n styleData.delete('easing');\n }\n if (!containsDynamicStyles) {\n for (let value of styleData.values()) {\n if (value!.toString().indexOf(SUBSTITUTION_EXPR_START) >= 0) {\n containsDynamicStyles = true;\n break;\n }\n }\n }\n }\n });\n\n return {\n type: AnimationMetadataType.Style,\n styles,\n easing: collectedEasing,\n offset: metadata.offset,\n containsDynamicStyles,\n options: null\n };\n }\n\n private _validateStyleAst(ast: StyleAst, context: AnimationAstBuilderContext): void {\n const timings = context.currentAnimateTimings;\n let endTime = context.currentTime;\n let startTime = context.currentTime;\n if (timings && startTime > 0) {\n startTime -= timings.duration + timings.delay;\n }\n\n ast.styles.forEach(tuple => {\n if (typeof tuple === 'string') return;\n\n tuple.forEach((value, prop) => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._driver.validateStyleProperty(prop)) {\n tuple.delete(prop);\n context.unsupportedCSSPropertiesFound.add(prop);\n return;\n }\n }\n\n // This is guaranteed to have a defined Map at this querySelector location making it\n // safe to add the assertion here. It is set as a default empty map in prior methods.\n const collectedStyles = context.collectedStyles.get(context.currentQuerySelector!)!;\n const collectedEntry = collectedStyles.get(prop);\n let updateCollectedStyle = true;\n if (collectedEntry) {\n if (startTime != endTime && startTime >= collectedEntry.startTime &&\n endTime <= collectedEntry.endTime) {\n context.errors.push(invalidParallelAnimation(\n prop, collectedEntry.startTime, collectedEntry.endTime, startTime, endTime));\n updateCollectedStyle = false;\n }\n\n // we always choose the smaller start time value since we\n // want to have a record of the entire animation window where\n // the style property is being animated in between\n startTime = collectedEntry.startTime;\n }\n\n if (updateCollectedStyle) {\n collectedStyles.set(prop, {startTime, endTime});\n }\n\n if (context.options) {\n validateStyleParams(value, context.options, context.errors);\n }\n });\n });\n }\n\n visitKeyframes(metadata: AnimationKeyframesSequenceMetadata, context: AnimationAstBuilderContext):\n KeyframesAst {\n const ast: KeyframesAst = {type: AnimationMetadataType.Keyframes, styles: [], options: null};\n if (!context.currentAnimateTimings) {\n context.errors.push(invalidKeyframes());\n return ast;\n }\n\n const MAX_KEYFRAME_OFFSET = 1;\n\n let totalKeyframesWithOffsets = 0;\n const offsets: number[] = [];\n let offsetsOutOfOrder = false;\n let keyframesOutOfRange = false;\n let previousOffset: number = 0;\n\n const keyframes: StyleAst[] = metadata.steps.map(styles => {\n const style = this._makeStyleAst(styles, context);\n let offsetVal: number|null =\n style.offset != null ? style.offset : consumeOffset(style.styles);\n let offset: number = 0;\n if (offsetVal != null) {\n totalKeyframesWithOffsets++;\n offset = style.offset = offsetVal;\n }\n keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1;\n offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset;\n previousOffset = offset;\n offsets.push(offset);\n return style;\n });\n\n if (keyframesOutOfRange) {\n context.errors.push(invalidOffset());\n }\n\n if (offsetsOutOfOrder) {\n context.errors.push(keyframeOffsetsOutOfOrder());\n }\n\n const length = metadata.steps.length;\n let generatedOffset = 0;\n if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {\n context.errors.push(keyframesMissingOffsets());\n } else if (totalKeyframesWithOffsets == 0) {\n generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);\n }\n\n const limit = length - 1;\n const currentTime = context.currentTime;\n const currentAnimateTimings = context.currentAnimateTimings!;\n const animateDuration = currentAnimateTimings.duration;\n keyframes.forEach((kf, i) => {\n const offset = generatedOffset > 0 ? (i == limit ? 1 : (generatedOffset * i)) : offsets[i];\n const durationUpToThisFrame = offset * animateDuration;\n context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;\n currentAnimateTimings.duration = durationUpToThisFrame;\n this._validateStyleAst(kf, context);\n kf.offset = offset;\n\n ast.styles.push(kf);\n });\n\n return ast;\n }\n\n visitReference(metadata: AnimationReferenceMetadata, context: AnimationAstBuilderContext):\n ReferenceAst {\n return {\n type: AnimationMetadataType.Reference,\n animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitAnimateChild(metadata: AnimationAnimateChildMetadata, context: AnimationAstBuilderContext):\n AnimateChildAst {\n context.depCount++;\n return {\n type: AnimationMetadataType.AnimateChild,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitAnimateRef(metadata: AnimationAnimateRefMetadata, context: AnimationAstBuilderContext):\n AnimateRefAst {\n return {\n type: AnimationMetadataType.AnimateRef,\n animation: this.visitReference(metadata.animation, context),\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitQuery(metadata: AnimationQueryMetadata, context: AnimationAstBuilderContext): QueryAst {\n const parentSelector = context.currentQuerySelector!;\n const options = (metadata.options || {}) as AnimationQueryOptions;\n\n context.queryCount++;\n context.currentQuery = metadata;\n const [selector, includeSelf] = normalizeSelector(metadata.selector);\n context.currentQuerySelector =\n parentSelector.length ? (parentSelector + ' ' + selector) : selector;\n getOrSetDefaultValue(context.collectedStyles, context.currentQuerySelector, new Map());\n\n const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);\n context.currentQuery = null;\n context.currentQuerySelector = parentSelector;\n\n return {\n type: AnimationMetadataType.Query,\n selector,\n limit: options.limit || 0,\n optional: !!options.optional,\n includeSelf,\n animation,\n originalSelector: metadata.selector,\n options: normalizeAnimationOptions(metadata.options)\n };\n }\n\n visitStagger(metadata: AnimationStaggerMetadata, context: AnimationAstBuilderContext):\n StaggerAst {\n if (!context.currentQuery) {\n context.errors.push(invalidStagger());\n }\n const timings = metadata.timings === 'full' ?\n {duration: 0, delay: 0, easing: 'full'} :\n resolveTiming(metadata.timings, context.errors, true);\n\n return {\n type: AnimationMetadataType.Stagger,\n animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),\n timings,\n options: null\n };\n }\n}\n\nfunction normalizeSelector(selector: string): [string, boolean] {\n const hasAmpersand = selector.split(/\\s*,\\s*/).find(token => token == SELF_TOKEN) ? true : false;\n if (hasAmpersand) {\n selector = selector.replace(SELF_TOKEN_REGEX, '');\n }\n\n // Note: the :enter and :leave aren't normalized here since those\n // selectors are filled in at runtime during timeline building\n selector = selector.replace(/@\\*/g, NG_TRIGGER_SELECTOR)\n .replace(/@\\w+/g, match => NG_TRIGGER_SELECTOR + '-' + match.slice(1))\n .replace(/:animating/g, NG_ANIMATING_SELECTOR);\n\n return [selector, hasAmpersand];\n}\n\n\nfunction normalizeParams(obj: {[key: string]: any}|any): {[key: string]: any}|null {\n return obj ? copyObj(obj) : null;\n}\n\nexport type StyleTimeTuple = {\n startTime: number; endTime: number;\n};\n\nexport class AnimationAstBuilderContext {\n public queryCount: number = 0;\n public depCount: number = 0;\n public currentTransition: AnimationTransitionMetadata|null = null;\n public currentQuery: AnimationQueryMetadata|null = null;\n public currentQuerySelector: string|null = null;\n public currentAnimateTimings: TimingAst|null = null;\n public currentTime: number = 0;\n public collectedStyles = new Map<string, Map<string, StyleTimeTuple>>();\n public options: AnimationOptions|null = null;\n public unsupportedCSSPropertiesFound: Set<string> = new Set<string>();\n constructor(public errors: Error[]) {}\n}\n\ntype OffsetStyles = string|ɵStyleDataMap;\n\nfunction consumeOffset(styles: OffsetStyles|Array<OffsetStyles>): number|null {\n if (typeof styles == 'string') return null;\n\n let offset: number|null = null;\n\n if (Array.isArray(styles)) {\n styles.forEach(styleTuple => {\n if (styleTuple instanceof Map && styleTuple.has('offset')) {\n const obj = styleTuple as ɵStyleDataMap;\n offset = parseFloat(obj.get('offset') as string);\n obj.delete('offset');\n }\n });\n } else if (styles instanceof Map && styles.has('offset')) {\n const obj = styles;\n offset = parseFloat(obj.get('offset') as string);\n obj.delete('offset');\n }\n return offset;\n}\n\nfunction constructTimingAst(value: string|number|AnimateTimings, errors: Error[]) {\n if (value.hasOwnProperty('duration')) {\n return value as AnimateTimings;\n }\n\n if (typeof value == 'number') {\n const duration = resolveTiming(value, errors).duration;\n return makeTimingAst(duration, 0, '');\n }\n\n const strValue = value as string;\n const isDynamic = strValue.split(/\\s+/).some(v => v.charAt(0) == '{' && v.charAt(1) == '{');\n if (isDynamic) {\n const ast = makeTimingAst(0, 0, '') as any;\n ast.dynamic = true;\n ast.strValue = strValue;\n return ast as DynamicTimingAst;\n }\n\n const timings = resolveTiming(strValue, errors);\n return makeTimingAst(timings.duration, timings.delay, timings.easing);\n}\n\nfunction normalizeAnimationOptions(options: AnimationOptions|null): AnimationOptions {\n if (options) {\n options = copyObj(options);\n if (options['params']) {\n options['params'] = normalizeParams(options['params'])!;\n }\n } else {\n options = {};\n }\n return options;\n}\n\nfunction makeTimingAst(duration: number, delay: number, easing: string|null): TimingAst {\n return {duration, delay, easing};\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ɵStyleDataMap} from '@angular/animations';\n\nimport {AnimationEngineInstruction, AnimationTransitionInstructionType} from '../render/animation_engine_instruction';\n\nexport interface AnimationTimelineInstruction extends AnimationEngineInstruction {\n element: any;\n keyframes: Array<ɵStyleDataMap>;\n preStyleProps: string[];\n postStyleProps: string[];\n duration: number;\n delay: number;\n totalTime: number;\n easing: string|null;\n stretchStartingKeyframe?: boolean;\n subTimeline: boolean;\n}\n\nexport function createTimelineInstruction(\n element: any, keyframes: Array<ɵStyleDataMap>, preStyleProps: string[],\n postStyleProps: string[], duration: number, delay: number, easing: string|null = null,\n subTimeline: boolean = false): AnimationTimelineInstruction {\n return {\n type: AnimationTransitionInstructionType.TimelineAnimation,\n element,\n keyframes,\n preStyleProps,\n postStyleProps,\n duration,\n delay,\n totalTime: duration + delay,\n easing,\n subTimeline\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationTimelineInstruction} from './animation_timeline_instruction';\n\nexport class ElementInstructionMap {\n private _map = new Map<any, AnimationTimelineInstruction[]>();\n\n get(element: any): AnimationTimelineInstruction[] {\n return this._map.get(element) || [];\n }\n\n append(element: any, instructions: AnimationTimelineInstruction[]) {\n let existingInstructions = this._map.get(element);\n if (!existingInstructions) {\n this._map.set(element, existingInstructions = []);\n }\n existingInstructions.push(...instructions);\n }\n\n has(element: any): boolean {\n return this._map.has(element);\n }\n\n clear() {\n this._map.clear();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimateChildOptions, AnimateTimings, AnimationMetadataType, AnimationOptions, AnimationQueryOptions, AUTO_STYLE, ɵPRE_STYLE as PRE_STYLE, ɵStyleDataMap} from '@angular/animations';\n\nimport {invalidQuery} from '../error_helpers';\nimport {AnimationDriver} from '../render/animation_driver';\nimport {copyStyles, interpolateParams, iteratorToArray, resolveTiming, resolveTimingValue, visitDslNode} from '../util';\n\nimport {AnimateAst, AnimateChildAst, AnimateRefAst, Ast, AstVisitor, DynamicTimingAst, GroupAst, KeyframesAst, QueryAst, ReferenceAst, SequenceAst, StaggerAst, StateAst, StyleAst, TimingAst, TransitionAst, TriggerAst} from './animation_ast';\nimport {AnimationTimelineInstruction, createTimelineInstruction} from './animation_timeline_instruction';\nimport {ElementInstructionMap} from './element_instruction_map';\n\nconst ONE_FRAME_IN_MILLISECONDS = 1;\nconst ENTER_TOKEN = ':enter';\nconst ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, 'g');\nconst LEAVE_TOKEN = ':leave';\nconst LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');\n\n/*\n * The code within this file aims to generate web-animations-compatible keyframes from Angular's\n * animation DSL code.\n *\n * The code below will be converted from:\n *\n * ```\n * sequence([\n * style({ opacity: 0 }),\n * animate(1000, style({ opacity: 0 }))\n * ])\n * ```\n *\n * To:\n * ```\n * keyframes = [{ opacity: 0, offset: 0 }, { opacity: 1, offset: 1 }]\n * duration = 1000\n * delay = 0\n * easing = ''\n * ```\n *\n * For this operation to cover the combination of animation verbs (style, animate, group, etc...) a\n * combination of AST traversal and merge-sort-like algorithms are used.\n *\n * [AST Traversal]\n * Each of the animation verbs, when executed, will return an string-map object representing what\n * type of action it is (style, animate, group, etc...) and the data associated with it. This means\n * that when functional composition mix of these functions is evaluated (like in the example above)\n * then it will end up producing a tree of objects representing the animation itself.\n *\n * When this animation object tree is processed by the visitor code below it will visit each of the\n * verb statements within the visitor. And during each visit it will build the context of the\n * animation keyframes by interacting with the `TimelineBuilder`.\n *\n * [TimelineBuilder]\n * This class is responsible for tracking the styles and building a series of keyframe objects for a\n * timeline between a start and end time. The builder starts off with an initial timeline and each\n * time the AST comes across a `group()`, `keyframes()` or a combination of the two within a\n * `sequence()` then it will generate a sub timeline for each step as well as a new one after\n * they are complete.\n *\n * As the AST is traversed, the timing state on each of the timelines will be incremented. If a sub\n * timeline was created (based on one of the cases above) then the parent timeline will attempt to\n * merge the styles used within the sub timelines into itself (only with group() this will happen).\n * This happens with a merge operation (much like how the merge works in mergeSort) and it will only\n * copy the most recently used styles from the sub timelines into the parent timeline. This ensures\n * that if the styles are used later on in another phase of the animation then they will be the most\n * up-to-date values.\n *\n * [How Missing Styles Are Updated]\n * Each timeline has a `backFill` property which is responsible for filling in new styles into\n * already processed keyframes if a new style shows up later within the animation sequence.\n *\n * ```\n * sequence([\n * style({ width: 0 }),\n * animate(1000, style({ width: 100 })),\n * animate(1000, style({ width: 200 })),\n * animate(1000, style({ width: 300 }))\n * animate(1000, style({ width: 400, height: 400 })) // notice how `height` doesn't exist anywhere\n * else\n * ])\n * ```\n *\n * What is happening here is that the `height` value is added later in the sequence, but is missing\n * from all previous animation steps. Therefore when a keyframe is created it would also be missing\n * from all previous keyframes up until where it is first used. For the timeline keyframe generation\n * to properly fill in the style it will place the previous value (the value from the parent\n * timeline) or a default value of `*` into the backFill map. The `copyStyles` method in util.ts\n * handles propagating that backfill map to the styles object.\n *\n * When a sub-timeline is created it will have its own backFill property. This is done so that\n * styles present within the sub-timeline do not accidentally seep into the previous/future timeline\n * keyframes\n *\n * [Validation]\n * The code in this file is not responsible for validation. That functionality happens with within\n * the `AnimationValidatorVisitor` code.\n */\nexport function buildAnimationTimelines(\n driver: AnimationDriver, rootElement: any, ast: Ast<AnimationMetadataType>,\n enterClassName: string, leaveClassName: string, startingStyles: ɵStyleDataMap = new Map(),\n finalStyles: ɵStyleDataMap = new Map(), options: AnimationOptions,\n subInstructions?: ElementInstructionMap, errors: Error[] = []): AnimationTimelineInstruction[] {\n return new AnimationTimelineBuilderVisitor().buildKeyframes(\n driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles,\n options, subInstructions, errors);\n}\n\nexport class AnimationTimelineBuilderVisitor implements AstVisitor {\n buildKeyframes(\n driver: AnimationDriver, rootElement: any, ast: Ast<AnimationMetadataType>,\n enterClassName: string, leaveClassName: string, startingStyles: ɵStyleDataMap,\n finalStyles: ɵStyleDataMap, options: AnimationOptions,\n subInstructions?: ElementInstructionMap,\n errors: Error[] = []): AnimationTimelineInstruction[] {\n subInstructions = subInstructions || new ElementInstructionMap();\n const context = new AnimationTimelineContext(\n driver, rootElement, subInstructions, enterClassName, leaveClassName, errors, []);\n context.options = options;\n const delay = options.delay ? resolveTimingValue(options.delay) : 0;\n context.currentTimeline.delayNextStep(delay);\n context.currentTimeline.setStyles([startingStyles], null, context.errors, options);\n\n visitDslNode(this, ast, context);\n\n // this checks to see if an actual animation happened\n const timelines = context.timelines.filter(timeline => timeline.containsAnimation());\n\n // note: we just want to apply the final styles for the rootElement, so we do not\n // just apply the styles to the last timeline but the last timeline which\n // element is the root one (basically `*`-styles are replaced with the actual\n // state style values only for the root element)\n if (timelines.length && finalStyles.size) {\n let lastRootTimeline: TimelineBuilder|undefined;\n for (let i = timelines.length - 1; i >= 0; i--) {\n const timeline = timelines[i];\n if (timeline.element === rootElement) {\n lastRootTimeline = timeline;\n break;\n }\n }\n if (lastRootTimeline && !lastRootTimeline.allowOnlyTimelineStyles()) {\n lastRootTimeline.setStyles([finalStyles], null, context.errors, options);\n }\n }\n return timelines.length ?\n timelines.map(timeline => timeline.buildKeyframes()) :\n [createTimelineInstruction(rootElement, [], [], [], 0, delay, '', false)];\n }\n\n visitTrigger(ast: TriggerAst, context: AnimationTimelineContext): any {\n // these values are not visited in this AST\n }\n\n visitState(ast: StateAst, context: AnimationTimelineContext): any {\n // these values are not visited in this AST\n }\n\n visitTransition(ast: TransitionAst, context: AnimationTimelineContext): any {\n // these values are not visited in this AST\n }\n\n visitAnimateChild(ast: AnimateChildAst, context: AnimationTimelineContext): any {\n const elementInstructions = context.subInstructions.get(context.element);\n if (elementInstructions) {\n const innerContext = context.createSubContext(ast.options);\n const startTime = context.currentTimeline.currentTime;\n const endTime = this._visitSubInstructions(\n elementInstructions, innerContext, innerContext.options as AnimateChildOptions);\n if (startTime != endTime) {\n // we do this on the upper context because we created a sub context for\n // the sub child animations\n context.transformIntoNewTimeline(endTime);\n }\n }\n context.previousNode = ast;\n }\n\n visitAnimateRef(ast: AnimateRefAst, context: AnimationTimelineContext): any {\n const innerContext = context.createSubContext(ast.options);\n innerContext.transformIntoNewTimeline();\n this._applyAnimationRefDelays([ast.options, ast.animation.options], context, innerContext);\n this.visitReference(ast.animation, innerContext);\n context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);\n context.previousNode = ast;\n }\n\n private _applyAnimationRefDelays(\n animationsRefsOptions: (AnimationOptions|null)[], context: AnimationTimelineContext,\n innerContext: AnimationTimelineContext) {\n for (const animationRefOptions of animationsRefsOptions) {\n const animationDelay = animationRefOptions?.delay;\n if (animationDelay) {\n const animationDelayValue = typeof animationDelay === 'number' ?\n animationDelay :\n resolveTimingValue(interpolateParams(\n animationDelay, animationRefOptions?.params ?? {}, context.errors));\n innerContext.delayNextStep(animationDelayValue);\n }\n }\n }\n\n private _visitSubInstructions(\n instructions: AnimationTimelineInstruction[], context: AnimationTimelineContext,\n options: AnimateChildOptions): number {\n const startTime = context.currentTimeline.currentTime;\n let furthestTime = startTime;\n\n // this is a special-case for when a user wants to skip a sub\n // animation from being fired entirely.\n const duration = options.duration != null ? resolveTimingValue(options.duration) : null;\n const delay = options.delay != null ? resolveTimingValue(options.delay) : null;\n if (duration !== 0) {\n instructions.forEach(instruction => {\n const instructionTimings =\n context.appendInstructionToTimeline(instruction, duration, delay);\n furthestTime =\n Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);\n });\n }\n\n return furthestTime;\n }\n\n visitReference(ast: ReferenceAst, context: AnimationTimelineContext) {\n context.updateOptions(ast.options, true);\n visitDslNode(this, ast.animation, context);\n context.previousNode = ast;\n }\n\n visitSequence(ast: SequenceAst, context: AnimationTimelineContext) {\n const subContextCount = context.subContextCount;\n let ctx = context;\n const options = ast.options;\n\n if (options && (options.params || options.delay)) {\n ctx = context.createSubContext(options);\n ctx.transformIntoNewTimeline();\n\n if (options.delay != null) {\n if (ctx.previousNode.type == AnimationMetadataType.Style) {\n ctx.currentTimeline.snapshotCurrentStyles();\n ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n }\n\n const delay = resolveTimingValue(options.delay);\n ctx.delayNextStep(delay);\n }\n }\n\n if (ast.steps.length) {\n ast.steps.forEach(s => visitDslNode(this, s, ctx));\n\n // this is here just in case the inner steps only contain or end with a style() call\n ctx.currentTimeline.applyStylesToKeyframe();\n\n // this means that some animation function within the sequence\n // ended up creating a sub timeline (which means the current\n // timeline cannot overlap with the contents of the sequence)\n if (ctx.subContextCount > subContextCount) {\n ctx.transformIntoNewTimeline();\n }\n }\n\n context.previousNode = ast;\n }\n\n visitGroup(ast: GroupAst, context: AnimationTimelineContext) {\n const innerTimelines: TimelineBuilder[] = [];\n let furthestTime = context.currentTimeline.currentTime;\n const delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;\n\n ast.steps.forEach(s => {\n const innerContext = context.createSubContext(ast.options);\n if (delay) {\n innerContext.delayNextStep(delay);\n }\n\n visitDslNode(this, s, innerContext);\n furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);\n innerTimelines.push(innerContext.currentTimeline);\n });\n\n // this operation is run after the AST loop because otherwise\n // if the parent timeline's collected styles were updated then\n // it would pass in invalid data into the new-to-be forked items\n innerTimelines.forEach(\n timeline => context.currentTimeline.mergeTimelineCollectedStyles(timeline));\n context.transformIntoNewTimeline(furthestTime);\n context.previousNode = ast;\n }\n\n private _visitTiming(ast: TimingAst, context: AnimationTimelineContext): AnimateTimings {\n if ((ast as DynamicTimingAst).dynamic) {\n const strValue = (ast as DynamicTimingAst).strValue;\n const timingValue =\n context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;\n return resolveTiming(timingValue, context.errors);\n } else {\n return {duration: ast.duration, delay: ast.delay, easing: ast.easing};\n }\n }\n\n visitAnimate(ast: AnimateAst, context: AnimationTimelineContext) {\n const timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);\n const timeline = context.currentTimeline;\n if (timings.delay) {\n context.incrementTime(timings.delay);\n timeline.snapshotCurrentStyles();\n }\n\n const style = ast.style;\n if (style.type == AnimationMetadataType.Keyframes) {\n this.visitKeyframes(style, context);\n } else {\n context.incrementTime(timings.duration);\n this.visitStyle(style as StyleAst, context);\n timeline.applyStylesToKeyframe();\n }\n\n context.currentAnimateTimings = null;\n context.previousNode = ast;\n }\n\n visitStyle(ast: StyleAst, context: AnimationTimelineContext) {\n const timeline = context.currentTimeline;\n const timings = context.currentAnimateTimings!;\n\n // this is a special case for when a style() call\n // directly follows an animate() call (but not inside of an animate() call)\n if (!timings && timeline.hasCurrentStyleProperties()) {\n timeline.forwardFrame();\n }\n\n const easing = (timings && timings.easing) || ast.easing;\n if (ast.isEmptyStep) {\n timeline.applyEmptyStep(easing);\n } else {\n timeline.setStyles(ast.styles, easing, context.errors, context.options);\n }\n\n context.previousNode = ast;\n }\n\n visitKeyframes(ast: KeyframesAst, context: AnimationTimelineContext) {\n const currentAnimateTimings = context.currentAnimateTimings!;\n const startTime = (context.currentTimeline!).duration;\n const duration = currentAnimateTimings.duration;\n const innerContext = context.createSubContext();\n const innerTimeline = innerContext.currentTimeline;\n innerTimeline.easing = currentAnimateTimings.easing;\n\n ast.styles.forEach(step => {\n const offset: number = step.offset || 0;\n innerTimeline.forwardTime(offset * duration);\n innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options);\n innerTimeline.applyStylesToKeyframe();\n });\n\n // this will ensure that the parent timeline gets all the styles from\n // the child even if the new timeline below is not used\n context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);\n\n // we do this because the window between this timeline and the sub timeline\n // should ensure that the styles within are exactly the same as they were before\n context.transformIntoNewTimeline(startTime + duration);\n context.previousNode = ast;\n }\n\n visitQuery(ast: QueryAst, context: AnimationTimelineContext) {\n // in the event that the first step before this is a style step we need\n // to ensure the styles are applied before the children are animated\n const startTime = context.currentTimeline.currentTime;\n const options = (ast.options || {}) as AnimationQueryOptions;\n const delay = options.delay ? resolveTimingValue(options.delay) : 0;\n\n if (delay &&\n (context.previousNode.type === AnimationMetadataType.Style ||\n (startTime == 0 && context.currentTimeline.hasCurrentStyleProperties()))) {\n context.currentTimeline.snapshotCurrentStyles();\n context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n }\n\n let furthestTime = startTime;\n const elms = context.invokeQuery(\n ast.selector, ast.originalSelector, ast.limit, ast.includeSelf,\n options.optional ? true : false, context.errors);\n\n context.currentQueryTotal = elms.length;\n let sameElementTimeline: TimelineBuilder|null = null;\n elms.forEach((element, i) => {\n context.currentQueryIndex = i;\n const innerContext = context.createSubContext(ast.options, element);\n if (delay) {\n innerContext.delayNextStep(delay);\n }\n\n if (element === context.element) {\n sameElementTimeline = innerContext.currentTimeline;\n }\n\n visitDslNode(this, ast.animation, innerContext);\n\n // this is here just incase the inner steps only contain or end\n // with a style() call (which is here to signal that this is a preparatory\n // call to style an element before it is animated again)\n innerContext.currentTimeline.applyStylesToKeyframe();\n\n const endTime = innerContext.currentTimeline.currentTime;\n furthestTime = Math.max(furthestTime, endTime);\n });\n\n context.currentQueryIndex = 0;\n context.currentQueryTotal = 0;\n context.transformIntoNewTimeline(furthestTime);\n\n if (sameElementTimeline) {\n context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);\n context.currentTimeline.snapshotCurrentStyles();\n }\n\n context.previousNode = ast;\n }\n\n visitStagger(ast: StaggerAst, context: AnimationTimelineContext) {\n const parentContext = context.parentContext!;\n const tl = context.currentTimeline;\n const timings = ast.timings;\n const duration = Math.abs(timings.duration);\n const maxTime = duration * (context.currentQueryTotal - 1);\n let delay = duration * context.currentQueryIndex;\n\n let staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing;\n switch (staggerTransformer) {\n case 'reverse':\n delay = maxTime - delay;\n break;\n case 'full':\n delay = parentContext.currentStaggerTime;\n break;\n }\n\n const timeline = context.currentTimeline;\n if (delay) {\n timeline.delayNextStep(delay);\n }\n\n const startingTime = timeline.currentTime;\n visitDslNode(this, ast.animation, context);\n context.previousNode = ast;\n\n // time = duration + delay\n // the reason why this computation is so complex is because\n // the inner timeline may either have a delay value or a stretched\n // keyframe depending on if a subtimeline is not used or is used.\n parentContext.currentStaggerTime =\n (tl.currentTime - startingTime) + (tl.startTime - parentContext.currentTimeline.startTime);\n }\n}\n\nexport declare type StyleAtTime = {\n time: number; value: string | number;\n};\n\nconst DEFAULT_NOOP_PREVIOUS_NODE = <Ast<AnimationMetadataType>>{};\nexport class AnimationTimelineContext {\n public parentContext: AnimationTimelineContext|null = null;\n public currentTimeline: TimelineBuilder;\n public currentAnimateTimings: AnimateTimings|null = null;\n public previousNode: Ast<AnimationMetadataType> = DEFAULT_NOOP_PREVIOUS_NODE;\n public subContextCount = 0;\n public options: AnimationOptions = {};\n public currentQueryIndex: number = 0;\n public currentQueryTotal: number = 0;\n public currentStaggerTime: number = 0;\n\n constructor(\n private _driver: AnimationDriver, public element: any,\n public subInstructions: ElementInstructionMap, private _enterClassName: string,\n private _leaveClassName: string, public errors: Error[], public timelines: TimelineBuilder[],\n initialTimeline?: TimelineBuilder) {\n this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0);\n timelines.push(this.currentTimeline);\n }\n\n get params() {\n return this.options.params;\n }\n\n updateOptions(options: AnimationOptions|null, skipIfExists?: boolean) {\n if (!options) return;\n\n const newOptions = options as any;\n let optionsToUpdate = this.options;\n\n // NOTE: this will get patched up when other animation methods support duration overrides\n if (newOptions.duration != null) {\n (optionsToUpdate as any).duration = resolveTimingValue(newOptions.duration);\n }\n\n if (newOptions.delay != null) {\n optionsToUpdate.delay = resolveTimingValue(newOptions.delay);\n }\n\n const newParams = newOptions.params;\n if (newParams) {\n let paramsToUpdate: {[name: string]: any} = optionsToUpdate.params!;\n if (!paramsToUpdate) {\n paramsToUpdate = this.options.params = {};\n }\n\n Object.keys(newParams).forEach(name => {\n if (!skipIfExists || !paramsToUpdate.hasOwnProperty(name)) {\n paramsToUpdate[name] = interpolateParams(newParams[name], paramsToUpdate, this.errors);\n }\n });\n }\n }\n\n private _copyOptions() {\n const options: AnimationOptions = {};\n if (this.options) {\n const oldParams = this.options.params;\n if (oldParams) {\n const params: {[name: string]: any} = options['params'] = {};\n Object.keys(oldParams).forEach(name => {\n params[name] = oldParams[name];\n });\n }\n }\n return options;\n }\n\n createSubContext(options: AnimationOptions|null = null, element?: any, newTime?: number):\n AnimationTimelineContext {\n const target = element || this.element;\n const context = new AnimationTimelineContext(\n this._driver, target, this.subInstructions, this._enterClassName, this._leaveClassName,\n this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));\n context.previousNode = this.previousNode;\n context.currentAnimateTimings = this.currentAnimateTimings;\n\n context.options = this._copyOptions();\n context.updateOptions(options);\n\n context.currentQueryIndex = this.currentQueryIndex;\n context.currentQueryTotal = this.currentQueryTotal;\n context.parentContext = this;\n this.subContextCount++;\n return context;\n }\n\n transformIntoNewTimeline(newTime?: number) {\n this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n this.currentTimeline = this.currentTimeline.fork(this.element, newTime);\n this.timelines.push(this.currentTimeline);\n return this.currentTimeline;\n }\n\n appendInstructionToTimeline(\n instruction: AnimationTimelineInstruction, duration: number|null,\n delay: number|null): AnimateTimings {\n const updatedTimings: AnimateTimings = {\n duration: duration != null ? duration : instruction.duration,\n delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay,\n easing: ''\n };\n const builder = new SubTimelineBuilder(\n this._driver, instruction.element, instruction.keyframes, instruction.preStyleProps,\n instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);\n this.timelines.push(builder);\n return updatedTimings;\n }\n\n incrementTime(time: number) {\n this.currentTimeline.forwardTime(this.currentTimeline.duration + time);\n }\n\n delayNextStep(delay: number) {\n // negative delays are not yet supported\n if (delay > 0) {\n this.currentTimeline.delayNextStep(delay);\n }\n }\n\n invokeQuery(\n selector: string, originalSelector: string, limit: number, includeSelf: boolean,\n optional: boolean, errors: Error[]): any[] {\n let results: any[] = [];\n if (includeSelf) {\n results.push(this.element);\n }\n if (selector.length > 0) { // only if :self is used then the selector can be empty\n selector = selector.replace(ENTER_TOKEN_REGEX, '.' + this._enterClassName);\n selector = selector.replace(LEAVE_TOKEN_REGEX, '.' + this._leaveClassName);\n const multi = limit != 1;\n let elements = this._driver.query(this.element, selector, multi);\n if (limit !== 0) {\n elements = limit < 0 ? elements.slice(elements.length + limit, elements.length) :\n elements.slice(0, limit);\n }\n results.push(...elements);\n }\n\n if (!optional && results.length == 0) {\n errors.push(invalidQuery(originalSelector));\n }\n return results;\n }\n}\n\nexport class TimelineBuilder {\n public duration: number = 0;\n public easing: string|null = null;\n private _previousKeyframe: ɵStyleDataMap = new Map();\n private _currentKeyframe: ɵStyleDataMap = new Map();\n private _keyframes = new Map<number, ɵStyleDataMap>();\n private _styleSummary = new Map<string, StyleAtTime>();\n private _localTimelineStyles: ɵStyleDataMap = new Map();\n private _globalTimelineStyles: ɵStyleDataMap;\n private _pendingStyles: ɵStyleDataMap = new Map();\n private _backFill: ɵStyleDataMap = new Map();\n private _currentEmptyStepKeyframe: ɵStyleDataMap|null = null;\n\n constructor(\n private _driver: AnimationDriver, public element: any, public startTime: number,\n private _elementTimelineStylesLookup?: Map<any, ɵStyleDataMap>) {\n if (!this._elementTimelineStylesLookup) {\n this._elementTimelineStylesLookup = new Map<any, ɵStyleDataMap>();\n }\n\n this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element)!;\n if (!this._globalTimelineStyles) {\n this._globalTimelineStyles = this._localTimelineStyles;\n this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);\n }\n this._loadKeyframe();\n }\n\n containsAnimation(): boolean {\n switch (this._keyframes.size) {\n case 0:\n return false;\n case 1:\n return this.hasCurrentStyleProperties();\n default:\n return true;\n }\n }\n\n hasCurrentStyleProperties(): boolean {\n return this._currentKeyframe.size > 0;\n }\n\n get currentTime() {\n return this.startTime + this.duration;\n }\n\n delayNextStep(delay: number) {\n // in the event that a style() step is placed right before a stagger()\n // and that style() step is the very first style() value in the animation\n // then we need to make a copy of the keyframe [0, copy, 1] so that the delay\n // properly applies the style() values to work with the stagger...\n const hasPreStyleStep = this._keyframes.size === 1 && this._pendingStyles.size;\n\n if (this.duration || hasPreStyleStep) {\n this.forwardTime(this.currentTime + delay);\n if (hasPreStyleStep) {\n this.snapshotCurrentStyles();\n }\n } else {\n this.startTime += delay;\n }\n }\n\n fork(element: any, currentTime?: number): TimelineBuilder {\n this.applyStylesToKeyframe();\n return new TimelineBuilder(\n this._driver, element, currentTime || this.currentTime, this._elementTimelineStylesLookup);\n }\n\n private _loadKeyframe() {\n if (this._currentKeyframe) {\n this._previousKeyframe = this._currentKeyframe;\n }\n this._currentKeyframe = this._keyframes.get(this.duration)!;\n if (!this._currentKeyframe) {\n this._currentKeyframe = new Map();\n this._keyframes.set(this.duration, this._currentKeyframe);\n }\n }\n\n forwardFrame() {\n this.duration += ONE_FRAME_IN_MILLISECONDS;\n this._loadKeyframe();\n }\n\n forwardTime(time: number) {\n this.applyStylesToKeyframe();\n this.duration = time;\n this._loadKeyframe();\n }\n\n private _updateStyle(prop: string, value: string|number) {\n this._localTimelineStyles.set(prop, value);\n this._globalTimelineStyles.set(prop, value);\n this._styleSummary.set(prop, {time: this.currentTime, value});\n }\n\n allowOnlyTimelineStyles() {\n return this._currentEmptyStepKeyframe !== this._currentKeyframe;\n }\n\n applyEmptyStep(easing: string|null) {\n if (easing) {\n this._previousKeyframe.set('easing', easing);\n }\n\n // special case for animate(duration):\n // all missing styles are filled with a `*` value then\n // if any destination styles are filled in later on the same\n // keyframe then they will override the overridden styles\n // We use `_globalTimelineStyles` here because there may be\n // styles in previous keyframes that are not present in this timeline\n for (let [prop, value] of this._globalTimelineStyles) {\n this._backFill.set(prop, value || AUTO_STYLE);\n this._currentKeyframe.set(prop, AUTO_STYLE);\n }\n this._currentEmptyStepKeyframe = this._currentKeyframe;\n }\n\n setStyles(\n input: Array<(ɵStyleDataMap | string)>, easing: string|null, errors: Error[],\n options?: AnimationOptions) {\n if (easing) {\n this._previousKeyframe.set('easing', easing);\n }\n const params = (options && options.params) || {};\n const styles = flattenStyles(input, this._globalTimelineStyles);\n for (let [prop, value] of styles) {\n const val = interpolateParams(value, params, errors);\n this._pendingStyles.set(prop, val);\n if (!this._localTimelineStyles.has(prop)) {\n this._backFill.set(prop, this._globalTimelineStyles.get(prop) ?? AUTO_STYLE);\n }\n this._updateStyle(prop, val);\n }\n }\n\n applyStylesToKeyframe() {\n if (this._pendingStyles.size == 0) return;\n\n this._pendingStyles.forEach((val, prop) => {\n this._currentKeyframe.set(prop, val);\n });\n this._pendingStyles.clear();\n\n this._localTimelineStyles.forEach((val, prop) => {\n if (!this._currentKeyframe.has(prop)) {\n this._currentKeyframe.set(prop, val);\n }\n });\n }\n\n snapshotCurrentStyles() {\n for (let [prop, val] of this._localTimelineStyles) {\n this._pendingStyles.set(prop, val);\n this._updateStyle(prop, val);\n }\n }\n\n getFinalKeyframe() {\n return this._keyframes.get(this.duration);\n }\n\n get properties() {\n const properties: string[] = [];\n for (let prop in this._currentKeyframe) {\n properties.push(prop);\n }\n return properties;\n }\n\n mergeTimelineCollectedStyles(timeline: TimelineBuilder) {\n timeline._styleSummary.forEach((details1, prop) => {\n const details0 = this._styleSummary.get(prop);\n if (!details0 || details1.time > details0.time) {\n this._updateStyle(prop, details1.value);\n }\n });\n }\n\n buildKeyframes(): AnimationTimelineInstruction {\n this.applyStylesToKeyframe();\n const preStyleProps = new Set<string>();\n const postStyleProps = new Set<string>();\n const isEmpty = this._keyframes.size === 1 && this.duration === 0;\n\n let finalKeyframes: Array<ɵStyleDataMap> = [];\n this._keyframes.forEach((keyframe, time) => {\n const finalKeyframe = copyStyles(keyframe, new Map(), this._backFill);\n finalKeyframe.forEach((value, prop) => {\n if (value === PRE_STYLE) {\n preStyleProps.add(prop);\n } else if (value === AUTO_STYLE) {\n postStyleProps.add(prop);\n }\n });\n if (!isEmpty) {\n finalKeyframe.set('offset', time / this.duration);\n }\n finalKeyframes.push(finalKeyframe);\n });\n\n const preProps: string[] = preStyleProps.size ? iteratorToArray(preStyleProps.values()) : [];\n const postProps: string[] = postStyleProps.size ? iteratorToArray(postStyleProps.values()) : [];\n\n // special case for a 0-second animation (which is designed just to place styles onscreen)\n if (isEmpty) {\n const kf0 = finalKeyframes[0];\n const kf1 = new Map(kf0);\n kf0.set('offset', 0);\n kf1.set('offset', 1);\n finalKeyframes = [kf0, kf1];\n }\n\n return createTimelineInstruction(\n this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime,\n this.easing, false);\n }\n}\n\nclass SubTimelineBuilder extends TimelineBuilder {\n public timings: AnimateTimings;\n\n constructor(\n driver: AnimationDriver, element: any, public keyframes: Array<ɵStyleDataMap>,\n public preStyleProps: string[], public postStyleProps: string[], timings: AnimateTimings,\n private _stretchStartingKeyframe: boolean = false) {\n super(driver, element, timings.delay);\n this.timings = {duration: timings.duration, delay: timings.delay, easing: timings.easing};\n }\n\n override containsAnimation(): boolean {\n return this.keyframes.length > 1;\n }\n\n override buildKeyframes(): AnimationTimelineInstruction {\n let keyframes = this.keyframes;\n let {delay, duration, easing} = this.timings;\n if (this._stretchStartingKeyframe && delay) {\n const newKeyframes: Array<ɵStyleDataMap> = [];\n const totalTime = duration + delay;\n const startingGap = delay / totalTime;\n\n // the original starting keyframe now starts once the delay is done\n const newFirstKeyframe = copyStyles(keyframes[0]);\n newFirstKeyframe.set('offset', 0);\n newKeyframes.push(newFirstKeyframe);\n\n const oldFirstKeyframe = copyStyles(keyframes[0]);\n oldFirstKeyframe.set('offset', roundOffset(startingGap));\n newKeyframes.push(oldFirstKeyframe);\n\n /*\n When the keyframe is stretched then it means that the delay before the animation\n starts is gone. Instead the first keyframe is placed at the start of the animation\n and it is then copied to where it starts when the original delay is over. This basically\n means nothing animates during that delay, but the styles are still rendered. For this\n to work the original offset values that exist in the original keyframes must be \"warped\"\n so that they can take the new keyframe + delay into account.\n\n delay=1000, duration=1000, keyframes = 0 .5 1\n\n turns into\n\n delay=0, duration=2000, keyframes = 0 .33 .66 1\n */\n\n // offsets between 1 ... n -1 are all warped by the keyframe stretch\n const limit = keyframes.length - 1;\n for (let i = 1; i <= limit; i++) {\n let kf = copyStyles(keyframes[i]);\n const oldOffset = kf.get('offset') as number;\n const timeAtKeyframe = delay + oldOffset * duration;\n kf.set('offset', roundOffset(timeAtKeyframe / totalTime));\n newKeyframes.push(kf);\n }\n\n // the new starting keyframe should be added at the start\n duration = totalTime;\n delay = 0;\n easing = '';\n\n keyframes = newKeyframes;\n }\n\n return createTimelineInstruction(\n this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing,\n true);\n }\n}\n\nfunction roundOffset(offset: number, decimalPoints = 3): number {\n const mult = Math.pow(10, decimalPoints - 1);\n return Math.round(offset * mult) / mult;\n}\n\nfunction flattenStyles(input: Array<(ɵStyleDataMap | string)>, allStyles: ɵStyleDataMap) {\n const styles: ɵStyleDataMap = new Map();\n let allProperties: string[]|IterableIterator<string>;\n input.forEach(token => {\n if (token === '*') {\n allProperties = allProperties || allStyles.keys();\n for (let prop of allProperties) {\n styles.set(prop, AUTO_STYLE);\n }\n } else {\n copyStyles(token as ɵStyleDataMap, styles);\n }\n });\n return styles;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @publicApi\n */\nexport abstract class AnimationStyleNormalizer {\n abstract normalizePropertyName(propertyName: string, errors: Error[]): string;\n abstract normalizeStyleValue(\n userProvidedProperty: string, normalizedProperty: string, value: string|number,\n errors: Error[]): string;\n}\n\n/**\n * @publicApi\n */\nexport class NoopAnimationStyleNormalizer {\n normalizePropertyName(propertyName: string, errors: Error[]): string {\n return propertyName;\n }\n\n normalizeStyleValue(\n userProvidedProperty: string, normalizedProperty: string, value: string|number,\n errors: Error[]): string {\n return <any>value;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {invalidCssUnitValue} from '../../error_helpers';\nimport {dashCaseToCamelCase} from '../../util';\n\nimport {AnimationStyleNormalizer} from './animation_style_normalizer';\n\nconst DIMENSIONAL_PROP_SET = new Set([\n 'width',\n 'height',\n 'minWidth',\n 'minHeight',\n 'maxWidth',\n 'maxHeight',\n 'left',\n 'top',\n 'bottom',\n 'right',\n 'fontSize',\n 'outlineWidth',\n 'outlineOffset',\n 'paddingTop',\n 'paddingLeft',\n 'paddingBottom',\n 'paddingRight',\n 'marginTop',\n 'marginLeft',\n 'marginBottom',\n 'marginRight',\n 'borderRadius',\n 'borderWidth',\n 'borderTopWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'textIndent',\n 'perspective'\n]);\n\nexport class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer {\n override normalizePropertyName(propertyName: string, errors: Error[]): string {\n return dashCaseToCamelCase(propertyName);\n }\n\n override normalizeStyleValue(\n userProvidedProperty: string, normalizedProperty: string, value: string|number,\n errors: Error[]): string {\n let unit: string = '';\n const strVal = value.toString().trim();\n\n if (DIMENSIONAL_PROP_SET.has(normalizedProperty) && value !== 0 && value !== '0') {\n if (typeof value === 'number') {\n unit = 'px';\n } else {\n const valAndSuffixMatch = value.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n errors.push(invalidCssUnitValue(userProvidedProperty, value));\n }\n }\n }\n return strVal + unit;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵStyleDataMap} from '@angular/animations';\n\nimport {AnimationEngineInstruction, AnimationTransitionInstructionType} from '../render/animation_engine_instruction';\n\nimport {AnimationTimelineInstruction} from './animation_timeline_instruction';\n\nexport interface AnimationTransitionInstruction extends AnimationEngineInstruction {\n element: any;\n triggerName: string;\n isRemovalTransition: boolean;\n fromState: string;\n fromStyles: ɵStyleDataMap;\n toState: string;\n toStyles: ɵStyleDataMap;\n timelines: AnimationTimelineInstruction[];\n queriedElements: any[];\n preStyleProps: Map<any, Set<string>>;\n postStyleProps: Map<any, Set<string>>;\n totalTime: number;\n errors?: Error[];\n}\n\nexport function createTransitionInstruction(\n element: any, triggerName: string, fromState: string, toState: string,\n isRemovalTransition: boolean, fromStyles: ɵStyleDataMap, toStyles: ɵStyleDataMap,\n timelines: AnimationTimelineInstruction[], queriedElements: any[],\n preStyleProps: Map<any, Set<string>>, postStyleProps: Map<any, Set<string>>, totalTime: number,\n errors?: Error[]): AnimationTransitionInstruction {\n return {\n type: AnimationTransitionInstructionType.TransitionAnimation,\n element,\n triggerName,\n isRemovalTransition,\n fromState,\n fromStyles,\n toState,\n toStyles,\n timelines,\n queriedElements,\n preStyleProps,\n postStyleProps,\n totalTime,\n errors\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationOptions, ɵStyleDataMap} from '@angular/animations';\n\nimport {AnimationDriver} from '../render/animation_driver';\nimport {getOrSetDefaultValue} from '../render/shared';\nimport {copyObj, interpolateParams, iteratorToArray} from '../util';\n\nimport {StyleAst, TransitionAst} from './animation_ast';\nimport {buildAnimationTimelines} from './animation_timeline_builder';\nimport {AnimationTimelineInstruction} from './animation_timeline_instruction';\nimport {TransitionMatcherFn} from './animation_transition_expr';\nimport {AnimationTransitionInstruction, createTransitionInstruction} from './animation_transition_instruction';\nimport {ElementInstructionMap} from './element_instruction_map';\nimport {AnimationStyleNormalizer} from './style_normalization/animation_style_normalizer';\n\nconst EMPTY_OBJECT = {};\n\nexport class AnimationTransitionFactory {\n constructor(\n private _triggerName: string, public ast: TransitionAst,\n private _stateStyles: Map<string, AnimationStateStyles>) {}\n\n match(currentState: any, nextState: any, element: any, params: {[key: string]: any}): boolean {\n return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params);\n }\n\n buildStyles(stateName: string|boolean|undefined, params: {[key: string]: any}, errors: Error[]):\n ɵStyleDataMap {\n let styler = this._stateStyles.get('*');\n if (stateName !== undefined) {\n styler = this._stateStyles.get(stateName?.toString()) || styler;\n }\n return styler ? styler.buildStyles(params, errors) : new Map();\n }\n\n build(\n driver: AnimationDriver, element: any, currentState: any, nextState: any,\n enterClassName: string, leaveClassName: string, currentOptions?: AnimationOptions,\n nextOptions?: AnimationOptions, subInstructions?: ElementInstructionMap,\n skipAstBuild?: boolean): AnimationTransitionInstruction {\n const errors: Error[] = [];\n\n const transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT;\n const currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT;\n const currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors);\n const nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT;\n const nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors);\n\n const queriedElements = new Set<any>();\n const preStyleMap = new Map<any, Set<string>>();\n const postStyleMap = new Map<any, Set<string>>();\n const isRemoval = nextState === 'void';\n\n const animationOptions: AnimationOptions = {\n params: applyParamDefaults(nextAnimationParams, transitionAnimationParams),\n delay: this.ast.options?.delay,\n };\n\n const timelines = skipAstBuild ?\n [] :\n buildAnimationTimelines(\n driver, element, this.ast.animation, enterClassName, leaveClassName, currentStateStyles,\n nextStateStyles, animationOptions, subInstructions, errors);\n\n let totalTime = 0;\n timelines.forEach(tl => {\n totalTime = Math.max(tl.duration + tl.delay, totalTime);\n });\n\n if (errors.length) {\n return createTransitionInstruction(\n element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles,\n nextStateStyles, [], [], preStyleMap, postStyleMap, totalTime, errors);\n }\n\n timelines.forEach(tl => {\n const elm = tl.element;\n const preProps = getOrSetDefaultValue(preStyleMap, elm, new Set<string>());\n tl.preStyleProps.forEach(prop => preProps.add(prop));\n\n const postProps = getOrSetDefaultValue(postStyleMap, elm, new Set<string>());\n tl.postStyleProps.forEach(prop => postProps.add(prop));\n\n if (elm !== element) {\n queriedElements.add(elm);\n }\n });\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n checkNonAnimatableInTimelines(timelines, this._triggerName, driver);\n }\n\n const queriedElementsList = iteratorToArray(queriedElements.values());\n return createTransitionInstruction(\n element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles,\n nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap, totalTime);\n }\n}\n\n/**\n * Checks inside a set of timelines if they try to animate a css property which is not considered\n * animatable, in that case it prints a warning on the console.\n * Besides that the function doesn't have any other effect.\n *\n * Note: this check is done here after the timelines are built instead of doing on a lower level so\n * that we can make sure that the warning appears only once per instruction (we can aggregate here\n * all the issues instead of finding them separately).\n *\n * @param timelines The built timelines for the current instruction.\n * @param triggerName The name of the trigger for the current instruction.\n * @param driver Animation driver used to perform the check.\n *\n */\nfunction checkNonAnimatableInTimelines(\n timelines: AnimationTimelineInstruction[], triggerName: string, driver: AnimationDriver): void {\n if (!driver.validateAnimatableStyleProperty) {\n return;\n }\n\n const allowedNonAnimatableProps = new Set<string>([\n // 'easing' is a utility/synthetic prop we use to represent\n // easing functions, it represents a property of the animation\n // which is not animatable but different values can be used\n // in different steps\n 'easing'\n ]);\n\n const invalidNonAnimatableProps = new Set<string>();\n\n timelines.forEach(({keyframes}) => {\n const nonAnimatablePropsInitialValues = new Map<string, string|number>();\n keyframes.forEach(keyframe => {\n const entriesToCheck =\n Array.from(keyframe.entries()).filter(([prop]) => !allowedNonAnimatableProps.has(prop));\n for (const [prop, value] of entriesToCheck) {\n if (!driver.validateAnimatableStyleProperty!(prop)) {\n if (nonAnimatablePropsInitialValues.has(prop) && !invalidNonAnimatableProps.has(prop)) {\n const propInitialValue = nonAnimatablePropsInitialValues.get(prop);\n if (propInitialValue !== value) {\n invalidNonAnimatableProps.add(prop);\n }\n } else {\n nonAnimatablePropsInitialValues.set(prop, value);\n }\n }\n }\n });\n });\n\n if (invalidNonAnimatableProps.size > 0) {\n console.warn(\n `Warning: The animation trigger \"${triggerName}\" is attempting to animate the following` +\n ' not animatable properties: ' + Array.from(invalidNonAnimatableProps).join(', ') + '\\n' +\n '(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)');\n }\n}\n\nfunction oneOrMoreTransitionsMatch(\n matchFns: TransitionMatcherFn[], currentState: any, nextState: any, element: any,\n params: {[key: string]: any}): boolean {\n return matchFns.some(fn => fn(currentState, nextState, element, params));\n}\n\nfunction applyParamDefaults(userParams: Record<string, any>, defaults: Record<string, any>) {\n const result: Record<string, any> = copyObj(defaults);\n\n for (const key in userParams) {\n if (userParams.hasOwnProperty(key) && userParams[key] != null) {\n result[key] = userParams[key];\n }\n }\n\n return result;\n}\n\nexport class AnimationStateStyles {\n constructor(\n private styles: StyleAst, private defaultParams: {[key: string]: any},\n private normalizer: AnimationStyleNormalizer) {}\n\n buildStyles(params: {[key: string]: any}, errors: Error[]): ɵStyleDataMap {\n const finalStyles: ɵStyleDataMap = new Map();\n const combinedParams = copyObj(this.defaultParams);\n Object.keys(params).forEach(key => {\n const value = params[key];\n if (value !== null) {\n combinedParams[key] = value;\n }\n });\n this.styles.styles.forEach(value => {\n if (typeof value !== 'string') {\n value.forEach((val, prop) => {\n if (val) {\n val = interpolateParams(val, combinedParams, errors);\n }\n const normalizedProp = this.normalizer.normalizePropertyName(prop, errors);\n val = this.normalizer.normalizeStyleValue(prop, normalizedProp, val, errors);\n finalStyles.set(prop, val);\n });\n }\n });\n return finalStyles;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationMetadataType, ɵStyleDataMap} from '@angular/animations';\n\nimport {SequenceAst, TransitionAst, TriggerAst} from './animation_ast';\nimport {AnimationStateStyles, AnimationTransitionFactory} from './animation_transition_factory';\nimport {AnimationStyleNormalizer} from './style_normalization/animation_style_normalizer';\n\n\n\nexport function buildTrigger(\n name: string, ast: TriggerAst, normalizer: AnimationStyleNormalizer): AnimationTrigger {\n return new AnimationTrigger(name, ast, normalizer);\n}\n\nexport class AnimationTrigger {\n public transitionFactories: AnimationTransitionFactory[] = [];\n public fallbackTransition: AnimationTransitionFactory;\n public states = new Map<string, AnimationStateStyles>();\n\n constructor(\n public name: string, public ast: TriggerAst, private _normalizer: AnimationStyleNormalizer) {\n ast.states.forEach(ast => {\n const defaultParams = (ast.options && ast.options.params) || {};\n this.states.set(ast.name, new AnimationStateStyles(ast.style, defaultParams, _normalizer));\n });\n\n balanceProperties(this.states, 'true', '1');\n balanceProperties(this.states, 'false', '0');\n\n ast.transitions.forEach(ast => {\n this.transitionFactories.push(new AnimationTransitionFactory(name, ast, this.states));\n });\n this.fallbackTransition = createFallbackTransition(name, this.states, this._normalizer);\n }\n\n get containsQueries() {\n return this.ast.queryCount > 0;\n }\n\n matchTransition(currentState: any, nextState: any, element: any, params: {[key: string]: any}):\n AnimationTransitionFactory|null {\n const entry =\n this.transitionFactories.find(f => f.match(currentState, nextState, element, params));\n return entry || null;\n }\n\n matchStyles(currentState: any, params: {[key: string]: any}, errors: Error[]): ɵStyleDataMap {\n return this.fallbackTransition.buildStyles(currentState, params, errors);\n }\n}\n\nfunction createFallbackTransition(\n triggerName: string, states: Map<string, AnimationStateStyles>,\n normalizer: AnimationStyleNormalizer): AnimationTransitionFactory {\n const matchers = [(fromState: any, toState: any) => true];\n const animation: SequenceAst = {type: AnimationMetadataType.Sequence, steps: [], options: null};\n const transition: TransitionAst = {\n type: AnimationMetadataType.Transition,\n animation,\n matchers,\n options: null,\n queryCount: 0,\n depCount: 0\n };\n return new AnimationTransitionFactory(triggerName, transition, states);\n}\n\nfunction balanceProperties(\n stateMap: Map<string, AnimationStateStyles>, key1: string, key2: string) {\n if (stateMap.has(key1)) {\n if (!stateMap.has(key2)) {\n stateMap.set(key2, stateMap.get(key1)!);\n }\n } else if (stateMap.has(key2)) {\n stateMap.set(key1, stateMap.get(key2)!);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationMetadata, AnimationMetadataType, AnimationOptions, AnimationPlayer, AUTO_STYLE, ɵStyleDataMap} from '@angular/animations';\n\nimport {Ast} from '../dsl/animation_ast';\nimport {buildAnimationAst} from '../dsl/animation_ast_builder';\nimport {buildAnimationTimelines} from '../dsl/animation_timeline_builder';\nimport {AnimationTimelineInstruction} from '../dsl/animation_timeline_instruction';\nimport {ElementInstructionMap} from '../dsl/element_instruction_map';\nimport {AnimationStyleNormalizer} from '../dsl/style_normalization/animation_style_normalizer';\nimport {createAnimationFailed, missingOrDestroyedAnimation, missingPlayer, registerFailed} from '../error_helpers';\nimport {ENTER_CLASSNAME, LEAVE_CLASSNAME} from '../util';\nimport {warnRegister} from '../warning_helpers';\n\nimport {AnimationDriver} from './animation_driver';\nimport {getOrSetDefaultValue, listenOnPlayer, makeAnimationEvent, normalizeKeyframes, optimizeGroupPlayer} from './shared';\n\nconst EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();\n\nexport class TimelineAnimationEngine {\n private _animations = new Map<string, Ast<AnimationMetadataType>>();\n private _playersById = new Map<string, AnimationPlayer>();\n public players: AnimationPlayer[] = [];\n\n constructor(\n public bodyNode: any, private _driver: AnimationDriver,\n private _normalizer: AnimationStyleNormalizer) {}\n\n register(id: string, metadata: AnimationMetadata|AnimationMetadata[]) {\n const errors: Error[] = [];\n const warnings: string[] = [];\n const ast = buildAnimationAst(this._driver, metadata, errors, warnings);\n if (errors.length) {\n throw registerFailed(errors);\n } else {\n if (warnings.length) {\n warnRegister(warnings);\n }\n this._animations.set(id, ast);\n }\n }\n\n private _buildPlayer(\n i: AnimationTimelineInstruction, preStyles: ɵStyleDataMap,\n postStyles?: ɵStyleDataMap): AnimationPlayer {\n const element = i.element;\n const keyframes = normalizeKeyframes(\n this._driver, this._normalizer, element, i.keyframes, preStyles, postStyles);\n return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, [], true);\n }\n\n create(id: string, element: any, options: AnimationOptions = {}): AnimationPlayer {\n const errors: Error[] = [];\n const ast = this._animations.get(id);\n let instructions: AnimationTimelineInstruction[];\n\n const autoStylesMap = new Map<any, ɵStyleDataMap>();\n\n if (ast) {\n instructions = buildAnimationTimelines(\n this._driver, element, ast, ENTER_CLASSNAME, LEAVE_CLASSNAME, new Map(), new Map(),\n options, EMPTY_INSTRUCTION_MAP, errors);\n instructions.forEach(inst => {\n const styles = getOrSetDefaultValue(\n autoStylesMap, inst.element, new Map<string, string|number|null>());\n inst.postStyleProps.forEach(prop => styles.set(prop, null));\n });\n } else {\n errors.push(missingOrDestroyedAnimation());\n instructions = [];\n }\n\n if (errors.length) {\n throw createAnimationFailed(errors);\n }\n\n autoStylesMap.forEach((styles, element) => {\n styles.forEach((_, prop) => {\n styles.set(prop, this._driver.computeStyle(element, prop, AUTO_STYLE));\n });\n });\n\n const players = instructions.map(i => {\n const styles = autoStylesMap.get(i.element);\n return this._buildPlayer(i, new Map(), styles);\n });\n const player = optimizeGroupPlayer(players);\n this._playersById.set(id, player);\n player.onDestroy(() => this.destroy(id));\n\n this.players.push(player);\n return player;\n }\n\n destroy(id: string) {\n const player = this._getPlayer(id);\n player.destroy();\n this._playersById.delete(id);\n const index = this.players.indexOf(player);\n if (index >= 0) {\n this.players.splice(index, 1);\n }\n }\n\n private _getPlayer(id: string): AnimationPlayer {\n const player = this._playersById.get(id);\n if (!player) {\n throw missingPlayer(id);\n }\n return player;\n }\n\n listen(id: string, element: string, eventName: string, callback: (event: any) => any):\n () => void {\n // triggerName, fromState, toState are all ignored for timeline animations\n const baseEvent = makeAnimationEvent(element, '', '', '');\n listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback);\n return () => {};\n }\n\n command(id: string, element: any, command: string, args: any[]): void {\n if (command == 'register') {\n this.register(id, args[0] as AnimationMetadata | AnimationMetadata[]);\n return;\n }\n\n if (command == 'create') {\n const options = (args[0] || {}) as AnimationOptions;\n this.create(id, element, options);\n return;\n }\n\n const player = this._getPlayer(id);\n switch (command) {\n case 'play':\n player.play();\n break;\n case 'pause':\n player.pause();\n break;\n case 'reset':\n player.reset();\n break;\n case 'restart':\n player.restart();\n break;\n case 'finish':\n player.finish();\n break;\n case 'init':\n player.init();\n break;\n case 'setPosition':\n player.setPosition(parseFloat(args[0] as string));\n break;\n case 'destroy':\n this.destroy(id);\n break;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationOptions, AnimationPlayer, AUTO_STYLE, NoopAnimationPlayer, ɵAnimationGroupPlayer as AnimationGroupPlayer, ɵPRE_STYLE as PRE_STYLE, ɵStyleDataMap} from '@angular/animations';\n\nimport {AnimationTimelineInstruction} from '../dsl/animation_timeline_instruction';\nimport {AnimationTransitionFactory} from '../dsl/animation_transition_factory';\nimport {AnimationTransitionInstruction} from '../dsl/animation_transition_instruction';\nimport {AnimationTrigger} from '../dsl/animation_trigger';\nimport {ElementInstructionMap} from '../dsl/element_instruction_map';\nimport {AnimationStyleNormalizer} from '../dsl/style_normalization/animation_style_normalizer';\nimport {missingEvent, missingTrigger, transitionFailed, triggerTransitionsFailed, unregisteredTrigger, unsupportedTriggerEvent} from '../error_helpers';\nimport {copyObj, ENTER_CLASSNAME, eraseStyles, LEAVE_CLASSNAME, NG_ANIMATING_CLASSNAME, NG_ANIMATING_SELECTOR, NG_TRIGGER_CLASSNAME, NG_TRIGGER_SELECTOR, setStyles} from '../util';\n\nimport {AnimationDriver} from './animation_driver';\nimport {getOrSetDefaultValue, listenOnPlayer, makeAnimationEvent, normalizeKeyframes, optimizeGroupPlayer} from './shared';\n\nconst QUEUED_CLASSNAME = 'ng-animate-queued';\nconst QUEUED_SELECTOR = '.ng-animate-queued';\nconst DISABLED_CLASSNAME = 'ng-animate-disabled';\nconst DISABLED_SELECTOR = '.ng-animate-disabled';\nconst STAR_CLASSNAME = 'ng-star-inserted';\nconst STAR_SELECTOR = '.ng-star-inserted';\n\nconst EMPTY_PLAYER_ARRAY: TransitionAnimationPlayer[] = [];\nconst NULL_REMOVAL_STATE: ElementAnimationState = {\n namespaceId: '',\n setForRemoval: false,\n setForMove: false,\n hasAnimation: false,\n removedBeforeQueried: false\n};\nconst NULL_REMOVED_QUERIED_STATE: ElementAnimationState = {\n namespaceId: '',\n setForMove: false,\n setForRemoval: false,\n hasAnimation: false,\n removedBeforeQueried: true\n};\n\ninterface TriggerListener {\n name: string;\n phase: string;\n callback: (event: any) => any;\n}\n\nexport interface QueueInstruction {\n element: any;\n triggerName: string;\n fromState: StateValue;\n toState: StateValue;\n transition: AnimationTransitionFactory;\n player: TransitionAnimationPlayer;\n isFallbackTransition: boolean;\n}\n\nexport const REMOVAL_FLAG = '__ng_removed';\n\nexport interface ElementAnimationState {\n setForRemoval: boolean;\n setForMove: boolean;\n hasAnimation: boolean;\n namespaceId: string;\n removedBeforeQueried: boolean;\n previousTriggersValues?: Map<string, string>;\n}\n\nexport class StateValue {\n public value: string;\n public options: AnimationOptions;\n\n get params(): {[key: string]: any} {\n return this.options.params as {[key: string]: any};\n }\n\n constructor(input: any, public namespaceId: string = '') {\n const isObj = input && input.hasOwnProperty('value');\n const value = isObj ? input['value'] : input;\n this.value = normalizeTriggerValue(value);\n if (isObj) {\n const options = copyObj(input as any);\n delete options['value'];\n this.options = options as AnimationOptions;\n } else {\n this.options = {};\n }\n if (!this.options.params) {\n this.options.params = {};\n }\n }\n\n absorbOptions(options: AnimationOptions) {\n const newParams = options.params;\n if (newParams) {\n const oldParams = this.options.params!;\n Object.keys(newParams).forEach(prop => {\n if (oldParams[prop] == null) {\n oldParams[prop] = newParams[prop];\n }\n });\n }\n }\n}\n\nexport const VOID_VALUE = 'void';\nexport const DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);\n\nexport class AnimationTransitionNamespace {\n public players: TransitionAnimationPlayer[] = [];\n\n private _triggers = new Map<string, AnimationTrigger>();\n private _queue: QueueInstruction[] = [];\n\n private _elementListeners = new Map<any, TriggerListener[]>();\n\n private _hostClassName: string;\n\n constructor(\n public id: string, public hostElement: any, private _engine: TransitionAnimationEngine) {\n this._hostClassName = 'ng-tns-' + id;\n addClass(hostElement, this._hostClassName);\n }\n\n listen(element: any, name: string, phase: string, callback: (event: any) => boolean): () => any {\n if (!this._triggers.has(name)) {\n throw missingTrigger(phase, name);\n }\n\n if (phase == null || phase.length == 0) {\n throw missingEvent(name);\n }\n\n if (!isTriggerEventValid(phase)) {\n throw unsupportedTriggerEvent(phase, name);\n }\n\n const listeners = getOrSetDefaultValue(this._elementListeners, element, []);\n const data = {name, phase, callback};\n listeners.push(data);\n\n const triggersWithStates =\n getOrSetDefaultValue(this._engine.statesByElement, element, new Map<string, StateValue>());\n if (!triggersWithStates.has(name)) {\n addClass(element, NG_TRIGGER_CLASSNAME);\n addClass(element, NG_TRIGGER_CLASSNAME + '-' + name);\n triggersWithStates.set(name, DEFAULT_STATE_VALUE);\n }\n\n return () => {\n // the event listener is removed AFTER the flush has occurred such\n // that leave animations callbacks can fire (otherwise if the node\n // is removed in between then the listeners would be deregistered)\n this._engine.afterFlush(() => {\n const index = listeners.indexOf(data);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n\n if (!this._triggers.has(name)) {\n triggersWithStates.delete(name);\n }\n });\n };\n }\n\n register(name: string, ast: AnimationTrigger): boolean {\n if (this._triggers.has(name)) {\n // throw\n return false;\n } else {\n this._triggers.set(name, ast);\n return true;\n }\n }\n\n private _getTrigger(name: string) {\n const trigger = this._triggers.get(name);\n if (!trigger) {\n throw unregisteredTrigger(name);\n }\n return trigger;\n }\n\n trigger(element: any, triggerName: string, value: any, defaultToFallback: boolean = true):\n TransitionAnimationPlayer|undefined {\n const trigger = this._getTrigger(triggerName);\n const player = new TransitionAnimationPlayer(this.id, triggerName, element);\n\n let triggersWithStates = this._engine.statesByElement.get(element);\n if (!triggersWithStates) {\n addClass(element, NG_TRIGGER_CLASSNAME);\n addClass(element, NG_TRIGGER_CLASSNAME + '-' + triggerName);\n this._engine.statesByElement.set(element, triggersWithStates = new Map<string, StateValue>());\n }\n\n let fromState = triggersWithStates.get(triggerName);\n const toState = new StateValue(value, this.id);\n const isObj = value && value.hasOwnProperty('value');\n if (!isObj && fromState) {\n toState.absorbOptions(fromState.options);\n }\n\n triggersWithStates.set(triggerName, toState);\n\n if (!fromState) {\n fromState = DEFAULT_STATE_VALUE;\n }\n\n const isRemoval = toState.value === VOID_VALUE;\n\n // normally this isn't reached by here, however, if an object expression\n // is passed in then it may be a new object each time. Comparing the value\n // is important since that will stay the same despite there being a new object.\n // The removal arc here is special cased because the same element is triggered\n // twice in the event that it contains animations on the outer/inner portions\n // of the host container\n if (!isRemoval && fromState.value === toState.value) {\n // this means that despite the value not changing, some inner params\n // have changed which means that the animation final styles need to be applied\n if (!objEquals(fromState.params, toState.params)) {\n const errors: Error[] = [];\n const fromStyles = trigger.matchStyles(fromState.value, fromState.params, errors);\n const toStyles = trigger.matchStyles(toState.value, toState.params, errors);\n if (errors.length) {\n this._engine.reportError(errors);\n } else {\n this._engine.afterFlush(() => {\n eraseStyles(element, fromStyles);\n setStyles(element, toStyles);\n });\n }\n }\n return;\n }\n\n const playersOnElement: TransitionAnimationPlayer[] =\n getOrSetDefaultValue(this._engine.playersByElement, element, []);\n playersOnElement.forEach(player => {\n // only remove the player if it is queued on the EXACT same trigger/namespace\n // we only also deal with queued players here because if the animation has\n // started then we want to keep the player alive until the flush happens\n // (which is where the previousPlayers are passed into the new player)\n if (player.namespaceId == this.id && player.triggerName == triggerName && player.queued) {\n player.destroy();\n }\n });\n\n let transition =\n trigger.matchTransition(fromState.value, toState.value, element, toState.params);\n let isFallbackTransition = false;\n if (!transition) {\n if (!defaultToFallback) return;\n transition = trigger.fallbackTransition;\n isFallbackTransition = true;\n }\n\n this._engine.totalQueuedPlayers++;\n this._queue.push(\n {element, triggerName, transition, fromState, toState, player, isFallbackTransition});\n\n if (!isFallbackTransition) {\n addClass(element, QUEUED_CLASSNAME);\n player.onStart(() => {\n removeClass(element, QUEUED_CLASSNAME);\n });\n }\n\n player.onDone(() => {\n let index = this.players.indexOf(player);\n if (index >= 0) {\n this.players.splice(index, 1);\n }\n\n const players = this._engine.playersByElement.get(element);\n if (players) {\n let index = players.indexOf(player);\n if (index >= 0) {\n players.splice(index, 1);\n }\n }\n });\n\n this.players.push(player);\n playersOnElement.push(player);\n\n return player;\n }\n\n deregister(name: string) {\n this._triggers.delete(name);\n\n this._engine.statesByElement.forEach(stateMap => stateMap.delete(name));\n\n this._elementListeners.forEach((listeners, element) => {\n this._elementListeners.set(element, listeners.filter(entry => {\n return entry.name != name;\n }));\n });\n }\n\n clearElementCache(element: any) {\n this._engine.statesByElement.delete(element);\n this._elementListeners.delete(element);\n const elementPlayers = this._engine.playersByElement.get(element);\n if (elementPlayers) {\n elementPlayers.forEach(player => player.destroy());\n this._engine.playersByElement.delete(element);\n }\n }\n\n private _signalRemovalForInnerTriggers(rootElement: any, context: any) {\n const elements = this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true);\n\n // emulate a leave animation for all inner nodes within this node.\n // If there are no animations found for any of the nodes then clear the cache\n // for the element.\n elements.forEach(elm => {\n // this means that an inner remove() operation has already kicked off\n // the animation on this element...\n if (elm[REMOVAL_FLAG]) return;\n\n const namespaces = this._engine.fetchNamespacesByElement(elm);\n if (namespaces.size) {\n namespaces.forEach(ns => ns.triggerLeaveAnimation(elm, context, false, true));\n } else {\n this.clearElementCache(elm);\n }\n });\n\n // If the child elements were removed along with the parent, their animations might not\n // have completed. Clear all the elements from the cache so we don't end up with a memory leak.\n this._engine.afterFlushAnimationsDone(\n () => elements.forEach(elm => this.clearElementCache(elm)));\n }\n\n triggerLeaveAnimation(\n element: any, context: any, destroyAfterComplete?: boolean,\n defaultToFallback?: boolean): boolean {\n const triggerStates = this._engine.statesByElement.get(element);\n const previousTriggersValues = new Map<string, string>();\n if (triggerStates) {\n const players: TransitionAnimationPlayer[] = [];\n triggerStates.forEach((state, triggerName) => {\n previousTriggersValues.set(triggerName, state.value);\n // this check is here in the event that an element is removed\n // twice (both on the host level and the component level)\n if (this._triggers.has(triggerName)) {\n const player = this.trigger(element, triggerName, VOID_VALUE, defaultToFallback);\n if (player) {\n players.push(player);\n }\n }\n });\n\n if (players.length) {\n this._engine.markElementAsRemoved(this.id, element, true, context, previousTriggersValues);\n if (destroyAfterComplete) {\n optimizeGroupPlayer(players).onDone(() => this._engine.processLeaveNode(element));\n }\n return true;\n }\n }\n return false;\n }\n\n prepareLeaveAnimationListeners(element: any) {\n const listeners = this._elementListeners.get(element);\n const elementStates = this._engine.statesByElement.get(element);\n\n // if this statement fails then it means that the element was picked up\n // by an earlier flush (or there are no listeners at all to track the leave).\n if (listeners && elementStates) {\n const visitedTriggers = new Set<string>();\n listeners.forEach(listener => {\n const triggerName = listener.name;\n if (visitedTriggers.has(triggerName)) return;\n visitedTriggers.add(triggerName);\n\n const trigger = this._triggers.get(triggerName)!;\n const transition = trigger.fallbackTransition;\n const fromState = elementStates.get(triggerName) || DEFAULT_STATE_VALUE;\n const toState = new StateValue(VOID_VALUE);\n const player = new TransitionAnimationPlayer(this.id, triggerName, element);\n\n this._engine.totalQueuedPlayers++;\n this._queue.push({\n element,\n triggerName,\n transition,\n fromState,\n toState,\n player,\n isFallbackTransition: true\n });\n });\n }\n }\n\n removeNode(element: any, context: any): void {\n const engine = this._engine;\n if (element.childElementCount) {\n this._signalRemovalForInnerTriggers(element, context);\n }\n\n // this means that a * => VOID animation was detected and kicked off\n if (this.triggerLeaveAnimation(element, context, true)) return;\n\n // find the player that is animating and make sure that the\n // removal is delayed until that player has completed\n let containsPotentialParentTransition = false;\n if (engine.totalAnimations) {\n const currentPlayers =\n engine.players.length ? engine.playersByQueriedElement.get(element) : [];\n\n // when this `if statement` does not continue forward it means that\n // a previous animation query has selected the current element and\n // is animating it. In this situation want to continue forwards and\n // allow the element to be queued up for animation later.\n if (currentPlayers && currentPlayers.length) {\n containsPotentialParentTransition = true;\n } else {\n let parent = element;\n while (parent = parent.parentNode) {\n const triggers = engine.statesByElement.get(parent);\n if (triggers) {\n containsPotentialParentTransition = true;\n break;\n }\n }\n }\n }\n\n // at this stage we know that the element will either get removed\n // during flush or will be picked up by a parent query. Either way\n // we need to fire the listeners for this element when it DOES get\n // removed (once the query parent animation is done or after flush)\n this.prepareLeaveAnimationListeners(element);\n\n // whether or not a parent has an animation we need to delay the deferral of the leave\n // operation until we have more information (which we do after flush() has been called)\n if (containsPotentialParentTransition) {\n engine.markElementAsRemoved(this.id, element, false, context);\n } else {\n const removalFlag = element[REMOVAL_FLAG];\n if (!removalFlag || removalFlag === NULL_REMOVAL_STATE) {\n // we do this after the flush has occurred such\n // that the callbacks can be fired\n engine.afterFlush(() => this.clearElementCache(element));\n engine.destroyInnerAnimations(element);\n engine._onRemovalComplete(element, context);\n }\n }\n }\n\n insertNode(element: any, parent: any): void {\n addClass(element, this._hostClassName);\n }\n\n drainQueuedTransitions(microtaskId: number): QueueInstruction[] {\n const instructions: QueueInstruction[] = [];\n this._queue.forEach(entry => {\n const player = entry.player;\n if (player.destroyed) return;\n\n const element = entry.element;\n const listeners = this._elementListeners.get(element);\n if (listeners) {\n listeners.forEach((listener: TriggerListener) => {\n if (listener.name == entry.triggerName) {\n const baseEvent = makeAnimationEvent(\n element, entry.triggerName, entry.fromState.value, entry.toState.value);\n (baseEvent as any)['_data'] = microtaskId;\n listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);\n }\n });\n }\n\n if (player.markedForDestroy) {\n this._engine.afterFlush(() => {\n // now we can destroy the element properly since the event listeners have\n // been bound to the player\n player.destroy();\n });\n } else {\n instructions.push(entry);\n }\n });\n\n this._queue = [];\n\n return instructions.sort((a, b) => {\n // if depCount == 0 them move to front\n // otherwise if a contains b then move back\n const d0 = a.transition.ast.depCount;\n const d1 = b.transition.ast.depCount;\n if (d0 == 0 || d1 == 0) {\n return d0 - d1;\n }\n return this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;\n });\n }\n\n destroy(context: any) {\n this.players.forEach(p => p.destroy());\n this._signalRemovalForInnerTriggers(this.hostElement, context);\n }\n\n elementContainsData(element: any): boolean {\n let containsData = false;\n if (this._elementListeners.has(element)) containsData = true;\n containsData =\n (this._queue.find(entry => entry.element === element) ? true : false) || containsData;\n return containsData;\n }\n}\n\nexport interface QueuedTransition {\n element: any;\n instruction: AnimationTransitionInstruction;\n player: TransitionAnimationPlayer;\n}\n\nexport class TransitionAnimationEngine {\n public players: TransitionAnimationPlayer[] = [];\n public newHostElements = new Map<any, AnimationTransitionNamespace>();\n public playersByElement = new Map<any, TransitionAnimationPlayer[]>();\n public playersByQueriedElement = new Map<any, TransitionAnimationPlayer[]>();\n public statesByElement = new Map<any, Map<string, StateValue>>();\n public disabledNodes = new Set<any>();\n\n public totalAnimations = 0;\n public totalQueuedPlayers = 0;\n\n private _namespaceLookup: {[id: string]: AnimationTransitionNamespace} = {};\n private _namespaceList: AnimationTransitionNamespace[] = [];\n private _flushFns: (() => any)[] = [];\n private _whenQuietFns: (() => any)[] = [];\n\n public namespacesByHostElement = new Map<any, AnimationTransitionNamespace>();\n public collectedEnterElements: any[] = [];\n public collectedLeaveElements: any[] = [];\n\n // this method is designed to be overridden by the code that uses this engine\n public onRemovalComplete = (element: any, context: any) => {};\n\n /** @internal */\n _onRemovalComplete(element: any, context: any) {\n this.onRemovalComplete(element, context);\n }\n\n constructor(\n public bodyNode: any, public driver: AnimationDriver,\n private _normalizer: AnimationStyleNormalizer) {}\n\n get queuedPlayers(): TransitionAnimationPlayer[] {\n const players: TransitionAnimationPlayer[] = [];\n this._namespaceList.forEach(ns => {\n ns.players.forEach(player => {\n if (player.queued) {\n players.push(player);\n }\n });\n });\n return players;\n }\n\n createNamespace(namespaceId: string, hostElement: any) {\n const ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);\n if (this.bodyNode && this.driver.containsElement(this.bodyNode, hostElement)) {\n this._balanceNamespaceList(ns, hostElement);\n } else {\n // defer this later until flush during when the host element has\n // been inserted so that we know exactly where to place it in\n // the namespace list\n this.newHostElements.set(hostElement, ns);\n\n // given that this host element is a part of the animation code, it\n // may or may not be inserted by a parent node that is of an\n // animation renderer type. If this happens then we can still have\n // access to this item when we query for :enter nodes. If the parent\n // is a renderer then the set data-structure will normalize the entry\n this.collectEnterElement(hostElement);\n }\n return this._namespaceLookup[namespaceId] = ns;\n }\n\n private _balanceNamespaceList(ns: AnimationTransitionNamespace, hostElement: any) {\n const namespaceList = this._namespaceList;\n const namespacesByHostElement = this.namespacesByHostElement;\n const limit = namespaceList.length - 1;\n if (limit >= 0) {\n let found = false;\n // Find the closest ancestor with an existing namespace so we can then insert `ns` after it,\n // establishing a top-down ordering of namespaces in `this._namespaceList`.\n let ancestor = this.driver.getParentElement(hostElement);\n while (ancestor) {\n const ancestorNs = namespacesByHostElement.get(ancestor);\n if (ancestorNs) {\n // An animation namespace has been registered for this ancestor, so we insert `ns`\n // right after it to establish top-down ordering of animation namespaces.\n const index = namespaceList.indexOf(ancestorNs);\n namespaceList.splice(index + 1, 0, ns);\n found = true;\n break;\n }\n ancestor = this.driver.getParentElement(ancestor);\n }\n if (!found) {\n // No namespace exists that is an ancestor of `ns`, so `ns` is inserted at the front to\n // ensure that any existing descendants are ordered after `ns`, retaining the desired\n // top-down ordering.\n namespaceList.unshift(ns);\n }\n } else {\n namespaceList.push(ns);\n }\n\n namespacesByHostElement.set(hostElement, ns);\n return ns;\n }\n\n register(namespaceId: string, hostElement: any) {\n let ns = this._namespaceLookup[namespaceId];\n if (!ns) {\n ns = this.createNamespace(namespaceId, hostElement);\n }\n return ns;\n }\n\n registerTrigger(namespaceId: string, name: string, trigger: AnimationTrigger) {\n let ns = this._namespaceLookup[namespaceId];\n if (ns && ns.register(name, trigger)) {\n this.totalAnimations++;\n }\n }\n\n destroy(namespaceId: string, context: any) {\n if (!namespaceId) return;\n\n const ns = this._fetchNamespace(namespaceId);\n\n this.afterFlush(() => {\n this.namespacesByHostElement.delete(ns.hostElement);\n delete this._namespaceLookup[namespaceId];\n const index = this._namespaceList.indexOf(ns);\n if (index >= 0) {\n this._namespaceList.splice(index, 1);\n }\n });\n\n this.afterFlushAnimationsDone(() => ns.destroy(context));\n }\n\n private _fetchNamespace(id: string) {\n return this._namespaceLookup[id];\n }\n\n fetchNamespacesByElement(element: any): Set<AnimationTransitionNamespace> {\n // normally there should only be one namespace per element, however\n // if @triggers are placed on both the component element and then\n // its host element (within the component code) then there will be\n // two namespaces returned. We use a set here to simply deduplicate\n // the namespaces in case (for the reason described above) there are multiple triggers\n const namespaces = new Set<AnimationTransitionNamespace>();\n const elementStates = this.statesByElement.get(element);\n if (elementStates) {\n for (let stateValue of elementStates.values()) {\n if (stateValue.namespaceId) {\n const ns = this._fetchNamespace(stateValue.namespaceId);\n if (ns) {\n namespaces.add(ns);\n }\n }\n }\n }\n return namespaces;\n }\n\n trigger(namespaceId: string, element: any, name: string, value: any): boolean {\n if (isElementNode(element)) {\n const ns = this._fetchNamespace(namespaceId);\n if (ns) {\n ns.trigger(element, name, value);\n return true;\n }\n }\n return false;\n }\n\n insertNode(namespaceId: string, element: any, parent: any, insertBefore: boolean): void {\n if (!isElementNode(element)) return;\n\n // special case for when an element is removed and reinserted (move operation)\n // when this occurs we do not want to use the element for deletion later\n const details = element[REMOVAL_FLAG] as ElementAnimationState;\n if (details && details.setForRemoval) {\n details.setForRemoval = false;\n details.setForMove = true;\n const index = this.collectedLeaveElements.indexOf(element);\n if (index >= 0) {\n this.collectedLeaveElements.splice(index, 1);\n }\n }\n\n // in the event that the namespaceId is blank then the caller\n // code does not contain any animation code in it, but it is\n // just being called so that the node is marked as being inserted\n if (namespaceId) {\n const ns = this._fetchNamespace(namespaceId);\n // This if-statement is a workaround for router issue #21947.\n // The router sometimes hits a race condition where while a route\n // is being instantiated a new navigation arrives, triggering leave\n // animation of DOM that has not been fully initialized, until this\n // is resolved, we need to handle the scenario when DOM is not in a\n // consistent state during the animation.\n if (ns) {\n ns.insertNode(element, parent);\n }\n }\n\n // only *directives and host elements are inserted before\n if (insertBefore) {\n this.collectEnterElement(element);\n }\n }\n\n collectEnterElement(element: any) {\n this.collectedEnterElements.push(element);\n }\n\n markElementAsDisabled(element: any, value: boolean) {\n if (value) {\n if (!this.disabledNodes.has(element)) {\n this.disabledNodes.add(element);\n addClass(element, DISABLED_CLASSNAME);\n }\n } else if (this.disabledNodes.has(element)) {\n this.disabledNodes.delete(element);\n removeClass(element, DISABLED_CLASSNAME);\n }\n }\n\n removeNode(namespaceId: string, element: any, isHostElement: boolean, context: any): void {\n if (isElementNode(element)) {\n const ns = namespaceId ? this._fetchNamespace(namespaceId) : null;\n if (ns) {\n ns.removeNode(element, context);\n } else {\n this.markElementAsRemoved(namespaceId, element, false, context);\n }\n\n if (isHostElement) {\n const hostNS = this.namespacesByHostElement.get(element);\n if (hostNS && hostNS.id !== namespaceId) {\n hostNS.removeNode(element, context);\n }\n }\n } else {\n this._onRemovalComplete(element, context);\n }\n }\n\n markElementAsRemoved(\n namespaceId: string, element: any, hasAnimation?: boolean, context?: any,\n previousTriggersValues?: Map<string, string>) {\n this.collectedLeaveElements.push(element);\n element[REMOVAL_FLAG] = {\n namespaceId,\n setForRemoval: context,\n hasAnimation,\n removedBeforeQueried: false,\n previousTriggersValues\n };\n }\n\n listen(\n namespaceId: string, element: any, name: string, phase: string,\n callback: (event: any) => boolean): () => any {\n if (isElementNode(element)) {\n return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);\n }\n return () => {};\n }\n\n private _buildInstruction(\n entry: QueueInstruction, subTimelines: ElementInstructionMap, enterClassName: string,\n leaveClassName: string, skipBuildAst?: boolean) {\n return entry.transition.build(\n this.driver, entry.element, entry.fromState.value, entry.toState.value, enterClassName,\n leaveClassName, entry.fromState.options, entry.toState.options, subTimelines, skipBuildAst);\n }\n\n destroyInnerAnimations(containerElement: any) {\n let elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);\n elements.forEach(element => this.destroyActiveAnimationsForElement(element));\n\n if (this.playersByQueriedElement.size == 0) return;\n\n elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);\n elements.forEach(element => this.finishActiveQueriedAnimationOnElement(element));\n }\n\n destroyActiveAnimationsForElement(element: any) {\n const players = this.playersByElement.get(element);\n if (players) {\n players.forEach(player => {\n // special case for when an element is set for destruction, but hasn't started.\n // in this situation we want to delay the destruction until the flush occurs\n // so that any event listeners attached to the player are triggered.\n if (player.queued) {\n player.markedForDestroy = true;\n } else {\n player.destroy();\n }\n });\n }\n }\n\n finishActiveQueriedAnimationOnElement(element: any) {\n const players = this.playersByQueriedElement.get(element);\n if (players) {\n players.forEach(player => player.finish());\n }\n }\n\n whenRenderingDone(): Promise<any> {\n return new Promise<void>(resolve => {\n if (this.players.length) {\n return optimizeGroupPlayer(this.players).onDone(() => resolve());\n } else {\n resolve();\n }\n });\n }\n\n processLeaveNode(element: any) {\n const details = element[REMOVAL_FLAG] as ElementAnimationState;\n if (details && details.setForRemoval) {\n // this will prevent it from removing it twice\n element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;\n if (details.namespaceId) {\n this.destroyInnerAnimations(element);\n const ns = this._fetchNamespace(details.namespaceId);\n if (ns) {\n ns.clearElementCache(element);\n }\n }\n this._onRemovalComplete(element, details.setForRemoval);\n }\n\n if (element.classList?.contains(DISABLED_CLASSNAME)) {\n this.markElementAsDisabled(element, false);\n }\n\n this.driver.query(element, DISABLED_SELECTOR, true).forEach(node => {\n this.markElementAsDisabled(node, false);\n });\n }\n\n flush(microtaskId: number = -1) {\n let players: AnimationPlayer[] = [];\n if (this.newHostElements.size) {\n this.newHostElements.forEach((ns, element) => this._balanceNamespaceList(ns, element));\n this.newHostElements.clear();\n }\n\n if (this.totalAnimations && this.collectedEnterElements.length) {\n for (let i = 0; i < this.collectedEnterElements.length; i++) {\n const elm = this.collectedEnterElements[i];\n addClass(elm, STAR_CLASSNAME);\n }\n }\n\n if (this._namespaceList.length &&\n (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {\n const cleanupFns: Function[] = [];\n try {\n players = this._flushAnimations(cleanupFns, microtaskId);\n } finally {\n for (let i = 0; i < cleanupFns.length; i++) {\n cleanupFns[i]();\n }\n }\n } else {\n for (let i = 0; i < this.collectedLeaveElements.length; i++) {\n const element = this.collectedLeaveElements[i];\n this.processLeaveNode(element);\n }\n }\n\n this.totalQueuedPlayers = 0;\n this.collectedEnterElements.length = 0;\n this.collectedLeaveElements.length = 0;\n this._flushFns.forEach(fn => fn());\n this._flushFns = [];\n\n if (this._whenQuietFns.length) {\n // we move these over to a variable so that\n // if any new callbacks are registered in another\n // flush they do not populate the existing set\n const quietFns = this._whenQuietFns;\n this._whenQuietFns = [];\n\n if (players.length) {\n optimizeGroupPlayer(players).onDone(() => {\n quietFns.forEach(fn => fn());\n });\n } else {\n quietFns.forEach(fn => fn());\n }\n }\n }\n\n reportError(errors: Error[]) {\n throw triggerTransitionsFailed(errors);\n }\n\n private _flushAnimations(cleanupFns: Function[], microtaskId: number):\n TransitionAnimationPlayer[] {\n const subTimelines = new ElementInstructionMap();\n const skippedPlayers: TransitionAnimationPlayer[] = [];\n const skippedPlayersMap = new Map<any, AnimationPlayer[]>();\n const queuedInstructions: QueuedTransition[] = [];\n const queriedElements = new Map<any, TransitionAnimationPlayer[]>();\n const allPreStyleElements = new Map<any, Set<string>>();\n const allPostStyleElements = new Map<any, Set<string>>();\n\n const disabledElementsSet = new Set<any>();\n this.disabledNodes.forEach(node => {\n disabledElementsSet.add(node);\n const nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true);\n for (let i = 0; i < nodesThatAreDisabled.length; i++) {\n disabledElementsSet.add(nodesThatAreDisabled[i]);\n }\n });\n\n const bodyNode = this.bodyNode;\n const allTriggerElements = Array.from(this.statesByElement.keys());\n const enterNodeMap = buildRootMap(allTriggerElements, this.collectedEnterElements);\n\n // this must occur before the instructions are built below such that\n // the :enter queries match the elements (since the timeline queries\n // are fired during instruction building).\n const enterNodeMapIds = new Map<any, string>();\n let i = 0;\n enterNodeMap.forEach((nodes, root) => {\n const className = ENTER_CLASSNAME + i++;\n enterNodeMapIds.set(root, className);\n nodes.forEach(node => addClass(node, className));\n });\n\n const allLeaveNodes: any[] = [];\n const mergedLeaveNodes = new Set<any>();\n const leaveNodesWithoutAnimations = new Set<any>();\n for (let i = 0; i < this.collectedLeaveElements.length; i++) {\n const element = this.collectedLeaveElements[i];\n const details = element[REMOVAL_FLAG] as ElementAnimationState;\n if (details && details.setForRemoval) {\n allLeaveNodes.push(element);\n mergedLeaveNodes.add(element);\n if (details.hasAnimation) {\n this.driver.query(element, STAR_SELECTOR, true).forEach(elm => mergedLeaveNodes.add(elm));\n } else {\n leaveNodesWithoutAnimations.add(element);\n }\n }\n }\n\n const leaveNodeMapIds = new Map<any, string>();\n const leaveNodeMap = buildRootMap(allTriggerElements, Array.from(mergedLeaveNodes));\n leaveNodeMap.forEach((nodes, root) => {\n const className = LEAVE_CLASSNAME + i++;\n leaveNodeMapIds.set(root, className);\n nodes.forEach(node => addClass(node, className));\n });\n\n cleanupFns.push(() => {\n enterNodeMap.forEach((nodes, root) => {\n const className = enterNodeMapIds.get(root)!;\n nodes.forEach(node => removeClass(node, className));\n });\n\n leaveNodeMap.forEach((nodes, root) => {\n const className = leaveNodeMapIds.get(root)!;\n nodes.forEach(node => removeClass(node, className));\n });\n\n allLeaveNodes.forEach(element => {\n this.processLeaveNode(element);\n });\n });\n\n const allPlayers: TransitionAnimationPlayer[] = [];\n const erroneousTransitions: AnimationTransitionInstruction[] = [];\n for (let i = this._namespaceList.length - 1; i >= 0; i--) {\n const ns = this._namespaceList[i];\n ns.drainQueuedTransitions(microtaskId).forEach(entry => {\n const player = entry.player;\n const element = entry.element;\n allPlayers.push(player);\n\n if (this.collectedEnterElements.length) {\n const details = element[REMOVAL_FLAG] as ElementAnimationState;\n // animations for move operations (elements being removed and reinserted,\n // e.g. when the order of an *ngFor list changes) are currently not supported\n if (details && details.setForMove) {\n if (details.previousTriggersValues &&\n details.previousTriggersValues.has(entry.triggerName)) {\n const previousValue = details.previousTriggersValues.get(entry.triggerName) as string;\n\n // we need to restore the previous trigger value since the element has\n // only been moved and hasn't actually left the DOM\n const triggersWithStates = this.statesByElement.get(entry.element);\n if (triggersWithStates && triggersWithStates.has(entry.triggerName)) {\n const state = triggersWithStates.get(entry.triggerName)!;\n state.value = previousValue;\n triggersWithStates.set(entry.triggerName, state);\n }\n }\n\n player.destroy();\n return;\n }\n }\n\n const nodeIsOrphaned = !bodyNode || !this.driver.containsElement(bodyNode, element);\n const leaveClassName = leaveNodeMapIds.get(element)!;\n const enterClassName = enterNodeMapIds.get(element)!;\n const instruction = this._buildInstruction(\n entry, subTimelines, enterClassName, leaveClassName, nodeIsOrphaned)!;\n if (instruction.errors && instruction.errors.length) {\n erroneousTransitions.push(instruction);\n return;\n }\n\n // even though the element may not be in the DOM, it may still\n // be added at a later point (due to the mechanics of content\n // projection and/or dynamic component insertion) therefore it's\n // important to still style the element.\n if (nodeIsOrphaned) {\n player.onStart(() => eraseStyles(element, instruction.fromStyles));\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n skippedPlayers.push(player);\n return;\n }\n\n // if an unmatched transition is queued and ready to go\n // then it SHOULD NOT render an animation and cancel the\n // previously running animations.\n if (entry.isFallbackTransition) {\n player.onStart(() => eraseStyles(element, instruction.fromStyles));\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n skippedPlayers.push(player);\n return;\n }\n\n // this means that if a parent animation uses this animation as a sub-trigger\n // then it will instruct the timeline builder not to add a player delay, but\n // instead stretch the first keyframe gap until the animation starts. This is\n // important in order to prevent extra initialization styles from being\n // required by the user for the animation.\n const timelines: AnimationTimelineInstruction[] = [];\n instruction.timelines.forEach(tl => {\n tl.stretchStartingKeyframe = true;\n if (!this.disabledNodes.has(tl.element)) {\n timelines.push(tl);\n }\n });\n instruction.timelines = timelines;\n\n subTimelines.append(element, instruction.timelines);\n\n const tuple = {instruction, player, element};\n\n queuedInstructions.push(tuple);\n\n instruction.queriedElements.forEach(\n element => getOrSetDefaultValue(queriedElements, element, []).push(player));\n\n instruction.preStyleProps.forEach((stringMap, element) => {\n if (stringMap.size) {\n let setVal: Set<string> = allPreStyleElements.get(element)!;\n if (!setVal) {\n allPreStyleElements.set(element, setVal = new Set<string>());\n }\n stringMap.forEach((_, prop) => setVal.add(prop));\n }\n });\n\n instruction.postStyleProps.forEach((stringMap, element) => {\n let setVal: Set<string> = allPostStyleElements.get(element)!;\n if (!setVal) {\n allPostStyleElements.set(element, setVal = new Set<string>());\n }\n stringMap.forEach((_, prop) => setVal.add(prop));\n });\n });\n }\n\n if (erroneousTransitions.length) {\n const errors: Error[] = [];\n erroneousTransitions.forEach(instruction => {\n errors.push(transitionFailed(instruction.triggerName, instruction.errors!));\n });\n\n allPlayers.forEach(player => player.destroy());\n this.reportError(errors);\n }\n\n const allPreviousPlayersMap = new Map<any, TransitionAnimationPlayer[]>();\n // this map tells us which element in the DOM tree is contained by\n // which animation. Further down this map will get populated once\n // the players are built and in doing so we can use it to efficiently\n // figure out if a sub player is skipped due to a parent player having priority.\n const animationElementMap = new Map<any, any>();\n queuedInstructions.forEach(entry => {\n const element = entry.element;\n if (subTimelines.has(element)) {\n animationElementMap.set(element, element);\n this._beforeAnimationBuild(\n entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);\n }\n });\n\n skippedPlayers.forEach(player => {\n const element = player.element;\n const previousPlayers =\n this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);\n previousPlayers.forEach(prevPlayer => {\n getOrSetDefaultValue(allPreviousPlayersMap, element, []).push(prevPlayer);\n prevPlayer.destroy();\n });\n });\n\n // this is a special case for nodes that will be removed either by\n // having their own leave animations or by being queried in a container\n // that will be removed once a parent animation is complete. The idea\n // here is that * styles must be identical to ! styles because of\n // backwards compatibility (* is also filled in by default in many places).\n // Otherwise * styles will return an empty value or \"auto\" since the element\n // passed to getComputedStyle will not be visible (since * === destination)\n const replaceNodes = allLeaveNodes.filter(node => {\n return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);\n });\n\n // POST STAGE: fill the * styles\n const postStylesMap = new Map<any, ɵStyleDataMap>();\n const allLeaveQueriedNodes = cloakAndComputeStyles(\n postStylesMap, this.driver, leaveNodesWithoutAnimations, allPostStyleElements, AUTO_STYLE);\n\n allLeaveQueriedNodes.forEach(node => {\n if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {\n replaceNodes.push(node);\n }\n });\n\n // PRE STAGE: fill the ! styles\n const preStylesMap = new Map<any, ɵStyleDataMap>();\n enterNodeMap.forEach((nodes, root) => {\n cloakAndComputeStyles(\n preStylesMap, this.driver, new Set(nodes), allPreStyleElements, PRE_STYLE);\n });\n\n replaceNodes.forEach(node => {\n const post = postStylesMap.get(node);\n const pre = preStylesMap.get(node);\n postStylesMap.set(\n node,\n new Map([...Array.from(post?.entries() ?? []), ...Array.from(pre?.entries() ?? [])]));\n });\n\n const rootPlayers: TransitionAnimationPlayer[] = [];\n const subPlayers: TransitionAnimationPlayer[] = [];\n const NO_PARENT_ANIMATION_ELEMENT_DETECTED = {};\n queuedInstructions.forEach(entry => {\n const {element, player, instruction} = entry;\n // this means that it was never consumed by a parent animation which\n // means that it is independent and therefore should be set for animation\n if (subTimelines.has(element)) {\n if (disabledElementsSet.has(element)) {\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n player.disabled = true;\n player.overrideTotalTime(instruction.totalTime);\n skippedPlayers.push(player);\n return;\n }\n\n // this will flow up the DOM and query the map to figure out\n // if a parent animation has priority over it. In the situation\n // that a parent is detected then it will cancel the loop. If\n // nothing is detected, or it takes a few hops to find a parent,\n // then it will fill in the missing nodes and signal them as having\n // a detected parent (or a NO_PARENT value via a special constant).\n let parentWithAnimation: any = NO_PARENT_ANIMATION_ELEMENT_DETECTED;\n if (animationElementMap.size > 1) {\n let elm = element;\n const parentsToAdd: any[] = [];\n while (elm = elm.parentNode) {\n const detectedParent = animationElementMap.get(elm);\n if (detectedParent) {\n parentWithAnimation = detectedParent;\n break;\n }\n parentsToAdd.push(elm);\n }\n parentsToAdd.forEach(parent => animationElementMap.set(parent, parentWithAnimation));\n }\n\n const innerPlayer = this._buildAnimation(\n player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap,\n postStylesMap);\n\n player.setRealPlayer(innerPlayer);\n\n if (parentWithAnimation === NO_PARENT_ANIMATION_ELEMENT_DETECTED) {\n rootPlayers.push(player);\n } else {\n const parentPlayers = this.playersByElement.get(parentWithAnimation);\n if (parentPlayers && parentPlayers.length) {\n player.parentPlayer = optimizeGroupPlayer(parentPlayers);\n }\n skippedPlayers.push(player);\n }\n } else {\n eraseStyles(element, instruction.fromStyles);\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n // there still might be a ancestor player animating this\n // element therefore we will still add it as a sub player\n // even if its animation may be disabled\n subPlayers.push(player);\n if (disabledElementsSet.has(element)) {\n skippedPlayers.push(player);\n }\n }\n });\n\n // find all of the sub players' corresponding inner animation players\n subPlayers.forEach(player => {\n // even if no players are found for a sub animation it\n // will still complete itself after the next tick since it's Noop\n const playersForElement = skippedPlayersMap.get(player.element);\n if (playersForElement && playersForElement.length) {\n const innerPlayer = optimizeGroupPlayer(playersForElement);\n player.setRealPlayer(innerPlayer);\n }\n });\n\n // the reason why we don't actually play the animation is\n // because all that a skipped player is designed to do is to\n // fire the start/done transition callback events\n skippedPlayers.forEach(player => {\n if (player.parentPlayer) {\n player.syncPlayerEvents(player.parentPlayer);\n } else {\n player.destroy();\n }\n });\n\n // run through all of the queued removals and see if they\n // were picked up by a query. If not then perform the removal\n // operation right away unless a parent animation is ongoing.\n for (let i = 0; i < allLeaveNodes.length; i++) {\n const element = allLeaveNodes[i];\n const details = element[REMOVAL_FLAG] as ElementAnimationState;\n removeClass(element, LEAVE_CLASSNAME);\n\n // this means the element has a removal animation that is being\n // taken care of and therefore the inner elements will hang around\n // until that animation is over (or the parent queried animation)\n if (details && details.hasAnimation) continue;\n\n let players: TransitionAnimationPlayer[] = [];\n\n // if this element is queried or if it contains queried children\n // then we want for the element not to be removed from the page\n // until the queried animations have finished\n if (queriedElements.size) {\n let queriedPlayerResults = queriedElements.get(element);\n if (queriedPlayerResults && queriedPlayerResults.length) {\n players.push(...queriedPlayerResults);\n }\n\n let queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);\n for (let j = 0; j < queriedInnerElements.length; j++) {\n let queriedPlayers = queriedElements.get(queriedInnerElements[j]);\n if (queriedPlayers && queriedPlayers.length) {\n players.push(...queriedPlayers);\n }\n }\n }\n\n const activePlayers = players.filter(p => !p.destroyed);\n if (activePlayers.length) {\n removeNodesAfterAnimationDone(this, element, activePlayers);\n } else {\n this.processLeaveNode(element);\n }\n }\n\n // this is required so the cleanup method doesn't remove them\n allLeaveNodes.length = 0;\n\n rootPlayers.forEach(player => {\n this.players.push(player);\n player.onDone(() => {\n player.destroy();\n\n const index = this.players.indexOf(player);\n this.players.splice(index, 1);\n });\n player.play();\n });\n\n return rootPlayers;\n }\n\n elementContainsData(namespaceId: string, element: any) {\n let containsData = false;\n const details = element[REMOVAL_FLAG] as ElementAnimationState;\n if (details && details.setForRemoval) containsData = true;\n if (this.playersByElement.has(element)) containsData = true;\n if (this.playersByQueriedElement.has(element)) containsData = true;\n if (this.statesByElement.has(element)) containsData = true;\n return this._fetchNamespace(namespaceId).elementContainsData(element) || containsData;\n }\n\n afterFlush(callback: () => any) {\n this._flushFns.push(callback);\n }\n\n afterFlushAnimationsDone(callback: () => any) {\n this._whenQuietFns.push(callback);\n }\n\n private _getPreviousPlayers(\n element: string, isQueriedElement: boolean, namespaceId?: string, triggerName?: string,\n toStateValue?: any): TransitionAnimationPlayer[] {\n let players: TransitionAnimationPlayer[] = [];\n if (isQueriedElement) {\n const queriedElementPlayers = this.playersByQueriedElement.get(element);\n if (queriedElementPlayers) {\n players = queriedElementPlayers;\n }\n } else {\n const elementPlayers = this.playersByElement.get(element);\n if (elementPlayers) {\n const isRemovalAnimation = !toStateValue || toStateValue == VOID_VALUE;\n elementPlayers.forEach(player => {\n if (player.queued) return;\n if (!isRemovalAnimation && player.triggerName != triggerName) return;\n players.push(player);\n });\n }\n }\n if (namespaceId || triggerName) {\n players = players.filter(player => {\n if (namespaceId && namespaceId != player.namespaceId) return false;\n if (triggerName && triggerName != player.triggerName) return false;\n return true;\n });\n }\n return players;\n }\n\n private _beforeAnimationBuild(\n namespaceId: string, instruction: AnimationTransitionInstruction,\n allPreviousPlayersMap: Map<any, TransitionAnimationPlayer[]>) {\n const triggerName = instruction.triggerName;\n const rootElement = instruction.element;\n\n // when a removal animation occurs, ALL previous players are collected\n // and destroyed (even if they are outside of the current namespace)\n const targetNameSpaceId: string|undefined =\n instruction.isRemovalTransition ? undefined : namespaceId;\n const targetTriggerName: string|undefined =\n instruction.isRemovalTransition ? undefined : triggerName;\n\n for (const timelineInstruction of instruction.timelines) {\n const element = timelineInstruction.element;\n const isQueriedElement = element !== rootElement;\n const players = getOrSetDefaultValue(allPreviousPlayersMap, element, []);\n const previousPlayers = this._getPreviousPlayers(\n element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);\n previousPlayers.forEach(player => {\n const realPlayer = (player as TransitionAnimationPlayer).getRealPlayer() as any;\n if (realPlayer.beforeDestroy) {\n realPlayer.beforeDestroy();\n }\n player.destroy();\n players.push(player);\n });\n }\n\n // this needs to be done so that the PRE/POST styles can be\n // computed properly without interfering with the previous animation\n eraseStyles(rootElement, instruction.fromStyles);\n }\n\n private _buildAnimation(\n namespaceId: string, instruction: AnimationTransitionInstruction,\n allPreviousPlayersMap: Map<any, TransitionAnimationPlayer[]>,\n skippedPlayersMap: Map<any, AnimationPlayer[]>, preStylesMap: Map<any, ɵStyleDataMap>,\n postStylesMap: Map<any, ɵStyleDataMap>): AnimationPlayer {\n const triggerName = instruction.triggerName;\n const rootElement = instruction.element;\n\n // we first run this so that the previous animation player\n // data can be passed into the successive animation players\n const allQueriedPlayers: TransitionAnimationPlayer[] = [];\n const allConsumedElements = new Set<any>();\n const allSubElements = new Set<any>();\n const allNewPlayers = instruction.timelines.map(timelineInstruction => {\n const element = timelineInstruction.element;\n allConsumedElements.add(element);\n\n // FIXME (matsko): make sure to-be-removed animations are removed properly\n const details = element[REMOVAL_FLAG];\n if (details && details.removedBeforeQueried)\n return new NoopAnimationPlayer(timelineInstruction.duration, timelineInstruction.delay);\n const isQueriedElement = element !== rootElement;\n const previousPlayers =\n flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY)\n .map(p => p.getRealPlayer()))\n .filter(p => {\n // the `element` is not apart of the AnimationPlayer definition, but\n // Mock/WebAnimations\n // use the element within their implementation. This will be added in Angular5 to\n // AnimationPlayer\n const pp = p as any;\n return pp.element ? pp.element === element : false;\n });\n\n const preStyles = preStylesMap.get(element);\n const postStyles = postStylesMap.get(element);\n\n const keyframes = normalizeKeyframes(\n this.driver, this._normalizer, element, timelineInstruction.keyframes, preStyles,\n postStyles);\n const player = this._buildPlayer(timelineInstruction, keyframes, previousPlayers);\n\n // this means that this particular player belongs to a sub trigger. It is\n // important that we match this player up with the corresponding (@trigger.listener)\n if (timelineInstruction.subTimeline && skippedPlayersMap) {\n allSubElements.add(element);\n }\n\n if (isQueriedElement) {\n const wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);\n wrappedPlayer.setRealPlayer(player);\n allQueriedPlayers.push(wrappedPlayer);\n }\n\n return player;\n });\n\n allQueriedPlayers.forEach(player => {\n getOrSetDefaultValue(this.playersByQueriedElement, player.element, []).push(player);\n player.onDone(() => deleteOrUnsetInMap(this.playersByQueriedElement, player.element, player));\n });\n\n allConsumedElements.forEach(element => addClass(element, NG_ANIMATING_CLASSNAME));\n const player = optimizeGroupPlayer(allNewPlayers);\n player.onDestroy(() => {\n allConsumedElements.forEach(element => removeClass(element, NG_ANIMATING_CLASSNAME));\n setStyles(rootElement, instruction.toStyles);\n });\n\n // this basically makes all of the callbacks for sub element animations\n // be dependent on the upper players for when they finish\n allSubElements.forEach(element => {\n getOrSetDefaultValue(skippedPlayersMap, element, []).push(player);\n });\n\n return player;\n }\n\n private _buildPlayer(\n instruction: AnimationTimelineInstruction, keyframes: Array<ɵStyleDataMap>,\n previousPlayers: AnimationPlayer[]): AnimationPlayer {\n if (keyframes.length > 0) {\n return this.driver.animate(\n instruction.element, keyframes, instruction.duration, instruction.delay,\n instruction.easing, previousPlayers);\n }\n\n // special case for when an empty transition|definition is provided\n // ... there is no point in rendering an empty animation\n return new NoopAnimationPlayer(instruction.duration, instruction.delay);\n }\n}\n\nexport class TransitionAnimationPlayer implements AnimationPlayer {\n private _player: AnimationPlayer = new NoopAnimationPlayer();\n private _containsRealPlayer = false;\n\n private _queuedCallbacks = new Map<string, ((event: any) => any)[]>();\n public readonly destroyed = false;\n public parentPlayer: AnimationPlayer|null = null;\n\n public markedForDestroy: boolean = false;\n public disabled = false;\n\n readonly queued: boolean = true;\n public readonly totalTime: number = 0;\n\n constructor(public namespaceId: string, public triggerName: string, public element: any) {}\n\n setRealPlayer(player: AnimationPlayer) {\n if (this._containsRealPlayer) return;\n\n this._player = player;\n this._queuedCallbacks.forEach((callbacks, phase) => {\n callbacks.forEach(callback => listenOnPlayer(player, phase, undefined, callback));\n });\n\n this._queuedCallbacks.clear();\n this._containsRealPlayer = true;\n this.overrideTotalTime(player.totalTime);\n (this as {queued: boolean}).queued = false;\n }\n\n getRealPlayer() {\n return this._player;\n }\n\n overrideTotalTime(totalTime: number) {\n (this as any).totalTime = totalTime;\n }\n\n syncPlayerEvents(player: AnimationPlayer) {\n const p = this._player as any;\n if (p.triggerCallback) {\n player.onStart(() => p.triggerCallback!('start'));\n }\n player.onDone(() => this.finish());\n player.onDestroy(() => this.destroy());\n }\n\n private _queueEvent(name: string, callback: (event: any) => any): void {\n getOrSetDefaultValue(this._queuedCallbacks, name, []).push(callback);\n }\n\n onDone(fn: () => void): void {\n if (this.queued) {\n this._queueEvent('done', fn);\n }\n this._player.onDone(fn);\n }\n\n onStart(fn: () => void): void {\n if (this.queued) {\n this._queueEvent('start', fn);\n }\n this._player.onStart(fn);\n }\n\n onDestroy(fn: () => void): void {\n if (this.queued) {\n this._queueEvent('destroy', fn);\n }\n this._player.onDestroy(fn);\n }\n\n init(): void {\n this._player.init();\n }\n\n hasStarted(): boolean {\n return this.queued ? false : this._player.hasStarted();\n }\n\n play(): void {\n !this.queued && this._player.play();\n }\n\n pause(): void {\n !this.queued && this._player.pause();\n }\n\n restart(): void {\n !this.queued && this._player.restart();\n }\n\n finish(): void {\n this._player.finish();\n }\n\n destroy(): void {\n (this as {destroyed: boolean}).destroyed = true;\n this._player.destroy();\n }\n\n reset(): void {\n !this.queued && this._player.reset();\n }\n\n setPosition(p: any): void {\n if (!this.queued) {\n this._player.setPosition(p);\n }\n }\n\n getPosition(): number {\n return this.queued ? 0 : this._player.getPosition();\n }\n\n /** @internal */\n triggerCallback(phaseName: string): void {\n const p = this._player as any;\n if (p.triggerCallback) {\n p.triggerCallback(phaseName);\n }\n }\n}\n\nfunction deleteOrUnsetInMap<T, V>(map: Map<T, V[]>, key: T, value: V) {\n let currentValues = map.get(key);\n if (currentValues) {\n if (currentValues.length) {\n const index = currentValues.indexOf(value);\n currentValues.splice(index, 1);\n }\n if (currentValues.length == 0) {\n map.delete(key);\n }\n }\n return currentValues;\n}\n\nfunction normalizeTriggerValue(value: any): any {\n // we use `!= null` here because it's the most simple\n // way to test against a \"falsy\" value without mixing\n // in empty strings or a zero value. DO NOT OPTIMIZE.\n return value != null ? value : null;\n}\n\nfunction isElementNode(node: any) {\n return node && node['nodeType'] === 1;\n}\n\nfunction isTriggerEventValid(eventName: string): boolean {\n return eventName == 'start' || eventName == 'done';\n}\n\nfunction cloakElement(element: any, value?: string) {\n const oldValue = element.style.display;\n element.style.display = value != null ? value : 'none';\n return oldValue;\n}\n\nfunction cloakAndComputeStyles(\n valuesMap: Map<any, ɵStyleDataMap>, driver: AnimationDriver, elements: Set<any>,\n elementPropsMap: Map<any, Set<string>>, defaultStyle: string): any[] {\n const cloakVals: string[] = [];\n elements.forEach(element => cloakVals.push(cloakElement(element)));\n\n const failedElements: any[] = [];\n\n elementPropsMap.forEach((props: Set<string>, element: any) => {\n const styles: ɵStyleDataMap = new Map();\n props.forEach(prop => {\n const value = driver.computeStyle(element, prop, defaultStyle);\n styles.set(prop, value);\n\n // there is no easy way to detect this because a sub element could be removed\n // by a parent animation element being detached.\n if (!value || value.length == 0) {\n element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;\n failedElements.push(element);\n }\n });\n valuesMap.set(element, styles);\n });\n\n // we use a index variable here since Set.forEach(a, i) does not return\n // an index value for the closure (but instead just the value)\n let i = 0;\n elements.forEach(element => cloakElement(element, cloakVals[i++]));\n\n return failedElements;\n}\n\n/*\nSince the Angular renderer code will return a collection of inserted\nnodes in all areas of a DOM tree, it's up to this algorithm to figure\nout which nodes are roots for each animation @trigger.\n\nBy placing each inserted node into a Set and traversing upwards, it\nis possible to find the @trigger elements and well any direct *star\ninsertion nodes, if a @trigger root is found then the enter element\nis placed into the Map[@trigger] spot.\n */\nfunction buildRootMap(roots: any[], nodes: any[]): Map<any, any[]> {\n const rootMap = new Map<any, any[]>();\n roots.forEach(root => rootMap.set(root, []));\n\n if (nodes.length == 0) return rootMap;\n\n const NULL_NODE = 1;\n const nodeSet = new Set(nodes);\n const localRootMap = new Map<any, any>();\n\n function getRoot(node: any): any {\n if (!node) return NULL_NODE;\n\n let root = localRootMap.get(node);\n if (root) return root;\n\n const parent = node.parentNode;\n if (rootMap.has(parent)) { // ngIf inside @trigger\n root = parent;\n } else if (nodeSet.has(parent)) { // ngIf inside ngIf\n root = NULL_NODE;\n } else { // recurse upwards\n root = getRoot(parent);\n }\n\n localRootMap.set(node, root);\n return root;\n }\n\n nodes.forEach(node => {\n const root = getRoot(node);\n if (root !== NULL_NODE) {\n rootMap.get(root)!.push(node);\n }\n });\n\n return rootMap;\n}\n\nfunction addClass(element: any, className: string) {\n element.classList?.add(className);\n}\n\nfunction removeClass(element: any, className: string) {\n element.classList?.remove(className);\n}\n\nfunction removeNodesAfterAnimationDone(\n engine: TransitionAnimationEngine, element: any, players: AnimationPlayer[]) {\n optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));\n}\n\nfunction flattenGroupPlayers(players: AnimationPlayer[]): AnimationPlayer[] {\n const finalPlayers: AnimationPlayer[] = [];\n _flattenGroupPlayersRecur(players, finalPlayers);\n return finalPlayers;\n}\n\nfunction _flattenGroupPlayersRecur(players: AnimationPlayer[], finalPlayers: AnimationPlayer[]) {\n for (let i = 0; i < players.length; i++) {\n const player = players[i];\n if (player instanceof AnimationGroupPlayer) {\n _flattenGroupPlayersRecur(player.players, finalPlayers);\n } else {\n finalPlayers.push(player);\n }\n }\n}\n\nfunction objEquals(a: {[key: string]: any}, b: {[key: string]: any}): boolean {\n const k1 = Object.keys(a);\n const k2 = Object.keys(b);\n if (k1.length != k2.length) return false;\n for (let i = 0; i < k1.length; i++) {\n const prop = k1[i];\n if (!b.hasOwnProperty(prop) || a[prop] !== b[prop]) return false;\n }\n return true;\n}\n\nfunction replacePostStylesAsPre(\n element: any, allPreStyleElements: Map<any, Set<string>>,\n allPostStyleElements: Map<any, Set<string>>): boolean {\n const postEntry = allPostStyleElements.get(element);\n if (!postEntry) return false;\n\n let preEntry = allPreStyleElements.get(element);\n if (preEntry) {\n postEntry.forEach(data => preEntry!.add(data));\n } else {\n allPreStyleElements.set(element, postEntry);\n }\n\n allPostStyleElements.delete(element);\n return true;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationMetadata, AnimationPlayer, AnimationTriggerMetadata} from '@angular/animations';\n\nimport {TriggerAst} from '../dsl/animation_ast';\nimport {buildAnimationAst} from '../dsl/animation_ast_builder';\nimport {AnimationTrigger, buildTrigger} from '../dsl/animation_trigger';\nimport {AnimationStyleNormalizer} from '../dsl/style_normalization/animation_style_normalizer';\nimport {triggerBuildFailed} from '../error_helpers';\nimport {warnTriggerBuild} from '../warning_helpers';\n\nimport {AnimationDriver} from './animation_driver';\nimport {parseTimelineCommand} from './shared';\nimport {TimelineAnimationEngine} from './timeline_animation_engine';\nimport {TransitionAnimationEngine} from './transition_animation_engine';\n\nexport class AnimationEngine {\n private _transitionEngine: TransitionAnimationEngine;\n private _timelineEngine: TimelineAnimationEngine;\n\n private _triggerCache: {[key: string]: AnimationTrigger} = {};\n\n // this method is designed to be overridden by the code that uses this engine\n public onRemovalComplete = (element: any, context: any) => {};\n\n constructor(\n private bodyNode: any, private _driver: AnimationDriver,\n private _normalizer: AnimationStyleNormalizer) {\n this._transitionEngine = new TransitionAnimationEngine(bodyNode, _driver, _normalizer);\n this._timelineEngine = new TimelineAnimationEngine(bodyNode, _driver, _normalizer);\n\n this._transitionEngine.onRemovalComplete = (element: any, context: any) =>\n this.onRemovalComplete(element, context);\n }\n\n registerTrigger(\n componentId: string, namespaceId: string, hostElement: any, name: string,\n metadata: AnimationTriggerMetadata): void {\n const cacheKey = componentId + '-' + name;\n let trigger = this._triggerCache[cacheKey];\n if (!trigger) {\n const errors: Error[] = [];\n const warnings: string[] = [];\n const ast = buildAnimationAst(\n this._driver, metadata as AnimationMetadata, errors, warnings) as TriggerAst;\n if (errors.length) {\n throw triggerBuildFailed(name, errors);\n }\n if (warnings.length) {\n warnTriggerBuild(name, warnings);\n }\n trigger = buildTrigger(name, ast, this._normalizer);\n this._triggerCache[cacheKey] = trigger;\n }\n this._transitionEngine.registerTrigger(namespaceId, name, trigger);\n }\n\n register(namespaceId: string, hostElement: any) {\n this._transitionEngine.register(namespaceId, hostElement);\n }\n\n destroy(namespaceId: string, context: any) {\n this._transitionEngine.destroy(namespaceId, context);\n }\n\n onInsert(namespaceId: string, element: any, parent: any, insertBefore: boolean): void {\n this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);\n }\n\n onRemove(namespaceId: string, element: any, context: any, isHostElement?: boolean): void {\n this._transitionEngine.removeNode(namespaceId, element, isHostElement || false, context);\n }\n\n disableAnimations(element: any, disable: boolean) {\n this._transitionEngine.markElementAsDisabled(element, disable);\n }\n\n process(namespaceId: string, element: any, property: string, value: any) {\n if (property.charAt(0) == '@') {\n const [id, action] = parseTimelineCommand(property);\n const args = value as any[];\n this._timelineEngine.command(id, element, action, args);\n } else {\n this._transitionEngine.trigger(namespaceId, element, property, value);\n }\n }\n\n listen(\n namespaceId: string, element: any, eventName: string, eventPhase: string,\n callback: (event: any) => any): () => any {\n // @@listen\n if (eventName.charAt(0) == '@') {\n const [id, action] = parseTimelineCommand(eventName);\n return this._timelineEngine.listen(id, element, action, callback);\n }\n return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);\n }\n\n flush(microtaskId: number = -1): void {\n this._transitionEngine.flush(microtaskId);\n }\n\n get players(): AnimationPlayer[] {\n return (this._transitionEngine.players as AnimationPlayer[])\n .concat(this._timelineEngine.players as AnimationPlayer[]);\n }\n\n whenRenderingDone(): Promise<any> {\n return this._transitionEngine.whenRenderingDone();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ɵStyleDataMap} from '@angular/animations';\n\nimport {eraseStyles, setStyles} from '../util';\n\n/**\n * Returns an instance of `SpecialCasedStyles` if and when any special (non animateable) styles are\n * detected.\n *\n * In CSS there exist properties that cannot be animated within a keyframe animation\n * (whether it be via CSS keyframes or web-animations) and the animation implementation\n * will ignore them. This function is designed to detect those special cased styles and\n * return a container that will be executed at the start and end of the animation.\n *\n * @returns an instance of `SpecialCasedStyles` if any special styles are detected otherwise `null`\n */\nexport function packageNonAnimatableStyles(\n element: any, styles: ɵStyleDataMap|Array<ɵStyleDataMap>): SpecialCasedStyles|null {\n let startStyles: ɵStyleDataMap|null = null;\n let endStyles: ɵStyleDataMap|null = null;\n if (Array.isArray(styles) && styles.length) {\n startStyles = filterNonAnimatableStyles(styles[0]);\n if (styles.length > 1) {\n endStyles = filterNonAnimatableStyles(styles[styles.length - 1]);\n }\n } else if (styles instanceof Map) {\n startStyles = filterNonAnimatableStyles(styles);\n }\n\n return (startStyles || endStyles) ? new SpecialCasedStyles(element, startStyles, endStyles) :\n null;\n}\n\n/**\n * Designed to be executed during a keyframe-based animation to apply any special-cased styles.\n *\n * When started (when the `start()` method is run) then the provided `startStyles`\n * will be applied. When finished (when the `finish()` method is called) the\n * `endStyles` will be applied as well any any starting styles. Finally when\n * `destroy()` is called then all styles will be removed.\n */\nexport class SpecialCasedStyles {\n static initialStylesByElement = (/* @__PURE__ */ new WeakMap<any, ɵStyleDataMap>());\n\n private _state = SpecialCasedStylesState.Pending;\n private _initialStyles!: ɵStyleDataMap;\n\n constructor(\n private _element: any, private _startStyles: ɵStyleDataMap|null,\n private _endStyles: ɵStyleDataMap|null) {\n let initialStyles = SpecialCasedStyles.initialStylesByElement.get(_element);\n if (!initialStyles) {\n SpecialCasedStyles.initialStylesByElement.set(_element, initialStyles = new Map());\n }\n this._initialStyles = initialStyles;\n }\n\n start() {\n if (this._state < SpecialCasedStylesState.Started) {\n if (this._startStyles) {\n setStyles(this._element, this._startStyles, this._initialStyles);\n }\n this._state = SpecialCasedStylesState.Started;\n }\n }\n\n finish() {\n this.start();\n if (this._state < SpecialCasedStylesState.Finished) {\n setStyles(this._element, this._initialStyles);\n if (this._endStyles) {\n setStyles(this._element, this._endStyles);\n this._endStyles = null;\n }\n this._state = SpecialCasedStylesState.Started;\n }\n }\n\n destroy() {\n this.finish();\n if (this._state < SpecialCasedStylesState.Destroyed) {\n SpecialCasedStyles.initialStylesByElement.delete(this._element);\n if (this._startStyles) {\n eraseStyles(this._element, this._startStyles);\n this._endStyles = null;\n }\n if (this._endStyles) {\n eraseStyles(this._element, this._endStyles);\n this._endStyles = null;\n }\n setStyles(this._element, this._initialStyles);\n this._state = SpecialCasedStylesState.Destroyed;\n }\n }\n}\n\n/**\n * An enum of states reflective of what the status of `SpecialCasedStyles` is.\n *\n * Depending on how `SpecialCasedStyles` is interacted with, the start and end\n * styles may not be applied in the same way. This enum ensures that if and when\n * the ending styles are applied then the starting styles are applied. It is\n * also used to reflect what the current status of the special cased styles are\n * which helps prevent the starting/ending styles not be applied twice. It is\n * also used to cleanup the styles once `SpecialCasedStyles` is destroyed.\n */\nconst enum SpecialCasedStylesState {\n Pending = 0,\n Started = 1,\n Finished = 2,\n Destroyed = 3,\n}\n\nfunction filterNonAnimatableStyles(styles: ɵStyleDataMap): ɵStyleDataMap|null {\n let result: ɵStyleDataMap|null = null;\n styles.forEach((val, prop) => {\n if (isNonAnimatableStyle(prop)) {\n result = result || new Map();\n result.set(prop, val);\n }\n });\n return result;\n}\n\nfunction isNonAnimatableStyle(prop: string) {\n return prop === 'display' || prop === 'position';\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationPlayer, ɵStyleDataMap} from '@angular/animations';\n\nimport {computeStyle} from '../../util';\nimport {SpecialCasedStyles} from '../special_cased_styles';\n\nimport {DOMAnimation} from './dom_animation';\n\nexport class WebAnimationsPlayer implements AnimationPlayer {\n private _onDoneFns: Function[] = [];\n private _onStartFns: Function[] = [];\n private _onDestroyFns: Function[] = [];\n private _duration: number;\n private _delay: number;\n private _initialized = false;\n private _finished = false;\n private _started = false;\n private _destroyed = false;\n private _finalKeyframe?: ɵStyleDataMap;\n\n // the following original fns are persistent copies of the _onStartFns and _onDoneFns\n // and are used to reset the fns to their original values upon reset()\n // (since the _onStartFns and _onDoneFns get deleted after they are called)\n private _originalOnDoneFns: Function[] = [];\n private _originalOnStartFns: Function[] = [];\n\n // using non-null assertion because it's re(set) by init();\n public readonly domPlayer!: DOMAnimation;\n public time = 0;\n\n public parentPlayer: AnimationPlayer|null = null;\n public currentSnapshot: ɵStyleDataMap = new Map();\n\n constructor(\n public element: any, public keyframes: Array<ɵStyleDataMap>,\n public options: {[key: string]: string|number},\n private _specialStyles?: SpecialCasedStyles|null) {\n this._duration = <number>options['duration'];\n this._delay = <number>options['delay'] || 0;\n this.time = this._duration + this._delay;\n }\n\n private _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n\n init(): void {\n this._buildPlayer();\n this._preparePlayerBeforeStart();\n }\n\n private _buildPlayer(): void {\n if (this._initialized) return;\n this._initialized = true;\n\n const keyframes = this.keyframes;\n // @ts-expect-error overwriting a readonly property\n this.domPlayer = this._triggerWebAnimation(this.element, keyframes, this.options);\n this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : new Map();\n this.domPlayer.addEventListener('finish', () => this._onFinish());\n }\n\n private _preparePlayerBeforeStart() {\n // this is required so that the player doesn't start to animate right away\n if (this._delay) {\n this._resetDomPlayerState();\n } else {\n this.domPlayer.pause();\n }\n }\n\n private _convertKeyframesToObject(keyframes: Array<ɵStyleDataMap>): any[] {\n const kfs: any[] = [];\n keyframes.forEach(frame => {\n kfs.push(Object.fromEntries(frame));\n });\n return kfs;\n }\n\n /** @internal */\n _triggerWebAnimation(element: any, keyframes: Array<ɵStyleDataMap>, options: any): DOMAnimation {\n // jscompiler doesn't seem to know animate is a native property because it's not fully\n // supported yet across common browsers (we polyfill it for Edge/Safari) [CL #143630929]\n return element['animate'](this._convertKeyframesToObject(keyframes), options) as DOMAnimation;\n }\n\n onStart(fn: () => void): void {\n this._originalOnStartFns.push(fn);\n this._onStartFns.push(fn);\n }\n\n onDone(fn: () => void): void {\n this._originalOnDoneFns.push(fn);\n this._onDoneFns.push(fn);\n }\n\n onDestroy(fn: () => void): void {\n this._onDestroyFns.push(fn);\n }\n\n play(): void {\n this._buildPlayer();\n if (!this.hasStarted()) {\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n this._started = true;\n if (this._specialStyles) {\n this._specialStyles.start();\n }\n }\n this.domPlayer.play();\n }\n\n pause(): void {\n this.init();\n this.domPlayer.pause();\n }\n\n finish(): void {\n this.init();\n if (this._specialStyles) {\n this._specialStyles.finish();\n }\n this._onFinish();\n this.domPlayer.finish();\n }\n\n reset(): void {\n this._resetDomPlayerState();\n this._destroyed = false;\n this._finished = false;\n this._started = false;\n this._onStartFns = this._originalOnStartFns;\n this._onDoneFns = this._originalOnDoneFns;\n }\n\n private _resetDomPlayerState() {\n if (this.domPlayer) {\n this.domPlayer.cancel();\n }\n }\n\n restart(): void {\n this.reset();\n this.play();\n }\n\n hasStarted(): boolean {\n return this._started;\n }\n\n destroy(): void {\n if (!this._destroyed) {\n this._destroyed = true;\n this._resetDomPlayerState();\n this._onFinish();\n if (this._specialStyles) {\n this._specialStyles.destroy();\n }\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n\n setPosition(p: number): void {\n if (this.domPlayer === undefined) {\n this.init();\n }\n this.domPlayer.currentTime = p * this.time;\n }\n\n getPosition(): number {\n return this.domPlayer.currentTime / this.time;\n }\n\n get totalTime(): number {\n return this._delay + this._duration;\n }\n\n beforeDestroy() {\n const styles: ɵStyleDataMap = new Map();\n if (this.hasStarted()) {\n // note: this code is invoked only when the `play` function was called prior to this\n // (thus `hasStarted` returns true), this implies that the code that initializes\n // `_finalKeyframe` has also been executed and the non-null assertion can be safely used here\n const finalKeyframe = this._finalKeyframe!;\n finalKeyframe.forEach((val, prop) => {\n if (prop !== 'offset') {\n styles.set(prop, this._finished ? val : computeStyle(this.element, prop));\n }\n });\n }\n\n this.currentSnapshot = styles;\n }\n\n /** @internal */\n triggerCallback(phaseName: string): void {\n const methods = phaseName === 'start' ? this._onStartFns : this._onDoneFns;\n methods.forEach(fn => fn());\n methods.length = 0;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationPlayer, ɵStyleDataMap} from '@angular/animations';\n\nimport {allowPreviousPlayerStylesMerge, balancePreviousStylesIntoKeyframes, camelCaseToDashCase, copyStyles, normalizeKeyframes} from '../../util';\nimport {AnimationDriver} from '../animation_driver';\nimport {containsElement, getParentElement, invokeQuery, validateStyleProperty, validateWebAnimatableStyleProperty} from '../shared';\nimport {packageNonAnimatableStyles} from '../special_cased_styles';\n\nimport {WebAnimationsPlayer} from './web_animations_player';\n\nexport class WebAnimationsDriver implements AnimationDriver {\n validateStyleProperty(prop: string): boolean {\n // Perform actual validation in dev mode only, in prod mode this check is a noop.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n return validateStyleProperty(prop);\n }\n return true;\n }\n\n validateAnimatableStyleProperty(prop: string): boolean {\n // Perform actual validation in dev mode only, in prod mode this check is a noop.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const cssProp = camelCaseToDashCase(prop);\n return validateWebAnimatableStyleProperty(cssProp);\n }\n return true;\n }\n\n matchesElement(_element: any, _selector: string): boolean {\n // This method is deprecated and no longer in use so we return false.\n return false;\n }\n\n containsElement(elm1: any, elm2: any): boolean {\n return containsElement(elm1, elm2);\n }\n\n getParentElement(element: unknown): unknown {\n return getParentElement(element);\n }\n\n query(element: any, selector: string, multi: boolean): any[] {\n return invokeQuery(element, selector, multi);\n }\n\n computeStyle(element: any, prop: string, defaultValue?: string): string {\n return (window.getComputedStyle(element) as any)[prop] as string;\n }\n\n animate(\n element: any, keyframes: Array<Map<string, string|number>>, duration: number, delay: number,\n easing: string, previousPlayers: AnimationPlayer[] = []): AnimationPlayer {\n const fill = delay == 0 ? 'both' : 'forwards';\n const playerOptions: {[key: string]: string|number} = {duration, delay, fill};\n // we check for this to avoid having a null|undefined value be present\n // for the easing (which results in an error for certain browsers #9752)\n if (easing) {\n playerOptions['easing'] = easing;\n }\n\n const previousStyles: ɵStyleDataMap = new Map();\n const previousWebAnimationPlayers = <WebAnimationsPlayer[]>previousPlayers.filter(\n player => player instanceof WebAnimationsPlayer);\n if (allowPreviousPlayerStylesMerge(duration, delay)) {\n previousWebAnimationPlayers.forEach(player => {\n player.currentSnapshot.forEach((val, prop) => previousStyles.set(prop, val));\n });\n }\n\n let _keyframes = normalizeKeyframes(keyframes).map(styles => copyStyles(styles));\n _keyframes = balancePreviousStylesIntoKeyframes(element, _keyframes, previousStyles);\n const specialStyles = packageNonAnimatableStyles(element, _keyframes);\n return new WebAnimationsPlayer(element, _keyframes, playerOptions, specialStyles);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationBuilder, AnimationFactory, AnimationMetadata, AnimationOptions, AnimationPlayer, sequence} from '@angular/animations';\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable, RendererFactory2, RendererType2, ViewEncapsulation} from '@angular/core';\n\nimport {AnimationRenderer} from './animation_renderer';\n\n@Injectable()\nexport class BrowserAnimationBuilder extends AnimationBuilder {\n private _nextAnimationId = 0;\n private _renderer: AnimationRenderer;\n\n constructor(rootRenderer: RendererFactory2, @Inject(DOCUMENT) doc: any) {\n super();\n const typeData =\n {id: '0', encapsulation: ViewEncapsulation.None, styles: [], data: {animation: []}} as\n RendererType2;\n this._renderer = rootRenderer.createRenderer(doc.body, typeData) as AnimationRenderer;\n }\n\n build(animation: AnimationMetadata|AnimationMetadata[]): AnimationFactory {\n const id = this._nextAnimationId.toString();\n this._nextAnimationId++;\n const entry = Array.isArray(animation) ? sequence(animation) : animation;\n issueAnimationCommand(this._renderer, null, id, 'register', [entry]);\n return new BrowserAnimationFactory(id, this._renderer);\n }\n}\n\nexport class BrowserAnimationFactory extends AnimationFactory {\n constructor(private _id: string, private _renderer: AnimationRenderer) {\n super();\n }\n\n create(element: any, options?: AnimationOptions): AnimationPlayer {\n return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);\n }\n}\n\nexport class RendererAnimationPlayer implements AnimationPlayer {\n public parentPlayer: AnimationPlayer|null = null;\n private _started = false;\n\n constructor(\n public id: string, public element: any, options: AnimationOptions,\n private _renderer: AnimationRenderer) {\n this._command('create', options);\n }\n\n private _listen(eventName: string, callback: (event: any) => any): () => void {\n return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback);\n }\n\n private _command(command: string, ...args: any[]) {\n return issueAnimationCommand(this._renderer, this.element, this.id, command, args);\n }\n\n onDone(fn: () => void): void {\n this._listen('done', fn);\n }\n\n onStart(fn: () => void): void {\n this._listen('start', fn);\n }\n\n onDestroy(fn: () => void): void {\n this._listen('destroy', fn);\n }\n\n init(): void {\n this._command('init');\n }\n\n hasStarted(): boolean {\n return this._started;\n }\n\n play(): void {\n this._command('play');\n this._started = true;\n }\n\n pause(): void {\n this._command('pause');\n }\n\n restart(): void {\n this._command('restart');\n }\n\n finish(): void {\n this._command('finish');\n }\n\n destroy(): void {\n this._command('destroy');\n }\n\n reset(): void {\n this._command('reset');\n this._started = false;\n }\n\n setPosition(p: number): void {\n this._command('setPosition', p);\n }\n\n getPosition(): number {\n return this._renderer.engine.players[+this.id]?.getPosition() ?? 0;\n }\n\n public totalTime = 0;\n}\n\nfunction issueAnimationCommand(\n renderer: AnimationRenderer, element: any, id: string, command: string, args: any[]): any {\n return renderer.setProperty(element, `@@${id}:${command}`, args);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {AnimationTriggerMetadata} from '@angular/animations';\nimport {ɵAnimationEngine as AnimationEngine} from '@angular/animations/browser';\nimport {Injectable, NgZone, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2} from '@angular/core';\n\nconst ANIMATION_PREFIX = '@';\nconst DISABLE_ANIMATIONS_FLAG = '@.disabled';\n\n// Define a recursive type to allow for nested arrays of `AnimationTriggerMetadata`. Note that an\n// interface declaration is used as TypeScript prior to 3.7 does not support recursive type\n// references, see https://github.com/microsoft/TypeScript/pull/33050 for details.\ntype NestedAnimationTriggerMetadata = AnimationTriggerMetadata|RecursiveAnimationTriggerMetadata;\ninterface RecursiveAnimationTriggerMetadata extends Array<NestedAnimationTriggerMetadata> {}\n\n@Injectable()\nexport class AnimationRendererFactory implements RendererFactory2 {\n private _currentId: number = 0;\n private _microtaskId: number = 1;\n private _animationCallbacksBuffer: [(e: any) => any, any][] = [];\n private _rendererCache = new Map<Renderer2, BaseAnimationRenderer>();\n private _cdRecurDepth = 0;\n private promise: Promise<any> = Promise.resolve(0);\n\n constructor(\n private delegate: RendererFactory2, private engine: AnimationEngine, private _zone: NgZone) {\n engine.onRemovalComplete = (element: any, delegate: Renderer2) => {\n // Note: if a component element has a leave animation, and a host leave animation,\n // the view engine will call `removeChild` for the parent\n // component renderer as well as for the child component renderer.\n // Therefore, we need to check if we already removed the element.\n const parentNode = delegate?.parentNode(element);\n if (parentNode) {\n delegate.removeChild(parentNode, element);\n }\n };\n }\n\n createRenderer(hostElement: any, type: RendererType2): Renderer2 {\n const EMPTY_NAMESPACE_ID = '';\n\n // cache the delegates to find out which cached delegate can\n // be used by which cached renderer\n const delegate = this.delegate.createRenderer(hostElement, type);\n if (!hostElement || !type || !type.data || !type.data['animation']) {\n let renderer: BaseAnimationRenderer|undefined = this._rendererCache.get(delegate);\n if (!renderer) {\n // Ensure that the renderer is removed from the cache on destroy\n // since it may contain references to detached DOM nodes.\n const onRendererDestroy = () => this._rendererCache.delete(delegate);\n renderer =\n new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine, onRendererDestroy);\n // only cache this result when the base renderer is used\n this._rendererCache.set(delegate, renderer);\n }\n return renderer;\n }\n\n const componentId = type.id;\n const namespaceId = type.id + '-' + this._currentId;\n this._currentId++;\n\n this.engine.register(namespaceId, hostElement);\n\n const registerTrigger = (trigger: NestedAnimationTriggerMetadata) => {\n if (Array.isArray(trigger)) {\n trigger.forEach(registerTrigger);\n } else {\n this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger);\n }\n };\n const animationTriggers = type.data['animation'] as NestedAnimationTriggerMetadata[];\n animationTriggers.forEach(registerTrigger);\n\n return new AnimationRenderer(this, namespaceId, delegate, this.engine);\n }\n\n begin() {\n this._cdRecurDepth++;\n if (this.delegate.begin) {\n this.delegate.begin();\n }\n }\n\n private _scheduleCountTask() {\n // always use promise to schedule microtask instead of use Zone\n this.promise.then(() => {\n this._microtaskId++;\n });\n }\n\n /** @internal */\n scheduleListenerCallback(count: number, fn: (e: any) => any, data: any) {\n if (count >= 0 && count < this._microtaskId) {\n this._zone.run(() => fn(data));\n return;\n }\n\n if (this._animationCallbacksBuffer.length == 0) {\n Promise.resolve(null).then(() => {\n this._zone.run(() => {\n this._animationCallbacksBuffer.forEach(tuple => {\n const [fn, data] = tuple;\n fn(data);\n });\n this._animationCallbacksBuffer = [];\n });\n });\n }\n\n this._animationCallbacksBuffer.push([fn, data]);\n }\n\n end() {\n this._cdRecurDepth--;\n\n // this is to prevent animations from running twice when an inner\n // component does CD when a parent component instead has inserted it\n if (this._cdRecurDepth == 0) {\n this._zone.runOutsideAngular(() => {\n this._scheduleCountTask();\n this.engine.flush(this._microtaskId);\n });\n }\n if (this.delegate.end) {\n this.delegate.end();\n }\n }\n\n whenRenderingDone(): Promise<any> {\n return this.engine.whenRenderingDone();\n }\n}\n\nexport class BaseAnimationRenderer implements Renderer2 {\n constructor(\n protected namespaceId: string, public delegate: Renderer2, public engine: AnimationEngine,\n private _onDestroy?: () => void) {\n this.destroyNode = this.delegate.destroyNode ? (n) => delegate.destroyNode!(n) : null;\n }\n\n get data() {\n return this.delegate.data;\n }\n\n destroyNode: ((n: any) => void)|null;\n\n destroy(): void {\n this.engine.destroy(this.namespaceId, this.delegate);\n this.delegate.destroy();\n this._onDestroy?.();\n }\n\n createElement(name: string, namespace?: string|null|undefined) {\n return this.delegate.createElement(name, namespace);\n }\n\n createComment(value: string) {\n return this.delegate.createComment(value);\n }\n\n createText(value: string) {\n return this.delegate.createText(value);\n }\n\n appendChild(parent: any, newChild: any): void {\n this.delegate.appendChild(parent, newChild);\n this.engine.onInsert(this.namespaceId, newChild, parent, false);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any, isMove: boolean = true): void {\n this.delegate.insertBefore(parent, newChild, refChild);\n // If `isMove` true than we should animate this insert.\n this.engine.onInsert(this.namespaceId, newChild, parent, isMove);\n }\n\n removeChild(parent: any, oldChild: any, isHostElement: boolean): void {\n this.engine.onRemove(this.namespaceId, oldChild, this.delegate, isHostElement);\n }\n\n selectRootElement(selectorOrNode: any, preserveContent?: boolean) {\n return this.delegate.selectRootElement(selectorOrNode, preserveContent);\n }\n\n parentNode(node: any) {\n return this.delegate.parentNode(node);\n }\n\n nextSibling(node: any) {\n return this.delegate.nextSibling(node);\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string|null|undefined): void {\n this.delegate.setAttribute(el, name, value, namespace);\n }\n\n removeAttribute(el: any, name: string, namespace?: string|null|undefined): void {\n this.delegate.removeAttribute(el, name, namespace);\n }\n\n addClass(el: any, name: string): void {\n this.delegate.addClass(el, name);\n }\n\n removeClass(el: any, name: string): void {\n this.delegate.removeClass(el, name);\n }\n\n setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2|undefined): void {\n this.delegate.setStyle(el, style, value, flags);\n }\n\n removeStyle(el: any, style: string, flags?: RendererStyleFlags2|undefined): void {\n this.delegate.removeStyle(el, style, flags);\n }\n\n setProperty(el: any, name: string, value: any): void {\n if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) {\n this.disableAnimations(el, !!value);\n } else {\n this.delegate.setProperty(el, name, value);\n }\n }\n\n setValue(node: any, value: string): void {\n this.delegate.setValue(node, value);\n }\n\n listen(target: any, eventName: string, callback: (event: any) => boolean | void): () => void {\n return this.delegate.listen(target, eventName, callback);\n }\n\n protected disableAnimations(element: any, value: boolean) {\n this.engine.disableAnimations(element, value);\n }\n}\n\nexport class AnimationRenderer extends BaseAnimationRenderer implements Renderer2 {\n constructor(\n public factory: AnimationRendererFactory, namespaceId: string, delegate: Renderer2,\n engine: AnimationEngine, onDestroy?: () => void) {\n super(namespaceId, delegate, engine, onDestroy);\n this.namespaceId = namespaceId;\n }\n\n override setProperty(el: any, name: string, value: any): void {\n if (name.charAt(0) == ANIMATION_PREFIX) {\n if (name.charAt(1) == '.' && name == DISABLE_ANIMATIONS_FLAG) {\n value = value === undefined ? true : !!value;\n this.disableAnimations(el, value as boolean);\n } else {\n this.engine.process(this.namespaceId, el, name.slice(1), value);\n }\n } else {\n this.delegate.setProperty(el, name, value);\n }\n }\n\n override listen(\n target: 'window'|'document'|'body'|any, eventName: string,\n callback: (event: any) => any): () => void {\n if (eventName.charAt(0) == ANIMATION_PREFIX) {\n const element = resolveElementFromTarget(target);\n let name = eventName.slice(1);\n let phase = '';\n // @listener.phase is for trigger animation callbacks\n // @@listener is for animation builder callbacks\n if (name.charAt(0) != ANIMATION_PREFIX) {\n [name, phase] = parseTriggerCallbackName(name);\n }\n return this.engine.listen(this.namespaceId, element, name, phase, event => {\n const countId = (event as any)['_data'] || -1;\n this.factory.scheduleListenerCallback(countId, callback, event);\n });\n }\n return this.delegate.listen(target, eventName, callback);\n }\n}\n\nfunction resolveElementFromTarget(target: 'window'|'document'|'body'|any): any {\n switch (target) {\n case 'body':\n return document.body;\n case 'document':\n return document;\n case 'window':\n return window;\n default:\n return target;\n }\n}\n\nfunction parseTriggerCallbackName(triggerName: string) {\n const dotIndex = triggerName.indexOf('.');\n const trigger = triggerName.substring(0, dotIndex);\n const phase = triggerName.slice(dotIndex + 1);\n return [trigger, phase];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AnimationBuilder} from '@angular/animations';\nimport {AnimationDriver, ɵAnimationEngine as AnimationEngine, ɵAnimationStyleNormalizer as AnimationStyleNormalizer, ɵNoopAnimationDriver as NoopAnimationDriver, ɵWebAnimationsDriver as WebAnimationsDriver, ɵWebAnimationsStyleNormalizer as WebAnimationsStyleNormalizer} from '@angular/animations/browser';\nimport {DOCUMENT} from '@angular/common';\nimport {ANIMATION_MODULE_TYPE, ApplicationRef, Inject, Injectable, NgZone, OnDestroy, Provider, RendererFactory2} from '@angular/core';\nimport {ɵDomRendererFactory2 as DomRendererFactory2} from '@angular/platform-browser';\n\nimport {BrowserAnimationBuilder} from './animation_builder';\nimport {AnimationRendererFactory} from './animation_renderer';\n\n@Injectable()\nexport class InjectableAnimationEngine extends AnimationEngine implements OnDestroy {\n // The `ApplicationRef` is injected here explicitly to force the dependency ordering.\n // Since the `ApplicationRef` should be created earlier before the `AnimationEngine`, they\n // both have `ngOnDestroy` hooks and `flush()` must be called after all views are destroyed.\n constructor(\n @Inject(DOCUMENT) doc: any, driver: AnimationDriver, normalizer: AnimationStyleNormalizer,\n appRef: ApplicationRef) {\n super(doc.body, driver, normalizer);\n }\n\n ngOnDestroy(): void {\n this.flush();\n }\n}\n\nexport function instantiateDefaultStyleNormalizer() {\n return new WebAnimationsStyleNormalizer();\n}\n\nexport function instantiateRendererFactory(\n renderer: DomRendererFactory2, engine: AnimationEngine, zone: NgZone) {\n return new AnimationRendererFactory(renderer, engine, zone);\n}\n\nconst SHARED_ANIMATION_PROVIDERS: Provider[] = [\n {provide: AnimationBuilder, useClass: BrowserAnimationBuilder},\n {provide: AnimationStyleNormalizer, useFactory: instantiateDefaultStyleNormalizer},\n {provide: AnimationEngine, useClass: InjectableAnimationEngine}, {\n provide: RendererFactory2,\n useFactory: instantiateRendererFactory,\n deps: [DomRendererFactory2, AnimationEngine, NgZone]\n }\n];\n\n/**\n * Separate providers from the actual module so that we can do a local modification in Google3 to\n * include them in the BrowserModule.\n */\nexport const BROWSER_ANIMATIONS_PROVIDERS: Provider[] = [\n {provide: AnimationDriver, useFactory: () => new WebAnimationsDriver()},\n {provide: ANIMATION_MODULE_TYPE, useValue: 'BrowserAnimations'}, ...SHARED_ANIMATION_PROVIDERS\n];\n\n/**\n * Separate providers from the actual module so that we can do a local modification in Google3 to\n * include them in the BrowserTestingModule.\n */\nexport const BROWSER_NOOP_ANIMATIONS_PROVIDERS: Provider[] = [\n {provide: AnimationDriver, useClass: NoopAnimationDriver},\n {provide: ANIMATION_MODULE_TYPE, useValue: 'NoopAnimations'}, ...SHARED_ANIMATION_PROVIDERS\n];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ModuleWithProviders, NgModule, Provider} from '@angular/core';\nimport {BrowserModule} from '@angular/platform-browser';\n\nimport {BROWSER_ANIMATIONS_PROVIDERS, BROWSER_NOOP_ANIMATIONS_PROVIDERS} from './providers';\n\n/**\n * Object used to configure the behavior of {@link BrowserAnimationsModule}\n * @publicApi\n */\nexport interface BrowserAnimationsModuleConfig {\n /**\n * Whether animations should be disabled. Passing this is identical to providing the\n * `NoopAnimationsModule`, but it can be controlled based on a runtime value.\n */\n disableAnimations?: boolean;\n}\n\n/**\n * Exports `BrowserModule` with additional [dependency-injection providers](guide/glossary#provider)\n * for use with animations. See [Animations](guide/animations).\n * @publicApi\n */\n@NgModule({\n exports: [BrowserModule],\n providers: BROWSER_ANIMATIONS_PROVIDERS,\n})\nexport class BrowserAnimationsModule {\n /**\n * Configures the module based on the specified object.\n *\n * @param config Object used to configure the behavior of the `BrowserAnimationsModule`.\n * @see `BrowserAnimationsModuleConfig`\n *\n * @usageNotes\n * When registering the `BrowserAnimationsModule`, you can use the `withConfig`\n * function as follows:\n * ```\n * @NgModule({\n * imports: [BrowserAnimationsModule.withConfig(config)]\n * })\n * class MyNgModule {}\n * ```\n */\n static withConfig(config: BrowserAnimationsModuleConfig):\n ModuleWithProviders<BrowserAnimationsModule> {\n return {\n ngModule: BrowserAnimationsModule,\n providers: config.disableAnimations ? BROWSER_NOOP_ANIMATIONS_PROVIDERS :\n BROWSER_ANIMATIONS_PROVIDERS\n };\n }\n}\n\n/**\n * Returns the set of [dependency-injection providers](guide/glossary#provider)\n * to enable animations in an application. See [animations guide](guide/animations)\n * to learn more about animations in Angular.\n *\n * @usageNotes\n *\n * The function is useful when you want to enable animations in an application\n * bootstrapped using the `bootstrapApplication` function. In this scenario there\n * is no need to import the `BrowserAnimationsModule` NgModule at all, just add\n * providers returned by this function to the `providers` list as show below.\n *\n * ```typescript\n * bootstrapApplication(RootComponent, {\n * providers: [\n * provideAnimations()\n * ]\n * });\n * ```\n *\n * @publicApi\n */\nexport function provideAnimations(): Provider[] {\n // Return a copy to prevent changes to the original array in case any in-place\n // alterations are performed to the `provideAnimations` call results in app code.\n return [...BROWSER_ANIMATIONS_PROVIDERS];\n}\n\n/**\n * A null player that must be imported to allow disabling of animations.\n * @publicApi\n */\n@NgModule({\n exports: [BrowserModule],\n providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,\n})\nexport class NoopAnimationsModule {\n}\n\n/**\n * Returns the set of [dependency-injection providers](guide/glossary#provider)\n * to disable animations in an application. See [animations guide](guide/animations)\n * to learn more about animations in Angular.\n *\n * @usageNotes\n *\n * The function is useful when you want to bootstrap an application using\n * the `bootstrapApplication` function, but you need to disable animations\n * (for example, when running tests).\n *\n * ```typescript\n * bootstrapApplication(RootComponent, {\n * providers: [\n * provideNoopAnimations()\n * ]\n * });\n * ```\n *\n * @publicApi\n */\nexport function provideNoopAnimations(): Provider[] {\n // Return a copy to prevent changes to the original array in case any in-place\n // alterations are performed to the `provideNoopAnimations` call results in app code.\n return [...BROWSER_NOOP_ANIMATIONS_PROVIDERS];\n}\n","import {\r\n HttpClientModule,\r\n} from '@angular/common/http';\r\nimport { NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport {BrowserModule, HammerModule} from '@angular/platform-browser';\r\nimport {BrowserAnimationsModule} from '@angular/platform-browser/animations';\r\nimport {\r\n TranslateLoader,\r\n TranslateModule,\r\n} from '@ngx-translate/core';\r\nimport {\r\n UIRouterUpgradeModule,\r\n} from '@uirouter/angular-hybrid';\r\nimport {\r\n AlertModule,\r\n} from 'ngx-bootstrap/alert';\r\nimport {\r\n CollapseModule,\r\n} from 'ngx-bootstrap/collapse';\r\nimport {\r\n BsDatepickerModule,\r\n} from 'ngx-bootstrap/datepicker';\r\nimport {\r\n ModalModule,\r\n} from 'ngx-bootstrap/modal';\r\nimport {\r\n PaginationModule,\r\n} from 'ngx-bootstrap/pagination';\r\nimport {\r\n TabsModule,\r\n} from 'ngx-bootstrap/tabs';\r\nimport {\r\n ToastaConfig,\r\n ToastaModule,\r\n} from 'ngx-toasta';\r\nimport {\r\n AprimaTranslateLoader,\r\n webcommonHttpInterceptorProviders,\r\n} from 'webcommon/legacy-common';\r\n\r\nimport { HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';\r\n\r\nimport { BaseHammerConfig } from 'webcommon/core-ui';\r\n\r\nconst defaultToastaConfig: ToastaConfig = {\r\n limit: 5,\r\n position: 'top-right',\r\n showClose: true,\r\n showDuration: true,\r\n theme: 'bootstrap',\r\n timeout: 5000,\r\n};\r\n\r\n@NgModule({\r\n imports: [\r\n // For now, all these imports are only supposed to be imported a single time in\r\n // the app.\r\n // The intent is that the AppModule in the app can just import this module, and get these.\r\n // And this shouldn't be imported anywhere else.\r\n //\r\n // The main problem to avoid becomes obvious if BrowserModule, or some of these other modules\r\n // also get imported in a lazy-loaded module;\r\n // then an error will get thrown when navigating to that lazy-loaded module.\r\n BrowserModule,\r\n BrowserAnimationsModule,\r\n HttpClientModule,\r\n AlertModule.forRoot(),\r\n BsDatepickerModule.forRoot(),\r\n CollapseModule.forRoot(),\r\n ModalModule.forRoot(),\r\n PaginationModule.forRoot(),\r\n TabsModule.forRoot(),\r\n ToastaModule.forRoot(),\r\n TranslateModule.forRoot({\r\n loader: {\r\n provide: TranslateLoader,\r\n useClass: AprimaTranslateLoader,\r\n },\r\n }),\r\n UIRouterUpgradeModule.forRoot(),\r\n HammerModule,\r\n ],\r\n providers: [\r\n {\r\n // This overrides the default Hammer config.\r\n // This may need to be moved up to the root project module if this config\r\n // isn't getting loaded up correctly there, but for now, it should work across all of webcommon.\r\n provide: HAMMER_GESTURE_CONFIG,\r\n useClass: BaseHammerConfig,\r\n },\r\n {\r\n provide: ToastaConfig,\r\n useValue: defaultToastaConfig,\r\n },\r\n ...webcommonHttpInterceptorProviders,\r\n ],\r\n})\r\nexport class WebCommonModule {\r\n // This is using the same constructor pattern as BrowserModule\r\n constructor(\r\n @Optional() @SkipSelf() parentModule: WebCommonModule | null,\r\n ) {\r\n if (parentModule) {\r\n throw new Error(\r\n `WebCommonModule is already loaded. Import it only once, usually in the AppModule only`);\r\n }\r\n }\r\n}\r\n","import {\r\n DoBootstrap,\r\n NgModule,\r\n NgZone,\r\n} from '@angular/core';\r\nimport { UrlService } from '@uirouter/core';\r\n\r\nimport { PatientPortalAngularJSModule } from './ajs/ajs.module';\r\nimport { PatientPortalConfigurationRepository } from './core';\r\nimport {\r\n CoreModule,\r\n LoginModule,\r\n TelehealthModule,\r\n DashboardModule,\r\n} from './modules.index';\r\n\r\nimport { imports as conditionalImports } from './conditional.module';\r\n\r\nimport {\r\n WebCommonModule,\r\n} from 'webcommon';\r\nimport {\r\n WebBridgeService,\r\n} from 'webcommon/common-api';\r\nimport {\r\n AprimaCacheService,\r\n BridgeService,\r\n ConfigurationRepository,\r\n DeviceSettingsRepository,\r\n LogInService,\r\n} from 'webcommon/legacy-common';\r\nimport { currentBsVersion, setTheme } from 'ngx-bootstrap/utils';\r\n\r\n@NgModule({\r\n imports: [\r\n WebCommonModule,\r\n CoreModule,\r\n LoginModule,\r\n PatientPortalAngularJSModule,\r\n TelehealthModule,\r\n DashboardModule,\r\n ...conditionalImports,\r\n ],\r\n})\r\nexport class AppModule implements DoBootstrap {\r\n constructor(\r\n private aprimaCacheService: AprimaCacheService,\r\n private bridgeService: BridgeService,\r\n private configurationRepository: ConfigurationRepository,\r\n private deviceSettingsRepository: DeviceSettingsRepository,\r\n private logInService: LogInService,\r\n private ngZone: NgZone,\r\n private portalConfigurationRepository: PatientPortalConfigurationRepository,\r\n private urlService: UrlService,\r\n private webBridgeService: WebBridgeService,\r\n ) { }\r\n\r\n ngDoBootstrap() {\r\n this.configurationRepository.loadConfiguration(this.portalConfigurationRepository);\r\n this.deviceSettingsRepository.loadConfiguration({\r\n isBrowser: true,\r\n isBrowserOrOverride: true,\r\n isDevice: false,\r\n isDeviceOrOverride: false,\r\n isPhone: false,\r\n isPhoneOrOverride: false,\r\n isTablet: false,\r\n isTabletOrOverride: false,\r\n\r\n isAndroid: false,\r\n isIos: false,\r\n isPrm: false,\r\n isStandaloneBrowser: true,\r\n });\r\n this.bridgeService.loadConfiguration(this.webBridgeService);\r\n this.aprimaCacheService.initialize();\r\n this.logInService.setDefaultRedirect();\r\n\r\n // Set the theme of ngx-bootstrap to bs3, because we are still stuck on bs3 css.\r\n // In the current version of ngx-bootstrap, it was defaulting to bs4.\r\n // (Also, there can be a bit of a race condition for the default,\r\n // since the guess it makes is based on certain css being loaded on the page.\r\n // look at https://github.com/valor-software/ngx-bootstrap/blob/v8.0.0/src/utils/theme-provider.ts)\r\n // This could maybe happen in main.ts as well, I'm not sure what the difference would be\r\n console.log('guessed bootstrap version for ngx-bootstrap:', currentBsVersion());\r\n setTheme('bs3');\r\n console.log('manually set bootstrap version for ngx-bootstrap:', currentBsVersion());\r\n\r\n // This UrlService setup logic previously was run not inside of setTimeout(),\r\n // but I changed it because of an issue:\r\n // In the case of going directly to the route of a lazy-loaded module (like refreshing the page on that route),\r\n // this code was running too early, and there would be an error throw like this:\r\n // Error: Trying to get the Angular injector before bootstrapping the corresponding Angular module.\r\n // If it runs at this point in time instead, then the bootstrapping will be done, and there won't be an error.\r\n // For non-lazy-loaded routes, they should still work just fine.\r\n //\r\n // Another potential option would be to have this run in the callback of the Output angularInitialized,\r\n // by doing something like this in main.ts:\r\n // ngModule.run(['CustomModuleRunService', (CustomModuleRunService: any) => {\r\n // CustomModuleRunService.add(['$urlService', ($urlService: UrlService) => {\r\n // $urlService.listen();\r\n // $urlService.sync();\r\n // }]);\r\n // }]);\r\n //\r\n // Another potential option could be in a setTimeout() in bootstrapModule(AppModule).then()\r\n // Some info from this helped as well: https://github.com/ui-router/angular-hybrid/issues/98,\r\n // even though the code doesn't look the same\r\n //\r\n // Another potential option would be to call this without setTimeout() in ForceLoadAngularComponent.ngOnInit()\r\n // because that would be late enough in the process to not cause this error case.\r\n setTimeout(() => {\r\n this.ngZone.run(() => {\r\n this.urlService.listen();\r\n this.urlService.sync();\r\n });\r\n });\r\n }\r\n}\r\n","import {\r\n enableProdMode,\r\n StaticProvider,\r\n} from '@angular/core';\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { downgradeModule } from '@angular/upgrade/static';\r\n\r\nimport { PatientPortalAngularJSModule } from '@app/ajs/ajs.module';\r\nimport { AppModule } from '@app/app.module';\r\nimport { environment } from './environments/environment';\r\n\r\n// TODO: use npm package for hammerjs and propagating-hammerjs, and delete the bower packages,\r\n// and most likely load them up here:\r\n// import 'hammerjs';\r\n// import 'propagating-hammerjs';\r\n// also, angular-hammer bower pkg depends on hammerjs, so I think it will complain that\r\n// it's missing a dependency if hammerjs bower pkg is deleted, but maybe there's a way around that.\r\n// also could install @types/hammerjs if the types need to be referenced somewhere\r\n// also need to migrate app.config.hammer to typescript as well\r\n\r\ndeclare var angular: angular.IAngularStatic;\r\n\r\nif (environment.production) {\r\n console.log('enabling ProdMode');\r\n enableProdMode();\r\n} else {\r\n console.log('not enabling ProdMode');\r\n}\r\n\r\nfunction bootstrapFn(extraProviders: StaticProvider[]) {\r\n // Angular CLI automatically converts this into platformBrowser().bootstrapModule when AOT compiled.\r\n const promise = platformBrowserDynamic(extraProviders).bootstrapModule(AppModule);\r\n promise.catch((err) => console.error(err));\r\n return promise;\r\n}\r\n\r\nconst ngModule = angular.module('ngPatientPortal', [\r\n downgradeModule(bootstrapFn),\r\n]);\r\nPatientPortalAngularJSModule.registerAngularJS(ngModule);\r\n\r\nangular.bootstrap(document.body, ['all']);\r\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 9674;\nmodule.exports = webpackEmptyContext;"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,329,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,387,388,389,390,391,393,394,395,396,397,398,408,421,445,446,447,448,449,450,451,452,453,454,455,613,752,791,792,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1043,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1175]}