package com.jeesharp.business.member.controller;

import com.jeesharp.business.modules.member.application.MobileAuthApplication;
import com.jeesharp.business.modules.member.dto.CancelAccountDTO;
import com.jeesharp.business.modules.member.dto.ChangePasswordDTO;
import com.jeesharp.business.modules.member.dto.RealNameAuthDTO;
import com.jeesharp.business.modules.member.dto.RefreshTokenDTO;
import com.jeesharp.business.modules.member.entity.LoginResultVO;
import com.jeesharp.business.member.vo.UserCenterVO;
import com.jeesharp.business.member.support.MemberLetterInboxMobileSupport;
import com.jeesharp.business.modules.member.application.MemberApplicationService;
import com.jeesharp.business.modules.member.application.MemberFavoriteApplicationService;
import com.jeesharp.business.modules.member.dto.MemberSaveDTO;
import com.jeesharp.business.modules.member.vo.MemberInfoVO;
import com.jeesharp.framework.memberauth.utils.MemberAuthUtils;
import com.jeesharp.framework.memberauth.web.BaseMobileController;
import com.jeesharp.framework.pojo.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.*;

/**
 * 移动端用户中心接口
 * <p>
 * 整合个人信息所有相关数据，为APP/小程序/H5提供统一的用户中心数据接口
 * </p>
 *
 * @author jeesharp
 */
@Slf4j
@RestController
@RequestMapping("${jeesharp.web.mobilePath}/member/userCenter")
@Tag(name = "移动端-用户中心", description = "用户中心相关接口，整合个人信息所有数据")
@AllArgsConstructor
public class UserCenterMobileController extends BaseMobileController {

    private final MemberApplicationService memberApplicationService;

    private final MobileAuthApplication mobileAuthApplication;

    private final MemberLetterInboxMobileSupport memberLetterInboxMobileSupport;

    private final MemberFavoriteApplicationService memberFavoriteApplicationService;

    // ==================== 用户中心首页 ====================

    /**
     * 获取用户中心首页数据
     * <p>
     * 整合所有个人信息相关的数据，包括：
     * <ul>
     *   <li>基本信息：昵称、头像、手机号等</li>
     *   <li>会员等级：等级、成长值、特权等</li>
     *   <li>资产概览：积分、余额、优惠券等</li>
     *   <li>订单统计：待付款、待发货、待收货等</li>
     *   <li>认证状态：实名、绑定手机、绑定微信等</li>
     *   <li>签到信息：今日是否签到、连续签到天数等</li>
     *   <li>消息通知：未读消息数</li>
     * </ul>
     * </p>
     */
    @Operation(summary = "获取用户中心首页数据", description = "整合个人信息所有相关数据")
    @GetMapping("/index")
    public AjaxResult<UserCenterVO> index() {
        // 获取当前登录用户ID
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        log.info("获取用户中心数据: memberId={}", memberId);
        // 获取会员基本信息
        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }
        // 构建用户中心数据
        UserCenterVO userCenter = buildUserCenterVO(memberInfo);
        return AjaxResult.okData(userCenter);
    }

    /**
     * 获取用户中心首页数据（简化版）
     * <p>
     * 只返回首页必要的数据，减少数据传输量
     * </p>
     */
    @Operation(summary = "获取用户中心首页数据（简化版）", description = "只返回首页必要的数据")
    @GetMapping("/indexSimple")
    public AjaxResult<Map<String, Object>> indexSimple() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }
        // 构建简化版数据
        Map<String, Object> data = new HashMap<>();
        data.put("memberId", memberInfo.getId());
        data.put("nickname", memberInfo.getNickname());
        data.put("avatar", memberInfo.getAvatar());
        data.put("levelName", memberInfo.getLevelName());
        data.put("levelIcon", getLevelIcon(memberInfo.getLevelCode()));
        data.put("availablePoints", memberInfo.getAvailablePoints());
        data.put("balance", memberInfo.getBalance());
        return AjaxResult.okData(data);
    }

    // ==================== 个人信息 ====================

    /**
     * 获取个人信息详情
     */
    @Operation(summary = "获取个人信息详情")
    @GetMapping("/profile")
    public AjaxResult<Map<String, Object>> profile() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }
        // 构建个人信息详情
        Map<String, Object> data = new HashMap<>();
        data.put("memberId", memberInfo.getId());
        data.put("memberNo", memberInfo.getMemberNo());
        data.put("nickname", memberInfo.getNickname());
        data.put("realName", memberInfo.getRealName());
        data.put("avatar", memberInfo.getAvatar());
        data.put("gender", memberInfo.getGender());
        data.put("genderName", getGenderName(memberInfo.getGender()));
        data.put("mobile", maskMobile(memberInfo.getMobile()));
        data.put("email", memberInfo.getEmail());
        data.put("birthday", memberInfo.getBirthday());
        data.put("province", memberInfo.getProvince());
        data.put("city", memberInfo.getCity());
        data.put("remarks", memberInfo.getRemarks());
        data.put("district", memberInfo.getDistrict());
        data.put("isRealName", memberInfo.getIsRealName());
        data.put("isCompleteProfile", memberInfo.getIsCompleteProfile());
        return AjaxResult.okData(data);
    }

    /**
     * 修改个人信息
     */
    @Operation(summary = "修改个人信息")
    @PostMapping("/updateProfile")
    public AjaxResult<Void> updateProfile(@RequestBody MemberSaveDTO dto) {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        dto.setId(memberId);
        log.info("修改个人信息: memberId={}, nickname={}", memberId, dto.getNickname());
        memberApplicationService.updateMemberInfo(dto);
        return AjaxResult.ok("修改成功");
    }

    /**
     * 修改头像
     */
    @Operation(summary = "修改头像")
    @PostMapping("/updateAvatar")
    public AjaxResult<Void> updateAvatar(@RequestBody Map<String, String> params) {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        String avatar = params.get("avatar");
        if (avatar == null || avatar.isBlank()) {
            return AjaxResult.failMsg("头像地址不能为空");
        }
        log.info("修改头像: memberId={}", memberId);
       memberApplicationService.updateAvatar(memberId, avatar);
        return AjaxResult.ok("修改成功");
    }

    /**
     * 修改昵称
     */
    @Operation(summary = "修改昵称")
    @PostMapping("/updateNickname")
    public AjaxResult<Void> updateNickname(@RequestBody Map<String, String> params) {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        String nickname = params.get("nickname");
        if (nickname == null || nickname.isBlank()) {
            return AjaxResult.failMsg("昵称不能为空");
        }
        log.info("修改昵称: memberId={}, nickname={}", memberId, nickname);
        memberApplicationService.updateNickname(memberId, nickname);
        return AjaxResult.ok("修改成功");
    }

    // ==================== 实名认证 ====================

    /**
     * 获取实名认证状态
     */
    @Operation(summary = "获取实名认证状态")
    @GetMapping("/realNameStatus")
    public AjaxResult<Map<String, Object>> realNameStatus() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }
        Map<String, Object> data = new HashMap<>();
        data.put("isRealName", memberInfo.getIsRealName());
        data.put("realName", maskName(memberInfo.getRealName()));
        return AjaxResult.okData(data);
    }

    /**
     * 实名认证
     */
    @Operation(summary = "实名认证")
    @PostMapping("/realNameAuth")
    public AjaxResult<Map<String, Object>> realNameAuth(@RequestBody @Valid RealNameAuthDTO dto) {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        log.info("实名认证: memberId={}, realName={}", memberId, dto.getRealName());
        memberApplicationService.realNameAuth(memberId, dto.getRealName(),dto.getIdCard());
        Map<String, Object> data = new HashMap<>();
        data.put("isRealName", 1);
        return AjaxResult.ok("实名认证成功", data);
    }

    // ==================== 账户安全 ====================

    /**
     * 获取账户安全信息
     */
    @Operation(summary = "获取账户安全信息")
    @GetMapping("/security")
    public AjaxResult<Map<String, Object>> security() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }

        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }

        Map<String, Object> data = new HashMap<>();
        // 手机绑定状态
        data.put("isBindMobile", memberInfo.getMobile() != null ? 1 : 0);
        data.put("mobile", maskMobile(memberInfo.getMobile()));
        // 微信绑定状态 TODO: 从会员表获取第三方绑定信息
        data.put("isBindWechat", 0);
        // 支付宝绑定状态
        data.put("isBindAlipay", 0);
        // 苹果绑定状态
        data.put("isBindApple", 0);
        // 实名认证状态
        data.put("isRealName", memberInfo.getIsRealName());
        // 密码设置状态
        data.put("isSetPassword", 1); // TODO: 从用户表获取
        // 支付密码设置状态
        data.put("isSetPayPassword", 0); // TODO: 从用户表获取
        return AjaxResult.okData(data);
    }

    // ==================== 登录会话与安全（需登录，refreshToken 除外见接口说明）====================

    /**
     * 刷新访问令牌：凭 body 中的 refreshToken 续期（access_token 失效时仍可用），与 Sa-Token 逻辑一致。
     */
    @Operation(summary = "刷新Token", description = "使用登录后下发的 refreshToken 续期；不依赖请求头 access_token 仍有效")
    @PostMapping("/refreshToken")
    public AjaxResult<LoginResultVO> refreshToken(@RequestBody @Valid RefreshTokenDTO dto) {
        LoginResultVO result = mobileAuthApplication.refreshToken(dto.getRefreshToken());
        return AjaxResult.okData(result);
    }

    @Operation(summary = "退出登录")
    @PostMapping("/logout")
    public AjaxResult<Void> logout() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        mobileAuthApplication.logout();
        return AjaxResult.ok("退出成功");
    }

    @Operation(summary = "注销账号")
    @PostMapping("/cancel")
    public AjaxResult<Void> cancel(@RequestBody @Valid CancelAccountDTO dto) {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        mobileAuthApplication.cancelAccount(dto);
        return AjaxResult.ok("账号已注销");
    }

    @Operation(summary = "修改密码")
    @PostMapping("/changePassword")
    public AjaxResult<Void> changePassword(@RequestBody @Valid ChangePasswordDTO dto) {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }
        mobileAuthApplication.changePassword(dto);
        return AjaxResult.ok("密码修改成功");
    }

    // ==================== 资产概览 ====================

    /**
     * 获取资产概览
     */
    @Operation(summary = "获取资产概览", description = "积分、余额、优惠券等资产汇总")
    @GetMapping("/assets")
    public AjaxResult<Map<String, Object>> assets() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }

        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }

        Map<String, Object> data = new HashMap<>();
        // 积分
        data.put("availablePoints", memberInfo.getAvailablePoints());
        data.put("frozenPoints", memberInfo.getFrozenPoints());
        data.put("totalPoints", memberInfo.getTotalPoints());
        data.put("usedPoints", memberInfo.getUsedPoints());
        // 余额
        data.put("balance", memberInfo.getBalance());
        data.put("frozenBalance", memberInfo.getFrozenPoints());
        // 优惠券
        data.put("couponCount", 5); // TODO: 从优惠券服务获取
        data.put("expiringSoonCouponCount", 2); // TODO: 从优惠券服务获取
        // 红包（如有）
        data.put("redPacketAmount", new BigDecimal("0.00"));

        return AjaxResult.okData(data);
    }

    // ==================== 会员等级 ====================

    /**
     * 获取会员等级信息
     */
    @Operation(summary = "获取会员等级信息")
    @GetMapping("/level")
    public AjaxResult<Map<String, Object>> level() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }

        MemberInfoVO memberInfo = memberApplicationService.getMember(memberId);
        if (memberInfo == null) {
            return AjaxResult.failMsg("会员信息不存在");
        }

        Map<String, Object> data = new HashMap<>();
        // 当前等级
        data.put("levelCode", memberInfo.getLevelCode());
        data.put("levelName", memberInfo.getLevelName());
        data.put("levelIcon", getLevelIcon(memberInfo.getLevelCode()));
        data.put("growthValue", memberInfo.getGrowthValue());
        // 下一等级
        data.put("nextLevelName", "铂金会员"); // TODO: 从等级服务获取
        data.put("nextLevelGrowth", 20000);
        data.put("remainGrowth", 20000 - (memberInfo.getGrowthValue() != null ? memberInfo.getGrowthValue() : 0));
        // 等级进度
        int growthValue = memberInfo.getGrowthValue() != null ? memberInfo.getGrowthValue() : 0;
        int progress = Math.min(100, (growthValue * 100) / 20000);
        data.put("growthProgress", progress);
        // 等级特权
        data.put("discountRate", new BigDecimal("0.95"));
        data.put("pointsRate", new BigDecimal("1.5"));
        data.put("privileges", Arrays.asList("95折优惠", "1.5倍积分", "生日200积分", "专属客服"));

        // 所有等级列表
        List<Map<String, Object>> allLevels = new ArrayList<>();
        allLevels.add(Map.of("levelCode", "NORMAL", "levelName", "普通会员", "minGrowthValue", 0, "current", false));
        allLevels.add(Map.of("levelCode", "SILVER", "levelName", "白银会员", "minGrowthValue", 1000, "current", false));
        allLevels.add(Map.of("levelCode", "GOLD", "levelName", "黄金会员", "minGrowthValue", 5000, "current", "GOLD".equals(memberInfo.getLevelCode())));
        allLevels.add(Map.of("levelCode", "PLATINUM", "levelName", "铂金会员", "minGrowthValue", 20000, "current", false));
        allLevels.add(Map.of("levelCode", "DIAMOND", "levelName", "钻石会员", "minGrowthValue", 50000, "current", false));
        data.put("allLevels", allLevels);

        return AjaxResult.okData(data);
    }

    // ==================== 订单统计 ====================

    /**
     * 获取订单统计
     */
    @Operation(summary = "获取订单统计", description = "各状态订单数量")
    @GetMapping("/orderStats")
    public AjaxResult<Map<String, Object>> orderStats() {
        String memberId = MemberAuthUtils.getLoginId();
        if (memberId == null) {
            return AjaxResult.needLogin();
        }

        // TODO: 从订单服务获取
        Map<String, Object> data = new HashMap<>();
        data.put("pendingPaymentCount", 2);   // 待付款
        data.put("pendingShipmentCount", 1);  // 待发货
        data.put("pendingReceiveCount", 3);   // 待收货
        data.put("pendingReviewCount", 1);    // 待评价
        data.put("afterSaleCount", 0);        // 售后中
        data.put("totalOrderCount", 28);      // 全部订单

        return AjaxResult.okData(data);
    }

    // ==================== 常用功能入口 ====================

    /**
     * 获取常用功能列表
     */
    @Operation(summary = "获取常用功能列表", description = "用户中心的功能入口配置")
    @GetMapping("/functions")
    public AjaxResult<List<Map<String, Object>>> functions() {
        List<Map<String, Object>> functions = new ArrayList<>();

        // 我的订单
        functions.add(Map.of("code", "ORDER", "name", "我的订单", "icon", "icon-order", "url", "/pages/order/list"));
        // 优惠券
        functions.add(Map.of("code", "COUPON", "name", "优惠券", "icon", "icon-coupon", "url", "/pages/coupon/list"));
        // 积分
        functions.add(Map.of("code", "POINTS", "name", "我的积分", "icon", "icon-points", "url", "/pages/points/index"));
        // 余额
        functions.add(Map.of("code", "BALANCE", "name", "我的余额", "icon", "icon-balance", "url", "/pages/balance/index"));
        // 收藏
        functions.add(Map.of("code", "FAVORITE", "name", "我的收藏", "icon", "icon-favorite", "url", "/pages/favorite/list"));
        // 足迹
        functions.add(Map.of("code", "HISTORY", "name", "浏览足迹", "icon", "icon-history", "url", "/pages/history/list"));
        // 地址
        functions.add(Map.of("code", "ADDRESS", "name", "收货地址", "icon", "icon-address", "url", "/pages/address/list"));
        // 邀请
        functions.add(Map.of("code", "INVITE", "name", "邀请有礼", "icon", "icon-invite", "url", "/pages/invite/index"));
        // 签到
        functions.add(Map.of("code", "SIGNIN", "name", "每日签到", "icon", "icon-signin", "url", "/pages/signin/index"));
        // 客服
        functions.add(Map.of("code", "SERVICE", "name", "联系客服", "icon", "icon-service", "url", "/pages/service/index"));
        // 设置
        functions.add(Map.of("code", "SETTING", "name", "设置", "icon", "icon-setting", "url", "/pages/setting/index"));

        return AjaxResult.okData(functions);
    }

    // ==================== 私有方法 ====================

    /**
     * 构建用户中心VO
     */
    private UserCenterVO buildUserCenterVO(MemberInfoVO memberInfo) {
        UserCenterVO vo = new UserCenterVO();

        // 基本信息
        vo.setMemberId(memberInfo.getId());
        vo.setMemberNo(memberInfo.getMemberNo());
        vo.setNickname(memberInfo.getNickname());
        vo.setRealName(memberInfo.getRealName());
        vo.setAvatar(memberInfo.getAvatar());
        vo.setGender(memberInfo.getGender());
        vo.setMobile(maskMobile(memberInfo.getMobile()));
        vo.setEmail(memberInfo.getEmail());
        vo.setBirthday(memberInfo.getBirthday() != null ? memberInfo.getBirthday().toString() : null);

        // 会员等级
        vo.setLevelCode(memberInfo.getLevelCode());
        vo.setLevelName(memberInfo.getLevelName());
        vo.setLevelIcon(getLevelIcon(memberInfo.getLevelCode()));
        vo.setGrowthValue(memberInfo.getGrowthValue());
        vo.setNextLevelName("铂金会员"); // TODO: 从等级服务获取
        vo.setNextLevelGrowth(20000);
        int growthValue = memberInfo.getGrowthValue() != null ? memberInfo.getGrowthValue() : 0;
        vo.setRemainGrowth(20000 - growthValue);
        vo.setGrowthProgress(Math.min(100, (growthValue * 100) / 20000));
        vo.setDiscountRate(new BigDecimal("0.95"));
        vo.setPointsRate(new BigDecimal("1.5"));

        // 资产概览
        vo.setAvailablePoints(memberInfo.getAvailablePoints());
        vo.setFrozenPoints(memberInfo.getFrozenPoints());
        vo.setBalance(memberInfo.getBalance());
        vo.setFrozenBalance(new BigDecimal("0.00")); // TODO: 从会员表获取
        vo.setCouponCount(5); // TODO: 从优惠券服务获取
        vo.setExpiringSoonCouponCount(2);

        // 订单统计 TODO: 从订单服务获取
        vo.setPendingPaymentCount(2);
        vo.setPendingShipmentCount(1);
        vo.setPendingReceiveCount(3);
        vo.setPendingReviewCount(1);
        vo.setAfterSaleCount(0);

        // 邀请信息
        vo.setInviteCode(memberInfo.getInviteCode());
        vo.setInviteCount(memberInfo.getInviteCount());
        vo.setInviteRewardPoints(1200); // TODO: 从邀请记录计算

        // 认证状态
        vo.setIsRealName(memberInfo.getIsRealName());
        vo.setIsCompleteProfile(memberInfo.getIsCompleteProfile());
        vo.setIsBindMobile(memberInfo.getMobile() != null ? 1 : 0);
        vo.setIsSetPassword(1);
        vo.setIsBindWechat(0); // TODO: 从会员表获取第三方绑定信息

        // 签到信息 TODO: 从签到服务获取
        vo.setTodaySigned(false);
        vo.setContinuousSignDays(4);

        long unread = memberLetterInboxMobileSupport.countUnread(memberInfo.getId());
        vo.setUnreadMessageCount(unread > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) unread);

        // 会员特权
        vo.setPrivileges(Arrays.asList("95折优惠", "1.5倍积分", "生日200积分", "专属客服"));

        // 其他
        vo.setRegisterDate(memberInfo.getRegisterDate() != null ? memberInfo.getRegisterDate().toString() : null);
        vo.setTotalConsumeAmount(memberInfo.getTotalConsumeAmount());
        vo.setTotalConsumeCount(memberInfo.getTotalConsumeCount());
        long favoriteCount = memberFavoriteApplicationService.countByMemberId(memberInfo.getId());
        vo.setFavoriteProductCount(favoriteCount > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) favoriteCount);
        vo.setBrowseHistoryCount(58);   // TODO: 从足迹服务获取
        vo.setAddressCount(3);          // TODO: 从地址服务获取

        return vo;
    }

    /**
     * 手机号脱敏
     */
    private String maskMobile(String mobile) {
        if (mobile == null || mobile.length() < 11) {
            return mobile;
        }
        return mobile.substring(0, 3) + "****" + mobile.substring(7);
    }

    /**
     * 姓名脱敏
     */
    private String maskName(String name) {
        if (name == null || name.isEmpty()) {
            return name;
        }
        if (name.length() == 2) {
            return name.charAt(0) + "*";
        }
        if (name.length() > 2) {
            return name.charAt(0) + "*".repeat(name.length() - 2) + name.charAt(name.length() - 1);
        }
        return name;
    }

    /**
     * 获取性别名称
     */
    private String getGenderName(Integer gender) {
        if (gender == null) {
            return "未知";
        }
        return switch (gender) {
            case 1 -> "男";
            case 2 -> "女";
            default -> "未知";
        };
    }

    /**
     * 根据等级编码获取等级图标
     */
    private String getLevelIcon(String levelCode) {
        if (levelCode == null) {
            return null;
        }
        // TODO: 从等级服务获取图标，这里返回示例URL
        return switch (levelCode) {
            case "NORMAL" -> "/assets/level/normal.png";
            case "SILVER" -> "/assets/level/silver.png";
            case "GOLD" -> "/assets/level/gold.png";
            case "PLATINUM" -> "/assets/level/platinum.png";
            case "DIAMOND" -> "/assets/level/diamond.png";
            default -> "/assets/level/normal.png";
        };
    }
}
