488 lines
		
	
	
		
			21 KiB
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			488 lines
		
	
	
		
			21 KiB
		
	
	
	
		
			Swift
		
	
	
	
	
	
//
 | 
						|
//  LiveViewModel.swift
 | 
						|
//  SodaLive
 | 
						|
//
 | 
						|
//  Created by klaus on 2023/08/09.
 | 
						|
//
 | 
						|
 | 
						|
import Foundation
 | 
						|
import Combine
 | 
						|
 | 
						|
final class LiveViewModel: ObservableObject {
 | 
						|
    
 | 
						|
    private let repository = LiveRepository()
 | 
						|
    private let liveRecommendRepository = LiveRecommendRepository()
 | 
						|
    private let creatorCommunityRepository = CreatorCommunityRepository()
 | 
						|
    private var subscription = Set<AnyCancellable>()
 | 
						|
    
 | 
						|
    @Published private(set) var liveNowItems = [GetRoomListResponse]()
 | 
						|
    @Published private(set) var liveReservationItems = [GetRoomListResponse]()
 | 
						|
    @Published private(set) var recommendLiveItems: [GetRecommendLiveResponse] = []
 | 
						|
    @Published private(set) var followedChannelItems: [GetRecommendChannelResponse] = []
 | 
						|
    @Published private(set) var communityPostItems: [GetCommunityPostListResponse] = []
 | 
						|
    @Published private(set) var replayLiveItems: [AudioContentMainItem] = []
 | 
						|
    @Published private(set) var latestFinishedLiveItems: [GetLatestFinishedLiveResponse] = []
 | 
						|
    
 | 
						|
    @Published var errorMessage = ""
 | 
						|
    @Published var isShowPopup = false
 | 
						|
    @Published var isRefresh = false
 | 
						|
    @Published var isLoading = false
 | 
						|
    
 | 
						|
    @Published var paymentDialogTitle = ""
 | 
						|
    @Published var paymentDialogDesc = ""
 | 
						|
    @Published var paymentDialogDesc2 = ""
 | 
						|
    @Published var isShowPaymentDialog = false
 | 
						|
    @Published var paymentDialogConfirmAction = {}
 | 
						|
    @Published var paymentDialogConfirmTitle = ""
 | 
						|
    
 | 
						|
    @Published var secretOrPasswordDialogCan = 0
 | 
						|
    @Published var passwordDialogConfirmAction: (String) -> Void = { _ in }
 | 
						|
    @Published var isShowPasswordDialog = false
 | 
						|
    
 | 
						|
    @Published var liveStartDate: String? = nil
 | 
						|
    @Published var nowDate: String? = nil
 | 
						|
    
 | 
						|
    let paymentDialogCancelTitle = "취소"
 | 
						|
    
 | 
						|
    var page = 1
 | 
						|
    var isLast = false
 | 
						|
    private let pageSize = 10
 | 
						|
    
 | 
						|
    var selectedDateString: String = "" {
 | 
						|
        didSet {
 | 
						|
            if !selectedDateString.trimmingCharacters(in: .whitespaces).isEmpty {
 | 
						|
                page = 1
 | 
						|
                isLast = false
 | 
						|
                liveReservationItems.removeAll()
 | 
						|
                getLiveReservationList()
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
    
 | 
						|
    func hidePopup() {
 | 
						|
        isShowPaymentDialog = false
 | 
						|
        isShowPasswordDialog = false
 | 
						|
        
 | 
						|
        paymentDialogTitle = ""
 | 
						|
        paymentDialogDesc = ""
 | 
						|
        paymentDialogDesc2 = ""
 | 
						|
        paymentDialogConfirmAction = {}
 | 
						|
        
 | 
						|
        secretOrPasswordDialogCan = 0
 | 
						|
        
 | 
						|
        passwordDialogConfirmAction = { _ in }
 | 
						|
    }
 | 
						|
    
 | 
						|
    func getLiveMain() {
 | 
						|
        isLoading = true
 | 
						|
        
 | 
						|
        repository.getLiveMain()
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { [unowned self] response in
 | 
						|
                self.isLoading = false
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponse<LiveMainResponse>.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if let data = decoded.data, decoded.success {
 | 
						|
                        self.liveNowItems = data.liveOnAirRoomList
 | 
						|
                        self.liveReservationItems = data.liveReservationRoomList
 | 
						|
                        self.recommendLiveItems = data.recommendLiveList
 | 
						|
                        self.followedChannelItems = data.followingChannelList
 | 
						|
                        self.communityPostItems = data.communityPostList
 | 
						|
                        self.replayLiveItems = data.replayLive
 | 
						|
                        self.latestFinishedLiveItems = data.latestFinishedLiveList
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "라이브에 입장하지 못했습니다.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "라이브에 입장하지 못했습니다.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
    }
 | 
						|
    
 | 
						|
    func enterRoom(roomId: Int, onSuccess: (() -> Void)? = nil, password: String? = nil) {
 | 
						|
        isLoading = true
 | 
						|
        let request = EnterOrQuitLiveRoomRequest(roomId: roomId, password: password)
 | 
						|
        repository.enterRoom(request: request)
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { [unowned self] response in
 | 
						|
                self.isLoading = false
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if decoded.success {
 | 
						|
                        AppState.shared.roomId = roomId
 | 
						|
                        
 | 
						|
                        if let onSuccess = onSuccess {
 | 
						|
                            onSuccess()
 | 
						|
                        } else {
 | 
						|
                            if roomId > 0 {
 | 
						|
                                AppState.shared.isShowPlayer = true
 | 
						|
                                AppState.shared.setAppStep(step: .main)
 | 
						|
                            }
 | 
						|
                        }
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "라이브에 입장하지 못했습니다.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "라이브에 입장하지 못했습니다.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
    }
 | 
						|
    
 | 
						|
    func startLive(roomId: Int) {
 | 
						|
        isLoading = true
 | 
						|
        repository.startLive(roomId: roomId)
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { [unowned self] response in
 | 
						|
                self.isLoading = false
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponseWithoutData.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if decoded.success {
 | 
						|
                        getLiveMain()
 | 
						|
                        enterRoom(roomId: roomId)
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
    }
 | 
						|
    
 | 
						|
    func getLiveNowList() {
 | 
						|
        if (!isLast && !isLoading) {
 | 
						|
            isLoading = true
 | 
						|
            repository.roomList(
 | 
						|
                request: GetRoomListRequest(
 | 
						|
                    timezone: TimeZone.current.identifier,
 | 
						|
                    dateString: nil,
 | 
						|
                    status: .NOW,
 | 
						|
                    isAdultContentVisible: UserDefaults.isAdultContentVisible(),
 | 
						|
                    page: page,
 | 
						|
                    size: pageSize
 | 
						|
                )
 | 
						|
            )
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { [unowned self] response in
 | 
						|
                self.isRefresh = false
 | 
						|
                self.isLoading = false
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponse<[GetRoomListResponse]>.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if let data = decoded.data, decoded.success {
 | 
						|
                        if page < 2 {
 | 
						|
                            self.liveNowItems.removeAll()
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        if !data.isEmpty {
 | 
						|
                            page += 1
 | 
						|
                            self.liveNowItems.append(contentsOf: data)
 | 
						|
                        } else {
 | 
						|
                            isLast = true
 | 
						|
                        }
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
        }
 | 
						|
    }
 | 
						|
    
 | 
						|
    func getLiveReservationList() {
 | 
						|
        if (!isLast && !isLoading) {
 | 
						|
            isLoading = true
 | 
						|
            repository.roomList(
 | 
						|
                request: GetRoomListRequest(
 | 
						|
                    timezone: TimeZone.current.identifier,
 | 
						|
                    dateString: selectedDateString,
 | 
						|
                    status: .RESERVATION,
 | 
						|
                    isAdultContentVisible: UserDefaults.isAdultContentVisible(),
 | 
						|
                    page: page,
 | 
						|
                    size: pageSize
 | 
						|
                )
 | 
						|
            )
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { [unowned self] response in
 | 
						|
                self.isLoading = false
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponse<[GetRoomListResponse]>.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if let data = decoded.data, decoded.success {
 | 
						|
                        if !data.isEmpty {
 | 
						|
                            page += 1
 | 
						|
                            self.liveReservationItems.append(contentsOf: data)
 | 
						|
                        } else {
 | 
						|
                            isLast = true
 | 
						|
                        }
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
        }
 | 
						|
    }
 | 
						|
    
 | 
						|
    func reservationLiveRoom(roomId: Int) {
 | 
						|
        getRoomDetail(roomId: roomId) { [unowned self] in
 | 
						|
            if ($0.manager.id == UserDefaults.int(forKey: .userId)) {
 | 
						|
                self.errorMessage = "내가 만든 라이브는 예약할 수 없습니다."
 | 
						|
                self.isShowPopup = true
 | 
						|
            } else {
 | 
						|
                if $0.isPrivateRoom {
 | 
						|
                    self.passwordDialogConfirmAction = { password in
 | 
						|
                        self.reservation(roomId: roomId, password: password)
 | 
						|
                    }
 | 
						|
                    self.isShowPasswordDialog = true
 | 
						|
                } else {
 | 
						|
                    if ($0.price == 0 || $0.isPaid) {
 | 
						|
                        self.reservation(roomId: roomId)
 | 
						|
                    } else {
 | 
						|
                        self.paymentDialogTitle = "\($0.price)캔으로 예약"
 | 
						|
                        self.paymentDialogDesc = "'\($0.title)' 라이브에 참여하기 위해 결제합니다."
 | 
						|
                        self.paymentDialogConfirmTitle = "결제 후 예약하기"
 | 
						|
                        self.paymentDialogConfirmAction = { [unowned self] in
 | 
						|
                            hidePopup()
 | 
						|
                            reservation(roomId: roomId)
 | 
						|
                        }
 | 
						|
                        self.isShowPaymentDialog = true
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
    
 | 
						|
    func enterLiveRoom(roomId: Int) {
 | 
						|
        getRoomDetail(roomId: roomId) {
 | 
						|
            if let _ = $0.channelName {
 | 
						|
                if $0.manager.id == UserDefaults.int(forKey: .userId) {
 | 
						|
                    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
 | 
						|
                        self.enterRoom(roomId: roomId)
 | 
						|
                    }
 | 
						|
                } else if ($0.price == 0 || $0.isPaid) {
 | 
						|
                    if $0.isPrivateRoom {
 | 
						|
                        self.passwordDialogConfirmAction = { password in
 | 
						|
                            self.enterRoom(roomId: roomId, password: password)
 | 
						|
                        }
 | 
						|
                        self.isShowPasswordDialog = true
 | 
						|
                    } else {
 | 
						|
                        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
 | 
						|
                            self.enterRoom(roomId: roomId)
 | 
						|
                        }
 | 
						|
                    }
 | 
						|
                } else {
 | 
						|
                    if $0.isPrivateRoom {
 | 
						|
                        self.secretOrPasswordDialogCan = $0.price
 | 
						|
                        self.passwordDialogConfirmAction = { password in
 | 
						|
                            self.enterRoom(roomId: roomId, password: password)
 | 
						|
                        }
 | 
						|
                        self.isShowPasswordDialog = true
 | 
						|
                    } else {
 | 
						|
                        let fromFormatter = DateFormatter()
 | 
						|
                        fromFormatter.dateFormat = "yyyy.MM.dd EEE hh:mm a"
 | 
						|
                        fromFormatter.locale = Locale(identifier: "en_US_POSIX")
 | 
						|
                        let beginDate = fromFormatter.date(from: $0.beginDateTime)!
 | 
						|
                        let now = Date()
 | 
						|
                        
 | 
						|
                        let timeInterval = now.timeIntervalSince(beginDate)
 | 
						|
                        let hours = Int(timeInterval / 3600)
 | 
						|
                        let minutes = Int((timeInterval.truncatingRemainder(dividingBy: 3600)) / 60)
 | 
						|
                        
 | 
						|
                        if hours >= 1 {
 | 
						|
                            self.liveStartDate = beginDate.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
 | 
						|
                            self.nowDate = now.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
 | 
						|
                            self.paymentDialogDesc2 = "라이브를 시작한 지 \(hours)시간 \(minutes)분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.paymentDialogTitle = "유료 라이브 입장"
 | 
						|
                        self.paymentDialogDesc = "\($0.price)캔을 차감하고\n라이브에 입장 하시겠습니까?"
 | 
						|
                        self.paymentDialogConfirmTitle = "결제 후 참여하기"
 | 
						|
                        self.paymentDialogConfirmAction = { [unowned self] in
 | 
						|
                            hidePopup()
 | 
						|
                            self.enterRoom(roomId: roomId)
 | 
						|
                        }
 | 
						|
                        self.isShowPaymentDialog = true
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            } else {
 | 
						|
                AppState.shared.setAppStep(
 | 
						|
                    step: .liveDetail(
 | 
						|
                        roomId: roomId,
 | 
						|
                        onClickParticipant: {},
 | 
						|
                        onClickReservation: { self.reservationLiveRoom(roomId: roomId) },
 | 
						|
                        onClickStart: { self.startLive(roomId: roomId) },
 | 
						|
                        onClickCancel: { self.getLiveMain() }
 | 
						|
                    )
 | 
						|
                )
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
    
 | 
						|
    private func getRoomDetail(roomId: Int, onSuccess: @escaping (GetRoomDetailResponse) -> Void) {
 | 
						|
        isLoading = true
 | 
						|
        repository.getRoomDetail(roomId: roomId)
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { response in
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponse<GetRoomDetailResponse>.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if let data = decoded.data, decoded.success {
 | 
						|
                        onSuccess(data)
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "라이브 정보를 가져오지 못했습니다.\n다시 시도해 주세요."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "라이브 정보를 가져오지 못했습니다.\n다시 시도해 주세요."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
                
 | 
						|
                self.isLoading = false
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
    }
 | 
						|
    
 | 
						|
    private func reservation(roomId: Int, password: String? = nil) {
 | 
						|
        isLoading = true
 | 
						|
        let request = MakeLiveReservationRequest(roomId: roomId, password: password)
 | 
						|
        repository.makeReservation(request: request)
 | 
						|
            .sink { result in
 | 
						|
                switch result {
 | 
						|
                case .finished:
 | 
						|
                    DEBUG_LOG("finish")
 | 
						|
                case .failure(let error):
 | 
						|
                    ERROR_LOG(error.localizedDescription)
 | 
						|
                }
 | 
						|
            } receiveValue: { [unowned self] response in
 | 
						|
                self.isLoading = false
 | 
						|
                let responseData = response.data
 | 
						|
                
 | 
						|
                do {
 | 
						|
                    let jsonDecoder = JSONDecoder()
 | 
						|
                    let decoded = try jsonDecoder.decode(ApiResponse<MakeLiveReservationResponse>.self, from: responseData)
 | 
						|
                    
 | 
						|
                    if let response = decoded.data, decoded.success {
 | 
						|
                        self.getLiveMain()
 | 
						|
                        AppState.shared.setAppStep(step: .liveReservationComplete(response: response))
 | 
						|
                    } else {
 | 
						|
                        if let message = decoded.message {
 | 
						|
                            self.errorMessage = message
 | 
						|
                        } else {
 | 
						|
                            self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                        }
 | 
						|
                        
 | 
						|
                        self.isShowPopup = true
 | 
						|
                    }
 | 
						|
                } catch {
 | 
						|
                    self.errorMessage = "다시 시도해 주세요.\n계속 같은 문제가 발생할 경우 고객센터로 문의 주시기 바랍니다."
 | 
						|
                    self.isShowPopup = true
 | 
						|
                }
 | 
						|
            }
 | 
						|
            .store(in: &subscription)
 | 
						|
    }
 | 
						|
}
 |