{"ast":null,"code":"import { noop } from '../common/common';\nimport { services } from '../common/coreservices';\n/**\n * A [[TransitionHookFn]] which waits for the views to load\n *\n * Registered using `transitionService.onStart({}, loadEnteringViews);`\n *\n * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.\n * In angular 1, this includes loading the templates.\n */\n\nvar loadEnteringViews = function (transition) {\n  var $q = services.$q;\n  var enteringViews = transition.views('entering');\n  if (!enteringViews.length) return;\n  return $q.all(enteringViews.map(function (view) {\n    return $q.when(view.load());\n  })).then(noop);\n};\n\nexport var registerLoadEnteringViews = function (transitionService) {\n  return transitionService.onFinish({}, loadEnteringViews);\n};\n/**\n * A [[TransitionHookFn]] which activates the new views when a transition is successful.\n *\n * Registered using `transitionService.onSuccess({}, activateViews);`\n *\n * After a transition is complete, this hook deactivates the old views from the previous state,\n * and activates the new views from the destination state.\n *\n * See [[ViewService]]\n */\n\nvar activateViews = function (transition) {\n  var enteringViews = transition.views('entering');\n  var exitingViews = transition.views('exiting');\n  if (!enteringViews.length && !exitingViews.length) return;\n  var $view = transition.router.viewService;\n  exitingViews.forEach(function (vc) {\n    return $view.deactivateViewConfig(vc);\n  });\n  enteringViews.forEach(function (vc) {\n    return $view.activateViewConfig(vc);\n  });\n  $view.sync();\n};\n\nexport var registerActivateViews = function (transitionService) {\n  return transitionService.onSuccess({}, activateViews);\n};","map":{"version":3,"sources":["D:/Development/Work/CENOS/cenos-ui/node_modules/@uirouter/core/__ivy_ngcc__/lib-esm/hooks/views.js"],"names":["noop","services","loadEnteringViews","transition","$q","enteringViews","views","length","all","map","view","when","load","then","registerLoadEnteringViews","transitionService","onFinish","activateViews","exitingViews","$view","router","viewService","forEach","vc","deactivateViewConfig","activateViewConfig","sync","registerActivateViews","onSuccess"],"mappings":"AAAA,SAASA,IAAT,QAAqB,kBAArB;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAIC,iBAAiB,GAAG,UAAUC,UAAV,E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6B;AAC5D,SAAOA,iBAAiB,CAACa,SAAlB,CAA4B,EAA5B,EAAgCX,aAAhC,CAAP;AACH,CAFM","sourcesContent":["import { noop } from '../common/common';\nimport { services } from '../common/coreservices';\n/**\n * A [[TransitionHookFn]] which waits for the views to load\n *\n * Registered using `transitionService.onStart({}, loadEnteringViews);`\n *\n * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.\n * In angular 1, this includes loading the templates.\n */\nvar loadEnteringViews = function (transition) {\n    var $q = services.$q;\n    var enteringViews = transition.views('entering');\n    if (!enteringViews.length)\n        return;\n    return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(noop);\n};\nexport var registerLoadEnteringViews = function (transitionService) {\n    return transitionService.onFinish({}, loadEnteringViews);\n};\n/**\n * A [[TransitionHookFn]] which activates the new views when a transition is successful.\n *\n * Registered using `transitionService.onSuccess({}, activateViews);`\n *\n * After a transition is complete, this hook deactivates the old views from the previous state,\n * and activates the new views from the destination state.\n *\n * See [[ViewService]]\n */\nvar activateViews = function (transition) {\n    var enteringViews = transition.views('entering');\n    var exitingViews = transition.views('exiting');\n    if (!enteringViews.length && !exitingViews.length)\n        return;\n    var $view = transition.router.viewService;\n    exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); });\n    enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); });\n    $view.sync();\n};\nexport var registerActivateViews = function (transitionService) {\n    return transitionService.onSuccess({}, activateViews);\n};\n"]},"metadata":{},"sourceType":"module"}