<?php

namespace App\Http\Controllers\V1;

use App\Http\Controllers\Controller;
use App\Core\Service\PropertyRoomService;
use App\Core\Service\PropertyRoomTypeService;
use Illuminate\Http\Request;
use App\Core\Service\PropertyRoomBedTypeService;
use App\Core\Service\PropertyRoomViewTypeService;
use App\Core\Service\PropertyChannelMappingService ;

use App;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Config;
use Exception;
use App\Exceptions\ApiErrorException;

class PropertyRoomController
{


    private $request;
    private $propertyRoomService;
    private $propertyRoomTypeService;
    private $propertyRoomBedTypeService;
    private $propertyRoomViewTypeService;
    private $propertyChannelMappingService;


    public function __construct(
        Request $request,
        PropertyChannelMappingService $propertyChannelMappingService,
        PropertyRoomService $propertyRoomService,
        PropertyRoomTypeService $propertyRoomTypeService,
        PropertyRoomBedTypeService $propertyRoomBedTypeService,
        PropertyRoomViewTypeService $propertyRoomViewTypeService
    )
    {
        $this->request = $request;
        $this->propertyRoomService = $propertyRoomService;
        $this->propertyRoomTypeService = $propertyRoomTypeService;
        $this->propertyRoomBedTypeService = $propertyRoomBedTypeService;
        $this->propertyRoomViewTypeService = $propertyRoomViewTypeService;
        $this->propertyChannelMappingService = $propertyChannelMappingService ;

    }



    public function getPropertyRoom(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
            ];

            $propertyRoomType = $this->propertyRoomService->getPropertyRooms($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function addPropertyRoom(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'name' => fillOnUndefined($params, 'name'),
                'room_type_id' => fillOnUndefined($params, 'room_type_id'),
                'max_occupancy' => fillOnUndefined($params, 'max_occupancy'),
                'max_adult' => fillOnUndefined($params, 'max_adult'),
                'max_child' => fillOnUndefined($params, 'max_child'),
                'occupancy_lock' => fillOnUndefined($params, 'occupancy_lock'),
                'room_size' => fillOnUndefined($params, 'room_size'),
                'room_size_type' => fillOnUndefined($params, 'room_size_type'),
                'room_type_count' => fillOnUndefined($params, 'room_type_count',1),
                'room_count' => fillOnUndefined($params, 'room_count'),
                'bathroom_count' => fillOnUndefined($params, 'bathroom_count'),
                'toilet_count' => fillOnUndefined($params, 'toilet_count'),
                'lounge_count' => fillOnUndefined($params, 'lounge_count'),
                'max_child_number' => fillOnUndefined($params, 'max_child_number'),
                'description' => fillOnUndefined($params, 'description'),
                'user_id' => $this->request->auth->id,
            ];


            $propertyRoomType = $this->propertyRoomService->addPropertyRoom($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function addPropertyRoomAndBed(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'name' =>  trim(fillOnUndefined($params, 'name')),
                'room_type_id' => fillOnUndefined($params, 'room_type_id'),
                'max_occupancy' => fillOnUndefined($params, 'max_occupancy'),
                'max_adult' => fillOnUndefined($params, 'max_adult'),
                'max_child' => fillOnUndefined($params, 'max_child'),
                'occupancy_lock' => fillOnUndefined($params, 'occupancy_lock'),
                'exclude_occupancy' => fillOnUndefined($params, 'exclude_occupancy'),
                'room_size' => fillOnUndefined($params, 'room_size', null),
                'room_size_type' => fillOnUndefined($params, 'room_size_type', null),
                'room_type_count' => fillOnUndefined($params, 'room_type_count', 1),
                'room_count' => fillOnUndefined($params, 'room_count', null),
                'bathroom_count' => fillOnUndefined($params, 'bathroom_count', null),
                'toilet_count' => fillOnUndefined($params, 'toilet_count', null),
                'lounge_count' => fillOnUndefined($params, 'lounge_count', null),
                'max_child_number' => fillOnUndefined($params, 'max_child_number', null),
                'description' => fillOnUndefined($params, 'description', []),
                'room_bed_group' => fillOnUndefined($params, 'room_bed_group'),
                'room_view_type' => fillOnUndefined($params, 'room_view_type'),
                'is_connected_room' => fillOnUndefined($params, 'is_connected_room', null),
                'is_connected_room_price' => fillOnUndefined($params, 'is_connected_room_price', null),
                'is_connected_room_availability' => fillOnUndefined($params, 'is_connected_room_availability', null),
                'connected_rooms' => fillOnUndefined($params, 'connected_rooms', []),
                'user_id' => $this->request->auth->id,
            ];



            $propertyRoomType = $this->propertyRoomService->addPropertyRoomAndBed($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function updatePropertyRoomAndBed(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'room_id' => fillOnUndefined($params, 'room_id'),
                'name' =>  trim(fillOnUndefined($params, 'name')),
                'room_type_id' => fillOnUndefined($params, 'room_type_id'),
                'max_occupancy' => fillOnUndefined($params, 'max_occupancy'),
                'max_adult' => fillOnUndefined($params, 'max_adult'),
                'max_child' => fillOnUndefined($params, 'max_child'),
                'occupancy_lock' => fillOnUndefined($params, 'occupancy_lock'),
                'exclude_occupancy' => fillOnUndefined($params, 'exclude_occupancy'),
                'room_size' => fillOnUndefined($params, 'room_size', null),
                'room_size_type' => fillOnUndefined($params, 'room_size_type', null),
                'room_type_count' => fillOnUndefined($params, 'room_type_count', 1),
                'room_count' => fillOnUndefined($params, 'room_count', null),
                'bathroom_count' => fillOnUndefined($params, 'bathroom_count', null),
                'toilet_count' => fillOnUndefined($params, 'toilet_count', null),
                'lounge_count' => fillOnUndefined($params, 'lounge_count', null),
                'max_child_number' => fillOnUndefined($params, 'max_child_number', null),
                'description' => fillOnUndefined($params, 'description', []),
                'room_bed_group' => fillOnUndefined($params, 'room_bed_group'),
                'room_view_type' => fillOnUndefined($params, 'room_view_type'),
                'is_connected_room' => fillOnUndefined($params, 'is_connected_room', null),
                'is_connected_room_price' => fillOnUndefined($params, 'is_connected_room_price', null),
                'is_connected_room_availability' => fillOnUndefined($params, 'is_connected_room_availability', null),
                'connected_rooms' => fillOnUndefined($params, 'connected_rooms', []),
                "status" => fillOnUndefined($params, "status", 1),
                'user_id' => $this->request->auth->id,
            ];



            $propertyRoomType = $this->propertyRoomService->updatePropertyRoomAndBed($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function updatePropertyRoom(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [

                'id' => fillOnUndefined($params, 'id'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'name' => trim(fillOnUndefined($params, 'name')),
                'room_type_id' => fillOnUndefined($params, 'room_type_id'),
                'max_occupancy' => fillOnUndefined($params, 'max_occupancy'),
                'max_adult' => fillOnUndefined($params, 'max_adult'),
                'max_child' => fillOnUndefined($params, 'max_child'),
                'occupancy_lock' => fillOnUndefined($params, 'occupancy_lock'),
                'exclude_occupancy' => fillOnUndefined($params, 'exclude_occupancy'),
                'room_size' => fillOnUndefined($params, 'room_size', null),
                'room_size_type' => fillOnUndefined($params, 'room_size_type', null),
                'room_type_count' => fillOnUndefined($params, 'room_type_count', 1),
                'room_count' => fillOnUndefined($params, 'room_count', null),
                'bathroom_count' => fillOnUndefined($params, 'bathroom_count', null),
                'toilet_count' => fillOnUndefined($params, 'toilet_count', null),
                'lounge_count' => fillOnUndefined($params, 'lounge_count', null),
                'max_child_number' => fillOnUndefined($params, 'max_child_number', null),
                'description' => fillOnUndefined($params, 'description', []),
                'user_id' => $this->request->auth->id,
            ];

            $propertyRoomType = $this->propertyRoomService->updatePropertyRoom($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }
            $propertyRoomType['data']['exclude_occupancy'] = json_decode($propertyRoomType['data']['exclude_occupancy'], true);
            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function getPropertyRoomAndBed(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [

                'room_id' => fillOnUndefined($params, 'room_id'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'user_id' => $this->request->auth->id,
            ];

            $propertyRoom = $this->propertyRoomService->getPropertyRoomAndBed($requestParams);
            if($propertyRoom['status'] != 'success'){
                throw new ApiErrorException($propertyRoom['message']);
            }

            $responseData['property_room'] = $propertyRoom['data'] ;


            $propertyRoomType = $this->propertyRoomTypeService->getPropertyRoomTypes($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $responseData['property_room_types'] = $propertyRoomType['data'] ;

            $propertyRoomBedType = $this->propertyRoomBedTypeService->getPropertyRoomBedTypes($requestParams);
            if($propertyRoomBedType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomBedType['message']);
            }

            $responseData['property_room_bed_types'] = $propertyRoomBedType['data'] ;


            $propertyRoomViewTypeCriteria = [
                'criteria' => [
                    ['field' => 'status', 'condition' => '=', 'value' => 1]
                ],
                "orderBy" => [
                    ["field" => "name", "value" => "ASC"]
                ]
            ];

            $propertyRoomViewTypeList = $this->propertyRoomViewTypeService->getPropertyRoomViewTypes($propertyRoomViewTypeCriteria);

            if($propertyRoomViewTypeList['status'] != 'success'){
                throw new ApiErrorException($propertyRoomViewTypeList['message']);
            }

            $responseData['property_room_view_types'] = $propertyRoomViewTypeList['data'] ;


            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $responseData];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function deletePropertyRoom(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [

                'id' => fillOnUndefined($params, 'id'),
                'user_id' => $this->request->auth->id,

            ];

            $propertyRoomType = $this->propertyRoomService->deletePropertyRoom($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function getPropertyRoomRateChannel(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
            ];

            $propertyRoomType = $this->propertyRoomService->getPropertyRoomRateChannel($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function getPropertyRoomInventory(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'room_id' => fillOnUndefined($params, 'room_id'),
                'room_rate_mapping_id' => fillOnUndefined($params, 'room_rate_mapping_id'),
                'channel_id' => fillOnUndefined($params, 'channel_id'),
                'start_date' => fillOnUndefined($params, 'start_date'),
                'end_date' => fillOnUndefined($params, 'end_date'),

            ];

            $propertyRoomType = $this->propertyRoomService->getPropertyRoomInventory($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            //Best Available Rate Manipulate
            foreach ($propertyRoomType['data'] as $roomKey => $room) {
                foreach ($room['property_room_rate_mapping'] as $roomRateMappingKey => $roomRateMapping) {
                    if($roomRateMapping['name'] == 'Best Available Rate') {
                        unset($room['property_room_rate_mapping'][$roomRateMappingKey]);
                    }
                }

                $propertyRoomType['data'][$roomKey]['property_room_rate_mapping'] = array_values($room['property_room_rate_mapping']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function getChannelRoomRateMapping(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'channel_id' => fillOnUndefined($params, 'channel_id'),
            ];

            $propertyRoomType = $this->propertyRoomService->getChannelRoomRateMapping($requestParams);
            if($propertyRoomType['status'] != 'success'){
                throw new ApiErrorException($propertyRoomType['message']);
            }

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' => $propertyRoomType['data']];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }

    public function getChannelBulkUpdateParams(Request $request)
    {

        $response = ['status' => false, 'message' => '', 'data' => null, 'statusCode' => 500];
        try {

            if (is_null($this->request->getContent())) {
                throw new ApiErrorException(lang('Parameter Error.'));
            }

            $params = $this->request->params;

            $requestParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'channel_id' => fillOnUndefined($params, 'channel_id'),
            ];

            $propertyRooms = $this->propertyRoomService->getChannelRoomRateMapping($requestParams);
            if($propertyRooms['status'] != 'success'){
                throw new ApiErrorException($propertyRooms['message']);
            }
            $propertyRooms = $propertyRooms['data'] ;

            $rooms = [] ;
            foreach ($propertyRooms as $propertyRoom) {
                $room = [
                    'id' => $propertyRoom['id'],
                    'name' => $propertyRoom['name'],
                    'room_selected' => false,
                ] ;
                $rates = [] ;
                foreach ($propertyRoom['property_room_rate_mapping'] as $roomRate) {

                    //Best Available Rate Manipulate
                    if($roomRate['name'] == 'Best Available Rate') {
                        continue;
                    }

                    if($roomRate['is_selected'] === true){

                        $rate = [
                            'id' => $roomRate['room_rate_id'],
                            'room_rate_mapping_id' => $roomRate['id'],
                            'name' => $roomRate['name'],
                            'rate_selected' => false,
                        ] ;
                        $rates[] = $rate ;
                    }

                }
                if($rates){
                    $room['room_rate_mapping'] = $rates;
                    $rooms[] = $room;
                }
            }

            $bulkUpdateOptionParams = [
                'locale' => fillOnUndefined($params, 'locale'),
                'property_id' => fillOnUndefined($params, 'property_id'),
                'channel_id' => fillOnUndefined($params, 'channel_id'),
                'user_id' => $this->request->auth->id,
            ];


            $channelMapping =  $this->propertyChannelMappingService->getPropertyChannelSetup($bulkUpdateOptionParams);
            if($channelMapping['status'] != 'success'){
                throw new ApiErrorException($channelMapping['message']);
            }

            $channelMapping = $channelMapping['data'] ;

            $response = ['status' => 1, 'statusCode' => 200, 'message' => null, 'data' =>  ['room_rates' => $rooms, 'bulk_update_options' => $channelMapping['bulk_update_options']]];

        } catch (ApiErrorException $e) {
            $response['message'] = implode(', ', $e->getMessageArr());
            $response['statusCode'] = 400;
        } catch (Exception $e) {
            $message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
            Log::error($message);
            $response['message'] = $e->getMessage();
            $response['statusCode'] = 500;
        }
        return apiResponse($response['status'], $response['message'], $response['data'], $response['statusCode']);


    }


}
