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D,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;yBACtB;6BAAM;4BACH,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;4BAC3H,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;yBAClD;oBACL,CAAC,CAAC,CAAC,CAAC;iBACP;YACL,CAAC,CAAC,CAAC;QAEP,CAAC;KACJ,CAAA;IAjEU,2BAAI,GAAG,wBAAwB,CAAC;IAD9B,sBAAsB;QADlC,qCAAY,CAAC,iCAAiB,CAAC;OACnB,sBAAsB,CAkElC;IAAD,6BAAC;KAAA;AAlEY,wDAAsB","file":"","sourceRoot":"/","sourcesContent":["import { Presenter, createPresenter } from \"../../../common/classbase/PresenterBase\";\nimport { PhoneCallView, PhoneCallViewType, PhoneCallItemProps, PhoneCallViewProps } from \"../view/type/PhoneCallView\";\nimport { RegPresenter } from \"../PresenterCCViewFactory\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport { PlotSceneType } from \"../../Enums\";\nimport { ConfigManager } from \"../../../common/gameplay/managers/ConfigManager\";\nimport { role } from \"../../../config/Role\";\nimport { PlotManager } from \"../../../avg/PlotManager\";\nimport SentenceSelectorViewPresenter from \"./SentenceSelectorViewPresenter\";\nimport { SentenceContent, SentenceSelectContent } from \"../../../avg/model/PlotModel\";\nimport { UIManager } from \"../../../common/gameplay/managers/UIManager\";\nimport { SentenceSelectorViewProps } from \"../view/type/SentenceSelectorView\";\nimport { DeepReadonly } from \"simba-utils\";\nimport { runAction } from \"../../../../../build-templates/wechatgame/launcher/launcher-scene\";\n\n@RegPresenter(PhoneCallViewType)\nexport class PhoneCallViewPresenter extends Presenter<undefined, PhoneCallView> {\n static uuid = \"PhoneCallViewPresenter\";\n private _items: PhoneCallItemProps[] = [];\n private _viewProps: PhoneCallViewProps;\n onSetContent = (content: DeepReadonly<SentenceSelectContent> | undefined) => {\n let props: SentenceSelectorViewProps =\n {\n sentence: content,\n backgroundpath: \"\",\n clickcausehide: false,\n onSelectIndexCallback: this.onSelectIndexCallback\n\n };\n UIManager.pushPresenter(SentenceSelectorViewPresenter, props);\n }\n\n\n onSelectIndexCallback = (index: number) => {\n this.view.select(index);\n }\n\n isSentenceSelectVisible = (): boolean => {\n let preset = UIManager.getTopPresenter();\n if (preset instanceof SentenceSelectorViewPresenter) {\n let selectorPresenter = preset as SentenceSelectorViewPresenter;\n return !selectorPresenter.view.isHidden;\n }\n return false;\n }\n\n\n async onOpen() {\n super.onOpen(undefined);\n\n this._items = [];\n GameModelManager.rollbackPhoneCallIfNeeded().then((plots) => {\n let plot = plots[0];\n if (plot.plotSceneType !== PlotSceneType.PhoneCall) {\n console.error(\"Phone call plot data error.\");\n } else {\n let roleData = ConfigManager.getConfig(role, plot.plotSceneTypeId);\n this._items = [{ key: plot.id + \"\", isSelf: plot.sentences[0].roleId === 2, sentence: plot.sentences[0] }];\n this._viewProps =\n {\n name: roleData.name, // TODO i18n\n icon: GameModelManager.getRoleData(plot.plotSceneTypeId)!.getHeadIcon(),\n items: this._items,\n onCompletePlot: (index?: number) => PlotManager.completePlot(plot, index),\n onSetContent: this.onSetContent,\n isSentenceSelectVisible: this.isSentenceSelectVisible\n };\n this._view.setProps(this._viewProps);\n\n this._disposable.add(PlotManager.PlotStartEvent.on((plots) => {\n plot = plots[0];\n if (plot.plotSceneType !== PlotSceneType.PhoneCall) {\n this._view.close();\n } else {\n this._items = [...this._items, { key: plot.id + \"\", isSelf: plot.sentences[0].roleId === 2, sentence: plot.sentences[0] }];\n this._view.updateProps({ items: this._items });\n }\n }));\n }\n });\n\n }\n}"]}