{"version":3,"sources":["webpack:///../WCC.UI/App/components/editors/thread/text/replySuggestion/replySuggestion.html?f100","webpack:///../WCC.UI/App/components/editors/thread/text/replySuggestion/replySuggestion.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/editors/thread/text/replySuggestion/replySuggestion.html"],"names":["content","expose","__esModule","default","ReplySuggestion","constructor","model","info","storage","ctx","effects","replySuggestions","ko","observableArray","openAiCompletionRef","observable","this","isOpenAiEnabled","WCC","Settings","CurrentUser","IsModerator","EnableQualzyAI","threadId","unwrap","cCanHaveSuggestionsUI","cHasModReply","cReplyContent","oReplySuggestion","oTranslatedReplySuggestion","oTranslationNeeded","ref","onOpenAiCompletionReady","completion","translatedCompletion","contentField","NotNativeSpeaker","__decorate","autobind","injectable","__param","inject","wccModules","componentConfig","componentInfo","servicesContext","system","SystemHelpers","html","getTemplatesAndResources","forEach","node","document","head","appendChild","module","exports"],"mappings":"uKAAA,UAAO,CACC,uIACA,wDAIC,KAJkD,EAAF,SAAYA,EAASC,GAGlE,OADAA,EADAD,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,GAE1CA,GACV,4B,gzBCgBT,IAAqBI,EAArB,MAgBIC,YACwCC,EACFC,EACNC,EACQC,EACRC,GAVhC,KAAAC,iBAAmBC,EAAGC,kBACtB,KAAAC,oBAAsBF,EAAGG,WAAW,MAWhCC,KAAKC,gBAAkBC,EAAIC,SAASC,YAAYC,aAAeH,EAAIC,SAASG,eAC5EN,KAAKO,SAAWX,EAAGY,OAAOlB,EAAMiB,UAEhCP,KAAKS,sBAAwBnB,EAAMmB,sBACnCT,KAAKU,aAAepB,EAAMoB,aAC1BV,KAAKW,cAAgBrB,EAAMqB,cAC3BX,KAAKY,iBAAmBtB,EAAMsB,iBAC9BZ,KAAKa,2BAA6BvB,EAAMuB,2BACxCb,KAAKc,mBAAqBxB,EAAMwB,mBAEhCxB,EAAMyB,IAAIf,MAIdgB,wBAAwBC,EAAoBC,GACxC,MAAMC,EAAenB,KAAKW,gBACvBQ,KACsC,IAAlCjB,EAAIC,SAASiB,kBACZD,EAAaD,GAA8CD,GAC3DjB,KAAKY,iBAAiBK,GACtBjB,KAAKa,2BAA2BK,IAGhCC,EAAaF,MATzBI,EAAA,CADCC,K,4CApCgBlC,EAAeiC,EAAA,CADnCE,cAkBQC,EAAA,EAAAC,YAAOC,IAAWC,kBAClBH,EAAA,EAAAC,YAAOC,IAAWE,gBAClBJ,EAAA,EAAAC,YAAOC,IAAWlC,UAClBgC,EAAA,EAAAC,YAAOC,IAAWG,kBAClBL,EAAA,EAAAC,YAAOC,IAAWhC,WArBNN,gB,sLCtBrB,WAOC,KAPD,aACI,MAAM0C,EAAS,EAAQ,mCAAkBC,cAEzC,OAAO,SAAUC,GACbF,EAAOG,yBAAyBD,GAC3BE,SAAQ,SAAUC,GAAQC,SAASC,KAAKC,YAAYH,QAEhE,+B,kJCJDI,EAAOC,QAFI","file":"344.fd089aa6ad5a558ec75c.js","sourcesContent":["define([\n \"!!../../../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./replySuggestion.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 {Observable, PureComputed, Subscribable} from 'knockout';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport { ServicesContext } from 'services/context';\r\n\r\nimport './replySuggestion.html';\r\nimport autobind from \"decorators/autobind\";\r\n\r\ninterface IReplySuggestionConfig {\r\n threadId: string\r\n cCanHaveSuggestionsUI: PureComputed\r\n cHasModReply: PureComputed\r\n cReplyContent: PureComputed | undefined>\r\n oReplySuggestion: Observable\r\n oTranslatedReplySuggestion: Observable\r\n oTranslationNeeded: Subscribable\r\n ref: Observable\r\n}\r\n\r\n@injectable()\r\nexport default class ReplySuggestion {\r\n\r\n isOpenAiEnabled: boolean;\r\n threadId: string;\r\n\r\n cCanHaveSuggestionsUI: PureComputed;\r\n cHasModReply: PureComputed;\r\n cReplyContent: PureComputed | undefined>;\r\n oReplySuggestion: Observable;\r\n oTranslatedReplySuggestion: Observable;\r\n\r\n replySuggestions = ko.observableArray();\r\n openAiCompletionRef = ko.observable(null);\r\n\r\n oTranslationNeeded: Subscribable\r\n \r\n constructor(\r\n @inject(wccModules.componentConfig) model: IReplySuggestionConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.storage) storage: IWCCStorageManager,\r\n @inject(wccModules.servicesContext) ctx: ServicesContext,\r\n @inject(wccModules.effects) effects: EffectsContainer\r\n ) {\r\n this.isOpenAiEnabled = WCC.Settings.CurrentUser.IsModerator && WCC.Settings.EnableQualzyAI;\r\n this.threadId = ko.unwrap(model.threadId); \r\n \r\n this.cCanHaveSuggestionsUI = model.cCanHaveSuggestionsUI;\r\n this.cHasModReply = model.cHasModReply;\r\n this.cReplyContent = model.cReplyContent;\r\n this.oReplySuggestion = model.oReplySuggestion;\r\n this.oTranslatedReplySuggestion = model.oTranslatedReplySuggestion;\r\n this.oTranslationNeeded = model.oTranslationNeeded;\r\n \r\n model.ref(this);\r\n }\r\n \r\n @autobind\r\n onOpenAiCompletionReady(completion: string, translatedCompletion: string) {\r\n const contentField = this.cReplyContent();\r\n if(contentField) {\r\n if(WCC.Settings.NotNativeSpeaker === true) {\r\n contentField(translatedCompletion ? translatedCompletion : completion);\r\n this.oReplySuggestion(completion);\r\n this.oTranslatedReplySuggestion(translatedCompletion);\r\n }\r\n else {\r\n contentField(completion);\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});","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}