@weapp-vite/web 1.3.13 → 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "./runtime-BEbX1tRN.mjs";
1
+ import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "./runtime-D6j2_x_N.mjs";
2
2
  import { n as transformWxssToCss, t as weappWebPlugin } from "./plugin-BARxSPO8.mjs";
3
3
  export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, transformWxssToCss, updateShareMenu, uploadFile, vibrateShort, weappWebPlugin };
@@ -1,2 +1,2 @@
1
- import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "../runtime-BEbX1tRN.mjs";
1
+ import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "../runtime-D6j2_x_N.mjs";
2
2
  export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };
@@ -2,6 +2,7 @@ import { t as slugify } from "./slugify-B4l45KNs.mjs";
2
2
  import { parseDocument } from "htmlparser2";
3
3
  import { LitElement, html } from "lit";
4
4
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
5
+ import { WEAPP_VITE_WEB_ACTION_SHEET_SELECT_INDEX_KEY, WEAPP_VITE_WEB_ANALYTICS_EVENTS_KEY, WEAPP_VITE_WEB_AUTHORIZE_DECISION_KEY, WEAPP_VITE_WEB_CHECK_SESSION_KEY, WEAPP_VITE_WEB_CHOOSE_ADDRESS_KEY, WEAPP_VITE_WEB_CHOOSE_LOCATION_KEY, WEAPP_VITE_WEB_COMPRESS_VIDEO_KEY, WEAPP_VITE_WEB_EXT_CONFIG_KEY, WEAPP_VITE_WEB_FUZZY_LOCATION_KEY, WEAPP_VITE_WEB_GET_USER_PROFILE_DECISION_KEY, WEAPP_VITE_WEB_OPEN_APP_AUTHORIZE_SETTING_KEY, WEAPP_VITE_WEB_OPEN_SETTING_AUTH_KEY, WEAPP_VITE_WEB_OPEN_VIDEO_EDITOR_KEY, WEAPP_VITE_WEB_REQUEST_SUBSCRIBE_MESSAGE_KEY, WEAPP_VITE_WEB_SCAN_CODE_RESULT_KEY, WEAPP_VITE_WEB_UPDATE_MANAGER_KEY, WEAPP_VITE_WEB_USER_INFO_KEY, WEAPP_VITE_WEB_USER_PROFILE_KEY, WEAPP_VITE_WEB_VIDEO_INFO_KEY } from "@weapp-core/constants";
5
6
  //#region \0rolldown/runtime.js
6
7
  var __defProp = Object.defineProperty;
7
8
  var __exportAll = (all, no_symbols) => {
@@ -1565,7 +1566,7 @@ function normalizeAuthorizeDecision(decision) {
1565
1566
  return "authorized";
1566
1567
  }
1567
1568
  function resolveAuthorizeDecision(scope) {
1568
- const decisionSource = globalThis.__weappViteWebAuthorizeDecision;
1569
+ const decisionSource = globalThis[WEAPP_VITE_WEB_AUTHORIZE_DECISION_KEY];
1569
1570
  if (typeof decisionSource === "function") try {
1570
1571
  return normalizeAuthorizeDecision(decisionSource(scope));
1571
1572
  } catch {
@@ -1575,7 +1576,7 @@ function resolveAuthorizeDecision(scope) {
1575
1576
  return "authorized";
1576
1577
  }
1577
1578
  function syncOpenSettingPreset(authorizeState, supportedAuthScopes) {
1578
- const preset = globalThis.__weappViteWebOpenSettingAuth;
1579
+ const preset = globalThis[WEAPP_VITE_WEB_OPEN_SETTING_AUTH_KEY];
1579
1580
  if (!preset || typeof preset !== "object") return;
1580
1581
  for (const [scope, value] of Object.entries(preset)) {
1581
1582
  if (!supportedAuthScopes.has(scope)) continue;
@@ -1589,7 +1590,7 @@ function normalizeAppAuthorizeStatus(value) {
1589
1590
  return "not determined";
1590
1591
  }
1591
1592
  function syncOpenAppAuthorizeSettingPreset(authorizeState, scopeMap) {
1592
- const preset = globalThis.__weappViteWebOpenAppAuthorizeSetting;
1593
+ const preset = globalThis[WEAPP_VITE_WEB_OPEN_APP_AUTHORIZE_SETTING_KEY];
1593
1594
  if (!preset || typeof preset !== "object") return;
1594
1595
  for (const [key, scope] of Object.entries(scopeMap)) {
1595
1596
  if (!scope) continue;
@@ -1631,7 +1632,7 @@ function resolveUserInfoPreset(source, lang) {
1631
1632
  }
1632
1633
  function buildUserProfilePayload(errMsg, optionsLang) {
1633
1634
  const language = normalizeUserLanguage(optionsLang);
1634
- const userInfo = resolveUserInfoPreset("__weappViteWebUserProfile", language) ?? resolveUserInfoPreset("__weappViteWebUserInfo", language) ?? {
1635
+ const userInfo = resolveUserInfoPreset(WEAPP_VITE_WEB_USER_PROFILE_KEY, language) ?? resolveUserInfoPreset(WEAPP_VITE_WEB_USER_INFO_KEY, language) ?? {
1635
1636
  nickName: "Web User",
1636
1637
  avatarUrl: "",
1637
1638
  gender: 0,
@@ -1651,14 +1652,14 @@ function buildUserProfilePayload(errMsg, optionsLang) {
1651
1652
  };
1652
1653
  }
1653
1654
  function resolveCheckSessionState() {
1654
- const preset = globalThis.__weappViteWebCheckSession;
1655
+ const preset = globalThis[WEAPP_VITE_WEB_CHECK_SESSION_KEY];
1655
1656
  if (typeof preset === "boolean") return preset;
1656
1657
  if (typeof preset === "string") return preset.trim() !== "fail";
1657
1658
  if (preset && typeof preset === "object" && "valid" in preset) return Boolean(preset.valid);
1658
1659
  return true;
1659
1660
  }
1660
1661
  function resolveUserProfileDecision() {
1661
- const preset = globalThis.__weappViteWebGetUserProfileDecision;
1662
+ const preset = globalThis[WEAPP_VITE_WEB_GET_USER_PROFILE_DECISION_KEY];
1662
1663
  if (typeof preset === "function") return normalizeAuthorizeDecision(preset());
1663
1664
  return normalizeAuthorizeDecision(preset);
1664
1665
  }
@@ -1825,6 +1826,7 @@ async function getBatteryInfoBridge(options) {
1825
1826
  }
1826
1827
  //#endregion
1827
1828
  //#region src/runtime/polyfill/location.ts
1829
+ const ADDRESS_PROMPT_SPLIT_RE = /[,,]/;
1828
1830
  function normalizeGeoNumber(value, fallback = 0) {
1829
1831
  if (typeof value !== "number" || Number.isNaN(value)) return fallback;
1830
1832
  return value;
@@ -1858,7 +1860,7 @@ function normalizeFuzzyCoordinate(value) {
1858
1860
  return Number(value.toFixed(2));
1859
1861
  }
1860
1862
  function readPresetFuzzyLocation() {
1861
- const preset = globalThis.__weappViteWebFuzzyLocation;
1863
+ const preset = globalThis[WEAPP_VITE_WEB_FUZZY_LOCATION_KEY];
1862
1864
  if (!preset || typeof preset !== "object") return null;
1863
1865
  const value = preset;
1864
1866
  const latitude = Number(value.latitude);
@@ -1871,7 +1873,7 @@ function readPresetFuzzyLocation() {
1871
1873
  };
1872
1874
  }
1873
1875
  function readPresetChooseLocation() {
1874
- const preset = globalThis.__weappViteWebChooseLocation;
1876
+ const preset = globalThis[WEAPP_VITE_WEB_CHOOSE_LOCATION_KEY];
1875
1877
  if (!preset || typeof preset !== "object") return null;
1876
1878
  const value = preset;
1877
1879
  const latitude = Number(value.latitude);
@@ -1885,7 +1887,7 @@ function readPresetChooseLocation() {
1885
1887
  };
1886
1888
  }
1887
1889
  function readPresetChooseAddress() {
1888
- const preset = globalThis.__weappViteWebChooseAddress;
1890
+ const preset = globalThis[WEAPP_VITE_WEB_CHOOSE_ADDRESS_KEY];
1889
1891
  if (!preset || typeof preset !== "object") return null;
1890
1892
  const value = preset;
1891
1893
  return {
@@ -1900,7 +1902,7 @@ function readPresetChooseAddress() {
1900
1902
  };
1901
1903
  }
1902
1904
  function parseChooseAddressPromptInput(input) {
1903
- const [provinceName = "", cityName = "", countyName = "", detailInfo = "", userName = "", telNumber = ""] = String(input).split(/[,,]/).map((item) => item.trim());
1905
+ const [provinceName = "", cityName = "", countyName = "", detailInfo = "", userName = "", telNumber = ""] = String(input).split(ADDRESS_PROMPT_SPLIT_RE).map((item) => item.trim());
1904
1906
  if (!provinceName || !cityName || !countyName || !detailInfo) return null;
1905
1907
  return {
1906
1908
  userName,
@@ -1946,7 +1948,7 @@ function normalizePreviewMediaSources(sources) {
1946
1948
  }).filter((item) => Boolean(item));
1947
1949
  }
1948
1950
  function readOpenVideoEditorPreset(src) {
1949
- const preset = globalThis.__weappViteWebOpenVideoEditor;
1951
+ const preset = globalThis[WEAPP_VITE_WEB_OPEN_VIDEO_EDITOR_KEY];
1950
1952
  if (typeof preset === "function") {
1951
1953
  const value = preset(src);
1952
1954
  return typeof value === "string" && value.trim() ? value.trim() : "";
@@ -2068,7 +2070,7 @@ function setLoadingVisible(loading, visible, title, mask) {
2068
2070
  ].join(";"));
2069
2071
  }
2070
2072
  function resolveActionSheetSelection(itemList) {
2071
- const preset = globalThis.__weappViteWebActionSheetSelectIndex;
2073
+ const preset = globalThis[WEAPP_VITE_WEB_ACTION_SHEET_SELECT_INDEX_KEY];
2072
2074
  if (typeof preset === "function") {
2073
2075
  const result = preset(itemList);
2074
2076
  if (Number.isInteger(result) && result >= 0 && result < itemList.length) return result;
@@ -2590,7 +2592,7 @@ function normalizeSubscribeTemplateIds(value) {
2590
2592
  return value.filter((item) => typeof item === "string").map((item) => item.trim()).filter(Boolean);
2591
2593
  }
2592
2594
  function resolveSubscribeDecisionMap(tmplIds) {
2593
- const preset = globalThis.__weappViteWebRequestSubscribeMessage;
2595
+ const preset = globalThis[WEAPP_VITE_WEB_REQUEST_SUBSCRIBE_MESSAGE_KEY];
2594
2596
  const presetValue = typeof preset === "function" ? preset(tmplIds) : preset;
2595
2597
  if (presetValue && typeof presetValue === "object") {
2596
2598
  const output = {};
@@ -3294,7 +3296,7 @@ function normalizeUpdateManagerPreset(value) {
3294
3296
  };
3295
3297
  }
3296
3298
  function resolveUpdateManagerPreset() {
3297
- const preset = globalThis.__weappViteWebUpdateManager;
3299
+ const preset = globalThis[WEAPP_VITE_WEB_UPDATE_MANAGER_KEY];
3298
3300
  if (typeof preset === "function") return normalizeUpdateManagerPreset(preset());
3299
3301
  return normalizeUpdateManagerPreset(preset);
3300
3302
  }
@@ -3302,7 +3304,7 @@ function readRuntimeConsole() {
3302
3304
  return globalThis.console;
3303
3305
  }
3304
3306
  function readExtConfigValue() {
3305
- const value = globalThis.__weappViteWebExtConfig;
3307
+ const value = globalThis[WEAPP_VITE_WEB_EXT_CONFIG_KEY];
3306
3308
  if (value && typeof value === "object") return { ...value };
3307
3309
  return {};
3308
3310
  }
@@ -3351,8 +3353,8 @@ function createLogManagerBridge(level, runtimeConsole) {
3351
3353
  }
3352
3354
  function reportAnalyticsEvent(eventName, data) {
3353
3355
  const runtimeGlobal = globalThis;
3354
- runtimeGlobal.__weappViteWebAnalyticsEvents ??= [];
3355
- runtimeGlobal.__weappViteWebAnalyticsEvents.push({
3356
+ runtimeGlobal[WEAPP_VITE_WEB_ANALYTICS_EVENTS_KEY] ??= [];
3357
+ runtimeGlobal[WEAPP_VITE_WEB_ANALYTICS_EVENTS_KEY].push({
3356
3358
  eventName: String(eventName ?? ""),
3357
3359
  data: { ...data ?? {} },
3358
3360
  timestamp: Date.now()
@@ -4741,7 +4743,7 @@ async function uploadFile(options) {
4741
4743
  //#endregion
4742
4744
  //#region src/runtime/polyfill/interaction.ts
4743
4745
  function resolveScanCodeResult(prompt) {
4744
- let rawResult = globalThis.__weappViteWebScanCodeResult;
4746
+ let rawResult = globalThis[WEAPP_VITE_WEB_SCAN_CODE_RESULT_KEY];
4745
4747
  if (rawResult == null && typeof prompt === "function") rawResult = prompt("请输入二维码/条码内容", "");
4746
4748
  if (rawResult == null) return null;
4747
4749
  if (typeof rawResult === "string") return rawResult;
@@ -4916,7 +4918,7 @@ function normalizeVideoInfoPreset(value, src) {
4916
4918
  };
4917
4919
  }
4918
4920
  function readPresetVideoInfo(src) {
4919
- const preset = globalThis.__weappViteWebVideoInfo;
4921
+ const preset = globalThis[WEAPP_VITE_WEB_VIDEO_INFO_KEY];
4920
4922
  if (typeof preset === "function") return normalizeVideoInfoPreset(preset(src), src);
4921
4923
  if (preset && typeof preset === "object") {
4922
4924
  const sourcePreset = preset[src];
@@ -4939,7 +4941,7 @@ function normalizeCompressVideoResult(value, src) {
4939
4941
  };
4940
4942
  }
4941
4943
  function readPresetCompressVideo(src) {
4942
- const preset = globalThis.__weappViteWebCompressVideo;
4944
+ const preset = globalThis[WEAPP_VITE_WEB_COMPRESS_VIDEO_KEY];
4943
4945
  if (typeof preset === "function") return normalizeCompressVideoResult(preset(src), src);
4944
4946
  if (preset && typeof preset === "object") {
4945
4947
  const sourcePreset = preset[src];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-vite/web",
3
3
  "type": "module",
4
- "version": "1.3.13",
4
+ "version": "1.3.15",
5
5
  "description": "Experimental web runtime for weapp-vite templates",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -56,6 +56,7 @@
56
56
  "lit": "^3.3.1",
57
57
  "magic-string": "^0.30.21",
58
58
  "pathe": "^2.0.3",
59
+ "@weapp-core/constants": "^0.1.1",
59
60
  "@weapp-core/shared": "^3.0.3",
60
61
  "rolldown-require": "2.0.13"
61
62
  },