diff --git a/client/demo/dist/index.js b/client/demo/dist/index.js index d1ad36e7..67fb0402 100644 --- a/client/demo/dist/index.js +++ b/client/demo/dist/index.js @@ -114,7 +114,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GuiStateProvider: () => (/* binding */ GuiStateProvider),\n/* harmony export */ OpenAdvancedSettingCheckbox: () => (/* binding */ OpenAdvancedSettingCheckbox),\n/* harmony export */ OpenAdvancedSettingDialogCheckbox: () => (/* binding */ OpenAdvancedSettingDialogCheckbox),\n/* harmony export */ OpenConverterSettingCheckbox: () => (/* binding */ OpenConverterSettingCheckbox),\n/* harmony export */ OpenDeviceSettingCheckbox: () => (/* binding */ OpenDeviceSettingCheckbox),\n/* harmony export */ OpenGetClientInformationDialogCheckbox: () => (/* binding */ OpenGetClientInformationDialogCheckbox),\n/* harmony export */ OpenGetServerInformationDialogCheckbox: () => (/* binding */ OpenGetServerInformationDialogCheckbox),\n/* harmony export */ OpenLabCheckbox: () => (/* binding */ OpenLabCheckbox),\n/* harmony export */ OpenLicenseDialogCheckbox: () => (/* binding */ OpenLicenseDialogCheckbox),\n/* harmony export */ OpenMergeLabDialogCheckbox: () => (/* binding */ OpenMergeLabDialogCheckbox),\n/* harmony export */ OpenModelSettingCheckbox: () => (/* binding */ OpenModelSettingCheckbox),\n/* harmony export */ OpenModelSlotManagerDialogCheckbox: () => (/* binding */ OpenModelSlotManagerDialogCheckbox),\n/* harmony export */ OpenQualityControlCheckbox: () => (/* binding */ OpenQualityControlCheckbox),\n/* harmony export */ OpenServerControlCheckbox: () => (/* binding */ OpenServerControlCheckbox),\n/* harmony export */ OpenShowLicenseDialogCheckbox: () => (/* binding */ OpenShowLicenseDialogCheckbox),\n/* harmony export */ OpenSpeakerSettingCheckbox: () => (/* binding */ OpenSpeakerSettingCheckbox),\n/* harmony export */ OpenStartingNoticeDialogCheckbox: () => (/* binding */ OpenStartingNoticeDialogCheckbox),\n/* harmony export */ OpenTextInputDialogCheckbox: () => (/* binding */ OpenTextInputDialogCheckbox),\n/* harmony export */ OpenWaitingDialogCheckbox: () => (/* binding */ OpenWaitingDialogCheckbox),\n/* harmony export */ useGuiState: () => (/* binding */ useGuiState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useStateControlCheckbox */ \"./src/hooks/useStateControlCheckbox.tsx\");\n\n\n\n\n\n\nvar OpenServerControlCheckbox = \"open-server-control-checkbox\";\nvar OpenModelSettingCheckbox = \"open-model-setting-checkbox\";\nvar OpenDeviceSettingCheckbox = \"open-device-setting-checkbox\";\nvar OpenQualityControlCheckbox = \"open-quality-control-checkbox\";\nvar OpenSpeakerSettingCheckbox = \"open-speaker-setting-checkbox\";\nvar OpenConverterSettingCheckbox = \"open-converter-setting-checkbox\";\nvar OpenAdvancedSettingCheckbox = \"open-advanced-setting-checkbox\";\nvar OpenLabCheckbox = \"open-lab-checkbox\";\nvar OpenLicenseDialogCheckbox = \"open-license-dialog-checkbox\";\nvar OpenWaitingDialogCheckbox = \"open-waiting-dialog-checkbox\";\nvar OpenStartingNoticeDialogCheckbox = \"open-starting-notice-dialog-checkbox\";\nvar OpenModelSlotManagerDialogCheckbox = \"open-model-slot-manager-dialog-checkbox\";\nvar OpenMergeLabDialogCheckbox = \"open-merge-lab-dialog-checkbox\";\nvar OpenAdvancedSettingDialogCheckbox = \"open-advanced-setting-dialog-checkbox\";\nvar OpenGetServerInformationDialogCheckbox = \"open-get-server-information-dialog-checkbox\";\nvar OpenGetClientInformationDialogCheckbox = \"open-get-client-information-dialog-checkbox\";\nvar OpenTextInputDialogCheckbox = \"open-text-input-dialog-checkbox\";\nvar OpenShowLicenseDialogCheckbox = \"open-show-license-dialog-checkbox\";\nvar GuiStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createContext(null);\nvar useGuiState = function useGuiState() {\n var state = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(GuiStateContext);\n if (!state) {\n throw new Error(\"useGuiState must be used within GuiStateProvider\");\n }\n return state;\n};\nvar GuiStateProvider = function GuiStateProvider(_ref) {\n var children = _ref.children;\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n isConverting = _useState2[0],\n setIsConverting = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState3, 2),\n isAnalyzing = _useState4[0],\n setIsAnalyzing = _useState4[1];\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(0),\n _useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState5, 2),\n modelSlotNum = _useState6[0],\n setModelSlotNum = _useState6[1];\n var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState7, 2),\n showPyTorchModelUpload = _useState8[0],\n setShowPyTorchModelUpload = _useState8[1];\n var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n _useState10 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState9, 2),\n inputAudioDeviceInfo = _useState10[0],\n setInputAudioDeviceInfo = _useState10[1];\n var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n _useState12 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState11, 2),\n outputAudioDeviceInfo = _useState12[0],\n setOutputAudioDeviceInfo = _useState12[1];\n var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState14 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState13, 2),\n audioInputForGUI = _useState14[0],\n setAudioInputForGUI = _useState14[1];\n var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState16 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState15, 2),\n audioOutputForGUI = _useState16[0],\n setAudioOutputForGUI = _useState16[1];\n var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState18 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState17, 2),\n audioMonitorForGUI = _useState18[0],\n setAudioMonitorForGUI = _useState18[1];\n var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState20 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState19, 2),\n fileInputEchoback = _useState20[0],\n setFileInputEchoback = _useState20[1]; //最初のmuteが有効になるように。undefined <-- ??? falseしておけばよさそう。undefinedだとwarningがでる。\n var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState22 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState21, 2),\n shareScreenEnabled = _useState22[0],\n setShareScreenEnabled = _useState22[1];\n var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"default\"),\n _useState24 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState23, 2),\n audioOutputForAnalyzer = _useState24[0],\n setAudioOutputForAnalyzer = _useState24[1];\n var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null),\n _useState26 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState25, 2),\n textInputResolve = _useState26[0],\n setTextInputResolve = _useState26[1];\n var reloadDeviceInfo = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee() {\n var ms, mediaDeviceInfos, audioInputs, audioOutputs;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return navigator.mediaDevices.getUserMedia({\n video: false,\n audio: true\n });\n case 3:\n ms = _context.sent;\n ms.getTracks().forEach(function (x) {\n x.stop();\n });\n _context.next = 10;\n break;\n case 7:\n _context.prev = 7;\n _context.t0 = _context[\"catch\"](0);\n console.warn(\"Enumerate device error::\", _context.t0);\n case 10:\n _context.next = 12;\n return navigator.mediaDevices.enumerateDevices();\n case 12:\n mediaDeviceInfos = _context.sent;\n audioInputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audioinput\";\n });\n audioInputs.push({\n deviceId: \"none\",\n groupId: \"none\",\n kind: \"audioinput\",\n label: \"none\",\n toJSON: function toJSON() {}\n });\n audioInputs.push({\n deviceId: \"file\",\n groupId: \"file\",\n kind: \"audioinput\",\n label: \"file\",\n toJSON: function toJSON() {}\n });\n audioInputs.push({\n deviceId: \"screen\",\n groupId: \"screen\",\n kind: \"audioinput\",\n label: \"system(only win)\",\n toJSON: function toJSON() {}\n });\n audioOutputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audiooutput\";\n });\n audioOutputs.push({\n deviceId: \"none\",\n groupId: \"none\",\n kind: \"audiooutput\",\n label: \"none\",\n toJSON: function toJSON() {}\n });\n // audioOutputs.push({\n // deviceId: \"record\",\n // groupId: \"record\",\n // kind: \"audiooutput\",\n // label: \"record\",\n // toJSON: () => { }\n // })\n return _context.abrupt(\"return\", [audioInputs, audioOutputs]);\n case 20:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 7]]);\n }));\n return function reloadDeviceInfo() {\n return _ref2.apply(this, arguments);\n };\n }();\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var audioInitialize = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() {\n var audioInfo;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return reloadDeviceInfo();\n case 2:\n audioInfo = _context2.sent;\n setInputAudioDeviceInfo(audioInfo[0]);\n setOutputAudioDeviceInfo(audioInfo[1]);\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function audioInitialize() {\n return _ref3.apply(this, arguments);\n };\n }();\n audioInitialize();\n }, []);\n\n // (1) Controller Switch\n var openServerControlCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenServerControlCheckbox);\n var openModelSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenModelSettingCheckbox);\n var openDeviceSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenDeviceSettingCheckbox);\n var openQualityControlCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenQualityControlCheckbox);\n var openSpeakerSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenSpeakerSettingCheckbox);\n var openConverterSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenConverterSettingCheckbox);\n var openAdvancedSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenAdvancedSettingCheckbox);\n var openLabCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenLabCheckbox);\n var showWaitingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenWaitingDialogCheckbox);\n var showStartingNoticeCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenStartingNoticeDialogCheckbox);\n var showModelSlotManagerCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenModelSlotManagerDialogCheckbox);\n var showMergeLabCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenMergeLabDialogCheckbox);\n var showAdvancedSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenAdvancedSettingDialogCheckbox);\n var showGetServerInformationCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenGetServerInformationDialogCheckbox);\n var showGetClientInformationCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenGetClientInformationDialogCheckbox);\n var showTextInputCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenTextInputDialogCheckbox);\n var showLicenseCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenShowLicenseDialogCheckbox);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n openServerControlCheckbox.updateState(true);\n openModelSettingCheckbox.updateState(false);\n openDeviceSettingCheckbox.updateState(true);\n openSpeakerSettingCheckbox.updateState(true);\n openConverterSettingCheckbox.updateState(true);\n openQualityControlCheckbox.updateState(false);\n openLabCheckbox.updateState(false);\n openAdvancedSettingCheckbox.updateState(false);\n showWaitingCheckbox.updateState(false);\n showStartingNoticeCheckbox.updateState(false);\n showModelSlotManagerCheckbox.updateState(false);\n showMergeLabCheckbox.updateState(false);\n showAdvancedSettingCheckbox.updateState(false);\n showGetServerInformationCheckbox.updateState(false);\n showGetClientInformationCheckbox.updateState(false);\n showTextInputCheckbox.updateState(false);\n showLicenseCheckbox.updateState(false);\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var show = function show() {\n var _document$getElementB, _document$getElementB2;\n // const lang = window.navigator.language\n // const edition = appGuiSettingState.edition\n // console.log(\"appGuiSettingState.edition\", appGuiSettingState.edition, lang)\n // if ((edition == \"onnxdirectML-cuda\" || edition == \"\") && lang == \"ja\") {\n // return\n // }\n\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n showStartingNoticeCheckbox.updateState(true);\n (_document$getElementB2 = document.getElementById(\"dialog2\")) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.add(\"dialog-container-show\");\n };\n setTimeout(show);\n }, [appGuiSettingState.edition]);\n var providerValue = {\n stateControls: {\n openServerControlCheckbox: openServerControlCheckbox,\n openModelSettingCheckbox: openModelSettingCheckbox,\n openDeviceSettingCheckbox: openDeviceSettingCheckbox,\n openQualityControlCheckbox: openQualityControlCheckbox,\n openSpeakerSettingCheckbox: openSpeakerSettingCheckbox,\n openConverterSettingCheckbox: openConverterSettingCheckbox,\n openAdvancedSettingCheckbox: openAdvancedSettingCheckbox,\n openLabCheckbox: openLabCheckbox,\n showWaitingCheckbox: showWaitingCheckbox,\n showStartingNoticeCheckbox: showStartingNoticeCheckbox,\n showModelSlotManagerCheckbox: showModelSlotManagerCheckbox,\n showMergeLabCheckbox: showMergeLabCheckbox,\n showAdvancedSettingCheckbox: showAdvancedSettingCheckbox,\n showGetServerInformationCheckbox: showGetServerInformationCheckbox,\n showGetClientInformationCheckbox: showGetClientInformationCheckbox,\n showTextInputCheckbox: showTextInputCheckbox,\n showLicenseCheckbox: showLicenseCheckbox\n },\n isConverting: isConverting,\n setIsConverting: setIsConverting,\n isAnalyzing: isAnalyzing,\n setIsAnalyzing: setIsAnalyzing,\n showPyTorchModelUpload: showPyTorchModelUpload,\n setShowPyTorchModelUpload: setShowPyTorchModelUpload,\n reloadDeviceInfo: reloadDeviceInfo,\n inputAudioDeviceInfo: inputAudioDeviceInfo,\n outputAudioDeviceInfo: outputAudioDeviceInfo,\n audioInputForGUI: audioInputForGUI,\n audioOutputForGUI: audioOutputForGUI,\n audioMonitorForGUI: audioMonitorForGUI,\n fileInputEchoback: fileInputEchoback,\n shareScreenEnabled: shareScreenEnabled,\n audioOutputForAnalyzer: audioOutputForAnalyzer,\n setInputAudioDeviceInfo: setInputAudioDeviceInfo,\n setOutputAudioDeviceInfo: setOutputAudioDeviceInfo,\n setAudioInputForGUI: setAudioInputForGUI,\n setAudioOutputForGUI: setAudioOutputForGUI,\n setAudioMonitorForGUI: setAudioMonitorForGUI,\n setFileInputEchoback: setFileInputEchoback,\n setShareScreenEnabled: setShareScreenEnabled,\n setAudioOutputForAnalyzer: setAudioOutputForAnalyzer,\n modelSlotNum: modelSlotNum,\n setModelSlotNum: setModelSlotNum,\n textInputResolve: textInputResolve,\n setTextInputResolve: setTextInputResolve\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(GuiStateContext.Provider, {\n value: providerValue\n }, children);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/001_GuiStateProvider.tsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GuiStateProvider: () => (/* binding */ GuiStateProvider),\n/* harmony export */ OpenAdvancedSettingCheckbox: () => (/* binding */ OpenAdvancedSettingCheckbox),\n/* harmony export */ OpenAdvancedSettingDialogCheckbox: () => (/* binding */ OpenAdvancedSettingDialogCheckbox),\n/* harmony export */ OpenConverterSettingCheckbox: () => (/* binding */ OpenConverterSettingCheckbox),\n/* harmony export */ OpenDeviceSettingCheckbox: () => (/* binding */ OpenDeviceSettingCheckbox),\n/* harmony export */ OpenEnablePassThroughDialogCheckbox: () => (/* binding */ OpenEnablePassThroughDialogCheckbox),\n/* harmony export */ OpenGetClientInformationDialogCheckbox: () => (/* binding */ OpenGetClientInformationDialogCheckbox),\n/* harmony export */ OpenGetServerInformationDialogCheckbox: () => (/* binding */ OpenGetServerInformationDialogCheckbox),\n/* harmony export */ OpenLabCheckbox: () => (/* binding */ OpenLabCheckbox),\n/* harmony export */ OpenLicenseDialogCheckbox: () => (/* binding */ OpenLicenseDialogCheckbox),\n/* harmony export */ OpenMergeLabDialogCheckbox: () => (/* binding */ OpenMergeLabDialogCheckbox),\n/* harmony export */ OpenModelSettingCheckbox: () => (/* binding */ OpenModelSettingCheckbox),\n/* harmony export */ OpenModelSlotManagerDialogCheckbox: () => (/* binding */ OpenModelSlotManagerDialogCheckbox),\n/* harmony export */ OpenQualityControlCheckbox: () => (/* binding */ OpenQualityControlCheckbox),\n/* harmony export */ OpenServerControlCheckbox: () => (/* binding */ OpenServerControlCheckbox),\n/* harmony export */ OpenShowLicenseDialogCheckbox: () => (/* binding */ OpenShowLicenseDialogCheckbox),\n/* harmony export */ OpenSpeakerSettingCheckbox: () => (/* binding */ OpenSpeakerSettingCheckbox),\n/* harmony export */ OpenStartingNoticeDialogCheckbox: () => (/* binding */ OpenStartingNoticeDialogCheckbox),\n/* harmony export */ OpenTextInputDialogCheckbox: () => (/* binding */ OpenTextInputDialogCheckbox),\n/* harmony export */ OpenWaitingDialogCheckbox: () => (/* binding */ OpenWaitingDialogCheckbox),\n/* harmony export */ useGuiState: () => (/* binding */ useGuiState)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n/* harmony import */ var _hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useStateControlCheckbox */ \"./src/hooks/useStateControlCheckbox.tsx\");\n\n\n\n\n\n\nvar OpenServerControlCheckbox = \"open-server-control-checkbox\";\nvar OpenModelSettingCheckbox = \"open-model-setting-checkbox\";\nvar OpenDeviceSettingCheckbox = \"open-device-setting-checkbox\";\nvar OpenQualityControlCheckbox = \"open-quality-control-checkbox\";\nvar OpenSpeakerSettingCheckbox = \"open-speaker-setting-checkbox\";\nvar OpenConverterSettingCheckbox = \"open-converter-setting-checkbox\";\nvar OpenAdvancedSettingCheckbox = \"open-advanced-setting-checkbox\";\nvar OpenLabCheckbox = \"open-lab-checkbox\";\nvar OpenLicenseDialogCheckbox = \"open-license-dialog-checkbox\";\nvar OpenWaitingDialogCheckbox = \"open-waiting-dialog-checkbox\";\nvar OpenStartingNoticeDialogCheckbox = \"open-starting-notice-dialog-checkbox\";\nvar OpenModelSlotManagerDialogCheckbox = \"open-model-slot-manager-dialog-checkbox\";\nvar OpenMergeLabDialogCheckbox = \"open-merge-lab-dialog-checkbox\";\nvar OpenAdvancedSettingDialogCheckbox = \"open-advanced-setting-dialog-checkbox\";\nvar OpenGetServerInformationDialogCheckbox = \"open-get-server-information-dialog-checkbox\";\nvar OpenGetClientInformationDialogCheckbox = \"open-get-client-information-dialog-checkbox\";\nvar OpenEnablePassThroughDialogCheckbox = \"open-enable-pass-through-dialog-checkbox\";\nvar OpenTextInputDialogCheckbox = \"open-text-input-dialog-checkbox\";\nvar OpenShowLicenseDialogCheckbox = \"open-show-license-dialog-checkbox\";\nvar GuiStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createContext(null);\nvar useGuiState = function useGuiState() {\n var state = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(GuiStateContext);\n if (!state) {\n throw new Error(\"useGuiState must be used within GuiStateProvider\");\n }\n return state;\n};\nvar GuiStateProvider = function GuiStateProvider(_ref) {\n var children = _ref.children;\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__.useAppRoot)(),\n appGuiSettingState = _useAppRoot.appGuiSettingState;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState, 2),\n isConverting = _useState2[0],\n setIsConverting = _useState2[1];\n var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState3, 2),\n isAnalyzing = _useState4[0],\n setIsAnalyzing = _useState4[1];\n var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(0),\n _useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState5, 2),\n modelSlotNum = _useState6[0],\n setModelSlotNum = _useState6[1];\n var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState7, 2),\n showPyTorchModelUpload = _useState8[0],\n setShowPyTorchModelUpload = _useState8[1];\n var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n _useState10 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState9, 2),\n inputAudioDeviceInfo = _useState10[0],\n setInputAudioDeviceInfo = _useState10[1];\n var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n _useState12 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState11, 2),\n outputAudioDeviceInfo = _useState12[0],\n setOutputAudioDeviceInfo = _useState12[1];\n var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState14 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState13, 2),\n audioInputForGUI = _useState14[0],\n setAudioInputForGUI = _useState14[1];\n var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState16 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState15, 2),\n audioOutputForGUI = _useState16[0],\n setAudioOutputForGUI = _useState16[1];\n var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"none\"),\n _useState18 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState17, 2),\n audioMonitorForGUI = _useState18[0],\n setAudioMonitorForGUI = _useState18[1];\n var _useState19 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState20 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState19, 2),\n fileInputEchoback = _useState20[0],\n setFileInputEchoback = _useState20[1]; //最初のmuteが有効になるように。undefined <-- ??? falseしておけばよさそう。undefinedだとwarningがでる。\n var _useState21 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false),\n _useState22 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState21, 2),\n shareScreenEnabled = _useState22[0],\n setShareScreenEnabled = _useState22[1];\n var _useState23 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"default\"),\n _useState24 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState23, 2),\n audioOutputForAnalyzer = _useState24[0],\n setAudioOutputForAnalyzer = _useState24[1];\n var _useState25 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null),\n _useState26 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_useState25, 2),\n textInputResolve = _useState26[0],\n setTextInputResolve = _useState26[1];\n var reloadDeviceInfo = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee() {\n var ms, mediaDeviceInfos, audioInputs, audioOutputs;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return navigator.mediaDevices.getUserMedia({\n video: false,\n audio: true\n });\n case 3:\n ms = _context.sent;\n ms.getTracks().forEach(function (x) {\n x.stop();\n });\n _context.next = 10;\n break;\n case 7:\n _context.prev = 7;\n _context.t0 = _context[\"catch\"](0);\n console.warn(\"Enumerate device error::\", _context.t0);\n case 10:\n _context.next = 12;\n return navigator.mediaDevices.enumerateDevices();\n case 12:\n mediaDeviceInfos = _context.sent;\n audioInputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audioinput\";\n });\n audioInputs.push({\n deviceId: \"none\",\n groupId: \"none\",\n kind: \"audioinput\",\n label: \"none\",\n toJSON: function toJSON() {}\n });\n audioInputs.push({\n deviceId: \"file\",\n groupId: \"file\",\n kind: \"audioinput\",\n label: \"file\",\n toJSON: function toJSON() {}\n });\n audioInputs.push({\n deviceId: \"screen\",\n groupId: \"screen\",\n kind: \"audioinput\",\n label: \"system(only win)\",\n toJSON: function toJSON() {}\n });\n audioOutputs = mediaDeviceInfos.filter(function (x) {\n return x.kind == \"audiooutput\";\n });\n audioOutputs.push({\n deviceId: \"none\",\n groupId: \"none\",\n kind: \"audiooutput\",\n label: \"none\",\n toJSON: function toJSON() {}\n });\n // audioOutputs.push({\n // deviceId: \"record\",\n // groupId: \"record\",\n // kind: \"audiooutput\",\n // label: \"record\",\n // toJSON: () => { }\n // })\n return _context.abrupt(\"return\", [audioInputs, audioOutputs]);\n case 20:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 7]]);\n }));\n return function reloadDeviceInfo() {\n return _ref2.apply(this, arguments);\n };\n }();\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var audioInitialize = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() {\n var audioInfo;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return reloadDeviceInfo();\n case 2:\n audioInfo = _context2.sent;\n setInputAudioDeviceInfo(audioInfo[0]);\n setOutputAudioDeviceInfo(audioInfo[1]);\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function audioInitialize() {\n return _ref3.apply(this, arguments);\n };\n }();\n audioInitialize();\n }, []);\n\n // (1) Controller Switch\n var openServerControlCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenServerControlCheckbox);\n var openModelSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenModelSettingCheckbox);\n var openDeviceSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenDeviceSettingCheckbox);\n var openQualityControlCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenQualityControlCheckbox);\n var openSpeakerSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenSpeakerSettingCheckbox);\n var openConverterSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenConverterSettingCheckbox);\n var openAdvancedSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenAdvancedSettingCheckbox);\n var openLabCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenLabCheckbox);\n var showWaitingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenWaitingDialogCheckbox);\n var showStartingNoticeCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenStartingNoticeDialogCheckbox);\n var showModelSlotManagerCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenModelSlotManagerDialogCheckbox);\n var showMergeLabCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenMergeLabDialogCheckbox);\n var showAdvancedSettingCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenAdvancedSettingDialogCheckbox);\n var showGetServerInformationCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenGetServerInformationDialogCheckbox);\n var showGetClientInformationCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenGetClientInformationDialogCheckbox);\n var showEnablePassThroughDialogCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenEnablePassThroughDialogCheckbox);\n var showTextInputCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenTextInputDialogCheckbox);\n var showLicenseCheckbox = (0,_hooks_useStateControlCheckbox__WEBPACK_IMPORTED_MODULE_5__.useStateControlCheckbox)(OpenShowLicenseDialogCheckbox);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n openServerControlCheckbox.updateState(true);\n openModelSettingCheckbox.updateState(false);\n openDeviceSettingCheckbox.updateState(true);\n openSpeakerSettingCheckbox.updateState(true);\n openConverterSettingCheckbox.updateState(true);\n openQualityControlCheckbox.updateState(false);\n openLabCheckbox.updateState(false);\n openAdvancedSettingCheckbox.updateState(false);\n showWaitingCheckbox.updateState(false);\n showStartingNoticeCheckbox.updateState(false);\n showModelSlotManagerCheckbox.updateState(false);\n showMergeLabCheckbox.updateState(false);\n showAdvancedSettingCheckbox.updateState(false);\n showGetServerInformationCheckbox.updateState(false);\n showGetClientInformationCheckbox.updateState(false);\n showEnablePassThroughDialogCheckbox.updateState(false);\n showTextInputCheckbox.updateState(false);\n showLicenseCheckbox.updateState(false);\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n var show = function show() {\n var _document$getElementB, _document$getElementB2;\n // const lang = window.navigator.language\n // const edition = appGuiSettingState.edition\n // console.log(\"appGuiSettingState.edition\", appGuiSettingState.edition, lang)\n // if ((edition == \"onnxdirectML-cuda\" || edition == \"\") && lang == \"ja\") {\n // return\n // }\n\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n showStartingNoticeCheckbox.updateState(true);\n (_document$getElementB2 = document.getElementById(\"dialog2\")) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.classList.add(\"dialog-container-show\");\n };\n setTimeout(show);\n }, [appGuiSettingState.edition]);\n var providerValue = {\n stateControls: {\n openServerControlCheckbox: openServerControlCheckbox,\n openModelSettingCheckbox: openModelSettingCheckbox,\n openDeviceSettingCheckbox: openDeviceSettingCheckbox,\n openQualityControlCheckbox: openQualityControlCheckbox,\n openSpeakerSettingCheckbox: openSpeakerSettingCheckbox,\n openConverterSettingCheckbox: openConverterSettingCheckbox,\n openAdvancedSettingCheckbox: openAdvancedSettingCheckbox,\n openLabCheckbox: openLabCheckbox,\n showWaitingCheckbox: showWaitingCheckbox,\n showStartingNoticeCheckbox: showStartingNoticeCheckbox,\n showModelSlotManagerCheckbox: showModelSlotManagerCheckbox,\n showMergeLabCheckbox: showMergeLabCheckbox,\n showAdvancedSettingCheckbox: showAdvancedSettingCheckbox,\n showGetServerInformationCheckbox: showGetServerInformationCheckbox,\n showGetClientInformationCheckbox: showGetClientInformationCheckbox,\n showEnablePassThroughDialogCheckbox: showEnablePassThroughDialogCheckbox,\n showTextInputCheckbox: showTextInputCheckbox,\n showLicenseCheckbox: showLicenseCheckbox\n },\n isConverting: isConverting,\n setIsConverting: setIsConverting,\n isAnalyzing: isAnalyzing,\n setIsAnalyzing: setIsAnalyzing,\n showPyTorchModelUpload: showPyTorchModelUpload,\n setShowPyTorchModelUpload: setShowPyTorchModelUpload,\n reloadDeviceInfo: reloadDeviceInfo,\n inputAudioDeviceInfo: inputAudioDeviceInfo,\n outputAudioDeviceInfo: outputAudioDeviceInfo,\n audioInputForGUI: audioInputForGUI,\n audioOutputForGUI: audioOutputForGUI,\n audioMonitorForGUI: audioMonitorForGUI,\n fileInputEchoback: fileInputEchoback,\n shareScreenEnabled: shareScreenEnabled,\n audioOutputForAnalyzer: audioOutputForAnalyzer,\n setInputAudioDeviceInfo: setInputAudioDeviceInfo,\n setOutputAudioDeviceInfo: setOutputAudioDeviceInfo,\n setAudioInputForGUI: setAudioInputForGUI,\n setAudioOutputForGUI: setAudioOutputForGUI,\n setAudioMonitorForGUI: setAudioMonitorForGUI,\n setFileInputEchoback: setFileInputEchoback,\n setShareScreenEnabled: setShareScreenEnabled,\n setAudioOutputForAnalyzer: setAudioOutputForAnalyzer,\n modelSlotNum: modelSlotNum,\n setModelSlotNum: setModelSlotNum,\n textInputResolve: textInputResolve,\n setTextInputResolve: setTextInputResolve\n };\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(GuiStateContext.Provider, {\n value: providerValue\n }, children);\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/001_GuiStateProvider.tsx?"); /***/ }), @@ -147,7 +147,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Dialogs: () => (/* binding */ Dialogs)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _902_WaitingDialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./902_WaitingDialog */ \"./src/components/demo/902_WaitingDialog.tsx\");\n/* harmony import */ var _903_StartingNoticeDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./903_StartingNoticeDialog */ \"./src/components/demo/903_StartingNoticeDialog.tsx\");\n/* harmony import */ var _904_ModelSlotManagerDialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./904_ModelSlotManagerDialog */ \"./src/components/demo/904_ModelSlotManagerDialog.tsx\");\n/* harmony import */ var _905_MergeLabDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./905_MergeLabDialog */ \"./src/components/demo/905_MergeLabDialog.tsx\");\n/* harmony import */ var _906_AdvancedSettingDialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./906_AdvancedSettingDialog */ \"./src/components/demo/906_AdvancedSettingDialog.tsx\");\n/* harmony import */ var _907_GetServerInfomationDialog__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./907_GetServerInfomationDialog */ \"./src/components/demo/907_GetServerInfomationDialog.tsx\");\n/* harmony import */ var _908_GetClientInfomationDialog__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./908_GetClientInfomationDialog */ \"./src/components/demo/908_GetClientInfomationDialog.tsx\");\n\n\n\n\n\n\n\n\n\nvar Dialogs = function Dialogs() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var dialogs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, guiState.stateControls.showWaitingCheckbox.trigger, guiState.stateControls.showStartingNoticeCheckbox.trigger, guiState.stateControls.showModelSlotManagerCheckbox.trigger, guiState.stateControls.showMergeLabCheckbox.trigger, guiState.stateControls.showAdvancedSettingCheckbox.trigger, guiState.stateControls.showGetServerInformationCheckbox.trigger, guiState.stateControls.showGetClientInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-container\",\n id: \"dialog\"\n }, guiState.stateControls.showWaitingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_902_WaitingDialog__WEBPACK_IMPORTED_MODULE_2__.WaitingDialog, null), guiState.stateControls.showStartingNoticeCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_903_StartingNoticeDialog__WEBPACK_IMPORTED_MODULE_3__.StartingNoticeDialog, null), guiState.stateControls.showModelSlotManagerCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_904_ModelSlotManagerDialog__WEBPACK_IMPORTED_MODULE_4__.ModelSlotManagerDialog, null), guiState.stateControls.showMergeLabCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_905_MergeLabDialog__WEBPACK_IMPORTED_MODULE_5__.MergeLabDialog, null), guiState.stateControls.showAdvancedSettingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_906_AdvancedSettingDialog__WEBPACK_IMPORTED_MODULE_6__.AdvancedSettingDialog, null), guiState.stateControls.showGetServerInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_907_GetServerInfomationDialog__WEBPACK_IMPORTED_MODULE_7__.GetServerInfomationDialog, null), guiState.stateControls.showGetClientInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_908_GetClientInfomationDialog__WEBPACK_IMPORTED_MODULE_8__.GetClientInfomationDialog, null)));\n return dialogs;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/900_Dialogs.tsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Dialogs: () => (/* binding */ Dialogs)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _902_WaitingDialog__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./902_WaitingDialog */ \"./src/components/demo/902_WaitingDialog.tsx\");\n/* harmony import */ var _903_StartingNoticeDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./903_StartingNoticeDialog */ \"./src/components/demo/903_StartingNoticeDialog.tsx\");\n/* harmony import */ var _904_ModelSlotManagerDialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./904_ModelSlotManagerDialog */ \"./src/components/demo/904_ModelSlotManagerDialog.tsx\");\n/* harmony import */ var _905_MergeLabDialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./905_MergeLabDialog */ \"./src/components/demo/905_MergeLabDialog.tsx\");\n/* harmony import */ var _906_AdvancedSettingDialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./906_AdvancedSettingDialog */ \"./src/components/demo/906_AdvancedSettingDialog.tsx\");\n/* harmony import */ var _907_GetServerInfomationDialog__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./907_GetServerInfomationDialog */ \"./src/components/demo/907_GetServerInfomationDialog.tsx\");\n/* harmony import */ var _908_GetClientInfomationDialog__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./908_GetClientInfomationDialog */ \"./src/components/demo/908_GetClientInfomationDialog.tsx\");\n/* harmony import */ var _909_EnablePassThroughDialog__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./909_EnablePassThroughDialog */ \"./src/components/demo/909_EnablePassThroughDialog.tsx\");\n\n\n\n\n\n\n\n\n\n\nvar Dialogs = function Dialogs() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_1__.useGuiState)();\n var dialogs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, guiState.stateControls.showWaitingCheckbox.trigger, guiState.stateControls.showStartingNoticeCheckbox.trigger, guiState.stateControls.showModelSlotManagerCheckbox.trigger, guiState.stateControls.showMergeLabCheckbox.trigger, guiState.stateControls.showAdvancedSettingCheckbox.trigger, guiState.stateControls.showGetServerInformationCheckbox.trigger, guiState.stateControls.showGetClientInformationCheckbox.trigger, guiState.stateControls.showEnablePassThroughDialogCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dialog-container\",\n id: \"dialog\"\n }, guiState.stateControls.showWaitingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_902_WaitingDialog__WEBPACK_IMPORTED_MODULE_2__.WaitingDialog, null), guiState.stateControls.showStartingNoticeCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_903_StartingNoticeDialog__WEBPACK_IMPORTED_MODULE_3__.StartingNoticeDialog, null), guiState.stateControls.showModelSlotManagerCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_904_ModelSlotManagerDialog__WEBPACK_IMPORTED_MODULE_4__.ModelSlotManagerDialog, null), guiState.stateControls.showMergeLabCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_905_MergeLabDialog__WEBPACK_IMPORTED_MODULE_5__.MergeLabDialog, null), guiState.stateControls.showAdvancedSettingCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_906_AdvancedSettingDialog__WEBPACK_IMPORTED_MODULE_6__.AdvancedSettingDialog, null), guiState.stateControls.showGetServerInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_907_GetServerInfomationDialog__WEBPACK_IMPORTED_MODULE_7__.GetServerInfomationDialog, null), guiState.stateControls.showGetClientInformationCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_908_GetClientInfomationDialog__WEBPACK_IMPORTED_MODULE_8__.GetClientInfomationDialog, null), guiState.stateControls.showEnablePassThroughDialogCheckbox.trigger, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_909_EnablePassThroughDialog__WEBPACK_IMPORTED_MODULE_9__.EnablePassThroughDialog, null)));\n return dialogs;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/900_Dialogs.tsx?"); /***/ }), @@ -272,6 +272,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./src/components/demo/909_EnablePassThroughDialog.tsx": +/*!*************************************************************!*\ + !*** ./src/components/demo/909_EnablePassThroughDialog.tsx ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EnablePassThroughDialog: () => (/* binding */ EnablePassThroughDialog)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../001_provider/001_AppRootProvider */ \"./src/001_provider/001_AppRootProvider.tsx\");\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\nvar EnablePassThroughDialog = function EnablePassThroughDialog() {\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_2__.useGuiState)();\n var _useAppRoot = (0,_001_provider_001_AppRootProvider__WEBPACK_IMPORTED_MODULE_4__.useAppRoot)(),\n audioContextState = _useAppRoot.audioContextState;\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)(),\n serverSetting = _useAppState.serverSetting;\n var _useAppState2 = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_3__.useAppState)(),\n setting = _useAppState2.setting;\n var dialog = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {\n var buttonRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-row split-3-4-3 left-padding-1\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button-container body-button-container-space-around\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n passThrough: true\n }));\n guiState.stateControls.showEnablePassThroughDialogCheckbox.updateState(false);\n }\n }, \"OK\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-button\",\n onClick: function onClick() {\n guiState.stateControls.showEnablePassThroughDialogCheckbox.updateState(false);\n }\n }, \"Cancel\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"body-item-text\"\n }));\n console.log(\"AUDIO_CONTEXT\", audioContextState.audioContext);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-frame\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-title\"\n }, \"Enable Pass Through\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"dialog-content\"\n }, buttonRow));\n }, [setting, audioContextState]);\n return dialog;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/909_EnablePassThroughDialog.tsx?"); + +/***/ }), + /***/ "./src/components/demo/910_Dialogs2.tsx": /*!**********************************************!*\ !*** ./src/components/demo/910_Dialogs2.tsx ***! @@ -422,7 +433,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CharacterArea: () => (/* binding */ CharacterArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n/* harmony import */ var _101_1_TuningArea__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./101-1_TuningArea */ \"./src/components/demo/components2/101-1_TuningArea.tsx\");\n/* harmony import */ var _101_2_IndexArea__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./101-2_IndexArea */ \"./src/components/demo/components2/101-2_IndexArea.tsx\");\n/* harmony import */ var _101_3_SpeakerArea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./101-3_SpeakerArea */ \"./src/components/demo/components2/101-3_SpeakerArea.tsx\");\n/* harmony import */ var _101_4_F0FactorArea__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./101-4_F0FactorArea */ \"./src/components/demo/components2/101-4_F0FactorArea.tsx\");\n/* harmony import */ var _101_5_so_vits_svc40SettingArea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./101-5_so-vits-svc40SettingArea */ \"./src/components/demo/components2/101-5_so-vits-svc40SettingArea.tsx\");\n/* harmony import */ var _101_6_ddsp_svc30SettingArea__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./101-6_ddsp-svc30SettingArea */ \"./src/components/demo/components2/101-6_ddsp-svc30SettingArea.tsx\");\n/* harmony import */ var _101_7_diffusion_svcSettingArea__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./101-7_diffusion-svcSettingArea */ \"./src/components/demo/components2/101-7_diffusion-svcSettingArea.tsx\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\n\n\n\n\n\n\n\nvar CharacterArea = function CharacterArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n serverSetting = _useAppState.serverSetting,\n initializedRef = _useAppState.initializedRef,\n volume = _useAppState.volume,\n bufferingTime = _useAppState.bufferingTime,\n performance = _useAppState.performance,\n setting = _useAppState.setting,\n setVoiceChangerClientSetting = _useAppState.setVoiceChangerClientSetting,\n start = _useAppState.start,\n stop = _useAppState.stop;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)();\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"terms_of_use\", {\n ja: \"利用規約\",\n en: \"terms of use\"\n });\n messageBuilderState.setMessage(__filename, \"export_to_onnx\", {\n ja: \"onnx出力\",\n en: \"export to onnx\"\n });\n messageBuilderState.setMessage(__filename, \"save_default\", {\n ja: \"設定保存\",\n en: \"save setting\"\n });\n messageBuilderState.setMessage(__filename, \"alert_onnx\", {\n ja: \"ボイチェン中はonnx出力できません\",\n en: \"cannot export onnx when voice conversion is enabled\"\n });\n }, []);\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var vol = document.getElementById(\"status-vol\");\n var buf = document.getElementById(\"status-buf\");\n var res = document.getElementById(\"status-res\");\n if (!vol || !buf || !res) {\n return;\n }\n vol.innerText = volume.toFixed(4);\n buf.innerText = bufferingTime.toString();\n res.innerText = performance.responseTime.toString();\n }, [volume, bufferingTime, performance]);\n var portrait = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var icon = selected.iconFile.length > 0 ? serverSetting.serverSetting.voiceChangerParams.model_dir + \"/\" + selected.slotIndex + \"/\" + selected.iconFile.split(/[\\/\\\\]/).pop() : \"./assets/icons/human.png\";\n var selectedTermOfUseUrlLink = selected.termsOfUseUrl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"a\", {\n href: selected.termsOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"portrait-area-terms-of-use-link\"\n }, \"[\", messageBuilderState.getMessage(__filename, \"terms_of_use\"), \"]\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"img\", {\n className: \"portrait\",\n src: icon,\n alt: selected.name\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area-status\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"portrait-area-status-vctype\"\n }, selected.voiceChangerType)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"vol: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-vol\"\n }, \"0\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"buf: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-buf\"\n }, \"0\"), \" ms\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"res: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-res\"\n }, \"0\"), \" ms\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area-terms-of-use\"\n }, selectedTermOfUseUrlLink)));\n }, [selected]);\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n startWithAudioContextCreate = _useState2[0],\n setStartWithAudioContextCreate = _useState2[1];\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n if (!startWithAudioContextCreate) {\n return;\n }\n guiState.setIsConverting(true);\n start();\n }, [startWithAudioContextCreate]);\n var startControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var onStartClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(serverSetting.serverSetting.enableServerAudio == 0)) {\n _context.next = 17;\n break;\n }\n if (initializedRef.current) {\n _context.next = 12;\n break;\n }\n case 2:\n if (false) {}\n _context.next = 5;\n return new Promise(function (resolve) {\n setTimeout(resolve, 500);\n });\n case 5:\n if (!initializedRef.current) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"break\", 9);\n case 7:\n _context.next = 2;\n break;\n case 9:\n setStartWithAudioContextCreate(true);\n _context.next = 15;\n break;\n case 12:\n guiState.setIsConverting(true);\n _context.next = 15;\n return start();\n case 15:\n _context.next = 19;\n break;\n case 17:\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioStated: 1\n }));\n guiState.setIsConverting(true);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onStartClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onStopClicked = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!(serverSetting.serverSetting.enableServerAudio == 0)) {\n _context2.next = 6;\n break;\n }\n guiState.setIsConverting(false);\n _context2.next = 4;\n return stop();\n case 4:\n _context2.next = 8;\n break;\n case 6:\n guiState.setIsConverting(false);\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioStated: 0\n }));\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onStopClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var onPassThroughClicked = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee3() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n passThrough: !serverSetting.serverSetting.passThrough\n }));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function onPassThroughClicked() {\n return _ref3.apply(this, arguments);\n };\n }();\n var startClassName = guiState.isConverting ? \"character-area-control-button-active\" : \"character-area-control-button-stanby\";\n var stopClassName = guiState.isConverting ? \"character-area-control-button-stanby\" : \"character-area-control-button-active\";\n var passThruClassName = serverSetting.serverSetting.passThrough == false ? \"character-area-control-passthru-button-stanby\" : \"character-area-control-passthru-button-active blinking\";\n console.log(\"serverSetting.serverSetting.passThrough\", passThruClassName, serverSetting.serverSetting.passThrough);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onStartClicked,\n className: startClassName\n }, \"start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onStopClicked,\n className: stopClassName\n }, \"stop\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onPassThroughClicked,\n className: passThruClassName\n }, \"passthru\")));\n }, [guiState.isConverting, start, stop, serverSetting.serverSetting, serverSetting.updateServerSettings]);\n var gainControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var currentInputGain = serverSetting.serverSetting.enableServerAudio == 0 ? setting.voiceChangerClientSetting.inputGain : serverSetting.serverSetting.serverInputAudioGain;\n var inputValueUpdatedAction = serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/function () {\n var _ref4 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee4(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n inputGain: val\n }));\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function (_x) {\n return _ref4.apply(this, arguments);\n };\n }() : /*#__PURE__*/function () {\n var _ref5 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee5(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverInputAudioGain: val\n }));\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function (_x2) {\n return _ref5.apply(this, arguments);\n };\n }();\n var currentOutputGain = serverSetting.serverSetting.enableServerAudio == 0 ? setting.voiceChangerClientSetting.outputGain : serverSetting.serverSetting.serverOutputAudioGain;\n var outputValueUpdatedAction = serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/function () {\n var _ref6 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee6(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n outputGain: val\n }));\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return function (_x3) {\n return _ref6.apply(this, arguments);\n };\n }() : /*#__PURE__*/function () {\n var _ref7 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee7(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverOutputAudioGain: val\n }));\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7);\n }));\n return function (_x4) {\n return _ref7.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"GAIN:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"in\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: currentInputGain,\n onChange: function onChange(e) {\n inputValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentInputGain)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"out\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: currentOutputGain,\n onChange: function onChange(e) {\n outputValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentOutputGain))));\n }, [serverSetting.serverSetting, setting, setVoiceChangerClientSetting, serverSetting.updateServerSettings]);\n var modelSlotControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var onUpdateDefaultClicked = /*#__PURE__*/function () {\n var _ref8 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee8() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return serverSetting.updateModelDefault();\n case 2:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8);\n }));\n return function onUpdateDefaultClicked() {\n return _ref8.apply(this, arguments);\n };\n }();\n var onnxExportButtonAction = /*#__PURE__*/function () {\n var _ref9 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee9() {\n var _document$getElementB;\n var res, a;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n if (!guiState.isConverting) {\n _context9.next = 3;\n break;\n }\n alert(messageBuilderState.getMessage(__filename, \"alert_onnx\"));\n return _context9.abrupt(\"return\");\n case 3:\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n guiState.stateControls.showWaitingCheckbox.updateState(true);\n _context9.next = 7;\n return serverSetting.getOnnx();\n case 7:\n res = _context9.sent;\n a = document.createElement(\"a\");\n a.href = res.path;\n a.download = res.filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n guiState.stateControls.showWaitingCheckbox.updateState(false);\n case 15:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9);\n }));\n return function onnxExportButtonAction() {\n return _ref9.apply(this, arguments);\n };\n }();\n var exportOnnx = selected.voiceChangerType == \"RVC\" && selected.modelFile.endsWith(\"pth\") ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-button\",\n onClick: onnxExportButtonAction\n }, messageBuilderState.getMessage(__filename, \"export_to_onnx\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-button\",\n onClick: onUpdateDefaultClicked\n }, messageBuilderState.getMessage(__filename, \"save_default\")), exportOnnx)));\n }, [selected, serverSetting.getOnnx, serverSetting.updateModelDefault, guiState.isConverting]);\n var characterArea = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area\"\n }, portrait, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-area\"\n }, startControl, gainControl, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_1_TuningArea__WEBPACK_IMPORTED_MODULE_8__.TuningArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_2_IndexArea__WEBPACK_IMPORTED_MODULE_9__.IndexArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_3_SpeakerArea__WEBPACK_IMPORTED_MODULE_10__.SpeakerArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_4_F0FactorArea__WEBPACK_IMPORTED_MODULE_11__.F0FactorArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_5_so_vits_svc40SettingArea__WEBPACK_IMPORTED_MODULE_12__.SoVitsSVC40SettingArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_6_ddsp_svc30SettingArea__WEBPACK_IMPORTED_MODULE_13__.DDSPSVC30SettingArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_7_diffusion_svcSettingArea__WEBPACK_IMPORTED_MODULE_14__.DiffusionSVCSettingArea, null), modelSlotControl));\n }, [portrait, startControl, gainControl, modelSlotControl]);\n return characterArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101_CharacterArea.tsx?"); +eval("var __filename = \"/index.js\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CharacterArea: () => (/* binding */ CharacterArea)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../001_provider/001_AppStateProvider */ \"./src/001_provider/001_AppStateProvider.tsx\");\n/* harmony import */ var _001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../001_GuiStateProvider */ \"./src/components/demo/001_GuiStateProvider.tsx\");\n/* harmony import */ var _hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../hooks/useMessageBuilder */ \"./src/hooks/useMessageBuilder.ts\");\n/* harmony import */ var _101_1_TuningArea__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./101-1_TuningArea */ \"./src/components/demo/components2/101-1_TuningArea.tsx\");\n/* harmony import */ var _101_2_IndexArea__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./101-2_IndexArea */ \"./src/components/demo/components2/101-2_IndexArea.tsx\");\n/* harmony import */ var _101_3_SpeakerArea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./101-3_SpeakerArea */ \"./src/components/demo/components2/101-3_SpeakerArea.tsx\");\n/* harmony import */ var _101_4_F0FactorArea__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./101-4_F0FactorArea */ \"./src/components/demo/components2/101-4_F0FactorArea.tsx\");\n/* harmony import */ var _101_5_so_vits_svc40SettingArea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./101-5_so-vits-svc40SettingArea */ \"./src/components/demo/components2/101-5_so-vits-svc40SettingArea.tsx\");\n/* harmony import */ var _101_6_ddsp_svc30SettingArea__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./101-6_ddsp-svc30SettingArea */ \"./src/components/demo/components2/101-6_ddsp-svc30SettingArea.tsx\");\n/* harmony import */ var _101_7_diffusion_svcSettingArea__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./101-7_diffusion-svcSettingArea */ \"./src/components/demo/components2/101-7_diffusion-svcSettingArea.tsx\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n\n\n\n\n\n\n\n\nvar CharacterArea = function CharacterArea(_props) {\n var _useAppState = (0,_001_provider_001_AppStateProvider__WEBPACK_IMPORTED_MODULE_5__.useAppState)(),\n serverSetting = _useAppState.serverSetting,\n initializedRef = _useAppState.initializedRef,\n volume = _useAppState.volume,\n bufferingTime = _useAppState.bufferingTime,\n performance = _useAppState.performance,\n setting = _useAppState.setting,\n setVoiceChangerClientSetting = _useAppState.setVoiceChangerClientSetting,\n start = _useAppState.start,\n stop = _useAppState.stop;\n var guiState = (0,_001_GuiStateProvider__WEBPACK_IMPORTED_MODULE_6__.useGuiState)();\n var messageBuilderState = (0,_hooks_useMessageBuilder__WEBPACK_IMPORTED_MODULE_7__.useMessageBuilder)();\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n messageBuilderState.setMessage(__filename, \"terms_of_use\", {\n ja: \"利用規約\",\n en: \"terms of use\"\n });\n messageBuilderState.setMessage(__filename, \"export_to_onnx\", {\n ja: \"onnx出力\",\n en: \"export to onnx\"\n });\n messageBuilderState.setMessage(__filename, \"save_default\", {\n ja: \"設定保存\",\n en: \"save setting\"\n });\n messageBuilderState.setMessage(__filename, \"alert_onnx\", {\n ja: \"ボイチェン中はonnx出力できません\",\n en: \"cannot export onnx when voice conversion is enabled\"\n });\n }, []);\n var selected = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (serverSetting.serverSetting.modelSlotIndex == undefined) {\n return;\n }\n return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];\n }, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n var vol = document.getElementById(\"status-vol\");\n var buf = document.getElementById(\"status-buf\");\n var res = document.getElementById(\"status-res\");\n if (!vol || !buf || !res) {\n return;\n }\n vol.innerText = volume.toFixed(4);\n buf.innerText = bufferingTime.toString();\n res.innerText = performance.responseTime.toString();\n }, [volume, bufferingTime, performance]);\n var portrait = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var icon = selected.iconFile.length > 0 ? serverSetting.serverSetting.voiceChangerParams.model_dir + \"/\" + selected.slotIndex + \"/\" + selected.iconFile.split(/[\\/\\\\]/).pop() : \"./assets/icons/human.png\";\n var selectedTermOfUseUrlLink = selected.termsOfUseUrl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"a\", {\n href: selected.termsOfUseUrl,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"portrait-area-terms-of-use-link\"\n }, \"[\", messageBuilderState.getMessage(__filename, \"terms_of_use\"), \"]\") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-container\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"img\", {\n className: \"portrait\",\n src: icon,\n alt: selected.name\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area-status\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"portrait-area-status-vctype\"\n }, selected.voiceChangerType)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"vol: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-vol\"\n }, \"0\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"buf: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-buf\"\n }, \"0\"), \" ms\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"p\", null, \"res: \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n id: \"status-res\"\n }, \"0\"), \" ms\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"portrait-area-terms-of-use\"\n }, selectedTermOfUseUrlLink)));\n }, [selected]);\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_useState, 2),\n startWithAudioContextCreate = _useState2[0],\n setStartWithAudioContextCreate = _useState2[1];\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {\n if (!startWithAudioContextCreate) {\n return;\n }\n guiState.setIsConverting(true);\n start();\n }, [startWithAudioContextCreate]);\n var startControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var onStartClicked = /*#__PURE__*/function () {\n var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(serverSetting.serverSetting.enableServerAudio == 0)) {\n _context.next = 17;\n break;\n }\n if (initializedRef.current) {\n _context.next = 12;\n break;\n }\n case 2:\n if (false) {}\n _context.next = 5;\n return new Promise(function (resolve) {\n setTimeout(resolve, 500);\n });\n case 5:\n if (!initializedRef.current) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"break\", 9);\n case 7:\n _context.next = 2;\n break;\n case 9:\n setStartWithAudioContextCreate(true);\n _context.next = 15;\n break;\n case 12:\n guiState.setIsConverting(true);\n _context.next = 15;\n return start();\n case 15:\n _context.next = 19;\n break;\n case 17:\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioStated: 1\n }));\n guiState.setIsConverting(true);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function onStartClicked() {\n return _ref.apply(this, arguments);\n };\n }();\n var onStopClicked = /*#__PURE__*/function () {\n var _ref2 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!(serverSetting.serverSetting.enableServerAudio == 0)) {\n _context2.next = 6;\n break;\n }\n guiState.setIsConverting(false);\n _context2.next = 4;\n return stop();\n case 4:\n _context2.next = 8;\n break;\n case 6:\n guiState.setIsConverting(false);\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverAudioStated: 0\n }));\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function onStopClicked() {\n return _ref2.apply(this, arguments);\n };\n }();\n var onPassThroughClicked = /*#__PURE__*/function () {\n var _ref3 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee3() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (serverSetting.serverSetting.passThrough == false) {\n guiState.stateControls.showEnablePassThroughDialogCheckbox.updateState(true);\n } else {\n serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n passThrough: false\n }));\n }\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function onPassThroughClicked() {\n return _ref3.apply(this, arguments);\n };\n }();\n var startClassName = guiState.isConverting ? \"character-area-control-button-active\" : \"character-area-control-button-stanby\";\n var stopClassName = guiState.isConverting ? \"character-area-control-button-stanby\" : \"character-area-control-button-active\";\n var passThruClassName = serverSetting.serverSetting.passThrough == false ? \"character-area-control-passthru-button-stanby\" : \"character-area-control-passthru-button-active blinking\";\n console.log(\"serverSetting.serverSetting.passThrough\", passThruClassName, serverSetting.serverSetting.passThrough);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onStartClicked,\n className: startClassName\n }, \"start\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onStopClicked,\n className: stopClassName\n }, \"stop\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n onClick: onPassThroughClicked,\n className: passThruClassName\n }, \"passthru\")));\n }, [guiState.isConverting, start, stop, serverSetting.serverSetting, serverSetting.updateServerSettings]);\n var gainControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n var currentInputGain = serverSetting.serverSetting.enableServerAudio == 0 ? setting.voiceChangerClientSetting.inputGain : serverSetting.serverSetting.serverInputAudioGain;\n var inputValueUpdatedAction = serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/function () {\n var _ref4 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee4(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n inputGain: val\n }));\n case 2:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function (_x) {\n return _ref4.apply(this, arguments);\n };\n }() : /*#__PURE__*/function () {\n var _ref5 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee5(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverInputAudioGain: val\n }));\n case 2:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function (_x2) {\n return _ref5.apply(this, arguments);\n };\n }();\n var currentOutputGain = serverSetting.serverSetting.enableServerAudio == 0 ? setting.voiceChangerClientSetting.outputGain : serverSetting.serverSetting.serverOutputAudioGain;\n var outputValueUpdatedAction = serverSetting.serverSetting.enableServerAudio == 0 ? /*#__PURE__*/function () {\n var _ref6 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee6(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return setVoiceChangerClientSetting(_objectSpread(_objectSpread({}, setting.voiceChangerClientSetting), {}, {\n outputGain: val\n }));\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return function (_x3) {\n return _ref6.apply(this, arguments);\n };\n }() : /*#__PURE__*/function () {\n var _ref7 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee7(val) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return serverSetting.updateServerSettings(_objectSpread(_objectSpread({}, serverSetting.serverSetting), {}, {\n serverOutputAudioGain: val\n }));\n case 2:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7);\n }));\n return function (_x4) {\n return _ref7.apply(this, arguments);\n };\n }();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }, \"GAIN:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"in\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: currentInputGain,\n onChange: function onChange(e) {\n inputValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentInputGain)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-slider-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-kind\"\n }, \"out\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-slider\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"input\", {\n type: \"range\",\n min: \"0.1\",\n max: \"10.0\",\n step: \"0.1\",\n value: currentOutputGain,\n onChange: function onChange(e) {\n outputValueUpdatedAction(Number(e.target.value));\n }\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"span\", {\n className: \"character-area-slider-control-val\"\n }, currentOutputGain))));\n }, [serverSetting.serverSetting, setting, setVoiceChangerClientSetting, serverSetting.updateServerSettings]);\n var modelSlotControl = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n if (!selected) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n }\n var onUpdateDefaultClicked = /*#__PURE__*/function () {\n var _ref8 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee8() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return serverSetting.updateModelDefault();\n case 2:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8);\n }));\n return function onUpdateDefaultClicked() {\n return _ref8.apply(this, arguments);\n };\n }();\n var onnxExportButtonAction = /*#__PURE__*/function () {\n var _ref9 = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee9() {\n var _document$getElementB;\n var res, a;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n if (!guiState.isConverting) {\n _context9.next = 3;\n break;\n }\n alert(messageBuilderState.getMessage(__filename, \"alert_onnx\"));\n return _context9.abrupt(\"return\");\n case 3:\n (_document$getElementB = document.getElementById(\"dialog\")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.classList.add(\"dialog-container-show\");\n guiState.stateControls.showWaitingCheckbox.updateState(true);\n _context9.next = 7;\n return serverSetting.getOnnx();\n case 7:\n res = _context9.sent;\n a = document.createElement(\"a\");\n a.href = res.path;\n a.download = res.filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n guiState.stateControls.showWaitingCheckbox.updateState(false);\n case 15:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9);\n }));\n return function onnxExportButtonAction() {\n return _ref9.apply(this, arguments);\n };\n }();\n var exportOnnx = selected.voiceChangerType == \"RVC\" && selected.modelFile.endsWith(\"pth\") ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-button\",\n onClick: onnxExportButtonAction\n }, messageBuilderState.getMessage(__filename, \"export_to_onnx\")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement((react__WEBPACK_IMPORTED_MODULE_4___default().Fragment), null);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-title\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-field\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-buttons\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-button\",\n onClick: onUpdateDefaultClicked\n }, messageBuilderState.getMessage(__filename, \"save_default\")), exportOnnx)));\n }, [selected, serverSetting.getOnnx, serverSetting.updateModelDefault, guiState.isConverting]);\n var characterArea = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area\"\n }, portrait, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", {\n className: \"character-area-control-area\"\n }, startControl, gainControl, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_1_TuningArea__WEBPACK_IMPORTED_MODULE_8__.TuningArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_2_IndexArea__WEBPACK_IMPORTED_MODULE_9__.IndexArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_3_SpeakerArea__WEBPACK_IMPORTED_MODULE_10__.SpeakerArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_4_F0FactorArea__WEBPACK_IMPORTED_MODULE_11__.F0FactorArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_5_so_vits_svc40SettingArea__WEBPACK_IMPORTED_MODULE_12__.SoVitsSVC40SettingArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_6_ddsp_svc30SettingArea__WEBPACK_IMPORTED_MODULE_13__.DDSPSVC30SettingArea, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_101_7_diffusion_svcSettingArea__WEBPACK_IMPORTED_MODULE_14__.DiffusionSVCSettingArea, null), modelSlotControl));\n }, [portrait, startControl, gainControl, modelSlotControl]);\n return characterArea;\n};\n\n//# sourceURL=webpack://demo/./src/components/demo/components2/101_CharacterArea.tsx?"); /***/ }), diff --git a/client/demo/src/components/demo/001_GuiStateProvider.tsx b/client/demo/src/components/demo/001_GuiStateProvider.tsx index a239a9ec..9961e2c4 100644 --- a/client/demo/src/components/demo/001_GuiStateProvider.tsx +++ b/client/demo/src/components/demo/001_GuiStateProvider.tsx @@ -20,6 +20,7 @@ export const OpenMergeLabDialogCheckbox = "open-merge-lab-dialog-checkbox"; export const OpenAdvancedSettingDialogCheckbox = "open-advanced-setting-dialog-checkbox"; export const OpenGetServerInformationDialogCheckbox = "open-get-server-information-dialog-checkbox"; export const OpenGetClientInformationDialogCheckbox = "open-get-client-information-dialog-checkbox"; +export const OpenEnablePassThroughDialogCheckbox = "open-enable-pass-through-dialog-checkbox"; export const OpenTextInputDialogCheckbox = "open-text-input-dialog-checkbox"; export const OpenShowLicenseDialogCheckbox = "open-show-license-dialog-checkbox"; @@ -46,6 +47,7 @@ export type StateControls = { showAdvancedSettingCheckbox: StateControlCheckbox; showGetServerInformationCheckbox: StateControlCheckbox; showGetClientInformationCheckbox: StateControlCheckbox; + showEnablePassThroughDialogCheckbox: StateControlCheckbox; showTextInputCheckbox: StateControlCheckbox; showLicenseCheckbox: StateControlCheckbox; }; @@ -195,6 +197,7 @@ export const GuiStateProvider = ({ children }: Props) => { const showAdvancedSettingCheckbox = useStateControlCheckbox(OpenAdvancedSettingDialogCheckbox); const showGetServerInformationCheckbox = useStateControlCheckbox(OpenGetServerInformationDialogCheckbox); const showGetClientInformationCheckbox = useStateControlCheckbox(OpenGetClientInformationDialogCheckbox); + const showEnablePassThroughDialogCheckbox = useStateControlCheckbox(OpenEnablePassThroughDialogCheckbox); const showTextInputCheckbox = useStateControlCheckbox(OpenTextInputDialogCheckbox); const showLicenseCheckbox = useStateControlCheckbox(OpenShowLicenseDialogCheckbox); @@ -217,6 +220,7 @@ export const GuiStateProvider = ({ children }: Props) => { showAdvancedSettingCheckbox.updateState(false); showGetServerInformationCheckbox.updateState(false); showGetClientInformationCheckbox.updateState(false); + showEnablePassThroughDialogCheckbox.updateState(false); showTextInputCheckbox.updateState(false); showLicenseCheckbox.updateState(false); @@ -257,6 +261,7 @@ export const GuiStateProvider = ({ children }: Props) => { showAdvancedSettingCheckbox, showGetServerInformationCheckbox, showGetClientInformationCheckbox, + showEnablePassThroughDialogCheckbox, showTextInputCheckbox, showLicenseCheckbox, diff --git a/client/demo/src/components/demo/900_Dialogs.tsx b/client/demo/src/components/demo/900_Dialogs.tsx index 830d5167..37368794 100644 --- a/client/demo/src/components/demo/900_Dialogs.tsx +++ b/client/demo/src/components/demo/900_Dialogs.tsx @@ -7,6 +7,7 @@ import { MergeLabDialog } from "./905_MergeLabDialog"; import { AdvancedSettingDialog } from "./906_AdvancedSettingDialog"; import { GetServerInfomationDialog } from "./907_GetServerInfomationDialog"; import { GetClientInfomationDialog } from "./908_GetClientInfomationDialog"; +import { EnablePassThroughDialog } from "./909_EnablePassThroughDialog"; export const Dialogs = () => { const guiState = useGuiState(); @@ -19,6 +20,7 @@ export const Dialogs = () => { {guiState.stateControls.showAdvancedSettingCheckbox.trigger} {guiState.stateControls.showGetServerInformationCheckbox.trigger} {guiState.stateControls.showGetClientInformationCheckbox.trigger} + {guiState.stateControls.showEnablePassThroughDialogCheckbox.trigger}
{guiState.stateControls.showWaitingCheckbox.trigger} @@ -34,6 +36,8 @@ export const Dialogs = () => { {guiState.stateControls.showGetClientInformationCheckbox.trigger} + {guiState.stateControls.showEnablePassThroughDialogCheckbox.trigger} +
); diff --git a/client/demo/src/components/demo/909_EnablePassThroughDialog.tsx b/client/demo/src/components/demo/909_EnablePassThroughDialog.tsx new file mode 100644 index 00000000..ca7e436d --- /dev/null +++ b/client/demo/src/components/demo/909_EnablePassThroughDialog.tsx @@ -0,0 +1,47 @@ +import React, { useMemo } from "react"; +import { useGuiState } from "./001_GuiStateProvider"; +import { useAppState } from "../../001_provider/001_AppStateProvider"; +import { useAppRoot } from "../../001_provider/001_AppRootProvider"; + +export const EnablePassThroughDialog = () => { + const guiState = useGuiState(); + const { audioContextState } = useAppRoot(); + const { serverSetting } = useAppState(); + const { setting } = useAppState(); + const dialog = useMemo(() => { + const buttonRow = ( +
+
+
+
{ + serverSetting.updateServerSettings({ ...serverSetting.serverSetting, passThrough: true }); + guiState.stateControls.showEnablePassThroughDialogCheckbox.updateState(false); + }} + > + OK +
+
{ + guiState.stateControls.showEnablePassThroughDialogCheckbox.updateState(false); + }} + > + Cancel +
+
+
+
+ ); + + console.log("AUDIO_CONTEXT", audioContextState.audioContext); + return ( +
+
Enable Pass Through
+
{buttonRow}
+
+ ); + }, [setting, audioContextState]); + return dialog; +}; diff --git a/client/demo/src/components/demo/components2/101_CharacterArea.tsx b/client/demo/src/components/demo/components2/101_CharacterArea.tsx index 5945aab7..77a8075d 100644 --- a/client/demo/src/components/demo/components2/101_CharacterArea.tsx +++ b/client/demo/src/components/demo/components2/101_CharacterArea.tsx @@ -123,7 +123,11 @@ export const CharacterArea = (_props: CharacterAreaProps) => { } }; const onPassThroughClicked = async () => { - serverSetting.updateServerSettings({ ...serverSetting.serverSetting, passThrough: !serverSetting.serverSetting.passThrough }); + if (serverSetting.serverSetting.passThrough == false) { + guiState.stateControls.showEnablePassThroughDialogCheckbox.updateState(true); + } else { + serverSetting.updateServerSettings({ ...serverSetting.serverSetting, passThrough: false }); + } }; const startClassName = guiState.isConverting ? "character-area-control-button-active" : "character-area-control-button-stanby"; const stopClassName = guiState.isConverting ? "character-area-control-button-stanby" : "character-area-control-button-active";