diff --git a/AGENTS.md b/AGENTS.md index b814f43..8fe20bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,3 +7,7 @@ H5 通用主题放在 common/theme.css,新页面默认引用该文件。 页面样式不要硬编码主色,优先消费 common/theme.css 里的 CSS 变量;只有 Figma 强制要求 100% 还原时才允许局部覆盖。 H5 多语言能力放在 common/i18n.js 和 common/locales/\*.json,当前面向英语 en、阿拉伯语 ar、土耳其语 tr、西班牙语 es。页面文案使用 data-i18n / data-i18n-placeholder / data-i18n-aria 绑定语言包 key;新增页面必须优先复用 common 的语言包机制,不在页面脚本里硬编码多语言字典。 + +所有逻辑功能配置默认打开;只有密钥、地址、三方账号等必须由环境提供的敏感值使用占位符或环境配置,不在默认配置里伪造可用凭证。 + +所有业务逻辑、状态流转、权限判断、支付链路、异步流程都保持高密度逻辑注释,注释解释为什么这样处理和失败分支,不复述语法。 diff --git a/common/api.js b/common/api.js index 65c2fb8..a65cd5a 100644 --- a/common/api.js +++ b/common/api.js @@ -6,6 +6,7 @@ var default_api = 'https://api.global-interaction.com/'; var API_ENV_KEY = 'hyapp_h5_env'; var ACCESS_TOKEN_KEY = 'hyapp_access_token'; var APP_CODE_KEY = 'hyapp_app_code'; + var RENEWED_ACCESS_TOKEN_HEADER = 'X-Hyapp-Access-Token'; var memoryEnv = ''; var memoryAccessToken = ''; var memoryAppCode = ''; @@ -14,6 +15,36 @@ var default_api = 'https://api.global-interaction.com/'; return new URLSearchParams(window.location.search).get(name); } + function normalizeToken(value) { + var token = String(value || '').trim(); + if (!token) return ''; + if (/^Bearer\s+/i.test(token)) token = token.replace(/^Bearer\s+/i, ''); + var match = token.match( + /[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/ + ); + return match ? match[0] : token; + } + + function decodeBase64URLJSON(value) { + try { + var normalized = String(value || '').replace(/-/g, '+').replace(/_/g, '/'); + while (normalized.length % 4) normalized += '='; + return JSON.parse(window.atob(normalized)); + } catch (_) { + return null; + } + } + + function isExpiredToken(token) { + var parts = String(token || '').split('.'); + if (parts.length < 2) return false; + var payload = decodeBase64URLJSON(parts[1]); + if (!payload || !payload.exp) return false; + // JWT exp 是秒级时间戳;本地 H5 不能只凭 query 有 token 就进入 token 模式,过期 token 会被 gateway 当成未登录。 + // 这里预留 5 秒偏移,避免页面发请求时刚好跨过过期点,导致 H5 隐藏账号输入但服务端收到空 display_user_id。 + return Number(payload.exp) * 1000 <= Date.now() + 5000; + } + function normalizeBaseURL(value) { return String(value || '').replace(/\/+$/, '') + '/'; } @@ -85,19 +116,36 @@ var default_api = 'https://api.global-interaction.com/'; } function getAccessToken() { + if (memoryAccessToken && !isExpiredToken(memoryAccessToken)) + return memoryAccessToken; + if (memoryAccessToken && isExpiredToken(memoryAccessToken)) { + memoryAccessToken = ''; + if (shouldPersist()) window.localStorage.removeItem(ACCESS_TOKEN_KEY); + } var queryToken = - readQuery('token') || - readQuery('access_token') || - readQuery('accessToken'); + normalizeToken(readQuery('token')) || + normalizeToken(readQuery('access_token')) || + normalizeToken(readQuery('accessToken')); if (queryToken) { + if (isExpiredToken(queryToken)) { + if (shouldPersist()) + window.localStorage.removeItem(ACCESS_TOKEN_KEY); + return ''; + } memoryAccessToken = queryToken; if (shouldPersist()) window.localStorage.setItem(ACCESS_TOKEN_KEY, queryToken); return queryToken; } - if (memoryAccessToken) return memoryAccessToken; if (!shouldPersist()) return ''; - return window.localStorage.getItem(ACCESS_TOKEN_KEY) || ''; + var storedToken = normalizeToken( + window.localStorage.getItem(ACCESS_TOKEN_KEY) || '' + ); + if (storedToken && isExpiredToken(storedToken)) { + window.localStorage.removeItem(ACCESS_TOKEN_KEY); + return ''; + } + return storedToken; } function getAppCode() { @@ -114,6 +162,8 @@ var default_api = 'https://api.global-interaction.com/'; } function setAccessToken(token) { + token = normalizeToken(token); + if (token && isExpiredToken(token)) token = ''; memoryAccessToken = token || ''; if (token) { if (shouldPersist()) @@ -184,6 +234,14 @@ var default_api = 'https://api.global-interaction.com/'; }); } + function persistRenewedAccessToken(response) { + var renewedToken = + response && response.headers + ? response.headers.get(RENEWED_ACCESS_TOKEN_HEADER) + : ''; + if (renewedToken) setAccessToken(renewedToken); + } + function request(path, options) { var opts = options || {}; var headers = Object.assign({}, opts.headers || {}); @@ -210,7 +268,10 @@ var default_api = 'https://api.global-interaction.com/'; cache: shouldPersist() ? 'default' : 'no-store', credentials: opts.credentials || 'omit', }) - .then(parseResponse); + .then(function (response) { + persistRenewedAccessToken(response); + return parseResponse(response); + }); } var vipAPI = { @@ -235,6 +296,9 @@ var default_api = 'https://api.global-interaction.com/'; overview: function () { return request('/api/v1/users/me/overview', { method: 'GET' }); }, + appearance: function () { + return request('/api/v1/users/me/appearance', { method: 'GET' }); + }, hostIdentity: function () { return request('/api/v1/users/me/host-identity', { method: 'GET', @@ -280,6 +344,50 @@ var default_api = 'https://api.global-interaction.com/'; }, }; + // H5 充值 API 只做路径和参数名封装;token、app_code、env、错误 envelope 仍由 request 统一处理。 + // 金额、金币数、普通/币商钱包、MiFaPay 参数和 USDT 链上校验都以后端订单快照为准。 + var rechargeAPI = { + context: function (displayUserID) { + return request('/api/v1/recharge/h5/context', { + method: 'GET', + query: { display_user_id: displayUserID || '' }, + }); + }, + options: function (displayUserID) { + return request('/api/v1/recharge/h5/options', { + method: 'GET', + query: { display_user_id: displayUserID || '' }, + }); + }, + createOrder: function (payload) { + return request('/api/v1/recharge/h5/orders', { + method: 'POST', + body: payload || {}, + }); + }, + submitTx: function (orderID, payload) { + return request( + '/api/v1/recharge/h5/orders/' + + encodeURIComponent(orderID || '') + + '/tx', + { + method: 'POST', + body: payload || {}, + } + ); + }, + getOrder: function (orderID, displayUserID) { + return request( + '/api/v1/recharge/h5/orders/' + + encodeURIComponent(orderID || ''), + { + method: 'GET', + query: { display_user_id: displayUserID || '' }, + } + ); + }, + }; + var salaryWalletAPI = { overview: function (identity) { return request('/api/v1/salary-wallet/overview', { @@ -548,6 +656,48 @@ var default_api = 'https://api.global-interaction.com/'; }, }; + var diceGameAPI = { + config: function (gameID) { + return request('/api/v1/games/dice/config', { + method: 'GET', + query: { game_id: gameID || 'dice' }, + }); + }, + match: function (payload) { + return request('/api/v1/games/dice/match', { + method: 'POST', + body: payload || {}, + }); + }, + getMatch: function (matchID) { + return request( + '/api/v1/games/dice/matches/' + + encodeURIComponent(matchID || ''), + { method: 'GET' } + ); + }, + roll: function (matchID) { + return request( + '/api/v1/games/dice/matches/' + + encodeURIComponent(matchID || '') + + '/roll', + { method: 'POST', body: {} } + ); + }, + cancel: function (matchID) { + return request( + '/api/v1/games/dice/matches/' + + encodeURIComponent(matchID || '') + + '/cancel', + { method: 'POST', body: {} } + ); + }, + }; + + var gameAPI = { + dice: diceGameAPI, + }; + window.HyAppAPI = { baseURL: resolveBaseURL, buildURL: buildURL, @@ -574,6 +724,7 @@ var default_api = 'https://api.global-interaction.com/'; vip: vipAPI, user: userAPI, wallet: walletAPI, + recharge: rechargeAPI, salaryWallet: salaryWalletAPI, host: hostAPI, hostCenter: hostCenterAPI, @@ -584,6 +735,7 @@ var default_api = 'https://api.global-interaction.com/'; superadminCenter: superadminCenterAPI, level: levelAPI, weeklyStar: weeklyStarAPI, + game: gameAPI, }; clearLocalDevCache(); })(); diff --git a/common/i18n.js b/common/i18n.js index 8387de4..b0937c8 100644 --- a/common/i18n.js +++ b/common/i18n.js @@ -10,6 +10,28 @@ var messages = {}; var currentLang = ''; + function scopedSupported() { + var scoped = + window.HyAppI18nSupported || window.HyAppSupportedLanguages || null; + if (!Array.isArray(scoped)) return SUPPORTED; + var normalized = []; + scoped.forEach(function (value) { + var lang = String(value || '') + .trim() + .toLowerCase() + .replace('_', '-'); + if (lang.indexOf('ar') === 0) lang = 'ar'; + else if (lang.indexOf('tr') === 0) lang = 'tr'; + else if (lang.indexOf('es') === 0) lang = 'es'; + else if (lang.indexOf('zh') === 0) lang = 'zh'; + else if (lang.indexOf('id') === 0) lang = 'id'; + if (SUPPORTED.indexOf(lang) >= 0 && normalized.indexOf(lang) < 0) { + normalized.push(lang); + } + }); + return normalized.length ? normalized : SUPPORTED; + } + function storageGet(key) { try { return window.localStorage ? window.localStorage.getItem(key) : ''; @@ -28,8 +50,34 @@ } } + function currentParams() { + var parsed = + window.HyAppParams && + window.HyAppParams.current && + window.HyAppParams.current.raw; + if (parsed && parsed.get) return parsed; + var params = new URLSearchParams(window.location.search); + var hash = window.location.hash || ''; + if (hash.indexOf('?') >= 0) { + new URLSearchParams(hash.split('?').slice(1).join('?')).forEach( + function (value, key) { + if (!params.has(key)) params.set(key, value); + } + ); + } + return params; + } + function queryLang() { - return new URLSearchParams(window.location.search).get('lang') || ''; + var params = currentParams(); + return ( + params.get('lang') || + params.get('language') || + params.get('locale') || + params.get('app_lang') || + params.get('appLanguage') || + '' + ); } function normalizeLang(value) { @@ -38,12 +86,12 @@ .toLowerCase() .replace('_', '-'); if (!lang) return ''; - if (lang.indexOf('ar') === 0) return 'ar'; - if (lang.indexOf('tr') === 0) return 'tr'; - if (lang.indexOf('es') === 0) return 'es'; - if (lang.indexOf('zh') === 0) return 'zh'; - if (lang.indexOf('id') === 0) return 'id'; - return SUPPORTED.indexOf(lang) >= 0 ? lang : ''; + if (lang.indexOf('ar') === 0) lang = 'ar'; + else if (lang.indexOf('tr') === 0) lang = 'tr'; + else if (lang.indexOf('es') === 0) lang = 'es'; + else if (lang.indexOf('zh') === 0) lang = 'zh'; + else if (lang.indexOf('id') === 0) lang = 'id'; + return scopedSupported().indexOf(lang) >= 0 ? lang : ''; } function resolveLang() { @@ -182,7 +230,7 @@ lang: function () { return currentLang || DEFAULT_LANG; }, - supported: SUPPORTED.slice(), + supported: scopedSupported(), }; function init() { diff --git a/common/locales/ar.json b/common/locales/ar.json index bade7f0..96211f3 100644 --- a/common/locales/ar.json +++ b/common/locales/ar.json @@ -8,6 +8,17 @@ "diceMatch.unknownOpponent": "?", "diceMatch.win": "فوز", "diceMatch.coins": "عملات", + "diceMatch.changeLanguage": "تغيير اللغة", + "diceMatch.loading": "جار التحميل", + "diceMatch.roll": "ارمِ", + "diceMatch.rolling": "جار الرمي...", + "diceMatch.ready": "جاهز", + "diceMatch.draw": "تعادل", + "diceMatch.compare": "مقارنة", + "diceMatch.apiUnavailable": "واجهة لعبة النرد غير متاحة", + "diceMatch.selectStake": "اختر قيمة الرهان", + "diceMatch.requestFailed": "فشل الطلب", + "diceMatch.configFeeNote": "الرسوم {fee}% · المجمع {pool}%", "roomReward.pageTitle": "فعالية مكافآت الغرفة", "roomReward.pageLabel": "فعالية مكافآت الغرفة", "roomReward.currentTarget": "هدف المكافأة الحالي", @@ -397,5 +408,55 @@ "cp.rewardMarquis7": "ماركيز*7 أيام", "cp.rewardCoins10000": "عملات*10000", "cp.rewardCount7": "عدّاد*7 أيام", - "cp.copyright": "حقوق هذا النشاط تعود إلى Shila" + "cp.copyright": "حقوق هذا النشاط تعود إلى Shila", + "recharge.pageTitle": "الشحن", + "recharge.pageSubtitle": "اختر باقة عملات وادفع عبر USDT-TRC20 أو طريقة دفع محلية مدعومة.", + "recharge.changeLanguage": "تغيير اللغة", + "recharge.accountTitle": "الحساب", + "recharge.accountHint": "أكد الحساب قبل اختيار الباقة.", + "recharge.userIdPlaceholder": "أدخل معرف المستخدم", + "recharge.searchAccount": "تأكيد", + "recharge.loading": "جار التحميل...", + "recharge.accountConfirmed": "تم تأكيد الحساب", + "recharge.ordinaryUser": "مستخدم", + "recharge.coinSeller": "بائع عملات", + "recharge.productTitle": "الباقة", + "recharge.productEmpty": "لا توجد باقة متاحة لهذا الحساب.", + "recharge.paymentTitle": "الدفع", + "recharge.backToPackages": "العودة إلى الباقات", + "recharge.selectedPackage": "الباقة المحددة", + "recharge.selectProductFirst": "اختر باقة أولا.", + "recharge.noPaymentMethods": "لا توجد طريقة دفع متاحة.", + "recharge.usdtTrc20": "USDT-TRC20", + "recharge.usdtNetwork": "شبكة TRON", + "recharge.thirdPartyPayment": "دفع محلي", + "recharge.createOrder": "إنشاء الطلب", + "recharge.creating": "جار الإنشاء...", + "recharge.orderTitle": "الطلب", + "recharge.paymentOperation": "عملية الدفع", + "recharge.close": "إغلاق", + "recharge.orderId": "رقم الطلب", + "recharge.orderStatus": "الحالة", + "recharge.payRedirecting": "جار فتح صفحة الدفع...", + "recharge.payOpenHint": "افتح صفحة الدفع وأكمل الدفع.", + "recharge.openPayment": "فتح الدفع", + "recharge.usdtAddress": "عنوان USDT-TRC20", + "recharge.usdtHint": "حوّل USDT ثم أرسل TXID.", + "recharge.copy": "نسخ", + "recharge.txHashPlaceholder": "أدخل TXID بعد الدفع", + "recharge.submitTx": "إرسال TXID", + "recharge.submitted": "جار الإرسال...", + "recharge.txSubmitted": "تم إرسال TXID", + "recharge.paidSuccess": "اكتمل الدفع", + "recharge.orderFailed": "فشل الطلب", + "recharge.accountRequired": "أدخل معرف المستخدم", + "recharge.orderCreateFailed": "فشل إنشاء الطلب", + "recharge.loadFailed": "فشل التحميل", + "recharge.copied": "تم النسخ", + "recharge.copyFailed": "فشل النسخ", + "recharge.coins": "عملات", + "recharge.status.pending": "قيد الانتظار", + "recharge.status.redirected": "بانتظار الدفع", + "recharge.status.credited": "تمت الإضافة", + "recharge.status.failed": "فشل" } diff --git a/common/locales/en.json b/common/locales/en.json index d1d868c..d28306d 100644 --- a/common/locales/en.json +++ b/common/locales/en.json @@ -8,6 +8,17 @@ "diceMatch.unknownOpponent": "?", "diceMatch.win": "Win", "diceMatch.coins": "Coins", + "diceMatch.changeLanguage": "Change language", + "diceMatch.loading": "Loading", + "diceMatch.roll": "Roll", + "diceMatch.rolling": "Rolling...", + "diceMatch.ready": "Ready", + "diceMatch.draw": "Draw", + "diceMatch.compare": "Compare", + "diceMatch.apiUnavailable": "Dice API unavailable", + "diceMatch.selectStake": "Select a stake", + "diceMatch.requestFailed": "Request failed", + "diceMatch.configFeeNote": "Fee {fee}% · Pool {pool}%", "roomReward.pageTitle": "Room Reward Event", "roomReward.pageLabel": "Room Reward Event", "roomReward.currentTarget": "Current reward target", @@ -403,5 +414,55 @@ "cp.rewardMarquis7": "Marquis*7days", "cp.rewardCoins10000": "Coins*10000", "cp.rewardCount7": "Count*7days", - "cp.copyright": "The copyright of this activity belongs to Shila" + "cp.copyright": "The copyright of this activity belongs to Shila", + "recharge.pageTitle": "Recharge", + "recharge.pageSubtitle": "Choose a coin package and pay with USDT-TRC20 or a supported local payment method.", + "recharge.changeLanguage": "Change language", + "recharge.accountTitle": "Account", + "recharge.accountHint": "Confirm the account before selecting a package.", + "recharge.userIdPlaceholder": "Enter user ID", + "recharge.searchAccount": "Confirm", + "recharge.loading": "Loading...", + "recharge.accountConfirmed": "Account confirmed", + "recharge.ordinaryUser": "User", + "recharge.coinSeller": "Coin seller", + "recharge.productTitle": "Package", + "recharge.productEmpty": "No package is available for this account.", + "recharge.paymentTitle": "Payment", + "recharge.backToPackages": "Back to packages", + "recharge.selectedPackage": "Selected package", + "recharge.selectProductFirst": "Select a package first.", + "recharge.noPaymentMethods": "No payment method is available.", + "recharge.usdtTrc20": "USDT-TRC20", + "recharge.usdtNetwork": "TRON network", + "recharge.thirdPartyPayment": "Local payment", + "recharge.createOrder": "Create order", + "recharge.creating": "Creating...", + "recharge.orderTitle": "Order", + "recharge.paymentOperation": "Payment operation", + "recharge.close": "Close", + "recharge.orderId": "Order ID", + "recharge.orderStatus": "Status", + "recharge.payRedirecting": "Opening payment page...", + "recharge.payOpenHint": "Open the payment page and finish the payment.", + "recharge.openPayment": "Open payment", + "recharge.usdtAddress": "USDT-TRC20 address", + "recharge.usdtHint": "Transfer USDT and submit the TXID.", + "recharge.copy": "Copy", + "recharge.txHashPlaceholder": "Enter TXID after payment", + "recharge.submitTx": "Submit TXID", + "recharge.submitted": "Submitting...", + "recharge.txSubmitted": "TXID submitted", + "recharge.paidSuccess": "Payment completed", + "recharge.orderFailed": "Order failed", + "recharge.accountRequired": "Enter user ID", + "recharge.orderCreateFailed": "Create order failed", + "recharge.loadFailed": "Load failed", + "recharge.copied": "Copied", + "recharge.copyFailed": "Copy failed", + "recharge.coins": "coins", + "recharge.status.pending": "Pending", + "recharge.status.redirected": "Waiting for payment", + "recharge.status.credited": "Credited", + "recharge.status.failed": "Failed" } diff --git a/common/locales/es.json b/common/locales/es.json index b1900cf..f28b61b 100644 --- a/common/locales/es.json +++ b/common/locales/es.json @@ -8,6 +8,17 @@ "diceMatch.unknownOpponent": "?", "diceMatch.win": "Victoria", "diceMatch.coins": "Monedas", + "diceMatch.changeLanguage": "Cambiar idioma", + "diceMatch.loading": "Cargando", + "diceMatch.roll": "Tirar", + "diceMatch.rolling": "Tirando...", + "diceMatch.ready": "Listo", + "diceMatch.draw": "Empate", + "diceMatch.compare": "Comparar", + "diceMatch.apiUnavailable": "API del juego de dados no disponible", + "diceMatch.selectStake": "Selecciona una apuesta", + "diceMatch.requestFailed": "Error de solicitud", + "diceMatch.configFeeNote": "Comisión {fee}% · Bolsa {pool}%", "roomReward.pageTitle": "Evento de recompensas de sala", "roomReward.pageLabel": "Evento de recompensas de sala", "roomReward.currentTarget": "Objetivo de recompensa actual", @@ -397,5 +408,55 @@ "cp.rewardMarquis7": "Marqués*7 días", "cp.rewardCoins10000": "Monedas*10000", "cp.rewardCount7": "Contador*7 días", - "cp.copyright": "Los derechos de esta actividad pertenecen a Shila" + "cp.copyright": "Los derechos de esta actividad pertenecen a Shila", + "recharge.pageTitle": "Recarga", + "recharge.pageSubtitle": "Elige un paquete de monedas y paga con USDT-TRC20 o un método local compatible.", + "recharge.changeLanguage": "Cambiar idioma", + "recharge.accountTitle": "Cuenta", + "recharge.accountHint": "Confirma la cuenta antes de elegir un paquete.", + "recharge.userIdPlaceholder": "Ingresa el ID de usuario", + "recharge.searchAccount": "Confirmar", + "recharge.loading": "Cargando...", + "recharge.accountConfirmed": "Cuenta confirmada", + "recharge.ordinaryUser": "Usuario", + "recharge.coinSeller": "Vendedor de monedas", + "recharge.productTitle": "Paquete", + "recharge.productEmpty": "No hay paquetes disponibles para esta cuenta.", + "recharge.paymentTitle": "Pago", + "recharge.backToPackages": "Volver a paquetes", + "recharge.selectedPackage": "Paquete seleccionado", + "recharge.selectProductFirst": "Elige un paquete primero.", + "recharge.noPaymentMethods": "No hay métodos de pago disponibles.", + "recharge.usdtTrc20": "USDT-TRC20", + "recharge.usdtNetwork": "Red TRON", + "recharge.thirdPartyPayment": "Pago local", + "recharge.createOrder": "Crear pedido", + "recharge.creating": "Creando...", + "recharge.orderTitle": "Pedido", + "recharge.paymentOperation": "Operación de pago", + "recharge.close": "Cerrar", + "recharge.orderId": "ID de pedido", + "recharge.orderStatus": "Estado", + "recharge.payRedirecting": "Abriendo página de pago...", + "recharge.payOpenHint": "Abre la página de pago y completa el pago.", + "recharge.openPayment": "Abrir pago", + "recharge.usdtAddress": "Dirección USDT-TRC20", + "recharge.usdtHint": "Transfiere USDT y envía el TXID.", + "recharge.copy": "Copiar", + "recharge.txHashPlaceholder": "Ingresa el TXID después del pago", + "recharge.submitTx": "Enviar TXID", + "recharge.submitted": "Enviando...", + "recharge.txSubmitted": "TXID enviado", + "recharge.paidSuccess": "Pago completado", + "recharge.orderFailed": "Pedido fallido", + "recharge.accountRequired": "Ingresa el ID de usuario", + "recharge.orderCreateFailed": "No se pudo crear el pedido", + "recharge.loadFailed": "Error al cargar", + "recharge.copied": "Copiado", + "recharge.copyFailed": "Error al copiar", + "recharge.coins": "monedas", + "recharge.status.pending": "Pendiente", + "recharge.status.redirected": "Esperando pago", + "recharge.status.credited": "Acreditado", + "recharge.status.failed": "Fallido" } diff --git a/common/locales/id.json b/common/locales/id.json index 9a323bb..5f390e1 100644 --- a/common/locales/id.json +++ b/common/locales/id.json @@ -397,5 +397,55 @@ "cp.rewardMarquis7": "Marquis*7 hari", "cp.rewardCoins10000": "Koin*10000", "cp.rewardCount7": "Hitungan*7 hari", - "cp.copyright": "Hak cipta aktivitas ini milik Shila" + "cp.copyright": "Hak cipta aktivitas ini milik Shila", + "recharge.pageTitle": "Top up", + "recharge.pageSubtitle": "Pilih paket coin dan bayar dengan USDT-TRC20 atau metode lokal yang didukung.", + "recharge.changeLanguage": "Ganti bahasa", + "recharge.accountTitle": "Akun", + "recharge.accountHint": "Konfirmasi akun sebelum memilih paket.", + "recharge.userIdPlaceholder": "Masukkan ID pengguna", + "recharge.searchAccount": "Konfirmasi", + "recharge.loading": "Memuat...", + "recharge.accountConfirmed": "Akun dikonfirmasi", + "recharge.ordinaryUser": "Pengguna", + "recharge.coinSeller": "Coin seller", + "recharge.productTitle": "Paket", + "recharge.productEmpty": "Tidak ada paket untuk akun ini.", + "recharge.paymentTitle": "Pembayaran", + "recharge.backToPackages": "Kembali ke paket", + "recharge.selectedPackage": "Paket dipilih", + "recharge.selectProductFirst": "Pilih paket terlebih dahulu.", + "recharge.noPaymentMethods": "Tidak ada metode pembayaran.", + "recharge.usdtTrc20": "USDT-TRC20", + "recharge.usdtNetwork": "Jaringan TRON", + "recharge.thirdPartyPayment": "Pembayaran lokal", + "recharge.createOrder": "Buat pesanan", + "recharge.creating": "Membuat...", + "recharge.orderTitle": "Pesanan", + "recharge.paymentOperation": "Operasi pembayaran", + "recharge.close": "Tutup", + "recharge.orderId": "ID pesanan", + "recharge.orderStatus": "Status", + "recharge.payRedirecting": "Membuka halaman pembayaran...", + "recharge.payOpenHint": "Buka halaman pembayaran dan selesaikan pembayaran.", + "recharge.openPayment": "Buka pembayaran", + "recharge.usdtAddress": "Alamat USDT-TRC20", + "recharge.usdtHint": "Transfer USDT lalu kirim TXID.", + "recharge.copy": "Salin", + "recharge.txHashPlaceholder": "Masukkan TXID setelah bayar", + "recharge.submitTx": "Kirim TXID", + "recharge.submitted": "Mengirim...", + "recharge.txSubmitted": "TXID terkirim", + "recharge.paidSuccess": "Pembayaran selesai", + "recharge.orderFailed": "Pesanan gagal", + "recharge.accountRequired": "Masukkan ID pengguna", + "recharge.orderCreateFailed": "Gagal membuat pesanan", + "recharge.loadFailed": "Gagal memuat", + "recharge.copied": "Disalin", + "recharge.copyFailed": "Gagal menyalin", + "recharge.coins": "coin", + "recharge.status.pending": "Menunggu", + "recharge.status.redirected": "Menunggu pembayaran", + "recharge.status.credited": "Masuk", + "recharge.status.failed": "Gagal" } diff --git a/common/locales/tr.json b/common/locales/tr.json index 694250a..683eba2 100644 --- a/common/locales/tr.json +++ b/common/locales/tr.json @@ -397,5 +397,55 @@ "cp.rewardMarquis7": "Marki*7 gün", "cp.rewardCoins10000": "Coin*10000", "cp.rewardCount7": "Sayaç*7 gün", - "cp.copyright": "Bu etkinliğin telif hakkı Shila'ya aittir" + "cp.copyright": "Bu etkinliğin telif hakkı Shila'ya aittir", + "recharge.pageTitle": "Yükleme", + "recharge.pageSubtitle": "Coin paketi seçin ve USDT-TRC20 ya da desteklenen yerel ödeme yöntemiyle ödeyin.", + "recharge.changeLanguage": "Dili değiştir", + "recharge.accountTitle": "Hesap", + "recharge.accountHint": "Paket seçmeden önce hesabı onaylayın.", + "recharge.userIdPlaceholder": "Kullanıcı ID girin", + "recharge.searchAccount": "Onayla", + "recharge.loading": "Yükleniyor...", + "recharge.accountConfirmed": "Hesap onaylandı", + "recharge.ordinaryUser": "Kullanıcı", + "recharge.coinSeller": "Coin seller", + "recharge.productTitle": "Paket", + "recharge.productEmpty": "Bu hesap için paket yok.", + "recharge.paymentTitle": "Ödeme", + "recharge.backToPackages": "Paketlere dön", + "recharge.selectedPackage": "Seçilen paket", + "recharge.selectProductFirst": "Önce paket seçin.", + "recharge.noPaymentMethods": "Kullanılabilir ödeme yöntemi yok.", + "recharge.usdtTrc20": "USDT-TRC20", + "recharge.usdtNetwork": "TRON ağı", + "recharge.thirdPartyPayment": "Yerel ödeme", + "recharge.createOrder": "Sipariş oluştur", + "recharge.creating": "Oluşturuluyor...", + "recharge.orderTitle": "Sipariş", + "recharge.paymentOperation": "Ödeme işlemi", + "recharge.close": "Kapat", + "recharge.orderId": "Sipariş ID", + "recharge.orderStatus": "Durum", + "recharge.payRedirecting": "Ödeme sayfası açılıyor...", + "recharge.payOpenHint": "Ödeme sayfasını açın ve ödemeyi tamamlayın.", + "recharge.openPayment": "Ödemeyi aç", + "recharge.usdtAddress": "USDT-TRC20 adresi", + "recharge.usdtHint": "USDT gönderin ve TXID girin.", + "recharge.copy": "Kopyala", + "recharge.txHashPlaceholder": "Ödemeden sonra TXID girin", + "recharge.submitTx": "TXID gönder", + "recharge.submitted": "Gönderiliyor...", + "recharge.txSubmitted": "TXID gönderildi", + "recharge.paidSuccess": "Ödeme tamamlandı", + "recharge.orderFailed": "Sipariş başarısız", + "recharge.accountRequired": "Kullanıcı ID girin", + "recharge.orderCreateFailed": "Sipariş oluşturulamadı", + "recharge.loadFailed": "Yükleme başarısız", + "recharge.copied": "Kopyalandı", + "recharge.copyFailed": "Kopyalama başarısız", + "recharge.coins": "coin", + "recharge.status.pending": "Bekliyor", + "recharge.status.redirected": "Ödeme bekleniyor", + "recharge.status.credited": "Yüklendi", + "recharge.status.failed": "Başarısız" } diff --git a/common/locales/zh.json b/common/locales/zh.json index 56b2797..bc2c983 100644 --- a/common/locales/zh.json +++ b/common/locales/zh.json @@ -403,5 +403,55 @@ "cp.rewardMarquis7": "侯爵*7天", "cp.rewardCoins10000": "金币*10000", "cp.rewardCount7": "计数*7天", - "cp.copyright": "本活动版权归 Shila 所有" + "cp.copyright": "本活动版权归 Shila 所有", + "recharge.pageTitle": "充值", + "recharge.pageSubtitle": "选择金币档位,使用 USDT-TRC20 或支持的本地支付方式付款。", + "recharge.changeLanguage": "切换语言", + "recharge.accountTitle": "账号", + "recharge.accountHint": "确认账号后再选择充值档位。", + "recharge.userIdPlaceholder": "输入用户 ID", + "recharge.searchAccount": "确认", + "recharge.loading": "加载中...", + "recharge.accountConfirmed": "账号已确认", + "recharge.ordinaryUser": "普通用户", + "recharge.coinSeller": "币商", + "recharge.productTitle": "充值档位", + "recharge.productEmpty": "当前账号暂无可用档位。", + "recharge.paymentTitle": "支付方式", + "recharge.backToPackages": "返回充值档位", + "recharge.selectedPackage": "已选档位", + "recharge.selectProductFirst": "请先选择充值档位。", + "recharge.noPaymentMethods": "当前暂无可用支付方式。", + "recharge.usdtTrc20": "USDT-TRC20", + "recharge.usdtNetwork": "TRON 网络", + "recharge.thirdPartyPayment": "本地支付", + "recharge.createOrder": "创建订单", + "recharge.creating": "创建中...", + "recharge.orderTitle": "订单", + "recharge.paymentOperation": "支付操作", + "recharge.close": "关闭", + "recharge.orderId": "订单号", + "recharge.orderStatus": "状态", + "recharge.payRedirecting": "正在打开支付页面...", + "recharge.payOpenHint": "打开支付页面并完成付款。", + "recharge.openPayment": "打开支付", + "recharge.usdtAddress": "USDT-TRC20 收款地址", + "recharge.usdtHint": "转账 USDT 后提交 TXID。", + "recharge.copy": "复制", + "recharge.txHashPlaceholder": "付款后输入 TXID", + "recharge.submitTx": "提交 TXID", + "recharge.submitted": "提交中...", + "recharge.txSubmitted": "TXID 已提交", + "recharge.paidSuccess": "支付已完成", + "recharge.orderFailed": "订单失败", + "recharge.accountRequired": "请输入用户 ID", + "recharge.orderCreateFailed": "创建订单失败", + "recharge.loadFailed": "加载失败", + "recharge.copied": "已复制", + "recharge.copyFailed": "复制失败", + "recharge.coins": "金币", + "recharge.status.pending": "待支付", + "recharge.status.redirected": "等待支付", + "recharge.status.credited": "已到账", + "recharge.status.failed": "失败" } diff --git a/common/params.js b/common/params.js index 7a9b35c..605e8a0 100644 --- a/common/params.js +++ b/common/params.js @@ -28,10 +28,31 @@ function normalizeToken(value) { var token = String(value || '').trim(); if (!token) return ''; + if (/^Bearer\s+/i.test(token)) token = token.replace(/^Bearer\s+/i, ''); var match = token.match( /[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/ ); - return match ? match[0] : token; + token = match ? match[0] : token; + return isExpiredToken(token) ? '' : token; + } + + function decodeBase64URLJSON(value) { + try { + var normalized = String(value || '').replace(/-/g, '+').replace(/_/g, '/'); + while (normalized.length % 4) normalized += '='; + return JSON.parse(window.atob(normalized)); + } catch (_) { + return null; + } + } + + function isExpiredToken(token) { + var parts = String(token || '').split('.'); + if (parts.length < 2) return false; + var payload = decodeBase64URLJSON(parts[1]); + if (!payload || !payload.exp) return false; + // params 是页面入口模式的判定来源;过期 JWT 必须当作无 token,否则充值页会隐藏用户 ID 输入并触发 INVALID_ARGUMENT。 + return Number(payload.exp) * 1000 <= Date.now() + 5000; } function parse() { diff --git a/common/vendor/svga.min.js b/common/vendor/svga.min.js new file mode 100644 index 0000000..fb60df4 --- /dev/null +++ b/common/vendor/svga.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SVGA=t():e.SVGA=t()}(window,(function(){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)t.d(i,n,function(t){return e[t]}.bind(null,n));return i},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=64)}([function(e,t,r){"use strict";var i,n,o=e.exports=r(1),s=r(20);o.codegen=r(47),o.fetch=r(48),o.path=r(49),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),i=0;i0)t[n]=e(t[n]||{},r,i);else{var o=t[n];o&&(i=[].concat(o).concat(i)),t[n]=i}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(30)))}})},function(e,t,r){"use strict";(function(e){function i(e,t,r){for(var i=Object.keys(t),n=0;n0)},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var r=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},o.merge=i,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=n,o.ProtocolError=n("ProtocolError"),o.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;rt)return!0;return!1},n.isReservedName=function(e,t){if(e)for(var r=0;r0;){var i=e.shift();if(r.nested&&r.nested[i]){if(!((r=r.nested[i])instanceof n))throw Error("path conflicts with non-namespace objects")}else r.add(r=new n(i))}return t&&r.addJSON(t),r},n.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return i}else if(i instanceof n&&(i=i.lookup(e.slice(1),t,!0)))return i}else for(var o=0;o>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function u(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}e.exports=s;var h,c=r(1),d=c.LongBits,p=c.base64,y=c.utf8,m=function(){return c.Buffer?function(){return(s.create=function(){return new h})()}:function(){return new s}};s.create=m(),s.alloc=function(e){return new c.Array(e)},c.Array!==Array&&(s.alloc=c.pool(s.alloc,c.Array.prototype.subarray)),s.prototype._push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},f.prototype=Object.create(i.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},s.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},s.prototype.int32=function(e){return e<0?this._push(l,10,d.fromNumber(e)):this.uint32(e)},s.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},s.prototype.uint64=function(e){var t=d.from(e);return this._push(l,t.length(),t)},s.prototype.int64=s.prototype.uint64,s.prototype.sint64=function(e){var t=d.from(e).zzEncode();return this._push(l,t.length(),t)},s.prototype.bool=function(e){return this._push(a,1,e?1:0)},s.prototype.fixed32=function(e){return this._push(u,4,e>>>0)},s.prototype.sfixed32=s.prototype.fixed32,s.prototype.fixed64=function(e){var t=d.from(e);return this._push(u,4,t.lo)._push(u,4,t.hi)},s.prototype.sfixed64=s.prototype.fixed64,s.prototype.float=function(e){return this._push(c.float.writeFloatLE,4,e)},s.prototype.double=function(e){return this._push(c.float.writeDoubleLE,8,e)};var v=c.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i>>0;if(!t)return this._push(a,1,0);if(c.isString(e)){var r=s.alloc(t=p.length(e));p.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},s.prototype.string=function(e){var t=y.length(e);return t?this.uint32(t)._push(y.write,t,e):this._push(a,1,0)},s.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new i(n,0,0),this.len=0,this},s.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(n,0,0),this.len=0),this},s.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},s.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},s._configure=function(e){h=e,s.create=m(),h._configure()}},function(e,t,r){"use strict";function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new u(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw i(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function s(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function a(){if(this.pos+8>this.len)throw i(this,8);return new u(s(this.buf,this.pos+=4),s(this.buf,this.pos+=4))}e.exports=n;var f,l=r(1),u=l.LongBits,h=l.utf8,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new n(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new n(e);throw Error("illegal buffer")},d=function(){return l.Buffer?function(e){return(n.create=function(e){return l.Buffer.isBuffer(e)?new f(e):c(e)})(e)}:c};n.create=d(),n.prototype._slice=l.Array.prototype.subarray||l.Array.prototype.slice,n.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return e}}(),n.prototype.int32=function(){return 0|this.uint32()},n.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},n.prototype.bool=function(){return 0!==this.uint32()},n.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return s(this.buf,this.pos+=4)},n.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|s(this.buf,this.pos+=4)},n.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=l.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},n.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=l.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},n.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},n.prototype.string=function(){var e=this.bytes();return h.read(e,0,e.length)},n.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},n.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},n._configure=function(e){f=e,n.create=d(),f._configure();var t=l.Long?"toLong":"toNumber";l.merge(n.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return a.call(this)[t](!0)},sfixed64:function(){return a.call(this)[t](!1)}})}},function(e,t,r){"use strict";function i(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),o.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function n(e){if(e.parent)for(var t=0;t-1&&this.oneof.splice(t,1),e.partOf=null,this},i.prototype.onAdd=function(e){o.prototype.onAdd.call(this,e);for(var t=0;t>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,i,(t.id<<3|2)>>>0)}e.exports=function(e){for(var t,r=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(s.compareFieldsById),f=0;f>>0,8|o.mapKey[l.keyType],l.keyType),void 0===c?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,h,t),r("}")("}")):l.repeated?(r("if(%s!=null&&%s.length){",t,t),l.packed&&void 0!==o.packed[h]?r("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",h,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===c?i(r,l,u,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(l.id<<3|c)>>>0,h,t)),r("}")):(l.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,l.name),void 0===c?i(r,l,u,t):r("w.uint32(%i).%s(%s)",(l.id<<3|c)>>>0,h,t))}return r("return w")};var n=r(2),o=r(7),s=r(0)},function(e,t,r){"use strict";function i(e,t){o.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function n(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}e.exports=i;var o=r(6);((i.prototype=Object.create(o.prototype)).constructor=i).className="Type";var s=r(2),a=r(11),f=r(4),l=r(23),u=r(24),h=r(12),c=r(10),d=r(9),p=r(0),y=r(21),m=r(26),v=r(27),g=r(28),b=r(29);Object.defineProperties(i.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===o.basic[f]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",f),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',l):t("%s[k]=value",l)):a.repeated?(t("if(!(%s&&%s.length))",l,l)("%s=[]",l),void 0!==o.packed[f]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":f=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,f)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,f?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function n(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof s?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,r,i,i):e("d%s=types[%i].toObject(m%s,o)",i,r,i);else{var n=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":n=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,n?"true":"",i);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}var o=t,s=r(2),a=r(0);o.fromObject=function(e){var t=e.fieldsArray,r=a.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n-1){var r=e.substring(t);if(r in l)return r}return null}function a(e,t){try{if(d.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),d.isString(t)){f.filename=e;var i,n=f(t,h,r),a=0;if(n.imports)for(;a-1)){if(h.files.push(e),e in l)return void(c?a(e,l[e]):(++p,setTimeout((function(){--p,a(e,l[e])}))));if(c){var r;try{r=d.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||o(e))}a(e,r)}else++p,h.fetch(e,(function(r,n){if(--p,i)return r?void(t?p||o(null,h):o(r)):void a(e,n)}))}}"function"==typeof r&&(i=r,r=void 0);var h=this;if(!i)return d.asPromise(e,h,t,r);var c=i===n,p=0;d.isString(t)&&(t=[t]);for(var y,m=0;m-1&&this.deferred.splice(t,1)}}else if(e instanceof h)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof s){for(var r=0;r0&&(this.maskPath=new i.BezierPath(t.clipPath,void 0,{fill:"#000000"})),t.shapes&&(t.shapes instanceof Array&&t.shapes.forEach((function(e){switch(e.pathArgs=e.args,e.type){case 0:e.type="shape",e.pathArgs=e.shape;break;case 1:e.type="rect",e.pathArgs=e.rect;break;case 2:e.type="ellipse",e.pathArgs=e.ellipse;break;case 3:e.type="keep"}if(e.styles){e.styles.fill&&("number"==typeof e.styles.fill.r&&(e.styles.fill[0]=e.styles.fill.r),"number"==typeof e.styles.fill.g&&(e.styles.fill[1]=e.styles.fill.g),"number"==typeof e.styles.fill.b&&(e.styles.fill[2]=e.styles.fill.b),"number"==typeof e.styles.fill.a&&(e.styles.fill[3]=e.styles.fill.a)),e.styles.stroke&&("number"==typeof e.styles.stroke.r&&(e.styles.stroke[0]=e.styles.stroke.r),"number"==typeof e.styles.stroke.g&&(e.styles.stroke[1]=e.styles.stroke.g),"number"==typeof e.styles.stroke.b&&(e.styles.stroke[2]=e.styles.stroke.b),"number"==typeof e.styles.stroke.a&&(e.styles.stroke[3]=e.styles.stroke.a));var t=e.styles.lineDash||[];switch(e.styles.lineDashI>0&&t.push(e.styles.lineDashI),e.styles.lineDashII>0&&(t.length<1&&t.push(0),t.push(e.styles.lineDashII),t.push(0)),e.styles.lineDashIII>0&&(t.length<2&&(t.push(0),t.push(0)),t[2]=e.styles.lineDashIII),e.styles.lineDash=t,e.styles.lineJoin){case 0:e.styles.lineJoin="miter";break;case 1:e.styles.lineJoin="round";break;case 2:e.styles.lineJoin="bevel"}switch(e.styles.lineCap){case 0:e.styles.lineCap="butt";break;case 1:e.styles.lineCap="round";break;case 2:e.styles.lineCap="square"}}})),t.shapes[0]&&"keep"===t.shapes[0].type?this.shapes=e.lastShapes:(this.shapes=t.shapes,e.lastShapes=t.shapes));var r=this.transform.a*this.layout.x+this.transform.c*this.layout.y+this.transform.tx,n=this.transform.a*(this.layout.x+this.layout.width)+this.transform.c*this.layout.y+this.transform.tx,o=this.transform.a*this.layout.x+this.transform.c*(this.layout.y+this.layout.height)+this.transform.tx,s=this.transform.a*(this.layout.x+this.layout.width)+this.transform.c*(this.layout.y+this.layout.height)+this.transform.tx,a=this.transform.b*this.layout.x+this.transform.d*this.layout.y+this.transform.ty,f=this.transform.b*(this.layout.x+this.layout.width)+this.transform.d*this.layout.y+this.transform.ty,l=this.transform.b*this.layout.x+this.transform.d*(this.layout.y+this.layout.height)+this.transform.ty,u=this.transform.b*(this.layout.x+this.layout.width)+this.transform.d*(this.layout.y+this.layout.height)+this.transform.ty;this.nx=Math.min(Math.min(o,s),Math.min(r,n)),this.ny=Math.min(Math.min(l,u),Math.min(a,f))}},function(e,t,r){"use strict";e.exports=r(35)},function(e,t,r){"use strict";var i=e.exports=r(36);i.build="light",i.load=function(e,t,r){return"function"==typeof t?(r=t,t=new i.Root):t||(t=new i.Root),t.load(e,r)},i.loadSync=function(e,t){return t||(t=new i.Root),t.loadSync(e)},i.encoder=r(21),i.decoder=r(26),i.verifier=r(27),i.converter=r(28),i.ReflectionObject=r(3),i.Namespace=r(6),i.Root=r(30),i.Enum=r(2),i.Type=r(22),i.Field=r(4),i.OneOf=r(11),i.MapField=r(23),i.Service=r(24),i.Method=r(25),i.Message=r(12),i.wrappers=r(29),i.types=r(7),i.util=r(0),i.ReflectionObject._configure(i.Root),i.Namespace._configure(i.Type,i.Service,i.Enum),i.Root._configure(i.Type),i.Field._configure(i.Type)},function(e,t,r){"use strict";function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}var n=t;n.build="minimal",n.Writer=r(9),n.BufferWriter=r(44),n.Reader=r(10),n.BufferReader=r(45),n.util=r(1),n.rpc=r(19),n.roots=r(20),n.configure=i,i()},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var i=t;i.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),s=0;s<64;)o[n[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(e,t,r){for(var i,o=null,s=[],a=0,f=0;t>2],i=(3&l)<<4,f=1;break;case 1:s[a++]=n[i|l>>4],i=(15&l)<<2,f=2;break;case 2:s[a++]=n[i|l>>6],s[a++]=n[63&l],f=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return f&&(s[a++]=n[i],s[a++]=61,1===f&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))},i.decode=function(e,t,r){for(var i,n=r,s=0,a=0;a1)break;if(void 0===(f=o[f]))throw Error("invalid encoding");switch(s){case 0:i=f,s=1;break;case 1:t[r++]=i<<2|(48&f)>>4,i=f,s=2;break;case 2:t[r++]=(15&i)<<4|(60&f)>>2,i=f,s=3;break;case 3:t[r++]=(3&i)<<6|f,s=0}}if(1===s)throw Error("invalid encoding");return r-n},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,r){"use strict";function i(){this._listeners={}}e.exports=i,i.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},i.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,i)}}function r(e,t,r){var i=e(t,r),n=2*(i>>31)+1,o=i>>>23&255,s=8388607&i;return 255===o?s?NaN:n*(1/0):0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,s),e.readFloatBE=r.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){function t(e,t,r){o[0]=e,t[r]=s[0],t[r+1]=s[1],t[r+2]=s[2],t[r+3]=s[3],t[r+4]=s[4],t[r+5]=s[5],t[r+6]=s[6],t[r+7]=s[7]}function r(e,t,r){o[0]=e,t[r]=s[7],t[r+1]=s[6],t[r+2]=s[5],t[r+3]=s[4],t[r+4]=s[3],t[r+5]=s[2],t[r+6]=s[1],t[r+7]=s[0]}function i(e,t){return s[0]=e[t],s[1]=e[t+1],s[2]=e[t+2],s[3]=e[t+3],s[4]=e[t+4],s[5]=e[t+5],s[6]=e[t+6],s[7]=e[t+7],o[0]}function n(e,t){return s[7]=e[t],s[6]=e[t+1],s[5]=e[t+2],s[4]=e[t+3],s[3]=e[t+4],s[2]=e[t+5],s[1]=e[t+6],s[0]=e[t+7],o[0]}var o=new Float64Array([-0]),s=new Uint8Array(o.buffer),a=128===s[7];e.writeDoubleLE=a?t:r,e.writeDoubleBE=a?r:t,e.readDoubleLE=a?i:n,e.readDoubleBE=a?n:i}():function(){function t(e,t,r,i,n,o){var s=i<0?1:0;if(s&&(i=-i),0===i)e(0,n,o+t),e(1/i>0?0:2147483648,n,o+r);else if(isNaN(i))e(0,n,o+t),e(2146959360,n,o+r);else if(i>17976931348623157e292)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+r);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,n,o+t),e((s<<31|a/4294967296)>>>0,n,o+r);else{var f=Math.floor(Math.log(i)/Math.LN2);1024===f&&(f=1023),e(4503599627370496*(a=i*Math.pow(2,-f))>>>0,n,o+t),e((s<<31|f+1023<<20|1048576*a&1048575)>>>0,n,o+r)}}}function r(e,t,r,i,n){var o=e(i,n+t),s=e(i,n+r),a=2*(s>>31)+1,f=s>>>20&2047,l=4294967296*(1048575&s)+o;return 2047===f?l?NaN:a*(1/0):0===f?5e-324*a*l:a*Math.pow(2,f-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=r.bind(null,s,0,4),e.readDoubleBE=r.bind(null,a,4,0)}(),e}function n(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=i(i)},function(e,t,r){"use strict";var i=t;i.length=function(e){for(var t=0,r=0,i=0;i191&&i<224?o[s++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},i.write=function(e,t,r){for(var i,n,o=r,s=0;s>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(s+1)))?(i=65536+((1023&i)<<10)+(1023&n),++s,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}},function(e,t,r){"use strict";e.exports=function(e,t,r){var i=r||8192,n=i>>>1,o=null,s=i;return function(r){if(r<1||r>n)return e(r);s+r>i&&(o=e(i),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},function(e,t,r){"use strict";function i(e,t){this.lo=e>>>0,this.hi=t>>>0}e.exports=i;var n=r(1),o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict";function i(){o.call(this)}function n(e,t,r){e.length<40?s.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}e.exports=i;var o=r(9);(i.prototype=Object.create(o.prototype)).constructor=i;var s=r(1);i._configure=function(){i.alloc=s._Buffer_allocUnsafe,i.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&"set"===s.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=s.Buffer.byteLength(e);return this.uint32(t),t&&this._push(n,t,e),this},i._configure()},function(e,t,r){"use strict";function i(e){n.call(this,e)}e.exports=i;var n=r(10);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(1);i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},function(e,t,r){"use strict";function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}e.exports=i;var n=r(1);(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict";function i(e,t){function r(e){if("string"!=typeof e){var t=n();if(i.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var s=Object.keys(e),a=new Array(s.length+1),f=new Array(s.length),l=0;l0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};i.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},function(e,t,r){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=r(16).ProtoMovieEntity,o=r(8).assign,s=r(51),a={};o(a,s);var f=function(e){for(var t=[],r=0;r=0){var n=l._base64ToArrayBuffer(e.substring(21));JSZip.loadAsync(n).then((function(e){l._decodeAssets(e,t)}))}else if(e.indexOf("data:svga/2.0;base64,")>=0){n=l._base64ToArrayBuffer(e.substring(21));l.load_viaProto(n,t,r)}else JSZipUtils.getBinaryContent(e,(function(e,i){if(e)throw r&&r(e),console.error(e),e;var n=new Uint8Array(i,0,4);80==n[0]&&75==n[1]&&3==n[2]&&4==n[3]?JSZip.loadAsync(i).then((function(e){l._decodeAssets(e,t)})):l.load_viaProto(i,t,r)}));else{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){l.load_viaProto(o.response,t,r)},o.onerror=function(e){if(!r)throw console.error(e),e;r(e)},o.send()}},load_viaProto:function(e,t,r){try{var i=a.inflate(e),o=n.decode(i),s={};l._loadImages(s,void 0,o,(function(){o.ver="2.0",t({movie:o,images:s})}))}catch(e){if(r)return void r(e);throw console.error(e),e}},_decodeAssets:function(e,t){var r="1.0";e.file("movie.binary")&&(r="1.5"),e.file("movie.spec").async("string").then((function(i){var n=JSON.parse(i),o={};n.ver=r,l._loadImages(o,e,n,(function(){t({movie:n,images:o})}))}))},_loadImages:function(e,t,r,o){var s=this;if("object"===(void 0===r?"undefined":i(r))&&r.$type==n){var a=!0;if(t)e:for(var u in r.images){switch(function(i){if(r.images.hasOwnProperty(i)){var n=r.images[i],u=f(n);return e.hasOwnProperty(i)?"continue":(a=!1,t.file(u+".png").async("base64").then(function(n){e[i]=n,l._loadImages(e,t,r,o)}.bind(s)),"break")}}(u)){case"continue":continue;case"break":break e}}else for(var h in r.images)if(r.images.hasOwnProperty(h)){var c=r.images[h],d=void 0;try{d=f(c)}catch(e){d=f(c)}e[h]=btoa(d)}a&&o.call(this)}else{a=!0;for(var p in r.images)if(r.images.hasOwnProperty(p)){var y=r.images[p];if(e.hasOwnProperty(p))continue;a=!1,t.file(y+".png").async("base64").then(function(i){e[p]=i,l._loadImages(e,t,r,o)}.bind(this));break}a&&o.call(this)}},_base64ToArrayBuffer:function(e){for(var t=window.atob(e),r=t.length,i=new Uint8Array(r),n=0;n=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=o.inflateInit2(this.strm,t.windowBits);if(r!==f.Z_OK)throw new Error(l[r]);if(this.header=new h,o.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=o.inflateSetDictionary(this.strm,t.dictionary))!==f.Z_OK))throw new Error(l[r])}function n(e,t){var r=new i(t);if(r.push(e,!0),r.err)throw r.msg||l[r.err];return r.result}var o=r(52),s=r(8),a=r(57),f=r(58),l=r(59),u=r(60),h=r(61),c=Object.prototype.toString;i.prototype.push=function(e,t){var r,i,n,l,u,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;i=t===~~t?t:!0===t?f.Z_FINISH:f.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new s.Buf8(d),h.next_out=0,h.avail_out=d),(r=o.inflate(h,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&p&&(r=o.inflateSetDictionary(this.strm,p)),r===f.Z_BUF_ERROR&&!0===y&&(r=f.Z_OK,y=!1),r!==f.Z_STREAM_END&&r!==f.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==f.Z_STREAM_END&&(0!==h.avail_in||i!==f.Z_FINISH&&i!==f.Z_SYNC_FLUSH)||("string"===this.options.to?(n=a.utf8border(h.output,h.next_out),l=h.next_out-n,u=a.buf2string(h.output,n),h.next_out=l,h.avail_out=d-l,l&&s.arraySet(h.output,h.output,n,l,0),this.onData(u)):this.onData(s.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==f.Z_STREAM_END);return r===f.Z_STREAM_END&&(i=f.Z_FINISH),i===f.Z_FINISH?(r=o.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===f.Z_OK):i!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),h.avail_out=0,!0)},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){e===f.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=i,t.inflate=n,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,n(e,t)},t.ungzip=n},function(e,t,r){"use strict";function i(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new d.Buf16(320),this.work=new d.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=C,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new d.Buf32(ue),t.distcode=t.distdyn=new d.Buf32(he),t.sane=1,t.back=-1,O):j}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):j}function a(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?j:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,s(e))):j}function f(e,t){var r,i;return e?(i=new n,e.state=i,i.window=null,(r=a(e,t))!==O&&(e.state=null),r):j}function l(e){if(de){var t;for(h=new d.Buf32(512),c=new d.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(v(b,e.lens,0,288,h,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;v(_,e.lens,0,32,c,0,e.work,{bits:5}),de=!1}e.lencode=h,e.lenbits=9,e.distcode=c,e.distbits=5}function u(e,t,r,i){var n,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(d.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((n=o.wsize-o.wnext)>i&&(n=i),d.arraySet(o.window,t,r-i,n,o.wnext),(i-=n)?(d.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=y(r.check,je,2,0),c=0,ue=0,r.mode=B;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ae;break}if((15&c)!==F){e.msg="unknown compression method",r.mode=ae;break}if(ue-=4,ke=8+(15&(c>>>=4)),0===r.wbits)r.wbits=ke;else if(ke>r.wbits){e.msg="invalid window size",r.mode=ae;break}r.dmax=1<>8&1),512&r.flags&&(je[0]=255&c,je[1]=c>>>8&255,r.check=y(r.check,je,2,0)),c=0,ue=0,r.mode=I;case I:for(;ue<32;){if(0===f)break e;f--,c+=n[s++]<>>8&255,je[2]=c>>>16&255,je[3]=c>>>24&255,r.check=y(r.check,je,4,0)),c=0,ue=0,r.mode=P;case P:for(;ue<16;){if(0===f)break e;f--,c+=n[s++]<>8),512&r.flags&&(je[0]=255&c,je[1]=c>>>8&255,r.check=y(r.check,je,2,0)),c=0,ue=0,r.mode=R;case R:if(1024&r.flags){for(;ue<16;){if(0===f)break e;f--,c+=n[s++]<>>8&255,r.check=y(r.check,je,2,0)),c=0,ue=0}else r.head&&(r.head.extra=null);r.mode=D;case D:if(1024&r.flags&&((de=r.length)>f&&(de=f),de&&(r.head&&(ke=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),d.arraySet(r.head.extra,n,s,de,ke)),512&r.flags&&(r.check=y(r.check,n,de,s)),f-=de,s+=de,r.length-=de),r.length))break e;r.length=0,r.mode=M;case M:if(2048&r.flags){if(0===f)break e;de=0;do{ke=n[s+de++],r.head&&ke&&r.length<65536&&(r.head.name+=String.fromCharCode(ke))}while(ke&&de>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Z;break;case J:for(;ue<32;){if(0===f)break e;f--,c+=n[s++]<>>=7&ue,ue-=7&ue,r.mode=ne;break}for(;ue<3;){if(0===f)break e;f--,c+=n[s++]<>>=1)){case 0:r.mode=q;break;case 1:if(l(r),r.mode=Y,t===x){c>>>=2,ue-=2;break e}break;case 2:r.mode=H;break;case 3:e.msg="invalid block type",r.mode=ae}c>>>=2,ue-=2;break;case q:for(c>>>=7&ue,ue-=7&ue;ue<32;){if(0===f)break e;f--,c+=n[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=ae;break}if(r.length=65535&c,c=0,ue=0,r.mode=$,t===x)break e;case $:r.mode=V;case V:if(de=r.length){if(de>f&&(de=f),de>h&&(de=h),0===de)break e;d.arraySet(o,n,s,de,a),f-=de,s+=de,h-=de,a+=de,r.length-=de;break}r.mode=Z;break;case H:for(;ue<14;){if(0===f)break e;f--,c+=n[s++]<>>=5,ue-=5,r.ndist=1+(31&c),c>>>=5,ue-=5,r.ncode=4+(15&c),c>>>=4,ue-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ae;break}r.have=0,r.mode=W;case W:for(;r.have>>=3,ue-=3}for(;r.have<19;)r.lens[Te[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Oe={bits:r.lenbits},xe=v(g,r.lens,0,19,r.lencode,0,r.work,Oe),r.lenbits=Oe.bits,xe){e.msg="invalid code lengths set",r.mode=ae;break}r.have=0,r.mode=G;case G:for(;r.have>>16&255,ge=65535&Se,!((me=Se>>>24)<=ue);){if(0===f)break e;f--,c+=n[s++]<>>=me,ue-=me,r.lens[r.have++]=ge;else{if(16===ge){for(Ae=me+2;ue>>=me,ue-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=ae;break}ke=r.lens[r.have-1],de=3+(3&c),c>>>=2,ue-=2}else if(17===ge){for(Ae=me+3;ue>>=me)),c>>>=3,ue-=3}else{for(Ae=me+7;ue>>=me)),c>>>=7,ue-=7}if(r.have+de>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ae;break}for(;de--;)r.lens[r.have++]=ke}}if(r.mode===ae)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=ae;break}if(r.lenbits=9,Oe={bits:r.lenbits},xe=v(b,r.lens,0,r.nlen,r.lencode,0,r.work,Oe),r.lenbits=Oe.bits,xe){e.msg="invalid literal/lengths set",r.mode=ae;break}if(r.distbits=6,r.distcode=r.distdyn,Oe={bits:r.distbits},xe=v(_,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Oe),r.distbits=Oe.bits,xe){e.msg="invalid distances set",r.mode=ae;break}if(r.mode=Y,t===x)break e;case Y:r.mode=Q;case Q:if(f>=6&&h>=258){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=f,r.hold=c,r.bits=ue,m(e,ce),a=e.next_out,o=e.output,h=e.avail_out,s=e.next_in,n=e.input,f=e.avail_in,c=r.hold,ue=r.bits,r.mode===Z&&(r.back=-1);break}for(r.back=0;ve=(Se=r.lencode[c&(1<>>16&255,ge=65535&Se,!((me=Se>>>24)<=ue);){if(0===f)break e;f--,c+=n[s++]<>be)])>>>16&255,ge=65535&Se,!(be+(me=Se>>>24)<=ue);){if(0===f)break e;f--,c+=n[s++]<>>=be,ue-=be,r.back+=be}if(c>>>=me,ue-=me,r.back+=me,r.length=ge,0===ve){r.mode=ie;break}if(32&ve){r.back=-1,r.mode=Z;break}if(64&ve){e.msg="invalid literal/length code",r.mode=ae;break}r.extra=15&ve,r.mode=X;case X:if(r.extra){for(Ae=r.extra;ue>>=r.extra,ue-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ee;case ee:for(;ve=(Se=r.distcode[c&(1<>>16&255,ge=65535&Se,!((me=Se>>>24)<=ue);){if(0===f)break e;f--,c+=n[s++]<>be)])>>>16&255,ge=65535&Se,!(be+(me=Se>>>24)<=ue);){if(0===f)break e;f--,c+=n[s++]<>>=be,ue-=be,r.back+=be}if(c>>>=me,ue-=me,r.back+=me,64&ve){e.msg="invalid distance code",r.mode=ae;break}r.offset=ge,r.extra=15&ve,r.mode=te;case te:if(r.extra){for(Ae=r.extra;ue>>=r.extra,ue-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ae;break}r.mode=re;case re:if(0===h)break e;if(de=ce-h,r.offset>de){if((de=r.offset-de)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ae;break}de>r.wnext?(de-=r.wnext,pe=r.wsize-de):pe=r.wnext-de,de>r.length&&(de=r.length),ye=r.window}else ye=o,pe=a-r.offset,de=r.length;de>h&&(de=h),h-=de,r.length-=de;do{o[a++]=ye[pe++]}while(--de);0===r.length&&(r.mode=Q);break;case ie:if(0===h)break e;o[a++]=r.length,h--,r.mode=Q;break;case ne:if(r.wrap){for(;ue<32;){if(0===f)break e;f--,c|=n[s++]<>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(n=n+t[i++]|0)|0}while(--s);n%=65521,o%=65521}return n|o<<16|0}},function(e,t,r){"use strict";var i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var o=i,s=n+r;e^=-1;for(var a=n;a>>8^o[255&(e^t[a])];return-1^e}},function(e,t,r){"use strict";e.exports=function(e,t){var r,i,n,o,s,a,f,l,u,h,c,d,p,y,m,v,g,b,_,w,k,x,O,A,S;r=e.state,i=e.next_in,A=e.input,n=i+(e.avail_in-5),o=e.next_out,S=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),f=r.dmax,l=r.wsize,u=r.whave,h=r.wnext,c=r.window,d=r.hold,p=r.bits,y=r.lencode,m=r.distcode,v=(1<>>=_=b>>>24,p-=_,0==(_=b>>>16&255))S[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=y[(65535&b)+(d&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&b,(_&=15)&&(p<_&&(d+=A[i++]<>>=_,p-=_),p<15&&(d+=A[i++]<>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=m[(65535&b)+(d&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&b,p<(_&=15)&&(d+=A[i++]<f){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=_,p-=_,k>(_=o-s)){if((_=k-_)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,O=c,0===h){if(x+=l-_,_2;)S[o++]=O[x++],S[o++]=O[x++],S[o++]=O[x++],w-=3;w&&(S[o++]=O[x++],w>1&&(S[o++]=O[x++]))}else{x=o-k;do{S[o++]=S[x++],S[o++]=S[x++],S[o++]=S[x++],w-=3}while(w>2);w&&(S[o++]=S[x++],w>1&&(S[o++]=S[x++]))}break}}break}}while(i>3,d&=(1<<(p-=w<<3))-1,e.next_in=i,e.next_out=o,e.avail_in=i=1&&0===P[S];S--);if(j>S&&(j=S),0===S)return l[u++]=20971520,l[u++]=20971520,c.bits=1,0;for(A=1;A0&&(0===e||1!==S))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+P[x];for(O=0;O852||2===e&&F>592)return 1;for(;;){b=x-E,h[O]g?(_=D[M+h[O]],w=B[I+h[O]]):(_=96,w=0),d=1<>E)+(p-=d)]=b<<24|_<<16|w|0}while(0!==p);for(d=1<>=1;if(0!==d?(C&=d-1,C+=d):C=0,O++,0==--P[x]){if(x===S)break;x=t[r+h[O]]}if(x>j&&(C&m)!==y){for(0===E&&(E=j),v+=A,N=1<<(T=x-E);T+E852||2===e&&F>592)return 1;l[y=C&m]=j<<24|T<<16|v-u|0}}return 0!==C&&(l[v+C]=x-E<<24|64<<16|0),c.bits=j,0}},function(e,t,r){"use strict";function i(e,t){if(t<65534&&(e.subarray&&s||!e.subarray&&o))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",i=0;i=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;a[254]=a[254]=1,t.string2buf=function(e){var t,r,i,o,s,a=e.length,f=0;for(o=0;o>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return i(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r4)l[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r1?l[n++]=65533:o<65536?l[n++]=o:(o-=65536,l[n++]=55296|o>>10&1023,l[n++]=56320|1023&o)}return i(l,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+a[e[r]]>t?r:t}},function(e,t,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1);e.exports=i.ValueAnimator},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.startValue=0,this.endValue=0,this.duration=0,this.loops=1,this.fillRule=0,this.onStart=function(){},this.onUpdate=function(){},this.onEnd=function(){},this.mRunning=!1,this.mStartTime=0,this.mCurrentFrication=0,this.mReverse=!1}return e.prototype.start=function(e){void 0===e&&(e=void 0),this.doStart(!1,e)},e.prototype.reverse=function(e){void 0===e&&(e=void 0),this.doStart(!0,e)},e.prototype.stop=function(){this.doStop()},Object.defineProperty(e.prototype,"animatedValue",{get:function(){return(this.endValue-this.startValue)*this.mCurrentFrication+this.startValue},enumerable:!0,configurable:!0}),e.prototype.doStart=function(t,r){void 0===t&&(t=!1),void 0===r&&(r=void 0),this.mReverse=t,this.mRunning=!0,this.mStartTime=e.currentTimeMillsecond(),r&&(this.mStartTime-=t?(1-r/(this.endValue-this.startValue))*this.duration:r/(this.endValue-this.startValue)*this.duration),this.mCurrentFrication=0,this.onStart(),this.doFrame()},e.prototype.doStop=function(){this.mRunning=!1},e.prototype.doFrame=function(){this.mRunning&&(this.doDeltaTime(e.currentTimeMillsecond()-this.mStartTime),this.mRunning&&e.requestAnimationFrame(this.doFrame.bind(this)))},e.prototype.doDeltaTime=function(e){e>=this.duration*this.loops?(this.mCurrentFrication=1===this.fillRule?0:1,this.mRunning=!1):(this.mCurrentFrication=e%this.duration/this.duration,this.mReverse&&(this.mCurrentFrication=1-this.mCurrentFrication)),this.onUpdate(this.animatedValue),!1===this.mRunning&&this.onEnd()},e.currentTimeMillsecond=function(){return"undefined"==typeof performance?(new Date).getTime():performance.now()},e.requestAnimationFrame=function(e){return"undefined"==typeof requestAnimationFrame?setTimeout(e,16):window.requestAnimationFrame(e)},e}();t.ValueAnimator=i}])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Player=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var r=0;r=this._videoItem.frames||e<0||(this.pauseAnimation(),this._currentFrame=e,this._update(),t&&this._doStart(void 0,!1,this._currentFrame))}},{key:"stepToPercentage",value:function(e,t){var r=parseInt(e*this._videoItem.frames);r>=this._videoItem.frames&&r>0&&(r=this._videoItem.frames-1),this.stepToFrame(r,t)}},{key:"setImage",value:function(e,t,r){this._dynamicImage[t]=e,void 0!==r&&r instanceof Array&&6==r.length&&(this._dynamicImageTransform[t]=r)}},{key:"setText",value:function(e,t){var r="string"==typeof e?e:e.text,n=("object"===(void 0===e?"undefined":i(e))?e.size:"14px")||"14px",o=("object"===(void 0===e?"undefined":i(e))?e.family:"Arial")||"Arial",s=("object"===(void 0===e?"undefined":i(e))?e.color:"#000000")||"#000000",a=("object"===(void 0===e?"undefined":i(e))?e.offset:{x:0,y:0})||{x:0,y:0};this._dynamicText[t]={text:r,style:n+" "+o,color:s,offset:a}}},{key:"clearDynamicObjects",value:function(){this._dynamicImage={},this._dynamicImageTransform={},this._dynamicText={}}},{key:"onFinished",value:function(e){this._onFinished=e}},{key:"onFrame",value:function(e){this._onFrame=e}},{key:"onPercentage",value:function(e){this._onPercentage=e}},{key:"drawOnContext",value:function(e,t,r,i,n){this._drawingCanvas&&this._videoItem&&e.drawImage(this._drawingCanvas,t,r,i||this._videoItem.videoSize.width,n||this._videoItem.videoSize.height)}},{key:"_init",value:function(){if(this._container instanceof HTMLDivElement||this._asChild){if(this._container)for(var e=this._container.querySelectorAll("canvas"),t=0;tMath.floor(e)&&i._renderer.clearAudios(),i._currentFrame=Math.floor(e),i._update(),"function"==typeof i._onFrame&&i._onFrame(i._currentFrame),"function"==typeof i._onPercentage&&i._onPercentage(parseFloat(i._currentFrame+1)/parseFloat(i._videoItem.frames)))},this._animator.onEnd=function(){i._forwardAnimating=!1,!0===i.clearsAfterStop&&i.clear(),"function"==typeof i._onFinished&&i._onFinished()},!0===t?(this._animator.reverse(r),this._forwardAnimating=!1):(this._animator.start(r),this._forwardAnimating=!0),this._currentFrame=this._animator.startValue,this._update()}},{key:"_resize",value:function(){var e=!1;if(this._drawingCanvas){var t;t=this._drawingCanvas.parentNode?{width:this._drawingCanvas.parentNode.clientWidth,height:this._drawingCanvas.parentNode.clientHeight}:this._videoItem.videoSize;var r=this._videoItem.videoSize;if(t.width>=r.width&&t.height>=r.height)this._drawingCanvas.width=t.width,this._drawingCanvas.height=t.height,this._drawingCanvas.style.webkitTransform=this._drawingCanvas.style.transform="",e=!0;else{if(this._drawingCanvas.width=r.width,this._drawingCanvas.height=r.height,"Fill"===this._contentMode){var i=t.width/r.width,n=t.height/r.height,o=(r.width*i-r.width)/2,s=(r.height*n-r.height)/2;this._drawingCanvas.style.webkitTransform=this._drawingCanvas.style.transform="matrix("+i+", 0.0, 0.0, "+n+", "+o+", "+s+")"}else if("AspectFit"===this._contentMode||"AspectFill"===this._contentMode){var a=r.width/r.height,f=t.width/t.height;if(a>=f&&"AspectFit"===this._contentMode||a<=f&&"AspectFill"===this._contentMode){var l=t.width/r.width,u=(r.width*l-r.width)/2,h=(r.height*l-r.height)/2+(t.height-r.height*l)/2;this._drawingCanvas.style.webkitTransform=this._drawingCanvas.style.transform="matrix("+l+", 0.0, 0.0, "+l+", "+u+", "+h+")"}else if(af&&"AspectFill"===this._contentMode){var c=t.height/r.height,d=(r.width*c-r.width)/2+(t.width-r.width*c)/2,p=(r.height*c-r.height)/2;this._drawingCanvas.style.webkitTransform=this._drawingCanvas.style.transform="matrix("+c+", 0.0, 0.0, "+c+", "+d+", "+p+")"}}this._globalTransform=void 0}}if(void 0===this._drawingCanvas||!0===e){var y=1,m=1,v=0,g=0,b={width:void 0!==this._container?this._container.clientWidth:0,height:void 0!==this._container?this._container.clientHeight:0},_=this._videoItem.videoSize;if("Fill"===this._contentMode)y=b.width/_.width,m=b.height/_.height;else if("AspectFit"===this._contentMode||"AspectFill"===this._contentMode){var w=_.width/_.height,k=b.width/b.height;w>=k&&"AspectFit"===this._contentMode||w<=k&&"AspectFill"===this._contentMode?(y=m=b.width/_.width,g=(b.height-_.height*m)/2):(wk&&"AspectFill"===this._contentMode)&&(y=m=b.height/_.height,v=(b.width-_.width*y)/2)}this._globalTransform={a:y,b:0,c:0,d:m,tx:v,ty:g}}}},{key:"_update",value:function(){void 0!==this._videoItem&&(this._resize(),this._renderer.drawFrame(this._currentFrame),this._renderer.playAudio(this._currentFrame))}}]),e}()},function(e,t,r){"use strict";var i=r(13),n=r(63),o=r(66);e.exports={Parser:i.Parser,Player:n.Player,autoload:o.AutoLoader.autoload},o.AutoLoader.autoload()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(){function e(e,t){for(var r=0;r=t.endFrame&&(r=!0,t.player.stop(t.playID))})),r&&(this._soundsQueue=this._soundsQueue.filter((function(t){return e=0){var o=t.substr(1).trim().split(" ");r.drawBezierElement(e,i,n,o)}}})),t._styles&&t._styles.fill&&e.fill(),t._styles&&t._styles.stroke&&e.stroke(),e.restore()}},{key:"drawBezierElement",value:function(e,t,r,i){switch(r){case"M":t.x=Number(i[0]),t.y=Number(i[1]),e.moveTo(t.x,t.y);break;case"m":t.x+=Number(i[0]),t.y+=Number(i[1]),e.moveTo(t.x,t.y);break;case"L":t.x=Number(i[0]),t.y=Number(i[1]),e.lineTo(t.x,t.y);break;case"l":t.x+=Number(i[0]),t.y+=Number(i[1]),e.lineTo(t.x,t.y);break;case"H":t.x=Number(i[0]),e.lineTo(t.x,t.y);break;case"h":t.x+=Number(i[0]),e.lineTo(t.x,t.y);break;case"V":t.y=Number(i[0]),e.lineTo(t.x,t.y);break;case"v":t.y+=Number(i[0]),e.lineTo(t.x,t.y);break;case"C":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x2=Number(i[2]),t.y2=Number(i[3]),t.x=Number(i[4]),t.y=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"c":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x2=t.x+Number(i[2]),t.y2=t.y+Number(i[3]),t.x+=Number(i[4]),t.y+=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"S":t.x1&&t.y1&&t.x2&&t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=Number(i[0]),t.y2=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"s":t.x1&&t.y1&&t.x2&&t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=t.x+Number(i[0]),t.y2=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"Q":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"q":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"A":case"a":break;case"Z":case"z":e.closePath()}}},{key:"drawEllipse",value:function(e,t){e.save(),this.resetShapeStyles(e,t),void 0!==t._transform&&null!==t._transform&&e.transform(t._transform.a,t._transform.b,t._transform.c,t._transform.d,t._transform.tx,t._transform.ty);var r=t._x-t._radiusX,i=t._y-t._radiusY,n=2*t._radiusX,o=2*t._radiusY,s=n/2*.5522848,a=o/2*.5522848,f=r+n,l=i+o,u=r+n/2,h=i+o/2;e.beginPath(),e.moveTo(r,h),e.bezierCurveTo(r,h-a,u-s,i,u,i),e.bezierCurveTo(u+s,i,f,h-a,f,h),e.bezierCurveTo(f,h+a,u+s,l,u,l),e.bezierCurveTo(u-s,l,r,h+a,r,h),t._styles&&t._styles.fill&&e.fill(),t._styles&&t._styles.stroke&&e.stroke(),e.restore()}},{key:"drawRect",value:function(e,t){e.save(),this.resetShapeStyles(e,t),void 0!==t._transform&&null!==t._transform&&e.transform(t._transform.a,t._transform.b,t._transform.c,t._transform.d,t._transform.tx,t._transform.ty);var r=t._x,i=t._y,n=t._width,o=t._height,s=t._cornerRadius;n<2*s&&(s=n/2),o<2*s&&(s=o/2),e.beginPath(),e.moveTo(r+s,i),e.arcTo(r+n,i,r+n,i+o,s),e.arcTo(r+n,i+o,r,i+o,s),e.arcTo(r,i+o,r,i,s),e.arcTo(r,i,r+n,i,s),e.closePath(),t._styles&&t._styles.fill&&e.fill(),t._styles&&t._styles.stroke&&e.stroke(),e.restore()}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoLoader=void 0;var i=r(13),n=r(63),o=t.AutoLoader=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};o.sharedParser=new i.Parser,o.autoload=function(e,t){if("undefined"!=typeof window&&"undefined"!=typeof document){var r=t||o.sharedParser;if(e){if(("CANVAS"===e.tagName||"DIV"===e.tagName)&&e.attributes.src&&e.attributes.src.value.indexOf(".svga")===e.attributes.src.value.length-5){var i=e.attributes.src.value,s=new n.Player(e);r.load(i,(function(t){if(e.attributes.loops){var r=parseFloat(e.attributes.loops.value)||0;s.loops=r}if(e.attributes.clearsAfterStop){var i=!("false"===e.attributes.clearsAfterStop.value);s.clearsAfterStop=i}s.setVideoItem(t),s.startAnimation()})),e.player=s}}else for(var a=document.querySelectorAll('[src$=".svga"]'),f=0;f + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/game/touzi/assets/figma/matching-center.svg b/game/touzi/assets/figma/matching-center.svg new file mode 100644 index 0000000..33b80ce --- /dev/null +++ b/game/touzi/assets/figma/matching-center.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/game/touzi/index.html b/game/touzi/index.html index de34623..102ffa5 100644 --- a/game/touzi/index.html +++ b/game/touzi/index.html @@ -14,6 +14,8 @@ --dice-frame-width: 375px; --dice-frame-height: 812px; --dice-scale: 1; + --dice-playfield-offset: 24px; + --dice-topbar-offset: -24px; } * { @@ -78,7 +80,9 @@ .game-content { position: absolute; inset: 0; - transform: translateY(-44px); + transform: translateY( + calc(-44px + var(--dice-playfield-offset)) + ); } .layer { @@ -142,6 +146,306 @@ text-align: center; } + .top-bar { + position: absolute; + top: 60px; + left: 16px; + z-index: 10; + width: 343px; + height: 36px; + display: flex; + align-items: center; + justify-content: space-between; + transform: translateY(var(--dice-topbar-offset)); + } + + .top-back { + position: relative; + width: 46px; + height: 36px; + flex: 0 0 46px; + transform: translateY(-17px); + } + + .top-game-icon { + position: absolute; + top: 50%; + left: 50%; + width: 36px; + height: 36px; + overflow: hidden; + border-radius: 6px; + transform: translate(-50%, -50%); + } + + .top-coin { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 102px; + height: 32px; + flex: 0 0 102px; + gap: 4px; + overflow: hidden; + padding: 0 7px; + /* border: 1px solid rgba(108, 113, 194, 0.96); + border-radius: 4px; */ + /* background: linear-gradient( + 180deg, + rgba(15, 18, 58, 0.92) 0%, + rgba(4, 6, 31, 0.86) 100% + ); + box-shadow: + inset 0 0 0 1px rgba(255, 255, 255, 0.05), + 0 0 11px rgba(79, 93, 202, 0.22); */ + color: #ffe38e; + font-family: inherit; + font-size: 18px; + font-weight: 900; + line-height: 20px; + margin: 0; + text-align: center; + text-shadow: + 0 1px 1px rgba(65, 23, 0, 0.86), + 0 0 6px rgba(255, 204, 74, 0.34); + white-space: nowrap; + appearance: none; + -webkit-appearance: none; + border-image: none; + cursor: pointer; + } + + .top-coin span { + display: block; + min-width: 0; + max-width: 48px; + flex: 0 1 auto; + overflow: hidden; + line-height: 20px; + } + + .top-coin.is-compact span { + max-width: 38px; + font-size: 16px; + } + + .top-coin img { + display: block; + width: 23px; + height: 23px; + flex: 0 0 23px; + filter: drop-shadow(0 0 5px rgba(255, 197, 49, 0.45)); + } + + .top-coin-plus { + color: #ffd15a; + font-size: 21px; + font-weight: 900; + /* line-height: 8px; */ + text-shadow: + 0 1px 1px rgba(65, 23, 0, 0.86), + 0 0 8px rgba(255, 178, 47, 0.74); + align-items: center; + /* font-size: 0; */ + display: inline-block; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 5px; + } + + .language-switcher { + position: absolute; + top: 41px; + right: 0; + z-index: 20; + width: 102px; + font-family: inherit; + } + + .language-button { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 22px; + border: 1px solid rgba(108, 113, 194, 0.68); + border-radius: 4px; + background: rgba(7, 10, 40, 0.72); + color: #ffe38e; + font-size: 12px; + font-weight: 900; + line-height: 14px; + letter-spacing: 0; + text-shadow: 0 0 5px rgba(255, 204, 74, 0.42); + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); + } + + .language-button::after { + margin-left: 4px; + color: #ffd15a; + content: 'v'; + font-size: 10px; + line-height: 10px; + } + + .language-menu { + position: absolute; + top: 26px; + right: 0; + width: 102px; + padding: 4px; + border: 1px solid rgba(108, 113, 194, 0.78); + border-radius: 6px; + background: rgba(5, 8, 35, 0.94); + box-shadow: 0 6px 14px rgba(0, 0, 0, 0.42); + } + + .language-menu button { + display: block; + width: 100%; + min-height: 24px; + border-radius: 4px; + color: rgba(255, 227, 142, 0.78); + font-size: 12px; + font-weight: 800; + line-height: 14px; + text-align: center; + } + + .language-menu button.is-active { + background: rgba(255, 209, 90, 0.16); + color: #ffd15a; + } + + html[dir='rtl'] .language-button::after { + margin-right: 4px; + margin-left: 0; + } + + .lobby-avatar-glow { + top: 163px; + left: 151px; + width: 73px; + height: 73px; + } + + .lobby-player-card { + top: 146px; + left: 131px; + width: 113px; + height: 158px; + } + + .dice-avatar, + .dice-avatar-frame { + position: absolute; + display: block; + pointer-events: none; + user-select: none; + } + + .dice-avatar { + z-index: 4; + width: 71px; + height: 71px; + border-radius: 50%; + object-fit: cover; + clip-path: circle(50% at 50% 50%); + background: transparent; + } + + .dice-avatar-frame { + z-index: 5; + width: 84px; + height: 84px; + object-fit: contain; + opacity: 0; + } + + .dice-avatar-frame.has-frame { + opacity: 1; + } + + .avatar-hole-mask { + position: absolute; + z-index: 3; + width: 74px; + height: 74px; + border-radius: 50%; + background: radial-gradient( + circle at 50% 44%, + rgba(27, 19, 36, 0.98) 0%, + rgba(13, 10, 22, 0.98) 68%, + rgba(6, 5, 15, 0.98) 100% + ); + box-shadow: + inset 0 0 16px rgba(0, 0, 0, 0.72), + 0 0 10px rgba(255, 174, 58, 0.12); + pointer-events: none; + } + + .avatar-hole-mask-lobby { + top: 163px; + left: 150px; + } + + .avatar-hole-mask-self { + top: 163px; + left: 40px; + } + + .dice-avatar.is-empty, + .dice-avatar-frame.is-empty { + visibility: hidden; + opacity: 0; + } + + .dice-avatar-lobby { + top: 163px; + left: 152px; + } + + .dice-avatar-frame-lobby { + top: 158px; + left: 145px; + } + + .dice-avatar-self { + top: 168px; + left: 45px; + } + + .dice-avatar-frame-self { + top: 158px; + left: 35px; + } + + .dice-avatar-opponent { + top: 168px; + left: 266px; + } + + .dice-avatar-frame-opponent { + top: 158px; + left: 256px; + } + + .lobby-player-name { + position: absolute; + top: 247px; + left: 147px; + width: 81px; + height: 32px; + overflow: hidden; + color: #ffffff; + font-size: 14px; + line-height: 16px; + text-align: center; + word-break: break-word; + } + .player-name { position: absolute; top: 247px; @@ -167,6 +471,21 @@ text-align: center; } + .opponent-name { + position: absolute; + top: 247px; + left: 258px; + z-index: 6; + width: 81px; + height: 32px; + overflow: hidden; + color: #ffffff; + font-size: 14px; + line-height: 16px; + text-align: center; + word-break: break-word; + } + .matching-label { position: absolute; top: 270px; @@ -360,6 +679,49 @@ visibility 0s linear 830ms; } + .dice-frame.is-searching .waiting-only { + visibility: hidden; + opacity: 0; + pointer-events: none; + transition: + opacity 240ms ease, + visibility 0s linear 260ms; + } + + .lobby-only { + transition: + opacity 180ms ease, + visibility 0s linear 0s, + transform 820ms ease-in-out; + will-change: opacity, transform; + } + + .dice-frame.is-searching .lobby-only, + .dice-frame.is-matching .lobby-only { + visibility: visible; + opacity: 1; + pointer-events: auto; + transition: + opacity 180ms ease, + visibility 0s linear 0s, + transform 820ms ease-in-out; + } + + .dice-frame.is-searching .lobby-avatar-glow, + .dice-frame.is-matching .lobby-avatar-glow, + .dice-frame.is-searching .lobby-player-card, + .dice-frame.is-matching .lobby-player-card, + .dice-frame.is-searching .avatar-hole-mask-lobby, + .dice-frame.is-matching .avatar-hole-mask-lobby, + .dice-frame.is-searching .dice-avatar-lobby, + .dice-frame.is-matching .dice-avatar-lobby, + .dice-frame.is-searching .dice-avatar-frame-lobby, + .dice-frame.is-matching .dice-avatar-frame-lobby, + .dice-frame.is-searching .lobby-player-name, + .dice-frame.is-matching .lobby-player-name { + transform: translateX(-110px); + } + .matching-card-only { visibility: hidden; opacity: 0; @@ -368,12 +730,79 @@ visibility 0s linear 180ms; } - .dice-frame.is-matching .matching-card-only { + .dice-frame.is-searching .matching-card-only { visibility: visible; opacity: 1; transition: - opacity 220ms ease 560ms, - visibility 0s linear 560ms; + opacity 220ms ease 760ms, + visibility 0s linear 760ms; + } + + .search-indicator img { + transform-origin: 50% 50%; + } + + .search-indicator img { + --search-orbit-radius: 5px; + } + + .dice-frame.is-searching .search-indicator img { + animation: search-orbit 1100ms linear infinite; + } + + .searching-only { + visibility: hidden; + opacity: 0; + transition: + opacity 180ms ease, + visibility 0s linear 180ms; + } + + .dice-frame.is-searching .searching-only { + visibility: visible; + opacity: 1; + transition: + opacity 220ms ease 820ms, + visibility 0s linear 820ms; + } + + .center-search { + position: absolute; + top: 157px; + left: 122px; + z-index: 8; + width: 132px; + height: 132px; + filter: drop-shadow(0 0 12px rgba(77, 224, 255, 0.72)); + } + + .center-search-bg, + .center-search-icon { + position: absolute; + display: block; + pointer-events: none; + user-select: none; + } + + .center-search-bg { + inset: 0; + width: 100%; + height: 100%; + transform-origin: 50% 50%; + will-change: transform; + } + + .dice-frame.is-searching .center-search-bg { + animation: matching-center-spin 3000ms linear infinite; + } + + .center-search-icon { + top: 50%; + left: 50%; + width: 44px; + height: 44px; + filter: drop-shadow(0 0 8px rgba(126, 220, 255, 0.88)); + transform: translate(-50%, -50%); } .matching-action { @@ -390,12 +819,12 @@ will-change: opacity; } - .dice-frame.is-matching .matching-action { + .dice-frame.is-searching .matching-action { visibility: visible; opacity: 1; transition: - opacity 260ms ease 680ms, - visibility 0s linear 680ms; + opacity 260ms ease 860ms, + visibility 0s linear 860ms; } .matching-action img { @@ -420,12 +849,12 @@ transform: translateX(-18px); } - .dice-frame.is-matching .matching-action img { + .dice-frame.is-searching .matching-action img { opacity: 1; transform: translateX(0); transition: - opacity 180ms ease 760ms, - transform 260ms ease 740ms; + opacity 180ms ease 940ms, + transform 260ms ease 920ms; } .matching-action-text { @@ -447,9 +876,170 @@ transition: opacity 220ms ease 260ms; } - .dice-frame.is-matching .matching-action-text { + .dice-frame.is-searching .matching-action-text { opacity: 1; - transition: opacity 220ms ease 740ms; + transition: opacity 220ms ease 920ms; + } + + .dice-phase-text { + position: absolute; + top: 318px; + left: 52px; + z-index: 12; + width: 271px; + min-height: 42px; + visibility: hidden; + opacity: 0; + color: #fff1a8; + font-size: 36px; + font-weight: 900; + line-height: 42px; + text-align: center; + text-shadow: + 0 2px 0 rgba(96, 16, 0, 0.78), + 0 0 14px rgba(255, 88, 0, 0.82); + transition: opacity 180ms ease; + } + + .dice-frame.is-searching .dice-phase-text, + .dice-frame.is-matching .dice-phase-text { + visibility: visible; + opacity: 1; + } + + .dice-frame.is-countdown .dice-phase-text { + visibility: hidden; + opacity: 0; + } + + .countdown-layer { + position: absolute; + top: 268px; + left: 0; + z-index: 18; + display: flex; + align-items: center; + justify-content: center; + width: 375px; + height: 158px; + visibility: hidden; + opacity: 0; + pointer-events: none; + transition: opacity 120ms ease; + } + + .dice-frame.is-countdown .countdown-layer { + visibility: visible; + opacity: 1; + } + + .countdown-number { + min-width: 132px; + color: transparent; + font-size: 132px; + font-weight: 1000; + line-height: 132px; + text-align: center; + background: linear-gradient( + 180deg, + #ffffff 0%, + #fff5b6 17%, + #ffcf44 43%, + #ff7a00 71%, + #9b2d00 100% + ); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-stroke: 2px #7d2700; + filter: drop-shadow(0 5px 0 rgba(94, 17, 0, 0.9)) + drop-shadow(0 0 18px rgba(255, 205, 46, 0.92)) + drop-shadow(0 0 30px rgba(255, 77, 0, 0.72)); + opacity: 0; + transform: scale(0.72); + } + + .countdown-number.is-ticking { + animation: countdown-number-pop 940ms ease-out both; + } + + .dice-score { + position: absolute; + top: 302px; + z-index: 12; + width: 88px; + min-height: 34px; + visibility: hidden; + opacity: 0; + color: #ffffff; + font-size: 18px; + font-weight: 900; + line-height: 22px; + text-align: center; + text-shadow: 0 2px 5px rgba(0, 0, 0, 0.82); + transition: opacity 180ms ease; + } + + .dice-score-self { + left: 34px; + } + + .dice-score-opponent { + left: 255px; + } + + .dice-frame.has-scores .dice-score { + visibility: visible; + opacity: 1; + } + + .dice-roll-effect { + position: absolute; + z-index: 11; + width: 132px; + height: 132px; + visibility: hidden; + opacity: 0; + pointer-events: none; + transition: opacity 120ms ease; + } + + .dice-roll-effect canvas, + .dice-roll-effect video { + display: block; + width: 100%; + height: 100%; + } + + .dice-roll-effect-self { + left: 8px; + top: 379px; + } + + .dice-roll-effect-opponent { + left: 230px; + top: 379px; + } + + .dice-roll-effect.is-playing, + .dice-roll-effect.is-fallback { + visibility: visible; + opacity: 1; + } + + .dice-roll-effect.is-fallback::before { + position: absolute; + inset: 28px; + content: ''; + border-radius: 50%; + background: radial-gradient( + circle at 45% 38%, + rgba(255, 255, 255, 0.95) 0%, + rgba(255, 230, 124, 0.72) 32%, + rgba(255, 108, 26, 0.38) 58%, + rgba(255, 108, 26, 0) 78% + ); + filter: blur(1px) drop-shadow(0 0 14px rgba(255, 196, 69, 0.82)); + animation: dice-roll-fallback 520ms linear infinite; } .battle-only { @@ -459,10 +1049,90 @@ visibility 0s linear 0s; } + .match-battle-only { + visibility: hidden; + opacity: 0; + pointer-events: none; + transition: + opacity 180ms ease, + visibility 0s linear 180ms; + } + + .dice-frame.is-matching .match-battle-only { + visibility: visible; + opacity: 1; + pointer-events: auto; + transition: + opacity 220ms ease, + visibility 0s linear 0s; + } + + .player-copy-only { + display: none; + } + + .opponent-battle-only, + .versus-only { + visibility: hidden; + opacity: 0; + pointer-events: none; + transition: + opacity 180ms ease, + visibility 0s linear 180ms; + } + + .dice-frame.is-searching .opponent-battle-only, + .dice-frame.is-matching .opponent-battle-only { + visibility: visible; + opacity: 1; + pointer-events: auto; + transition: + opacity 220ms ease 760ms, + visibility 0s linear 760ms; + } + + .opponent-name { + display: none; + } + + .dice-frame.is-matching .opponent-name { + display: block; + } + + .dice-frame.has-opponent .opponent-default-avatar { + visibility: hidden; + opacity: 0; + pointer-events: none; + } + + .dice-frame.is-matching .versus-only { + visibility: visible; + opacity: 1; + pointer-events: auto; + transition: + opacity 80ms ease, + visibility 0s linear 0s; + } + + .dice-frame .dice-avatar.is-empty, + .dice-frame .dice-avatar-frame.is-empty, + .dice-frame.is-searching .dice-avatar.is-empty, + .dice-frame.is-searching .dice-avatar-frame.is-empty, + .dice-frame.is-matching .dice-avatar.is-empty, + .dice-frame.is-matching .dice-avatar-frame.is-empty { + visibility: hidden; + opacity: 0; + pointer-events: none; + } + .dice-frame.is-victory .battle-only, .dice-frame.is-victory .waiting-only, .dice-frame.is-victory .matching-card-only, - .dice-frame.is-victory .matching-action { + .dice-frame.is-victory .matching-action, + .dice-frame.is-victory .searching-only, + .dice-frame.is-victory .opponent-battle-only, + .dice-frame.is-victory .dice-roll-effect, + .dice-frame.is-victory .versus-only { visibility: hidden; opacity: 0; pointer-events: none; @@ -492,6 +1162,38 @@ visibility 0s linear 120ms; } + .winner-avatar-mask, + .winner-avatar { + position: absolute; + top: 268px; + left: 134px; + width: 108px; + height: 108px; + border-radius: 50%; + pointer-events: none; + } + + .winner-avatar-mask { + z-index: 3; + background: radial-gradient( + circle at 50% 44%, + rgba(27, 19, 36, 0.98) 0%, + rgba(13, 10, 22, 0.98) 68%, + rgba(6, 5, 15, 0.98) 100% + ); + box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.72); + } + + .winner-avatar { + z-index: 4; + object-fit: cover; + user-select: none; + } + + .winner-avatar.is-empty { + opacity: 0; + } + .victory-name { position: absolute; top: 392px; @@ -502,6 +1204,7 @@ color: #ffffff; font-size: 24px; line-height: 26px; + text-align: center; word-break: break-word; } @@ -545,17 +1248,26 @@ @media (prefers-reduced-motion: reduce) { .waiting-only, + .lobby-only, + .searching-only, .matching-action, .matching-action img, .matching-action-text, .battle-only, + .match-battle-only, + .opponent-battle-only, + .dice-roll-effect, + .versus-only, .victory-only { transition: none; } .dice-frame.is-matching .vs-badge, .dice-frame.is-matching .vs-badge::after, - .dice-frame.is-matching { + .dice-frame.is-matching, + .dice-frame.is-searching .center-search-bg, + .dice-frame.is-searching .search-indicator img, + .dice-roll-effect.is-fallback::before { animation: none; } } @@ -630,6 +1342,70 @@ transform: scale(1.92); } } + + @keyframes search-orbit { + 0% { + transform: rotate(0deg) + translateX(var(--search-orbit-radius, 12px)) + rotate(0deg); + } + 100% { + transform: rotate(360deg) + translateX(var(--search-orbit-radius, 12px)) + rotate(-360deg); + } + } + + @keyframes matching-center-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } + + @keyframes dice-roll-fallback { + 0% { + transform: scale(0.88) rotate(0deg); + opacity: 0.78; + } + 50% { + transform: scale(1.08) rotate(180deg); + opacity: 1; + } + 100% { + transform: scale(0.88) rotate(360deg); + opacity: 0.78; + } + } + + @keyframes countdown-number-pop { + 0% { + opacity: 0; + transform: scale(0.32); + filter: drop-shadow(0 5px 0 rgba(94, 17, 0, 0.9)) + drop-shadow(0 0 8px rgba(255, 205, 46, 0.55)); + } + + 24% { + opacity: 1; + transform: scale(1.18); + filter: drop-shadow(0 5px 0 rgba(94, 17, 0, 0.9)) + drop-shadow(0 0 24px rgba(255, 229, 86, 1)) + drop-shadow(0 0 42px rgba(255, 77, 0, 0.86)); + } + + 70% { + opacity: 1; + transform: scale(1); + } + + 100% { + opacity: 0; + transform: scale(0.86); + } + } @@ -654,43 +1430,122 @@
- +
+ -
- +
+ +
+ + + +
+ + +
+ +
+
+ +
+
+ + +
+
NameName
+
Name...
+
+ +
-
+
+ + +
NameName
Name...
+ + + +
+ + +
+
?
+
+
+
+ +
+
- -
+ class="winner-avatar-mask victory-only" + data-name="winner avatar empty mask" + >
+
@@ -1250,13 +2189,39 @@ - + + + + + + + + +