{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./Usc.Web/scripts/bundles/_gettingstartedguide.js"],"names":["installedModules","__webpack_require__","moduleId","module","i","l","exports","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","angular","controller","$q","$timeout","contentService","root","document","getElementById","guidesModel","JSON","parse","guidesJson","guides","deferred","defer","q","searchType","fields","contentTypes","html","count","this","stepLabels","hasAttribute","data","steplabels","split","guideNames","forEach","Guides","v","push","index","GuideLabel","steps","Steps","map","Links","pageQuery","query","then","resp","setData","let","content","bodyText","pointer","pointerBox","summary","stepSummary","classList","remove","getGuidePage","all","currentGuide","currentPage","resolve","loadingClass","add","extend","progress","getGuide","item","guideIndex","vv","Udi","replace","getPage","barClass","str","length","next"],"mappings":"KACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,IAIIC,EAJJ,OAAGH,EAAiBE,KAIhBC,EAASH,EAAiBE,GAAY,CACzCE,EAAGF,EACHG,EAAG,GACHC,QAAS,EACV,EAGAC,EAAQL,GAAUM,KAAKL,EAAOG,QAASH,EAAQA,EAAOG,QAASL,CAAmB,EAGlFE,EAAOE,EAAI,GAGJF,IAhB4BG,OAiBpC,CAIAL,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASL,EAASM,EAAMC,GAC3CZ,EAAoBa,EAAER,EAASM,CAAI,GACtCG,OAAOC,eAAeV,EAASM,EAAM,CAAEK,WAAY,GAAMC,IAAKL,CAAO,CAAC,CAExE,EAGAZ,EAAoBkB,EAAI,SAASb,GACX,aAAlB,OAAOc,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeV,EAASc,OAAOC,YAAa,CAAEC,MAAO,QAAS,CAAC,EAEvEP,OAAOC,eAAeV,EAAS,aAAc,CAAEgB,MAAO,EAAK,CAAC,CAC7D,EAOArB,EAAoBs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,GACvDA,EAAGC,IAAIC,QAAQ,kBAAmB,EAAE,EAAEA,QAAQ,kCAAmC,gBAAgB,CAAC,CAAC,EAEvG7C,KAAKkC,YAAc,EACnBH,EAAa,CACjB,EAiDIe,QAtCYpG,IACRA,IAAMsD,KAAKkC,cACXE,EAAa,EACbpC,KAAKkC,YAAcxF,EACnBqF,EAAa,EAErB,EAiCIgB,SA1BarG,IAEb4E,IAAI0B,EAAM,GAUV,OARIhD,KAAKkC,YAAc,IAAMlC,KAAKiC,aAAagB,OAC3CD,EAAM,WACChD,KAAKkC,cAAgBxF,EAC5BsG,EAAM,SACChD,KAAKkC,YAAcxF,IAC1BsG,EAAM,QAGHA,GAAa,IAANtG,EAAU,SAAW,KAAOA,EAAI,IAAMsD,KAAKiC,aAAagB,OAAS,QAAU,GAC7F,EAcIC,KA/CSA,KACTd,EAAa,EACbpC,KAAKkC,YAAclC,KAAKkC,YAAc,GAAKlC,KAAKiC,aAAagB,OAASjD,KAAKkC,aAAe,EAAI,EAC9FH,EAAa,CACjB,CA4CA,CAAC,CACL,EAEwH,C","file":"gettingstartedguide-bundle-8d1b1e0a3003307730a0.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 32);\n","import 'Sass/views/getting-started-guide.scss';\r\n\r\n(function () {\r\n 'use strict';\r\n\r\n function gettingStartedGuide($q, $timeout, contentService) {\r\n\r\n // fetch the root guide element and its data attributes\r\n // set up the content service query object\r\n // guide model data is retrieved directly from a variable loaded on the page in the view\r\n var root = document.getElementById('guideRoot'),\r\n guidesModel = JSON.parse(guidesJson),\r\n guides = [],\r\n deferred = $q.defer(),\r\n q = {\r\n searchType: 'SearchSearcher',\r\n fields: ['bodyText', 'pointerBox', 'stepSummary'],\r\n contentTypes: ['GettingStartedItem'],\r\n html: true,\r\n count: 1\r\n };\r\n\r\n this.stepLabels = root.hasAttribute('data-steplabels') ? root.data.steplabels.split(',') : [];\r\n this.guideNames = [];\r\n\r\n angular.forEach(guidesModel.Guides, (v, i) => {\r\n // filter to ensure the correct value is returned - object isn't ordered\r\n this.guideNames.push({ index: i, name: v.GuideLabel });\r\n\r\n const steps = v.Steps;\r\n\r\n guides.push(\r\n steps.map(\r\n s => s.Links\r\n )\r\n );\r\n });\r\n\r\n const pageQuery = v => {\r\n q.query = {\r\n '__Key': v\r\n };\r\n\r\n return contentService.get(q)\r\n .then(resp => resp);\r\n }\r\n\r\n // timeout triggers digest cycle\r\n const setData = data => {\r\n $timeout(() => {\r\n\r\n this.content = '';\r\n\r\n let c = '';\r\n\r\n angular.forEach(data, v => {\r\n c += v[0].bodyText;\r\n });\r\n\r\n this.pointer = data[0][0].pointerBox;\r\n this.summary = data[0][0].stepSummary;\r\n this.content = c;\r\n\r\n root.classList.remove('loading');\r\n });\r\n }\r\n\r\n // chain the requests for multiple nodes\r\n // set the displayed data when all have returned\r\n // id can be a single id or pipe-delimited list\r\n // only the first pointer and summary are displayed - allows using multiple nodes in a step to aid content reuse\r\n const getGuidePage = () => {\r\n\r\n $q.all(this.currentGuide[this.currentPage].map(pageQuery))\r\n .then(data => {\r\n $timeout(() => {\r\n deferred.resolve();\r\n setData(data);\r\n });\r\n });\r\n }\r\n\r\n // set the current page to 0\r\n // fetch the correct guide based on the current selected index\r\n // send request for the first page of the current guide\r\n const getGuide = item => {\r\n // if using the typeahead, need to set the guideindex value\r\n if (item) {\r\n this.guideIndex = item.index;\r\n }\r\n\r\n loadingClass();\r\n // convert udi to key for search\r\n this.currentGuide = guides[this.guideIndex].map(v => v.map(vv =>\r\n vv.Udi.replace('umb://document/', '').replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, '$1-$2-$3-$4-$5')));\r\n\r\n this.currentPage = 0;\r\n getGuidePage();\r\n }\r\n\r\n // increment the current page\r\n // send request for the current page of the current guide\r\n const next = () => {\r\n loadingClass();\r\n this.currentPage = this.currentPage + 1 <= this.currentGuide.length ? this.currentPage += 1 : 0;\r\n getGuidePage();\r\n }\r\n\r\n // for the parameter i, set the current page and fetch the corresponding guide page\r\n const getPage = i => {\r\n if (i !== this.currentPage) {\r\n loadingClass();\r\n this.currentPage = i;\r\n getGuidePage();\r\n }\r\n }\r\n\r\n // set the progress bar block class based on the current progress through the guide\r\n // class will be complete|active|done plus either first|last for the first and last child - using :first|last-child psuedo selectors lags \r\n // complete: all steps set to complete when the final guide page is loaded\r\n // active: the current page\r\n // done: any page where the index is lower than the current page\r\n const barClass = i => {\r\n\r\n let str = '';\r\n\r\n if (this.currentPage + 1 === this.currentGuide.length) {\r\n str = 'complete';\r\n } else if (this.currentPage === i) {\r\n str = 'active';\r\n } else if (this.currentPage > i) {\r\n str = 'done';\r\n }\r\n\r\n return str + (i === 0 ? ' first' : '') + (i + 1 === this.currentGuide.length ? ' last' : '');\r\n }\r\n\r\n const loadingClass = () => root.classList.add('loading');\r\n\r\n // the public api\r\n angular.extend(this, {\r\n currentGuide: [],\r\n currentPage: 0,\r\n progress: 0,\r\n content: '',\r\n\r\n getGuide: getGuide,\r\n getPage: getPage,\r\n barClass: barClass,\r\n next: next\r\n });\r\n }\r\n\r\n angular.module('Uscapp').controller('gettingStartedGuideCtrl', ['$q', '$timeout', 'contentService', gettingStartedGuide]);\r\n}());"],"sourceRoot":""}