'use strict';
import { editResourceInternalFormKeys } from '../edit-resources-constants.js';
import { fileUploadTypes } from '../../../../fd-toolbox/enums/enums.js';
import { firstOrUndefined } from '../../../../fd-toolbox/server/collections/single-funcs.js';

var __defProp=Object['defineProperty'],__name=(_0x32467c,_0x4bc2b1)=>__defProp(_0x32467c,'name',{'value':_0x4bc2b1,'configurable':!![]});function onImageChange(_0x1884a9,_0x4d53a7,_0x993729,_0xc6a4,_0x41de39,_0xb05760){if(_0x41de39){const _0x36f3a4=_0x4d53a7['getValues'](editResourceInternalFormKeys['blobFiles'])??[],_0x194dfc=_0x36f3a4;_0x4d53a7['setValue'](editResourceInternalFormKeys['blobFiles'],[..._0x194dfc,..._0x993729]);}else {const _0xe8d77f=_0x1884a9['fileUploadType']===fileUploadTypes['multiple']?_0xc6a4['join'](',\x20'):firstOrUndefined(_0xc6a4)??'';_0x4d53a7['setValue'](_0x1884a9['name'],_0xe8d77f),_0xb05760?.(_0xe8d77f,_0x1884a9['name']);}}__name(onImageChange,'onImageChange');function onImageDelete(_0x2e1182,_0x521ef8,_0x26420a,_0xd7381e,_0xff4b3a,_0x43c5ea){if(_0xff4b3a){const _0x2a2a1a=_0x521ef8['getValues'](editResourceInternalFormKeys['blobFiles'])??[];_0x521ef8['setValue'](editResourceInternalFormKeys['blobFiles'],_0x2a2a1a['filter'](_0x358d5c=>_0x358d5c['name']!==_0xd7381e));}else {const _0x390f57=_0x2e1182['fileUploadType']===fileUploadTypes['multiple']?_0x26420a['filter'](_0x4a661a=>_0x4a661a!==_0xd7381e)['join'](',\x20'):'';_0x521ef8['setValue'](_0x2e1182['name'],_0x390f57),_0x43c5ea?.(_0x390f57,_0x2e1182['name']);}}__name(onImageDelete,'onImageDelete');

export { onImageChange, onImageDelete };
