{"version":3,"sources":["webpack:///../WCC.UI/App/components/editors/thread/text/ideationVote/ideationVote.scss?3635","webpack:///../WCC.UI/App/components/editors/thread/text/ideationVote/ideationVote.ts","webpack:///../WCC.UI/App/components/editors/thread/text/ideationVote/standaloneIdeationVote.html?a867","webpack:///../WCC.UI/App/components/editors/thread/text/ideationVote/standaloneIdeationVote.ts","webpack:///../WCC.UI/App/components/editors/thread/text/ideationVote/ideationVote.scss","webpack:///../WCC.UI/App/components/editors/thread/text/ideationVote/standaloneIdeationVote.html"],"names":["api","content","__esModule","default","module","i","options","exports","locals","components","preload","IdeationVoteEditorVM","TextThreadEditorVM","constructor","config","info","storage","ctx","effects","super","mediaSize","votePicker","ko","observable","vote","this","pluck","p","pickedVote","initialVote","thread","th","isActive","isNotNull","register","textEditor","undefined","focus","container","pickerNode","$","applyBindings","appendChild","removeNode","votesPickerContainer","applyBindingsToNode","element","checkIfAllowedToCancel","checkIfTextIsMandatory","jsonThread","WCCError","messages","UnknownError","commentsService","updateVote","reset","_this$votePicker","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","servicesContext","expose","StandaloneIdeationVoteEditorVM","___CSS_LOADER_API_IMPORT___","push"],"mappings":"yJAAA,IAAIA,EAAM,EAAQ,gFACFC,EAAU,EAAQ,4KAIC,iBAFvBA,EAAUA,EAAQC,WAAaD,EAAQE,QAAUF,KAG/CA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAG9C,IAAIK,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEPN,EAAIC,EAASK,GAI1BF,EAAOG,QAAUN,EAAQO,QAAU,I,g2BCNnCC,EAAWC,QAAQ,wBAOnB,IAAqBC,EAArB,cAAkDC,IAS9CC,YACwCC,EACFC,EACNC,EACQC,EACRC,GAE5BC,MAAML,EAAQC,EAAMC,EAASC,EAAKC,GAftC,KAAAE,UAAY,GAEZ,KAAAC,WAAaC,EAAGC,aAChB,KAAAC,KAAOC,KAAKJ,WAAWK,MAAMC,GAAKA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KAJkD,EAAF,SAAYV,EAASgE,GAGlE,OADAA,EADAhE,EAAUA,EAAQC,WAAaD,EAAQE,QAAUF,GAE1CA,GACV,4B,21BCGT,IAAqBiE,EAArB,cAA4DvD,IACxDE,YACwCC,EACFC,EACNC,EACQC,EACRC,GAE5BC,MAAML,EAAQC,EAAMC,EAASC,EAAKC,GAElCI,EAAGuB,oBAAoB9B,EAAK+B,QAAS,CACjC,IAAO,CACH,mCAAmC,IAExCrB,QAdUyC,EAA8BT,EAAA,CADlDC,cAGQC,EAAA,EAAAC,YAAOC,IAAWC,kBAClBH,EAAA,EAAAC,YAAOC,IAAWE,gBAClBJ,EAAA,EAAAC,YAAOC,IAAW7C,UAClB2C,EAAA,EAAAC,YAAOC,IAAWG,kBAClBL,EAAA,EAAAC,YAAOC,IAAW3C,WANNgD,gB,mQCPrB3D,EADkC,EAAQ,wDAChC4D,EAA4B,IAE9BC,KAAK,CAAChE,EAAOC,EAAI,uCAAwC,KAEjED,EAAOG,QAAUA,G,sJCHjBH,EAAOG,QAFI","file":"296.a7515f9f0eea06255983.js","sourcesContent":["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!./ideationVote.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 IdeationVotePickerVM from 'components/ideationVotePicker/ideationVotePicker';\r\nimport { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport { JSONTopicThread } from 'models/topicThread';\r\nimport WCCError from 'models/wccError';\r\nimport { ServicesContext } from 'services/context';\r\nimport TextThreadEditorVM, { TextThreadEditorVMConfig } from '../textThread';\r\nimport './ideationVote.scss';\r\n\r\ncomponents.preload('ideation-vote-picker');\r\n\r\nexport interface IdeationVoteEditorVMConfig extends TextThreadEditorVMConfig {\r\n votesPickerContainer: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class IdeationVoteEditorVM extends TextThreadEditorVM {\n mediaSize = 75\n\n votePicker = ko.observable();\n vote = this.votePicker.pluck(p => p.pickedVote);\n\n initialVote: Subscribable\n isActive: Subscribable\n\n constructor(\n @inject(wccModules.componentConfig) config: IdeationVoteEditorVMConfig,\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\n @inject(wccModules.storage) storage: IWCCStorageManager,\n @inject(wccModules.servicesContext) ctx: ServicesContext,\n @inject(wccModules.effects) effects: EffectsContainer\n ) {\n super(config, info, storage, ctx, effects);\n\n this.initialVote = this.thread.pluck(th => th.vote);\n this.isActive = this.vote.isNotNull();\n\n effects.register((isActive, textEditor) => {\n if (isActive && textEditor != undefined)\n textEditor.focus();\n }, [this.isActive, this.textEditor]);\n\n effects.register((container) => {\n if (container != undefined) {\n const pickerNode = $(``)[0];\r\n\r\n ko.applyBindings(this, pickerNode);\r\n container.appendChild(pickerNode);\r\n\r\n return () => ko.removeNode(pickerNode);\r\n }\r\n }, [config.votesPickerContainer]);\n\n ko.applyBindingsToNode(info.element, {\n 'visible': this.isActive,\n\n 'css': {\n 'ideation-vote-editor': true\n }\n }, this);\n }\n\n protected override checkIfAllowedToCancel() {\n return super.checkIfAllowedToCancel() || this.isActive();\r\n }\n\n protected override checkIfTextIsMandatory() {\n return true;\r\n }\n\n protected override async saveThread(jsonThread: JSONTopicThread): Promise {\r\n const vote = this.vote();\r\n\r\n if (vote == undefined)\r\n throw new WCCError(messages.UnknownError);\r\n\r\n await this.ctx.commentsService.vote(jsonThread, vote);\r\n }\r\n\r\n protected override async updateThread(jsonThread: JSONTopicThread): Promise {\r\n const vote = this.vote();\r\n\r\n if (vote == undefined)\r\n throw new WCCError(messages.UnknownError);\r\n\r\n await this.ctx.commentsService.updateVote(jsonThread, vote);\r\n }\n\n protected override reset() {\n super.reset();\r\n\r\n this.votePicker()?.reset();\r\n }\n}","define([\n \"!!../../../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./standaloneIdeationVote.html\", \n \"!../../../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport { ServicesContext } from 'services/context';\r\nimport IdeationVoteEditorVM, { IdeationVoteEditorVMConfig } from './ideationVote';\r\nimport './standaloneIdeationVote.html';\r\n\r\n@injectable()\nexport default class StandaloneIdeationVoteEditorVM extends IdeationVoteEditorVM {\n constructor(\n @inject(wccModules.componentConfig) config: IdeationVoteEditorVMConfig,\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\n @inject(wccModules.storage) storage: IWCCStorageManager,\n @inject(wccModules.servicesContext) ctx: ServicesContext,\n @inject(wccModules.effects) effects: EffectsContainer\n ) {\n super(config, info, storage, ctx, effects);\n\n ko.applyBindingsToNode(info.element, {\n 'css': {\n 'ideation-vote-editor-standalone': true\n }\n }, this);\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, \".ideation-vote-editor{display:block}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}