{"version":3,"sources":["webpack:///../WCC.UI/App/components/componentAwaiter/componentAwaiter.html?a357","webpack:///../WCC.UI/App/components/componentAwaiter/componentAwaiter.scss?1298","webpack:///../WCC.UI/App/components/componentAwaiter/componentAwaiter.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/componentAwaiter/componentAwaiter.scss","webpack:///../WCC.UI/App/components/componentAwaiter/componentAwaiter.html"],"names":["content","expose","__esModule","default","api","module","i","options","exports","locals","ComponentAwaiterVM","constructor","config","info","this","busyNodes","$","templateNodes","filter","contents","readyNodes","isLoading","ko","fromPromise","async","undefined","toAwait","_","isArray","components","await","extend","rateLimit","isReady","not","applyBindingsToNode","element","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","system","SystemHelpers","html","getTemplatesAndResources","forEach","node","document","head","appendChild","___CSS_LOADER_API_IMPORT___","push"],"mappings":"qJAAA,UAAO,CACC,qHACA,wDAIC,KAJyC,EAAF,SAAYA,EAASC,GAGzD,OADAA,EADAD,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,GAE1CA,GACV,4B,kFCNT,IAAII,EAAM,EAAQ,gFACFJ,EAAU,EAAQ,gKAIC,iBAFvBA,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,KAG/CA,EAAU,CAAC,CAACK,EAAOC,EAAIN,EAAS,MAG9C,IAAIO,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEPH,EAAIJ,EAASO,GAI1BF,EAAOG,QAAUR,EAAQS,QAAU,I,yyBCPnC,IAAqBC,EAArB,MAOIC,YACwCC,EACFC,GAElCC,KAAKC,UAAYC,EAAEH,EAAKI,eAAeC,OAAO,gBAAgBC,WAC9DL,KAAKM,WAAaJ,EAAEH,EAAKI,eAAeC,OAAO,iBAAiBC,WAEhEL,KAAKO,UAAYC,EAAGC,YAAYC,UACbC,MAAXC,IACIC,EAAEC,QAAQF,SACJG,EAAWC,SAASJ,SAEpBG,EAAWC,MAAMJ,KAGxB,GACR,CAACd,EAAOkB,QAAQ,GAAMC,OAAO,CAAEC,UAAW,MAE7ClB,KAAKmB,QAAUnB,KAAKO,UAAUa,MAE9BZ,EAAGa,oBAAoBtB,EAAKuB,QAAS,CACjC,IAAO,CACH,qBAAqB,OA7BhB1B,EAAkB2B,EAAA,CADtCC,cASQC,EAAA,EAAAC,YAAOC,IAAWC,kBAClBH,EAAA,EAAAC,YAAOC,IAAWE,iBATNjC,gB,iTCXrB,WAOC,KAPD,aACI,MAAMkC,EAAS,EAAQ,mCAAkBC,cAEzC,OAAO,SAAUC,GACbF,EAAOG,yBAAyBD,GAC3BE,SAAQ,SAAUC,GAAQC,SAASC,KAAKC,YAAYH,QAEhE,+B,gLCLDzC,EADkC,EAAQ,wDAChC6C,EAA4B,IAE9BC,KAAK,CAACjD,EAAOC,EAAI,oCAAqC,KAE9DD,EAAOG,QAAUA,G,gICHjBH,EAAOG,QAFI","file":"278.4f8af8070c9c2aa8d0ac.js","sourcesContent":["define([\n \"!!../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./componentAwaiter.html\", \n \"!../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./componentAwaiter.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport './componentAwaiter.html';\r\nimport './componentAwaiter.scss';\r\n\r\nexport interface ComponentAwaiterVMConfig {\r\n await: SubscribableOrNullableValue>\r\n}\r\n\r\n@injectable()\r\nexport default class ComponentAwaiterVM {\r\n busyNodes: JQuery\r\n readyNodes: JQuery\r\n\r\n isLoading: Subscribable\r\n isReady: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: ComponentAwaiterVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n this.busyNodes = $(info.templateNodes).filter('awaiter-busy').contents();\r\n this.readyNodes = $(info.templateNodes).filter('awaiter-ready').contents();\r\n\r\n this.isLoading = ko.fromPromise(async toAwait => {\r\n if (toAwait != undefined) {\r\n if (_.isArray(toAwait))\r\n await components.await(...toAwait);\r\n else\r\n await components.await(toAwait);\r\n }\r\n\r\n return false;\r\n }, [config.await], true).extend({ rateLimit: 250 });\r\n\r\n this.isReady = this.isLoading.not();\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'component-awaiter': true\r\n }\r\n });\r\n }\r\n}","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".component-awaiter{display:block}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}