(() => {
var exports = {};
exports.id = 439;
exports.ids = [439];
exports.modules = {

/***/ 6195:
/***/ ((module) => {

// Exports
module.exports = {
	"broadcast": "style_broadcast__S1u_2",
	"broadcastTitle": "style_broadcastTitle__BLG99",
	"broadcastTitleText": "style_broadcastTitleText___0h_Q",
	"broadcastContent": "style_broadcastContent___0k3t",
	"broadcastButs": "style_broadcastButs__MDTix"
};


/***/ }),

/***/ 9202:
/***/ ((module) => {

// Exports
module.exports = {
	"templateList": "style_templateList__N2pFc",
	"title": "style_title__Dz64T",
	"scroll": "style_scroll__xX1og",
	"templateItem": "style_templateItem___ZdUZ",
	"image": "style_image__O0cFe",
	"activeItem": "style_activeItem__eguQj"
};


/***/ }),

/***/ 2496:
/***/ ((module) => {

// Exports
module.exports = {
	"selectItem": "style_selectItem__3vy6j",
	"selectItemInline": "style_selectItemInline__SCNoY",
	"selectLabel": "style_selectLabel__mnUIs",
	"textLabel": "style_textLabel__SVZT5",
	"label": "style_label__gV4rV",
	"popover": "style_popover___OIiQ",
	"popoverContent": "style_popoverContent__GblYr",
	"info": "style_info__tCJgA",
	"title": "style_title__TiLow",
	"titleInline": "style_titleInline__G9FlU",
	"selectContent": "style_selectContent__cbOd4",
	"wrap": "style_wrap__AGaXr",
	"refresh": "style_refresh__tBiip",
	"multipleSelectContent": "style_multipleSelectContent__mQFUx"
};


/***/ }),

/***/ 7614:
/***/ ((module) => {

// Exports
module.exports = {
	"wslider": "style_wslider__sjq2T",
	"wsliderInline": "style_wsliderInline__tSCN2",
	"input": "style_input__kRNNO",
	"label": "style_label__riWlq",
	"labelInline": "style_labelInline__M1ff4",
	"sliderContainer": "style_sliderContainer__7rIzM",
	"slider": "style_slider__RZF0H",
	"valueDisplay": "style_valueDisplay__qdEfz"
};


/***/ }),

/***/ 8035:
/***/ ((module) => {

// Exports
module.exports = {
	"select": "style_select___9ksH",
	"list": "style_list__sRvTR",
	"title": "style_title__eIBYO",
	"item": "style_item__zDYzQ",
	"active": "style_active__We_Ps",
	"refresh": "style_refresh__U_jGd"
};


/***/ }),

/***/ 2475:
/***/ ((module) => {

// Exports
module.exports = {
	"wrap": "style_wrap__P39kA"
};


/***/ }),

/***/ 4500:
/***/ ((module) => {

// Exports
module.exports = {
	"modelContainer": "styles_modelContainer__b79PH",
	"modelItem": "styles_modelItem__agidg"
};


/***/ }),

/***/ 2539:
/***/ ((module) => {

// Exports
module.exports = {
	"textPrompt": "styles_textPrompt__YxEY0",
	"textPromptItem": "styles_textPromptItem__W8uRh",
	"negative": "styles_negative__v5hZ7",
	"title": "styles_title___26pE"
};


/***/ }),

/***/ 4001:
/***/ ((module) => {

// Exports
module.exports = {
	"label": "styles_label__gujEu",
	"container": "styles_container__HAMKg",
	"controllerContainer": "styles_controllerContainer__5_aoe",
	"controller": "styles_controller__WYds1",
	"active": "styles_active___tx8C",
	"controllerDel": "styles_controllerDel__FmHeL",
	"add": "styles_add__T_cDU",
	"addIcon": "styles_addIcon__4nxYL"
};


/***/ }),

/***/ 2422:
/***/ ((module) => {

// Exports
module.exports = {
	"adArea": "styles_adArea__RVCuG"
};


/***/ }),

/***/ 9047:
/***/ ((module) => {

// Exports
module.exports = {
	"container": "style_container__07pN7",
	"imageContent": "style_imageContent__GoqeP",
	"originItem": "style_originItem__F0dig",
	"delete": "style_delete__SzGe2",
	"or": "style_or__YqIkN",
	"originImage": "style_originImage__yfTMn",
	"defaultImage": "style_defaultImage__6iOr3",
	"originUploader": "style_originUploader__MolXl",
	"empty": "style_empty__b92YL",
	"previewItem": "style_previewItem__s_WqQ",
	"previewImg": "style_previewImg__1fJTD",
	"previewButton": "style_previewButton__GugZy",
	"previewBtn": "style_previewBtn__pREeE",
	"loadingBtn": "style_loadingBtn___GbKE",
	"previewIcon": "style_previewIcon__jc__D",
	"previewText": "style_previewText__bVnKV",
	"upload": "style_upload__JWDHw",
	"uploadMessage": "style_uploadMessage__tLn3d",
	"uploadIcon": "style_uploadIcon__g_Er0",
	"uploadText": "style_uploadText__VSVyV",
	"dragText": "style_dragText__eE_aG",
	"size": "style_size__jbxz2",
	"modelContainer": "style_modelContainer__857eQ",
	"modelItem": "style_modelItem__r4JVZ",
	"uploadImage": "style_uploadImage__o6zdl"
};


/***/ }),

/***/ 4113:
/***/ ((module) => {

// Exports
module.exports = {
	"label": "style_label__fpEOH",
	"container": "style_container__ifgz9",
	"controllerContainer": "style_controllerContainer__CGTmP",
	"controller": "style_controller__TzVVs",
	"active": "style_active__HKMlS",
	"controllerDel": "style_controllerDel__RVFpq",
	"add": "style_add__xyWo_",
	"addIcon": "style_addIcon__NL7KI"
};


/***/ }),

/***/ 7829:
/***/ ((module) => {

// Exports
module.exports = {
	"preprocessorResolution": "style_preprocessorResolution__iFU58"
};


/***/ }),

/***/ 4019:
/***/ ((module) => {

// Exports
module.exports = {
	"ctrlPad": "style_ctrlPad__Jx6im",
	"ctrlArea": "style_ctrlArea__kk3q1"
};


/***/ }),

/***/ 9632:
/***/ ((module) => {

// Exports
module.exports = {
	"text": "style_text__sWB_1"
};


/***/ }),

/***/ 1652:
/***/ ((module) => {

// Exports
module.exports = {
	"customSize": "style_customSize__OMEOy",
	"customLock": "style_customLock__VCnO7",
	"customUnlock": "style_customUnlock__jfUl9",
	"customInput": "style_customInput__bt9gI",
	"hint": "style_hint__uZlGg"
};


/***/ }),

/***/ 8128:
/***/ ((module) => {

// Exports
module.exports = {
	"sizePad": "style_sizePad__eGIUW",
	"sizeContainer": "style_sizeContainer__b_Rsj",
	"title": "style_title__J4FGl"
};


/***/ }),

/***/ 5762:
/***/ ((module) => {

// Exports
module.exports = {
	"text": "style_text__h61P3"
};


/***/ }),

/***/ 6403:
/***/ ((module) => {

// Exports
module.exports = {
	"container": "style_container__t2Dlm",
	"modelContainer": "style_modelContainer__MRqOk",
	"modelItem": "style_modelItem__cIVQi"
};


/***/ }),

/***/ 4659:
/***/ ((module) => {

// Exports
module.exports = {
	"modelContainer": "style_modelContainer__ymIQL",
	"modelItem": "style_modelItem__XJarS"
};


/***/ }),

/***/ 8517:
/***/ ((module) => {

// Exports
module.exports = {
	"previewButton": "style_previewButton__kgCxb",
	"previewBtn": "style_previewBtn__PGsOT",
	"loadingBtn": "style_loadingBtn__di3AM",
	"imageClassName": "style_imageClassName__XvHqg"
};


/***/ }),

/***/ 4195:
/***/ ((module) => {

// Exports
module.exports = {
	"templateList": "style_templateList__NZHup",
	"title": "style_title__vcuMh",
	"scroll": "style_scroll__u9EYy",
	"add": "style_add__LkAPn",
	"templateItem": "style_templateItem__WjtO5",
	"image": "style_image__7OnpL",
	"delete": "style_delete__sCrr4",
	"loraStore": "style_loraStore__NipWJ",
	"lora": "style_lora__nrKIs",
	"selectLora": "style_selectLora__ThCPT",
	"empty": "style_empty__idtTz",
	"infoLora": "style_infoLora__q_hw4",
	"popover": "style_popover__dzYV_",
	"popoverContent": "style_popoverContent__XgnnO",
	"submit": "style_submit__aI7yu",
	"btn": "style_btn__8D_y3",
	"cancel": "style_cancel__CtiVj",
	"confrim": "style_confrim__GSGQg",
	"loraName": "style_loraName__oCtuf",
	"name": "style_name__8pza3",
	"valueDisplay": "style_valueDisplay__jV5FS",
	"loraModalName": "style_loraModalName__9BzOW",
	"refresh": "style_refresh__9VXEv"
};


/***/ }),

/***/ 7552:
/***/ ((module) => {

// Exports
module.exports = {
	"modelContainer": "style_modelContainer__TxWEd",
	"modelItem": "style_modelItem__A7Bk3",
	"divider": "style_divider__q92kO",
	"line": "style_line__EBL_a"
};


/***/ }),

/***/ 2403:
/***/ ((module) => {

// Exports
module.exports = {
	"seedItem": "style_seedItem__MjskC",
	"label": "style_label__vGcJK",
	"content": "style_content__deBa0",
	"input": "style_input__PYElt",
	"icon": "style_icon__dwMpE",
	"modelItem": "style_modelItem__oHIsg"
};


/***/ }),

/***/ 4127:
/***/ ((module) => {

// Exports
module.exports = {
	"progress": "style_progress__EWalC",
	"line": "style_line__u20VV"
};


/***/ }),

/***/ 4213:
/***/ ((module) => {

// Exports
module.exports = {
	"textPrompt": "style_textPrompt__dseqq",
	"text": "style_text___8Wmh",
	"dividing": "style_dividing__qwbbM",
	"copyIcon": "style_copyIcon__2K9_B",
	"copy": "style_copy__5QX1y"
};


/***/ }),

/***/ 6675:
/***/ ((module) => {

// Exports
module.exports = {
	"executeContainer": "style_executeContainer___n_Cf",
	"executeSeq": "style_executeSeq__Z_2dH",
	"seed": "style_seed__I4DF5",
	"image": "style_image__NRhNU",
	"imageMask": "style_imageMask__B_weG",
	"content": "style_content__J9WNl",
	"box": "style_box__Ci4R1",
	"place": "style_place__I1IVQ",
	"placeLogo": "style_placeLogo__LLWqk",
	"placeTxt": "style_placeTxt__i29y9",
	"placeBottom": "style_placeBottom__iznBB",
	"imageOne": "style_imageOne__62fz_"
};


/***/ }),

/***/ 4771:
/***/ ((module) => {

// Exports
module.exports = {
	"imageWrap": "style_imageWrap__2esd5",
	"head": "style_head__9rHhb",
	"closeModalIcon": "style_closeModalIcon__2BkZM",
	"detailModal": "style_detailModal__r_c6y",
	"showDetail": "style_showDetail__4i22E",
	"originImage": "style_originImage__XVmFm",
	"finalImage": "style_finalImage__8WqgU",
	"content": "style_content__uzq0E",
	"noOrigin": "style_noOrigin__kAiTz",
	"image": "style_image__yDuZ8",
	"waterMask": "style_waterMask__S5zVe",
	"changeBtn": "style_changeBtn__7wqSF",
	"changeBtnDisable": "style_changeBtnDisable__lUCJt",
	"preIcon": "style_preIcon__NibWM"
};


/***/ }),

/***/ 6874:
/***/ ((module) => {

// Exports
module.exports = {
	"starContainer": "style_starContainer__cIfZg",
	"starTitle": "style_starTitle__Pt_5j",
	"starlist": "style_starlist__wsmmI",
	"head": "style_head__a6oGG",
	"closeModalIcon": "style_closeModalIcon__uXz9F",
	"detailModal": "style_detailModal__SlpZt",
	"showDetail": "style_showDetail__snRpb",
	"originImage": "style_originImage__LUC9_",
	"finalImage": "style_finalImage__S8tpP",
	"content": "style_content__smcGe",
	"noOrigin": "style_noOrigin__4rZuY",
	"image": "style_image__Wj_UC",
	"waterMask": "style_waterMask__LmpGO",
	"changeBtn": "style_changeBtn__QQNsc",
	"changeBtnDisable": "style_changeBtnDisable__eLOzq",
	"preIcon": "style_preIcon__fsv1M",
	"opreateHover": "style_opreateHover__N33Ex",
	"starSub": "style_starSub__pvq0D",
	"opreateHoverNoOrigin": "style_opreateHoverNoOrigin__Xmi_L"
};


/***/ }),

/***/ 5439:
/***/ ((module) => {

// Exports
module.exports = {
	"taskTitle": "style_taskTitle__Tv0_A",
	"taskTitleZ": "style_taskTitleZ__4eCub",
	"taskName": "style_taskName__qQ37J",
	"divider": "style_divider__hgavn",
	"taskId": "style_taskId__9oYWi",
	"taskShareButton": "style_taskShareButton__CZgvR",
	"taskShare": "style_taskShare__AbClY",
	"inputValue": "style_inputValue__AfCJk",
	"icon": "style_icon__jButi",
	"pagination": "style_pagination__gPBFg",
	"num1": "style_num1__ytfX5",
	"pre": "style_pre__5kIwl",
	"next": "style_next__AZKsG",
	"page1": "style_page1__wXbAL",
	"lastPage": "style_lastPage__qxmkn"
};


/***/ }),

/***/ 4530:
/***/ ((module) => {

// Exports
module.exports = {
	"container": "styles_container__Myrwj",
	"left": "styles_left__s5JWL",
	"leftcircle": "styles_leftcircle__EvUgN",
	"right": "styles_right__iv8pA",
	"rightcircle": "styles_rightcircle__ZdOwU",
	"circle_right": "styles_circle_right__u65Vi",
	"circle_left": "styles_circle_left__4V7w_"
};


/***/ }),

/***/ 4754:
/***/ ((module) => {

// Exports
module.exports = {
	"sendItem": "style_sendItem__md_RU",
	"sendLabel": "style_sendLabel__5drcu"
};


/***/ }),

/***/ 9397:
/***/ ((module) => {

// Exports
module.exports = {
	"opreate": "style_opreate__Vfm8S",
	"starSub": "style_starSub__SPa6B",
	"seed": "style_seed__eXXan",
	"copy": "style_copy___n8Jd",
	"star": "style_star__DkWKM",
	"send": "style_send__o6cv4",
	"dot": "style_dot__7Onvv",
	"sendEntry": "style_sendEntry__9NVDn",
	"sendContainer": "style_sendContainer__QWQwv",
	"sendItem": "style_sendItem__hervJ",
	"sendIcon": "style_sendIcon__Rk9HS",
	"sendLabel": "style_sendLabel__4kLC7",
	"download": "style_download__oq8dI",
	"downloadLarge": "style_downloadLarge__FnHbt",
	"downloadEntry": "style_downloadEntry__krM4_",
	"more": "style_more__KA4n4",
	"opreateItem": "style_opreateItem__1XdfH",
	"loadingIcon": "style_loadingIcon__GGoue",
	"icon": "style_icon__pr1_v",
	"btn": "style_btn__8SGL4",
	"btnItem": "style_btnItem__wZeYS",
	"ok": "style_ok__jR_2P",
	"powerTips": "style_powerTips__XlLxY",
	"notice": "style_notice__OKX0r",
	"powerMessage": "style_powerMessage__fkn7K",
	"primaryColor": "style_primaryColor__TphLr",
	"cpuCharge": "style_cpuCharge__r8uGe",
	"shareList": "style_shareList__fiuAk"
};


/***/ }),

/***/ 4580:
/***/ ((module) => {

// Exports
module.exports = {
	"tagWrap": "style_tagWrap__UZmdH"
};


/***/ }),

/***/ 697:
/***/ ((module) => {

// Exports
module.exports = {
	"prompt": "style_prompt__s3ad3",
	"waitingCnt": "style_waitingCnt__IkDUX",
	"promptList": "style_promptList__HDXxf",
	"promptDeatail": "style_promptDeatail__YrCaZ",
	"time": "style_time__hZ6WG",
	"executeSeq": "style_executeSeq__3dtd2",
	"setting": "style_setting__Br6eE",
	"reeditButton": "style_reeditButton__CbL_k",
	"moreButton": "style_moreButton___ekHd",
	"checkPoints": "style_checkPoints__09jWH",
	"checkPointsItem": "style_checkPointsItem__0t4in",
	"sdCheckpoint": "style_sdCheckpoint___YZvI",
	"sdSamplingMethod": "style_sdSamplingMethod__VfALf"
};


/***/ }),

/***/ 933:
/***/ ((module) => {

// Exports
module.exports = {
	"tagName": "style_tagName__0dbLn",
	"icon": "style_icon__5DkbC"
};


/***/ }),

/***/ 3851:
/***/ ((module) => {

// Exports
module.exports = {
	"wrap": "style_wrap__NUREq",
	"promptTxt": "style_promptTxt__8pvIf",
	"icon": "style_icon__j3Gxx"
};


/***/ }),

/***/ 9562:
/***/ ((module) => {

// Exports
module.exports = {
	"inferResult": "style_inferResult__ruq0G",
	"imageResult": "style_imageResult__jHL33"
};


/***/ }),

/***/ 2172:
/***/ ((module) => {

// Exports
module.exports = {
	"point": "style_point__ykffX"
};


/***/ }),

/***/ 9899:
/***/ ((module) => {

// Exports
module.exports = {
	"canvas": "style_canvas__tMRrU",
	"canvasOption": "style_canvasOption__BdsDq",
	"canvasOptionLeft": "style_canvasOptionLeft__ulNHt",
	"canvasOptionCenter": "style_canvasOptionCenter___fdBl",
	"canvasOptionRight": "style_canvasOptionRight__M4DCe",
	"canvasOptionDetail": "style_canvasOptionDetail__IfCWn",
	"canvasOptionText": "style_canvasOptionText__AcuQy",
	"optionMarginRight": "style_optionMarginRight__oXSWL",
	"canvasOptionTextRight": "style_canvasOptionTextRight__2UhJ0",
	"optionBorderRight": "style_optionBorderRight__1y8wi",
	"optionDefaultColor": "style_optionDefaultColor__D7gdp",
	"optionActiveColor": "style_optionActiveColor__BPCht",
	"optionScaleText": "style_optionScaleText__E8OgY",
	"sliderContent": "style_sliderContent__FwmHT",
	"solidBigDot": "style_solidBigDot__ZzsyW",
	"solidSmallDot": "style_solidSmallDot__UhY7P",
	"sliderBrush": "style_sliderBrush__bdVuG",
	"sliderEraser": "style_sliderEraser__VdDDd",
	"canvasTip": "style_canvasTip__q9agJ",
	"manualMask": "style_manualMask__tm4FW",
	"canvasMask": "style_canvasMask__2nCCM",
	"userSelect": "style_userSelect___s8wb",
	"showImage": "style_showImage__NXecn"
};


/***/ }),

/***/ 6018:
/***/ ((module) => {

// Exports
module.exports = {
	"mobile": "style_mobile__7dIfo",
	"mobileIcon": "style_mobileIcon__j_xyY",
	"tips": "style_tips__RvU0w",
	"international": "style_international__aW5JX",
	"primaryColor": "style_primaryColor__pH6gN",
	"mobileContent": "style_mobileContent__cZhea",
	"mobileLogo": "style_mobileLogo__yJgVw"
};


/***/ }),

/***/ 2273:
/***/ ((module) => {

// Exports
module.exports = {
	"modalWrap": "style_modalWrap__z_HQk",
	"modalTitle": "style_modalTitle__kAPQz",
	"btn": "style_btn__XnZCR",
	"unit": "style_unit__B3aXh",
	"closeModalIcon": "style_closeModalIcon__aE34Y"
};


/***/ }),

/***/ 2198:
/***/ ((module) => {

// Exports
module.exports = {
	"groupTips": "style_groupTips__X2JAI",
	"title": "style_title__DccQL",
	"subTitle": "style_subTitle__7fr5_"
};


/***/ }),

/***/ 3610:
/***/ ((module) => {

// Exports
module.exports = {
	"tabsWrap": "style_tabsWrap__WslvD",
	"tabsItem": "style_tabsItem__PCmLn",
	"border": "style_border__9ULzM",
	"active": "style_active__mCF3d",
	"tabIcon": "style_tabIcon__2wuEM",
	"activeGroup": "style_activeGroup__W1ebP",
	"beta": "style_beta__3ohqc",
	"floatIcon": "style_floatIcon__GJ9Y_",
	"dot": "style_dot___0kZi"
};


/***/ }),

/***/ 7732:
/***/ ((module) => {

// Exports
module.exports = {
	"tabsContent": "style_tabsContent__wm_lo",
	"tabsTop": "style_tabsTop__7tVst",
	"bottomDivider": "style_bottomDivider__yCXZM",
	"tabBottom": "style_tabBottom__2DYNm"
};


/***/ }),

/***/ 3658:
/***/ ((module) => {

// Exports
module.exports = {
	"agentVersion": "style_agentVersion__Pw56P",
	"batchWrap": "style_batchWrap__z3U3B",
	"batchItem": "style_batchItem__kJ_Ai",
	"itemDefault": "style_itemDefault__psCY3",
	"activeKey": "style_activeKey__Gttu3"
};


/***/ }),

/***/ 4662:
/***/ ((module) => {

// Exports
module.exports = {
	"detail": "style_detail__8Rm2x",
	"icon": "style_icon__Bm6tI",
	"open": "style_open__qHQPG",
	"content": "style_content__dO3o3",
	"title": "style_title__xyS7H",
	"head": "style_head__btJrc",
	"closeModalIcon": "style_closeModalIcon__FAxfi",
	"list": "style_list__RWt0Y",
	"item": "style_item__xz_zK",
	"value": "style_value__9o2M_",
	"primaryColor": "style_primaryColor__NhOh_",
	"cpuCharge": "style_cpuCharge__B9cD8",
	"methodItem": "style_methodItem__2CUcr",
	"checkbox": "style_checkbox__ECnoh",
	"totalPower": "style_totalPower__E07SY"
};


/***/ }),

/***/ 9225:
/***/ ((module) => {

// Exports
module.exports = {
	"promptContent": "styles_promptContent__USPWz",
	"tabsContent": "styles_tabsContent__sCMmD"
};


/***/ }),

/***/ 7419:
/***/ ((module) => {

// Exports
module.exports = {
	"maskWrap": "style_maskWrap__VrNeO",
	"maskItem": "style_maskItem__LfXd7",
	"mask": "style_mask__0NDDm",
	"editMask": "style_editMask__4Dtya",
	"originImage": "style_originImage__fSnHr",
	"maskNeed": "style_maskNeed__6pLsG",
	"maskNeedText": "style_maskNeedText__I2UAM"
};


/***/ }),

/***/ 2989:
/***/ ((module) => {

// Exports
module.exports = {
	"maskItem": "style_maskItem__Kvk5W",
	"empty": "style_empty__iXAYM",
	"editEmpty": "style_editEmpty__Y_zdx",
	"editEmptySpin": "style_editEmptySpin__IKAim",
	"editTitle": "style_editTitle__lGptT",
	"editSubTitle": "style_editSubTitle__xWvCj",
	"editAndUpload": "style_editAndUpload__uWmvZ",
	"editBtn": "style_editBtn__9N9RE",
	"loading": "style_loading__0Bl2q",
	"loadingIcon": "style_loadingIcon__rQu_m",
	"successBtn": "style_successBtn__R_bQ8",
	"editIcon": "style_editIcon__o9syI",
	"maskBg": "style_maskBg__PQrwi",
	"originImag": "style_originImag__BXDgj",
	"maskImg": "style_maskImg__l_PzE",
	"selectMask": "style_selectMask__9cC_c",
	"maskText": "style_maskText__wdhsO",
	"or": "style_or__sZJzw",
	"size": "style_size__NzZnU",
	"disableButton": "style_disableButton__fwh84",
	"delete": "style_delete__zd6lw"
};


/***/ }),

/***/ 7073:
/***/ ((module) => {

// Exports
module.exports = {
	"maximizeTag": "style_maximizeTag__DxVsA",
	"maximizeWay": "style_maximizeWay__znv87"
};


/***/ }),

/***/ 679:
/***/ ((module) => {

// Exports
module.exports = {
	"originImgDiff": "style_originImgDiff__XudE7",
	"title": "style_title__pG8ne"
};


/***/ }),

/***/ 4655:
/***/ ((module) => {

// Exports
module.exports = {
	"unit": "style_unit__z2S9_",
	"goPay": "style_goPay__teZ8N"
};


/***/ }),

/***/ 6945:
/***/ ((module) => {

// Exports
module.exports = {
	"replicateContainer": "style_replicateContainer___gnvN",
	"replicateImageContainer": "style_replicateImageContainer__6VF8g",
	"replicateImage": "style_replicateImage__IwOgP",
	"replicateImageNone": "style_replicateImageNone__VIqse",
	"replicateImageHint": "style_replicateImageHint__d_CdC",
	"replicateNoContainer": "style_replicateNoContainer__3ynWp",
	"retaskContainer": "style_retaskContainer__tW7pa",
	"titleHint": "style_titleHint__UaacE",
	"linkContainer": "style_linkContainer__DRSvN",
	"link": "style_link__w8M6y",
	"input": "style_input__mPe9g",
	"inputTaskContainer": "style_inputTaskContainer__Ah__2",
	"inputContainer": "style_inputContainer__OYRbp",
	"inputSplit": "style_inputSplit__FeJD_",
	"inputValue": "style_inputValue__m59dO",
	"selectValue": "style_selectValue__Bd2kt",
	"dropdown": "style_dropdown__Y7_lV",
	"imgHint": "style_imgHint__Xluvs",
	"imgContainer": "style_imgContainer__TvtTN",
	"imgWrapper": "style_imgWrapper__sBuPM",
	"selected": "style_selected__jQDsx",
	"img": "style_img__0K5qZ",
	"failContent": "style_failContent__ZpMDa",
	"btnChoose": "style_btnChoose__M1vK3",
	"content": "style_content__Doebf",
	"contentTitle": "style_contentTitle__pbAOB",
	"contentDesc": "style_contentDesc__CRcZU",
	"caseTitle": "style_caseTitle__PHZ8o",
	"caseContent": "style_caseContent__5USNk",
	"label": "style_label__9wv6X"
};


/***/ }),

/***/ 2871:
/***/ ((module) => {

// Exports
module.exports = {
	"retaskContainer": "style_retaskContainer__3eqET",
	"titleHint": "style_titleHint__c_QfX",
	"linkContainer": "style_linkContainer__c21Xf",
	"link": "style_link__7w9fv",
	"input": "style_input__6Vnzs",
	"inputContainer": "style_inputContainer___AOLU",
	"inputSplit": "style_inputSplit__K6EWY",
	"inputValue0": "style_inputValue0___X3Ca",
	"inputValue": "style_inputValue__COmTs",
	"selectValue": "style_selectValue__K_4oz",
	"selectValue0": "style_selectValue0__eZx6T",
	"dropdown": "style_dropdown__IOiiq",
	"imgHint": "style_imgHint__vYji6",
	"imgContainer": "style_imgContainer__CQVVw",
	"imgWrapper": "style_imgWrapper__ey_3c",
	"imgWrapper0": "style_imgWrapper0___SzqS",
	"selected": "style_selected__9DLJr",
	"img": "style_img__mm0Ti",
	"failContent": "style_failContent___t4zz",
	"btnChoose": "style_btnChoose__R4lzm",
	"content": "style_content__fZZpK",
	"contentTitle": "style_contentTitle__l1yRG",
	"contentDesc": "style_contentDesc__zyt1y",
	"caseTitle": "style_caseTitle__hAGKa",
	"caseContent": "style_caseContent__6jnrf"
};


/***/ }),

/***/ 9985:
/***/ ((module) => {

// Exports
module.exports = {
	"race": "style_race__Tw_2R"
};


/***/ }),

/***/ 28:
/***/ ((module) => {

// Exports
module.exports = {
	"tagList": "style_tagList__HT1Mw"
};


/***/ }),

/***/ 8499:
/***/ ((module) => {

// Exports
module.exports = {
	"content": "style_content__kBDOx"
};


/***/ }),

/***/ 8527:
/***/ ((module) => {

// Exports
module.exports = {
	"content": "style_content__3csOH",
	"contentTitle": "style_contentTitle__SgOaV",
	"contentDesc": "style_contentDesc__VXRh8",
	"caseTitle": "style_caseTitle__PYNnZ",
	"caseTitleI18n": "style_caseTitleI18n__01oGk",
	"caseContent": "style_caseContent__mCHuH",
	"highlighted": "style_highlighted__QIxv3"
};


/***/ }),

/***/ 8102:
/***/ ((module) => {

// Exports
module.exports = {
	"textarea": "style_textarea__02TKV",
	"active": "style_active__b8prO",
	"inspirationList": "style_inspirationList__Jx8mj",
	"inspirationDefault": "style_inspirationDefault__Kn2NA",
	"inspirationTitle": "style_inspirationTitle__MNJ2g",
	"promptTip": "style_promptTip__RMHGs",
	"promptContent": "style_promptContent__vL3Sl",
	"promptRightTip": "style_promptRightTip__bQC2o"
};


/***/ }),

/***/ 213:
/***/ ((module) => {

// Exports
module.exports = {
	"content": "style_content__ZBcGF",
	"contentTitle": "style_contentTitle__lkZrd",
	"contentC": "style_contentC__flTBy",
	"contentDesc": "style_contentDesc__hVESP",
	"caseTitle": "style_caseTitle__WD3fG",
	"caseTitleI18n": "style_caseTitleI18n__ZE_Mr",
	"caseContent": "style_caseContent__wdb36",
	"highlighted": "style_highlighted__9dWbj"
};


/***/ }),

/***/ 1321:
/***/ ((module) => {

// Exports
module.exports = {
	"textarea": "style_textarea__emdam",
	"popoverRecommendList": "style_popoverRecommendList__4PlS6",
	"popoverRecommendItem": "style_popoverRecommendItem__6Tv8v",
	"popoverRecommendItemIndexed": "style_popoverRecommendItemIndexed__ccSE1",
	"popoverRecommendBorder": "style_popoverRecommendBorder__ffgyh",
	"popoverRecommendWrapper": "style_popoverRecommendWrapper__50alO"
};


/***/ }),

/***/ 3210:
/***/ ((module) => {

// Exports
module.exports = {
	"textPrompt": "style_textPrompt__yzYpp",
	"textPromptItem": "style_textPromptItem__Ryd29",
	"negative": "style_negative__3KiBg",
	"title": "style_title__ZtWFA",
	"active": "style_active__CU0sc"
};


/***/ }),

/***/ 7612:
/***/ ((module) => {

// Exports
module.exports = {
	"uploadWrap": "style_uploadWrap__VMxL2",
	"upload": "style_upload__m_Q0b",
	"wrap": "style_wrap__K0H1L",
	"uploadMessage": "style_uploadMessage__DkPuP",
	"uploadIcon": "style_uploadIcon__58SnB",
	"uploadText": "style_uploadText__2O_1B",
	"dragText": "style_dragText__EgDqU",
	"size": "style_size__McMmy",
	"currentImage": "style_currentImage__dcS_V",
	"image": "style_image__yROGp",
	"closeIcon": "style_closeIcon__Wa6OA"
};


/***/ }),

/***/ 2797:
/***/ ((module) => {

// Exports
module.exports = {
	"uploadMask": "style_uploadMask__Fmwr9"
};


/***/ }),

/***/ 1371:
/***/ ((module) => {

// Exports
module.exports = {
	"edit": "style_edit__NPrOy",
	"title": "style_title__t39BC",
	"saveTime": "style_saveTime__VJIsv",
	"opreate": "style_opreate__6eWsh",
	"generate": "style_generate___630j",
	"consumeHighlightTip": "style_consumeHighlightTip__M8m0o",
	"consumeTip": "style_consumeTip__YQ6sO",
	"residueTip": "style_residueTip__BsRD2",
	"cpuCharge": "style_cpuCharge__6zQHZ",
	"computerPowerWrap": "style_computerPowerWrap__jahuz"
};


/***/ }),

/***/ 1804:
/***/ ((module) => {

// Exports
module.exports = {
	"batchTask": "style_batchTask__99EXB",
	"batchIcon": "style_batchIcon__D7dSY",
	"batchWrap": "style_batchWrap__1fwqY",
	"batchItem": "style_batchItem__M7VTl",
	"item": "style_item__gN6XP"
};


/***/ }),

/***/ 7415:
/***/ ((module) => {

// Exports
module.exports = {
	"deleteWrap": "style_deleteWrap__CC8rV",
	"deletePonit": "style_deletePonit__A0z4s",
	"point": "style_point___KRC9",
	"delete": "style_delete__wkfcr",
	"deleteIcon": "style_deleteIcon__Muqkv",
	"loadingWrap": "style_loadingWrap__9gzAH",
	"cube": "style_cube__cbnB_",
	"suspend": "style_suspend__J0fUB"
};


/***/ }),

/***/ 5866:
/***/ ((module) => {

// Exports
module.exports = {
	"addTaskWrap": "style_addTaskWrap__jDERn",
	"addTask": "style_addTask__aZnoW",
	"addIcon": "style_addIcon__GW0tT",
	"title": "style_title__aKZuU",
	"taskList": "style_taskList__kYIIN",
	"pageTurn": "style_pageTurn__NzBjI",
	"turnButton": "style_turnButton__Yg5Pu",
	"homeButton": "style_homeButton__8PG1t",
	"item": "style_item__qsE14",
	"active": "style_active__PrEad",
	"origin": "style_origin__LTdi7",
	"image": "style_image__kHYp9",
	"status": "style_status__H9uJV",
	"statusText": "style_statusText__ypj_H",
	"empty": "style_empty__agWkI",
	"emptyImage": "style_emptyImage__oXYv8",
	"taskName": "style_taskName___clD9"
};


/***/ }),

/***/ 969:
/***/ ((module) => {

// Exports
module.exports = {
	"nav": "style_nav__SlQvq",
	"task": "style_task__v7eUn",
	"openEdit": "style_openEdit__PZ9pP",
	"openIcon": "style_openIcon__ioWUu",
	"close": "style_close__Jm62j",
	"open": "style_open__AZZcR",
	"mask": "style_mask__1vnFj"
};


/***/ }),

/***/ 509:
/***/ ((module) => {

// Exports
module.exports = {
	"newMask": "style_newMask__otpCW",
	"modalMask": "style_modalMask__UdofR",
	"message": "style_message__tXb4E",
	"closeModalIcon": "style_closeModalIcon__TU6jy",
	"content": "style_content__J8B9w",
	"wrap": "style_wrap__CX6Eu",
	"image": "style_image__V62ch",
	"maskImag": "style_maskImag__5jJPB",
	"selectImage": "style_selectImage__TEuBw",
	"back": "style_back__yuHvy",
	"opreate": "style_opreate__ukH9I",
	"btn": "style_btn__SkEmO",
	"endBtn": "style_endBtn__YKmO9",
	"clear": "style_clear__J1_it",
	"revoke": "style_revoke__8eoWj",
	"comfirm": "style_comfirm__ZAEMO",
	"startBtnSvg": "style_startBtnSvg__4uBT8",
	"btnSvg": "style_btnSvg__hxPpz"
};


/***/ }),

/***/ 3402:
/***/ ((module) => {

// Exports
module.exports = {
	"showPrompt": "style_showPrompt__KVWz_",
	"promptWrap": "style_promptWrap__1_tEa",
	"title": "style_title__Fj9cm",
	"copy": "style_copy__NgKak",
	"copyIcon": "style_copyIcon__jzpNC",
	"promptDetail": "style_promptDetail__gBEkn",
	"posPrompt": "style_posPrompt__SQINN"
};


/***/ }),

/***/ 2574:
/***/ ((module) => {

// Exports
module.exports = {
	"contribute": "style_contribute__CnL_U",
	"contributeDefault": "style_contributeDefault__oJX9B",
	"taskIcon": "style_taskIcon__AvBEE"
};


/***/ }),

/***/ 290:
/***/ ((module) => {

// Exports
module.exports = {
	"closeModalIcon": "style_closeModalIcon__Fj8Jq",
	"detailModal": "style_detailModal__kMuQ1",
	"showDetail": "style_showDetail__ffrkn",
	"originImage": "style_originImage__rlXxQ",
	"finalImage": "style_finalImage__uYJZW",
	"noOrigin": "style_noOrigin__ejnlM",
	"maskBase64": "style_maskBase64__LivzX",
	"image": "style_image__Lkhxy",
	"waterMask": "style_waterMask__y8JfS",
	"opreateWrap": "style_opreateWrap__dCkxn",
	"starSub": "style_starSub__U6lXk"
};


/***/ }),

/***/ 5586:
/***/ ((module) => {

// Exports
module.exports = {
	"imageWrap": "style_imageWrap__FUlYf",
	"image": "style_image__gQtt3"
};


/***/ }),

/***/ 3331:
/***/ ((module) => {

// Exports
module.exports = {
	"waterfall": "style_waterfall__6_a2_",
	"noData": "style_noData__dTD9n",
	"showCaseWrap": "style_showCaseWrap__81dcU",
	"wrap": "style_wrap__yKpJo",
	"column": "style_column__Paidj",
	"detection": "style_detection___1qdc",
	"clearfix": "style_clearfix__JAedu",
	"showMore": "style_showMore__KjfpA",
	"btn": "style_btn__B_eL_",
	"empty": "style_empty__i40lM",
	"submissionTips": "style_submissionTips__B7z3N",
	"blog": "style_blog__meJnp"
};


/***/ }),

/***/ 513:
/***/ ((module) => {

// Exports
module.exports = {
	"showCase": "style_showCase__IG5NO",
	"tabs": "style_tabs__BzCDu",
	"tips": "style_tips__h8nnn"
};


/***/ }),

/***/ 7570:
/***/ ((module) => {

// Exports
module.exports = {
	"homeContent": "Studio_homeContent__u3yLX",
	"output": "Studio_output__Bvwwh",
	"buttonFloat": "Studio_buttonFloat__zZfLN",
	"floatButton": "Studio_floatButton__pxrKS",
	"floatText": "Studio_floatText__BHSGP",
	"floatIcon": "Studio_floatIcon__NIVwE",
	"international": "Studio_international__w83ji",
	"primaryColor": "Studio_primaryColor__VsaiZ"
};


/***/ }),

/***/ 2140:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_markdown__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3135);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6195);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7550);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9648);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3413);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([react_markdown__WEBPACK_IMPORTED_MODULE_2__, axios__WEBPACK_IMPORTED_MODULE_4__]);
([react_markdown__WEBPACK_IMPORTED_MODULE_2__, axios__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);







const BROADCAST_VERSION_KEY = "notificationVersion";
const Broadcast = ({ setIsBroadcast  })=>{
    const [content, setContent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();
    const closeBroadcast = ()=>{
        localStorage.setItem(BROADCAST_VERSION_KEY, content?.version ?? "");
        setIsBroadcast(false);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        const config = {
            method: "get",
            maxBodyLength: Infinity,
            url: _common_constans_international__WEBPACK_IMPORTED_MODULE_5__/* .BROADCASE_URL */ .wD,
            headers: {
                Authorization: "Bearer 638df89a5a8a3ea25dabd3e6657ccbd29f61b6a55c769063fff9e1f2f7808334ac3847e81af75d3784d444127c6fecc929b82f4dd59d59eac5c69b2247fa0d62bbcd801a9bf7e8556283379b2caaf701ec0615c6ab79ba4465b84901ab723d5ea75fc2d434f8bb235a7f84257ca36d6bdd17016fda4f345495e9fc37e30e1ede"
            }
        };
        axios__WEBPACK_IMPORTED_MODULE_4__["default"].request(config).then((response)=>{
            if (response.data) {
                const data = response.data.data.attributes;
                const localVersion = localStorage.getItem(BROADCAST_VERSION_KEY);
                const currentTime = new Date().getTime();
                const effectiveTime = new Date(data.effectiveTime).getTime();
                const expiredTime = new Date(data.expiredTime).getTime();
                if (data.version == localVersion || currentTime < effectiveTime || currentTime > expiredTime) {
                    setIsBroadcast(false);
                } else {
                    setContent(data);
                }
            }
        }).catch((error)=>{
            console.log(error);
        });
    }, []);
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: content?.content && typeof Object.hasOwn === "function" ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().broadcast),
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().broadcastTitle),
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().broadcastTitleText)} ag14-t`,
                        children: "\uD83D\uDCE3 WeShop唯象妙境小广播"
                    })
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_markdown__WEBPACK_IMPORTED_MODULE_2__["default"], {
                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().broadcastContent)} ag14`,
                    components: {
                        a: (props)=>{
                            return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                href: props.href,
                                target: "_blank",
                                rel: "noreferrer",
                                children: props.children
                            });
                        }
                    },
                    children: content.content.split("\n").join("  \n")
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().broadcastButs),
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                        style: {
                            borderRadius: "4px",
                            fontSize: "14px",
                            fontWeight: "400",
                            lineHeight: "22px",
                            width: "88px",
                            height: "32px"
                        },
                        onClick: closeBroadcast,
                        children: "我知道了"
                    })
                })
            ]
        }) : null
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Broadcast);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2021:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9202);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_3__);





const CustomImageSelect = ({ list , label , type  })=>{
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().templateList),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().title)}`,
                children: label
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().scroll),
                children: list.map((item, key)=>{
                    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().templateItem)} ag12`,
                        onClick: ()=>{
                            handleTaskResult(type, item.id);
                        },
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().image)} ${taskResult?.[type] === item.id ? (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().activeItem) : ""}`,
                                src: item?.image || "",
                                width: 144,
                                height: 144,
                                alt: "template",
                                unoptimized: true
                            }),
                            item?.name
                        ]
                    }, key);
                })
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomImageSelect);


/***/ }),

/***/ 6402:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2496);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_3__);





const CustomSelect = ({ onChange , value , options , label , labelMode ="header" , refersh , mode  })=>{
    const componentRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    const [maxLabelWidth, setMaxLabelWidth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(344);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (componentRef.current) {
            const width = componentRef.current.offsetWidth;
            setMaxLabelWidth(width - 100);
        }
    }, []);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().selectItem)} ${labelMode === "inline" ? (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().selectItemInline) : ""}`,
        children: [
            label ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: labelMode === "inline" ? `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().titleInline)}` : `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().title)}`,
                children: label
            }) : null,
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_2__.Space, {
                wrap: true,
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().wrap),
                ref: componentRef,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_2__.ConfigProvider, {
                    theme: {
                        token: {
                            colorBgContainer: "var(--FillColor6)",
                            colorText: "var(--TextColor1)",
                            fontSize: 14,
                            controlHeight: 48,
                            controlOutlineWidth: 1,
                            controlPaddingHorizontal: 12
                        }
                    },
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_2__.Select, {
                            mode: mode,
                            value: value,
                            style: {
                                width: 120
                            },
                            onChange: (value)=>{
                                onChange(value);
                            },
                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().selectContent)} ${mode === "multiple" ? (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().multipleSelectContent) : ""}`,
                            options: options?.map((item)=>{
                                return {
                                    value: item.value,
                                    label: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().selectLabel),
                                        children: [
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().textLabel)}`,
                                                style: {
                                                    maxWidth: `${maxLabelWidth}px`
                                                },
                                                children: item.label
                                            }),
                                            item.popover && item.popover.content ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_2__.Popover, {
                                                placement: "rightTop",
                                                title: item.popover.title,
                                                overlayClassName: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().popover),
                                                content: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().popoverContent),
                                                    children: item.popover.content
                                                }),
                                                zIndex: 2050,
                                                trigger: "hover",
                                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().info)} info`,
                                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                                        src: "/checkpoint_info.svg",
                                                        height: 16,
                                                        width: 16,
                                                        alt: "info"
                                                    })
                                                })
                                            }) : null
                                        ]
                                    })
                                };
                            }),
                            suffixIcon: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                src: "/arrow_down.svg",
                                width: 14,
                                height: 14,
                                alt: "drop_down"
                            })
                        }),
                        refersh ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().refresh),
                            height: 48,
                            width: 48,
                            src: "/ic_sd_refresh.svg",
                            alt: "refresh",
                            onClick: refersh
                        }) : null
                    ]
                })
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomSelect);


/***/ }),

/***/ 9246:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7614);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);




const CustomSlider = ({ value , valueChange , label , config ={
    min: 0,
    max: 100,
    step: 1
} , labelMode ="header"  })=>{
    const [slide, setSlide] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(value);
    const [display, setDisplay] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(value?.toString() ?? "0");
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        setSlide(value);
        setDisplay(value?.toString() ?? "0");
    }, [
        value
    ]);
    const changeValue = ()=>{
        let value = parseFloat(display);
        if (Number.isNaN(value) || value < config.min || value > config.max) {
            if (value > config.max) {
                value = config.max;
            } else {
                value = config.min;
            }
        }
        setDisplay(value.toString());
        valueChange(value);
    };
    const changeValue2 = (value)=>{
        valueChange(value);
    };
    const handleKeyUp = (event)=>{
        if (event.key === "Enter") {
            event.preventDefault() // 阻止默认的提交行为
            ;
            event.target.blur();
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: labelMode === "inline" ? (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().wsliderInline) : (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().wslider),
        children: [
            label && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("label", {
                className: labelMode === "inline" ? `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().labelInline)}` : `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().label)}`,
                children: label
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().sliderContainer),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().slider),
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Slider, {
                            min: config.min,
                            max: config.max,
                            onAfterChange: changeValue2,
                            onChange: setSlide,
                            value: slide,
                            step: config.step
                        })
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("input", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().valueDisplay)}`,
                        onChange: (e)=>{
                            setDisplay(e.target.value);
                        },
                        onKeyUp: handleKeyUp,
                        value: display,
                        type: "text",
                        onBlur: changeValue
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomSlider);


/***/ }),

/***/ 9948:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8035);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_2__);



const CustomTag = ({ options , onChange , value , label , refersh  })=>{
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().select)}`,
        children: [
            label ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().title)} ag14-t`,
                children: label
            }) : null,
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().list),
                children: [
                    options?.map((item, index)=>{
                        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().item)} ${value.includes(item.key) ? (_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().active) : ""}`,
                            onClick: ()=>{
                                onChange(item.key);
                            },
                            children: item.value
                        }, index);
                    }),
                    refersh ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().refresh),
                        height: 36,
                        width: 36,
                        src: "/ic_sd_refresh.svg",
                        alt: "refresh",
                        onClick: refersh
                    }) : null
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomTag);


/***/ }),

/***/ 882:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2475);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_hooks_upload_UploadCtx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7038);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Nav_components_Edit_components_UploadImage_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(949);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_4__);







const { Dragger  } = antd__WEBPACK_IMPORTED_MODULE_1__.Upload;
const CustomUpload = ({ children , type , uniqueKey ="" , taskId , taskName , beforeUpload , uploadSuccess , setUploading , maxWidth , maxHeight , needDragger =true  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)("studio");
    const uploadFiles = (0,_components_hooks_upload_UploadCtx__WEBPACK_IMPORTED_MODULE_2__/* .useUploadFiles */ .nc)();
    const { upload , remove  } = (0,_components_hooks_upload_UploadCtx__WEBPACK_IMPORTED_MODULE_2__/* .useUpload */ .Vn)();
    const file = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(()=>{
        return uploadFiles.find((item)=>item.taskId == taskId && item.type === type && item.uniqueKey == uniqueKey);
    }, [
        uploadFiles,
        taskId,
        type,
        uniqueKey
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        if (file?.status == "pending") {
            setUploading(true);
        } else {
            setUploading(false);
        }
        if (file?.status == "success" || file?.status == "failed") {
            const logParam = window?.logger.getParams("100000011", 3, {
                taskId,
                type: file.type,
                size: file.total,
                costTime: Date.now() - file.startTime,
                isSuccess: file.status == "success"
            });
            window?.logger.log([
                logParam
            ]);
        }
        if (file?.status == "success") {
            uploadSuccess(file);
            remove(type, taskId, uniqueKey);
        }
    }, [
        file
    ]);
    const props = {
        name: "image",
        showUploadList: false,
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().wrap),
        accept: "image/*",
        async beforeUpload (file) {
            const status = await (0,_components_Nav_components_Edit_components_UploadImage_utils__WEBPACK_IMPORTED_MODULE_6__/* .verifyLoadImage */ .m)(file, t, maxWidth, maxHeight);
            if (status && taskId) {
                await beforeUpload(file);
                upload(type, file, taskId, taskName, uniqueKey);
            }
            return false;
        },
        onDrop (e) {
            console.log("Dropped files", e.dataTransfer.files);
        }
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: needDragger ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().wrap),
            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Dragger, {
                ...props,
                children: children
            })
        }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Upload, {
            ...props,
            children: children
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomUpload);


/***/ }),

/***/ 1585:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9948);
/* harmony import */ var _ADetailPrompt__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3937);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4500);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_styles_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9246);
/* harmony import */ var _components_CustomSelect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6402);
/* harmony import */ var _components_Ground_Lora__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5047);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ADetailPrompt__WEBPACK_IMPORTED_MODULE_2__]);
_ADetailPrompt__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];







const ADetailPad = ({ settings , settingsChange , settingConfig , refershParams  })=>{
    const handleChange = (key, value)=>{
        settingsChange({
            ...settings,
            [key]: value
        });
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: `ag14 ${(_styles_module_css__WEBPACK_IMPORTED_MODULE_6___default().container)}`,
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_6___default().modelContainer),
            children: settingConfig.map((item, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_6___default().modelItem),
                    style: {
                        width: `${item.width ?? 100}%`
                    },
                    children: item.type === "prompt" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_ADetailPrompt__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                        settings: settings,
                        settingsChange: settingsChange
                    }) : item.type === "lora" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Ground_Lora__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                        list: item.options,
                        selectedLoras: settings["ad_lora"],
                        submitLoras: (it)=>{
                            handleChange("ad_lora", it);
                        },
                        refershParams: refershParams
                    }) : item.type === "selector" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSelect__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                        value: settings[item.key],
                        onChange: (value)=>{
                            handleChange(item.key, value);
                        },
                        options: item.options,
                        label: item.label
                    }) : item.type === "tag" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                        options: item.options,
                        value: [
                            settings[item.key]
                        ],
                        onChange: (value)=>{
                            handleChange(item.key, value);
                        },
                        label: item.label
                    }) : item.type === "slider" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                        value: settings[item.key],
                        valueChange: (value)=>{
                            handleChange(item.key, value);
                        },
                        label: item.label,
                        config: item.config
                    }) : null
                }, index))
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ADetailPad);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3937:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2539);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_styles_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_Nav_components_Edit_components_TextPrompt_PromptInput__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(609);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Nav_components_Edit_components_TextPrompt_PromptInput__WEBPACK_IMPORTED_MODULE_3__]);
_components_Nav_components_Edit_components_TextPrompt_PromptInput__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];





const KEY_PROMPT = "ad_prompt";
const KEY_NEGATIVE_PROMPT = "ad_negative_prompt";
const ADetailPrompt = ({ settings , settingsChange  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)("studio");
    const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [negativeValue, setNegativeValue] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setValue(settings[KEY_PROMPT] || "");
        setNegativeValue(settings[KEY_NEGATIVE_PROMPT] || "");
    }, [
        settings[KEY_PROMPT],
        settings[KEY_NEGATIVE_PROMPT]
    ]);
    const paste = (pastedText, selectionStart, selectionEnd, isPositive)=>{
        const splits = pastedText.split(" --n ");
        const positive = splits[0];
        const negative = splits[1];
        if (isPositive) {
            if (!document.execCommand || !document.execCommand("insertText", false, positive)) {
                setValue((value)=>value.slice(0, selectionStart) + positive + value.slice(selectionEnd));
            }
            setNegativeValue((value)=>value + negative);
        } else {
            setValue((value)=>value + positive);
            if (!document.execCommand || !document.execCommand("insertText", false, negative)) {
                setNegativeValue((value)=>value.slice(0, selectionStart) + negative + value.slice(selectionEnd));
            }
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_4___default().textPrompt),
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_4___default().textPromptItem),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `ag14-t ${(_styles_module_css__WEBPACK_IMPORTED_MODULE_4___default().title)}`,
                        children: t("sd.adPrompt")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav_components_Edit_components_TextPrompt_PromptInput__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                        height: 180,
                        type: "a_detail_positive",
                        promptChange: ()=>{
                            settingsChange({
                                ...settings,
                                [KEY_PROMPT]: value,
                                [KEY_NEGATIVE_PROMPT]: negativeValue
                            });
                        },
                        value: value,
                        setValue: setValue,
                        placeholder: t("sd.adPromptHint"),
                        pasteCallback: (text, start, end)=>{
                            paste(text, start, end, true);
                        }
                    })
                ]
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `${(_styles_module_css__WEBPACK_IMPORTED_MODULE_4___default().textPromptItem)} ${(_styles_module_css__WEBPACK_IMPORTED_MODULE_4___default().negative)}`,
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `ag14-t ${(_styles_module_css__WEBPACK_IMPORTED_MODULE_4___default().title)}`,
                        children: t("sd.adNegativePrompt")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav_components_Edit_components_TextPrompt_PromptInput__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                        height: 180,
                        type: "a_detail_negative",
                        promptChange: ()=>{
                            settingsChange({
                                ...settings,
                                [KEY_PROMPT]: value,
                                [KEY_NEGATIVE_PROMPT]: negativeValue
                            });
                        },
                        value: negativeValue,
                        setValue: setNegativeValue,
                        placeholder: t("sd.adNegativePromptHint"),
                        pasteCallback: (text, start, end)=>{
                            paste(text, start, end, false);
                        }
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ADetailPrompt);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 7227:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4001);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_styles_module_css__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_2__);




const ADetailTab = ({ aDetailSettingsList , activeKey , setActiveKey , aDetailAdd , aDetailRemove  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)("studio");
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: `${(_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().label)} ag14-t`,
                children: "ADetail"
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().container),
                children: [
                    aDetailSettingsList?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().controllerContainer),
                        children: aDetailSettingsList.map((item, index)=>{
                            const key = item.weshopkey;
                            const isActive = key == activeKey;
                            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `ag14 ${(_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().controller)} ${isActive ? (_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().active) : ""}`,
                                onClick: ()=>{
                                    setActiveKey(key);
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("sd.aDetailUnit", {
                                            index: index + 1
                                        })
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                        onClick: (e)=>{
                                            e.stopPropagation();
                                            aDetailRemove(key);
                                        },
                                        src: isActive ? "./controller_delete_selected.svg" : "./controller_delete.svg",
                                        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().controllerDel),
                                        width: 14,
                                        height: 14,
                                        alt: "controller_delete"
                                    })
                                ]
                            }, index);
                        })
                    }) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().add),
                        onClick: ()=>{
                            aDetailAdd();
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                            className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_3___default().addIcon),
                            src: "./controller_add.svg",
                            width: 18,
                            height: 18,
                            alt: "controller_add"
                        })
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ADetailTab);


/***/ }),

/***/ 9134:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_ADetailPad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1585);
/* harmony import */ var _components_ADetailTab__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7227);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2422);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_styles_module_css__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9204);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8502);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_ADetailPad__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__]);
([_components_ADetailPad__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);








const MAX_CONTROLLER = 2;
const ADetail = ({ loraOption , refershLora  })=>{
    const { taskId: [taskId] , taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const [activeKey, setActiveKey] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [aDetailSettingsList, setADetailSettingsList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    const [configs, setConfigs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    const [defaultConfigs, setDefaultConfigs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({});
    const activeSetting = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>{
        return aDetailSettingsList.find((item)=>item.weshopkey == activeKey);
    }, [
        activeKey,
        aDetailSettingsList
    ]);
    const activeSettingChange = (setting)=>{
        saveADetials(aDetailSettingsList.map((it)=>it.weshopkey == setting.weshopkey ? setting : it));
    };
    const saveADetials = (settingsList)=>{
        handleTaskResult("sdADetailerParams", settingsList);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setADetailSettingsList(taskResult["sdADetailerParams"] ?? []);
    }, [
        taskResult["sdADetailerParams"],
        taskId
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (!aDetailSettingsList.map((it)=>it.weshopkey).includes(activeKey)) {
            setActiveKey(aDetailSettingsList.length ? aDetailSettingsList[0].weshopkey : "");
        }
    }, [
        aDetailSettingsList
    ]);
    const aDetailAdd = ()=>{
        if (aDetailSettingsList.length < MAX_CONTROLLER) {
            const weshopkey = `${taskId}-${Date.now()}`;
            saveADetials(aDetailSettingsList.concat({
                ...defaultConfigs,
                weshopkey: weshopkey
            }));
            setActiveKey(weshopkey);
        } else {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({
                message: `🔴 ADetail最多支持${MAX_CONTROLLER}个 🙅🏻‍♀️`
            });
        }
    };
    const aDetailRemove = (key)=>{
        saveADetials(aDetailSettingsList.filter((it)=>it.weshopkey != key));
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        requestAdetailerParams();
    }, [
        loraOption
    ]);
    const requestAdetailerParams = async ()=>{
        const data = {
            id: taskId ?? ""
        };
        const params = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .getAdetailerParams */ .Ne)(data);
        const defaultSettings = {};
        Object.keys(params).map((key)=>{
            if (typeof params[key] === "object" && "default" in params[key]) {
                defaultSettings[key] = params[key].default;
            }
        });
        setDefaultConfigs(defaultSettings);
        const list = Object.keys(params).map((key)=>({
                key: key,
                ...params[key]
            })).filter((item)=>item.idx);
        list.sort((a, b)=>a.idx - b.idx);
        const configList = list.map((item)=>{
            const config = {};
            config["label"] = item.name;
            config["key"] = item.key;
            if (item.w) {
                config["width"] = item.w == 3 ? 32 : item.w == 2 ? 49 : 100;
            }
            if (item.choice) {
                if (item.key === "ad_model") {
                    config["type"] = "selector";
                    config["options"] = item.choice.map((it)=>{
                        return {
                            label: it,
                            value: it
                        };
                    });
                    config["width"] = 49;
                } else {
                    config["type"] = "tag";
                    config["options"] = item.choice.map((it)=>{
                        return {
                            key: it,
                            value: it
                        };
                    });
                }
            } else if (item.range) {
                config["type"] = "slider";
                config["config"] = item.range;
            }
            return config;
        });
        configList.splice(1, 0, {
            type: "prompt"
        }, loraOption);
        setConfigs(configList);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_7___default().adArea),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ADetailTab__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                aDetailSettingsList: aDetailSettingsList,
                activeKey: activeKey,
                setActiveKey: setActiveKey,
                aDetailAdd: aDetailAdd,
                aDetailRemove: aDetailRemove
            }),
            activeSetting ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ADetailPad__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                settingConfig: configs,
                settings: activeSetting,
                settingsChange: activeSettingChange,
                refershParams: refershLora
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ADetail);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 7235:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_CustomSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6402);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8502);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_4__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];





const MODEL_KEY = "model";
const ControllerModel = ({ settings , settingsChange  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)("studio");
    const [models, setModels] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]);
    const getModels = async (id, refresh)=>{
        const data = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_4__/* .getControllerModels */ .f6)({
            id,
            refresh
        });
        if (settings.id === id) {
            setModels(data ?? []);
            if (data?.length && (!settings[MODEL_KEY] || !data.includes(settings[MODEL_KEY]))) {
                handleChange(MODEL_KEY, data[0]);
            }
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        getModels(settings.id, false);
    // 这个依赖的是module，是因为上一层空间有个接口请求时间差的问题
    }, [
        settings.module
    ]);
    const handleChange = (key, value)=>{
        settingsChange({
            ...settings,
            [key]: value
        });
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSelect__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
        value: settings[MODEL_KEY],
        onChange: (value)=>{
            handleChange(MODEL_KEY, value);
        },
        label: t("sd.controlNetModel"),
        options: models.map((it)=>{
            return {
                label: it,
                value: it
            };
        }),
        refersh: ()=>{
            getModels(settings.id, true);
        }
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControllerModel);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 815:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9047);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9246);
/* harmony import */ var _components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(882);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9948);
/* harmony import */ var _PixelPerfect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7361);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8502);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _ControllerModel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7235);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_9__, _ControllerModel__WEBPACK_IMPORTED_MODULE_11__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_9__, _ControllerModel__WEBPACK_IMPORTED_MODULE_11__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);













const SIZE = 384;
const ControllerPad = ({ types , settings , settingsChange , previewImages , previewStatus , previewRequest , refreshParams  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_10__.useTranslation)("studio");
    const { taskId: [taskId] , taskResult: [taskResult]  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const [uploadingMain, setUploadingMain] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
    const [btnAtrr, setBtnAtrr] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)({
        text: t("sd.runPreprocessor"),
        icon: "/preview.svg",
        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().loading)}`,
        imageClassName: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().loadingIcon)}`
    });
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        if (previewStatus === "Loading") {
            btnAtrr.text = t("sd.processing");
            btnAtrr.icon = "/loading.svg";
            btnAtrr.className = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewBtn)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().loadingBtn)}`;
            btnAtrr.imageClassName = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewIcon)} progressLoading`;
        } else {
            btnAtrr.text = t("sd.runPreprocessor");
            btnAtrr.icon = "/preview.svg";
            btnAtrr.className = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewBtn)}`;
            btnAtrr.imageClassName = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewIcon)}`;
        }
        setBtnAtrr({
            ...btnAtrr
        });
    }, [
        previewStatus
    ]);
    const [preprocessors, setPreprocessors] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]);
    const [settingConfig, setSettingConfig] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        controllerTypeChoose(settings.id, settings.weshopkey);
    }, [
        settings.id,
        settings.weshopkey
    ]);
    const controllerTypeChoose = async (type, weshopkey)=>{
        const data = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_9__/* .getControllerParams */ .oZ)({
            id: type
        });
        if (data) {
            setPreprocessors(data);
            if (!settings.module || settings.module === "none" || !data.map((item)=>item.module).includes(settings.module)) {
                let preprocessorData = data[0];
                if (preprocessorData.module === "none" && data.length > 1) {
                    preprocessorData = data[1];
                }
                const defaultSettings = getDefaultSetting(preprocessorData);
                Object.keys(preprocessorData).map((key)=>{
                    if (key === "model") {
                        return;
                    }
                    if (typeof preprocessorData[key] === "object" && "default" in preprocessorData[key]) {
                        defaultSettings[key] = preprocessorData[key].default;
                    }
                    Object.keys(preprocessorData).map((key)=>{
                        if (typeof preprocessorData[key] === "object" && "default" in preprocessorData[key]) {
                            defaultSettings[key] = preprocessorData[key].default;
                        }
                    });
                    const pre = {};
                    if (settings.pixel_perfect) {
                        pre["pixel_perfect"] = settings.pixel_perfect;
                    }
                    if (settings.control_mode) {
                        pre["control_mode"] = settings.control_mode;
                    }
                    if (settings.weight) {
                        pre["weight"] = settings.weight;
                    }
                    if (settings.guidance_start) {
                        pre["guidance_start"] = settings.guidance_start;
                    }
                    if (settings.guidance_end) {
                        pre["guidance_end"] = settings.guidance_end;
                    }
                    settingsChange({
                        id: type,
                        weshopkey: weshopkey,
                        imageUrl: settings.imageUrl,
                        ...defaultSettings,
                        ...pre
                    });
                });
            }
        }
    };
    const getDefaultSetting = (preprocessorData)=>{
        const defaultSettings = {
            module: preprocessorData.module
        };
        Object.keys(preprocessorData).map((key)=>{
            if (typeof preprocessorData[key] === "object" && "default" in preprocessorData[key]) {
                defaultSettings[key] = preprocessorData[key].default;
            }
        });
        return defaultSettings;
    };
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        let configs = [
            {
                type: "tag",
                key: "id",
                label: t("sd.controlType"),
                options: types
            },
            {
                type: "tag",
                key: "module",
                label: t("sd.preprocessor"),
                options: preprocessors.map((item)=>{
                    return {
                        key: item.module,
                        value: item.module
                    };
                })
            }
        ];
        const preprocessorData = preprocessors.find((it)=>it.module === settings.module);
        if (preprocessorData) {
            if (preprocessorData["model"]) {
                configs.push({
                    type: "model"
                });
            }
            const list = Object.keys(preprocessorData).map((key)=>{
                return {
                    key: key,
                    ...preprocessorData[key]
                };
            }).filter((item)=>{
                return item.idx;
            });
            list.sort((a, b)=>a.idx - b.idx);
            const finalList = list.map((item)=>{
                const config = {};
                config["key"] = item.key;
                config["label"] = item.name;
                if (item.w) {
                    config["width"] = item.w == 3 ? 32 : item.w == 2 ? 49 : 100;
                }
                if (item.choice) {
                    config["type"] = "tag";
                    config["options"] = item.choice.map((it)=>{
                        return {
                            key: it,
                            value: it
                        };
                    });
                } else if (item.range) {
                    config["type"] = "slider";
                    config["config"] = item.range;
                }
                return config;
            });
            configs = configs.concat(finalList);
        }
        setSettingConfig(configs);
    }, [
        preprocessors,
        settings.module
    ]);
    const handleChange = (key, value)=>{
        if (key === "module") {
            const preprocessorData = preprocessors.find((it)=>it.module === value);
            const defaultSettings = getDefaultSetting(preprocessorData);
            settingsChange({
                ...defaultSettings,
                ...settings,
                [key]: value
            });
        } else {
            settingsChange({
                ...settings,
                [key]: value
            });
        }
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().container)}`,
            children: [
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().imageContent),
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Spin, {
                            spinning: uploadingMain && !settings.imageUrl,
                            children: !taskResult?.showImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().originItem),
                                children: [
                                    settings.imageUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                                        children: [
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                src: settings?.imageUrl || "",
                                                width: SIZE,
                                                height: SIZE,
                                                alt: "originImage",
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().originImage),
                                                unoptimized: true
                                            }),
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default()["delete"]),
                                                onClick: ()=>{
                                                    handleChange("imageUrl", null);
                                                },
                                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                    src: "/modal-close.svg",
                                                    width: 16,
                                                    height: 16,
                                                    alt: "deleteImage"
                                                })
                                            })
                                        ]
                                    }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().originUploader),
                                        style: {
                                            width: SIZE + "px",
                                            height: SIZE + "px"
                                        },
                                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                                            type: "controller",
                                            uniqueKey: settings.weshopkey,
                                            taskId: taskId ?? "",
                                            taskName: taskResult?.name ?? "",
                                            beforeUpload: ()=>{
                                                console.info("before upload");
                                            },
                                            uploadSuccess: (file)=>{
                                                handleChange("imageUrl", file.image);
                                            },
                                            setUploading: setUploadingMain,
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().upload),
                                                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().uploadMessage),
                                                    children: [
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                            src: "/gallery_export.svg",
                                                            alt: "uploadButton",
                                                            width: 24,
                                                            height: 24
                                                        }),
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().uploadText),
                                                            children: t("editMask.clickUpload")
                                                        }),
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().dragText)} ag14`,
                                                            children: t("editMask.dragUpload")
                                                        }),
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().size)} ag12`,
                                                            children: t("editMask.uploadLimitation")
                                                        })
                                                    ]
                                                })
                                            })
                                        })
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("editMask.original")
                                    })
                                ]
                            }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().originItem),
                                style: {
                                    width: SIZE + "px"
                                },
                                children: [
                                    settings?.imageUrl || taskResult.showImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                        src: settings?.imageUrl || taskResult.showImage,
                                        width: SIZE,
                                        height: SIZE,
                                        alt: "originImage",
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().originImage),
                                        unoptimized: true
                                    }, settings?.imageUrl) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        style: {
                                            width: `${SIZE}px`,
                                            height: `${SIZE}px`
                                        },
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().originImage)
                                    }),
                                    settings?.imageUrl ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default()["delete"]),
                                        onClick: ()=>{
                                            handleChange("imageUrl", null);
                                        },
                                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                            src: "/modal-close.svg",
                                            width: 16,
                                            height: 16,
                                            alt: "deleteImage"
                                        })
                                    }) : null,
                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                        children: [
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                children: t("editMask.original")
                                            }),
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().or),
                                                children: t("editMask.selectionOr")
                                            }),
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                                                type: "controller",
                                                uniqueKey: settings.weshopkey,
                                                taskId: taskId ?? "",
                                                taskName: taskResult?.name ?? "",
                                                beforeUpload: ()=>{
                                                    console.info("before upload");
                                                },
                                                uploadSuccess: (file)=>{
                                                    handleChange("imageUrl", file.image);
                                                },
                                                setUploading: setUploadingMain,
                                                needDragger: false,
                                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().uploadImage),
                                                    children: t("editMask.uploadPic")
                                                })
                                            })
                                        ]
                                    })
                                ]
                            })
                        }),
                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewItem)}`,
                            children: [
                                previewImages?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                    src: `data:image/png;base64,${previewImages[0]}`,
                                    alt: "previewImage",
                                    width: SIZE,
                                    height: SIZE,
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewImg)
                                }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().empty),
                                    style: {
                                        width: SIZE + "px",
                                        height: SIZE + "px"
                                    }
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewButton),
                                    children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                        onClick: ()=>{
                                            previewRequest(settings.weshopkey, settings.module, settings.imageUrl);
                                        },
                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewBtn)} ${btnAtrr.className}`,
                                        children: [
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                src: btnAtrr.icon,
                                                alt: "previewButton",
                                                width: 14,
                                                height: 14,
                                                className: btnAtrr.imageClassName
                                            }),
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                children: btnAtrr.text
                                            })
                                        ]
                                    })
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().previewText),
                                    children: t("sd.preprocessorPreview")
                                })
                            ]
                        })
                    ]
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().modelContainer),
                    children: settingConfig.map((item, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_12___default().modelItem),
                            style: {
                                width: `${item.width ?? 100}%`
                            },
                            children: item.key === "pixel_perfect" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_PixelPerfect__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                                pixelPerfectConfig: item,
                                preprocessorResolutionConfig: settingConfig.find((item)=>item.key == "processor_res"),
                                settings: settings,
                                handleChange: handleChange
                            }) : item.key === "processor_res" ? null : item.type === "tag" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                                options: item.options,
                                value: [
                                    settings[item.key]
                                ],
                                onChange: (value)=>{
                                    handleChange(item.key, value);
                                },
                                label: item.label,
                                refersh: item.key == "xxxxx" ? refreshParams : null
                            }) : item.type === "slider" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                                value: settings[item.key],
                                valueChange: (value)=>{
                                    handleChange(item.key, value);
                                },
                                label: item.label,
                                config: item.config
                            }) : item.type === "model" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_ControllerModel__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
                                settings: settings,
                                settingsChange: settingsChange
                            }) : null
                        }, index))
                })
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControllerPad);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 6288:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4113);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_2__);




const ControllerTab = ({ controllers , activeKey , controllerAdd , controllerRemove , controllerActive , sdControllers  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)("studio");
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().label)} ag14-t`,
                children: t("sd.controlNet")
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().container),
                children: [
                    controllers?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().controllerContainer),
                        children: controllers.map((item, index)=>{
                            const key = item.weshopkey;
                            const isActive = key == activeKey;
                            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().controller)} ${isActive ? (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().active) : ""}`,
                                onClick: ()=>{
                                    controllerActive(key);
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("sd.controlNetUnit", {
                                            index: `${index + 1}`,
                                            id: `${sdControllers.find((it)=>it.id == item.id)?.name}`
                                        })
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                        onClick: (e)=>{
                                            e.stopPropagation();
                                            controllerRemove(key);
                                        },
                                        src: isActive ? "./controller_delete_selected.svg" : "./controller_delete.svg",
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().controllerDel),
                                        width: 14,
                                        height: 14,
                                        alt: "controller_delete"
                                    })
                                ]
                            }, index);
                        })
                    }) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().add),
                        onClick: ()=>{
                            controllerAdd();
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().addIcon),
                            src: "./controller_add.svg",
                            width: 18,
                            height: 18,
                            alt: "controller_add"
                        })
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControllerTab);


/***/ }),

/***/ 7361:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9948);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7829);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9246);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);





const PixelPerfect = ({ pixelPerfectConfig , preprocessorResolutionConfig , settings , handleChange  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const perfect = {
        key: pixelPerfectConfig.key,
        label: pixelPerfectConfig.label,
        options: [
            {
                key: 1,
                value: t("sd.open")
            },
            {
                key: 0,
                value: t("sd.close")
            }
        ]
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                options: perfect.options,
                value: [
                    settings[perfect.key] ? 1 : 0
                ],
                onChange: (value)=>{
                    handleChange(perfect.key, value ? true : false);
                },
                label: perfect.label
            }),
            preprocessorResolutionConfig && !settings[perfect.key] ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().preprocessorResolution),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                    value: settings[preprocessorResolutionConfig.key],
                    valueChange: (value)=>{
                        handleChange(preprocessorResolutionConfig.key, value);
                    },
                    label: preprocessorResolutionConfig.label,
                    config: preprocessorResolutionConfig.config,
                    labelMode: "inline"
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PixelPerfect);


/***/ }),

/***/ 550:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4019);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_ControllerTab__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6288);
/* harmony import */ var _components_ControllerPad__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(815);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9204);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8502);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_ControllerPad__WEBPACK_IMPORTED_MODULE_3__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__]);
([_components_ControllerPad__WEBPACK_IMPORTED_MODULE_3__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);









const MAX_CONTROLLER = 3;
const Controller = ({ sdControllers , refreshParams  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const { taskId: [taskId] , taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const [previewStatus, setPreviewStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({});
    const [previewImages, setPreviewImages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({});
    const requestPreview = async (key, module, imageUrl)=>{
        setPreviewStatus((preState)=>{
            return {
                ...preState,
                [key]: "Loading"
            };
        });
        setPreviewImages((preState)=>{
            return {
                ...preState,
                [key]: []
            };
        });
        const data = {
            taskId: taskId ?? "",
            module: module,
            image: imageUrl ?? taskResult.showImage
        };
        const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .getControlnetDetect */ .mT)(data);
        if (resp) {
            setPreviewImages((preState)=>{
                return {
                    ...preState,
                    [key]: resp.results
                };
            });
            setPreviewStatus((preState)=>{
                return {
                    ...preState,
                    [key]: "Success"
                };
            });
        } else {
            setPreviewStatus((preState)=>{
                return {
                    ...preState,
                    [key]: "Error"
                };
            });
        }
    };
    const [activeKey, setActiveKey] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [controllers, setControllers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setControllers(taskResult["sdControllerParams"] ?? []);
    }, [
        taskResult["sdControllerParams"],
        taskId
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (!controllers.map((it)=>it.weshopkey).includes(activeKey)) {
            setActiveKey(controllers.length ? controllers[0].weshopkey : "");
        }
    }, [
        controllers
    ]);
    const saveControllers = (list)=>{
        if (list.find((item)=>!item.module)) {
            //这是个中间态，就不用保存了
            setControllers(list);
        } else {
            handleTaskResult("sdControllerParams", list);
        }
    };
    const activeController = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>{
        return controllers.find((item)=>item.weshopkey == activeKey);
    }, [
        controllers,
        activeKey
    ]);
    const activeSettingChange = (setting)=>{
        saveControllers(controllers.map((it)=>it.weshopkey == setting.weshopkey ? setting : it));
    };
    const controllerAdd = ()=>{
        if (controllers.length < MAX_CONTROLLER) {
            const weshopkey = `${taskId}-${Date.now()}`;
            saveControllers(controllers.concat({
                id: sdControllers[0].id,
                weshopkey: weshopkey
            }));
            setActiveKey(weshopkey);
        } else {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({
                message: t("toast.controllerMax", {
                    max: MAX_CONTROLLER
                })
            });
        }
    };
    const controllerRemove = (key)=>{
        saveControllers(controllers.filter((it)=>it.weshopkey != key));
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().ctrlArea),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ControllerTab__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                controllers: controllers,
                activeKey: activeKey,
                controllerAdd: controllerAdd,
                controllerRemove: controllerRemove,
                controllerActive: setActiveKey,
                sdControllers: sdControllers
            }),
            activeController ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().ctrlPad),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ControllerPad__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                    types: sdControllers.map((item)=>{
                        return {
                            key: item.id,
                            value: item.name
                        };
                    }),
                    settings: activeController,
                    settingsChange: activeSettingChange,
                    previewImages: previewImages?.[activeKey],
                    previewStatus: previewStatus?.[activeKey],
                    previewRequest: requestPreview,
                    refreshParams: refreshParams
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Controller);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4955:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ Ground_GenerateSize)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: ./src/components/CustomTag/index.tsx
var CustomTag = __webpack_require__(9948);
// EXTERNAL MODULE: ./src/components/Ground/GenerateSize/style.module.css
var style_module = __webpack_require__(8128);
var style_module_default = /*#__PURE__*/__webpack_require__.n(style_module);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
// EXTERNAL MODULE: ./src/components/Ground/GenerateSize/Size/style.module.css
var Size_style_module = __webpack_require__(1652);
var Size_style_module_default = /*#__PURE__*/__webpack_require__.n(Size_style_module);
// EXTERNAL MODULE: ./node_modules/next/image.js
var next_image = __webpack_require__(5675);
var image_default = /*#__PURE__*/__webpack_require__.n(next_image);
// EXTERNAL MODULE: external "next-i18next"
var external_next_i18next_ = __webpack_require__(1377);
;// CONCATENATED MODULE: ./src/components/Ground/GenerateSize/Size/index.tsx






const Size = ({ size ={
    width: 512,
    height: 512
} , maxSize ={
    width: 1280,
    height: 1280
} , sizeOptions , sizeChange  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("studio");
    const [isLock, setLock] = (0,external_react_.useState)(false);
    const [sizeKey, setSizeKey] = (0,external_react_.useState)(0);
    const [cusWidth, setCusWidth] = (0,external_react_.useState)(size.width.toString());
    const [cusHeight, setCusHeight] = (0,external_react_.useState)(size.height.toString());
    (0,external_react_.useEffect)(()=>{
        setCusWidth(size.width.toString());
        setCusHeight(size.height.toString());
        const choose = chooseList.find((it)=>it.width === size.width && it.height === size.height);
        setSizeKey(choose ? choose.key : 0);
    }, [
        size
    ]);
    const chooseList = sizeOptions.map((it, index)=>{
        return {
            key: index + 1,
            value: `${it.width}x${it.height}`,
            width: it.width,
            height: it.height
        };
    });
    const chooseChange = (key)=>{
        const choose = chooseList.find((it)=>it.key === key);
        if (choose) {
            sizeChange({
                width: choose.width,
                height: choose.height
            });
        }
    };
    const handleKeyUp = (event)=>{
        if (event.key === "Enter") {
            event.preventDefault() // 阻止默认的提交行为
            ;
            event.target.blur();
        }
    };
    const handleInputBlur = (isWidth)=>{
        let w = parseInt(cusWidth);
        let h = parseInt(cusHeight);
        if (Number.isNaN(w)) {
            w = size.width;
        }
        if (Number.isNaN(h)) {
            h = size.height;
        }
        const maxWidth = maxSize.width;
        const maxHeight = maxSize.height;
        if (isLock) {
            if (isWidth) {
                h = size.height / size.width * w;
            } else {
                w = size.width / size.height * h;
            }
            if (h > maxHeight || w > maxWidth) {
                const scaleW = w / maxWidth;
                const sacleH = h / maxHeight;
                if (scaleW > sacleH) {
                    h = h * maxWidth / w;
                    w = maxWidth;
                } else {
                    w = w * maxHeight / h;
                    h = maxHeight;
                }
            }
        }
        if (w > maxWidth) {
            w = maxWidth;
        }
        if (h > maxHeight) {
            h = maxHeight;
        }
        sizeChange({
            width: Math.floor(w),
            height: Math.floor(h)
        });
    };
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx(CustomTag/* default */.Z, {
                options: chooseList,
                onChange: chooseChange,
                value: [
                    sizeKey
                ]
            }),
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: `ag14 ${(Size_style_module_default()).customSize}`,
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx("span", {
                        children: t("sd.width")
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("input", {
                        className: (Size_style_module_default()).customInput,
                        value: cusWidth,
                        onChange: (e)=>{
                            setCusWidth(e.target.value);
                        },
                        onKeyUp: handleKeyUp,
                        onBlur: ()=>handleInputBlur(true)
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: `${(Size_style_module_default()).customLock} ${isLock ? "" : (Size_style_module_default()).customUnlock}`,
                        onClick: ()=>{
                            setLock((isLock)=>!isLock);
                        },
                        children: /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                            src: isLock ? "/icon_lock.svg" : "/icon_unlock.svg",
                            width: 16,
                            height: 16,
                            alt: isLock ? "unlock" : "lock"
                        })
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("span", {
                        children: t("sd.height")
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("input", {
                        className: (Size_style_module_default()).customInput,
                        value: cusHeight,
                        onChange: (e)=>{
                            setCusHeight(e.target.value);
                        },
                        onKeyUp: handleKeyUp,
                        onBlur: ()=>handleInputBlur(false)
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("span", {
                        className: `ag14 ${(Size_style_module_default()).hint}`,
                        children: maxSize.height == maxSize.width ? t("sd.maxSize", {
                            size: maxSize.height
                        }) : t("sd.maxWidthAndHeight", {
                            w: maxSize.width,
                            h: maxSize.height
                        })
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const GenerateSize_Size = (Size);

// EXTERNAL MODULE: ./src/components/CustomSlider/index.tsx
var CustomSlider = __webpack_require__(9246);
// EXTERNAL MODULE: ./src/components/Ground/GenerateSize/Multi/style.module.css
var Multi_style_module = __webpack_require__(9632);
var Multi_style_module_default = /*#__PURE__*/__webpack_require__.n(Multi_style_module);
;// CONCATENATED MODULE: ./src/components/Ground/GenerateSize/Multi/index.tsx



const Multi = ({ size , multi , multiChange  })=>{
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx(CustomSlider/* default */.Z, {
                value: multi,
                valueChange: multiChange,
                labelMode: "inline",
                label: "倍数",
                config: {
                    min: 0.5,
                    max: 2,
                    step: 0.1
                }
            }),
            /*#__PURE__*/ jsx_runtime_.jsx("div", {
                className: `ag14 ${(Multi_style_module_default()).text}`,
                children: `从 ${size.width}x${size.height} 调至 ${size.width * multi}x${size.height * multi}`
            })
        ]
    });
};
/* harmony default export */ const GenerateSize_Multi = (Multi);

;// CONCATENATED MODULE: ./src/components/Ground/GenerateSize/index.tsx







const GenerateSize = ({ needMulti , sizeOptions , size , maxSize , sizeChange  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("studio");
    const [key, setKey] = (0,external_react_.useState)(0);
    const [multi, setMulti] = (0,external_react_.useState)(1);
    const options = [
        {
            key: 1,
            value: t("sd.resizeTo")
        },
        {
            key: 2,
            value: t("sd.resizeBy")
        }
    ];
    return /*#__PURE__*/ jsx_runtime_.jsx(jsx_runtime_.Fragment, {
        children: needMulti ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
            className: (style_module_default()).sizeContainer,
            children: [
                /*#__PURE__*/ jsx_runtime_.jsx(CustomTag/* default */.Z, {
                    options: options,
                    label: t("sd.size"),
                    value: [
                        key
                    ],
                    onChange: (key)=>{
                        setKey(key);
                    }
                }),
                key ? /*#__PURE__*/ jsx_runtime_.jsx("div", {
                    className: (style_module_default()).sizePad,
                    children: key == 1 ? /*#__PURE__*/ jsx_runtime_.jsx(GenerateSize_Size, {
                        size: size,
                        maxSize: maxSize,
                        sizeOptions: sizeOptions,
                        sizeChange: sizeChange
                    }) : /*#__PURE__*/ jsx_runtime_.jsx(GenerateSize_Multi, {
                        size: size,
                        multi: multi,
                        multiChange: setMulti
                    })
                }) : null
            ]
        }) : /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
            className: (style_module_default()).sizeContainer,
            children: [
                /*#__PURE__*/ jsx_runtime_.jsx("p", {
                    className: `${(style_module_default()).title} ag14-t`,
                    children: t("sd.size")
                }),
                /*#__PURE__*/ jsx_runtime_.jsx(GenerateSize_Size, {
                    size: size,
                    maxSize: maxSize,
                    sizeOptions: sizeOptions,
                    sizeChange: sizeChange
                })
            ]
        })
    });
};
/* harmony default export */ const Ground_GenerateSize = (GenerateSize);


/***/ }),

/***/ 1335:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5762);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_2__);



const UpscaleByDesc = ({ size , scaleby  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)("studio");
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_2___default().text)}`,
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
            children: t("sd.scaleby", {
                origin: `${size.width}x${size.height}`,
                target: `${Math.ceil(size.width * scaleby)}x${Math.ceil(size.height * scaleby)}`
            })
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UpscaleByDesc);


/***/ }),

/***/ 5073:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9948);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6403);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_CustomSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6402);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9246);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_UpscaleByDesc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1335);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8502);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_8__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_8__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];










const HiresFix = ({ sdkey  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_5__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
    const [configs, setConfigs] = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]);
    const [defaultConfigs, setDefaultConfigs] = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)({});
    const options = [
        {
            key: 1,
            value: t("sd.open")
        },
        {
            key: 0,
            value: t("sd.close")
        }
    ];
    const requestHiresFixParams = async ()=>{
        const params = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_8__/* .getHiresFixParams */ .Ob)();
        const defaultSettings = {};
        Object.keys(params).map((key)=>{
            if (typeof params[key] === "object" && "default" in params[key]) {
                defaultSettings[key] = params[key].default;
            }
        });
        setDefaultConfigs(defaultSettings);
        const list = Object.keys(params).map((key)=>({
                key: key,
                ...params[key]
            })).filter((item)=>item.idx);
        list.sort((a, b)=>a.idx - b.idx);
        const configList = [];
        list.forEach((item)=>{
            const config = {};
            config["label"] = item.name;
            config["key"] = item.key;
            config["width"] = item.w == 3 ? 31.8 : item.w == 2 ? 48.9 : 100;
            if (item.choice) {
                config["type"] = "selector";
                config["options"] = item.choice.map((it)=>{
                    return {
                        label: it,
                        value: it
                    };
                });
            } else if (item.range) {
                config["type"] = "slider";
                config["config"] = item.range;
            }
            configList.push(config);
            if (config["key"] == "sdHrUpscaler") {
                configList.push({
                    type: "place",
                    width: 48.9
                });
            } else if (config["key"] == "sdHrScale") {
                configList.push({
                    type: "byDesc",
                    width: 48.9
                });
            }
        });
        setConfigs(configList);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(()=>{
        requestHiresFixParams();
    }, []);
    const handleSettingChange = (key, value)=>{
        handleTaskResult(key, value);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                options: options,
                value: [
                    taskResult[sdkey] ? 1 : 0
                ],
                onChange: (value)=>{
                    handleTaskResult(sdkey, value ? true : false);
                    Object.keys(defaultConfigs).forEach((it)=>{
                        if (!taskResult[it]) {
                            handleTaskResult(it, defaultConfigs[it]);
                        }
                    });
                },
                label: t("sd.hiresFix")
            }),
            taskResult[sdkey] ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().container)}`,
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().modelContainer),
                    children: configs.map((item, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().modelItem),
                            style: {
                                width: `${item.width ?? 100}%`
                            },
                            children: item.type === "selector" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSelect__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                                value: taskResult[item.key],
                                onChange: (value)=>{
                                    handleSettingChange(item.key, value);
                                },
                                options: item.options,
                                label: item.label,
                                labelMode: "inline"
                            }) : item.type === "tag" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                                options: item.options,
                                value: [
                                    taskResult[item.key]
                                ],
                                onChange: (value)=>{
                                    handleSettingChange(item.key, value);
                                },
                                label: item.label
                            }) : item.type === "slider" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                value: taskResult[item.key],
                                valueChange: (value)=>{
                                    handleSettingChange(item.key, value);
                                },
                                label: item.label,
                                config: item.config,
                                labelMode: "inline"
                            }) : item.type === "byDesc" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_UpscaleByDesc__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                                size: taskResult["sdWidthAndHeight"] ?? {},
                                scaleby: taskResult["sdHrScale"]
                            }) : item.type === "place" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {}) : null
                        }, index))
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HiresFix);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3528:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4659);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9246);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9948);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Nav_components_Edit_components_EditImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3275);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2228);
/* harmony import */ var _components_Nav_components_Edit_components_UploadImage_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(949);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Nav_components_Edit_components_EditImage__WEBPACK_IMPORTED_MODULE_4__]);
_components_Nav_components_Edit_components_EditImage__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];









const ImgReference = ({ value  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
    const sdInpaintingMaskInvert = value?.sdInpaintingMaskInvert?.map((item)=>{
        return {
            key: item.id,
            value: item.name
        };
    });
    const sdInpaintingFill = value?.sdInpaintingFill?.map((item)=>{
        return {
            key: item.id,
            value: item.name
        };
    });
    const sdInpaintFullRes = value?.sdInpaintFullRes?.map((item)=>{
        return {
            key: item.id,
            value: item.name
        };
    });
    const maskSettingsConfig = [
        {
            type: "slider",
            key: "sdMaskBlur",
            label: t("sd.maskBlur"),
            option: value.sdMaskBlur.range
        },
        {
            type: "tag",
            key: "sdInpaintingMaskInvert",
            label: t("sd.maskMode"),
            width: 49,
            options: sdInpaintingMaskInvert
        },
        {
            type: "tag",
            key: "sdInpaintingFill",
            label: t("sd.maskedContent"),
            width: 49,
            options: sdInpaintingFill
        },
        {
            type: "tag",
            key: "sdInpaintFullRes",
            label: t("sd.inpaintArea"),
            options: sdInpaintFullRes
        },
        {
            type: "slider",
            key: "sdInpaintFullResPadding",
            label: t("sd.maskedPadding"),
            option: value.sdInpaintFullResPadding.range
        }
    ];
    const beforeUploading = async (file)=>{
        const info = await (0,_components_Nav_components_Edit_components_UploadImage_utils__WEBPACK_IMPORTED_MODULE_7__/* .checkAspectRatio */ .w)(file);
        const maxWidth = value?.sdWidthAndHeight?.maxWidth ?? 1024;
        const maxHeight = value?.sdWidthAndHeight?.maxHeight ?? 1024;
        if (info.width <= maxWidth && info.height <= maxHeight) {
            handleTaskResult("sdWidthAndHeight", {
                width: info.width,
                height: info.height
            });
        } else {
            const scaleW = info.width / maxWidth;
            const sacleH = info.height / maxHeight;
            if (scaleW > sacleH) {
                handleTaskResult("sdWidthAndHeight", {
                    height: Math.floor(info.height * maxWidth / info.width),
                    width: maxWidth
                });
            } else {
                handleTaskResult("sdWidthAndHeight", {
                    width: Math.floor(info.width * maxHeight / info.height),
                    height: maxHeight
                });
            }
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav_components_Edit_components_EditImage__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                isSDImg: true,
                maskNeed: taskResult["sdInpaint"],
                maskNeedChange: (value)=>{
                    handleTaskResult("sdInpaint", value ? 1 : 0);
                },
                beforeUploading: beforeUploading
            }),
            taskResult["sdInpaint"] ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().modelContainer),
                    children: maskSettingsConfig.map((item, index)=>{
                        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().modelItem),
                            style: {
                                width: `${item.width ?? 100}%`
                            },
                            children: item.type === "tag" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                                options: item.options,
                                value: [
                                    taskResult[item.key]
                                ],
                                onChange: (value)=>{
                                    handleTaskResult(item.key, value);
                                },
                                label: item.label
                            }) : item.type === "slider" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                                value: taskResult[item.key],
                                valueChange: (value)=>{
                                    handleTaskResult(item.key, value);
                                },
                                label: item.label
                            }) : null
                        }, index);
                    })
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ImgReference);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2175:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8517);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _hook_InterrogateCtx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);







const InterrogateButton = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)("studio");
    const { taskId: [taskId] , taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_4__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [isLoading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const results = (0,_hook_InterrogateCtx__WEBPACK_IMPORTED_MODULE_5__/* .useInterrogateResults */ .W9)();
    const { interrogate , remove  } = (0,_hook_InterrogateCtx__WEBPACK_IMPORTED_MODULE_5__/* .useInterrogate */ .Qs)();
    const result = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(()=>{
        return results.find((item)=>item.taskId == taskId);
    }, [
        results,
        taskId
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        if (result?.status == "pending") {
            setLoading(true);
        } else {
            setLoading(false);
        }
        if (result?.status == "success") {
            handleTaskResult("posPrompt", result.caption);
            remove(taskId ?? "");
        }
    }, [
        result
    ]);
    const interrogateClip = async ()=>{
        const image = taskResult["showImage"];
        if (!image) {
            return;
        }
        interrogate(taskId ?? "", image);
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().previewButton),
        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            onClick: interrogateClip,
            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().previewBtn)} ${isLoading ? (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().loadingBtn) : ""}`,
            children: [
                !isLoading ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                    src: "/ic_sd_interrogate.svg",
                    alt: "previewButton",
                    width: 14,
                    height: 14,
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().imageClassName)
                }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                    src: "/loading.svg",
                    alt: "loadingButton",
                    width: 14,
                    height: 14,
                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().imageClassName)} progressLoading`
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                    children: t("sd.interrogate")
                })
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterrogateButton);


/***/ }),

/***/ 5047:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4195);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7428);
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7550);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);








const Lora = ({ list , selectedLoras , submitLoras , refershParams  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const [isModalOpen, setIsModalOpen] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [selectList, setSelectList] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    const [weight, setWeight] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    const submit = ()=>{
        const result = selectedLoras ? [
            ...selectedLoras
        ] : [];
        const weightMap = {};
        result.forEach((item)=>{
            weightMap[item.id] = item.weight;
        });
        console.info(weightMap);
        console.info(list);
        const arr = [];
        list.forEach((item)=>{
            if (selectList?.includes(item.id)) {
                arr.push({
                    ...item,
                    weight: weightMap[item.id] ?? item.weight
                });
            }
        });
        submitLoras(arr);
        setIsModalOpen(false);
    };
    const cancel = ()=>{
        setIsModalOpen(false);
    };
    const deleteLora = (key)=>{
        const arr = selectedLoras ? [
            ...selectedLoras
        ] : [];
        const index = arr.findIndex((loraItem)=>loraItem.id === key);
        if (index !== -1) {
            arr.splice(index, 1);
        }
        submitLoras(arr);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        const arr = selectedLoras?.map((item)=>item.id) || [];
        const weights = selectedLoras?.map((item)=>item.weight.toString()) || [];
        setSelectList(arr);
        setWeight(weights);
    }, [
        selectedLoras
    ]);
    const selectLora = (item)=>{
        const updatedList = [
            ...selectList
        ];
        const index = updatedList.indexOf(item?.id);
        if (index !== -1) {
            updatedList.splice(index, 1);
        } else {
            updatedList.push(item?.id);
        }
        setSelectList(updatedList);
    };
    const handleKeyUp = (event)=>{
        if (event.key === "Enter") {
            event.preventDefault() // 阻止默认的提交行为
            ;
            event.target.blur();
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().templateList),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: `ag16-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().title)}`,
                children: " LoRA"
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().scroll),
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().templateItem)} ag12`,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().add),
                                onClick: ()=>{
                                    setIsModalOpen(true);
                                },
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                    src: "/add_active.svg",
                                    width: 40,
                                    height: 40,
                                    alt: "addLora",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().addIcon)
                                })
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                children: t("sd.fromStore")
                            })
                        ]
                    }),
                    selectedLoras?.map((item, key)=>{
                        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().templateItem)} ag14`,
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default()["delete"]),
                                    onClick: ()=>{
                                        deleteLora(item.id);
                                    },
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                        src: "/modal-close.svg",
                                        width: 12,
                                        height: 12,
                                        alt: "delete"
                                    })
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().image)}`,
                                    src: item?.image || "",
                                    width: 144,
                                    height: 144,
                                    unoptimized: true,
                                    alt: "lora-cover"
                                }),
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().loraName),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().name)} ag12`,
                                            children: item.name
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("input", {
                                            className: `ag12 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().valueDisplay)}`,
                                            onChange: (e)=>{
                                                const value = e.target.value;
                                                const sdLora = [
                                                    ...weight
                                                ];
                                                sdLora[key] = value;
                                                setWeight(sdLora);
                                            },
                                            onKeyUp: handleKeyUp,
                                            value: weight[key],
                                            type: "number",
                                            onBlur: ()=>{
                                                const result = selectedLoras ? [
                                                    ...selectedLoras
                                                ] : [];
                                                const aar = result.map((item, index)=>{
                                                    const value = parseFloat(weight[index]);
                                                    let limit = 0.5;
                                                    if (isNaN(value)) {
                                                        limit = 0.5;
                                                    } else {
                                                        limit = Math.min(Math.max(value, 0), 1);
                                                    }
                                                    return {
                                                        ...item,
                                                        weight: limit
                                                    };
                                                });
                                                submitLoras(aar);
                                            }
                                        })
                                    ]
                                })
                            ]
                        }, key);
                    })
                ]
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_Modal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                isModalOpen: isModalOpen,
                title: t("sd.store"),
                setIsModalOpen: setIsModalOpen,
                width: 1224,
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().loraStore),
                        children: [
                            list.map((item, key)=>{
                                return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().templateItem)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().lora)} ${selectList?.includes(item?.id) ? (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().selectLora) : ""}`,
                                    onClick: ()=>{
                                        selectLora(item);
                                    },
                                    children: [
                                        item.commercialDescription ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_5__.Popover, {
                                            placement: "bottomRight",
                                            title: t("sd.loraDisclaimer"),
                                            overlayClassName: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().popover),
                                            content: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().popoverContent),
                                                children: item.commercialDescription
                                            }),
                                            trigger: "hover",
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().infoLora),
                                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                                    src: "/lora_info.svg",
                                                    width: 24,
                                                    height: 24,
                                                    alt: "info"
                                                })
                                            })
                                        }) : null,
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().image)}`,
                                            src: item?.image || "",
                                            width: 144,
                                            height: 144,
                                            unoptimized: true,
                                            alt: "lora-cover"
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().loraModalName)} ag12`,
                                            children: item.name
                                        })
                                    ]
                                }, key);
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("i", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().empty)
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("i", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().empty)
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("i", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().empty)
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("i", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().empty)
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("i", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().empty)
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().submit),
                        children: [
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().selectNum)}`,
                                children: [
                                    t("sd.selectedLoRA"),
                                    selectList?.length,
                                    "/",
                                    list.length
                                ]
                            }),
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().btn),
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().cancel),
                                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                            style: {
                                                backgroundColor: "var(--FillColor3)",
                                                color: "var(--TextColor1)"
                                            },
                                            onClick: cancel,
                                            children: t("sd.cancel")
                                        })
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().confrim),
                                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                            onClick: submit,
                                            children: t("sd.confirm")
                                        })
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().refresh),
                                        height: 40,
                                        width: 40,
                                        src: "/ic_sd_refresh.svg",
                                        alt: "refresh",
                                        onClick: refershParams
                                    })
                                ]
                            })
                        ]
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Lora);


/***/ }),

/***/ 7643:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_CustomSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6402);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7552);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_17__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9246);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9948);
/* harmony import */ var _GenerateSize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4955);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2228);
/* harmony import */ var _components_Nav_components_Edit_components_TextPrompt__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2761);
/* harmony import */ var _Lora__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5047);
/* harmony import */ var _Controller__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(550);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8502);
/* harmony import */ var _ImgReference__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3528);
/* harmony import */ var _ADetail__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9134);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _Seed__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8817);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(9204);
/* harmony import */ var _HiresFix__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5073);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Nav_components_Edit_components_TextPrompt__WEBPACK_IMPORTED_MODULE_7__, _Controller__WEBPACK_IMPORTED_MODULE_9__, _pages_api_base__WEBPACK_IMPORTED_MODULE_10__, _ImgReference__WEBPACK_IMPORTED_MODULE_11__, _ADetail__WEBPACK_IMPORTED_MODULE_12__, _HiresFix__WEBPACK_IMPORTED_MODULE_15__]);
([_components_Nav_components_Edit_components_TextPrompt__WEBPACK_IMPORTED_MODULE_7__, _Controller__WEBPACK_IMPORTED_MODULE_9__, _pages_api_base__WEBPACK_IMPORTED_MODULE_10__, _ImgReference__WEBPACK_IMPORTED_MODULE_11__, _ADetail__WEBPACK_IMPORTED_MODULE_12__, _HiresFix__WEBPACK_IMPORTED_MODULE_15__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);







// import ImgReference from '../ImgReference'











const SDImg = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_13__.useTranslation)("studio");
    const { agentName: [agentName] , taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
    const [configs, setConfigs] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        setGroundParams();
    }, [
        taskResult
    ]);
    const refershGroundParams = async ()=>{
        const suc = await setGroundParams();
        if (suc) {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z)({
                message: t("sd.refreshSuccessful"),
                type: "success"
            });
        }
    };
    const handleOptions = (data, key, value)=>{
        const obj = data?.map((item)=>{
            return {
                [key]: item.name,
                [value]: item.id
            };
        });
        return obj;
    };
    const setGroundParams = async ()=>{
        if (!agentName) return false;
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_10__/* .getGroundParams */ .ZX)({
            agentName
        });
        if (!value) return false;
        const tempConfig = [
            {
                type: "selector",
                label: "CHECKPOINT",
                key: taskResult.batchTask ? "sdCheckpoints" : "sdCheckpoint",
                width: 49,
                mode: taskResult.batchTask ? "multiple" : undefined,
                options: value?.sdCheckpoint?.map((item)=>{
                    return {
                        label: item.name,
                        value: item.id,
                        popover: {
                            title: t("sd.modelDisclaimer"),
                            content: item.commercialDescription
                        }
                    };
                })
            },
            {
                type: "selector",
                label: "VAE",
                key: "sdVae",
                width: 37,
                options: handleOptions(value?.sdVae, "label", "value")
            },
            {
                type: "selector",
                label: "Clip Skip",
                key: "sdClipStopAtLastLayers",
                width: 10,
                options: handleOptions(value?.sdClipStopAtLastLayers, "label", "value")
            },
            {
                type: "imageReference",
                key: "imageReference",
                value: value
            },
            {
                type: "prompt"
            },
            {
                type: "lora",
                key: "sdLora",
                options: value?.sdLora
            },
            {
                type: "selector",
                label: t("sd.samplingMethod"),
                key: taskResult.batchTask ? "sdSamplingMethods" : "sdSamplingMethod",
                mode: taskResult.batchTask ? "multiple" : undefined,
                width: 49,
                options: handleOptions(value?.sdSamplingMethod, "label", "value")
            },
            {
                type: "tag",
                key: "sdSamplingSteps",
                label: t("sd.samplingSteps"),
                width: 49,
                options: handleOptions(value?.sdSamplingSteps, "key", "value")
            },
            {
                type: "tag",
                key: "sdRestoreFaces",
                label: t("sd.restoreFaces"),
                options: [
                    {
                        key: 1,
                        value: t("sd.true")
                    },
                    {
                        key: 0,
                        value: t("sd.false")
                    }
                ]
            },
            {
                type: "generateSize",
                key: "sdWidthAndHeight",
                maxSize: {
                    width: value?.sdWidthAndHeight?.maxWidth,
                    height: value?.sdWidthAndHeight?.maxHeight
                },
                options: value?.sdWidthAndHeight?.options
            },
            {
                type: "tag",
                key: "batchCount",
                label: t("sd.batchCount"),
                options: handleOptions(value?.batchCount, "key", "value")
            },
            {
                type: "slider",
                key: "sdCfgScale",
                label: t("sd.cgfScale"),
                config: value?.sdCfgScale?.range
            },
            {
                type: "slider",
                key: "sdDenoisingStrength",
                label: t("sd.denoisingStrength"),
                config: value?.sdDenoisingStrength?.range
            },
            {
                type: "seed",
                key: "sdSeed"
            },
            {
                type: "hiresFix",
                key: "sdHrEnable"
            },
            {
                type: "controller",
                key: "sdController",
                options: value?.sdController
            },
            {
                type: "aDetail",
                key: "sdADetail"
            }
        ];
        setConfigs(tempConfig.filter((item)=>agentName == "image2image" && item.key != "sdHrEnable" || agentName == "text2image" && item.key != "sdDenoisingStrength" && item.key != "imageReference"));
        return true;
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_17___default().modelContainer),
        children: configs.map((item, index)=>{
            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                children: [
                    item.type === "controller" || item.type === "aDetail" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_17___default().divider),
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_17___default().line)
                        })
                    }) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_17___default().modelItem),
                        style: {
                            width: `${item.width ?? 100}%`
                        },
                        children: item.type === "selector" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSelect__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                            value: taskResult[item.key],
                            onChange: (value)=>{
                                handleTaskResult(item.key, value);
                            },
                            options: item.options,
                            label: item.label,
                            refersh: item.key == "sdCheckpoint" || item.key == "sdVae" ? refershGroundParams : null,
                            mode: item?.mode || ""
                        }) : item.type === "prompt" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav_components_Edit_components_TextPrompt__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                            isNotShowExplain: true
                        }) : item.type === "lora" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Lora__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                            list: item.options,
                            refershParams: refershGroundParams,
                            selectedLoras: taskResult["sdLora"],
                            submitLoras: (it)=>{
                                handleTaskResult("sdLora", it);
                            }
                        }) : item.type === "tag" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                            options: item.options,
                            value: [
                                taskResult[item.key]
                            ],
                            onChange: (value)=>{
                                handleTaskResult(item.key, value);
                            },
                            label: item.label
                        }) : item.type === "generateSize" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_GenerateSize__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                            needMulti: false,
                            maxSize: item.maxSize,
                            size: taskResult[item.key],
                            sizeOptions: item.options ?? [],
                            sizeChange: (value)=>{
                                handleTaskResult(item.key, value);
                            }
                        }) : item.type === "slider" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                            value: taskResult[item.key],
                            valueChange: (value)=>{
                                handleTaskResult(item.key, value);
                            },
                            label: item.label,
                            config: item.config
                        }) : item.type === "imageReference" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_ImgReference__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
                            value: item.value
                        }) : item.type === "controller" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Controller__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
                            refreshParams: refershGroundParams,
                            sdControllers: item.options
                        }) : item.type === "aDetail" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_ADetail__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
                            loraOption: configs.find((it)=>{
                                return it.type === "lora";
                            }),
                            refershLora: refershGroundParams
                        }) : item.type === "seed" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Seed__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {}) : item.type === "hiresFix" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_HiresFix__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
                            sdkey: item.key
                        }) : null
                    }, index)
                ]
            });
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SDImg);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8817:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2403);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var _components_CustomSlider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9246);







const DEFAULT = -1;
const Seed = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const sdKey = "sdSeed";
    const sdSubseedStrengthKey = "sdSubseedStrength";
    const [seed, setSeed] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(`${taskResult[sdKey] ?? DEFAULT}`);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        setSeed(`${taskResult[sdKey] ?? DEFAULT}`);
    }, [
        taskResult[sdKey]
    ]);
    const handleSeed = ()=>{
        const seedNum = parseInt(seed);
        if (seedNum < -1) {
            handleTaskResult(sdKey, -seedNum);
        } else {
            handleTaskResult(sdKey, seedNum);
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().seedItem),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().label)} ag14`,
                        children: t("sd.seed")
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().content),
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("input", {
                                type: "number",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().input),
                                value: seed,
                                onChange: (e)=>{
                                    setSeed(e.target.value);
                                },
                                onBlur: ()=>{
                                    handleSeed();
                                }
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                height: 48,
                                width: 48,
                                src: "/ic_seed_default.svg",
                                alt: "seedDefault",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().icon),
                                onClick: ()=>{
                                    handleTaskResult(sdKey, -1);
                                }
                            })
                        ]
                    })
                ]
            }),
            taskResult[sdKey] && taskResult[sdKey] != -1 ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().modelItem),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomSlider__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                    value: taskResult[sdSubseedStrengthKey],
                    valueChange: (value)=>{
                        handleTaskResult(sdSubseedStrengthKey, value);
                    },
                    label: t("sd.subseedStrength"),
                    config: {
                        max: 1,
                        min: 0,
                        step: 0.01
                    }
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Seed);


/***/ }),

/***/ 9842:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4127);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_1__);


const BatchTaskProgress = ({ executeSummary  })=>{
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_1___default().progress)}`,
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_1___default().line)
            }),
            executeSummary,
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_1___default().line)
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BatchTaskProgress);


/***/ }),

/***/ 2011:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6675);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _Opreate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5802);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8502);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3413);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Opreate__WEBPACK_IMPORTED_MODULE_3__, _pages_api_base__WEBPACK_IMPORTED_MODULE_7__]);
([_Opreate__WEBPACK_IMPORTED_MODULE_3__, _pages_api_base__WEBPACK_IMPORTED_MODULE_7__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










const InferItem = ({ itemType , item , itemChange , itemData , executionClick , previewIndexChange  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)("studio");
    const [showHover, setHover] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
    const [hold, setHold] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(null);
    const { taskId: [taskId] , inferStarList: [, setInferStarList]  } = (0,react__WEBPACK_IMPORTED_MODULE_4__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
    const getStartList = async ()=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_7__/* .taskExecutionStars */ .LH)({
            taskId
        });
        setInferStarList(value ?? []);
    };
    const handleProgress = (value)=>{
        const progress = parseFloat(value) * 100;
        return parseInt(progress + "") + "%";
    };
    return item ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().image),
                onMouseMove: ()=>setHover(itemData.id),
                onMouseLeave: ()=>setHover(null),
                children: [
                    itemData.status === "Success" && showHover === itemData.id ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().imageMask)}`,
                        onClick: previewIndexChange,
                        children: t("previewText")
                    }) : null,
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().content),
                        children: [
                            itemData.status == "Pending" || itemData.status == "Running" || itemData.status == "Failed" || itemData.blocked ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().place),
                                style: {
                                    backgroundColor: itemData.status == "Pending" ? "var(--FillColor1)" : itemData.status == "Running" ? "var(--FillColor6)" : itemData.status == "Failed" ? "var(--FillColor3)" : "#333333",
                                    color: itemData.status == "Pending" ? "var(--TextColor2)" : itemData.status == "Running" ? "var(--TextColor2)" : itemData.status == "Failed" ? "var(--TextColor3)" : "#595959"
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().placeLogo),
                                        height: 100,
                                        width: 100,
                                        src: itemData.blocked ? "/ic_image_logo_blocked.svg" : "/ic_image_logo.svg",
                                        alt: "logo"
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().placeTxt)}`,
                                        children: itemData.status == "Pending" ? t("imageState.pending") : itemData.status == "Running" ? t("imageState.running", {
                                            progress: handleProgress(itemData?.progress || "0")
                                        }) : itemData.status == "Failed" ? _common_constans_international__WEBPACK_IMPORTED_MODULE_8__/* .IS_ONLINE_POWER */ .mt ? t("imageState.failed") : t("imageState.failedBack") : t("imageState.blocked")
                                    }),
                                    itemData.status == "Running" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                        className: `ag12 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().placeBottom)}`,
                                        children: _common_constans_international__WEBPACK_IMPORTED_MODULE_8__/* .CLOUD_PROVIDE */ .Xq
                                    }) : null
                                ]
                            }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Image, {
                                src: itemData.previewImage || "",
                                alt: "model_image",
                                width: 252,
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().imageOne),
                                preview: false
                            }, itemData.previewImage || itemData.finalImage),
                            showHover === itemData.id && itemData.status === "Success" && !itemData.blocked || hold === itemData.id ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Opreate__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                                executionInfo: {
                                    taskId,
                                    taskName: item.taskName,
                                    executionId: item.executionId,
                                    executeSeq: item.executeSeq,
                                    agentVersion: item.agentVersion
                                },
                                imageInfo: {
                                    unitId: itemData.id,
                                    image: itemData.finalImage,
                                    isStar: itemData.isStar ?? false,
                                    index: itemType === "star" ? null : item.result.findIndex((it)=>it.id == itemData.id) + 1,
                                    seed: itemData.seed
                                },
                                holdChange: setHold,
                                starCallback: getStartList,
                                submittedInfo: itemType === "star" ? {
                                    // 这是星标这边的，所以isSubmitted是在res维度的
                                    id: item.id ?? "",
                                    isSubmitted: !!item.isSubmitted,
                                    submittedChange: (it)=>{
                                        if (itemChange) {
                                            itemChange({
                                                ...item,
                                                isSubmitted: it
                                            });
                                        }
                                    }
                                } : undefined
                            }) : null
                        ]
                    })
                ]
            }),
            itemType === "star" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().executeContainer)}`,
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().executeSeq),
                    onClick: ()=>{
                        if (executionClick) {
                            executionClick(item?.executeSeq, itemData?.pageNumber || 0);
                        }
                    },
                    children: t("execution", {
                        executeSeq: item?.executeSeq
                    })
                })
            }) : null
        ]
    }) : null;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InferItem);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4652:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4771);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7428);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3413);
/* harmony import */ var _InferItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2011);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_6__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_InferItem__WEBPACK_IMPORTED_MODULE_3__]);
_InferItem__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];








const Detail = ({ item  })=>{
    const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [activeIndex, setActiveIndex] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(-1);
    const [list, setList] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        const successItems = item?.result?.filter((itemData)=>itemData?.status === "Success");
        setList(successItems || []);
    }, [
        item
    ]);
    const changeImage = (type)=>{
        if (type && activeIndex < list?.length - 1) {
            setActiveIndex((prevActiveIndex)=>prevActiveIndex + 1);
        } else if (!type && activeIndex > 0) {
            setActiveIndex((prevActiveIndex)=>prevActiveIndex - 1);
        }
    };
    const handleKeyDown = (event)=>{
        if (event.keyCode === 37) {
            // 左箭头键
            changeImage(0);
        } else if (event.keyCode === 39) {
            // 右箭头键
            changeImage(1);
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        window.addEventListener("keydown", handleKeyDown);
        return ()=>{
            window.removeEventListener("keydown", handleKeyDown);
        };
    }, [
        activeIndex
    ]);
    const outsideClick = (event)=>{
        const clickedElement = event.target;
        if (clickedElement.id === "caseDetail" || clickedElement.classList.contains("ant-image")) {
            setOpen(false);
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().detail),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().imageWrap),
                children: item?.result?.map((itemData, index)=>{
                    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_InferItem__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                        itemType: "page",
                        item: item,
                        itemData: itemData,
                        previewIndexChange: ()=>{
                            const index = list.findIndex((it)=>it.id == itemData.id);
                            setActiveIndex(index);
                            setOpen(true);
                        }
                    }, index);
                })
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_Modal__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                width: "100%",
                title: "",
                isModalOpen: open,
                setIsModalOpen: setOpen,
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().detailModal),
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag16 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().head)}`,
                        children: [
                            activeIndex + 1,
                            " / ",
                            list?.length
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().showDetail),
                        id: "caseDetail",
                        onClick: outsideClick,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().head),
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().closeModalIcon),
                                    onClick: ()=>{
                                        setOpen(false);
                                    },
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                        src: "/close.svg",
                                        width: 24,
                                        height: 24,
                                        alt: "close"
                                    })
                                })
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().changeBtn)} ${activeIndex == 0 ? (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().changeBtnDisable) : null}`,
                                onClick: ()=>changeImage(0),
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                    src: "/arrow_white.svg",
                                    width: 18,
                                    height: 18,
                                    alt: "pre",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().preIcon)
                                })
                            }),
                            item?.showImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().content)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().originImage)}`,
                                id: "originImage",
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_6__.Image, {
                                    src: item.showImage,
                                    alt: "origin-iamge",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().image),
                                    preview: false
                                })
                            }) : null,
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().content)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().finalImage)}`,
                                id: "finalImage",
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_6__.Image, {
                                    src: list[activeIndex]?.finalImage || "",
                                    alt: "origin-iamge",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().image),
                                    preview: false
                                })
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().changeBtn)} ${activeIndex == list?.length - 1 ? (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().changeBtnDisable) : null}`,
                                onClick: ()=>changeImage(1),
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                    src: "/arrow_white.svg",
                                    width: 18,
                                    height: 18,
                                    alt: "pre"
                                })
                            }),
                            _common_constans_international__WEBPACK_IMPORTED_MODULE_2__/* .SHOW_WATER_MASK */ .Lf ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                src: _common_constans_international__WEBPACK_IMPORTED_MODULE_2__/* .IMAGE_WATER_MASK */ .HK,
                                width: 200,
                                height: 74,
                                alt: "water-mask",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().waterMask)
                            }) : null
                        ]
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Detail);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 1200:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6874);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _InferItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2011);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7428);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3413);
/* harmony import */ var _components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9724);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8502);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_InferItem__WEBPACK_IMPORTED_MODULE_1__, _components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_8__, _pages_api_base__WEBPACK_IMPORTED_MODULE_9__]);
([_InferItem__WEBPACK_IMPORTED_MODULE_1__, _components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_8__, _pages_api_base__WEBPACK_IMPORTED_MODULE_9__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);











const InferStar = ({ taskId , inferStarList , setInferStarList , executionClick  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [activeIndex, setActiveIndex] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(-1);
    const [list, setList] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]);
    const [opreateHover, setOpreateHover] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [starBtnHover, setStarBtnHover] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [height, setHeight] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(0);
    const [width, setWidth] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(0);
    const [offsetX, setOffsetX] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(0);
    const [isSubmitted, setSubmitted] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const caseDetailRef = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        const successItems = [];
        inferStarList?.forEach((inferResult)=>{
            inferResult?.result.forEach((inferItem)=>{
                successItems.push({
                    showImage: inferResult.showImage,
                    previewImage: inferItem.previewImage,
                    finalImage: inferItem.finalImage,
                    id: inferItem.id,
                    isSubmitted: inferResult.isSubmitted
                });
            });
        });
        setList(successItems || []);
    }, [
        inferStarList
    ]);
    const changeImage = (type)=>{
        if (type && activeIndex < list?.length - 1) {
            setActiveIndex((prevActiveIndex)=>prevActiveIndex + 1);
        } else if (!type && activeIndex > 0) {
            setActiveIndex((prevActiveIndex)=>prevActiveIndex - 1);
        }
    };
    const handleKeyDown = (event)=>{
        if (event.keyCode === 37) {
            // 左箭头键
            changeImage(0);
        } else if (event.keyCode === 39) {
            // 右箭头键
            changeImage(1);
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        window.addEventListener("keydown", handleKeyDown);
        return ()=>{
            window.removeEventListener("keydown", handleKeyDown);
        };
    }, [
        activeIndex
    ]);
    const outsideClick = (event)=>{
        const clickedElement = event.target;
        if (clickedElement.id === "caseDetail" || clickedElement.classList.contains("ant-image")) {
            setOpen(false);
        }
    };
    const activePreview = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(()=>{
        return list[activeIndex];
    }, [
        list,
        activeIndex
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        if (activePreview) {
            setSubmitted(activePreview.isSubmitted ?? false);
            const observer = new ResizeObserver((entries)=>{
                const contentRect = entries[0].contentRect;
                setHeight(contentRect.height);
                setWidth(contentRect.width);
                if (!activePreview.showImage) {
                    const rect = entries[0].target.getBoundingClientRect();
                    const viewportWidth = window.innerWidth;
                    setOffsetX(rect.left - viewportWidth / 2);
                }
            });
            const img = caseDetailRef.current?.querySelector("#finalImage img.ant-image-img");
            console.info(img);
            if (img) {
                observer.observe(img);
                return ()=>{
                    observer.disconnect();
                };
            }
        }
    }, [
        activePreview
    ]);
    const getStartList = async ()=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_9__/* .taskExecutionStars */ .LH)({
            taskId
        });
        setInferStarList(value ?? []);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().starContainer),
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().starTitle)}`,
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                        width: 36,
                        height: 36,
                        alt: "bookmark",
                        src: "/ic-tag-star.svg",
                        style: {
                            marginLeft: "8px",
                            marginRight: "10px"
                        }
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: t("starred")
                    })
                ]
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().starlist),
                children: inferStarList?.map((item, index)=>{
                    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_InferItem__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                        itemType: "star",
                        item: item,
                        itemData: item.result[0],
                        executionClick: executionClick,
                        itemChange: (res)=>{
                            setInferStarList(inferStarList?.map((it)=>it.id === res.id ? res : it));
                        },
                        previewIndexChange: ()=>{
                            const index = list.findIndex((it)=>it.id == item.result[0].id);
                            setActiveIndex(index);
                            setOpen(true);
                        }
                    }, index);
                })
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_Modal__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                width: "100%",
                title: "",
                isModalOpen: open,
                setIsModalOpen: setOpen,
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().detailModal),
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag16 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().head)}`,
                        children: [
                            activeIndex + 1,
                            " / ",
                            list?.length
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().showDetail),
                        ref: caseDetailRef,
                        id: "caseDetail",
                        onClick: outsideClick,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().head),
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().closeModalIcon),
                                    onClick: ()=>{
                                        setOpen(false);
                                    },
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                        src: "/close.svg",
                                        width: 24,
                                        height: 24,
                                        alt: "close"
                                    })
                                })
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().changeBtn)} ${activeIndex == 0 ? (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().changeBtnDisable) : null}`,
                                onClick: ()=>changeImage(0),
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                    src: "/arrow_white.svg",
                                    width: 18,
                                    height: 18,
                                    alt: "pre",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().preIcon)
                                })
                            }),
                            activePreview?.showImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().content)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().originImage)}`,
                                id: "originImage",
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_6__.Image, {
                                    src: activePreview.showImage,
                                    alt: "origin-iamge",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().image),
                                    preview: false
                                })
                            }) : null,
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().content)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().finalImage)}`,
                                id: "finalImage",
                                onMouseEnter: ()=>{
                                    setOpreateHover(true);
                                },
                                onMouseLeave: ()=>{
                                    setOpreateHover(false);
                                },
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_6__.Image, {
                                    src: activePreview?.finalImage || "",
                                    alt: "origin-iamge",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().image),
                                    preview: false
                                })
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().changeBtn)} ${activeIndex == list?.length - 1 ? (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().changeBtnDisable) : null}`,
                                onClick: ()=>changeImage(1),
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                    src: "/arrow_white.svg",
                                    width: 18,
                                    height: 18,
                                    alt: "pre"
                                })
                            }),
                            opreateHover || starBtnHover ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().opreateHover)} ${activePreview.showImage ? "" : (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().opreateHoverNoOrigin)}`,
                                style: {
                                    height: height + "px",
                                    width: width - 40 + "px",
                                    pointerEvents: "none",
                                    transform: `translateX(${offsetX}px)`
                                },
                                children: _common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IS_SUBMIT_TASK */ .HR ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().starSub),
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                                        id: activePreview.id,
                                        isSubmitted: isSubmitted,
                                        setSubmitted: (value)=>{
                                            setSubmitted(value);
                                            getStartList();
                                        },
                                        mouseChange: (hover)=>{
                                            setStarBtnHover(hover);
                                        }
                                    })
                                }) : null
                            }) : null,
                            _common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .SHOW_WATER_MASK */ .Lf ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                src: _common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IMAGE_WATER_MASK */ .HK,
                                width: 200,
                                height: 74,
                                alt: "water-mask",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().waterMask)
                            }) : null
                        ]
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InferStar);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4988:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5439);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8502);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_5__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];







const MIN_WIDTH = 160;
const ListHeader = ({ currentPage , isEnd , turnPage  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)("studio");
    const { inferResult: [inferResult] , refreshPageList , taskId: [taskId] , taskResult: [taskResult, setTaskResult] , showEdit: [showEdit]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    const [taskName, setTaskName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [taskNameEdit, setTaskNameEdit] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [taskNameEditWidth, setTaskNameEditWidth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(100);
    const nameRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    const handleKeyDown = (event)=>{
        console.info(event);
        if (event.key === "Enter" && !event.nativeEvent.isComposing) {
            event.preventDefault() // 阻止默认的提交行为
            ;
            saveTaskName();
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setTaskNameEdit(false);
    }, [
        taskId
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (taskNameEdit && inputRef.current) {
            inputRef.current?.focus();
        }
    }, [
        taskNameEdit
    ]);
    const saveTaskName = async ()=>{
        const data = {
            taskId: taskId,
            name: taskName
        };
        const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .renameTask */ .a$)(data);
        if (resp) {
            setTaskNameEdit(false);
            setTaskResult({
                ...taskResult,
                name: taskName
            });
            setTaskName("");
            refreshPageList();
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().taskTitle)} ${showEdit ? "" : (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().taskTitleZ)}`,
        children: [
            taskNameEdit ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().taskName),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("input", {
                        style: {
                            width: `${taskNameEditWidth}px`
                        },
                        ref: inputRef,
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().inputValue)} ag18`,
                        type: "text",
                        placeholder: taskResult.name,
                        value: taskName,
                        onKeyDown: handleKeyDown,
                        onChange: (e)=>{
                            setTaskName(e.target.value);
                        }
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().icon),
                        src: "/ic_task_name_cancel.svg",
                        height: 24,
                        width: 24,
                        alt: "edit_canel",
                        onClick: ()=>{
                            setTaskNameEdit(false);
                            setTaskName("");
                        }
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().icon),
                        src: "/ic_task_name_complete.svg",
                        height: 24,
                        width: 24,
                        alt: "edit_complete",
                        onClick: saveTaskName
                    })
                ]
            }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `ag18 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().taskName)}`,
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        ref: nameRef,
                        children: taskResult.name
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().icon),
                        src: "/ic_task_name_edit.svg",
                        height: 24,
                        width: 24,
                        alt: "edit_name",
                        onClick: ()=>{
                            let width = nameRef.current?.offsetWidth ?? MIN_WIDTH;
                            if (width < MIN_WIDTH) {
                                width = MIN_WIDTH;
                            }
                            setTaskNameEditWidth(width);
                            setTaskNameEdit(true);
                        }
                    })
                ]
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().divider)
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().taskId)}`,
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: t("taskNo")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: `${taskResult.number}`
                    })
                ]
            }),
            currentPage === 1 && isEnd ? null : inferResult?.length ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().pagination),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().num1)}`,
                        onClick: ()=>{
                            turnPage(1);
                        },
                        children: t("toNewest")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().pre)} ${currentPage === 1 ? (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().page1) : ""}`,
                        onClick: ()=>{
                            if (currentPage === 1) return;
                            turnPage(currentPage - 1);
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                            src: currentPage === 1 ? "/disable_arrow.svg" : "/arrow.svg",
                            alt: "pre",
                            width: 16,
                            height: 16
                        })
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().pre)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().next)} ${isEnd ? (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().lastPage) : ""}`,
                        onClick: ()=>{
                            if (isEnd) return;
                            turnPage(currentPage + 1);
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                            src: isEnd ? "/disable_arrow.svg" : "/arrow.svg",
                            alt: "pre",
                            width: 16,
                            height: 16
                        })
                    })
                ]
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ListHeader);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 6397:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4530);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_styles_module_css__WEBPACK_IMPORTED_MODULE_1__);


const Progress = ({ progress  })=>{
    const rotate = progress / 100 * 360;
    const rightRotate = progress < 50 ? rotate - 135 : 45;
    const leftRotate = progress > 50 ? rotate + 45 : 225;
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_1___default().container),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_1___default().left),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    style: {
                        transform: `rotate(${leftRotate}deg)`
                    },
                    className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_1___default().leftcircle)
                })
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_1___default().right),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    style: {
                        transform: `rotate(${rightRotate}deg)`
                    },
                    className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_1___default().rightcircle)
                })
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Progress);


/***/ }),

/***/ 5382:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4754);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8502);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9204);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_4__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];







const ShopifySend = ({ imageUrl , getFileName  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const shareToShopify = async ()=>{
        if (loading) {
            return;
        }
        setLoading(true);
        const fileName = await getFileName();
        const data = {
            imgUrl: imageUrl,
            imgName: fileName
        };
        const result = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_4__/* .shopifyUploadImage */ .ey)(data);
        if (result) {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)({
                message: t("shopifyShareSuccess"),
                type: "success"
            });
        }
        setLoading(false);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().sendItem),
        onClick: ()=>{
            shareToShopify();
        },
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                width: 48,
                height: 48,
                src: "/ic_send_shopify.svg",
                alt: "shopify"
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: `ag12 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().sendLabel)}`,
                children: "Shopify"
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShopifySend);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 5802:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(9397);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_18__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8502);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8208);
/* harmony import */ var _hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7428);
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7550);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _components_Nav_components_Edit_components_PowerDefect__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7388);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8810);
/* harmony import */ var _components_Progress__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6397);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(3413);
/* harmony import */ var _components_Shopify__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5382);
/* harmony import */ var _components_hooks_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4098);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(1653);
/* harmony import */ var _components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(9724);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, underscore__WEBPACK_IMPORTED_MODULE_11__, _components_Shopify__WEBPACK_IMPORTED_MODULE_14__, _components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_17__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, underscore__WEBPACK_IMPORTED_MODULE_11__, _components_Shopify__WEBPACK_IMPORTED_MODULE_14__, _components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_17__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);




















const Opreate = ({ executionInfo , imageInfo , holdChange , starCallback , submittedInfo  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_10__.useTranslation)([
        "studio",
        "common"
    ]);
    const { userInfos: [userInfos] , handleTaskResult , powerBalanceAmount: [, setPowerBalance] , agentName: [agentName, setAgentName] , inferResult: [, setInferResult] , inferStarList: [, setInferStarList] , taskId: [, setTaskId]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const downloadMenu = [
        {
            icon: "/ic_opreate_download.svg",
            finishIcon: "",
            key: "download"
        },
        {
            icon: "/ic_opreate_4k.svg",
            finishIcon: "/ic_opreate_4k_finished.svg",
            key: "4K"
        }
    ];
    const sendMenu = _common_constans_international__WEBPACK_IMPORTED_MODULE_13__/* .IS_LOCAL */ .Kc ? [
        {
            icon: "/ic_send_img2img.svg",
            key: "image2image",
            label: t("common:scene.image2image.simple")
        }
    ] : [
        {
            icon: "/model.png",
            key: "mannequin",
            label: t("common:scene.mannequin.simple")
        },
        {
            icon: "/real.png",
            key: "model",
            label: t("common:scene.model.simple")
        },
        {
            icon: "/ic_send_img2img.svg",
            key: "image2image",
            label: t("common:scene.image2image.simple")
        }
    ];
    if (_common_constans__WEBPACK_IMPORTED_MODULE_16__/* .RETASK_AGENT.includes */ .MQ.includes(agentName ?? "")) {
        sendMenu.push({
            icon: "/ic_send_replicate.svg",
            key: "replicate",
            label: t("common:scene.replicate.simple")
        });
    }
    if (_common_constans_international__WEBPACK_IMPORTED_MODULE_13__/* .IS_EN */ .jY && userInfos?.isBindShopify) {
        sendMenu.push({
            key: "shopify",
            icon: "",
            label: ""
        });
    }
    const [downloadShow, setDownloadShow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [sendShow, setSendShow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [sendDotShow, setSendDotShow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [isNormalPending, setNormalPending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [isUpscalePending, setUpscalePending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [isModalOpen, setIsModalOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [notRemind, setRemind] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [isPowerDefect, setIsPowerDefect] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [isStar, setStar] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(imageInfo.isStar || false);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (localStorage.getItem(`opreate-send-click`)) {
            setSendDotShow(false);
        } else {
            setSendDotShow(true);
        }
    }, []);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (sendShow) {
            localStorage.setItem(`opreate-send-click`, "true");
            setSendDotShow(false);
        }
    }, [
        sendShow
    ]);
    const [upscaleStatus, setUpscaleStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [progress, setProgress] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
    const getFileName = async ()=>{
        if (!imageInfo.index) {
            const data = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .downloadImgName */ .Bv)({
                taskId: executionInfo.taskId,
                executionId: executionInfo.executionId,
                id: imageInfo.unitId
            });
            if (data) {
                return `${data.taskName}-${data.executeSeq}-${data.index ? data.index : "_"}`;
            }
        }
        return `${executionInfo.taskName}-${executionInfo.executeSeq}-${imageInfo.index ? imageInfo.index : "_"}`;
    };
    const handleDownload2KClick = ()=>{
        if (upscaleStatus === "Pending") return;
        if (localStorage.getItem("notRemind") === "true" || upscaleStatus === "Completed" || !_common_constans_international__WEBPACK_IMPORTED_MODULE_13__/* .SHOW_COMPUTER_POWER */ .fo) {
            upscale2KOk();
        } else {
            setIsModalOpen(true);
        }
    };
    const upscale2KOk = async ()=>{
        setUpscalePending(true);
        setDownloadShow(false);
        if (notRemind && localStorage.getItem("notRemind") != "true") {
            localStorage.setItem("notRemind", `${notRemind}`);
        }
        setIsModalOpen(false);
        // 4k放大
        const logParam = window?.logger.getParams(window?.logger.EID.COMMON_CLICK, window?.logger.EVENT_TYPE.CLICK, {
            type: "4K",
            image: imageInfo.image,
            taskId: executionInfo.taskId,
            executionId: executionInfo.executionId
        });
        window?.logger.log([
            logParam
        ]);
        const fileName = await getFileName();
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .get2KImage */ .ox)({
            id: imageInfo.unitId,
            image: imageInfo.image
        });
        if (value?.image) {
            const image4KUrl = value?.image;
            setPowerBalance(value?.powerBalanceAmount);
            if (image4KUrl) {
                const startTime = Date.now();
                setUpscaleStatus("Completed");
                const suc = await (0,_common_utils__WEBPACK_IMPORTED_MODULE_3__/* .handleDownloadClick */ .be)(image4KUrl, `${fileName}-4K`, t);
                const logParam1 = window?.logger.getParams("100000012", 3, {
                    taskId: executionInfo.taskId,
                    type: "4k",
                    image: image4KUrl,
                    costTime: Date.now() - startTime,
                    isSuccess: suc
                });
                window?.logger.log([
                    logParam1
                ]);
                if (!suc) {
                    setTimeout(()=>{
                        window.open(image4KUrl, "_blank");
                    }, 2000);
                }
            }
        } else if (value?.code === "2007") {
            setIsPowerDefect(true);
        }
        setUpscalePending(false);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        const timerId = setTimeout(()=>{
            looperStatus();
        }, 300);
        return ()=>{
            clearTimeout(timerId);
        };
    }, [
        imageInfo
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (upscaleStatus == "Pending") {
            const intervalId = setInterval(looperStatus, 1000);
            return ()=>{
                clearInterval(intervalId);
            };
        }
    }, [
        upscaleStatus
    ]);
    const looperStatus = async ()=>{
        const data = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .get2KImageStatus */ .FJ)({
            image: imageInfo.image
        });
        if (data) {
            setUpscaleStatus(data.upscaleStatus ?? "");
        }
    };
    const upscale2KCancel = ()=>{
        setIsModalOpen(false);
    };
    const downloadFinalImage = async ()=>{
        setNormalPending(true);
        setDownloadShow(false);
        const image = imageInfo.image;
        // 结果图下载打点
        const logParam = window?.logger.getParams(window?.logger.EID.COMMON_CLICK, window?.logger.EVENT_TYPE.CLICK, {
            type: "imageDownload",
            image,
            taskId: executionInfo.taskId,
            executionId: executionInfo.executionId
        });
        window?.logger.log([
            logParam
        ]);
        const startTime = Date.now();
        const fileName = await getFileName();
        const suc = await (0,_common_utils__WEBPACK_IMPORTED_MODULE_3__/* .handleDownloadClick */ .be)(image, fileName, t);
        const logParam1 = window?.logger.getParams("100000012", 3, {
            taskId: executionInfo.taskId,
            type: "imageDownload",
            image: image,
            costTime: Date.now() - startTime,
            isSuccess: suc
        });
        window?.logger.log([
            logParam1
        ]);
        if (!suc) {
            setTimeout(()=>{
                window.open(image, "_blank");
            }, 2000);
        }
        setNormalPending(false);
    };
    const orpeateClick = (key)=>{
        switch(key){
            case "download":
                downloadFinalImage();
                break;
            case "4K":
                handleDownload2KClick();
                break;
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setStar(imageInfo.isStar);
    }, [
        imageInfo.isStar
    ]);
    const starItem = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(underscore__WEBPACK_IMPORTED_MODULE_11__.debounce(()=>{
        const starImageRequest = async (star)=>{
            try {
                await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .starImage */ .hf)({
                    id: imageInfo.unitId,
                    finalImage: imageInfo.image,
                    isStar: star
                });
                starCallback(imageInfo.unitId, star);
            } catch (error) {
                console.error(error);
            }
        };
        const targetStar = !isStar;
        starImageRequest(targetStar);
        setStar(targetStar);
    }, 300), [
        isStar,
        imageInfo
    ]);
    const onChange = (e)=>{
        setRemind(e.target.checked);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        const showProgress = isUpscalePending || isNormalPending;
        let timerId = null;
        if (showProgress || progress) {
            timerId = setTimeout(()=>{
                setProgress((preState)=>{
                    let progress = preState;
                    if (progress >= 100) {
                        progress = 0;
                    } else if (!showProgress) {
                        if (progress < 50) {
                            progress = 50;
                        } else {
                            progress = 100;
                        }
                    } else if (progress < 20) {
                        progress = progress + 5;
                    } else if (progress < 50) {
                        progress = progress + 2;
                    } else if (progress < 80) {
                        progress = progress + 1;
                    } else if (progress < 95) {
                        progress = progress + 0.25;
                    }
                    return progress > 100 ? 100 : progress;
                });
            }, 200);
        }
        return ()=>{
            if (timerId) {
                clearTimeout(timerId);
            }
        };
    }, [
        isUpscalePending,
        isNormalPending,
        progress
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (progress || isModalOpen || isPowerDefect || sendShow) {
            holdChange(imageInfo.unitId);
        } else {
            holdChange(null);
        }
    }, [
        progress,
        isModalOpen,
        isPowerDefect,
        sendShow
    ]);
    const sendTo = (key)=>{
        switch(key){
            case "replicate":
                replicate();
                break;
            default:
                newTask(key);
                break;
        }
    };
    const replicate = async ()=>{
        const detail = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .getTaskDetail */ .T8)({
            taskId: executionInfo.taskId,
            executionId: executionInfo.executionId
        });
        let params;
        if (detail.paramType === "replicate") {
            params = {
                batchTask: detail?.batchTask,
                agentVersion: detail?.agentVersion,
                agentName: "replicate",
                replicateFromTaskNo: detail.number,
                replicateFromExecuteSeq: detail.executionSeq,
                replicateFromImage: imageInfo.image,
                replicateFromUnitId: imageInfo.unitId
            };
        } else {
            params = {
                batchTask: detail?.batchTask,
                agentVersion: detail?.agentVersion,
                agentName: "replicate",
                paramType: detail.paramType,
                replicateFromTaskNo: detail.number,
                replicateFromExecuteSeq: detail.executionSeq,
                replicateFromTaskAgentName: detail.agentName === "replicate" ? detail.replicateFromTaskAgentName : detail.agentName,
                replicateFromImage: imageInfo.image,
                replicateFromUnitId: imageInfo.unitId
            };
            _components_hooks_constants__WEBPACK_IMPORTED_MODULE_15__/* .PARAMS */ .z[params.paramType]?.forEach((item)=>{
                params[item] = detail[item];
            });
        }
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .saveTask */ .F9)(params);
        if (value) {
            setAgentName("replicate");
            setTaskId(null);
            setInferResult([]);
            setInferStarList([]);
            setTimeout(()=>{
                setTaskId(value.taskId);
            }, 100);
        }
    };
    const newTask = async (agentName)=>{
        const params = {
            batchTask: false,
            agentName,
            paramType: _common_constans__WEBPACK_IMPORTED_MODULE_16__/* .DEFAULT_AGENT_TIPS */ .Sg[agentName].paramType,
            image: imageInfo.image,
            agentVersion: executionInfo.agentVersion
        };
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .saveTask */ .F9)(params);
        if (value) {
            setAgentName(agentName);
            setTaskId(null);
            setInferResult([]);
            setInferStarList([]);
            setTimeout(()=>{
                setTaskId(value.taskId);
                if (agentName === "image2image") {
                    setTimeout(()=>{
                        const image = new Image();
                        image.src = imageInfo.image;
                        image.onload = ()=>{
                            handleTaskResult("sdWidthAndHeight", {
                                width: image.width,
                                height: image.height
                            });
                        };
                    }, 200);
                }
            }, 100);
        }
    };
    const copySeed = (seed)=>{
        if (!seed) {
            return;
        }
        (0,_common_utils__WEBPACK_IMPORTED_MODULE_3__/* .commonCopyText */ .jz)(seed, {}, t("common:toast.copySuccess"));
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            imageInfo.seed ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().seed)} ag12`,
                onClick: ()=>{
                    copySeed(imageInfo.seed);
                },
                children: [
                    imageInfo.seed,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().copy),
                        width: 12,
                        height: 12,
                        alt: "copy",
                        src: "/ic_seed_copy.svg"
                    })
                ]
            }) : null,
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().opreate),
                children: [
                    _common_constans_international__WEBPACK_IMPORTED_MODULE_13__/* .IS_SUBMIT_TASK */ .HR && submittedInfo ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().starSub),
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ShowCase_components_Detail_StarToTask__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
                            id: submittedInfo.id,
                            isSubmitted: submittedInfo.isSubmitted,
                            setSubmitted: (submitted)=>{
                                submittedInfo.submittedChange(submitted);
                            }
                        })
                    }) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().star),
                        onClick: ()=>{
                            starItem();
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                            height: 20,
                            width: 20,
                            alt: "bookmark",
                            src: isStar ? "/ic-stared.svg" : "/ic-star.svg",
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().starIcon)
                        })
                    }),
                    sendMenu.length ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().send),
                        onClick: ()=>{
                            setDownloadShow(false);
                            setSendShow(true);
                        },
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().sendEntry)}`,
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                    src: "/ic_opreate_send.svg",
                                    alt: "send",
                                    width: 20,
                                    height: 20
                                }, "send")
                            }),
                            sendDotShow ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().dot)
                            }) : null
                        ]
                    }) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().download)} ${sendMenu.length ? (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().downloadLarge) : ""}`,
                        onClick: ()=>{
                            setDownloadShow(true);
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().downloadEntry)}`,
                            children: progress ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Progress__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
                                    progress: progress
                                })
                            }) : upscaleStatus === "Pending" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                src: "/loading.svg",
                                alt: "loading",
                                width: 20,
                                height: 20,
                                className: `progressLoading`
                            }, "loading") : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                width: 20,
                                height: 20,
                                alt: "download",
                                src: "/ic_opreate_download.svg"
                            }, "download")
                        })
                    }),
                    sendShow ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Modal__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                        isModalOpen: sendShow,
                        setIsModalOpen: setSendShow,
                        title: t("studio:titleSend"),
                        width: 408,
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().sendContainer),
                            children: sendMenu.map((menu, index)=>{
                                return menu.key === "shopify" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Shopify__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
                                    imageUrl: imageInfo.image,
                                    getFileName: getFileName
                                }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().sendItem),
                                    onClick: ()=>{
                                        sendTo(menu.key);
                                    },
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().sendIcon),
                                            width: 48,
                                            height: 48,
                                            src: menu.icon,
                                            alt: menu.key
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: `ag12 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().sendLabel)}`,
                                            children: menu.label
                                        })
                                    ]
                                }, index);
                            })
                        })
                    }) : null,
                    downloadShow ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().more),
                        children: downloadMenu.map((menuItem, key)=>{
                            return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().opreateItem)}`,
                                onClick: ()=>{
                                    orpeateClick(menuItem.key);
                                },
                                children: [
                                    (upscaleStatus === "Pending" || isUpscalePending) && menuItem.key === "4K" || isNormalPending && menuItem.key === "download" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                        src: "/loading.svg",
                                        alt: "loading",
                                        width: 20,
                                        height: 20,
                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().loadingIcon)} progressLoading`
                                    }, "loading") : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                        src: menuItem.key === "4K" && upscaleStatus === "Completed" ? menuItem.finishIcon : menuItem.icon,
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().icon),
                                        width: 20,
                                        height: 20,
                                        alt: menuItem.key
                                    }, menuItem.key),
                                    t("studio:downloadButton", {
                                        returnObjects: true
                                    })[menuItem.key]
                                ]
                            }, key);
                        })
                    }) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Modal__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                        isModalOpen: isModalOpen && _common_constans_international__WEBPACK_IMPORTED_MODULE_13__/* .SHOW_COMPUTER_POWER */ .fo,
                        setIsModalOpen: setIsModalOpen,
                        title: t("studio:title4K"),
                        width: 408,
                        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: `ag16 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().powerMessage)}`,
                            children: [
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().powerTips),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                            children: t("studio:hint4K")
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                            src: "/cpu-charge.svg",
                                            width: 20,
                                            height: 20,
                                            alt: "cpu-charge",
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().cpuCharge)
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().primaryColor),
                                            children: "10"
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                            children: t("studio:points")
                                        })
                                    ]
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().notice),
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_8__.Checkbox, {
                                        onChange: onChange,
                                        children: t("studio:noFurther")
                                    })
                                }),
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().btn),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().btnItem),
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                                                onClick: upscale2KCancel,
                                                style: {
                                                    backgroundColor: "var(--FillColor3)",
                                                    color: "var(--TextColor1)",
                                                    fontSize: "16px",
                                                    lineHeight: "24px",
                                                    fontWeight: "500"
                                                },
                                                children: t("common:cancel")
                                            })
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().btnItem)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_18___default().ok)}`,
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                                                onClick: upscale2KOk,
                                                style: {
                                                    fontSize: "16px",
                                                    lineHeight: "24px",
                                                    fontWeight: "500"
                                                },
                                                children: t("common:confirm")
                                            })
                                        })
                                    ]
                                })
                            ]
                        })
                    }),
                    isPowerDefect ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav_components_Edit_components_PowerDefect__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
                        isModalOpen: isPowerDefect,
                        setIsModalOpen: setIsPowerDefect
                    }) : null
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Opreate);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2836:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4580);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_1__);


const PromptTag = ({ name  })=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: name ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_1___default().tagWrap)}`,
            children: name
        }) : null
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PromptTag);


/***/ }),

/***/ 4930:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ components_ShowPrompt)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: ./src/components/ImageList/components/ShowPrompt/style.module.css
var style_module = __webpack_require__(697);
var style_module_default = /*#__PURE__*/__webpack_require__.n(style_module);
// EXTERNAL MODULE: ./node_modules/next/image.js
var next_image = __webpack_require__(5675);
var image_default = /*#__PURE__*/__webpack_require__.n(next_image);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
// EXTERNAL MODULE: ./src/components/hooks/createContext.tsx
var createContext = __webpack_require__(2228);
// EXTERNAL MODULE: ./src/common/constans/international.ts + 2 modules
var international = __webpack_require__(3413);
// EXTERNAL MODULE: ./src/components/ImageList/components/ShowTemplate/index.tsx
var ShowTemplate = __webpack_require__(8761);
// EXTERNAL MODULE: ./src/components/ImageList/components/CopyPrompt/style.module.css
var CopyPrompt_style_module = __webpack_require__(4213);
var CopyPrompt_style_module_default = /*#__PURE__*/__webpack_require__.n(CopyPrompt_style_module);
// EXTERNAL MODULE: external "next-i18next"
var external_next_i18next_ = __webpack_require__(1377);
// EXTERNAL MODULE: ./src/common/utils.ts
var utils = __webpack_require__(8208);
;// CONCATENATED MODULE: ./src/components/ImageList/components/CopyPrompt/index.tsx





const CopyPrompt = ({ posPrompt , negPrompt , executionId  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)([
        "studio",
        "common"
    ]);
    const copyText = ()=>{
        let value = posPrompt;
        if (negPrompt) value = value + " --n " + negPrompt;
        (0,utils/* commonCopyText */.jz)(value, {
            executionId
        }, t("common:toast.copySuccess"));
    };
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        className: `ag16 ${(CopyPrompt_style_module_default()).textPrompt}`,
        children: [
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: (CopyPrompt_style_module_default()).text,
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx("span", {
                        children: posPrompt
                    }),
                    negPrompt ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                        className: (CopyPrompt_style_module_default()).textNegativePrompt,
                        children: [
                            /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                className: (CopyPrompt_style_module_default()).dividing,
                                children: " --n "
                            }),
                            /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                children: negPrompt
                            })
                        ]
                    }) : /*#__PURE__*/ jsx_runtime_.jsx("span", {
                        children: " "
                    })
                ]
            }),
            /*#__PURE__*/ jsx_runtime_.jsx("div", {
                className: (CopyPrompt_style_module_default()).copy,
                onClick: ()=>{
                    copyText();
                },
                children: /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                    src: "/copy.svg",
                    width: 16,
                    height: 16,
                    alt: "copy-icon",
                    className: (CopyPrompt_style_module_default()).copyIcon
                })
            })
        ]
    });
};
/* harmony default export */ const components_CopyPrompt = (CopyPrompt);

// EXTERNAL MODULE: ./src/components/ImageList/components/ShowRetask/style.module.css
var ShowRetask_style_module = __webpack_require__(933);
var ShowRetask_style_module_default = /*#__PURE__*/__webpack_require__.n(ShowRetask_style_module);
;// CONCATENATED MODULE: ./src/components/ImageList/components/ShowRetask/index.tsx





const ShowRetask = ({ item  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("studio");
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx("p", {
                className: `ag14 ${(ShowRetask_style_module_default()).tagName}`,
                children: t("showPrompt.replicateFrom", {
                    taskNo: item.replicateFromTaskNo,
                    executeSeq: item.replicateFromExecuteSeq
                })
            }),
            /*#__PURE__*/ jsx_runtime_.jsx("span", {
                children: "/"
            }),
            item.replicateFromImage ? /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                src: item.replicateFromImage || "",
                width: 20,
                height: 20,
                alt: "prompt-icon",
                className: (ShowRetask_style_module_default()).icon,
                loader: utils/* previewLoader */.Te
            }) : null
        ]
    });
};
/* harmony default export */ const components_ShowRetask = (ShowRetask);

// EXTERNAL MODULE: ./src/components/ImageList/components/PromptTag/index.tsx
var PromptTag = __webpack_require__(2836);
;// CONCATENATED MODULE: ./src/components/ImageList/components/ShowPrompt/index.tsx











const ShowPrompt = ({ item  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("studio");
    const { showEdit: [showEdit, setShowEdit] , taskDetail , taskId: [taskId] , agentName: [agentName] , requestLoading: [, setRequestLoading]  } = (0,external_react_.useContext)(createContext/* default */.Z);
    const editAgain = async (executionId)=>{
        if (!showEdit) {
            // 再次编辑打点
            const logParam = window?.logger.getParams("10000002", window?.logger.EVENT_TYPE.CLICK, {
                taskId,
                executionId: executionId,
                agentName
            });
            window?.logger.log([
                logParam
            ]);
            setRequestLoading(true);
            await taskDetail(executionId);
            setRequestLoading(false);
        }
        setShowEdit(!showEdit);
    };
    const downloadPsdClick = async (executionId)=>{
        //psd下载打点
        const logParam = window?.logger.getParams(window?.logger.EID.COMMON_CLICK, window?.logger.EVENT_TYPE.CLICK, {
            type: "psdDownload",
            executionId: executionId,
            taskId
        });
        window?.logger.log([
            logParam
        ]);
        return true;
    };
    return /*#__PURE__*/ jsx_runtime_.jsx(jsx_runtime_.Fragment, {
        children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
            className: (style_module_default()).prompt,
            children: [
                /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    className: (style_module_default()).promptList,
                    children: [
                        /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                            className: (style_module_default()).promptDeatail,
                            children: [
                                /*#__PURE__*/ jsx_runtime_.jsx(PromptTag/* default */.Z, {
                                    name: item?.agentVersion
                                }),
                                item.replicateFromTaskNo ? /*#__PURE__*/ jsx_runtime_.jsx(components_ShowRetask, {
                                    item: item
                                }) : item.posPrompt || item.textDescription ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
                                    children: [
                                        item?.sdCheckpoint ? /*#__PURE__*/ jsx_runtime_.jsx(PromptTag/* default */.Z, {
                                            name: item.sdCheckpoint
                                        }) : null,
                                        item?.sdSamplingMethod ? /*#__PURE__*/ jsx_runtime_.jsx(PromptTag/* default */.Z, {
                                            name: item.sdSamplingMethod
                                        }) : null,
                                        /*#__PURE__*/ jsx_runtime_.jsx(components_CopyPrompt, {
                                            posPrompt: item?.posPrompt || item.textDescription,
                                            executionId: item?.executionId,
                                            negPrompt: item?.negPrompt
                                        })
                                    ]
                                }) : /*#__PURE__*/ jsx_runtime_.jsx(ShowTemplate/* default */.Z, {
                                    item: item
                                }),
                                item?.waitingCnt ? /*#__PURE__*/ jsx_runtime_.jsx("p", {
                                    className: `ag16 ${(style_module_default()).waitingCnt}`,
                                    children: t("showPrompt.inline", {
                                        waitingCnt: item?.waitingCnt
                                    })
                                }) : null
                            ]
                        }),
                        /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                            children: [
                                /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                                    className: `${(style_module_default()).reeditButton} ag14`,
                                    onClick: ()=>{
                                        editAgain(item.executionId);
                                    },
                                    children: [
                                        /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                            src: "/setting.svg",
                                            alt: "setting",
                                            width: 14,
                                            height: 14,
                                            className: (style_module_default()).setting
                                        }),
                                        /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                            children: t("showPrompt.editAgain")
                                        })
                                    ]
                                }),
                                item?.status === "Success" ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
                                    download: true,
                                    href: `/api/v1/agent/task/downloadPsd?executionId=${item.executionId}`,
                                    className: `${(style_module_default()).reeditButton} ag14`,
                                    onClick: (e)=>{
                                        e.preventDefault();
                                        downloadPsdClick(item.executionId).then((result)=>{
                                            if (result) {
                                                window.open(`${international/* BASE_URL */._n}/v1/agent/task/downloadPsd?executionId=${item.executionId}`, "_blank");
                                            }
                                        });
                                    },
                                    children: [
                                        /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                            src: "/document-download.svg",
                                            alt: "document-download",
                                            width: 14,
                                            height: 14,
                                            className: (style_module_default()).setting
                                        }),
                                        /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                            children: t("showPrompt.downliadPSD")
                                        })
                                    ]
                                }) : null
                            ]
                        })
                    ]
                }),
                /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    className: `ag14 ${(style_module_default()).time}`,
                    children: [
                        /*#__PURE__*/ jsx_runtime_.jsx("span", {
                            className: (style_module_default()).executeSeq,
                            children: t("execution", {
                                executeSeq: item?.executeSeq
                            })
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx("span", {
                            children: item?.executionTime
                        })
                    ]
                })
            ]
        })
    });
};
/* harmony default export */ const components_ShowPrompt = (ShowPrompt);


/***/ }),

/***/ 8761:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8208);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3851);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _PromptTag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2836);





const ShowTemplate = ({ item  })=>{
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().wrap),
        children: [
            item.fashionModelImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                src: item.fashionModelImage || "",
                width: 20,
                height: 20,
                alt: "prompt-icon",
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().icon),
                loader: _common_utils__WEBPACK_IMPORTED_MODULE_1__/* .smallLoader */ .vB
            }) : null,
            item?.tagNames?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_PromptTag__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                name: item?.tagNames?.join("、")
            }) : null,
            item?.locationName ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_PromptTag__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                name: item?.locationName
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShowTemplate);


/***/ }),

/***/ 9777:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9562);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _components_ShowPrompt__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4930);
/* harmony import */ var _hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8502);
/* harmony import */ var _components_InferResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4652);
/* harmony import */ var _components_ListHeader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4988);
/* harmony import */ var _components_BatchTaskProgress__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9842);
/* harmony import */ var _components_InferStar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1200);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_4__, _components_InferResult__WEBPACK_IMPORTED_MODULE_5__, _components_ListHeader__WEBPACK_IMPORTED_MODULE_6__, _components_InferStar__WEBPACK_IMPORTED_MODULE_8__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_4__, _components_InferResult__WEBPACK_IMPORTED_MODULE_5__, _components_ListHeader__WEBPACK_IMPORTED_MODULE_6__, _components_InferStar__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










const ImageList = ()=>{
    const [executeSeq, setExecuteSeq] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
    const [currentPage, setCurrentPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1);
    const [isEnd, setIsEnd] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
    const [batchStartAt, setBatchStartAt] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
    const [executeSummary, setExecuteSummary] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const { inferResult: [inferResult] , taskId: [taskId] , startTaskExecutions: [startTaskExecutions] , inferStarList: [inferStarList, setInferStarList] , inferResult: [, setInferResult]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const currentTaskId = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    const currentStartTaskExecutions = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (executeSeq) {
            // 模拟滚动到列表的指定位置
            const listItem = document.getElementById(`item-${executeSeq}`);
            if (listItem) {
                listItem.scrollIntoView({
                    behavior: "smooth",
                    block: "center",
                    inline: "start"
                });
            }
        }
        setExecuteSeq(0);
    }, [
        executeSeq
    ]);
    const getStartList = async ()=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_4__/* .taskExecutionStars */ .LH)({
            taskId
        });
        setInferStarList(value ?? []);
    };
    // 执行结果轮询
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        let intervalId = null;
        let isRequestCompleted = true;
        let page = currentPage;
        if (currentTaskId.current !== taskId) {
            page = 1;
            setCurrentPage(page);
            currentTaskId.current = taskId;
        }
        const fetchData = async ()=>{
            if (isRequestCompleted && startTaskExecutions && taskId) {
                isRequestCompleted = false;
                try {
                    const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_4__/* .taskExecutions */ .Dl)({
                        taskId,
                        page,
                        requestTaskExecutions: true
                    });
                    setExecuteSummary(value?.executeSummary || "当前执行进度");
                    setInferResult(value?.list || []);
                    setIsEnd(value?.isLastPage || false);
                    setBatchStartAt(value?.batchStartAt);
                    if (value?.clearInterval) {
                        if (intervalId) clearInterval(intervalId);
                    }
                } catch (error) {
                    console.error(error);
                }
                isRequestCompleted = true;
            }
        };
        if (currentStartTaskExecutions.current == startTaskExecutions) {
            fetchData();
        }
        currentStartTaskExecutions.current = startTaskExecutions;
        intervalId = setInterval(fetchData, 2000);
        return ()=>{
            if (intervalId) clearInterval(intervalId);
        };
    }, [
        startTaskExecutions,
        currentPage
    ]);
    const executionClick = (executeSeq, page)=>{
        if (page && page !== currentPage) {
            setCurrentPage(page);
            setTimeout(()=>{
                setExecuteSeq(executeSeq);
            }, 1000);
        } else {
            setExecuteSeq(executeSeq);
        }
    };
    const turnPage = (num)=>{
        const element = document.getElementById("output");
        if (element) element.scrollTop = 0;
        setCurrentPage(num);
        if (num === 1) {
            getStartList();
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ListHeader__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                currentPage: currentPage,
                isEnd: isEnd,
                turnPage: turnPage
            }),
            inferStarList?.length && currentPage === 1 ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_InferStar__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                taskId: taskId ?? "",
                inferStarList: inferStarList,
                setInferStarList: setInferStarList,
                executionClick: executionClick
            }) : null,
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                children: inferResult?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().inferResult),
                    children: inferResult?.map((item, key)=>{
                        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().imageResult),
                            id: `item-${item.executeSeq}`,
                            children: [
                                key === batchStartAt && executeSummary ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_BatchTaskProgress__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                                    executeSummary: executeSummary
                                }) : null,
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ShowPrompt__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                                    item: item
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_InferResult__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                                    item: item
                                })
                            ]
                        }, key);
                    })
                }) : null
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ImageList);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2678:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ components_ManualMask)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: external "antd"
var external_antd_ = __webpack_require__(5725);
// EXTERNAL MODULE: ./src/components/ManualMask/style.module.css
var style_module = __webpack_require__(9899);
var style_module_default = /*#__PURE__*/__webpack_require__.n(style_module);
// EXTERNAL MODULE: ./node_modules/next/image.js
var next_image = __webpack_require__(5675);
var image_default = /*#__PURE__*/__webpack_require__.n(next_image);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
// EXTERNAL MODULE: ./src/components/hooks/createContext.tsx
var createContext = __webpack_require__(2228);
;// CONCATENATED MODULE: ./src/components/ManualMask/constans.ts
const reactSketchCanvasStyle = {
    border: "none",
    borderRadius: "12px"
};
const optionList = [
    {
        svg: "/canvas-rotate-right.svg",
        activeSvg: "",
        text: "清除",
        alt: "canvas rotate right",
        borderRight: false,
        dropDown: false,
        updateColor: false,
        key: "clear"
    },
    {
        svg: "/canvas-back.svg",
        activeSvg: "",
        text: "上一步",
        alt: "canvas back",
        borderRight: false,
        dropDown: false,
        updateColor: false,
        key: "undo"
    },
    {
        svg: "/canvas-next-step.svg",
        activeSvg: "",
        text: "下一步",
        alt: "canvas next step",
        borderRight: true,
        dropDown: false,
        updateColor: false,
        key: "redo"
    },
    // {
    //     'svg': '/canvas-cursor.svg',
    //     'activeSvg': '/canvas-cursor-active.svg',
    //     'text': '移动',
    //     'alt': 'canvas cursor',
    //     'borderRight': false,
    //     'dropDown': false,
    //     'updateColor': true,
    // },
    {
        svg: "/canvas-hand.svg",
        activeSvg: "/canvas-hand-active.svg",
        text: "抓手",
        alt: "canvas hand",
        borderRight: false,
        dropDown: false,
        updateColor: true,
        key: "hand"
    },
    {
        svg: "/canvas-painting-brush.svg",
        activeSvg: "/canvas-painting-brush-active.svg",
        text: "画笔",
        alt: "canvas painting brush",
        borderRight: false,
        dropDown: true,
        updateColor: true,
        dotSvg: "/canvas-solid-dot.svg",
        dotAlt1: "anvas solid big dot",
        dotAlt2: "anvas solid small dot",
        key: "brush"
    },
    {
        svg: "/canvas-eraser.svg",
        activeSvg: "/canvas-eraser-active.svg",
        text: "橡皮",
        alt: "canvas eraser",
        borderRight: true,
        dropDown: true,
        updateColor: true,
        dotSvg: "/canvas-hollow-dot.svg",
        dotAlt1: "anvas hollow big dot",
        dotAlt2: "anvas hollow small dot",
        key: "eraser"
    },
    {
        svg: "/canvas-minus.svg",
        activeSvg: "",
        text: "缩小",
        alt: "canvas minus",
        borderRight: false,
        dropDown: false,
        updateColor: false,
        key: "narrow"
    },
    {
        svg: "/canvas-add.svg",
        activeSvg: "",
        text: "放大",
        alt: "canvas add",
        borderRight: false,
        dropDown: false,
        updateColor: false,
        key: "enlarge"
    }
];

// EXTERNAL MODULE: ./src/components/ManualMask/Circle/style.module.css
var Circle_style_module = __webpack_require__(2172);
var Circle_style_module_default = /*#__PURE__*/__webpack_require__.n(Circle_style_module);
;// CONCATENATED MODULE: ./src/components/ManualMask/Circle/index.tsx



const Circle = ({ width  })=>{
    const [position, setPosition] = (0,external_react_.useState)({
        x: 0,
        y: 0
    });
    const handleMouseMove = (event)=>{
        // 获取需要判断的元素
        const targetElement = document.getElementById("cavansMask");
        if (targetElement) {
            // 判断鼠标位置是否在目标元素内部
            const isInsideTargetElement = targetElement.contains(event.target);
            // 如果鼠标不在目标元素内部，则设置 position 为 null
            if (!isInsideTargetElement) {
                setPosition({
                    x: -100000000,
                    y: -10000000000
                });
                return;
            }
            const rect = targetElement.getBoundingClientRect();
            const scaleX = targetElement.width / rect.width;
            const scaleY = targetElement.height / rect.height;
            setPosition({
                x: (event.clientX - rect.left) * scaleX,
                y: (event.clientY - rect.top) * scaleY
            });
        }
    };
    (0,external_react_.useEffect)(()=>{
        window.addEventListener("mousemove", handleMouseMove);
        return ()=>{
            window.removeEventListener("mousemove", handleMouseMove);
        };
    }, []);
    return /*#__PURE__*/ jsx_runtime_.jsx("div", {
        className: (Circle_style_module_default()).point,
        style: {
            width: `${width}px`,
            height: `${width}px`,
            borderRadius: "50%",
            position: "fixed",
            top: `${position?.y}px`,
            left: `${position?.x}px`
        }
    });
};
/* harmony default export */ const ManualMask_Circle = (Circle);

// EXTERNAL MODULE: ./src/components/Toast/index.tsx
var Toast = __webpack_require__(9204);
// EXTERNAL MODULE: external "next-i18next"
var external_next_i18next_ = __webpack_require__(1377);
;// CONCATENATED MODULE: ./src/components/ManualMask/index.tsx











const ManualMask = ({ isModalOpen , setIsModalOpen , width , height , mask  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult , taskId: [taskId] , segementModal: [, setSegmentModal] , samMask  } = (0,external_react_.useContext)(createContext/* default */.Z);
    const [svgSelected, setSvgSelected] = (0,external_react_.useState)("");
    const [scaleNum, setScaleNum] = (0,external_react_.useState)(100);
    const canvasRef = (0,external_react_.useRef)(null);
    const prevToolRef = (0,external_react_.useRef)("");
    const [canvas, setCanvas] = (0,external_react_.useState)(null);
    const prevCanvasRef = (0,external_react_.useRef)(null);
    const [lineWidth, setLineWidth] = (0,external_react_.useState)(18);
    const historyRef = (0,external_react_.useRef)([]);
    const stepRef = (0,external_react_.useRef)(-1);
    const [canvasPosition, setCanvasPosition] = (0,external_react_.useState)(null);
    (0,external_react_.useEffect)(()=>{
        if (!taskResult.showImage) return;
        const canvas = canvasRef.current;
        if (!canvas) return;
        const ctx = canvas?.getContext("2d");
        canvas.width = width;
        canvas.height = height;
        const img = new Image();
        if (mask) {
            img.src = mask;
            img.onload = ()=>{
                ctx?.drawImage(img, 0, 0);
                prevCanvasRef.current = canvas.toDataURL() // 保存画布初始状态
                ;
                setSvgSelected("brush");
                prevToolRef.current = "brush";
                setCanvas(canvas);
            };
        } else {
            ctx?.clearRect(0, 0, width, height);
            prevCanvasRef.current = canvas.toDataURL() // 保存画布初始状态
            ;
            setCanvas(canvas);
        }
    }, []);
    (0,external_react_.useEffect)(()=>{
        if (!canvas || !(svgSelected === "brush" || svgSelected === "eraser")) return;
        const ctx = canvas.getContext("2d");
        let isDrawing = false;
        const onDrawStart = (e)=>{
            isDrawing = true;
            const value = getRelativeCoords(canvas, e);
            ctx.lineWidth = lineWidth;
            ctx.lineCap = "round";
            ctx.lineJoin = "round";
            ctx.beginPath();
            ctx.moveTo(value.x, value.y);
            draw(value);
        };
        const onDrawing = (e)=>{
            if (isDrawing) {
                window.requestAnimationFrame(()=>{
                    draw(getRelativeCoords(canvas, e));
                });
            }
        };
        const onDrawEnd = ()=>{
            saveSnapshot();
            isDrawing = false;
            ctx.globalCompositeOperation = "source-over";
        };
        const getRelativeCoords = (element, event)=>{
            const rect = element.getBoundingClientRect();
            const scaleX = element.width / rect.width;
            const scaleY = element.height / rect.height;
            return {
                x: (event.clientX - rect.left) * scaleX,
                y: (event.clientY - rect.top) * scaleY
            };
        };
        const draw = (coords)=>{
            if (prevToolRef.current === "brush") {
                ctx.strokeStyle = "rgba(117, 48, 254, 0.5)";
                ctx.lineTo(coords.x, coords.y);
                ctx.stroke();
            } else if (prevToolRef.current === "eraser") {
                ctx.strokeStyle = "#fff";
                ctx.globalCompositeOperation = "destination-out";
                ctx.lineTo(coords.x, coords.y);
                ctx.stroke();
            }
        };
        canvas.addEventListener("mousedown", onDrawStart);
        canvas.addEventListener("mousemove", onDrawing);
        canvas.addEventListener("mouseup", onDrawEnd);
        return ()=>{
            canvas.removeEventListener("mousedown", onDrawStart);
            canvas.removeEventListener("mousemove", onDrawing);
            canvas.removeEventListener("mouseup", onDrawEnd);
        };
    }, [
        canvas,
        svgSelected,
        lineWidth
    ]);
    // 保存快照
    const saveSnapshot = ()=>{
        const snapshot = canvas.toDataURL();
        if (historyRef.current.length && historyRef.current[stepRef.current] === snapshot) return; // 避免重复保存相同状态
        historyRef.current = [
            ...historyRef.current.slice(0, stepRef.current + 1),
            snapshot
        ];
        stepRef.current += 1;
        prevCanvasRef.current = snapshot;
    };
    // 撤销
    const undo = ()=>{
        const canvas = canvasRef.current;
        const ctx = canvas?.getContext("2d");
        if (stepRef.current < 0 || !canvas || !ctx) return;
        const index = stepRef.current - 1;
        stepRef.current = index;
        const img = new Image();
        if (index < 0) {
            if (mask) img.src = mask;
            else {
                ctx?.clearRect(0, 0, canvas.width, canvas.height);
                prevCanvasRef.current = canvas.toDataURL() // 保存画布初始状态
                ;
            }
        } else {
            img.src = historyRef.current[index];
        }
        if (!img.src) return;
        img.onload = ()=>{
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            ctx.drawImage(img, 0, 0);
            prevCanvasRef.current = canvas.toDataURL();
        };
    };
    // 重做
    const redo = ()=>{
        const canvas = canvasRef.current;
        const ctx = canvas?.getContext("2d");
        if (stepRef.current >= historyRef.current.length - 1 || !canvas || !ctx) return;
        stepRef.current += 1;
        const img = new Image();
        img.src = historyRef.current[stepRef.current];
        img.onload = ()=>{
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            ctx.drawImage(img, 0, 0);
            prevCanvasRef.current = canvas.toDataURL();
        };
    };
    // 清除
    const clear = ()=>{
        const canvas = canvasRef.current;
        const ctx = canvas?.getContext("2d");
        if (!canvas || !ctx) return;
        const img = new Image();
        if (mask) {
            img.src = mask;
            img.onload = ()=>{
                ctx.clearRect(0, 0, canvas?.width, canvas?.height);
                ctx.drawImage(img, 0, 0);
                prevCanvasRef.current = canvas.toDataURL();
            };
        } else {
            ctx?.clearRect(0, 0, canvas.width, canvas.height);
            prevCanvasRef.current = canvas.toDataURL() // 保存画布初始状态
            ;
        }
    };
    // 橡皮擦和画笔的切换
    const handleSwitchTool = (value)=>{
        prevToolRef.current = value;
    };
    // 更新选中图标的颜色
    const updateSvgColor = (key)=>{
        setSvgSelected(key === svgSelected ? "" : key);
    };
    // 操作栏
    const opreate = (key)=>{
        switch(key){
            case "enlarge":
                upScale();
                break;
            case "narrow":
                downScale();
                break;
            case "brush":
                handleSwitchTool(key);
                break;
            case "eraser":
                handleSwitchTool(key);
                break;
            case "undo":
                undo();
                break;
            case "redo":
                redo();
                break;
            case "clear":
                clear();
                break;
        }
    };
    // 放大
    const upScale = ()=>{
        if (scaleNum < 500) {
            setScaleNum((prevScaleNum)=>{
                if (prevScaleNum >= 200) return prevScaleNum + 100;
                if (prevScaleNum >= 100) return prevScaleNum + 25;
                return prevScaleNum + 10;
            });
        }
    };
    // 缩小
    const downScale = ()=>{
        if (scaleNum > 20) {
            setScaleNum((prevScaleNum)=>prevScaleNum > 200 ? prevScaleNum - 100 : prevScaleNum > 100 ? prevScaleNum - 25 : prevScaleNum - 10);
        }
    };
    // 操作点击
    const onDivClick = (key, index)=>{
        if (optionList[index]?.activeSvg !== "") {
            updateSvgColor(key);
        }
        opreate(key);
    };
    // 设置画笔大小
    const sliderOnChange = (value)=>{
        setLineWidth(value);
    };
    const submit = ()=>{
        const logParam = window?.logger.getParams("100000010", window?.logger.EVENT_TYPE.CLICK, {
            taskId,
            type: 1
        });
        window?.logger.log([
            logParam
        ]);
        const ctx = canvas?.getContext("2d");
        const imageData = ctx?.getImageData(0, 0, canvas.width, canvas.height);
        let hasNonEmptyPixels = false;
        // 遍历每个像素，检查RGBA值是否为0
        for(let i = 0; i < imageData?.data?.length; i += 4){
            const r = imageData.data[i];
            const g = imageData.data[i + 1];
            const b = imageData.data[i + 2];
            const a = imageData.data[i + 3];
            if (r !== 0 || g !== 0 || b !== 0 || a !== 0) {
                hasNonEmptyPixels = true;
                break;
            }
        }
        if (hasNonEmptyPixels) {
            const maskImg = canvas.toDataURL();
            // 需要手动调用mask接口保存
            handleTaskResult("mask", maskImg, true);
            samMask(maskImg);
            setIsModalOpen(false);
            setSegmentModal(false);
        } else {
            (0,Toast/* default */.Z)({
                message: t("toast.keepSelect"),
                duration: 3000
            });
            return;
        }
    };
    function handleCanvasMouseDown(event) {
        if (svgSelected !== "hand") return;
        const element = document.getElementById("maskParent");
        const canvasRect = element?.getBoundingClientRect();
        if (!canvasRect) return;
        const mouseX = event.clientX - canvasRect.left;
        const mouseY = event.clientY - canvasRect.top;
        const canvasX = element?.offsetLeft || 0;
        const canvasY = element?.offsetTop || 0;
        // 计算缩放后的坐标
        const scaleX = 1 / (scaleNum / 100);
        const scaleY = 1 / (scaleNum / 100);
        const offsetX = mouseX * scaleX - canvasX;
        const offsetY = mouseY * scaleY - canvasY;
        function handleMouseMove(event) {
            if (!canvasRect) return;
            const newMouseX = event.clientX - canvasRect.left;
            const newMouseY = event.clientY - canvasRect.top;
            // 计算缩放后的坐标
            const newX = newMouseX * scaleX - offsetX;
            const newY = newMouseY * scaleY - offsetY;
            setCanvasPosition({
                x: newX,
                y: newY
            });
        }
        function handleMouseUp() {
            document.removeEventListener("mousemove", handleMouseMove);
            document.removeEventListener("mouseup", handleMouseUp);
        }
        document.addEventListener("mousemove", handleMouseMove);
        document.addEventListener("mouseup", handleMouseUp);
    }
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)(external_antd_.Modal, {
        open: isModalOpen,
        width: `100%`,
        footer: false,
        closable: false,
        className: (style_module_default()).canvas,
        style: {
            top: 0,
            padding: 0,
            margin: 0,
            maxWidth: "100%"
        },
        children: [
            svgSelected === "brush" || svgSelected === "eraser" ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: svgSelected === "brush" ? `${(style_module_default()).sliderContent} ${(style_module_default()).sliderBrush}` : `${(style_module_default()).sliderContent} ${(style_module_default()).sliderEraser}`,
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                        src: svgSelected === "brush" ? "/canvas-solid-dot.svg" : "/canvas-hollow-dot.svg",
                        width: 16,
                        height: 16,
                        alt: "canvas icon",
                        className: (style_module_default()).solidBigDot
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx(external_antd_.Slider, {
                        min: 1,
                        max: 100,
                        vertical: true,
                        value: lineWidth,
                        onChange: sliderOnChange
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                        src: svgSelected === "brush" ? "/canvas-solid-dot.svg" : "/canvas-hollow-dot.svg",
                        width: 12,
                        height: 12,
                        alt: "canvas icon",
                        className: (style_module_default()).solidSmallDot
                    })
                ]
            }) : null,
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: (style_module_default()).canvasOption,
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (style_module_default()).canvasOptionLeft,
                        children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                            className: (style_module_default()).canvasOptionDetail,
                            onClick: ()=>{
                                const logParam = window?.logger.getParams("100000010", window?.logger.EVENT_TYPE.CLICK, {
                                    taskId,
                                    type: 0
                                });
                                window?.logger.log([
                                    logParam
                                ]);
                                setIsModalOpen(false);
                            },
                            children: [
                                /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                    src: "/canvas-close.svg",
                                    width: 24,
                                    height: 24,
                                    alt: "canvas close"
                                }),
                                /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                    className: `${(style_module_default()).canvasOptionText} ag16`,
                                    children: t("manual.cancel")
                                })
                            ]
                        })
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (style_module_default()).canvasOptionCenter,
                        children: optionList.map((item, index)=>/*#__PURE__*/ (0,jsx_runtime_.jsxs)((external_react_default()).Fragment, {
                                children: [
                                    /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                                        className: `ag16 ${(style_module_default()).canvasOptionDetail} 
                                ${svgSelected === item.key ? (style_module_default()).optionActiveColor : (style_module_default()).optionDefaultColor}`,
                                        onClick: ()=>{
                                            onDivClick(item.key, index);
                                        },
                                        children: [
                                            /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                                src: svgSelected === item.key ? item.activeSvg : item.svg,
                                                width: 24,
                                                height: 24,
                                                alt: item.alt
                                            }),
                                            /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                                className: (style_module_default()).canvasOptionTextRight,
                                                children: t("manual", {
                                                    returnObjects: true
                                                })[item.key]
                                            }),
                                            item.dropDown && /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                                src: svgSelected === item.key ? `/canvas-drop-down-active.svg` : `/canvas-drop-down.svg`,
                                                width: 16,
                                                height: 16,
                                                alt: "canvas drop down"
                                            })
                                        ]
                                    }),
                                    item.borderRight && /*#__PURE__*/ jsx_runtime_.jsx("div", {
                                        className: (style_module_default()).optionBorderRight
                                    }),
                                    index === optionList.length - 2 && /*#__PURE__*/ jsx_runtime_.jsx("div", {
                                        className: (style_module_default()).optionScaleText,
                                        children: `${scaleNum}%`
                                    })
                                ]
                            }, index))
                    }),
                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (style_module_default()).canvasOptionRight,
                        children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                            className: (style_module_default()).canvasOptionDetail,
                            onClick: ()=>{
                                submit();
                            },
                            children: [
                                /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                    src: "/canvas-success.svg",
                                    width: 24,
                                    height: 24,
                                    alt: "canvas success"
                                }),
                                /*#__PURE__*/ jsx_runtime_.jsx("span", {
                                    className: `${(style_module_default()).canvasOptionText} ag16`,
                                    children: t("manual.done")
                                })
                            ]
                        })
                    })
                ]
            }),
            /*#__PURE__*/ jsx_runtime_.jsx("div", {
                className: `${(style_module_default()).canvasTip} ag20`,
                children: t("manual.title")
            }),
            /*#__PURE__*/ jsx_runtime_.jsx("div", {
                className: (style_module_default()).manualMask,
                style: {
                    height: canvas?.height + "px"
                },
                children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                    className: `${svgSelected === "hand" && (style_module_default()).userSelect} ${(style_module_default()).canvasMask}`,
                    id: "maskParent",
                    style: {
                        width: canvas?.width + "px",
                        height: canvas?.height + "px",
                        transform: `scale(${scaleNum / 100})`,
                        cursor: svgSelected === "hand" ? "grab" : "",
                        left: canvasPosition?.x,
                        top: canvasPosition?.y
                    },
                    onMouseDown: handleCanvasMouseDown,
                    children: [
                        /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                            width: 300,
                            height: 300,
                            src: taskResult.showImage || "",
                            alt: "originImag",
                            className: (style_module_default()).showImage,
                            unoptimized: true
                        }),
                        /*#__PURE__*/ jsx_runtime_.jsx("canvas", {
                            ref: canvasRef,
                            className: (style_module_default()).canvas,
                            id: "cavansMask"
                        }),
                        svgSelected === "brush" || svgSelected === "eraser" ? /*#__PURE__*/ jsx_runtime_.jsx(ManualMask_Circle, {
                            width: lineWidth
                        }) : null
                    ]
                })
            })
        ]
    });
};
/* harmony default export */ const components_ManualMask = (ManualMask);


/***/ }),

/***/ 9929:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _CustomLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3962);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6018);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3413);






const Mobile = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("common");
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().mobile),
        children: _common_constans_international__WEBPACK_IMPORTED_MODULE_4__/* .IS_LOCAL */ .Kc ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().mobileContent),
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                    src: "/mobile.svg",
                    alt: "bg-image",
                    width: 120,
                    height: 120,
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().mobileLogo),
                    unoptimized: true
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                    className: `ag24 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().mobileText)}`,
                    children: "请在桌面浏览器上打开"
                })
            ]
        }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                    src: _common_constans_international__WEBPACK_IMPORTED_MODULE_4__/* .MOBEIL_IMAGE */ .q6,
                    alt: "bg-image",
                    width: 375,
                    height: 523,
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().mobileIcon),
                    unoptimized: true
                }),
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
                    className: `ag24 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().tips)}`,
                    children: [
                        t("pcHint1"),
                        " ",
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}),
                        t("pcHint2")
                    ]
                }),
                _common_constans_international__WEBPACK_IMPORTED_MODULE_4__/* .IS_CN */ .RD ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: `ag16 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().international)}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                            children: "中国港澳台地区和海外用户请访问"
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_CustomLink__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                            href: "https://www.weshop.ai/",
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().primaryColor),
                                children: "www.weshop.ai"
                            })
                        })
                    ]
                }) : null
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Mobile);


/***/ }),

/***/ 7428:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2273);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);




const CustomModal = ({ isModalOpen , setIsModalOpen , title , children , width , className  })=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Modal, {
        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().payModal)} ${className}`,
        width: width,
        open: isModalOpen,
        footer: null,
        centered: true,
        closable: false,
        maskClosable: true,
        onCancel: ()=>{
            setIsModalOpen(false);
        },
        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().modalWrap),
            children: [
                title ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: `ag18 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().modalTitle)}`,
                    children: [
                        title,
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                            src: "/modal-close.svg",
                            width: 18,
                            height: 18,
                            alt: "close",
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().closeModalIcon),
                            onClick: ()=>{
                                setIsModalOpen(false);
                            }
                        })
                    ]
                }) : null,
                children
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomModal);


/***/ }),

/***/ 3028:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2198);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2228);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1653);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_4__);






const AgentTips = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)("common");
    const { agentName: [agentName]  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z);
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: agentName && _common_constans__WEBPACK_IMPORTED_MODULE_3__/* .DEFAULT_AGENT_TIPS */ .Sg[agentName] ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().groupTips),
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: `ag18 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().title)}`,
                    children: t("scene", {
                        returnObjects: true
                    })[agentName].name
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: `ag12 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().subTitle)}`,
                    children: t("scene", {
                        returnObjects: true
                    })[agentName].subTitle
                })
            ]
        }) : null
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AgentTips);


/***/ }),

/***/ 9829:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ components_Agent)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: ./src/common/constans/international.ts + 2 modules
var international = __webpack_require__(3413);
// EXTERNAL MODULE: ./src/components/Nav/components/Agent/style.module.css
var style_module = __webpack_require__(7732);
var style_module_default = /*#__PURE__*/__webpack_require__.n(style_module);
// EXTERNAL MODULE: ./src/components/hooks/createContext.tsx
var createContext = __webpack_require__(2228);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
// EXTERNAL MODULE: ./node_modules/next/image.js
var next_image = __webpack_require__(5675);
var image_default = /*#__PURE__*/__webpack_require__.n(next_image);
// EXTERNAL MODULE: ./src/components/Nav/components/Agent/AgentItem/style.module.css
var AgentItem_style_module = __webpack_require__(3610);
var AgentItem_style_module_default = /*#__PURE__*/__webpack_require__.n(AgentItem_style_module);
// EXTERNAL MODULE: external "next-i18next"
var external_next_i18next_ = __webpack_require__(1377);
;// CONCATENATED MODULE: ./src/components/Nav/components/Agent/AgentItem/index.tsx






const AgentItem = ({ item  })=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("common");
    const { agentName: [agentName, setAgentName] , inferResult: [, setInferResult] , inferStarList: [, setInferStarList] , taskId: [, setTaskId]  } = (0,external_react_.useContext)(createContext/* default */.Z);
    const [dot, setDot] = (0,external_react_.useState)(false);
    (0,external_react_.useEffect)(()=>{
        if (item.needDot) {
            if (localStorage.getItem(`agent-${item.key}-clicked`)) {
                setDot(false);
            } else {
                setDot(true);
            }
        }
    }, [
        item.needDot
    ]);
    const dotHide = ()=>{
        if (item.needDot) {
            localStorage.setItem(`agent-${item.key}-clicked`, "true");
            setDot(false);
        }
    };
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        className: (AgentItem_style_module_default()).tabsWrap,
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx("span", {
                className: `${(AgentItem_style_module_default()).border} ${agentName === item.key && (AgentItem_style_module_default()).active}`
            }),
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: `${(AgentItem_style_module_default()).tabsItem} ag12`,
                onClick: async ()=>{
                    dotHide();
                    try {
                        const logParam = window?.logger.getParams(window?.logger.EID.COMMON_CLICK, window?.logger.EVENT_TYPE.CLICK, {
                            type: "setAgentName",
                            group: item.key
                        });
                        window?.logger.log([
                            logParam
                        ]);
                        setAgentName(item.key);
                        setTaskId(null);
                        setInferResult([]);
                        setInferStarList([]);
                    } catch (error) {
                        console.log(error);
                    } finally{}
                },
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                        src: item.icon || "",
                        width: 48,
                        height: 48,
                        alt: "icon",
                        className: `${(AgentItem_style_module_default()).tabIcon} ${agentName === item.key && (AgentItem_style_module_default()).activeGroup}`
                    }),
                    t("scene", {
                        returnObjects: true
                    })[item.key].simple,
                    item.beta ? /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (AgentItem_style_module_default()).beta,
                        children: "公测"
                    }) : null,
                    item.floatIcon ? /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                        className: (AgentItem_style_module_default()).floatIcon,
                        src: item.floatIcon,
                        height: 16,
                        width: 16,
                        alt: "icon"
                    }) : null,
                    dot ? /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (AgentItem_style_module_default()).dot
                    }) : null
                ]
            })
        ]
    });
};
/* harmony default export */ const Agent_AgentItem = (AgentItem);

;// CONCATENATED MODULE: ./src/components/Nav/components/Agent/index.tsx







const Agent = ()=>{
    const { userInfos: [userInfos]  } = (0,external_react_.useContext)(createContext/* default */.Z);
    const [list, setList] = (0,external_react_.useState)(international/* AGENT_LIST */.WM);
    (0,external_react_.useEffect)(()=>{
        if (userInfos?.uid) {
            // 本地版本不包含以下group
            if (international/* IS_LOCAL */.Kc) return;
            const arr = [];
            if (userInfos?.accessoryAccess) {
                arr.push({
                    key: "accessory",
                    icon: "/jewelry.png",
                    beta: true
                });
            }
            const updatedList = [
                ...international/* AGENT_LIST */.WM,
                ...arr
            ];
            setList(updatedList);
        }
    }, [
        userInfos
    ]);
    const tabTop = list.filter((it)=>!it.bottom);
    const tabBottom = list.filter((it)=>it.bottom);
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        className: (style_module_default()).tabsContent,
        children: [
            international/* IS_LOCAL */.Kc ? null : /*#__PURE__*/ jsx_runtime_.jsx("div", {
                className: (style_module_default()).tabsTop,
                children: tabTop.map((item, index)=>{
                    return /*#__PURE__*/ jsx_runtime_.jsx(Agent_AgentItem, {
                        item: item
                    }, index);
                })
            }),
            tabBottom.length && (!international/* IS_CN */.RD || userInfos?.isPlanPaidUser || international/* IS_LOCAL */.Kc) ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: (style_module_default()).tabBottom,
                children: [
                    international/* IS_LOCAL */.Kc ? null : /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (style_module_default()).bottomDivider
                    }),
                    tabBottom.map((item, index)=>{
                        return /*#__PURE__*/ jsx_runtime_.jsx(Agent_AgentItem, {
                            item: item
                        }, index);
                    })
                ]
            }) : null
        ]
    });
};
/* harmony default export */ const components_Agent = (Agent);


/***/ }),

/***/ 5849:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3658);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8502);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_5__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_4__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];







const versionList = [
    {
        key: "v1.5",
        value: "v1.5"
    },
    {
        key: "v1.0",
        value: "v1.0"
    }
];
const AgentVersionSelect = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)("studio");
    const { taskResult: [taskResult, setTaskResult] , userInfos: [userInfos, setUserInfos] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [showAgentVersion, setShowAgentVersion] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const agentVersionRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        const handleClickOutside = (event)=>{
            const target = event.target;
            if (agentVersionRef.current && !agentVersionRef.current.contains(target)) {
                setShowAgentVersion(false);
            }
        };
        document.addEventListener("mousedown", handleClickOutside);
        return ()=>{
            document.removeEventListener("mousedown", handleClickOutside);
        };
    }, [
        agentVersionRef
    ]);
    const changeAgentVersion = async (item)=>{
        if (taskResult.paramType === "template") {
            setTaskResult({
                ...taskResult,
                fashionModelId: 0,
                locationId: 0,
                tagIds: []
            });
        }
        handleTaskResult("agentVersion", item.key);
        setShowAgentVersion(false);
        const data = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_4__/* .setDefaultAgentVersion */ .rW)({
            agentVersion: item.key
        });
        if (data) {
            setUserInfos({
                ...userInfos,
                agentVersion: item.key
            });
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().agentVersion),
        onClick: ()=>{
            setShowAgentVersion(true);
        },
        ref: agentVersionRef,
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                src: "/agentVersion.svg",
                alt: "agentVersion",
                width: 20,
                height: 20
            }),
            showAgentVersion ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().batchWrap),
                children: versionList?.map((item, key)=>{
                    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().batchItem)} ${taskResult?.agentVersion === item.key ? (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().activeKey) : ""}`,
                        onClick: (e)=>{
                            e.stopPropagation();
                            changeAgentVersion(item);
                        },
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                children: item.value
                            }),
                            (userInfos?.agentVersion ? userInfos.agentVersion : "v1.5") === item.key ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().itemDefault),
                                children: t("default")
                            }) : null
                        ]
                    }, key);
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AgentVersionSelect);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 6029:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4662);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3413);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2228);







const BatchPowerDetail = ()=>{
    const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
    const currentRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        const handleClickOutside = (event)=>{
            const target = event.target;
            if (currentRef.current && !currentRef.current.contains(target)) {
                setOpen(false);
            }
        };
        document.addEventListener("mousedown", handleClickOutside);
        return ()=>{
            document.removeEventListener("mousedown", handleClickOutside);
        };
    }, [
        currentRef
    ]);
    const { taskResult: [taskResult] , handleTaskResult , batchTaskPowerDetail: [batchTaskPowerDetail]  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().detail)}`,
                onClick: ()=>{
                    setOpen(!open);
                },
                children: [
                    _common_constans_international__WEBPACK_IMPORTED_MODULE_1__/* .POWER_DETAIL */ .aV,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                        src: "./drop_down_active.svg",
                        alt: "drop-down",
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().icon)} ${open ? (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().open) : ""}`,
                        width: 14,
                        height: 14
                    })
                ]
            }),
            open ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().content),
                ref: currentRef,
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().head),
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: `ag18 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().title)}`,
                                children: _common_constans_international__WEBPACK_IMPORTED_MODULE_1__/* .POWER_DETAIL */ .aV
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                src: "/modal-close.svg",
                                width: 18,
                                height: 18,
                                alt: "close",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().closeModalIcon),
                                onClick: ()=>{
                                    setOpen(false);
                                }
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().list),
                        children: [
                            _common_constans_international__WEBPACK_IMPORTED_MODULE_1__/* .POWER_DETAIL_LIST */ .y2?.map((item, key)=>{
                                return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().item)}`,
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().label),
                                            children: item.label
                                        }),
                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().value)} ${item.powerNum ? (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().primaryColor) : ""}`,
                                            children: [
                                                item.key === "totalExecuteCnt" ? `${batchTaskPowerDetail.checkPointCnt} * ${batchTaskPowerDetail.sdSamplingMethodCnt} * ${batchTaskPowerDetail.posPromptCnt} = ` : null,
                                                item.key === "totalExecutePowerConsume" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().totalPower),
                                                    children: `${batchTaskPowerDetail.totalExecuteCnt} * ${batchTaskPowerDetail.perExecutePowerConsume} = `
                                                }) : null,
                                                item.powerNum ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                    src: "/cpu-charge.svg",
                                                    width: 20,
                                                    height: 20,
                                                    alt: "cpu-charge",
                                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().cpuCharge)
                                                }) : null,
                                                batchTaskPowerDetail[item.key]
                                            ]
                                        })
                                    ]
                                }, key);
                            }),
                            _common_constans_international__WEBPACK_IMPORTED_MODULE_1__/* .SECHEDUCLE_STRATEGY */ .KG?.map((item, index)=>{
                                return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().methodItem)}`,
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_4__.Radio, {
                                        checked: item.key === taskResult?.scheduleStrategy,
                                        onChange: ()=>{
                                            handleTaskResult("scheduleStrategy", item.key);
                                        },
                                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().methodLable),
                                            children: item.label
                                        })
                                    })
                                }, index);
                            })
                        ]
                    })
                ]
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BatchPowerDetail);


/***/ }),

/***/ 1060:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(9225);
/* harmony import */ var _styles_module_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_styles_module_css__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1653);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _OriginImgDiff__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(181);
/* harmony import */ var _TextDescription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5134);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _Retask__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3887);
/* harmony import */ var _EditImage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3275);
/* harmony import */ var _TextPrompt__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2761);
/* harmony import */ var _Template__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(9973);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2228);
/* harmony import */ var _Replicate__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(2738);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Retask__WEBPACK_IMPORTED_MODULE_7__, _EditImage__WEBPACK_IMPORTED_MODULE_8__, _TextPrompt__WEBPACK_IMPORTED_MODULE_9__, _Template__WEBPACK_IMPORTED_MODULE_10__, _Replicate__WEBPACK_IMPORTED_MODULE_12__]);
([_Retask__WEBPACK_IMPORTED_MODULE_7__, _EditImage__WEBPACK_IMPORTED_MODULE_8__, _TextPrompt__WEBPACK_IMPORTED_MODULE_9__, _Template__WEBPACK_IMPORTED_MODULE_10__, _Replicate__WEBPACK_IMPORTED_MODULE_12__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);














const CommonTask = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const { taskResult: [taskResult] , agentName: [agentName] , handleTaskResult , taskId: [taskId]  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z);
    const [contentMinHeight, setContentMinHeight] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(0);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        const updateComponentHeight = ()=>{
            const parent = document.getElementById("myEdit");
            const tabs = document.getElementById("tabs");
            const opreate = document.getElementById("opreate");
            if (parent && tabs && opreate) {
                const minHeight = parent.offsetHeight - tabs.offsetHeight - opreate.offsetHeight - 36 //这个值试出来的。。
                ;
                setContentMinHeight(minHeight < 0 ? 0 : minHeight);
            }
        };
        updateComponentHeight();
        window.addEventListener("resize", updateComponentHeight);
        return ()=>{
            window.removeEventListener("resize", updateComponentHeight);
        };
    }, []);
    const promptTypes = _common_constans__WEBPACK_IMPORTED_MODULE_1__/* .PROMPT_TYPE.map */ .ZK.map((item)=>{
        return {
            key: item.key,
            label: t("paramType", {
                returnObjects: true
            })[item.key]
        };
    });
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            agentName === "replicate" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Replicate__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {}) : null,
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_EditImage__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                isSDImg: false
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_13___default().promptContent),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_styles_module_css__WEBPACK_IMPORTED_MODULE_13___default().tabsContent),
                        id: "tabs",
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_2__.Tabs, {
                            activeKey: taskResult.paramType,
                            items: promptTypes.filter((item)=>{
                                return item.key !== "replicate";
                            }),
                            onChange: (value)=>{
                                const logParam = window?.logger.getParams("10000003", window?.logger.EVENT_TYPE.CLICK, {
                                    taskId,
                                    agentName,
                                    type: value
                                });
                                window?.logger.log([
                                    logParam
                                ]);
                                handleTaskResult("paramType", value);
                            }
                        })
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        style: {
                            minHeight: contentMinHeight + "px"
                        },
                        children: taskResult.paramType === "prompt" ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_OriginImgDiff__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {}),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_TextPrompt__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {})
                            ]
                        }) : taskResult?.paramType === "textDescription" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_TextDescription__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {}) : taskResult?.paramType === "replicate" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Retask__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {}) : taskResult?.paramType === "template" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Template__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
                            agentName: agentName === "replicate" ? taskResult.replicateFromTaskAgentName ?? "" : agentName
                        }) : null
                    })
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CommonTask);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3275:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7419);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var _UploadImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1609);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _EditMask__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8613);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _components_Ground_InterrogateButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2175);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_EditMask__WEBPACK_IMPORTED_MODULE_6__]);
_EditMask__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];










const EditImage = ({ isSDImg , maskNeed =false , maskNeedChange =()=>{
    console.info("");
} , beforeUploading =()=>{
    console.info("");
}  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_7__.useTranslation)("studio");
    const { taskResult: [taskResult]  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [uploadingMain, setUploadingMain] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [uploadingMask, setUploadingMask] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().maskWrap)}`,
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_5__.Spin, {
                spinning: uploadingMain,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().maskItem)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().editMask)}`,
                    children: [
                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().mask),
                            children: [
                                taskResult?.showImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                    src: taskResult?.showImage,
                                    width: 384,
                                    height: 384,
                                    alt: "originImage",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().originImage),
                                    unoptimized: true
                                }, taskResult?.showImage) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_UploadImage__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                    setUploading: setUploadingMain,
                                    beforeUploading: beforeUploading
                                }),
                                isSDImg ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Ground_InterrogateButton__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {}) : null
                            ]
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: t("editMask.original")
                        })
                    ]
                })
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_5__.Spin, {
                spinning: uploadingMask,
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().maskItem),
                    children: !isSDImg || maskNeed ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_EditMask__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                        setUploadingMask: setUploadingMask,
                        showDisable: isSDImg,
                        disableEdit: ()=>maskNeedChange(false)
                    }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().maskNeed),
                        onClick: ()=>{
                            maskNeedChange(!maskNeed);
                        },
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                src: "/mask_add.svg",
                                width: 24,
                                height: 24,
                                alt: "addMask"
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().maskNeedText)} ag16`,
                                children: t("sd.inpaint")
                            })
                        ]
                    })
                })
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditImage);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8613:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2989);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var _components_NewGenerateMask_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8651);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8208);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9204);
/* harmony import */ var _UploadMask__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3164);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8502);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1653);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_NewGenerateMask_index__WEBPACK_IMPORTED_MODULE_4__, _pages_api_base__WEBPACK_IMPORTED_MODULE_8__]);
([_components_NewGenerateMask_index__WEBPACK_IMPORTED_MODULE_4__, _pages_api_base__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);













const EditMask = ({ setUploadingMask , showDisable =false , disableEdit =()=>{
    console.info("");
}  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_7__.useTranslation)("studio");
    const { agentName: [agentName] , showEdit: [showEdit] , taskId: [taskId] , taskResult: [taskResult] , segementModal: [segementModal, setSegmentModal] , mainCutMask: [, setMainCutMask] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [iWidth, setIwidth] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0);
    const [iHeight, setIheight] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0);
    const [imageData, setImageData] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    const [mainCutImageData, setMainCutImageData] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)({
        taskId: ""
    });
    const [btnStatus, setBtnStatus] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
    const [btnAtrr, setBtnAtrr] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)({
        icon: "/loading.svg",
        text: t("editMask.selectionLoading"),
        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().loading)}`,
        imageClassName: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editIcon)} progressLoading`
    });
    const isMainCut = _common_constans__WEBPACK_IMPORTED_MODULE_10__/* .MAIN_CUT_AGENT.includes */ .Q8.includes(agentName);
    const [key, setKey] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [flag, setFlag] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(true);
    const [mainCutLoading, setMainCutLoading] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [startSegement, setStartSegement] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [currentTaskId, setCurrentTaskId] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
    const handleEdit = async ()=>{
        // 编辑选区打点
        const logParam = window?.logger.getParams("10000005", window?.logger.EVENT_TYPE.CLICK, {
            taskId,
            agentName,
            type: 1
        });
        window?.logger.log([
            logParam
        ]);
        if (!imageData || !taskResult?.showImage || btnStatus !== "Success" || currentTaskId !== taskResult?.taskId) return;
        const { width , height  } = await (0,_common_utils__WEBPACK_IMPORTED_MODULE_5__/* .loadImage */ .po)(taskResult?.showImage);
        if (width && height) {
            setIheight(height);
            setIwidth(width);
            setSegmentModal(true);
        } else {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                message: t("toast.modelDownloadFail")
            });
        }
    };
    const reload = async ()=>{
        if (btnStatus !== "Success" && flag) {
            await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_8__/* .updateSegment */ .uG)({
                image: taskResult.showImage || "",
                taskId
            });
            setKey(!key);
            setFlag(false);
        }
    };
    const getMaskData = async (intervalId)=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_8__/* .getSegement */ .Kf)({
            taskId,
            image: taskResult?.showImage || "",
            noShowToast: true
        });
        if (value) {
            setImageData(JSON.parse(value.data));
            setBtnStatus(value.status);
            setCurrentTaskId(value.taskId);
            if (intervalId) {
                setFlag(true);
                if (value.status !== "Segmenting") clearInterval(intervalId);
            }
        }
    };
    const mainCutData = async (intervalId)=>{
        setMainCutLoading(true);
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_8__/* .getBodySegment */ .Eb)({
            taskId,
            image: taskResult?.showImage || "",
            noShowToast: true
        });
        setMainCutImageData(value);
        if (value?.base64Mask) {
            if (value?.taskId === taskResult?.taskId && !taskResult?.mask) {
                // 主体分割的mask无需保存
                handleTaskResult("mask", value.base64Mask, true);
                setMainCutMask(value.base64Mask);
            }
        } else if (value?.status === "Closed" && !taskResult?.mask) {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                message: t("toast.mainError")
            });
        }
        if (value.status !== "Segmenting") {
            if (intervalId) clearInterval(intervalId);
            setMainCutLoading(false);
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        if (isMainCut) handleEdit();
        if (btnStatus === "Success" || btnStatus === "Default") {
            btnAtrr.className = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().successBtn)}`;
            btnAtrr.text = t("editMask.selectionEdit");
            btnAtrr.icon = "/edit-2.svg";
            btnAtrr.imageClassName = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editIcon)}`;
        } else if (btnStatus === "OutOfDate" || btnStatus === "Error") {
            btnAtrr.className = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().successBtn)}`;
            btnAtrr.text = t("editMask.selectionRefresh");
            btnAtrr.icon = "/refresh.svg";
            btnAtrr.imageClassName = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editIcon)}`;
        } else if (btnStatus === "Segmenting") {
            btnAtrr.className = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().loading)}`;
            btnAtrr.text = t("editMask.selectionLoading");
            btnAtrr.icon = "/loading.svg";
            btnAtrr.imageClassName = `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().loadingIcon)} progressLoading`;
        }
        setBtnAtrr({
            ...btnAtrr
        });
    }, [
        btnStatus
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        if (startSegement || !isMainCut || taskResult?.segmentStatus === "Segmenting") {
            setBtnStatus("");
            setImageData([]);
            let isRequestCompleted = true;
            const fetchMaskData = async (intervalId)=>{
                try {
                    if (startSegement) setStartSegement(false);
                    await getMaskData(intervalId);
                } catch (error) {
                    console.error(error);
                }
                isRequestCompleted = true;
            };
            if (showEdit && taskResult?.showImage && taskId) {
                isRequestCompleted = false;
                fetchMaskData(null);
                const intervalId1 = setInterval(()=>{
                    if (isRequestCompleted) {
                        isRequestCompleted = false;
                        fetchMaskData(intervalId1);
                    }
                }, 2000);
                return ()=>clearInterval(intervalId1);
            }
        }
    }, [
        taskResult?.showImage,
        key,
        showEdit
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        if (!(startSegement || !isMainCut)) {
            setBtnStatus("Default");
            let isMainCutRequestCompleted = true;
            const fetchMainCutMaskData = async (intervalId)=>{
                try {
                    await mainCutData(intervalId);
                } catch (error) {
                    console.error(error);
                }
                isMainCutRequestCompleted = true;
            };
            if (showEdit && taskResult?.showImage && taskId) {
                isMainCutRequestCompleted = false;
                fetchMainCutMaskData(null);
                const intervalId2 = setInterval(()=>{
                    if (isMainCutRequestCompleted) {
                        isMainCutRequestCompleted = false;
                        fetchMainCutMaskData(intervalId2);
                    }
                }, 2000);
                return ()=>clearInterval(intervalId2);
            }
        }
    }, [
        taskResult?.showImage,
        showEdit
    ]);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            taskResult?.mask ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().maskBg),
                children: [
                    taskResult?.showImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                        src: taskResult?.showImage,
                        alt: "origin",
                        width: 384,
                        height: 384,
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().originImag),
                        unoptimized: true
                    }, taskResult?.showImage) : null,
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                        src: taskResult?.mask,
                        alt: "edit",
                        width: 384,
                        height: 384,
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().maskImg),
                        unoptimized: true
                    })
                ]
            }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().empty),
                children: taskResult.image ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editEmpty),
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                        children: mainCutLoading ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_9__.Spin, {
                                spinning: mainCutLoading,
                                size: "large",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editEmptySpin)
                            })
                        }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                    src: "/gallery-tick.svg",
                                    alt: "edit",
                                    width: 24,
                                    height: 24
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editTitle),
                                    children: t("editMask.editSelection")
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editSubTitle)} ag14`,
                                    children: showDisable ? t("editMask.editSelectionHint2") : t("editMask.editSelectionHint")
                                })
                            ]
                        })
                    })
                }) : null
            }),
            taskResult.image ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editAndUpload)}`,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    onClick: ()=>{
                        if (btnStatus === "Success") {
                            handleEdit();
                        } else if (btnStatus === "OutOfDate" || btnStatus === "Error") {
                            reload();
                        } else if (btnStatus === "Default") {
                            setStartSegement(true);
                            setKey(!key);
                        }
                    },
                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().editBtn)} ${btnAtrr.className}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                            src: btnAtrr.icon,
                            alt: "edit-icon",
                            width: 14,
                            height: 14,
                            className: btnAtrr.imageClassName
                        }),
                        btnAtrr.text
                    ]
                })
            }) : null,
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().maskText),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: t("editMask.selection")
                    }),
                    taskResult.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default().or),
                                children: t("editMask.selectionOr")
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_UploadMask__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                                setUploading: setUploadingMask
                            })
                        ]
                    }) : null
                ]
            }),
            showDisable ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_11___default()["delete"]),
                onClick: disableEdit,
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                    src: "/modal-close.svg",
                    width: 16,
                    height: 16,
                    alt: "disableMask"
                })
            }) : null,
            segementModal ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_NewGenerateMask_index__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                iWidth: iWidth,
                iHeight: iHeight,
                imageData: imageData,
                mainCutImageData: mainCutImageData
            }, taskId) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditMask);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2728:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7073);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _UploadImage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1609);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9948);
/* harmony import */ var _components_CustomImageSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2021);







const Maximize = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const message = t("toast.picCustomHWLimitMessage", {
        maxHeight: 1024,
        maxWidth: 1024
    });
    const [uploadingMain, setUploadingMain] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const beforeUploading = async (file)=>{
        console.log(file, uploadingMain);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().maximize),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_UploadImage__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                customVerfiyMessage: message,
                maxWidth: 1024,
                maxHeight: 1024,
                setUploading: setUploadingMain,
                beforeUploading: beforeUploading
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().maximizeTag),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                    options: [
                        {
                            key: 1,
                            value: "2x"
                        },
                        {
                            key: 2,
                            value: "4x"
                        }
                    ],
                    value: [
                        1
                    ],
                    onChange: (value)=>{
                        // handleTaskResult(item.key, value)
                        console.log(value, "-------");
                    },
                    label: "放大倍数"
                })
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().maximizeWay),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomImageSelect__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                    label: "放大方式",
                    list: [
                        {
                            name: "普通放大",
                            id: 1,
                            image: "	https://ai-image.weshop.com/3c0aa4b9-3e2f-46ee-b007-d389f5fc7e0e.png_256x256.jpeg"
                        },
                        {
                            name: "普通放大",
                            id: 2,
                            image: "	https://ai-image.weshop.com/3c0aa4b9-3e2f-46ee-b007-d389f5fc7e0e.png_256x256.jpeg"
                        }
                    ],
                    type: "test"
                })
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Maximize);


/***/ }),

/***/ 181:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(679);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9948);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_4__);






const OriginImgDiff = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const list = [
        {
            key: 14,
            value: t("promptObj.tab14")
        },
        {
            key: 15,
            value: t("promptObj.tab15")
        }
    ];
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().originImgDiff),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().title)}`,
                children: t("promptObj.algorithmicBias")
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                value: [
                    taskResult?.denoiseType || 14
                ],
                options: list,
                onChange: (value)=>{
                    handleTaskResult("denoiseType", value);
                }
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OriginImgDiff);


/***/ }),

/***/ 7388:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7550);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7428);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4655);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_CustomLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3962);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_5__);







const PowerDefect = ({ isModalOpen , setIsModalOpen  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)("studio");
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_Modal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
        isModalOpen: isModalOpen,
        setIsModalOpen: setIsModalOpen,
        width: 408,
        title: t("pointInsufficient"),
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().unit)}`,
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                        src: "/cpu-charge.svg",
                        width: 20,
                        height: 20,
                        alt: "cpu-charge",
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().cpuCharge)
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: " "
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: t("powerUnit")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        children: " "
                    })
                ]
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().goPay),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomLink__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                    href: "/member?scrollTo=plans",
                    target: "_blank",
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                        children: t("buy")
                    })
                })
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PowerDefect);


/***/ }),

/***/ 2738:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8810);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(6945);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8502);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7428);
/* harmony import */ var _components_CustomLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3962);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(9204);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8208);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3413);
/* harmony import */ var _components_hooks_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4098);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([underscore__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_6__]);
([underscore__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);















const Replicate = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_9__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
    const [detectStatus, setDetectStatus] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("None");
    const [taskNo, setTaskNo] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("");
    const [executions, setExecutions] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]);
    const [executionMsg, setExecutionMsg] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("");
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        const taskNo = taskResult.replicateFromTaskNo;
        setTaskNo(`${taskNo ? taskNo : ""}`);
        if (taskNo) {
            setExecutions([]);
            getReplicableExecutions(taskNo);
        }
    }, [
        taskResult.replicateFromTaskNo
    ]);
    const getReplicableExecutions = async (taskNo)=>{
        try {
            const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .replicableExecutions */ .bX)({
                taskNo,
                noShowToast: true,
                replicateList: true
            });
            if (resp?.list) {
                setExecutions(resp.list ?? []);
                setExecutionMsg("");
            } else if (resp.code) {
                setExecutionMsg(resp.msg);
            }
        } catch (error) {
            console.error(error);
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        if (taskResult.replicateFromTaskNo && taskResult.replicateFromExecuteSeq) {
            setDetectStatus("Pending");
        } else {
            setDetectStatus("None");
        }
    }, [
        taskResult.replicateFromExecuteSeq
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        const unitId = executions?.find((item)=>{
            return item.executeSeq == taskResult.replicateFromExecuteSeq;
        })?.results[0]?.unitId;
        if (detectStatus === "Pending" && unitId) {
            const faceDetect = async ()=>{
                try {
                    const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .executionFaceDetect */ .IM)({
                        unitId
                    });
                    if (resp) {
                        setDetectStatus(resp.status);
                        if (resp.status == "Error") {
                            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z)({
                                message: t("toast.systemError")
                            });
                        }
                    } else {
                        setDetectStatus("None");
                    }
                } catch (error) {
                    console.error(error);
                    setDetectStatus("None");
                }
            };
            faceDetect();
            const intervalId = setInterval(faceDetect, 2000);
            return ()=>{
                clearInterval(intervalId);
            };
        }
    }, [
        detectStatus,
        executions
    ]);
    const closeFailModal = (open)=>{
        if (!open) {
            handleTaskResult("replicateFromImage", null, true);
            handleTaskResult("replicateFromUnitId", null, true);
            handleTaskResult("replicateFromTaskAgentName", null, true);
            handleTaskResult("replicateFromExecuteSeq", 0, true);
            handleTaskResult("replicateFromTaskNo", 0);
        }
    };
    const executeSeqItems = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(()=>{
        return executions.map((item)=>{
            return {
                key: item.executeSeq,
                label: item.executeSeq
            };
        });
    }, [
        executions
    ]);
    const executeSeqMenuClick = (e)=>{
        const executionSeq = e.key;
        if (parseInt(executionSeq) != taskResult.replicateFromExecuteSeq) {
            handleTaskResult("replicateFromUnitId", null, true);
            handleTaskResult("replicateFromImage", null, true);
            handleTaskResult("replicateFromTaskAgentName", null, true);
            handleTaskResult("replicateFromExecuteSeq", parseInt(executionSeq));
        }
    };
    const figureIndexItems = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(()=>{
        const seq = taskResult.replicateFromExecuteSeq;
        if (seq) {
            return executions?.find((it)=>{
                return it.executeSeq == seq;
            })?.results?.map((item, index)=>{
                return {
                    key: `${item.unitId}`,
                    label: `${index + 1}`
                };
            });
        }
    }, [
        executions,
        taskResult.replicateFromExecuteSeq
    ]);
    const figureIndex = (0,react__WEBPACK_IMPORTED_MODULE_3__.useMemo)(()=>{
        const seq = taskResult.replicateFromExecuteSeq;
        const unitId = taskResult.replicateFromUnitId;
        if (seq && unitId) {
            const execution = executions?.find((it)=>{
                return it.executeSeq == seq;
            });
            if (execution) {
                const image = execution.results?.find((it)=>{
                    return it.unitId == unitId;
                });
                if (image) {
                    return `${execution.results.indexOf(image) + 1}`;
                }
            }
        }
        return "";
    }, [
        executions,
        taskResult.replicateFromExecuteSeq,
        taskResult.replicateFromUnitId
    ]);
    const figureIndexMenuClick = (e)=>{
        const unitId = e.key;
        const result = executions.find((it)=>{
            return it.executeSeq == taskResult.replicateFromExecuteSeq;
        })?.results?.find((it)=>{
            return it.unitId == unitId;
        });
        if (result) {
            handleTaskResult("replicateFromUnitId", result.unitId, true);
            handleTaskResult("replicateFromImage", result.image);
        }
    };
    const taskNoChange = (0,react__WEBPACK_IMPORTED_MODULE_3__.useCallback)(underscore__WEBPACK_IMPORTED_MODULE_2__.debounce((taskNo)=>{
        // 这里节流函数设置taskNo
        handleTaskResult("replicateFromImage", null, true);
        handleTaskResult("replicateFromUnitId", null, true);
        handleTaskResult("replicateFromTaskAgentName", null, true);
        handleTaskResult("replicateFromExecuteSeq", 0, true);
        handleTaskResult("replicateFromTaskNo", parseInt(taskNo));
    }, 500), []);
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        const taskNo = taskResult.replicateFromTaskNo;
        const seq = taskResult.replicateFromExecuteSeq;
        if (taskNo && seq) {
            const executionInfo = executions.find((it)=>it.executeSeq == seq);
            if (executionInfo && executionInfo.taskId && executionInfo.executionId && !taskResult.replicateFromTaskAgentName) {
                getReplicateTaskDetail(executionInfo.taskId, executionInfo.executionId);
            }
        }
    }, [
        taskResult.replicateFromTaskNo,
        taskResult.replicateFromExecuteSeq,
        executions
    ]);
    const getReplicateTaskDetail = async (taskId, executionId)=>{
        let taskDetail = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .getTaskDetail */ .T8)({
            taskId,
            executionId
        });
        if (taskDetail.paramType === "replicate") {
            const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .replicableExecutions */ .bX)({
                taskNo: taskDetail.replicateFromTaskNo,
                noShowToast: true,
                replicateList: true
            });
            if (resp?.list) {
                const execution = resp.list?.find((item)=>{
                    return item.executeSeq == taskDetail.replicateFromExecuteSeq;
                });
                taskDetail = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .getTaskDetail */ .T8)({
                    taskId: execution.taskId,
                    executionId: execution.executionId
                });
            }
        }
        handleTaskResult("replicateFromTaskAgentName", taskDetail.agentName === "replicate" ? taskDetail.replicateFromTaskAgentName : taskDetail.agentName, true);
        _components_hooks_constants__WEBPACK_IMPORTED_MODULE_12__/* .PARAMS */ .z[taskDetail.paramType]?.forEach((item)=>{
            handleTaskResult(item, taskDetail[item], true);
        });
        handleTaskResult("paramType", taskDetail.paramType);
        handleTaskResult("agentVersion", taskDetail.agentVersion);
    };
    const phrase = [
        t("retask.phrase1"),
        t("retask.phrase2"),
        t("retask.phrase3"),
        t("retask.phrase4")
    ];
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_4__.Spin, {
                spinning: detectStatus === "Pending",
                delay: 100,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateContainer),
                    children: [
                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateNoContainer),
                            children: [
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().input),
                                    children: [
                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().inputTaskContainer),
                                            children: [
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("label", {
                                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().label)}`,
                                                    children: t("retask.taskNumber")
                                                }),
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("input", {
                                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().inputValue)} ag16`,
                                                    type: "text",
                                                    placeholder: "",
                                                    value: taskNo,
                                                    onChange: (e)=>{
                                                        const taskNo = e.target.value;
                                                        setTaskNo(taskNo);
                                                        taskNoChange(taskNo);
                                                    }
                                                })
                                            ]
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().inputSplit),
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                children: "-"
                                            })
                                        }),
                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().inputContainer),
                                            children: [
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("label", {
                                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().label)}`,
                                                    children: t("retask.executionCount")
                                                }),
                                                executionMsg ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().selectValue)} ag16`,
                                                    onClick: ()=>{
                                                        (0,_components_Toast__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z)({
                                                            message: `🔴 ${executionMsg} 🙅🏻‍♀️`,
                                                            duration: 2000
                                                        });
                                                    },
                                                    children: [
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                            children: " "
                                                        }),
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                                            src: "/task-dropdown.svg",
                                                            alt: "dropdown",
                                                            height: 32,
                                                            width: 32
                                                        })
                                                    ]
                                                }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_4__.Dropdown, {
                                                    menu: {
                                                        items: executeSeqItems,
                                                        onClick: executeSeqMenuClick
                                                    },
                                                    overlayClassName: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().dropdown),
                                                    trigger: [
                                                        "click"
                                                    ],
                                                    disabled: !executeSeqItems?.length,
                                                    children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().selectValue)} ag16`,
                                                        onClick: (e)=>e.preventDefault(),
                                                        children: [
                                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                                children: taskResult.replicateFromExecuteSeq ? taskResult.replicateFromExecuteSeq : ""
                                                            }),
                                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                                                src: "/task-dropdown.svg",
                                                                alt: "dropdown",
                                                                height: 32,
                                                                width: 32
                                                            })
                                                        ]
                                                    })
                                                })
                                            ]
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().inputSplit),
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                children: "-"
                                            })
                                        }),
                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().inputContainer),
                                            children: [
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("label", {
                                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().label)}`,
                                                    children: t("retask.figureIndex")
                                                }),
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_4__.Dropdown, {
                                                    menu: {
                                                        items: figureIndexItems,
                                                        onClick: figureIndexMenuClick
                                                    },
                                                    overlayClassName: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().dropdown),
                                                    trigger: [
                                                        "click"
                                                    ],
                                                    disabled: !figureIndexItems?.length,
                                                    children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().selectValue)} ag16`,
                                                        onClick: (e)=>e.preventDefault(),
                                                        children: [
                                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                                children: figureIndex
                                                            }),
                                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                                                src: "/task-dropdown.svg",
                                                                alt: "dropdown",
                                                                height: 32,
                                                                width: 32
                                                            })
                                                        ]
                                                    })
                                                })
                                            ]
                                        })
                                    ]
                                }),
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().content),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                            className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().contentTitle)}`,
                                            children: t("retask.hint2")
                                        }),
                                        phrase.map((item, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().contentDesc)}`,
                                                children: [
                                                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                        style: {
                                                            width: "18px",
                                                            paddingLeft: "2px"
                                                        },
                                                        children: [
                                                            index + 1,
                                                            "."
                                                        ]
                                                    }),
                                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                        style: {
                                                            flex: 1
                                                        },
                                                        children: item
                                                    })
                                                ]
                                            }, index)),
                                        _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .RETASK_BLOG_LINK */ .vi ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().linkContainer),
                                            children: [
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                    children: t("retask.tutorial")
                                                }),
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomLink__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                                                    href: _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .RETASK_BLOG_LINK */ .vi,
                                                    target: "_blank",
                                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().link),
                                                        children: _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .RETASK_BLOG_TEXT */ .D_
                                                    })
                                                })
                                            ]
                                        }) : null
                                    ]
                                })
                            ]
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateImageContainer),
                            children: taskResult.replicateFromImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                        src: taskResult.replicateFromImage,
                                        width: 384,
                                        height: 384,
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateImage),
                                        alt: "replicate_image",
                                        loader: _common_utils__WEBPACK_IMPORTED_MODULE_10__/* .previewLoader */ .Te
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateImageHint)}`,
                                        children: t("retask.picHint")
                                    })
                                ]
                            }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        style: {
                                            width: "384px",
                                            height: "384px"
                                        },
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateImageNone)
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().replicateImageHint)}`,
                                        children: " "
                                    })
                                ]
                            })
                        })
                    ]
                })
            }),
            detectStatus === "Fail" ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_Modal__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                isModalOpen: detectStatus === "Fail",
                setIsModalOpen: closeFailModal,
                width: 408,
                title: t("retask.failTitle"),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().failContent)}`,
                        children: t("retask.failContent")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_14___default().btnChoose),
                        onClick: ()=>{
                            closeFailModal(false);
                        },
                        children: t("confirm")
                    })
                ]
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Replicate);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3887:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8810);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2871);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8502);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7428);
/* harmony import */ var _components_CustomLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3962);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9204);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8208);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3413);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([underscore__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_6__]);
([underscore__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);














const Retask = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_9__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z);
    const [detectStatus, setDetectStatus] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("None");
    const [taskNo, setTaskNo] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("");
    const [executions, setExecutions] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]);
    const [executionMsg, setExecutionMsg] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)("");
    const editable = false;
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        const taskNo = taskResult.replicateFromTaskNo;
        setTaskNo(`${taskNo ? taskNo : ""}`);
        if (taskNo) {
            setExecutions([]);
            getReplicableExecutions(taskNo);
        }
    }, [
        taskResult.replicateFromTaskNo
    ]);
    const getReplicableExecutions = async (taskNo)=>{
        try {
            const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .replicableExecutions */ .bX)({
                taskNo,
                noShowToast: true
            });
            if (resp.list) {
                setExecutions(resp.list ?? []);
                setExecutionMsg("");
            } else if (resp.code) {
                setExecutionMsg(resp.msg);
            }
        } catch (error) {
            console.error(error);
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        if (taskResult.replicateFromTaskNo && taskResult.replicateFromExecuteSeq) {
            setDetectStatus("Pending");
        } else {
            setDetectStatus("None");
        }
    }, [
        taskResult.replicateFromExecuteSeq
    ]);
    const setIntervalEx = (callback, ms)=>{
        callback();
        return setInterval(callback, ms);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{
        let intervalId = null;
        const unitId = executions?.find((item)=>{
            return item.executeSeq == taskResult.replicateFromExecuteSeq;
        })?.results[0]?.unitId;
        if (detectStatus === "Pending" && unitId) {
            intervalId = setIntervalEx(async ()=>{
                try {
                    const resp = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_6__/* .executionFaceDetect */ .IM)({
                        unitId
                    });
                    if (resp) {
                        setDetectStatus(resp.status);
                        if (resp.status == "Error") {
                            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                                message: t("toast.systemError")
                            });
                        }
                    } else {
                        setDetectStatus("None");
                    }
                } catch (error) {
                    console.error(error);
                    setDetectStatus("None");
                }
            }, 2000);
            return ()=>{
                if (intervalId) clearInterval(intervalId);
            };
        }
    }, [
        detectStatus,
        executions
    ]);
    const closeFailModal = (open)=>{
        if (!open) {
            handleTaskResult("replicateFromImage", null);
            handleTaskResult("replicateFromUnitId", null);
            handleTaskResult("replicateFromExecuteSeq", 0);
            handleTaskResult("replicateFromTaskNo", 0);
        }
    };
    const items = executions.map((item)=>{
        return {
            key: item.executeSeq,
            label: item.executeSeq
        };
    });
    const handleMenuClick = (e)=>{
        const executionSeq = e.key;
        if (parseInt(executionSeq) != taskResult["replicateFromExecuteSeq"]) {
            handleTaskResult("replicateFromUnitId", null, false);
            handleTaskResult("replicateFromImage", null, false);
            handleTaskResult("replicateFromExecuteSeq", parseInt(executionSeq));
        }
    };
    const inputIdChange = (0,react__WEBPACK_IMPORTED_MODULE_3__.useCallback)((e)=>{
        const taskNo = e.target.value;
        setTaskNo(taskNo);
        taskNoChange(taskNo);
    }, []);
    const taskNoChange = (0,react__WEBPACK_IMPORTED_MODULE_3__.useCallback)(underscore__WEBPACK_IMPORTED_MODULE_2__.debounce((taskNo)=>{
        // 这里节流函数设置taskNo
        handleTaskResult("replicateFromImage", null);
        handleTaskResult("replicateFromUnitId", null);
        handleTaskResult("replicateFromExecuteSeq", 0);
        handleTaskResult("replicateFromTaskNo", parseInt(taskNo));
    }, 500), []);
    const execution = executions.find((item)=>{
        return item.executeSeq == taskResult.replicateFromExecuteSeq;
    });
    const phrase = [
        t("retask.phrase1"),
        t("retask.phrase2"),
        t("retask.phrase3")
    ];
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_4__.Spin, {
                spinning: detectStatus === "Pending",
                delay: 100,
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().retaskContainer),
                    children: [
                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().input),
                            children: [
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().inputContainer),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("label", {
                                            className: `ag14`,
                                            children: t("retask.taskNumber")
                                        }),
                                        editable ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("input", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().inputValue)} ag16`,
                                            type: "text",
                                            placeholder: "",
                                            value: taskNo,
                                            onChange: inputIdChange
                                        }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().inputValue0)} ag16`,
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                children: taskNo
                                            })
                                        })
                                    ]
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().inputSplit),
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        children: "-"
                                    })
                                }),
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().inputContainer),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("label", {
                                            className: `ag14`,
                                            children: t("retask.executionCount")
                                        }),
                                        editable ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                                            children: executionMsg ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().selectValue)} ag16`,
                                                onClick: ()=>{
                                                    (0,_components_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                                                        message: `🔴 ${executionMsg} 🙅🏻‍♀️`,
                                                        duration: 2000
                                                    });
                                                },
                                                children: [
                                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                        children: " "
                                                    }),
                                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                                        src: "/task-dropdown.svg",
                                                        alt: "dropdown",
                                                        height: 32,
                                                        width: 32
                                                    })
                                                ]
                                            }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_4__.Dropdown, {
                                                menu: {
                                                    items,
                                                    onClick: handleMenuClick
                                                },
                                                overlayClassName: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().dropdown),
                                                trigger: [
                                                    "click"
                                                ],
                                                disabled: executions.length == 0,
                                                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                    className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().selectValue)} ag16`,
                                                    onClick: (e)=>e.preventDefault(),
                                                    children: [
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                            children: taskResult.replicateFromExecuteSeq ? taskResult.replicateFromExecuteSeq : ""
                                                        }),
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                                            src: "/task-dropdown.svg",
                                                            alt: "dropdown",
                                                            height: 32,
                                                            width: 32
                                                        })
                                                    ]
                                                })
                                            })
                                        }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().selectValue0)} ag16`,
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                children: taskResult.replicateFromExecuteSeq ? taskResult.replicateFromExecuteSeq : ""
                                            })
                                        })
                                    ]
                                })
                            ]
                        }),
                        execution ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().imgHint)}`,
                            children: t("retask.modelSelect")
                        }) : null,
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().imgContainer),
                            children: execution ? execution?.results.map((item, index)=>{
                                return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: `${editable ? (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().imgWrapper) : (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().imgWrapper0)} ${item.unitId == taskResult.replicateFromUnitId ? (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().selected) : ""}`,
                                    onClick: ()=>{
                                        if (editable) {
                                            handleTaskResult("replicateFromUnitId", item.unitId);
                                            handleTaskResult("replicateFromImage", item.image);
                                        }
                                    },
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                        src: item.image,
                                        alt: "execution-result",
                                        width: 184,
                                        height: 245,
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().img),
                                        loader: _common_utils__WEBPACK_IMPORTED_MODULE_10__/* .previewLoader */ .Te
                                    })
                                }, index);
                            }) : null
                        }),
                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().content),
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                    className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().contentTitle)}`,
                                    children: t("retask.hint1")
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                    className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().contentTitle)}`,
                                    children: t("retask.hint2")
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("ul", {
                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().contentDesc)}`,
                                    children: phrase.map((item, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("li", {
                                            children: item
                                        }, index))
                                }),
                                _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .RETASK_BLOG_LINK */ .vi ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().linkContainer),
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                            children: t("retask.tutorial")
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomLink__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                                            href: _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .RETASK_BLOG_LINK */ .vi,
                                            target: "_blank",
                                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().link),
                                                children: _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .RETASK_BLOG_TEXT */ .D_
                                            })
                                        })
                                    ]
                                }) : null
                            ]
                        })
                    ]
                })
            }),
            detectStatus === "Fail" ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components_Modal__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                isModalOpen: detectStatus === "Fail",
                setIsModalOpen: closeFailModal,
                width: 408,
                title: t("retask.failTitle"),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().failContent)}`,
                        children: t("retask.failContent")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btnChoose),
                        onClick: ()=>{
                            closeFailModal(false);
                        },
                        children: t("confirm")
                    })
                ]
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Retask);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 1026:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8502);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9985);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_CustomImageSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2021);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];







const Race = ({ agentName  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)("studio");
    const { taskId: [taskId] , taskResult: [taskResult]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [modelList, setModelList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (taskId) {
            const ethnicity = async ()=>{
                if (!taskId) return;
                const models = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .getModel */ .PD)({
                    agentName,
                    agentVersion: taskResult?.agentVersion
                }) || [];
                setModelList(models);
            };
            ethnicity();
        }
    }, [
        taskResult?.agentVersion
    ]);
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().race),
        children: modelList?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomImageSelect__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
            list: modelList,
            label: t("templateObj.mask"),
            type: "fashionModelId"
        }) : null
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Race);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3564:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8502);
/* harmony import */ var _components_CustomTag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9948);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];






const Tags = ({ agentName  })=>{
    const { taskId: [taskId] , taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const [tagList, setTagList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        const getTaglist = async ()=>{
            if (!taskId) return;
            const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .getTags */ .NJ)({
                agentName,
                agentVersion: taskResult?.agentVersion
            }) || [];
            const list = value.map((item)=>{
                return {
                    key: item.id,
                    value: item.name
                };
            });
            setTagList(list);
        };
        getTaglist();
    }, [
        agentName,
        taskResult?.agentVersion
    ]);
    // 多选tags
    const changeTags = (value)=>{
        const tagIds = taskResult.tagIds || [];
        if (tagIds?.includes(value)) {
            const index = tagIds.indexOf(value);
            tagIds?.splice(index, 1);
        } else {
            tagIds?.push(value);
        }
        handleTaskResult("tagIds", tagIds);
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().tagList),
        children: tagList.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomTag__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
            value: taskResult.tagIds || [],
            options: tagList,
            onChange: (value)=>{
                changeTags(value);
            }
        }) : null
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tags);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9973:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8502);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_Race__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1026);
/* harmony import */ var _components_Tags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3564);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1653);
/* harmony import */ var _components_CustomImageSelect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2021);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8499);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_9__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, _components_Race__WEBPACK_IMPORTED_MODULE_5__, _components_Tags__WEBPACK_IMPORTED_MODULE_6__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, _components_Race__WEBPACK_IMPORTED_MODULE_5__, _components_Tags__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










const Template = ({ agentName  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_4__.useTranslation)("studio");
    const { taskId: [taskId] , taskResult: [taskResult]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [templateList, setTemplateList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (!taskId || !agentName) return;
        const template = async ()=>{
            const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .getTemplate */ .t4)({
                agentName,
                agentVersion: taskResult?.agentVersion
            });
            setTemplateList(value);
        };
        template();
    }, [
        taskId,
        agentName,
        taskResult?.agentVersion
    ]);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            _common_constans__WEBPACK_IMPORTED_MODULE_7__/* .RACR_AGENT.includes */ .AL.includes(agentName || "") ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Race__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                        agentName: agentName
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Tags__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                        agentName: agentName
                    })
                ]
            }) : null,
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().content),
                children: templateList?.length ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomImageSelect__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                    list: templateList,
                    label: t("templateObj.location"),
                    type: "locationId"
                }) : null
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Template);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 5134:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ components_TextDescription)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: ./src/components/Nav/components/Edit/components/TextDescription/style.module.css
var style_module = __webpack_require__(8102);
var style_module_default = /*#__PURE__*/__webpack_require__.n(style_module);
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
// EXTERNAL MODULE: ./src/components/hooks/createContext.tsx
var createContext = __webpack_require__(2228);
// EXTERNAL MODULE: ./src/components/Nav/components/Edit/components/TextDescription/Example/style.module.css
var Example_style_module = __webpack_require__(8527);
var Example_style_module_default = /*#__PURE__*/__webpack_require__.n(Example_style_module);
// EXTERNAL MODULE: external "next-i18next"
var external_next_i18next_ = __webpack_require__(1377);
// EXTERNAL MODULE: ./src/common/constans/international.ts + 2 modules
var international = __webpack_require__(3413);
;// CONCATENATED MODULE: ./src/components/Nav/components/Edit/components/TextDescription/Example/index.tsx




const Example = ()=>{
    const { t  } = (0,external_next_i18next_.useTranslation)("studio");
    return /*#__PURE__*/ jsx_runtime_.jsx(jsx_runtime_.Fragment, {
        children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
            className: (Example_style_module_default()).content,
            children: [
                /*#__PURE__*/ jsx_runtime_.jsx("p", {
                    className: `ag14-t ${(Example_style_module_default()).contentTitle}`,
                    children: t("commandTips.describeTips")
                }),
                /*#__PURE__*/ jsx_runtime_.jsx("ul", {
                    className: `ag14 ${(Example_style_module_default()).contentDesc}`,
                    children: international/* WORKSPACE_PHRASE.map */.Yy.map((item, index)=>/*#__PURE__*/ jsx_runtime_.jsx("li", {
                            children: item
                        }, index))
                }),
                /*#__PURE__*/ jsx_runtime_.jsx("p", {
                    className: `ag14-t ${(Example_style_module_default()).contentTitle}`,
                    children: t("commandTips.contentTitle")
                }),
                international/* WORKSPACE_CASEINFOS.map */.Zy.map((caseInfo, index)=>/*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                        className: `ag14 ${(Example_style_module_default()).contentDesc}`,
                        children: [
                            /*#__PURE__*/ jsx_runtime_.jsx("p", {
                                className: (Example_style_module_default()).caseTitleI18n,
                                children: caseInfo.title
                            }),
                            /*#__PURE__*/ jsx_runtime_.jsx("p", {
                                className: (Example_style_module_default()).caseContent,
                                children: caseInfo.content
                            })
                        ]
                    }, index))
            ]
        })
    });
};
/* harmony default export */ const TextDescription_Example = (Example);

;// CONCATENATED MODULE: ./src/components/Nav/components/Edit/components/TextDescription/index.tsx





const TextDescription = ()=>{
    const { taskResult: [taskResult] , handleTaskResult  } = (0,external_react_.useContext)(createContext/* default */.Z);
    const [value, setValue] = (0,external_react_.useState)(taskResult.textDescription || "");
    (0,external_react_.useEffect)(()=>{
        setValue(taskResult.textDescription || "");
    }, [
        taskResult.textDescription
    ]);
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        className: (style_module_default()).CommonPrompt,
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx("textarea", {
                className: `${(style_module_default()).textarea} ag16`,
                value: value,
                onBlur: ()=>{
                    handleTaskResult("textDescription", value);
                },
                onChange: (e)=>{
                    setValue(e?.target?.value);
                }
            }),
            /*#__PURE__*/ jsx_runtime_.jsx(TextDescription_Example, {})
        ]
    });
};
/* harmony default export */ const components_TextDescription = (TextDescription);


/***/ }),

/***/ 3443:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(213);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3413);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7987);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([react_i18next__WEBPACK_IMPORTED_MODULE_2__]);
react_i18next__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];




const Example = ()=>{
    const { t  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)("studio");
    const phrase = [
        t("promptExample.phrase1"),
        t("promptExample.phrase2")
    ];
    const positiveCaseInfos = [
        {
            title: t("promptExample.positiveExample1"),
            content: t("promptExample.positiveExample1Content")
        },
        {
            title: t("promptExample.positiveExample2"),
            content: t("promptExample.positiveExample2Content")
        }
    ];
    const negativeCaseInfos = [
        {
            title: t("promptExample.negativeExample1"),
            content: t("promptExample.negativeExample1Content")
        }
    ];
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: _common_constans_international__WEBPACK_IMPORTED_MODULE_1__/* .IS_EN */ .jY ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().content),
            children: [
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentTitle)}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted),
                            children: "Describe the image you want to generate with words/phrases/sentences and separate them with commas. "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: "Examples:"
                        })
                    ]
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("ul", {
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentDesc)}`,
                    children: phrase.map((item, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("li", {
                            children: item
                        }, index))
                }),
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentC)}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted),
                            children: "Positive prompt:"
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: "Try to use positive language to describe the requirements, avoiding the use of negative words. Good sentence structure and precise descriptions will enhance the richness and depth of the generated product scenes."
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted),
                            children: "To emphasize certain parts, use parentheses () or double parentheses (()) to indicate their importance."
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: "If a particular aspect is crucial, you can rearrange the position,"
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted),
                            children: "placing the most important element at the beginning to give them greater significance."
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: "If you wish to generate images in a specific style, you can specify the photography equipment, camera model, and lens."
                        })
                    ]
                }),
                positiveCaseInfos.map((caseInfo, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentDesc)}`,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseTitleI18n)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted)}`,
                                children: caseInfo.title
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseContent),
                                children: caseInfo.content
                            })
                        ]
                    }, index)),
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentC)}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted),
                            children: "Negative prompt:"
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: "Negative prompt means “no” or “not” by default, so DO NOT include additional negative word. Avoid lengthy sentences and simply provide word/phrase."
                        })
                    ]
                }),
                negativeCaseInfos.map((caseInfo, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentDesc)}`,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseTitleI18n)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().highlighted)}`,
                                children: caseInfo.title
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseContent),
                                children: caseInfo.content
                            })
                        ]
                    }, index))
            ]
        }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().content),
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                    className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentTitle)}`,
                    children: t("promptExample.describeTips")
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("ul", {
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentDesc)}`,
                    children: phrase.map((item, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("li", {
                            children: item
                        }, index))
                }),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                    className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentC)}`,
                    children: t("promptExample.positive")
                }),
                positiveCaseInfos.map((caseInfo, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentDesc)}`,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseTitle),
                                children: caseInfo.title
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseContent),
                                children: caseInfo.content
                            })
                        ]
                    }, index)),
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                    className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentC)}`,
                    children: t("promptExample.negative")
                }),
                negativeCaseInfos.map((caseInfo, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().contentDesc)}`,
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseTitle),
                                children: caseInfo.title
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_3___default().caseContent),
                                children: caseInfo.content
                            })
                        ]
                    }, index))
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Example);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 609:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1321);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8502);
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8810);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_3__, underscore__WEBPACK_IMPORTED_MODULE_4__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_3__, underscore__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);






const wordRegex = /[a-zA-Z0-9'._-]/;
const splitStr = " --n ";
const PromptInput = ({ height , type , promptChange , value , setValue , placeholder , pasteCallback  })=>{
    const [promptRecommands, setPromptRecommands] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    const [focus, setFocus] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const prefixRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)("");
    const textAreaRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
    const pasteEvent = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(false);
    const handlePaste = (event)=>{
        const input = event.target;
        const selectedText = input.value.substring(input.selectionStart, input.selectionEnd);
        const clipboardData = event.clipboardData;
        const pastedText = clipboardData.getData("text/plain");
        if (pastedText.includes(splitStr)) {
            pasteEvent.current = type.includes("positive") ? selectedText != pastedText.split(splitStr)[0] : selectedText != pastedText.split(splitStr)[1];
            // 阻止默认粘贴行为
            event.preventDefault();
            const selectionStart = input.selectionStart;
            const selectionEnd = input.selectionEnd;
            pasteCallback(pastedText, selectionStart, selectionEnd);
        } else {
            pasteEvent.current = selectedText != pastedText;
        }
    };
    const recommand = async (prefix)=>{
        prefixRef.current = prefix;
        const data = {
            prefix: prefix,
            noShowToast: true
        };
        const recommands = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_3__/* .promptRecommand */ .S8)(data) ?? [];
        setPromptRecommands(recommands);
    };
    const prefixChange = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(underscore__WEBPACK_IMPORTED_MODULE_4__.debounce((prefix)=>{
        recommand(prefix);
    }, 100), []);
    const replaceRecommend = (word)=>{
        const element = textAreaRef.current;
        if (element) {
            const value = element.value;
            const index = element.selectionEnd;
            const range = findIndexWordRange(value, index);
            if (range && range.prefix == prefixRef.current) {
                const { start , end  } = range;
                const addStr = "";
                const replace = `${value.slice(0, start)}${word}${addStr}${value.slice(end, value.length)}`;
                element.value = replace;
                element.selectionEnd = start + word.length + addStr.length;
                element.focus();
                setValue(replace);
            } else {
                element.focus();
            }
            setTimeout(()=>{
                setPromptRecommands([]);
            }, 5);
        }
    };
    const promptRecommandRequest = ()=>{
        if (pasteEvent.current) {
            pasteEvent.current = false;
            return;
        }
        const element = textAreaRef.current;
        if (element) {
            const value = element.value;
            const index = element.selectionEnd;
            const range = findIndexWordRange(value, index);
            if (range) {
                prefixChange(range.prefix);
                return;
            }
        }
        setPromptRecommands([]);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        if (!focus) {
            const timerId = setTimeout(()=>{
                setPromptRecommands([]);
            }, 800);
            return ()=>{
                clearTimeout(timerId);
            };
        }
    }, [
        focus
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        const element = document.getElementById(`${type}-recommend-0`);
        if (element) {
            element.scrollIntoView();
        }
    }, [
        promptRecommands
    ]);
    const findIndexWordRange = (str, index)=>{
        let start = null;
        for(let i = 0; i < str.length; i++){
            if (start == null) {
                // 如果当前字符是字母或数字，则设置起始索引
                if (wordRegex.test(str[i])) {
                    start = i;
                }
            } else {
                // 如果当前字符不是字母或数字，则将前一个区间添加到结果中，并重新设置起始索引
                if (!wordRegex.test(str[i])) {
                    if (i >= index && index >= start) {
                        return {
                            start: start,
                            end: i,
                            prefix: str.substring(start, i)
                        };
                    }
                    start = null;
                }
            }
        }
        if (start != null) {
            return {
                start: start,
                end: str.length,
                prefix: str.substring(start, str.length)
            };
        }
        return null;
    };
    const [indexRecommand, setIndexRecommand] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        setIndexRecommand(0);
    }, [
        promptRecommands
    ]);
    const handleKeyDown = (e)=>{
        //mac下中文输入法的enter也会响应enter，所以需要isComposing判断
        if (promptRecommands.length && !e.nativeEvent.isComposing) {
            if (e.key === "ArrowUp") {
                if (indexRecommand > 0) {
                    setIndexRecommand(indexRecommand - 1);
                } else {
                    setIndexRecommand(0);
                }
                e.preventDefault();
            } else if (e.key === "ArrowDown") {
                if (indexRecommand < promptRecommands.length - 1) {
                    setIndexRecommand(indexRecommand + 1);
                } else {
                    setIndexRecommand(promptRecommands.length - 1);
                }
                e.preventDefault();
            } else if (e.key == "Enter") {
                if (indexRecommand >= 0 && indexRecommand < promptRecommands.length) {
                    replaceRecommend(promptRecommands[indexRecommand]);
                }
                e.preventDefault();
            }
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        if (indexRecommand >= 0) {
            const element = document.getElementById(`${type}-recommend-${indexRecommand}`);
            if (element) {
                element.scrollIntoView({
                    behavior: "smooth"
                });
            }
        }
    }, [
        indexRecommand
    ]);
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Popover, {
        transitionName: "",
        open: !!promptRecommands.length,
        arrow: false,
        placement: "rightTop",
        overlayClassName: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().popoverRecommendWrapper),
        content: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().popoverRecommendList),
            children: promptRecommands.map((item, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().popoverRecommendItem)} ${indexRecommand === index ? (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().popoverRecommendItemIndexed) : ""}`,
                    id: `${type}-recommend-${index}`,
                    onClick: ()=>{
                        replaceRecommend(item);
                    },
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: item
                        }),
                        indexRecommand === index ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().popoverRecommendBorder)
                        }) : null
                    ]
                }, index))
        }),
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("textarea", {
            ref: textAreaRef,
            placeholder: placeholder,
            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().textarea)} ag16`,
            style: {
                height: `${height}px`
            },
            value: value,
            onBlur: ()=>{
                promptChange(value);
                setFocus(false);
            },
            onFocus: ()=>{
                setFocus(true);
            },
            onChange: (e)=>{
                setValue(e.target.value);
                promptRecommandRequest();
            },
            onKeyDown: handleKeyDown,
            onPaste: handlePaste
        }, `positivelyTextarea`)
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PromptInput);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 2761:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3210);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Example__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3443);
/* harmony import */ var _PromptInput__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(609);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Example__WEBPACK_IMPORTED_MODULE_4__, _PromptInput__WEBPACK_IMPORTED_MODULE_5__]);
([_Example__WEBPACK_IMPORTED_MODULE_4__, _PromptInput__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);







const KEY_PROMPT = "posPrompt";
const KEY_NEGATIVE_PROMPT = "negPrompt";
const TextPrompt = ({ isNotShowExplain  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const { taskResult: [taskResult] , handleTaskResult  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(taskResult[KEY_PROMPT] || "");
    const [negativeValue, setNegativeValue] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(taskResult[KEY_NEGATIVE_PROMPT] || "");
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        setValue(taskResult[KEY_PROMPT] || "");
        setNegativeValue(taskResult[KEY_NEGATIVE_PROMPT] || "");
    }, [
        taskResult[KEY_PROMPT],
        taskResult[KEY_NEGATIVE_PROMPT]
    ]);
    const paste = (pastedText, selectionStart, selectionEnd, isPositive)=>{
        const splits = pastedText.split(" --n ");
        const positive = splits[0];
        const negative = splits[1];
        if (isPositive) {
            if (!document.execCommand || !document.execCommand("insertText", false, positive)) {
                setValue((value)=>value.slice(0, selectionStart) + positive + value.slice(selectionEnd));
            }
            setNegativeValue((value)=>value + negative);
        } else {
            setValue((value)=>value + positive);
            if (!document.execCommand || !document.execCommand("insertText", false, negative)) {
                setNegativeValue((value)=>value.slice(0, selectionStart) + negative + value.slice(selectionEnd));
            }
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().textPrompt),
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().textPromptItem),
                        children: [
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().title)}`,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("promptObj.input")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().active),
                                        children: t("promptObj.positive")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("promptObj.inputHint")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("promptObj.required")
                                    })
                                ]
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_PromptInput__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                                height: 312,
                                type: "positive",
                                promptChange: ()=>{
                                    handleTaskResult(KEY_PROMPT, value, false);
                                    handleTaskResult(KEY_NEGATIVE_PROMPT, negativeValue);
                                },
                                value: value,
                                setValue: setValue,
                                placeholder: taskResult?.batchTask ? t("promptObj.placeholder") + ". Combinatorial generation produced every possible prompt from the given string. For example: I {love|hate} {New York|Chicago} in {June|July|August}" : t("promptObj.placeholder"),
                                pasteCallback: (value, start, end)=>{
                                    paste(value, start, end, true);
                                }
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().textPromptItem)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().negative)}`,
                        children: [
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `ag14-t ${(_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().title)}`,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("promptObj.input")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().active),
                                        children: t("promptObj.negative")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("promptObj.inputHint")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("promptObj.optional")
                                    })
                                ]
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_PromptInput__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                                height: 312,
                                type: "negative",
                                promptChange: ()=>{
                                    handleTaskResult(KEY_NEGATIVE_PROMPT, negativeValue, false);
                                    handleTaskResult(KEY_PROMPT, value);
                                },
                                value: negativeValue,
                                setValue: setNegativeValue,
                                placeholder: t("promptObj.negativePlaceholder"),
                                pasteCallback: (value, start, end)=>{
                                    paste(value, start, end, false);
                                }
                            })
                        ]
                    })
                ]
            }),
            isNotShowExplain ? null : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Example__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {})
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TextPrompt);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 1609:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7612);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9204);
/* harmony import */ var _components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(882);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_5__);








const UploadedImage = ({ maxWidth , maxHeight , setUploading , customVerfiyMessage , beforeUploading =()=>{
    console.info("");
}  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)("studio");
    const { handleTaskResult , saveTaskDetail , taskId: [taskId] , taskResult: [taskResult]  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    const beforeUpload = async (file)=>{
        await saveTaskDetail();
        await beforeUploading(file);
    };
    const uploadSuccess = async (file)=>{
        if (file.image && file.showImage) {
            setUploading(true);
            handleTaskResult("image", file.image, true);
            handleTaskResult("showImage", file.showImage, true);
            setTimeout(()=>{
                setUploading(false);
            }, 500);
        } else {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({
                message: t("toast.picUploadFail"),
                duration: 3000
            });
        }
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().uploadWrap),
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
            type: "main",
            taskId: taskId ?? "",
            taskName: taskResult.name ?? "",
            maxWidth: maxWidth,
            maxHeight: maxHeight,
            beforeUpload: beforeUpload,
            uploadSuccess: uploadSuccess,
            setUploading: setUploading,
            needDragger: true,
            children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().uploadMessage),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                        src: "/gallery_export.svg",
                        alt: "upload_icon",
                        width: 24,
                        height: 24
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().uploadText),
                        children: t("editMask.clickUpload")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().dragText)} ag14`,
                        children: t("editMask.dragUpload")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().size)} ag12`,
                        children: t("editMask.uploadLimitation")
                    }),
                    customVerfiyMessage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_7___default().size)} ag12`,
                        children: customVerfiyMessage
                    }) : null
                ]
            })
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UploadedImage);


/***/ }),

/***/ 949:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "m": () => (/* binding */ verifyLoadImage),
/* harmony export */   "w": () => (/* binding */ checkAspectRatio)
/* harmony export */ });
/* harmony import */ var _Toast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9204);

const verifyLoadImage = async (file, tFun, maxWidth = 0, maxHeight = 0)=>{
    const isGIF = file.type === "image/gif";
    if (isGIF) {
        (0,_Toast__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({
            message: tFun("toast.gifError"),
            duration: 3000
        });
        return false;
    }
    const isLt10M = file.size / 1024 / 1024 < 10;
    if (!isLt10M) {
        (0,_Toast__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({
            message: tFun("toast.picSizeLimit"),
            duration: 3000
        });
        return false;
    }
    const { width , height , status  } = await checkAspectRatio(file);
    if (!width && !height) {
        (0,_Toast__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({
            message: tFun("toast.picInvalid"),
            duration: 3000
        });
        return false;
    } else if (maxWidth || maxHeight) {
        if (width > maxWidth || height > maxHeight) {
            (0,_Toast__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({
                message: tFun("toast.picCustomHWLimit", {
                    maxHeight,
                    maxWidth
                }),
                duration: 3000
            });
            return false;
        }
    } else if (!status) {
        (0,_Toast__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({
            message: tFun("toast.picHWLimit"),
            duration: 3000
        });
        return false;
    }
    return true;
};
const checkAspectRatio = (file)=>{
    const image = new Image();
    const url = URL.createObjectURL(file);
    return new Promise((resolve)=>{
        image.onload = ()=>{
            const aspectRatio = image.width / image.height;
            resolve({
                width: image.width,
                height: image.height,
                status: image.width >= 512 && image.height >= 512 && aspectRatio <= 2
            });
        };
        image.onerror = ()=>{
            resolve({
                width: 0,
                height: 0,
                status: false
            });
        };
        image.src = url;
    });
};


/***/ }),

/***/ 3164:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2228);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2797);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9204);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(882);







const UploadMask = ({ setUploading  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const { agentName: [agentName] , taskId: [taskId] , taskResult: [taskResult] , handleTaskResult , saveTaskDetail  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z);
    const uploadSuccess = async (file)=>{
        if (file.image) {
            setUploading(true);
            handleTaskResult("mask", file.image, true);
            setTimeout(()=>{
                setUploading(false);
            }, 500);
        } else {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)({
                message: t("toast.picUploadFail"),
                duration: 3000
            });
        }
    };
    const beforeUpload = async ()=>{
        // 编辑选区打点
        const logParam = window?.logger.getParams("10000005", window?.logger.EVENT_TYPE.CLICK, {
            taskId,
            agentName,
            type: 2
        });
        window?.logger.log([
            logParam
        ]);
        // 先保存下配置
        await saveTaskDetail();
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CustomUpload_Index__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
        type: "mask",
        taskId: taskId ?? "",
        taskName: taskResult.name ?? "",
        beforeUpload: beforeUpload,
        uploadSuccess: uploadSuccess,
        setUploading: setUploading,
        needDragger: false,
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_6___default().uploadMask),
            children: t("editMask.uploadMaskPic")
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UploadMask);


/***/ }),

/***/ 3618:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(1371);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8208);
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7550);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8502);
/* harmony import */ var _components_PowerDefect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7388);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _components_Ground_SDImg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7643);
/* harmony import */ var _components_Maximize__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2728);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3413);
/* harmony import */ var _components_BatchPowerDetail__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6029);
/* harmony import */ var _components_AgentVersion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5849);
/* harmony import */ var _components_CommonTask__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(1060);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(1653);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_5__, _components_Ground_SDImg__WEBPACK_IMPORTED_MODULE_9__, _components_AgentVersion__WEBPACK_IMPORTED_MODULE_13__, _components_CommonTask__WEBPACK_IMPORTED_MODULE_14__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_5__, _components_Ground_SDImg__WEBPACK_IMPORTED_MODULE_9__, _components_AgentVersion__WEBPACK_IMPORTED_MODULE_13__, _components_CommonTask__WEBPACK_IMPORTED_MODULE_14__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);

















const Edit = ({ infer  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_7__.useTranslation)("studio");
    const { userInfos: [userInfos] , taskResult: [taskResult] , saveTaskDetail , agentName: [agentName] , requestLoading: [, setRequestLoading] , taskId: [taskId] , powerBalanceAmount: [, setPowerBalance] , needPower: [needPower] , samMask , batchTaskPowerDetail: [batchTaskPowerDetail]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    const [isModalOpen, setIsModalOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const isSubmitting = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
    // 提交任务
    const handleInfer = async ()=>{
        if (isSubmitting.current) {
            return;
        }
        if (!(0,_common_utils__WEBPACK_IMPORTED_MODULE_3__/* .verfiyInfer */ .yL)(taskResult, t)) return;
        isSubmitting.current = true;
        setRequestLoading(true);
        try {
            if (taskResult.mask) await samMask(taskResult.mask) // 需要主动调用一下save mask
            ;
            const value = await saveTaskDetail();
            if (value?.taskId) {
                const data = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .runTask */ .by)({
                    taskId,
                    agentName: agentName ?? "",
                    agentVersion: taskResult?.agentVersion
                });
                if (data?.taskId) {
                    setPowerBalance(data?.powerBalanceAmount);
                    infer();
                } else if (data?.code === "2007") {
                    setRequestLoading(false);
                    setIsModalOpen(true);
                }
            }
        } catch (e) {
            console.info(e);
        } finally{
            isSubmitting.current = false;
            setRequestLoading(false);
        }
    };
    const renderComponents = ()=>{
        switch(agentName){
            case "image2image":
            case "text2image":
                return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Ground_SDImg__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {});
            case "upscale":
                return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Maximize__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {});
            default:
                return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_CommonTask__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {});
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().edit),
        id: "myEdit",
        children: [
            renderComponents(),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().opreate),
                id: "opreate",
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().computerPowerWrap),
                        children: [
                            _common_constans_international__WEBPACK_IMPORTED_MODULE_11__/* .SHOW_COMPUTER_POWER */ .fo ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().consumeTip)} ag14`,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("taskConsume")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_8___default()), {
                                        src: "/cpu-charge.svg",
                                        width: 20,
                                        height: 20,
                                        alt: "cpu-charge",
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().cpuCharge)
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().consumeHighlightTip),
                                        children: needPower
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("computerPower")
                                    })
                                ]
                            }) : null,
                            taskResult?.batchTask && batchTaskPowerDetail ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_BatchPowerDetail__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {}) : null
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_16___default().generate),
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Button__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                style: {
                                    fontWeight: "500",
                                    flex: 1
                                },
                                onClick: ()=>{
                                    handleInfer();
                                },
                                children: t("generate")
                            }),
                            _common_constans__WEBPACK_IMPORTED_MODULE_15__/* .DEFAULT_AGENT_TIPS */ .Sg[agentName || ""]?.isSupportChangeVersion && userInfos?.agent15 ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_AgentVersion__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {}) : null
                        ]
                    })
                ]
            }),
            isModalOpen && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_PowerDefect__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                isModalOpen: isModalOpen,
                setIsModalOpen: setIsModalOpen
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4960:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1804);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_3__);





const BatchTask = ({ selectTaskWay  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    const [showBatch, setShowBatch] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const currentRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        const handleClickOutside = (event)=>{
            const target = event.target;
            if (currentRef.current && !currentRef.current.contains(target)) {
                setShowBatch(false);
            }
        };
        document.addEventListener("mousedown", handleClickOutside);
        return ()=>{
            document.removeEventListener("mousedown", handleClickOutside);
        };
    }, [
        currentRef
    ]);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().batchTask)}`,
        ref: currentRef,
        onClick: ()=>{
            setShowBatch(true);
        },
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                src: "/more.svg",
                alt: "loading",
                width: 16,
                height: 16,
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().batchIcon)
            }),
            showBatch ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().batchWrap),
                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().batchItem),
                    onClick: ()=>{
                        selectTaskWay(true);
                        setShowBatch(false);
                    },
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().item),
                        children: t("newBatchTask")
                    })
                })
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BatchTask);


/***/ }),

/***/ 4441:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7415);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8502);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9204);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_6__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_3__]);
_pages_api_base__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];









const TaskStatus = ({ item , getTaskList  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)("studio");
    const [current, setCurrent] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("");
    const ref = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
    const { taskId: [taskId, setTaskId]  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        const handleClickOutside = (event)=>{
            const target = event.target;
            if (ref.current && !ref.current.contains(target)) {
                setCurrent("");
            }
        };
        document.addEventListener("mousedown", handleClickOutside);
        return ()=>{
            document.removeEventListener("mousedown", handleClickOutside);
        };
    }, [
        ref
    ]);
    const quit = async ()=>{
        if (!taskId || !item?.canSuspend) return;
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_3__/* .suspendTask */ .Bj)({
            taskId
        });
        if (value) {
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({
                message: t("toast.suspendSuccess"),
                type: "success"
            });
        }
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: item.status === "Pending" || item.status === "Running" || item.status === "Segmenting" ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_6__.Tooltip, {
            placement: "right",
            title: item?.canSuspend ? t("suspendTask") : "",
            color: "#333030",
            children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().loadingWrap)} ${item?.canSuspend ? (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().suspend) : ""}`,
                onClick: (e)=>{
                    e.stopPropagation();
                    quit();
                },
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                        src: "/loading.svg",
                        alt: "loading",
                        width: 16,
                        height: 16,
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().loadingIcon)} progressLoading`
                    }),
                    item?.canSuspend ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().cube)
                    }) : null
                ]
            })
        }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().deleteWrap),
            children: [
                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    onClick: (e)=>{
                        e.stopPropagation();
                        setCurrent(item.taskId);
                    },
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().deletePonit),
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                        src: "/more.svg",
                        alt: "loading",
                        width: 16,
                        height: 16
                    })
                }),
                current === item.taskId ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    ref: ref,
                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default()["delete"])}`,
                    onClick: async (e)=>{
                        e.stopPropagation();
                        await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_3__/* .deleteTask */ ._5)({
                            taskId: item.taskId
                        });
                        if (taskId === item.taskId) {
                            setTaskId(null);
                        }
                        getTaskList();
                    },
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                            src: "/trash.svg",
                            width: 14,
                            height: 14,
                            alt: "delete",
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().deleteIcon)
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: t("delete")
                        })
                    ]
                }) : null
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TaskStatus);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9789:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5866);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_Status__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4441);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2228);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8502);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1653);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3413);
/* harmony import */ var _components_Batch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4960);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Status__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__]);
([_components_Status__WEBPACK_IMPORTED_MODULE_2__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);











const Task = ({ onChange  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const { taskId: [taskId, setTaskId] , agentName: [agentName] , pageRefreshState: [pageRefreshState] , inferResult: [, setInferResult] , inferStarList: [, setInferStarList] , needPower: [, setNeedPower] , userInfos: [userInfos]  } = (0,react__WEBPACK_IMPORTED_MODULE_4__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z);
    const [oldAgent, setOldAgent] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(agentName);
    const [taskPage, setTaskPage] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(1);
    const [isLastPage, setIsLastPage] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [taskList, setList] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]);
    // get task list
    const getTaskList = async (page)=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .getTask */ ._X)({
            page: page,
            agentName: agentName,
            noShowToast: true
        });
        if (!value?.list?.length) {
            setTaskId(null);
            setIsLastPage(false);
            setInferResult([]);
            setInferStarList([]);
        }
        setList(value?.list);
        setIsLastPage(value?.isLastPage ? value.isLastPage : false);
    };
    const pageTurning = (pageNum)=>{
        const element = document.getElementById("myList");
        if (element) element.scrollTop = 0;
        setTaskPage(pageNum);
    };
    // get task list loop
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        let currentPage = taskPage;
        let isRequestCompleted = true;
        if (oldAgent !== agentName) {
            setTaskPage(1);
            setOldAgent(agentName);
            currentPage = 1;
        }
        const fetchData = async ()=>{
            try {
                await getTaskList(currentPage);
            } catch (error) {
                console.error(error);
            }
            isRequestCompleted = true;
        };
        const startPolling = ()=>{
            if (!isRequestCompleted) return; // Skip if previous request hasn't completed yet
            isRequestCompleted = false // Set flag to indicate that a request is in progress
            ;
            fetchData();
        };
        startPolling();
        let intervalId = null;
        intervalId = setInterval(startPolling, 3000) // Start polling with a delay of 3 seconds
        ;
        return ()=>{
            if (intervalId) clearInterval(intervalId);
        };
    }, [
        agentName,
        taskPage,
        pageRefreshState
    ]);
    // 切换任务
    const changeTask = async (id)=>{
        const logParam = window?.logger.getParams(window?.logger.EID.COMMON_CLICK, window?.logger.EVENT_TYPE.CLICK, {
            type: "task",
            taskId: id,
            agentName
        });
        window?.logger.log([
            logParam
        ]);
        setTaskId(id);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        if (taskId) onChange();
    }, [
        taskId
    ]);
    // add task
    const addTask = async (taskType)=>{
        if (!agentName) return;
        // 打点
        const logParam = window?.logger.getParams(window?.logger.EID.COMMON_CLICK, window?.logger.EVENT_TYPE.CLICK, {
            type: "newTask",
            agentName,
            batchTask: taskType
        });
        window?.logger.log([
            logParam
        ]);
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .saveTask */ .F9)({
            agentName: agentName,
            paramType: _common_constans__WEBPACK_IMPORTED_MODULE_7__/* .DEFAULT_AGENT_TIPS */ .Sg[agentName].paramType,
            tagIds: [],
            batchTask: taskType,
            agentVersion: userInfos?.agent15 && _common_constans__WEBPACK_IMPORTED_MODULE_7__/* .DEFAULT_AGENT_TIPS */ .Sg[agentName].isSupportChangeVersion ? userInfos?.agentVersion ? userInfos.agentVersion : "v1.5" : "v1.0"
        });
        if (value) {
            setNeedPower(value?.power || 40);
            setTaskId(value.taskId);
            getTaskList(taskPage);
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().addTaskWrap),
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().addTask)}`,
                        onClick: ()=>{
                            addTask(false);
                        },
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                src: "/add_active.svg",
                                alt: "add",
                                width: 14,
                                height: 14,
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().addIcon)
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                children: t("newTask")
                            })
                        ]
                    }),
                    agentName && _common_constans__WEBPACK_IMPORTED_MODULE_7__/* .DEFAULT_AGENT_TIPS */ .Sg[agentName]?.isSupportBatchTask && _common_constans_international__WEBPACK_IMPORTED_MODULE_8__/* .SHOW_BATCH_TASK */ .nq ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Batch__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
                        selectTaskWay: addTask
                    }) : null
                ]
            }),
            taskList?.length ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().taskList),
                id: "myList",
                children: [
                    taskList.map((item, key)=>{
                        return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().item)} ${taskId === item.taskId ? (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().active) : ""}`,
                            onClick: ()=>{
                                changeTask(item.taskId);
                            },
                            children: [
                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().origin)}`,
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                                            src: `${item?.image || "/mask.svg"}`,
                                            width: 40,
                                            height: 40,
                                            alt: "original",
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().image),
                                            unoptimized: true
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().taskName),
                                            children: item.name
                                        }),
                                        item.status ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                            className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().statusText)}`,
                                            children: item.status === "Pending" ? t("taskStatus.pending") : item.status === "Running" ? t("taskStatus.running") : item.status === "Segmenting" ? t("taskStatus.sgmenting") : item.status === "Success" ? t("taskStatus.success") : ""
                                        }) : null
                                    ]
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().status),
                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Status__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                                        item: item,
                                        getTaskList: ()=>getTaskList(taskPage)
                                    })
                                })
                            ]
                        }, key);
                    }),
                    taskPage === 1 && isLastPage ? null : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().pageTurn),
                        children: [
                            taskPage !== 1 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().turnButton)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().homeButton)}`,
                                        onClick: ()=>{
                                            if (taskPage !== 1) pageTurning(1);
                                        },
                                        children: t("home")
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().turnButton)}`,
                                        onClick: ()=>{
                                            if (taskPage !== 1) pageTurning(taskPage - 1);
                                        },
                                        children: t("previous")
                                    })
                                ]
                            }) : null,
                            !isLastPage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_10___default().turnButton)}`,
                                onClick: ()=>{
                                    if (!isLastPage) pageTurning(taskPage + 1);
                                },
                                children: t("next")
                            }) : null
                        ]
                    })
                ]
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Task);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3812:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(969);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_Task__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9789);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_Nav_components_Edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3618);
/* harmony import */ var _components_Agent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9829);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8502);
/* harmony import */ var _components_AgentTips__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3028);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Task__WEBPACK_IMPORTED_MODULE_2__, _components_Nav_components_Edit__WEBPACK_IMPORTED_MODULE_4__, _pages_api_base__WEBPACK_IMPORTED_MODULE_7__]);
([_components_Task__WEBPACK_IMPORTED_MODULE_2__, _components_Nav_components_Edit__WEBPACK_IMPORTED_MODULE_4__, _pages_api_base__WEBPACK_IMPORTED_MODULE_7__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










const Nav = ()=>{
    const { taskId: [taskId] , inferResult: [, setInferResult] , inferStarList: [, setInferStarList] , taskDetail , segementModal: [segementModal] , showEdit: [showEdit, setShowEdit] , requestLoading: [, setRequestLoading] , agentName: [agentName] , startTaskExecutions: [, setStartExecutions]  } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
    // change task
    const changeTaskTab = async ()=>{
        setStartExecutions(false);
        const { list =[]  } = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_7__/* .taskExecutions */ .Dl)({
            taskId,
            noShowToast: true,
            page: 1
        }) || {};
        if (list?.length) {
            setInferResult(list);
            getStartList();
            taskDetail();
            setShowEdit(false);
            setStartExecutions(true);
        } else {
            taskDetail();
            setInferResult([]);
            setInferStarList([]);
            setShowEdit(true);
        }
    };
    const getStartList = async ()=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_7__/* .taskExecutionStars */ .LH)({
            taskId
        });
        setInferStarList(value ?? []);
    };
    const editAgain = async ()=>{
        if (!showEdit) {
            const logParam = window?.logger.getParams("10000002", window?.logger.EVENT_TYPE.CLICK, {
                taskId,
                agentName
            });
            window?.logger.log([
                logParam
            ]);
            setRequestLoading(true);
            await taskDetail();
            setRequestLoading(false);
        }
        setShowEdit(!showEdit);
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().nav),
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Agent__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {}),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().task),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_AgentTips__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {}),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Task__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                        onChange: changeTaskTab
                    })
                ]
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().openEdit),
                children: [
                    showEdit && taskId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().mask),
                                onClick: ()=>{
                                    setShowEdit(false);
                                }
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav_components_Edit__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                                // key={taskId}
                                infer: ()=>{
                                    changeTaskTab();
                                }
                            })
                        ]
                    }),
                    taskId ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().openIcon)} ${showEdit && (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().open)} ${segementModal ? (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().close) : ""}`,
                        onClick: ()=>{
                            editAgain();
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                            src: "/dropDown.svg",
                            alt: "arrow",
                            width: 16,
                            height: 16,
                            className: showEdit ? (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().show) : (_style_module_css__WEBPACK_IMPORTED_MODULE_9___default().close)
                        })
                    }) : null
                ]
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Nav);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8651:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(509);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Toast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9204);
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8810);
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4950);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8208);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1653);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _ManualMask__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2678);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8502);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([underscore__WEBPACK_IMPORTED_MODULE_4__, _pages_api_base__WEBPACK_IMPORTED_MODULE_10__]);
([underscore__WEBPACK_IMPORTED_MODULE_4__, _pages_api_base__WEBPACK_IMPORTED_MODULE_10__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
/* eslint-disable @next/next/no-img-element */ /* eslint-disable react/jsx-no-comment-textnodes */ /* eslint-disable jsx-a11y/alt-text */ 













const NewGenerateMask = ({ iWidth , iHeight , imageData  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const { agentName: [agentName] , taskId: [taskId] , taskResult: [taskResult] , segementModal: [segementModal, setSegmentModal] , mainCutMask: [, setMainCutMask] , handleTaskResult , samMask  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    const [index, setIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1);
    const [maskImage, setMask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const [selectImg, setSelectImg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([
        taskResult?.mask
    ]);
    const [containerAtrr, setContainerAtrr] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();
    const [scale, setScale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1);
    const [isModalOpen, setIsModalOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [XY, setPosition] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
        x: -1,
        y: -1
    });
    const [manualMask, setManualMask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)("");
    const handleMouseMove = underscore__WEBPACK_IMPORTED_MODULE_4__.throttle((event)=>{
        const { x , y  } = (0,_util__WEBPACK_IMPORTED_MODULE_11__/* .getOffsetv2 */ .p6)(event);
        setPosition({
            x,
            y
        });
        if (XY.x < 0 || XY.y < 0) return;
        const position = Math.ceil(XY.x) * iHeight * scale + Math.ceil(XY.y) * scale;
        const cums = imageData?.map((ann)=>ann?.segmentation?.cums);
        const index = (0,_util__WEBPACK_IMPORTED_MODULE_11__/* .getIndex */ .rw)(cums, position);
        if (index < 0) return;
        setIndex(index);
    }, 200);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (iWidth > 800) {
            setScale(2);
            setContainerAtrr({
                width: Math.ceil(iWidth / 2),
                height: Math.ceil(iHeight / 2)
            });
        } else {
            setScale(1);
            setContainerAtrr({
                width: iWidth,
                height: iHeight
            });
        }
    }, [
        iWidth,
        iHeight
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (index < 0) return;
        const canvas = document.createElement("canvas");
        const ctx = canvas.getContext("2d");
        canvas.width = iWidth;
        canvas.height = iHeight;
        const result = imageData ? (0,_util__WEBPACK_IMPORTED_MODULE_11__/* .getMask */ .Vi)(imageData[index]?.segmentation || []) || [] : [];
        if (!result.length) return;
        for(let row = 0; row < result?.length; row++){
            for(let col = 0; col < result[row]?.length; col++){
                const cell = result[row][col];
                if (cell === 1) {
                    if (ctx) {
                        ctx.fillStyle = "rgba(117, 48, 254, 0.5)";
                        ctx.fillRect(row, col, 1, 1);
                    }
                }
            }
        }
        const image = (0,_util__WEBPACK_IMPORTED_MODULE_11__/* .canvasToImage */ .dK)(canvas);
        if (image.src) {
            if (!selectImg?.includes(image.src)) {
                setMask(image.src);
            }
        }
    }, [
        index,
        iWidth,
        iHeight
    ]);
    const saveMask = async ()=>{
        if (maskImage && !selectImg?.includes(maskImage)) {
            const list = selectImg.filter((item)=>item);
            list.push(maskImage);
            setSelectImg(list);
        }
    };
    // 清除重新选择切片
    const clear = ()=>{
        if (taskResult) {
            handleTaskResult("mask", "", true);
        }
        setSelectImg([]);
    };
    // 撤回
    const revoke = ()=>{
        if (selectImg?.length) {
            const newSelectImg = [
                ...selectImg
            ];
            newSelectImg.splice(newSelectImg.length - 1, 1);
            setSelectImg(newSelectImg);
        }
    };
    // 提交切片
    const confirm = ()=>{
        if (!selectImg.length) {
            (0,_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                message: t("toast.keepSelect"),
                duration: 3000
            });
            return;
        }
        (0,_common_utils__WEBPACK_IMPORTED_MODULE_5__/* .compositeImage */ .kS)(selectImg, iWidth, iHeight).then((dataUrl)=>{
            if (taskResult) {
                // 需要手动调用接口保存mask
                handleTaskResult("mask", dataUrl, true);
                samMask(dataUrl);
                setSegmentModal(false);
            }
        }).catch((error)=>{
            console.log(error);
            (0,_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                message: t("toast.keepSelectFail"),
                duration: 3000
            });
        });
    };
    const selectManualMask = ()=>{
        if (selectImg.length) {
            (0,_common_utils__WEBPACK_IMPORTED_MODULE_5__/* .compositeImage */ .kS)(selectImg, iWidth, iHeight).then((dataUrl)=>{
                setManualMask(dataUrl);
                setIsModalOpen(true);
            }).catch((error)=>{
                console.log(error);
            });
        } else {
            setIsModalOpen(true);
        }
    };
    const [mainCutLoading, setMainCutLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const mainCut = async ()=>{
        setMainCutLoading(true);
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_10__/* .getBodySegment */ .Eb)({
            taskId,
            image: taskResult?.showImage || "",
            noShowToast: true
        });
        if (value?.base64Mask) {
            setSelectImg([
                value.base64Mask
            ]);
            setMainCutMask(value.base64Mask);
            setMainCutLoading(false);
        } else if (value?.status === "Closed") {
            (0,_Toast__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
                message: t("toast.mainError")
            });
            setMainCutLoading(false);
        }
    };
    const counterSelect = ()=>{
        const canvas = document.createElement("canvas");
        const ctx = canvas.getContext("2d");
        canvas.width = iWidth;
        canvas.height = iHeight;
        if (!ctx) return;
        if (selectImg.length === 0) {
            ctx.fillStyle = "rgba(117, 48, 254, 0.5)";
            ctx.fillRect(0, 0, iWidth, iHeight);
            const base64Image = canvas.toDataURL() // Generates base64 representation of the image
            ;
            const newSelectImg = [
                base64Image
            ];
            setSelectImg(newSelectImg);
        } else {
            (0,_common_utils__WEBPACK_IMPORTED_MODULE_5__/* .compositeImage */ .kS)(selectImg, iWidth, iHeight, true).then((dataUrl)=>{
                const newSelectImg = [
                    dataUrl
                ];
                setSelectImg(newSelectImg);
            }).catch((error)=>{
                console.log(error);
            });
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
        children: [
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_8__.Modal, {
                open: segementModal === null ? false : segementModal,
                width: `100%`,
                footer: false,
                closable: false,
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().modalMask),
                style: {
                    top: 0,
                    padding: 0,
                    margin: 0,
                    maxWidth: "100%"
                },
                maskStyle: {
                    background: "rgba(20, 20, 20, 0.9)"
                },
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().closeModalIcon),
                        onClick: ()=>{
                            setSegmentModal(false);
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                            src: "/close.svg",
                            alt: "close_icon",
                            width: 40,
                            height: 40
                        })
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().message)} ag16`,
                        children: t("tool.title")
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_8__.Spin, {
                        spinning: mainCutLoading,
                        size: "large",
                        style: {
                            maxHeight: containerAtrr?.height + "px"
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().content),
                            style: {
                                height: containerAtrr?.height + "px"
                            },
                            children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().wrap),
                                style: {
                                    width: containerAtrr?.width + "px",
                                    height: containerAtrr?.height + "px"
                                },
                                onMouseMove: (event)=>{
                                    event.stopPropagation();
                                    handleMouseMove(event);
                                },
                                onMouseLeave: ()=>underscore__WEBPACK_IMPORTED_MODULE_4__.defer(()=>{
                                        setPosition({
                                            x: -1,
                                            y: -1
                                        });
                                        setMask("");
                                    }),
                                onTouchStart: (event)=>{
                                    event.stopPropagation();
                                    handleMouseMove(event);
                                },
                                onClick: ()=>{
                                    saveMask();
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("img", {
                                        src: taskResult?.showImage || "",
                                        alt: "test",
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().image)
                                    }),
                                    maskImage && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("img", {
                                        id: "maskImage",
                                        src: maskImage,
                                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().maskImag)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().image)}`
                                    }),
                                    selectImg?.length && selectImg[0] ? selectImg.map((item, index)=>{
                                        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("img", {
                                            src: item,
                                            className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().selectImg)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().image)}`
                                        }, index);
                                    }) : null
                                ]
                            })
                        })
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().opreate),
                        children: [
                            _common_constans__WEBPACK_IMPORTED_MODULE_7__/* .MAIN_CUT_AGENT.includes */ .Q8.includes(agentName) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btn)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().clear)} ag16`,
                                onClick: mainCut,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().startBtnSvg),
                                        src: "/gallery.svg",
                                        alt: "clear",
                                        width: 20,
                                        height: 20
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: " "
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("tool.main")
                                    })
                                ]
                            }) : null,
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btn)} ${_common_constans__WEBPACK_IMPORTED_MODULE_7__/* .MAIN_CUT_AGENT.includes */ .Q8.includes(agentName) ? (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().revoke) : (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().clear)} ag16`,
                                onClick: clear,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        className: _common_constans__WEBPACK_IMPORTED_MODULE_7__/* .MAIN_CUT_AGENT.includes */ .Q8.includes(agentName) ? (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btnSvg) : (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().startBtnSvg),
                                        src: "/rotate-right.svg",
                                        alt: "clear",
                                        width: 20,
                                        height: 20
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: " "
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("tool.reset")
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btn)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().revoke)} ag16`,
                                onClick: revoke,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btnSvg),
                                        src: "/return.svg",
                                        alt: "revoke",
                                        width: 20,
                                        height: 20
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: " "
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("tool.undo")
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btn)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().revoke)} ag16`,
                                onClick: counterSelect,
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btnSvg),
                                        src: "/counterSelect.svg",
                                        alt: "revoke",
                                        width: 20,
                                        height: 20
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: " "
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("tool.counterSelect")
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btn)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().revoke)} ag16`,
                                onClick: ()=>{
                                    selectManualMask();
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btnSvg),
                                        src: "/brush.svg",
                                        alt: "brush",
                                        width: 20,
                                        height: 20
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: " "
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("tool.brush")
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().endBtn)} ${(_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().comfirm)} ag16`,
                                onClick: ()=>{
                                    confirm();
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_13___default().btnSvg),
                                        src: "/tick-square.svg",
                                        alt: "revoke",
                                        width: 20,
                                        height: 20
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: " "
                                    }),
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        children: t("tool.done")
                                    })
                                ]
                            })
                        ]
                    })
                ]
            }),
            isModalOpen ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_ManualMask__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
                isModalOpen: isModalOpen,
                setIsModalOpen: setIsModalOpen,
                mask: manualMask,
                width: iWidth,
                height: iHeight
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NewGenerateMask);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 4950:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Vi": () => (/* binding */ getMask),
/* harmony export */   "dK": () => (/* binding */ canvasToImage),
/* harmony export */   "p6": () => (/* binding */ getOffsetv2),
/* harmony export */   "rw": () => (/* binding */ getIndex)
/* harmony export */ });
/* unused harmony exports imageWidth, imageHeight, containerWidth, containerHeight, binarySearch, getOffset */
const imageWidth = 1079;
const imageHeight = 1382;
const containerWidth = 540;
const containerHeight = 691;
function getMask(segmentation) {
    const [h, w] = segmentation.size;
    let mask = new Array(h * w).fill(false);
    let idx = 0;
    let parity = false;
    for (const count of segmentation.counts){
        for(let i = 0; i < count; i++){
            mask[idx + i] = Number(parity);
        }
        idx += count;
        parity = !parity;
    }
    const result = new Array(w);
    for(let i = 0; i < w; i++){
        result[i] = mask.slice(i * h, (i + 1) * h);
    }
    return result;
}
function binarySearch(arr, target) {
    // debugger
    const array = [
        0
    ].concat(arr);
    let left = 0;
    let right = array.length - 1;
    let result = 0;
    while(left <= right){
        const mid = Math.floor((left + right) / 2);
        if (array[mid] <= target) {
            result = mid;
            left = mid + 1;
        } else {
            right = mid - 1;
        }
    }
    return result;
}
function getOffset(event) {
    const imageScale = imageWidth / event.target.offsetWidth;
    const scale = Math.min(containerWidth / imageWidth, containerHeight / imageHeight);
    const offsetX = (containerWidth - imageWidth * scale) / 2;
    const offsetY = (containerHeight - imageHeight * scale) / 2;
    const xRelativeToImage = (event.clientX - offsetX) / scale;
    const yRelativeToImage = (event.clientY - offsetY) / scale;
    return {
        x: xRelativeToImage,
        y: yRelativeToImage,
        imageScale: imageScale
    };
}
function canvasToImage(canvas) {
    const image = new Image();
    image.src = canvas.toDataURL("image/png");
    return image;
}
function getOffsetv2(event) {
    const rect = event.target.getBoundingClientRect();
    const x = event.clientX - rect.left;
    const y = event.clientY - rect.top;
    return {
        x,
        y
    };
}
function getIndex(cums, position) {
    let index = 0;
    if (cums) {
        index = cums.map((cum)=>binarySearch(cum, position) % 2).indexOf(1);
    }
    return index;
}


/***/ }),

/***/ 230:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3402);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_ImageList_components_ShowTemplate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8761);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7987);
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8208);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([react_i18next__WEBPACK_IMPORTED_MODULE_3__]);
react_i18next__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];






const DetailPrompt = ({ showCaseInfo  })=>{
    const { t  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)([
        "studio",
        "common"
    ]);
    const type_menu = {
        textDescription: t("studio:paramType.textDescription"),
        template: t("studio:paramType.template"),
        prompt: t("studio:paramType.prompt"),
        replicate: t("studio:paramType.replicate"),
        Image2Image: t("studio:paramType.prompt"),
        Text2Image: t("studio:paramType.prompt")
    };
    const copyText = ()=>{
        let value = "";
        if (showCaseInfo.textDescription) {
            value = showCaseInfo.textDescription;
        } else {
            value = showCaseInfo.posPrompt || "";
            if (showCaseInfo.negPrompt) value = value + " --n " + showCaseInfo.negPrompt;
        }
        (0,_common_utils__WEBPACK_IMPORTED_MODULE_4__/* .commonCopyText */ .jz)(value, {}, t("common:toast.copySuccess"));
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: `ag16 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().showPrompt)}`,
        children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().promptDetail),
            children: [
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: `ag18 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().title)}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: type_menu[showCaseInfo?.paramType || "textDescription"]
                        }),
                        showCaseInfo?.paramType !== "template" ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: `ag12 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().copy)}`,
                            onClick: copyText,
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {
                                    src: "/copy.svg",
                                    width: 12,
                                    height: 12,
                                    alt: "copy-icon",
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().copyIcon)
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                    children: t("studio:copy")
                                })
                            ]
                        }) : null
                    ]
                }),
                showCaseInfo?.posPrompt || showCaseInfo?.textDescription ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: `ag16 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().posPrompt)}`,
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: showCaseInfo.posPrompt
                        }),
                        showCaseInfo.negPrompt ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().dividing),
                                    children: " --n "
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                    children: showCaseInfo.negPrompt
                                })
                            ]
                        }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: " "
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                            children: showCaseInfo.textDescription
                        })
                    ]
                }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().showTemplate),
                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ImageList_components_ShowTemplate__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
                        item: showCaseInfo
                    })
                })
            ]
        })
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DetailPrompt);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9724:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2574);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_Toast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9204);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8502);
/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7987);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, react_i18next__WEBPACK_IMPORTED_MODULE_3__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, react_i18next__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);






const StarToTask = ({ id , setSubmitted , isSubmitted , mouseChange  })=>{
    const { t  } = (0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.useTranslation)("studio");
    // 投稿
    const contribute = async ()=>{
        if (isSubmitted) return;
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .showCaseSubmission */ .pW)({
            id: id ?? ""
        });
        if (value) {
            setSubmitted(true);
            (0,_components_Toast__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({
                message: t("toast.submissionSuccess"),
                duration: 3000,
                type: "success"
            });
        }
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().contribute)} ${isSubmitted ? (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().contributeDefault) : null}`,
        onClick: ()=>{
            contribute();
        },
        onMouseEnter: ()=>{
            if (mouseChange) {
                mouseChange(true);
            }
        },
        onMouseLeave: ()=>{
            if (mouseChange) {
                mouseChange(false);
            }
        },
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                src: isSubmitted ? "/send_active.svg" : "/send.svg",
                width: 20,
                height: 20,
                alt: "share",
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_5___default().taskIcon)
            }),
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                children: isSubmitted ? t("submitted") : t("submission")
            })
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StarToTask);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 1267:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(290);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8502);
/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7428);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _ShowPrompt__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(230);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3413);
/* harmony import */ var _StarToTask__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9724);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, _ShowPrompt__WEBPACK_IMPORTED_MODULE_5__, _StarToTask__WEBPACK_IMPORTED_MODULE_7__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_2__, _ShowPrompt__WEBPACK_IMPORTED_MODULE_5__, _StarToTask__WEBPACK_IMPORTED_MODULE_7__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
/* eslint-disable @next/next/no-img-element */ 








const Detail = ({ setShowDetail , showDetail , id , tag , isSubmitted , setSubmitted  })=>{
    const [showCaseInfo, setInfo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
        isSubmitted: false
    });
    const [originHover, setOriginHover] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [finalImageHover, setFinalHover] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [height, setHeight] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
    const [width, setWidth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (!id) return;
        getInfo();
    }, [
        id
    ]);
    const getInfo = async ()=>{
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_2__/* .getShowCaseDetail */ .mV)({
            id,
            tag
        });
        if (value?.finalImage) {
            setInfo(value);
        }
    };
    const outsideClick = (event)=>{
        const clickedElement = event.target;
        if (document.getElementById("caseDetail") === clickedElement || document.getElementById("originImage") === clickedElement || document.getElementById("finalImage") === clickedElement) {
            setShowDetail(false);
        }
    };
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().detail),
        children: showCaseInfo?.finalImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Modal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
            width: "100%",
            title: "",
            isModalOpen: showDetail,
            setIsModalOpen: setShowDetail,
            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().detailModal),
            children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().showDetail),
                id: "caseDetail",
                onClick: outsideClick,
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().head),
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().closeModalIcon),
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_4___default()), {
                                src: "/close.svg",
                                width: 24,
                                height: 24,
                                alt: "close",
                                onClick: ()=>{
                                    setShowDetail(false);
                                }
                            })
                        })
                    }),
                    showCaseInfo?.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().originImage),
                        id: "originImage",
                        onMouseMove: ()=>{
                            setOriginHover(true);
                        },
                        onMouseLeave: ()=>setOriginHover(false),
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("img", {
                                src: showCaseInfo?.image || "",
                                alt: "origin",
                                className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().image)} ${originHover ? (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().hover) : ""}`
                            }),
                            originHover && showCaseInfo?.maskBase64 ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("img", {
                                src: showCaseInfo?.maskBase64 || "",
                                alt: "maskBase",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().maskBase64)
                            }) : null
                        ]
                    }) : null,
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().finalImage)} ${showCaseInfo?.image ? "" : (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().noOrigin)}`,
                        id: "finalImage",
                        onMouseMove: ()=>{
                            const element = document.getElementById("showCaseFinal");
                            if (element) {
                                setHeight(element.clientHeight);
                                setWidth(element?.clientWidth);
                            }
                            setFinalHover(true);
                        },
                        onMouseLeave: ()=>setFinalHover(false),
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("img", {
                                src: showCaseInfo?.finalImage || "",
                                alt: "origin",
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().image),
                                id: "showCaseFinal"
                            }),
                            finalImageHover ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().opreateWrap),
                                style: {
                                    height: height + "px",
                                    width: width - 40 + "px"
                                },
                                children: [
                                    tag === "star" && showCaseInfo && _common_constans_international__WEBPACK_IMPORTED_MODULE_6__/* .IS_SUBMIT_TASK */ .HR ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().starSub),
                                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_StarToTask__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
                                            id: id,
                                            isSubmitted: isSubmitted,
                                            setSubmitted: setSubmitted
                                        })
                                    }) : null,
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_ShowPrompt__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
                                        showCaseInfo: showCaseInfo
                                    })
                                ]
                            }) : null
                        ]
                    }),
                    _common_constans_international__WEBPACK_IMPORTED_MODULE_6__/* .SHOW_WATER_MASK */ .Lf ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_4___default()), {
                        src: _common_constans_international__WEBPACK_IMPORTED_MODULE_6__/* .IMAGE_WATER_MASK */ .HK,
                        width: 200,
                        height: 74,
                        alt: "water-mask",
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().waterMask)
                    }) : null
                ]
            })
        }) : null
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Detail);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 6469:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5586);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_ImageList_components_Opreate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5802);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_ImageList_components_Opreate__WEBPACK_IMPORTED_MODULE_2__]);
_components_ImageList_components_Opreate__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];





const Item = ({ data , dataChange , containerWidth , jumpToDetail , showOpreate , starCallback , unStars  })=>{
    const [hover, setHover] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
    const [hold, setHold] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
    const getHeight = (path)=>{
        if (!path) return;
        const newUrl = path.replace("_preview.webp", "");
        const index1 = newUrl.lastIndexOf("_");
        const index2 = newUrl.lastIndexOf(".");
        const arr = newUrl.substring(index1 + 1, index2).split("x");
        const w = parseInt(arr[0], 10);
        const h = parseInt(arr[1], 10);
        return containerWidth * h / w;
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().imageWrap),
        style: {
            width: `${containerWidth}px`,
            height: `${getHeight(data.showImage)}px`
        },
        onMouseMove: ()=>{
            setHover(data.unitId);
        },
        onMouseLeave: ()=>{
            setHover(null);
        },
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_1___default()), {
                src: data.showImage,
                width: containerWidth,
                height: 100,
                onClick: ()=>{
                    jumpToDetail(data);
                },
                alt: "test",
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_4___default().image),
                unoptimized: true
            }),
            showOpreate && (hover == data.unitId || hold == data.unitId) ? //taskName, executeSeq, index在星标中都没有
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ImageList_components_Opreate__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
                executionInfo: {
                    taskId: data.taskId,
                    taskName: null,
                    executionId: data.executionId,
                    executeSeq: null,
                    agentVersion: data.agentVersion
                },
                imageInfo: {
                    unitId: data.unitId,
                    image: data.image,
                    isStar: !unStars.find((it)=>it == data.unitId),
                    index: null
                },
                holdChange: setHold,
                starCallback: starCallback,
                submittedInfo: {
                    id: data.id,
                    isSubmitted: data.isSubmitted,
                    submittedChange: (it)=>{
                        dataChange({
                            ...data,
                            isSubmitted: it
                        });
                    }
                }
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Item);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3665:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3331);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8502);
/* harmony import */ var _Detail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1267);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _Item__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6469);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3413);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pages_api_base__WEBPACK_IMPORTED_MODULE_3__, _Detail__WEBPACK_IMPORTED_MODULE_4__, _Item__WEBPACK_IMPORTED_MODULE_6__]);
([_pages_api_base__WEBPACK_IMPORTED_MODULE_3__, _Detail__WEBPACK_IMPORTED_MODULE_4__, _Item__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










const containerWidth = 252;
const WaterFall = ({ activeTab , setShowTab  })=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)("studio");
    const { agentName: [agentName]  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z);
    const [cols, setCols] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1);
    const [feedHeightArr, setFeedHeightArr] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    const [list, setList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    const [lastInsertIndex, setLastInsertIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
    const [renderIndex, setRendeIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1);
    const isRendering = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
    const [feedListArr, setFeedListArr] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    const page = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(1);
    const offset = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0);
    const [show, setShow] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [showDetail, setShowDetail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const [detailInfo, setDetailInfo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();
    const isRequestCompleted = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(true);
    const lastScrollTop = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(-1);
    const isEnd = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
    const isCanScroll = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
    const [unStars, setUnStars] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        const winWidth = document.documentElement.clientWidth || document.body.clientWidth || window.innerWidth;
        const wallWidth = winWidth - 440;
        const cols = Math.floor(wallWidth / (containerWidth + 16));
        if (cols > 0) {
            const arr = Array(cols).fill([]);
            setFeedListArr(arr);
            setCols(cols);
        }
    }, []);
    const jumpToDetail = (data)=>{
        setDetailInfo(data);
        setShowDetail(true);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        const element = document.getElementById("output");
        if (cols >= 0) {
            getData();
            element?.addEventListener("scroll", handleScroll) // 绑定滚动事件
            ;
        }
        return ()=>{
            element?.removeEventListener("scroll", handleScroll) // 在组件卸载时解绑滚动事件
            ;
        };
    }, [
        cols
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (renderIndex < 0) return;
        requestAnimationFrame(renderFeed);
    }, [
        renderIndex
    ]);
    const getData = async ()=>{
        if (!agentName) return;
        isRequestCompleted.current = false;
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_3__/* .getShowCase */ .Ud)({
            agentName,
            page: page.current,
            tag: activeTab,
            offset: page.current === 1 ? 0 : offset.current
        });
        setShow(true);
        if (page.current === 1) {
            setUnStars([]);
        }
        page.current = page.current + 1;
        setList((prevList)=>prevList.concat(value?.list || []));
        isEnd.current = value?.isEnd;
        isRequestCompleted.current = true;
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (_common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IS_ONLY_SHOW_STAR */ .zG) setShowTab(list?.length > 0);
        if (list.length > 0 && isRequestCompleted.current) {
            renderFeed();
        }
    }, [
        list
    ]);
    // feed渲染
    const renderFeed = ()=>{
        if (list.length === 0 || renderIndex >= list.length - 1 || isRendering.current) {
            isCanScroll.current = true;
            return;
        }
        isRendering.current = true;
        isCanScroll.current = false;
        if (!feedHeightArr.length) {
            for(let i = 0; i < cols; i++){
                const height = document.getElementById(`item_coloum_${i}`)?.offsetHeight || 0;
                feedHeightArr.push(height);
            }
        } else {
            feedHeightArr[lastInsertIndex] = document.getElementById(`item_coloum_${lastInsertIndex}`)?.offsetHeight || 0;
        }
        setFeedHeightArr([
            ...feedHeightArr
        ]);
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        if (!feedHeightArr.length) return;
        const minHeight = Math.min.apply(null, feedHeightArr);
        getMinhIndex(feedHeightArr, minHeight).then((min)=>{
            const last = parseInt(String(min), 10);
            const feedData = list[renderIndex + 1];
            feedListArr[last] = feedListArr[last].concat({
                i: renderIndex + 1,
                data: feedData,
                top: minHeight + 24
            });
            setLastInsertIndex(last);
            setFeedListArr([
                ...feedListArr
            ]);
            setRendeIndex(renderIndex + 1);
            isRendering.current = false;
        });
    }, [
        feedHeightArr
    ]);
    // 最小高度的列数索引
    const getMinhIndex = (arr, value)=>{
        return new Promise((resolve)=>{
            let minIndex = 0;
            for(const i in arr){
                if (arr[i] === value) {
                    minIndex = parseInt(i, 10);
                    resolve(minIndex);
                }
            }
        });
    };
    const handleScroll = ()=>{
        const element = document.getElementById("output");
        // 当前滚动条高度
        const scrollTop = element?.scrollTop || 0;
        // 底部检测高度
        const bottom = document.getElementById("bottomDetection");
        if (!bottom) return;
        const bottomDetectionTop = bottom.offsetTop;
        const tempLastScrollTop = lastScrollTop.current;
        lastScrollTop.current = scrollTop;
        if (scrollTop > tempLastScrollTop) {
            const wallHeight = document.documentElement.clientHeight || document.body.clientHeight || window.innerHeight;
            if (bottomDetectionTop - tempLastScrollTop < wallHeight * 1.5 && !isRendering.current && !isEnd.current && isRequestCompleted.current && isCanScroll.current) {
                requestAnimationFrame(getData);
            }
        }
    };
    const starCallback = (unitId, isStar)=>{
        if (isStar) {
            setUnStars((preState)=>preState.filter((it)=>it != unitId));
        } else {
            setUnStars((preState)=>preState.concat([
                    unitId
                ]));
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        offset.current = -unStars.length;
    }, [
        unStars
    ]);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: `${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().waterfall)} ${_common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IS_ONLY_SHOW_STAR */ .zG ? list?.length ? "" : (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().noData) : ""}`,
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().showCaseWrap),
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().wrap),
                    style: {
                        width: cols * (containerWidth + 16) + "px"
                    },
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().clearfix),
                            children: feedListArr.map((i, key)=>{
                                return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().column),
                                    id: `item_coloum_${key}`,
                                    children: i.map((item, index)=>{
                                        return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {
                                            children: item?.data?.showImage ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Item__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
                                                data: item?.data,
                                                containerWidth: containerWidth,
                                                jumpToDetail: jumpToDetail,
                                                showOpreate: activeTab === "star",
                                                unStars: unStars,
                                                starCallback: starCallback,
                                                dataChange: (data)=>{
                                                    setFeedListArr((preState)=>preState.map((pi, pkey)=>{
                                                            if (key === pkey) {
                                                                return pi.map((it)=>it?.data?.id == data.id ? {
                                                                        ...it,
                                                                        data
                                                                    } : it);
                                                            } else {
                                                                return pi;
                                                            }
                                                        }));
                                                }
                                            }) : null
                                        }, index);
                                    })
                                }, key);
                            })
                        }),
                        show ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: `ag14 ${(_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().empty)}`,
                            id: "bottomDetection",
                            children: isEnd.current ? !feedHeightArr?.length && activeTab === "star" ? _common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IS_ONLY_SHOW_STAR */ .zG ? "" : t("emptyStar") : "" : t("loading")
                        }) : null
                    ]
                })
            }),
            showDetail ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Detail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
                setShowDetail: setShowDetail,
                id: detailInfo.id,
                showDetail: showDetail,
                tag: activeTab,
                isSubmitted: detailInfo.isSubmitted,
                setSubmitted: (submitted)=>{
                    const data = {
                        ...detailInfo,
                        isSubmitted: submitted
                    };
                    setDetailInfo(data);
                    setFeedListArr((preState)=>preState.map((pi)=>{
                            return pi.map((it)=>it?.data?.id == data.id ? {
                                    ...it,
                                    data
                                } : it);
                        }));
                }
            }) : null
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WaterFall);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 727:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(513);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_module_css__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5725);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(antd__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _components_WaterFall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3665);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2228);
/* harmony import */ var _pages_api_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8502);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1377);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_i18next__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3413);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_WaterFall__WEBPACK_IMPORTED_MODULE_3__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__]);
([_components_WaterFall__WEBPACK_IMPORTED_MODULE_3__, _pages_api_base__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);










const ShowCase = ()=>{
    const { t  } = (0,next_i18next__WEBPACK_IMPORTED_MODULE_6__.useTranslation)("studio");
    const { agentName: [agentName] , taskId: [taskId]  } = (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z);
    const [tabs, setTabs] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)("star");
    const [shouldRender, setShouldRender] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0);
    const [showRed, setShowRed] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [showTab, setShowTab] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(!_common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IS_ONLY_SHOW_STAR */ .zG);
    const onChange = (key)=>{
        scroll();
        setActive(key);
        setShouldRender(Math.random());
        if (key === "showcase" && showRed) {
            readUpdate();
        }
    };
    const readUpdate = async ()=>{
        await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .viewRecord */ .i2)({
            agentName: agentName || ""
        });
        setShowRed(false);
    };
    const isUpdate = async ()=>{
        if (!agentName) return;
        const value = await (0,_pages_api_base__WEBPACK_IMPORTED_MODULE_5__/* .getBadge */ .Xq)({
            agentName
        });
        setShowRed(value);
    };
    const scroll = ()=>{
        const element = document.getElementById("output");
        if (element) {
            element.scrollTop = 0;
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        isUpdate();
        scroll();
        setActive("star");
        setShouldRender(Math.random());
    }, [
        agentName,
        taskId
    ]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(()=>{
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        const arr = [];
        _common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .WORKSPACE_TABS.map */ .HG.map((item)=>{
            if (item === "star") {
                arr.push({
                    key: item,
                    label: t("myStar")
                });
            }
            if (item === "showcase") {
                arr.push({
                    key: item,
                    label: t("excellentCase")
                });
            }
        });
        setTabs(arr);
    }, []);
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().showCase),
        children: [
            showTab ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().tabs),
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(antd__WEBPACK_IMPORTED_MODULE_1__.Tabs, {
                        activeKey: active,
                        items: tabs,
                        onChange: onChange
                    }),
                    showRed && !_common_constans_international__WEBPACK_IMPORTED_MODULE_7__/* .IS_ONLY_SHOW_STAR */ .zG ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_style_module_css__WEBPACK_IMPORTED_MODULE_8___default().tips)
                    }) : null
                ]
            }) : null,
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_WaterFall__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
                activeTab: active,
                setShowTab: setShowTab
            }, shouldRender)
        ]
    });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShowCase);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 3895:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   "getStaticProps": () => (/* binding */ getStaticProps)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7570);
/* harmony import */ var _styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _components_Layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2758);
/* harmony import */ var _components_ImageList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9777);
/* harmony import */ var _components_Nav__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3812);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2228);
/* harmony import */ var next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5460);
/* harmony import */ var next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _components_HomePage_components_HelperI18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4946);
/* harmony import */ var _components_HomePage_components_Helper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4273);
/* harmony import */ var _components_Broadcast__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2140);
/* harmony import */ var _components_Mobile__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(9929);
/* harmony import */ var _components_ShowCase__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(727);
/* harmony import */ var _common_constans__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(1653);
/* harmony import */ var _common_constans_international__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3413);
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9648);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Layout__WEBPACK_IMPORTED_MODULE_1__, _components_ImageList__WEBPACK_IMPORTED_MODULE_2__, _components_Nav__WEBPACK_IMPORTED_MODULE_3__, _components_Broadcast__WEBPACK_IMPORTED_MODULE_10__, _components_ShowCase__WEBPACK_IMPORTED_MODULE_12__, axios__WEBPACK_IMPORTED_MODULE_15__]);
([_components_Layout__WEBPACK_IMPORTED_MODULE_1__, _components_ImageList__WEBPACK_IMPORTED_MODULE_2__, _components_Nav__WEBPACK_IMPORTED_MODULE_3__, _components_Broadcast__WEBPACK_IMPORTED_MODULE_10__, _components_ShowCase__WEBPACK_IMPORTED_MODULE_12__, axios__WEBPACK_IMPORTED_MODULE_15__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);

















const KEY_VER = "weshop_version";
const Studio = ()=>{
    const [isMobile, setIsMobile] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [isBroadcast, setIsBroadcast] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(true);
    const [isCustomerService, setIsCustomerService] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [isPublicAccountHover, setPublicAccountHover] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const [isPublicAccountShow, setPublicAccountShow] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
    const { taskId: [taskId]  } = (0,react__WEBPACK_IMPORTED_MODULE_4__.useContext)(_components_hooks_createContext__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z);
    // 版本检查
    const [visible, setVisible] = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(true);
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        axios__WEBPACK_IMPORTED_MODULE_15__["default"].get("/version.json", {
            timeout: 10000
        }).then((res)=>{
            const version = res.data.version;
            if (version) {
                localStorage.setItem(KEY_VER, version.toString());
            }
        });
        const handleVisibilityChange = ()=>{
            if (document.visibilityState === "visible") {
                setVisible(true);
                checkVersion();
            } else {
                setVisible(false);
            }
        };
        document.addEventListener("visibilitychange", handleVisibilityChange);
        return ()=>{
            document.removeEventListener("visibilitychange", handleVisibilityChange);
        };
    }, []);
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        if (visible) {
            const intervalId = setInterval(()=>{
                checkVersion();
            }, 180000);
            return ()=>{
                clearInterval(intervalId);
            };
        }
    }, [
        visible
    ]);
    const checkVersion = ()=>{
        axios__WEBPACK_IMPORTED_MODULE_15__["default"].get("/version.json", {
            timeout: 10000
        }).then((res)=>{
            const version = res.data.version;
            const localVerison = localStorage.getItem(KEY_VER);
            if (version) {
                localStorage.setItem(KEY_VER, version.toString());
                if (!localVerison || /^\d+$/.test(version) && parseInt(localVerison) < parseInt(version)) {
                    setTimeout(()=>{
                        window.location.reload();
                    }, 1000);
                }
            }
        });
    };
    (0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(()=>{
        const isMobileDevice = /(android|iphone|ipad|mobile)/i.test(navigator.userAgent);
        setIsMobile(isMobileDevice);
    }, []);
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Layout__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
        children: isMobile ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Mobile__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {}) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
            children: [
                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().homeContent),
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Nav__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {}),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().output),
                            id: "output",
                            children: taskId ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ImageList__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {}) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_ShowCase__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {})
                        })
                    ]
                }),
                _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .IS_LOCAL */ .Kc ? null : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                    className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().buttonFloat),
                    children: _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .IS_CN */ .RD ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                        children: [
                            _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .SHOW_WECHAT_ACCOUNT */ .du ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatButton),
                                style: {
                                    marginRight: "8px",
                                    width: isPublicAccountHover ? "144px" : "40px"
                                },
                                onClick: ()=>{
                                    setIsBroadcast(false);
                                    setPublicAccountShow(true);
                                },
                                onMouseEnter: ()=>{
                                    setPublicAccountHover(true);
                                },
                                onMouseLeave: ()=>{
                                    setPublicAccountHover(false);
                                    setPublicAccountShow(false);
                                },
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                        className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatIcon),
                                        src: "/wechat_icon.svg",
                                        alt: "public_account",
                                        width: 20,
                                        height: 20
                                    }),
                                    isPublicAccountHover && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                        className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatText),
                                        children: "关注微信公众号"
                                    })
                                ]
                            }) : null,
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatButton),
                                style: {
                                    width: "40px"
                                },
                                onClick: ()=>{
                                    setIsBroadcast(false);
                                    setIsCustomerService(true);
                                },
                                onMouseLeave: ()=>{
                                    setIsCustomerService(false);
                                },
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                                    className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatIcon),
                                    src: "/helper.svg",
                                    alt: "helper",
                                    width: 20,
                                    height: 20
                                })
                            })
                        ]
                    }) : /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatButton),
                        onClick: ()=>{
                            setIsCustomerService(true);
                        },
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_5___default()), {
                            className: (_styles_Studio_module_css__WEBPACK_IMPORTED_MODULE_16___default().floatIcon),
                            src: "/helper.svg",
                            alt: "helper",
                            width: 20,
                            height: 20
                        })
                    })
                }),
                _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .SHOW_BROADCASE */ .z4 && isBroadcast && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Broadcast__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
                    setIsBroadcast: setIsBroadcast
                }),
                isPublicAccountShow ? _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .IS_CN */ .RD ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_HomePage_components_Helper__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
                    qRCodeImg: _common_constans__WEBPACK_IMPORTED_MODULE_13__/* .publicAccoutImg */ .Zb,
                    position: "absolute",
                    mainTitle: "关注我们",
                    subTitle: "扫码关注WeShop唯象妙境公众号",
                    bottom: "94px",
                    right: "88px"
                }) : null : null,
                isCustomerService ? _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .IS_CN */ .RD ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_HomePage_components_Helper__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
                    qRCodeImg: _common_constans__WEBPACK_IMPORTED_MODULE_13__/* .qrcodeImg */ .lz,
                    mainTitle: "联系我们",
                    subTitle: "扫码添加小助手",
                    bottom: "94px",
                    right: "40px"
                }) : _common_constans_international__WEBPACK_IMPORTED_MODULE_14__/* .IS_EN */ .jY ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_HomePage_components_HelperI18n__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
                    isOpen: isCustomerService,
                    setOpen: setIsCustomerService
                }) : null : null
            ]
        })
    });
};
const getStaticProps = async ({ locale  })=>({
        props: {
            ...await (0,next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_7__.serverSideTranslations)(locale ?? "zh-CN", [
                "studio",
                "common"
            ])
        }
    });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Studio);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 5725:
/***/ ((module) => {

"use strict";
module.exports = require("antd");

/***/ }),

/***/ 1377:
/***/ ((module) => {

"use strict";
module.exports = require("next-i18next");

/***/ }),

/***/ 5460:
/***/ ((module) => {

"use strict";
module.exports = require("next-i18next/serverSideTranslations");

/***/ }),

/***/ 3918:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/amp-context.js");

/***/ }),

/***/ 5732:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/amp-mode.js");

/***/ }),

/***/ 2796:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/head-manager-context.js");

/***/ }),

/***/ 4486:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-blur-svg.js");

/***/ }),

/***/ 744:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-config-context.js");

/***/ }),

/***/ 5843:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-config.js");

/***/ }),

/***/ 9552:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-loader");

/***/ }),

/***/ 2470:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/side-effect.js");

/***/ }),

/***/ 618:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/utils/warn-once.js");

/***/ }),

/***/ 968:
/***/ ((module) => {

"use strict";
module.exports = require("next/head");

/***/ }),

/***/ 1853:
/***/ ((module) => {

"use strict";
module.exports = require("next/router");

/***/ }),

/***/ 6689:
/***/ ((module) => {

"use strict";
module.exports = require("react");

/***/ }),

/***/ 997:
/***/ ((module) => {

"use strict";
module.exports = require("react/jsx-runtime");

/***/ }),

/***/ 9621:
/***/ ((module) => {

"use strict";
module.exports = require("ua-parser-js");

/***/ }),

/***/ 9648:
/***/ ((module) => {

"use strict";
module.exports = import("axios");;

/***/ }),

/***/ 7987:
/***/ ((module) => {

"use strict";
module.exports = import("react-i18next");;

/***/ }),

/***/ 3135:
/***/ ((module) => {

"use strict";
module.exports = import("react-markdown");;

/***/ }),

/***/ 8810:
/***/ ((module) => {

"use strict";
module.exports = import("underscore");;

/***/ })

};
;

// load runtime
var __webpack_require__ = require("../webpack-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [636,675,751,758,288,425], () => (__webpack_exec__(3895)));
module.exports = __webpack_exports__;

})();