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AoBW,EAAEC,EAAO,EAGjCgD,EAAqBC,KAAmB,aAAIA,KAAmB,cAAK,GACxED,EAAmBE,QAAQR,EAAqBS,KAAK,KAAM,IAC3DH,EAAmBI,KAAOV,EAAqBS,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,G,KC7CvF5D,EAAoBW,OAAExC,EAAW,CAAC,MAAM,IAAO6B,EAAoB,SACnEA,EAAoBW,OAAExC,EAAW,CAAC,MAAM,IAAO6B,EAAoB,SACnE,IAAIiE,EAAsBjE,EAAoBW,OAAExC,EAAW,CAAC,MAAM,IAAO6B,EAAoB,SAC7FiE,EAAsBjE,EAAoBW,EAAEsD,E","sources":["webpack:///webpack/runtime/chunk loaded","webpack:///./Client/context/UserContext.ts","webpack:///./Client/selfService/SessionListener.ts","webpack:///./Client/selfService/MenuExtension.tsx","webpack:///webpack/bootstrap","webpack:///webpack/runtime/amd options","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/runtime/node module decorator","webpack:///webpack/runtime/runtimeId","webpack:///webpack/runtime/jsonp chunk loading","webpack:///webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import * as React from \"react\";\r\nimport { User, Customer, Elavtal, SelfServiceClient } from \"../api/ApiClient\";\r\n\r\nconst context = \"userContext.\";\r\nexport const UserContextContants = {\r\n tokenStorage: context + \"token\",\r\n userStorage: context + \"user\",\r\n customerStorage: context + \"customer\",\r\n elavtalStorage: context + \"elavtal\",\r\n currentElavtalStorage: context + \"currentElavtal\"\r\n};\r\n\r\nexport interface UserContextModel {\r\n token: string;\r\n user: User;\r\n customer: Customer;\r\n elavtal: Elavtal[];\r\n currentElavtal: Elavtal;\r\n\r\n getClient(): SelfServiceClient;\r\n\r\n setToken(token: string): void;\r\n setUser(user: User): void;\r\n setCustomer(customer: Customer): void;\r\n setElavtal(elavtal: Elavtal[]): void;\r\n setCurrentElavtal(elavtal: Elavtal): void;\r\n clear(): void;\r\n}\r\n\r\nexport const UserContext = React.createContext(undefined);\r\n","const eventName = \"rebel-session\";\r\n\r\nexport const sessionListener = (callback: (signedIn: boolean) => void) => {\r\n window.addEventListener(\r\n eventName,\r\n (event: CustomEvent) => {\r\n callback(event.detail.signedIn);\r\n },\r\n false\r\n );\r\n};\r\n\r\nexport const emitSessionChange = (signedIn: boolean) => {\r\n var event = new CustomEvent(eventName, {\r\n detail: {\r\n signedIn\r\n }\r\n });\r\n window.dispatchEvent(event);\r\n};\r\n","import * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { UserContextContants } from \"../context/UserContext\";\r\nimport { sessionListener, emitSessionChange } from \"./SessionListener\";\r\ninterface State {\r\n signedIn: boolean;\r\n}\r\n\r\nclass MenuExtension extends React.Component<{}, State> {\r\n state = {\r\n signedIn: false,\r\n };\r\n\r\n componentDidMount() {\r\n this.updateSignedIn(\r\n !!sessionStorage.getItem(UserContextContants.tokenStorage)\r\n );\r\n sessionListener((signedIn: boolean) => this.updateSignedIn(signedIn));\r\n }\r\n\r\n updateSignedIn(signedIn: boolean) {\r\n this.setState({\r\n signedIn,\r\n });\r\n }\r\n\r\n signOut = (event: React.MouseEvent) => {\r\n sessionStorage.removeItem(UserContextContants.tokenStorage);\r\n this.setState({\r\n signedIn: false,\r\n });\r\n\r\n emitSessionChange(false);\r\n event.preventDefault();\r\n $(\".navbar-collapse\").collapse(\"hide\");\r\n };\r\n\r\n render() {\r\n return this.state.signedIn ? (\r\n
  • \r\n \r\n Logga ut\r\n \r\n
  • \r\n ) : null;\r\n }\r\n}\r\n\r\nReactDOM.render(, document.getElementById(\"menu-extension\"));\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 288;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t288: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunk\"] = self[\"webpackChunk\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\n__webpack_require__.O(undefined, [736], () => (__webpack_require__(57147)))\n__webpack_require__.O(undefined, [736], () => (__webpack_require__(26981)))\nvar __webpack_exports__ = __webpack_require__.O(undefined, [736], () => (__webpack_require__(97934)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","context","UserContextContants","tokenStorage","userStorage","customerStorage","elavtalStorage","currentElavtalStorage","eventName","React","undefined","MenuExtension","signedIn","event","sessionStorage","removeItem","setState","CustomEvent","detail","window","dispatchEvent","emitSessionChange","preventDefault","$","collapse","callback","this","updateSignedIn","getItem","addEventListener","state","className","onClick","signOut","href","ReactDOM","document","getElementById","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","id","loaded","__webpack_modules__","call","m","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","obj","prop","prototype","hasOwnProperty","Symbol","toStringTag","value","nmd","paths","children","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","forEach","bind","push","__webpack_exports__"],"sourceRoot":""}