<script setup lang="ts">
import { ElDialog } from 'element-plus';
import { ref } from "vue";
import { LP2_Casino_Deeplink } from "../script/LP2_Casino_Deeplink";
import Popup from './Popup.vue';

const linetypeDefault = ref('')
const servertypeDefault = ref('')
const hostportDefault = ref('')
const patchDefault = ref('')
const linetype = ref(0)
const servertype = ref(0)
const hostport = ref(0)
const patch = ref(0)
const iscustom = ref(false)
const PopupVisible = ref(false)
const PopupCallback = ref(Function)
const PopupInfo = ref('')
const input3 = ref('')
const self = {
	linetypeDefault: linetypeDefault,
	servertypeDefault: servertypeDefault,
	hostportDefault: hostportDefault,
	patchDefault: patchDefault,
	linetype: linetype,
	servertype: servertype,
	hostport: hostport,
	patch: patch,
	iscustom: iscustom,
	PopupVisible: PopupVisible,
	PopupCallback: PopupCallback,
	PopupInfo: PopupInfo,
	Script: null
}
const Script = new LP2_Casino_Deeplink(self);
self.Script = Script;
const LinetypeData = Script.GetLineType();
const ServertypeData = Script.GetServerType();
const HostportData = Script.GetHostport();
const Patch = Script.GetPatch();
</script>

<template>
	<el-dialog v-model="PopupVisible" width="30%" :show-close="false">
		<Popup :APP="self" />
	</el-dialog>
	<div>
		<h1>
			<div>
				linetype:
				<el-select v-model="linetypeDefault" filterable @change="(data: any) => { Script.SelectLinetype(data) }">
					<el-option v-for="(item, index) in LinetypeData" :key="item.value" :label="item.label"
						:value="item.value" />
				</el-select>
			</div>
			<div>
				servertype:
				<el-select v-model="servertypeDefault" filterable
					@change="(data: any) => { Script.SelectServertype(data) }">
					<el-option v-for="(item, index) in ServertypeData" :key="item.value" :label="item.label"
						:value="item.value" />
				</el-select>
			</div>
			<div>
				hostport:
				<el-select v-model="hostportDefault" filterable @change="(data: any) => { Script.SelectHostport(data) }">
					<el-option v-for="(item, index) in HostportData" :key="item.value" :label="item.label"
						:value="item.value" />
				</el-select>
			</div>
			<div>
				patch:
				<el-select v-model="patchDefault" filterable @change="(data: any) => { Script.SelectPatch(data) }">
					<el-option v-for="(item, index) in Patch" :key="item.value" :label="item.label" :value="item.value" />
				</el-select>
			</div>
			<div>
				使用自己帶進來的URL參數
				<label class="switch">
					<input type="checkbox" id="iscustom">
					<span class="slider"></span>
				</label>
			</div>
			<el-button type="success" @click.native="() => { Script.OnclickOpen() }" size="large" round>開啟遊戲&gt;&gt;
			</el-button>
			<!-- <div>
								<el-button type="warning" @click.native="() => { Script.Install_InternalTest(+input3) }" size="large" round>
									前往
								</el-button>
								<el-input v-model="input3" placeholder="Google Play商店(內部測試) 版本號" class="input-with-select"
									style="width:25%; font-size:25px; text-align">
								</el-input>
								Google Play商店(內部測試) 版本號
							</div> -->
			<br>
			<a href="https://liff.line.me/2000222870-MOkW3vgO/?fid=10000000008">跟建喵做朋友&gt;&gt;</a>
			<br><br>
			<!-- <a href="bjcasino://get/message?GetOtherUserProfile=100000157">跟豆豆做朋友&gt;&gt;</a>
					<br><br>
					<a href="bjcasino://get/message?GetOtherUserProfile=100000148">跟柏威做朋友&gt;&gt;</a>
					<br><br>
					<a href="bjcasino://get/message?OnClickChatAndChat=100000157">跟豆豆聊聊天&gt;&gt;</a>
					<br><br> -->
		</h1>
	</div>
</template>