diff --git a/cloudfunctions/getServerDataDemo/package.json b/cloudfunctions/getServerDataDemo/package.json index d282a69e..d6aeb330 100644 --- a/cloudfunctions/getServerDataDemo/package.json +++ b/cloudfunctions/getServerDataDemo/package.json @@ -11,4 +11,4 @@ "dependencies": { "wx-server-sdk": "latest" } -} \ No newline at end of file +} diff --git a/cloudfunctions/getTempFileURL/package.json b/cloudfunctions/getTempFileURL/package.json index 873cd0a4..a22375aa 100644 --- a/cloudfunctions/getTempFileURL/package.json +++ b/cloudfunctions/getTempFileURL/package.json @@ -11,4 +11,4 @@ "dependencies": { "wx-server-sdk": "latest" } -} \ No newline at end of file +} diff --git a/cloudfunctions/wxContext/package.json b/cloudfunctions/wxContext/package.json index dc469ea0..c53d307f 100644 --- a/cloudfunctions/wxContext/package.json +++ b/cloudfunctions/wxContext/package.json @@ -11,4 +11,4 @@ "dependencies": { "wx-server-sdk": "latest" } -} \ No newline at end of file +} diff --git a/miniprogram/app-darkmode.json b/miniprogram/app-darkmode.json new file mode 100644 index 00000000..c7fc7815 --- /dev/null +++ b/miniprogram/app-darkmode.json @@ -0,0 +1,39 @@ +{ + "window": { + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#191919", + "backgroundColor": "#191919" + }, + "tabBar": { + "color": "#FCFCFC", + "selectedColor": "#51A937", + "borderStyle": "white", + "backgroundColor": "#191919", + "list": [ + { + "pagePath": "page/component/index", + "iconPath": "image/icon_component_HL.png", + "selectedIconPath": "image/icon_component_dark.png", + "text": "组件" + }, + { + "pagePath": "page/weui/example/index", + "iconPath": "image/icon_component_HL.png", + "selectedIconPath": "image/icon_component_dark.png", + "text": "扩展能力" + }, + { + "pagePath": "page/API/index", + "iconPath": "image/icon_API_HL.png", + "selectedIconPath": "image/icon_API_dark.png", + "text": "接口" + }, + { + "pagePath": "page/cloud/index", + "iconPath": "image/icon_cloud_HL.png", + "selectedIconPath": "image/icon_cloud_dark.png", + "text": "云开发" + } + ] + } +} \ No newline at end of file diff --git a/miniprogram/app.js b/miniprogram/app.js index 5d761e83..d3963b2b 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -1,9 +1,41 @@ const config = require('./config') - +const themeListeners = [] global.isDemo = true App({ - onLaunch(opts) { + + onLaunch(opts, data) { + const that = this; + const canIUseSetBackgroundFetchToken = wx.canIUse('setBackgroundFetchToken') + if (canIUseSetBackgroundFetchToken) { + wx.setBackgroundFetchToken({ + token: 'getBackgroundFetchToken', + }) + } + if (wx.getBackgroundFetchData) { + wx.getBackgroundFetchData({ + fetchType: 'pre', + success(res) { + that.globalData.backgroundFetchData = res; + console.log('读取预拉取数据成功') + }, + fail() { + console.log('读取预拉取数据失败') + wx.showToast({ + title: '无缓存数据', + icon: 'none' + }) + }, + complete() { + console.log('结束读取') + } + }) + } console.log('App Launch', opts) + if (data && data.path) { + wx.navigateTo({ + url: data.path, + }) + } if (!wx.cloud) { console.error('请使用 2.2.3 或以上的基础库以使用云能力') } else { @@ -13,15 +45,36 @@ App({ }) } }, + + onShow(opts) { console.log('App Show', opts) }, onHide() { console.log('App Hide') }, + onThemeChange({ theme }) { + this.globalData.theme = theme + themeListeners.forEach((listener) => { + listener(theme) + }) + }, + watchThemeChange(listener) { + if (themeListeners.indexOf(listener) < 0) { + themeListeners.push(listener) + } + }, + unWatchThemeChange(listener) { + const index = themeListeners.indexOf(listener) + if (index > -1) { + themeListeners.splice(index, 1) + } + }, globalData: { + theme: wx.getSystemInfoSync().theme, hasLogin: false, - openid: null + openid: null, + iconTabbar: '/page/weui/example/images/icon_tabbar.png', }, // lazy loading openid getUserOpenId(callback) { @@ -32,17 +85,17 @@ App({ } else { wx.login({ success(data) { - wx.request({ - url: config.openIdUrl, + wx.cloud.callFunction({ + name: 'login', data: { - code: data.code + action: 'openid' }, - success(res) { + success: res => { console.log('拉取openid成功', res) - self.globalData.openid = res.data.openid + self.globalData.openid = res.result.openid callback(null, self.globalData.openid) }, - fail(res) { + fail: err => { console.log('拉取用户openid失败,将无法正常使用开放接口等服务', res) callback(res) } diff --git a/miniprogram/app.json b/miniprogram/app.json index b423578e..a98b7be4 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -21,7 +21,6 @@ "page/component/pages/navigator/navigate", "page/component/pages/navigator/redirect", "page/component/pages/image/image", - "page/component/pages/audio/audio", "page/component/pages/video/video", "page/component/pages/map/map", "page/component/pages/canvas/canvas", @@ -29,84 +28,18 @@ "page/component/pages/movable-view/movable-view", "page/component/pages/cover-view/cover-view", "page/component/pages/rich-text/rich-text", - "page/API/index", - "page/API/pages/login/login", - "page/API/pages/get-user-info/get-user-info", - "page/API/pages/request-payment/request-payment", - "page/API/pages/share/share", - "page/API/pages/share-button/share-button", - "page/API/pages/custom-message/custom-message", - "page/API/pages/template-message/template-message", - "page/API/pages/set-navigation-bar-title/set-navigation-bar-title", - "page/API/pages/navigation-bar-loading/navigation-bar-loading", - "page/API/pages/navigator/navigator", - "page/API/pages/pull-down-refresh/pull-down-refresh", - "page/API/pages/animation/animation", - "page/API/pages/action-sheet/action-sheet", - "page/API/pages/modal/modal", - "page/API/pages/toast/toast", - "page/API/pages/get-network-type/get-network-type", - "page/API/pages/on-network-status-change/on-network-status-change", - "page/API/pages/get-system-info/get-system-info", - "page/API/pages/on-compass-change/on-compass-change", - "page/API/pages/make-phone-call/make-phone-call", - "page/API/pages/scan-code/scan-code", - "page/API/pages/request/request", - "page/API/pages/web-socket/web-socket", - "page/API/pages/upload-file/upload-file", - "page/API/pages/download-file/download-file", - "page/API/pages/image/image", - "page/API/pages/voice/voice", - "page/API/pages/file/file", - "page/API/pages/on-accelerometer-change/on-accelerometer-change", - "page/API/pages/canvas/canvas", - "page/API/pages/background-audio/background-audio", - "page/API/pages/video/video", - "page/API/pages/get-location/get-location", - "page/API/pages/open-location/open-location", - "page/API/pages/choose-location/choose-location", - "page/API/pages/storage/storage", "page/component/pages/picker-view/picker-view", "page/component/pages/camera/camera", "page/component/pages/camera-scan-code/camera-scan-code", - "page/API/pages/get-wxml-node-info/get-wxml-node-info", - "page/component/pages/open-data/open-data", - "page/component/pages/web-view/web-view", - "page/API/pages/load-font-face/load-font-face", - "page/API/pages/clipboard-data/clipboard-data", - "page/API/pages/bluetooth/bluetooth", - "page/API/pages/screen-brightness/screen-brightness", - "page/API/pages/vibrate/vibrate", - "page/API/pages/add-contact/add-contact", - "page/API/pages/wifi/wifi", - "page/API/pages/page-scroll/page-scroll", - "page/API/pages/intersection-observer/intersection-observer", - "page/API/pages/capture-screen/capture-screen", - "page/API/pages/worker/worker", - "page/API/pages/ibeacon/ibeacon", - "page/API/pages/choose-address/choose-address", - "page/API/pages/setting/setting", - "page/API/pages/choose-invoice-title/choose-invoice-title", - "page/API/pages/soter-authentication/soter-authentication", "page/component/pages/map-styles/map-styles", + "page/component/pages/live-player/live-player", + "page/component/pages/live-pusher/live-pusher", + "page/component/pages/aria-component/aria-component", + "page/API/index", "page/cloud/index", - "page/cloud/pages/user-authentication/user-authentication", - "page/cloud/pages/get-wx-context/get-wx-context", - "page/cloud/pages/upload-file/upload-file", - "page/cloud/pages/download-file/download-file", - "page/cloud/pages/get-temp-file-url/get-temp-file-url", - "page/cloud/pages/delete-file/delete-file", - "page/cloud/pages/cloud-file-component/cloud-file-component", - "page/cloud/pages/crud/crud", - "page/cloud/pages/crud-detail/crud-detail", - "page/cloud/pages/db-permission/db-permission", - "page/cloud/pages/server-date/server-date", - "page/cloud/pages/scf-database/scf-database", - "page/cloud/pages/scf-storage/scf-storage", - "page/cloud/pages/scf-openapi/scf-openapi", "page/component/pages/doc-web-view/doc-web-view", - "page/API/pages/doc-web-view/doc-web-view", - "page/cloud/pages/doc-web-view/doc-web-view", + "page/component/pages/open-data/open-data", + "page/component/pages/web-view/web-view", "page/component/pages/editor/editor", "page/weui/example/index", "page/weui/example/cell/cell", @@ -135,42 +68,158 @@ "page/weui/example/icons/icons", "page/weui/example/form-page/form-page", "page/weui/example/half-screen-dialog/half-screen-dialog", - "page/weui/example/actionsheet/actionsheet" + "page/weui/example/actionsheet/actionsheet", + "page/weui/example/toptips/toptips", + "page/weui/example/searchbar/searchbar", + "page/weui/example/emoji/emoji", + "page/weui/example/video-swiper/video-swiper", + "page/weui/example/index-list/index-list", + "page/weui/example/recycle-view/recycle-view", + "page/weui/example/sticky/sticky", + "page/weui/example/tabs/tabs", + "page/weui/example/vtabs/vtabs", + "page/weui/example/select-text/select-text", + "page/weui/example/barrage/barrage", + "page/weui/example/wxml-to-canvas/wxml-to-canvas" + ], + "subpackages": [ + { + "root": "packageAPI", + "pages": [ + "pages/login/login", + "pages/get-user-info/get-user-info", + "pages/request-payment/request-payment", + "pages/share/share", + "pages/share-button/share-button", + "pages/custom-message/custom-message", + "pages/template-message/template-message", + "pages/set-navigation-bar-title/set-navigation-bar-title", + "pages/navigation-bar-loading/navigation-bar-loading", + "pages/navigator/navigator", + "pages/pull-down-refresh/pull-down-refresh", + "pages/animation/animation", + "pages/action-sheet/action-sheet", + "pages/modal/modal", + "pages/toast/toast", + "pages/get-network-type/get-network-type", + "pages/on-network-status-change/on-network-status-change", + "pages/get-system-info/get-system-info", + "pages/on-compass-change/on-compass-change", + "pages/make-phone-call/make-phone-call", + "pages/scan-code/scan-code", + "pages/request/request", + "pages/web-socket/web-socket", + "pages/upload-file/upload-file", + "pages/download-file/download-file", + "pages/image/image", + "pages/voice/voice", + "pages/file/file", + "pages/on-accelerometer-change/on-accelerometer-change", + "pages/canvas/canvas", + "pages/background-audio/background-audio", + "pages/video/video", + "pages/get-location/get-location", + "pages/open-location/open-location", + "pages/choose-location/choose-location", + "pages/storage/storage", + "pages/get-wxml-node-info/get-wxml-node-info", + "pages/load-font-face/load-font-face", + "pages/clipboard-data/clipboard-data", + "pages/bluetooth/bluetooth", + "pages/screen-brightness/screen-brightness", + "pages/vibrate/vibrate", + "pages/add-contact/add-contact", + "pages/wifi/wifi", + "pages/page-scroll/page-scroll", + "pages/intersection-observer/intersection-observer", + "pages/capture-screen/capture-screen", + "pages/worker/worker", + "pages/ibeacon/ibeacon", + "pages/choose-address/choose-address", + "pages/setting/setting", + "pages/choose-invoice-title/choose-invoice-title", + "pages/soter-authentication/soter-authentication", + "pages/subscribe-message/subscribe-message", + "pages/doc-web-view/doc-web-view", + "pages/audio/audio", + "pages/get-battery-info/get-battery-info", + "pages/get-performance/get-performance", + "pages/mdns/mdns", + "pages/udp-socket/udp-socket", + "pages/two-way-bindings/two-way-bindings", + "pages/media-container/media-container", + "pages/get-background-fetch-data/get-background-fetch-data", + "pages/get-background-prefetch-data/get-background-prefetch-data", + "pages/wxs/wxs", + "pages/bluetooth/slave/slave", + "pages/resizable/resizable", + "pages/wxs/movable", + "pages/wxs/sidebar", + "pages/wxs/stick-top", + "pages/wxs/nearby" + ] + }, + { + "root": "packageCloud", + "pages": [ + "pages/doc-web-view/doc-web-view", + "pages/user-authentication/user-authentication", + "pages/get-wx-context/get-wx-context", + "pages/upload-file/upload-file", + "pages/download-file/download-file", + "pages/get-temp-file-url/get-temp-file-url", + "pages/delete-file/delete-file", + "pages/cloud-file-component/cloud-file-component", + "pages/crud/crud", + "pages/crud-detail/crud-detail", + "pages/db-permission/db-permission", + "pages/server-date/server-date", + "pages/scf-database/scf-database", + "pages/scf-storage/scf-storage", + "pages/scf-openapi/scf-openapi" + ] + } ], + "preloadRule": { + "page/component/index": { + "network": "all", + "packages": ["packageAPI", "packageCloud"] + } + }, "window": { - "navigationBarTextStyle": "black", + "navigationBarTextStyle": "@navigationBarTextStyle", "navigationBarTitleText": "演示", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" + "navigationBarBackgroundColor": "@navigationBarBackgroundColor", + "backgroundColor": "@backgroundColor" }, "tabBar": { - "color": "#7A7E83", - "selectedColor": "#3cc51f", - "borderStyle": "black", - "backgroundColor": "#ffffff", + "color": "@tabBarColor", + "selectedColor": "@tabBarSelectedColor", + "borderStyle": "@tabBarBorderStyle", + "backgroundColor": "@tabBarBackgroundColor", "list": [ { "pagePath": "page/component/index", - "iconPath": "image/icon_component.png", - "selectedIconPath": "image/icon_component_HL.png", + "iconPath": "@iconPathComponent", + "selectedIconPath": "@selectedIconPathComponent", "text": "组件" }, { "pagePath": "page/weui/example/index", - "iconPath": "image/icon_component.png", - "selectedIconPath": "image/icon_component_HL.png", - "text": "扩展组件" + "iconPath": "@iconPathComponent", + "selectedIconPath": "@selectedIconPathComponent", + "text": "扩展能力" }, { "pagePath": "page/API/index", - "iconPath": "image/icon_API.png", - "selectedIconPath": "image/icon_API_HL.png", + "iconPath": "@iconPathAPI", + "selectedIconPath": "@selectedIconPathAPI", "text": "接口" }, { "pagePath": "page/cloud/index", - "iconPath": "image/icon_cloud.png", - "selectedIconPath": "image/icon_cloud_HL.png", + "iconPath": "@iconPathCloud", + "selectedIconPath": "@selectedIconPathCloud", "text": "云开发" } ] @@ -193,5 +242,7 @@ } }, "cloud": true, - "sitemapLocation": "sitemap.json" + "sitemapLocation": "sitemap.json", + "themeLocation": "demo.theme.json", + "darkmode": true } \ No newline at end of file diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index f6ae693b..6d4f5cbe 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -1,9 +1,13 @@ +@import "./page/common/lib/weui.wxss"; + + /* reset */ page { - background-color: #F8F8F8; + background-color: var(--weui-BG-1); height: 100%; font-size: 32rpx; line-height: 1.6; + color: var(--weui-FG-0); } checkbox, radio{ margin-right: 10rpx; @@ -40,21 +44,20 @@ input { padding: 60rpx 50rpx 80rpx; text-align: center; } -.page-head-title{ +.page-head-title { display: inline-block; padding: 0 40rpx 20rpx 40rpx; font-size: 32rpx; - color: #BEBEBE; } .page-head-line{ margin: 0 auto; width: 150rpx; height: 2rpx; - background-color: #D8D8D8; + background-color: var(--weui-FG-1); } .page-head-desc{ padding-top: 20rpx; - color: #9B9B9B; + color: var(--weui-FG-1); font-size: 32rpx; } @@ -77,7 +80,7 @@ input { display: flex; flex-direction: column; align-items: center; - background-color: #fff; + background-color: var(--weui-BG-2); width: 100%; padding: 50rpx 0 150rpx 0; } @@ -88,16 +91,19 @@ input { .page-body-text { font-size: 30rpx; line-height: 26px; - color: #ccc; + color: var(--weui-FG-2); } .page-body-text-small { font-size: 24rpx; - color: #000; + color: var(--weui-FG-0); margin-bottom: 100rpx; } .page-foot{ - margin: 100rpx 0 30rpx 0; + margin: 100rpx 0 0 0; + margin-bottom: constant(safe-area-inset-bottom); + margin-bottom: env(safe-area-inset-bottom); + padding-bottom: 30rpx; text-align: center; color: #1aad19; font-size: 0; @@ -129,7 +135,7 @@ input { } .page-section-title{ font-size: 28rpx; - color: #999999; + color: var(--weui-FG-1); margin-bottom: 10rpx; padding-left: 30rpx; padding-right: 30rpx; @@ -153,21 +159,21 @@ input { .image-plus { width: 150rpx; height: 150rpx; - border: 2rpx solid #D9D9D9; + border: 2rpx solid var(--weui-FG-1); position: relative; } .image-plus-nb{ border: 0; } .image-plus-text{ - color: #888888; + color: var(--weui-FG-2); font-size: 28rpx; } .image-plus-horizontal { position: absolute; top: 50%; left: 50%; - background-color: #d9d9d9; + background-color: var(--weui-FG-1); width: 4rpx; height: 80rpx; transform: translate(-50%, -50%); @@ -176,7 +182,7 @@ input { position: absolute; top: 50%; left: 50%; - background-color: #d9d9d9; + background-color: var(--weui-FG-1); width: 80rpx; height: 4rpx; transform: translate(-50%, -50%); diff --git a/miniprogram/common/foot.wxml b/miniprogram/common/foot.wxml new file mode 100644 index 00000000..2375957b --- /dev/null +++ b/miniprogram/common/foot.wxml @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/miniprogram/common/head.wxml b/miniprogram/common/head.wxml new file mode 100644 index 00000000..73b26e6f --- /dev/null +++ b/miniprogram/common/head.wxml @@ -0,0 +1,7 @@ + diff --git a/miniprogram/common/index.wxss b/miniprogram/common/index.wxss new file mode 100644 index 00000000..6f840547 --- /dev/null +++ b/miniprogram/common/index.wxss @@ -0,0 +1,111 @@ +.index-hd { + padding: 80rpx; + text-align: center; +} +.index-bd { + padding: 0 30rpx 40rpx; +} +.index-ft { + padding-bottom: 20rpx; + text-align: center; +} +.index-logo { + width: 86rpx; + height: 86rpx; +} +.index-desc { + margin-top: 20rpx; + color: #888888; + font-size: 28rpx; +} + + +.navigator-box { + opacity: 0; + position: relative; + background-color: #FFFFFF; + line-height: 1.41176471; + font-size: 34rpx; + + transform: translateY(-50%); + transition: .3s; +} +.navigator-box-show { + opacity: 1; + transform: translateY(0); +} +.navigator { + padding: 20rpx 30rpx; + position: relative; + display: flex; + align-items: center; +} +.navigator:before { + content: " "; + position: absolute; + left: 30rpx; + top: 0; + right: 30rpx; + height: 1px; + border-top: 1rpx solid #D8D8D8; + color: #D8D8D8; +} +.navigator:first-child:before { + display: none; +} +.navigator-text { + flex: 1; +} +.navigator-arrow { + padding-right: 26rpx; + position: relative; +} +.navigator-arrow:after { + content: " "; + display: inline-block; + height: 18rpx; + width: 18rpx; + border-width: 2rpx 2rpx 0 0; + border-color: #888888; + border-style: solid; + transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); + position: absolute; + top: 50%; + margin-top: -8rpx; + right: 28rpx; +} + + +.kind-list-item { + margin: 20rpx 0; + background-color: #FFFFFF; + border-radius: 4rpx; + overflow: hidden; +} +.kind-list-item:first-child { + margin-top: 0; +} +.kind-list-text{ + flex: 1; +} +.kind-list-img { + width: 60rpx; + height: 60rpx; +} +.kind-list-item-hd { + padding: 30rpx; + display: flex; + align-items: center; + + transition: opacity .3s; +} +.kind-list-item-hd-show { + opacity: .2; +} +.kind-list-item-bd { + height: 0; + overflow: hidden; +} +.kind-list-item-bd-show { + height: auto; +} \ No newline at end of file diff --git a/miniprogram/common/lib/weui.wxss b/miniprogram/common/lib/weui.wxss new file mode 100644 index 00000000..e732bb4a --- /dev/null +++ b/miniprogram/common/lib/weui.wxss @@ -0,0 +1,4393 @@ +/*! + * WeUI v2.3.0 (https://github.com/weui/weui-wxss) + * Copyright 2020 Tencent, Inc. + * Licensed under the MIT license + */ +[data-weui-theme=light], +page { + --weui-BTN-DISABLED-FONT-COLOR: rgba(0, 0, 0, .2) +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-BTN-DISABLED-FONT-COLOR: hsla(0, 0%, 100%, .2) + } +} + +[data-weui-theme=light], +page { + --weui-BTN-DEFAULT-BG: #f2f2f2 +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-BTN-DEFAULT-BG: hsla(0, 0%, 100%, .08) + } +} + +[data-weui-theme=light], +page { + --weui-BTN-DEFAULT-COLOR: #06ae56 +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-BTN-DEFAULT-COLOR: hsla(0, 0%, 100%, .8) + } +} + +[data-weui-theme=light], +page { + --weui-BTN-DEFAULT-ACTIVE-BG: #e6e6e6 +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-BTN-DEFAULT-ACTIVE-BG: hsla(0, 0%, 100%, .126) + } +} + +[data-weui-theme=light], +page { + --weui-DIALOG-LINE-COLOR: rgba(0, 0, 0, .1) +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-DIALOG-LINE-COLOR: hsla(0, 0%, 100%, .1) + } +} + +page { + line-height: 1.6; + font-family: -apple-system-font, Helvetica Neue, sans-serif +} + +icon { + vertical-align: middle +} + +[data-weui-theme=light], +page { + --weui-BG-0: #ededed; + --weui-BG-1: #f7f7f7; + --weui-BG-2: #fff; + --weui-BG-3: #f7f7f7; + --weui-BG-4: #4c4c4c; + --weui-BG-5: #fff; + --weui-FG-0: rgba(0, 0, 0, .9); + --weui-FG-HALF: rgba(0, 0, 0, .9); + --weui-FG-1: rgba(0, 0, 0, .5); + --weui-FG-2: rgba(0, 0, 0, .3); + --weui-FG-3: rgba(0, 0, 0, .1); + --weui-RED: #fa5151; + --weui-ORANGE: #fa9d3b; + --weui-YELLOW: #ffc300; + --weui-GREEN: #91d300; + --weui-LIGHTGREEN: #95ec69; + --weui-BRAND: #07c160; + --weui-BLUE: #10aeff; + --weui-INDIGO: #1485ee; + --weui-PURPLE: #6467f0; + --weui-WHITE: #fff; + --weui-LINK: #576b95; + --weui-TEXTGREEN: #06ae56; + --weui-FG: #000; + --weui-BG: #fff; + --weui-TAG-TEXT-ORANGE: #fa9d3b; + --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, .1); + --weui-TAG-TEXT-GREEN: #06ae56; + --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, .1); + --weui-TAG-TEXT-BLUE: #10aeff; + --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, .1); + --weui-TAG-TEXT-BLACK: rgba(0, 0, 0, .5); + --weui-TAG-BACKGROUND-BLACK: rgba(0, 0, 0, .05) +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-BG-0: #191919; + --weui-BG-1: #1f1f1f; + --weui-BG-2: #232323; + --weui-BG-3: #2f2f2f; + --weui-BG-4: #606060; + --weui-BG-5: #2c2c2c; + --weui-FG-0: hsla(0, 0%, 100%, .8); + --weui-FG-HALF: hsla(0, 0%, 100%, .6); + --weui-FG-1: hsla(0, 0%, 100%, .5); + --weui-FG-2: hsla(0, 0%, 100%, .3); + --weui-FG-3: hsla(0, 0%, 100%, .05); + --weui-RED: #fa5151; + --weui-ORANGE: #c87d2f; + --weui-YELLOW: #cc9c00; + --weui-GREEN: #74a800; + --weui-LIGHTGREEN: #28b561; + --weui-BRAND: #07c160; + --weui-BLUE: #10aeff; + --weui-INDIGO: #1196ff; + --weui-PURPLE: #8183ff; + --weui-WHITE: hsla(0, 0%, 100%, .8); + --weui-LINK: #7d90a9; + --weui-TEXTGREEN: #259c5c; + --weui-FG: #fff; + --weui-BG: #000; + --weui-TAG-TEXT-ORANGE: rgba(250, 157, 59, .6); + --weui-TAG-BACKGROUND-ORANGE: rgba(250, 157, 59, .1); + --weui-TAG-TEXT-GREEN: rgba(6, 174, 86, .6); + --weui-TAG-BACKGROUND-GREEN: rgba(6, 174, 86, .1); + --weui-TAG-TEXT-BLUE: rgba(16, 174, 255, .6); + --weui-TAG-BACKGROUND-BLUE: rgba(16, 174, 255, .1); + --weui-TAG-TEXT-BLACK: hsla(0, 0%, 100%, .5); + --weui-TAG-BACKGROUND-BLACK: hsla(0, 0%, 100%, .05) + } +} + +[data-weui-theme=light], +page { + --weui-BG-COLOR-ACTIVE: #ececec +} + +@media(prefers-color-scheme: dark) { + page{ + --weui-BG-COLOR-ACTIVE: #373737 + } +} + +[class*=" weui-icon-"], +[class^=weui-icon-] { + display: inline-block; + vertical-align: middle; + width: 24px; + height: 24px; + -webkit-mask-position: 50% 50%; + mask-position: 50% 50%; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor +} + +.weui-icon-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-download { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M11.25%2012.04l-1.72-1.72-1.06%201.06%202.828%202.83a1%201%200%20001.414-.001l2.828-2.828-1.06-1.061-1.73%201.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55%200%20.999.446.999.996v13.008a.998.998%200%2001-.996.996H4.996A.998.998%200%20014%2021.004V7.996A1%201%200%20014.999%207h6.251z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-info { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.75-12v7h1.5v-7h-1.5zM12%209a1%201%200%20100-2%201%201%200%20000%202z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-safe-success { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.6C315.5%2046.7%20180.4%2093.1%2057.6%20132c0%20129.3.2%20231.7.2%20339.7%200%20304.2%20248.3%20471.6%20443.1%20523.7C695.7%20943.3%20944%20775.9%20944%20471.7c0-108%20.2-210.4.2-339.7C821.4%2093.1%20686.3%2046.7%20500.9%204.6zm248.3%20349.1l-299.7%20295c-2.1%202-5.3%202-7.4-.1L304.4%20506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3%205-2.8%207.2-1l112.2%2086c2.3%201.8%206%201.7%208.1-.1l274.7-228.9c2.2-1.8%205.7-1.7%207.7.3l17%2016.8c2.2%202.1%202.2%205.3.2%207.4z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23070202%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-safe-warn { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201000%201000%22%3E%3Cpath%20d%3D%22M500.9%204.5c-185.4%2042-320.4%2088.4-443.2%20127.3%200%20129.3.2%20231.7.2%20339.6%200%20304.1%20248.2%20471.4%20443%20523.6%20194.7-52.2%20443-219.5%20443-523.6%200-107.9.2-210.3.2-339.6C821.3%2092.9%20686.2%2046.5%20500.9%204.5zm-26.1%20271.1h52.1c5.8%200%2010.3%204.7%2010.1%2010.4l-11.6%20313.8c-.1%202.8-2.5%205.2-5.4%205.2h-38.2c-2.9%200-5.3-2.3-5.4-5.2L464.8%20286c-.2-5.8%204.3-10.4%2010-10.4zm26.1%20448.3c-20.2%200-36.5-16.3-36.5-36.5s16.3-36.5%2036.5-36.5%2036.5%2016.3%2036.5%2036.5-16.4%2036.5-36.5%2036.5z%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23020202%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-success { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-success-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm-1.172-6.242l5.809-5.808.848.849-5.95%205.95a1%201%200%2001-1.414%200L7%2012.426l.849-.849%202.98%202.98z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-success-no-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-waiting { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.75%2011.38V6h-1.5v6l4.243%204.243%201.06-1.06-3.803-3.804zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-waiting-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.6%2011.503l3.891%203.891-.848.849L11.4%2012V6h1.2v5.503zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-warn { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-info-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zM11.4%2010h1.2v7h-1.2v-7zm.6-1a1%201%200%20110-2%201%201%200%20010%202z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-cancel { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22M12.849%2012l3.11%203.111-.848.849L12%2012.849l-3.111%203.11-.849-.848L11.151%2012l-3.11-3.111.848-.849L12%2011.151l3.111-3.11.849.848L12.849%2012z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E) +} + +.weui-icon-search { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16.31%2015.561l4.114%204.115-.848.848-4.123-4.123a7%207%200%2011.857-.84zM16.8%2011a5.8%205.8%200%2010-11.6%200%205.8%205.8%200%200011.6%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-clear { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.06%2012l3.006-3.005-1.06-1.06L12%2010.938%208.995%207.934l-1.06%201.06L10.938%2012l-3.005%203.005%201.06%201.06L12%2013.062l3.005%203.005%201.06-1.06L13.062%2012zM12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-back { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm1.999-6.563L10.68%2012%2014%208.562%2012.953%207.5%209.29%2011.277a1.045%201.045%200%20000%201.446l3.663%203.777L14%2015.437z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-delete { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.774%206.4l.812%2013.648a.8.8%200%2000.798.752h7.232a.8.8%200%2000.798-.752L17.226%206.4H6.774zm11.655%200l-.817%2013.719A2%202%200%200115.616%2022H8.384a2%202%200%2001-1.996-1.881L5.571%206.4H3.5v-.7a.5.5%200%2001.5-.5h16a.5.5%200%2001.5.5v.7h-2.071zM14%203a.5.5%200%2001.5.5v.7h-5v-.7A.5.5%200%200110%203h4zM9.5%209h1.2l.5%209H10l-.5-9zm3.8%200h1.2l-.5%209h-1.2l.5-9z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-success-no-circle-thin { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.864%2016.617l-5.303-5.303-1.061%201.06%205.657%205.657a1%201%200%20001.414%200L21.238%206.364l-1.06-1.06L8.864%2016.616z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-arrow { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-arrow-bold { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2212%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.157%2012.711L4.5%2018.368l-1.414-1.414%204.95-4.95-4.95-4.95L4.5%205.64l5.657%205.657a1%201%200%20010%201.414z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-back-arrow { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.343%2012l7.071%207.071L9%2020.485l-7.778-7.778a1%201%200%20010-1.414L9%203.515l1.414%201.414L3.344%2012z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-back-arrow-thin { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-close { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.586l5.657-5.657%201.414%201.414L13.414%2012l5.657%205.657-1.414%201.414L12%2013.414l-5.657%205.657-1.414-1.414L10.586%2012%204.929%206.343%206.343%204.93%2012%2010.586z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-close-thin { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-back-circle { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm0-1.2a8.8%208.8%200%20100-17.6%208.8%208.8%200%20000%2017.6zm1.999-5.363L12.953%2016.5%209.29%2012.723a1.045%201.045%200%20010-1.446L12.953%207.5%2014%208.563%2010.68%2012%2014%2015.438z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-icon-success { + color: var(--weui-BRAND) +} + +.weui-icon-waiting { + color: var(--weui-BLUE) +} + +.weui-icon-warn { + color: var(--weui-RED) +} + +.weui-icon-info { + color: var(--weui-BLUE) +} + +.weui-icon-success-circle, +.weui-icon-success-no-circle, +.weui-icon-success-no-circle-thin { + color: var(--weui-BRAND) +} + +.weui-icon-waiting-circle { + color: var(--weui-BLUE) +} + +.weui-icon-circle { + color: var(--weui-FG-2) +} + +.weui-icon-download { + color: var(--weui-BRAND) +} + +.weui-icon-info-circle { + color: var(--weui-FG-2) +} + +.weui-icon-safe-success { + color: var(--weui-BRAND) +} + +.weui-icon-safe-warn { + color: var(--weui-YELLOW) +} + +.weui-icon-cancel { + color: var(--weui-RED) +} + +.weui-icon-search { + color: var(--weui-FG-1) +} + +.weui-icon-clear { + color: var(--weui-FG-2) +} + +.weui-icon-clear:active { + color: var(--weui-FG-1) +} + +.weui-icon-delete.weui-icon_gallery-delete { + color: var(--weui-WHITE) +} + +.weui-icon-arrow, +.weui-icon-arrow-bold, +.weui-icon-back-arrow, +.weui-icon-back-arrow-thin { + width: 12px +} + +.weui-icon-arrow, +.weui-icon-arrow-bold { + color: var(--weui-FG-2) +} + +.weui-icon-back, +.weui-icon-back-arrow, +.weui-icon-back-arrow-thin, +.weui-icon-back-circle { + color: var(--weui-FG-0) +} + +.weui-icon_msg { + width: 64px; + height: 64px +} + +.weui-icon_msg.weui-icon-warn { + color: var(--weui-RED) +} + +.weui-icon_msg-primary { + width: 64px; + height: 64px +} + +.weui-icon_msg-primary.weui-icon-warn { + color: var(--weui-YELLOW) +} + +.weui-link { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-link, +.weui-link:visited { + color: var(--weui-LINK) +} + +.weui-btn { + position: relative; + display: block; + width: 184px; + margin-left: auto; + margin-right: auto; + padding: 8px 24px; + box-sizing: border-box; + font-weight: 700; + font-size: 17px; + text-align: center; + text-decoration: none; + color: #fff; + line-height: 1.41176471; + border-radius: 4px; + overflow: hidden; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-btn_block { + width: auto +} + +.weui-btn_inline { + display: inline-block +} + +.weui-btn_default { + background-color: var(--weui-BTN-DEFAULT-BG) +} + +.weui-btn_default, +.weui-btn_default:not(.weui-btn_disabled):visited { + color: var(--weui-BTN-DEFAULT-COLOR) +} + +.weui-btn_default:not(.weui-btn_disabled):active { + background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG) +} + +.weui-btn_primary { + background-color: var(--weui-BRAND) +} + +.weui-btn_primary:not(.weui-btn_disabled):visited { + color: #fff +} + +.weui-btn_primary:not(.weui-btn_disabled):active { + background-color: var(--weui-TAG-TEXT-GREEN) +} + +.weui-btn_warn { + background-color: var(--weui-BTN-DEFAULT-BG) +} + +.weui-btn_warn, +.weui-btn_warn:not(.weui-btn_disabled):visited { + color: var(--weui-RED) +} + +.weui-btn_warn:not(.weui-btn_disabled):active { + background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG) +} + +.weui-btn_disabled { + color: var(--weui-BTN-DISABLED-FONT-COLOR); + background-color: var(--weui-BTN-DEFAULT-BG) +} + +.weui-btn_loading .weui-loading { + margin: -.2em .34em 0 0 +} + +.weui-btn_loading.weui-btn_primary { + background-color: var(--weui-TAG-TEXT-GREEN); + color: var(--weui-WHITE) +} + +.weui-btn_loading.weui-btn_default, +.weui-btn_loading.weui-btn_warn { + background-color: var(--weui-BTN-DEFAULT-ACTIVE-BG) +} + +.weui-btn_cell { + position: relative; + display: block; + margin-left: auto; + margin-right: auto; + box-sizing: border-box; + font-size: 17px; + text-align: center; + text-decoration: none; + color: #fff; + line-height: 1.41176471; + padding: 16px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + overflow: hidden; + background-color: var(--weui-BG-5) +} + +.weui-btn_cell+.weui-btn_cell { + margin-top: 16px +} + +.weui-btn_cell:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-btn_cell__icon { + display: inline-block; + vertical-align: middle; + width: 24px; + height: 24px; + margin: -.2em .34em 0 0 +} + +.weui-btn_cell-default { + color: var(--weui-FG-0) +} + +.weui-btn_cell-primary { + color: var(--weui-LINK) +} + +.weui-btn_cell-warn { + color: var(--weui-RED) +} + +button.weui-btn, +input.weui-btn { + border-width: 0; + outline: 0; + -webkit-appearance: none +} + +button.weui-btn:focus, +input.weui-btn:focus { + outline: 0 +} + +button.weui-btn_inline, +button.weui-btn_mini, +input.weui-btn_inline, +input.weui-btn_mini { + width: auto +} + +.weui-btn_mini { + display: inline-block; + width: auto; + padding: 0 .75em; + line-height: 2; + font-size: 16px +} + +.weui-btn:not(.weui-btn_mini)+.weui-btn:not(.weui-btn_mini) { + margin-top: 16px +} + +.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline { + margin-top: auto; + margin-left: 16px +} + +.weui-btn-area { + margin: 48px 16px 8px +} + +.weui-btn-area_inline { + display: -webkit-box; + display: -webkit-flex; + display: flex +} + +.weui-btn-area_inline .weui-btn { + margin-top: auto; + margin-right: 16px; + width: 100%; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-btn-area_inline .weui-btn:last-child { + margin-right: 0 +} + +.weui-btn_reset { + background: transparent; + border: 0; + padding: 0; + outline: 0 +} + +.weui-btn_icon { + font-size: 0 +} + +.weui-btn_icon:active [class*=weui-icon-] { + color: var(--weui-FG-1) +} + +.weui-cells { + margin-top: 8px; + background-color: var(--weui-BG-2); + line-height: 1.41176471; + font-size: 17px; + overflow: hidden; + position: relative +} + +.weui-cells:before { + top: 0; + border-top: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-cells:after, +.weui-cells:before { + content: " "; + position: absolute; + left: 0; + right: 0; + height: 1px; + color: var(--weui-FG-3); + z-index: 2 +} + +.weui-cells:after { + bottom: 0; + border-bottom: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-cells__title { + margin-top: 16px; + margin-bottom: 3px; + padding-left: 16px; + padding-right: 16px; + color: var(--weui-FG-1); + font-size: 14px; + line-height: 1.4 +} + +.weui-cells__title+.weui-cells { + margin-top: 0 +} + +.weui-cells__tips { + margin-top: 8px; + color: var(--weui-FG-1); + padding-left: 16px; + padding-right: 16px; + font-size: 14px; + line-height: 1.4 +} + +.weui-cells__tips a, +.weui-cells__tips navigator { + color: var(--weui-LINK) +} + +.weui-cells__tips navigator { + display: inline +} + +.weui-cell { + padding: 16px; + position: relative; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-cell:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + left: 16px; + z-index: 2 +} + +.weui-cell:first-child:before { + display: none +} + +.weui-cell_active:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-cell_primary { + -webkit-box-align: start; + -webkit-align-items: flex-start; + align-items: flex-start +} + +.weui-cell__bd { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-cell__ft { + text-align: right; + color: var(--weui-FG-1) +} + +.weui-cell_swiped { + display: block; + padding: 0 +} + +.weui-cell_swiped>.weui-cell__bd { + position: relative; + z-index: 1; + background-color: var(--weui-BG-2) +} + +.weui-cell_swiped>.weui-cell__ft { + position: absolute; + right: 0; + top: 0; + bottom: 0; + display: -webkit-box; + display: -webkit-flex; + display: flex; + color: #fff +} + +.weui-swiped-btn { + display: block; + padding: 16px 1em; + line-height: 1.41176471; + color: inherit +} + +.weui-swiped-btn_default { + background-color: var(--weui-BG-0) +} + +.weui-swiped-btn_warn { + background-color: var(--weui-RED) +} + +.weui-cell_access { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + color: inherit +} + +.weui-cell_access:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-cell_access .weui-cell__ft { + padding-right: 22px; + position: relative +} + +.weui-cell_access .weui-cell__ft:after { + content: " "; + width: 12px; + height: 24px; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + position: absolute; + top: 50%; + right: 0; + margin-top: -12px +} + +.weui-cell_link { + color: var(--weui-LINK); + font-size: 17px +} + +.weui-cell_link:first-child:before { + display: block +} + +.weui-check__label { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-check__label:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-check { + position: absolute; + left: -9999px +} + +.weui-cells_radio .weui-cell__ft { + padding-left: 16px; + font-size: 0 +} + +.weui-cells_radio .weui-check+.weui-icon-checked { + min-width: 16px; + color: transparent +} + +.weui-cells_radio .weui-check:checked+.weui-icon-checked, +.weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked { + color: var(--weui-BRAND); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-cells_checkbox .weui-check__label:before { + left: 55px +} + +.weui-cells_checkbox .weui-cell__hd { + padding-right: 16px; + font-size: 0 +} + +.weui-cells_checkbox .weui-icon-checked { + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-cells_checkbox .weui-check:checked+.weui-icon-checked, +.weui-cells_checkbox .weui-check[aria-checked=true]+.weui-icon-checked { + color: var(--weui-BRAND); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E) +} + +.weui-label { + display: block; + width: 105px; + word-wrap: break-word; + word-break: break-all +} + +.weui-input { + width: 100%; + border: 0; + outline: 0; + -webkit-appearance: none; + background-color: transparent; + font-size: inherit; + color: inherit; + height: 1.41176471em; + line-height: 1.41176471 +} + +.weui-input::-webkit-inner-spin-button, +.weui-input::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0 +} + +.weui-input:focus:not(:placeholder-shown)+.weui-btn_input-clear { + display: inline +} + +.weui-input::-webkit-input-placeholder, +.weui-input__placeholder { + color: var(--weui-FG-2) +} + +.weui-input::placeholder, +.weui-input__placeholder { + color: var(--weui-FG-2) +} + +.weui-textarea { + display: block; + border: 0; + resize: none; + background: transparent; + width: 100%; + color: inherit; + font-size: 1em; + line-height: inherit; + outline: 0 +} + +.weui-textarea-counter { + color: var(--weui-FG-2); + text-align: right; + font-size: 14px +} + +.weui-cell_warn .weui-textarea-counter { + color: var(--weui-RED) +} + +.weui-cells_form .weui-cell_disabled:active, +.weui-cells_form .weui-cell_readonly:active, +.weui-cells_form .weui-cell_switch:active, +.weui-cells_form .weui-cell_vcode:active { + background-color: transparent +} + +.weui-cells_form .weui-cell__ft { + font-size: 0 +} + +.weui-cells_form .weui-icon-warn { + display: none +} + +.weui-cells_form input, +.weui-cells_form label[for], +.weui-cells_form textarea { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-cell_warn { + color: var(--weui-RED) +} + +.weui-cell_warn .weui-icon-warn { + display: inline-block +} + +.weui-cell_disabled .weui-input:disabled, +.weui-cell_disabled .weui-textarea:disabled, +.weui-cell_readonly .weui-input:disabled, +.weui-cell_readonly .weui-textarea:disabled { + opacity: 1; + -webkit-text-fill-color: var(--weui-FG-1) +} + +.weui-cell_disabled .weui-input[disabled], +.weui-cell_disabled .weui-input[readonly], +.weui-cell_disabled .weui-textarea[disabled], +.weui-cell_disabled .weui-textarea[readonly], +.weui-cell_readonly .weui-input[disabled], +.weui-cell_readonly .weui-input[readonly], +.weui-cell_readonly .weui-textarea[disabled], +.weui-cell_readonly .weui-textarea[readonly] { + color: var(--weui-FG-1) +} + +.weui-btn_input-clear { + display: none; + padding-left: 8px +} + +.weui-btn_input-clear [class*=weui-icon-] { + width: 18px +} + +.weui-form-preview { + position: relative; + background-color: var(--weui-BG-2) +} + +.weui-form-preview:before { + top: 0; + border-top: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-form-preview:after, +.weui-form-preview:before { + content: " "; + position: absolute; + left: 0; + right: 0; + height: 1px; + color: var(--weui-FG-3) +} + +.weui-form-preview:after { + bottom: 0; + border-bottom: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-form-preview__hd { + position: relative; + padding: 16px; + text-align: right; + line-height: 2.5em +} + +.weui-form-preview__hd:after { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + left: 16px +} + +.weui-form-preview__hd .weui-form-preview__value { + font-style: normal; + font-size: 1.6em +} + +.weui-form-preview__bd { + padding: 16px; + font-size: .9em; + text-align: right; + color: var(--weui-FG-1); + line-height: 2 +} + +.weui-form-preview__ft { + position: relative; + line-height: 50px; + display: -webkit-box; + display: -webkit-flex; + display: flex +} + +.weui-form-preview__ft:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-form-preview__item { + overflow: hidden +} + +.weui-form-preview__label { + float: left; + margin-right: 1em; + min-width: 4em; + color: var(--weui-FG-1); + text-align: justify; + text-align-last: justify +} + +.weui-form-preview__value { + display: block; + overflow: hidden; + word-break: normal; + word-wrap: break-word; + color: var(--weui-FG-0) +} + +.weui-form-preview__btn { + position: relative; + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + color: var(--weui-LINK); + text-align: center; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +button.weui-form-preview__btn { + background-color: transparent; + border: 0; + outline: 0; + line-height: inherit; + font-size: inherit +} + +.weui-form-preview__btn:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-form-preview__btn:after { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-form-preview__btn:first-child:after { + display: none +} + +.weui-form-preview__btn_default { + color: var(--weui-FG-HALF) +} + +.weui-form-preview__btn_primary { + color: var(--weui-LINK) +} + +.weui-cell_select { + padding: 0 +} + +.weui-cell_select .weui-select { + padding-right: 30px +} + +.weui-cell_select .weui-cell__bd:after { + content: " "; + width: 12px; + height: 24px; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + position: absolute; + top: 50%; + right: 16px; + margin-top: -12px +} + +.weui-select { + -webkit-appearance: none; + border: 0; + outline: 0; + background-color: transparent; + width: 100%; + font-size: inherit; + height: 56px; + line-height: 56px; + position: relative; + z-index: 1; + padding-left: 16px; + color: var(--weui-FG-0) +} + +.weui-cell_select-before { + padding-right: 16px +} + +.weui-cell_select-before .weui-select { + width: 105px; + box-sizing: border-box +} + +.weui-cell_select-before .weui-cell__hd { + position: relative +} + +.weui-cell_select-before .weui-cell__hd:after { + content: " "; + position: absolute; + right: 0; + top: 0; + width: 1px; + bottom: 0; + border-right: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 100% 0; + transform-origin: 100% 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-cell_select-before .weui-cell__hd:before { + content: " "; + width: 12px; + height: 24px; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + background-color: currentColor; + color: var(--weui-FG-2); + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E); + position: absolute; + top: 50%; + right: 16px; + margin-top: -12px +} + +.weui-cell_select-before .weui-cell__bd { + padding-left: 16px +} + +.weui-cell_select-before .weui-cell__bd:after { + display: none +} + +.weui-cell_select-before.weui-cell_access .weui-cell__hd { + line-height: 56px; + padding-left: 32px +} + +.weui-cell_select-after { + padding-left: 16px +} + +.weui-cell_select-after .weui-select { + padding-left: 0 +} + +.weui-cell_select-after.weui-cell_access .weui-cell__bd { + line-height: 56px +} + +.weui-cell_vcode { + padding-top: 0; + padding-right: 0; + padding-bottom: 0 +} + +.weui-vcode-btn, +.weui-vcode-img { + margin-left: 5px; + height: 56px; + vertical-align: middle +} + +.weui-vcode-btn { + display: inline-block; + padding: 0 .6em 0 .7em; + line-height: 56px; + font-size: 17px; + color: var(--weui-LINK); + position: relative +} + +.weui-vcode-btn:before { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +button.weui-vcode-btn { + background-color: transparent; + border: 0; + outline: 0 +} + +.weui-vcode-btn:active { + color: #767676 +} + +.weui-gallery { + display: none; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: #000; + z-index: 1000 +} + +.weui-gallery__img, +.weui-gallery__opr { + position: absolute; + left: 0; + left: constant(safe-area-inset-left); + left: env(safe-area-inset-left); + right: 0; + right: constant(safe-area-inset-right); + right: env(safe-area-inset-right) +} + +.weui-gallery__img { + top: 0; + top: constant(safe-area-inset-top); + top: env(safe-area-inset-top); + bottom: 60px; + bottom: calc(60px + constant(safe-area-inset-bottom)); + bottom: calc(60px + env(safe-area-inset-bottom)); + background: 50% no-repeat; + background-size: contain +} + +.weui-gallery__opr { + position: absolute; + bottom: 0; + padding-bottom: 0; + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); + background-color: #0d0d0d; + color: var(--weui-WHITE); + line-height: 60px; + text-align: center +} + +.weui-gallery__del { + display: block +} + +.weui-cell_switch { + padding-top: 12px; + padding-bottom: 12px +} + +.weui-switch { + -webkit-appearance: none; + appearance: none +} + +.weui-switch, +.weui-switch-cp__box { + position: relative; + width: 52px; + height: 32px; + border: 2px solid var(--weui-FG-3); + outline: 0; + border-radius: 16px; + box-sizing: border-box; + -webkit-transition: background-color .1s, border .1s; + transition: background-color .1s, border .1s +} + +.weui-switch-cp__box:before, +.weui-switch:before { + content: " "; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + border-radius: 15px; + background-color: var(--weui-BG-3); + -webkit-transition: -webkit-transform .35s cubic-bezier(.45, 1, .4, 1); + transition: -webkit-transform .35s cubic-bezier(.45, 1, .4, 1); + transition: transform .35s cubic-bezier(.45, 1, .4, 1); + transition: transform .35s cubic-bezier(.45, 1, .4, 1), -webkit-transform .35s cubic-bezier(.45, 1, .4, 1) +} + +.weui-switch-cp__box:after, +.weui-switch:after { + content: " "; + position: absolute; + top: 0; + left: 0; + width: 28px; + height: 28px; + border-radius: 15px; + background-color: #fff; + box-shadow: 0 1px 3px rgba(0, 0, 0, .4); + -webkit-transition: -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35); + transition: -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35); + transition: transform .35s cubic-bezier(.4, .4, .25, 1.35); + transition: transform .35s cubic-bezier(.4, .4, .25, 1.35), -webkit-transform .35s cubic-bezier(.4, .4, .25, 1.35) +} + +.weui-switch-cp__input:checked+.weui-switch-cp__box, +.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box, +.weui-switch:checked { + border-color: var(--weui-BRAND); + background-color: var(--weui-BRAND) +} + +.weui-switch-cp__input:checked+.weui-switch-cp__box:before, +.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:before, +.weui-switch:checked:before { + -webkit-transform: scale(0); + transform: scale(0) +} + +.weui-switch-cp__input:checked+.weui-switch-cp__box:after, +.weui-switch-cp__input[aria-checked=true]+.weui-switch-cp__box:after, +.weui-switch:checked:after { + -webkit-transform: translateX(20px); + transform: translateX(20px) +} + +.weui-switch-cp__input { + position: absolute; + left: -9999px +} + +.weui-switch-cp__box { + display: block +} + +.weui-uploader { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-uploader__hd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + padding-bottom: 16px; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-uploader__title { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-uploader__info { + color: var(--weui-FG-2) +} + +.weui-uploader__bd { + margin-bottom: -8px; + margin-right: -8px; + overflow: hidden +} + +.weui-uploader__files { + list-style: none +} + +.weui-uploader__file { + float: left; + margin-right: 8px; + margin-bottom: 8px; + width: 96px; + height: 96px; + background: no-repeat 50%; + background-size: cover +} + +.weui-uploader__file_status { + position: relative +} + +.weui-uploader__file_status:before { + content: " "; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: rgba(0, 0, 0, .5) +} + +.weui-uploader__file_status .weui-uploader__file-content { + display: block +} + +.weui-uploader__file-content { + display: none; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + color: var(--weui-WHITE) +} + +.weui-uploader__file-content .weui-icon-warn { + display: inline-block +} + +.weui-uploader__input-box { + float: left; + position: relative; + margin-right: 8px; + margin-bottom: 8px; + width: 96px; + height: 96px; + box-sizing: border-box; + background-color: #ededed +} + +@media(prefers-color-scheme: dark) { + .weui-uploader__input-box { + background-color: #2e2e2e + } +} + +.weui-uploader__input-box:after, +.weui-uploader__input-box:before { + content: " "; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-color: #a3a3a3 +} + +@media(prefers-color-scheme: dark) { + .weui-uploader__input-box:after, + .weui-uploader__input-box:before { + background-color: #6d6d6d + } +} + +.weui-uploader__input-box:before { + width: 2px; + height: 32px +} + +.weui-uploader__input-box:after { + width: 32px; + height: 2px +} + +.weui-uploader__input-box:active:after, +.weui-uploader__input-box:active:before { + opacity: .7 +} + +.weui-uploader__input { + position: absolute; + z-index: 1; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-msg { + padding-top: 48px; + padding: calc(48px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left); + padding: calc(48px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); + text-align: center; + line-height: 1.4; + min-height: 100%; + box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + background-color: var(--weui-BG-2) +} + +.weui-msg a:not(.weui-btn) { + color: var(--weui-LINK); + display: inline-block; + vertical-align: baseline +} + +.weui-msg__icon-area { + margin-bottom: 32px +} + +.weui-msg__text-area { + margin-bottom: 32px; + padding: 0 32px; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + line-height: 1.6 +} + +.weui-msg__text-area:first-child { + padding-top: 96px +} + +.weui-msg__title { + font-weight: 700; + font-size: 22px +} + +.weui-msg__desc, +.weui-msg__title { + margin-bottom: 16px; + color: var(--weui-FG-0); + word-wrap: break-word; + word-break: break-all +} + +.weui-msg__desc { + font-size: 17px +} + +.weui-msg__desc-primary { + font-size: 14px; + color: var(--weui-FG-1); + word-wrap: break-word; + word-break: break-all; + margin-bottom: 16px +} + +.weui-msg__opr-area { + margin-bottom: 16px +} + +.weui-msg__opr-area .weui-btn-area { + margin: 0 +} + +.weui-msg__opr-area .weui-btn+.weui-btn { + margin-bottom: 16px +} + +.weui-msg__opr-area:last-child { + margin-bottom: 96px +} + +.weui-msg__opr-area+.weui-msg__extra-area { + margin-top: 48px +} + +.weui-msg__tips-area { + margin-bottom: 16px; + padding: 0 40px +} + +.weui-msg__opr-area+.weui-msg__tips-area { + margin-bottom: 48px +} + +.weui-msg__tips-area:last-child { + margin-bottom: 64px +} + +.weui-msg__extra-area, +.weui-msg__tips { + font-size: 12px; + color: var(--weui-FG-1) +} + +.weui-msg__extra-area { + margin-bottom: 24px +} + +.weui-msg__extra-area a, +.weui-msg__extra-area navigator { + color: var(--weui-LINK) +} + +.weui-msg__extra-area navigator { + display: inline +} + +.weui-cells__group_form:first-child .weui-cells__title { + margin-top: 0 +} + +.weui-cells__group_form .weui-cells__title { + margin-top: 24px; + margin-bottom: 8px; + padding: 0 32px +} + +.weui-cells__group_form .weui-cell:before, +.weui-cells__group_form .weui-cells:before { + left: 32px; + right: 32px +} + +.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before { + left: 72px +} + +.weui-cells__group_form .weui-cells:after { + left: 32px; + right: 32px +} + +.weui-cells__group_form .weui-cell { + padding: 16px 32px +} + +.weui-cells__group_form .weui-cell:not(.weui-cell_link) { + color: var(--weui-FG-0) +} + +.weui-cells__group_form .weui-cell__hd { + padding-right: 16px +} + +.weui-cells__group_form .weui-cell__ft { + padding-left: 16px +} + +.weui-cells__group_form .weui-cell_warn input { + color: var(--weui-RED) +} + +.weui-cells__group_form .weui-label { + max-width: 5em; + margin-right: 8px +} + +.weui-cells__group_form .weui-cells__tips { + margin-top: 8px; + padding: 0 32px; + color: rgba(0, 0, 0, .3) +} + +.weui-cells__group_form .weui-cells__tips a { + font-weight: 700 +} + +.weui-cells__group_form .weui-cell_vcode { + padding: 12px 32px +} + +.weui-cells__group_form .weui-vcode-btn { + font-size: 16px; + padding: 0 12px; + margin-left: 0; + height: auto; + width: auto; + line-height: 2em; + color: var(--weui-BTN-DEFAULT-COLOR); + background-color: var(--weui-BTN-DEFAULT-BG) +} + +.weui-cells__group_form .weui-vcode-btn:before { + display: none +} + +.weui-cells__group_form .weui-cell_select { + padding: 0 +} + +.weui-cells__group_form .weui-cell_select .weui-select { + padding: 0 32px +} + +.weui-cells__group_form .weui-cell_select .weui-cell__bd:after { + right: 32px +} + +.weui-cells__group_form .weui-cell_select-before .weui-label { + margin-right: 24px +} + +.weui-cells__group_form .weui-cell_select-before .weui-select { + padding-right: 24px; + box-sizing: initial +} + +.weui-cells__group_form .weui-cell_select-after { + padding-left: 32px +} + +.weui-cells__group_form .weui-cell_select-after .weui-select { + padding-left: 0 +} + +.weui-cells__group_form .weui-cell_switch { + padding: 12px 32px +} + +.weui-form { + padding: 56px 0 0; + padding: calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left); + padding: calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + line-height: 1.4; + min-height: 100%; + box-sizing: border-box; + background-color: var(--weui-BG-2) +} + +.weui-form .weui-footer, +.weui-form .weui-footer__link { + font-size: 14px +} + +.weui-form .weui-agree { + padding: 0 +} + +.weui-form__text-area { + padding: 0 32px; + color: var(--weui-FG-0); + text-align: center +} + +.weui-form__control-area { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + margin: 48px 0 +} + +.weui-form__tips-area { + overflow: hidden +} + +.weui-form__extra-area, +.weui-form__tips-area { + margin-bottom: 24px; + text-align: center +} + +.weui-form__opr-area { + margin-bottom: 64px +} + +.weui-form__opr-area:last-child { + margin-bottom: 96px +} + +.weui-form__title { + font-size: 22px; + font-weight: 700; + line-height: 1.36 +} + +.weui-form__desc { + font-size: 17px; + margin-top: 16px +} + +.weui-form__tips { + color: var(--weui-FG-1); + font-size: 14px +} + +.weui-form__tips a, +.weui-form__tips navigator { + color: var(--weui-LINK) +} + +.weui-form__tips navigator { + display: inline +} + +.weui-article { + padding: 24px 16px; + padding: 24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left)); + padding: 24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); + font-size: 17px; + color: var(--weui-FG-0) +} + +.weui-article__section { + margin-bottom: 1.5em +} + +.weui-article__h1 { + font-size: 22px; + font-weight: 700; + margin-bottom: .9em; + line-height: 1.4 +} + +.weui-article__h2 { + font-size: 17px +} + +.weui-article__h2, +.weui-article__h3 { + font-weight: 700; + margin-bottom: .34em; + line-height: 1.4 +} + +.weui-article__h3 { + font-size: 15px +} + +.weui-article__p { + margin: 0 0 .8em +} + +.weui-tabbar { + display: -webkit-box; + display: -webkit-flex; + display: flex; + position: relative; + z-index: 500; + background-color: var(--weui-BG-1) +} + +.weui-tabbar:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-tabbar__item { + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + padding: 8px 0; + padding-bottom: calc(8px + constant(safe-area-inset-bottom)); + padding-bottom: calc(8px + env(safe-area-inset-bottom)); + font-size: 0; + color: var(--weui-FG-1); + text-align: center; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-tabbar__item:first-child { + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left) +} + +.weui-tabbar__item:last-child { + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right) +} + +.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon, +.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i, +.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label { + color: var(--weui-BRAND) +} + +.weui-tabbar__icon { + display: inline-block; + width: 28px; + height: 28px; + margin-bottom: 2px +} + +.weui-tabbar__icon>i, +i.weui-tabbar__icon { + font-size: 24px; + color: var(--weui-FG-1) +} + +.weui-tabbar__icon img { + width: 100%; + height: 100% +} + +.weui-tabbar__label { + color: var(--weui-FG-0); + font-size: 10px; + line-height: 1.4 +} + +.weui-navbar { + display: -webkit-box; + display: -webkit-flex; + display: flex; + position: relative; + z-index: 500; + background-color: var(--weui-BG-2); + padding-top: constant(safe-area-inset-top); + padding-top: env(safe-area-inset-top) +} + +.weui-navbar:after { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-navbar+.weui-tab__panel { + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom) +} + +.weui-navbar__item { + position: relative; + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + padding: 16px 0; + padding-top: calc(16px + constant(safe-area-inset-top)); + padding-top: calc(16px + env(safe-area-inset-top)); + text-align: center; + font-size: 17px; + line-height: 1.41176471; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-navbar__item.weui-bar__item_on, +.weui-navbar__item:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-navbar__item:after { + content: " "; + position: absolute; + right: 0; + top: 0; + width: 1px; + bottom: 0; + border-right: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 100% 0; + transform-origin: 100% 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-navbar__item:first-child { + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left) +} + +.weui-navbar__item:last-child { + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right) +} + +.weui-navbar__item:last-child:after { + display: none +} + +.weui-tab { + display: -webkit-box; + display: -webkit-flex; + display: flex; + height: 100%; + box-sizing: border-box; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column +} + +.weui-tab__panel { + box-sizing: border-box; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + overflow: auto; + -webkit-overflow-scrolling: touch +} + +.weui-tab__content { + display: none +} + +.weui-progress { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-progress__bar { + background-color: var(--weui-BG-0); + height: 3px; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-progress__inner-bar { + width: 0; + height: 100%; + background-color: var(--weui-BRAND) +} + +.weui-progress__opr { + display: block; + margin-left: 15px; + font-size: 0 +} + +.weui-panel { + background-color: var(--weui-BG-2); + margin-top: 10px; + position: relative; + overflow: hidden +} + +.weui-panel:first-child { + margin-top: 0 +} + +.weui-panel:before { + top: 0; + border-top: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-panel:after, +.weui-panel:before { + content: " "; + position: absolute; + left: 0; + right: 0; + height: 1px; + color: var(--weui-FG-3) +} + +.weui-panel:after { + bottom: 0; + border-bottom: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-panel__hd { + padding: 16px 16px 13px; + color: var(--weui-FG-0); + font-size: 15px; + font-weight: 700; + position: relative +} + +.weui-panel__hd:after { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + left: 15px +} + +.weui-media-box { + padding: 16px; + position: relative +} + +.weui-media-box:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + left: 16px +} + +.weui-media-box:first-child:before { + display: none +} + +a.weui-media-box { + color: #000; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +a.weui-media-box:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-media-box__title { + font-weight: 400; + font-size: 17px; + color: var(--weui-FG-0); + width: auto; + white-space: nowrap; + word-wrap: normal; + word-wrap: break-word; + word-break: break-all +} + +.weui-media-box__desc, +.weui-media-box__title { + line-height: 1.4; + overflow: hidden; + text-overflow: ellipsis +} + +.weui-media-box__desc { + color: var(--weui-FG-2); + font-size: 14px; + padding-top: 4px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2 +} + +.weui-media-box__info { + margin-top: 16px; + padding-bottom: 4px; + font-size: 13px; + color: var(--weui-FG-2); + line-height: 1em; + list-style: none; + overflow: hidden +} + +.weui-media-box__info__meta { + float: left; + padding-right: 1em +} + +.weui-media-box__info__meta_extra { + padding-left: 1em; + border-left: 1px solid var(--weui-FG-2) +} + +.weui-media-box_appmsg { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-media-box_appmsg .weui-media-box__hd { + margin-right: 16px; + width: 60px; + height: 60px; + line-height: 60px; + text-align: center +} + +.weui-media-box_appmsg .weui-media-box__thumb { + width: 100%; + max-height: 100%; + vertical-align: top +} + +.weui-media-box_appmsg .weui-media-box__bd { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + min-width: 0 +} + +.weui-media-box_small-appmsg { + padding: 0 +} + +.weui-media-box_small-appmsg .weui-cells { + margin-top: 0 +} + +.weui-media-box_small-appmsg .weui-cells:before { + display: none +} + +.weui-grids { + position: relative; + overflow: hidden +} + +.weui-grids:before { + right: 0; + height: 1px; + border-top: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-grids:after, +.weui-grids:before { + content: " "; + position: absolute; + left: 0; + top: 0; + color: var(--weui-FG-3) +} + +.weui-grids:after { + width: 1px; + bottom: 0; + border-left: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-grid { + position: relative; + float: left; + padding: 20px 10px; + width: 33.33333333%; + box-sizing: border-box +} + +.weui-grid:before { + top: 0; + width: 1px; + border-right: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 100% 0; + transform-origin: 100% 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-grid:after, +.weui-grid:before { + content: " "; + position: absolute; + right: 0; + bottom: 0; + color: var(--weui-FG-3) +} + +.weui-grid:after { + left: 0; + height: 1px; + border-bottom: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-grid:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-grid__icon { + width: 28px; + height: 28px; + margin: 0 auto +} + +.weui-grid__icon img { + display: block; + width: 100%; + height: 100% +} + +.weui-grid__icon+.weui-grid__label { + margin-top: 4px +} + +.weui-grid__label { + display: block; + color: var(--weui-FG-0); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden +} + +.weui-footer, +.weui-grid__label { + text-align: center; + font-size: 14px +} + +.weui-footer { + color: var(--weui-FG-2); + line-height: 1.4 +} + +.weui-footer a, +.weui-footer navigator { + color: var(--weui-LINK) +} + +.weui-footer navigator { + display: inline +} + +.weui-footer_fixed-bottom { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-top: 16px; + padding-bottom: 16px; + padding-bottom: calc(16px + constant(safe-area-inset-bottom)); + padding-bottom: calc(16px + env(safe-area-inset-bottom)); + left: constant(safe-area-inset-left); + left: env(safe-area-inset-left); + right: constant(safe-area-inset-right); + right: env(safe-area-inset-right) +} + +.weui-footer__links { + font-size: 0 +} + +.weui-footer__link { + display: inline-block; + vertical-align: top; + margin: 0 8px; + position: relative; + font-size: 14px +} + +.weui-footer__link:before { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5); + left: -8px; + top: .36em; + bottom: .36em +} + +.weui-footer__link:first-child:before { + display: none +} + +.weui-footer__text { + padding: 0 16px; + font-size: 12px +} + +.weui-flex { + display: -webkit-box; + display: -webkit-flex; + display: flex +} + +.weui-flex__item { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-dialog { + position: fixed; + z-index: 5000; + top: 50%; + left: 16px; + right: 16px; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + background-color: var(--weui-BG-2); + text-align: center; + border-radius: 12px; + overflow: hidden; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + flex-direction: column; + max-height: 90% +} + +.weui-dialog__hd { + padding: 32px 24px 16px +} + +.weui-dialog__title { + font-weight: 700; + font-size: 17px; + line-height: 1.4 +} + +.weui-dialog__bd { + overflow-y: auto; + -webkit-overflow-scrolling: touch; + padding: 0 24px; + margin-bottom: 32px; + font-size: 17px; + line-height: 1.4; + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + color: var(--weui-FG-1) +} + +.weui-dialog__bd:first-child { + min-height: 40px; + padding: 32px 24px 0; + font-weight: 700; + color: var(--weui-FG-0); + -webkit-flex-direction: column; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + flex-direction: column; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center +} + +.weui-dialog__bd:first-child, +.weui-dialog__ft { + display: -webkit-box; + display: -webkit-flex; + display: flex +} + +.weui-dialog__ft { + position: relative; + line-height: 56px; + min-height: 56px; + font-size: 17px +} + +.weui-dialog__ft:after { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-dialog__btn { + display: block; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + color: var(--weui-LINK); + font-weight: 700; + text-decoration: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + position: relative +} + +.weui-dialog__btn:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-dialog__btn:after { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid var(--weui-DIALOG-LINE-COLOR); + color: var(--weui-DIALOG-LINE-COLOR); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-dialog__btn:first-child:after { + display: none +} + +.weui-dialog__btn_default { + color: var(--weui-FG-HALF) +} + +.weui-skin_android .weui-dialog { + text-align: left; + box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .1) +} + +.weui-skin_android .weui-dialog__title { + font-size: 22px; + line-height: 1.4 +} + +.weui-skin_android .weui-dialog__hd { + text-align: left +} + +.weui-skin_android .weui-dialog__bd { + color: var(--weui-FG-1); + text-align: left +} + +.weui-skin_android .weui-dialog__bd:first-child { + color: var(--weui-FG-0) +} + +.weui-skin_android .weui-dialog__ft { + display: block; + text-align: right; + line-height: 40px; + min-height: 40px; + padding: 0 24px 16px +} + +.weui-skin_android .weui-dialog__ft:after { + display: none +} + +.weui-skin_android .weui-dialog__btn { + display: inline-block; + vertical-align: top; + padding: 0 .8em +} + +.weui-skin_android .weui-dialog__btn:after { + display: none +} + +.weui-skin_android .weui-dialog__btn:last-child { + margin-right: -.8em +} + +.weui-skin_android .weui-dialog__btn_default { + color: var(--weui-FG-HALF) +} + +@media screen and (min-width:352px) { + .weui-dialog { + width: 320px; + margin: 0 auto + } +} + +.weui-half-screen-dialog { + position: fixed; + left: 0; + right: 0; + bottom: 0; + max-height: 75%; + z-index: 5000; + line-height: 1.4; + background-color: var(--weui-BG-2); + border-top-left-radius: 12px; + border-top-right-radius: 12px; + overflow: hidden; + padding: 0 24px; + padding: 0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left)); + padding: 0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left)) +} + +@media only screen and (max-height:558px) { + .weui-half-screen-dialog { + max-height: none + } +} + +.weui-half-screen-dialog__hd { + font-size: 8px; + height: 8em; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-half-screen-dialog__hd .weui-icon-btn { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%) +} + +.weui-half-screen-dialog__hd .weui-icon-btn:active { + opacity: .5 +} + +.weui-half-screen-dialog__hd__side { + position: relative; + left: -8px +} + +.weui-half-screen-dialog__hd__main { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main { + text-align: center; + padding: 0 40px +} + +.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side { + right: -8px; + left: auto +} + +.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn { + right: 0 +} + +.weui-half-screen-dialog__title { + display: block; + color: var(--weui-FG-0); + font-weight: 700; + font-size: 15px +} + +.weui-half-screen-dialog__subtitle { + display: block; + color: var(--weui-FG-1); + font-size: 10px +} + +.weui-half-screen-dialog__bd { + word-wrap: break-word; + -webkit-hyphens: auto; + hyphens: auto; + overflow-y: auto; + padding-top: 4px; + padding-bottom: 40px; + font-size: 14px; + color: var(--weui-FG-0) +} + +.weui-half-screen-dialog__desc { + font-size: 17px; + font-weight: 700; + color: var(--weui-FG-0); + line-height: 1.4 +} + +.weui-half-screen-dialog__tips { + padding-top: 16px; + font-size: 14px; + color: var(--weui-FG-2); + line-height: 1.4 +} + +.weui-half-screen-dialog__ft { + padding: 0 24px 32px; + text-align: center +} + +.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2), +.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn { + display: inline-block; + vertical-align: top; + margin: 0 8px; + width: 120px +} + +.weui-icon-btn { + outline: 0; + -webkit-appearance: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + border-width: 0; + background-color: transparent; + color: var(--weui-FG-0); + font-size: 0 +} + +.weui-icon-more { + width: 24px; + -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M5 10.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E%3C/svg%3E") no-repeat 50% 50%; + -webkit-mask-size: cover; + mask-size: cover +} + +.weui-icon-btn_goback, +.weui-icon-more { + display: inline-block; + vertical-align: middle; + height: 24px; + background-color: currentColor; + color: var(--weui-FG-0) +} + +.weui-icon-btn_goback { + width: 12px; + -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%; + mask: url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10%2019.438L8.955%2020.5l-7.666-7.79a1.02%201.02%200%20010-1.42L8.955%203.5%2010%204.563%202.682%2012%2010%2019.438z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%; + -webkit-mask-size: cover; + mask-size: cover +} + +.weui-icon-btn_close { + color: var(--weui-FG-0); + display: inline-block; + vertical-align: middle; + width: 14px; + height: 24px; + -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%; + mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat 50% 50%; + -webkit-mask-size: cover; + mask-size: cover; + background-color: currentColor +} + +.weui-toast { + position: fixed; + z-index: 5000; + width: 120px; + height: 120px; + top: 40%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + text-align: center; + border-radius: 5px; + color: hsla(0, 0%, 100%, .9); + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + background-color: #4c4c4c +} + +@media(prefers-color-scheme: dark) { + .weui-toast { + background-color: #606060 + } +} + +.weui-icon_toast { + display: block +} + +.weui-icon_toast.weui-icon-success-no-circle { + color: hsla(0, 0%, 100%, .9); + width: 55px; + height: 55px +} + +.weui-icon_toast.weui-loading { + margin: 8px 0; + width: 38px; + height: 38px; + vertical-align: baseline +} + +.weui-toast__content { + font-size: 14px +} + +.weui-mask { + background: rgba(0, 0, 0, .6) +} + +.weui-mask, +.weui-mask_transparent { + position: fixed; + z-index: 1000; + top: 0; + right: 0; + left: 0; + bottom: 0 +} + +.weui-actionsheet { + position: fixed; + left: 0; + bottom: 0; + -webkit-transform: translateY(100%); + transform: translateY(100%); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + z-index: 5000; + width: 100%; + background-color: var(--weui-BG-1); + -webkit-transition: -webkit-transform .3s; + transition: -webkit-transform .3s; + transition: transform .3s; + transition: transform .3s, -webkit-transform .3s; + border-top-left-radius: 12px; + border-top-right-radius: 12px; + overflow: hidden +} + +.weui-actionsheet__title { + position: relative; + height: 56px; + padding: 0 24px; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + text-align: center; + font-size: 12px; + color: var(--weui-FG-1); + line-height: 1.4; + background: var(--weui-BG-2) +} + +.weui-actionsheet__title:before { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-actionsheet__title .weui-actionsheet__title-text { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2 +} + +.weui-actionsheet__menu { + color: var(--weui-FG-0); + background-color: var(--weui-BG-2) +} + +.weui-actionsheet__action { + margin-top: 8px; + background-color: var(--weui-BG-2); + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom) +} + +.weui-actionsheet__cell { + position: relative; + padding: 16px; + text-align: center; + font-size: 17px; + line-height: 1.41176471 +} + +.weui-actionsheet__cell:before { + content: " "; + position: absolute; + left: 0; + top: 0; + right: 0; + height: 1px; + border-top: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-actionsheet__cell:active { + background-color: var(--weui-BG-COLOR-ACTIVE) +} + +.weui-actionsheet__cell:first-child:before { + display: none +} + +.weui-actionsheet__cell_warn { + color: var(--weui-RED) +} + +.weui-skin_android .weui-actionsheet { + position: fixed; + left: 50%; + top: 50%; + bottom: auto; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + width: 274px; + box-sizing: border-box; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + background: transparent; + -webkit-transition: -webkit-transform .3s; + transition: -webkit-transform .3s; + transition: transform .3s; + transition: transform .3s, -webkit-transform .3s; + border-top-left-radius: 0; + border-top-right-radius: 0 +} + +.weui-skin_android .weui-actionsheet__action { + display: none +} + +.weui-skin_android .weui-actionsheet__menu { + border-radius: 2px; + box-shadow: 0 6px 30px 0 rgba(0, 0, 0, .1) +} + +.weui-skin_android .weui-actionsheet__cell { + padding: 16px; + font-size: 17px; + line-height: 1.41176471; + color: var(--weui-FG-0); + text-align: left +} + +.weui-skin_android .weui-actionsheet__cell:first-child { + border-top-left-radius: 2px; + border-top-right-radius: 2px +} + +.weui-skin_android .weui-actionsheet__cell:last-child { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px +} + +.weui-actionsheet_toggle { + -webkit-transform: translate(0); + transform: translate(0) +} + +.weui-loadmore { + width: 65%; + margin: 1.5em auto; + line-height: 1.6em; + font-size: 14px; + text-align: center +} + +.weui-loadmore__tips { + display: inline-block; + vertical-align: middle; + color: var(--weui-FG-0) +} + +.weui-loadmore_line { + border-top: 1px solid var(--weui-FG-3); + margin-top: 2.4em +} + +.weui-loadmore_line .weui-loadmore__tips { + position: relative; + top: -.9em; + padding: 0 .55em; + background-color: var(--weui-BG-2); + color: var(--weui-FG-1) +} + +.weui-loadmore_dot .weui-loadmore__tips { + padding: 0 .16em +} + +.weui-loadmore_dot .weui-loadmore__tips:before { + content: " "; + width: 4px; + height: 4px; + border-radius: 50%; + background-color: var(--weui-FG-3); + display: inline-block; + position: relative; + vertical-align: 0; + top: -.16em +} + +.weui-badge { + display: inline-block; + padding: .15em .4em; + min-width: 8px; + border-radius: 18px; + background-color: var(--weui-RED); + color: #fff; + line-height: 1.2; + text-align: center; + font-size: 12px; + vertical-align: middle +} + +.weui-badge_dot { + padding: .4em; + min-width: 0 +} + +.weui-toptips { + display: none; + position: fixed; + -webkit-transform: translateZ(0); + transform: translateZ(0); + top: 8px; + left: 8px; + right: 8px; + padding: 10px; + border-radius: 8px; + font-size: 14px; + text-align: center; + color: #fff; + z-index: 5000; + word-wrap: break-word; + word-break: break-all +} + +.weui-toptips_warn { + background-color: var(--weui-RED) +} + +.weui-search-bar { + position: relative; + padding: 8px; + display: -webkit-box; + display: -webkit-flex; + display: flex; + box-sizing: border-box; + background-color: var(--weui-BG-0); + -webkit-text-size-adjust: 100%; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-search-bar.weui-search-bar_focusing .weui-search-bar__cancel-btn { + display: block +} + +.weui-search-bar.weui-search-bar_focusing .weui-search-bar__label { + display: none +} + +.weui-search-bar .weui-icon-search { + width: 16px; + height: 16px +} + +.weui-search-bar__form { + position: relative; + -webkit-box-flex: 1; + -webkit-flex: auto; + flex: auto; + background-color: var(--weui-BG-2); + border-radius: 4px +} + +.weui-search-bar__box { + position: relative; + padding-left: 28px; + padding-right: 32px; + height: 100%; + width: 100%; + box-sizing: border-box; + z-index: 1 +} + +.weui-search-bar__box .weui-search-bar__input { + padding: 8px 0; + width: 100%; + height: 1.14285714em; + border: 0; + font-size: 14px; + line-height: 1.14285714em; + box-sizing: content-box; + background: transparent; + caret-color: var(--weui-BRAND); + color: var(--weui-FG-0) +} + +.weui-search-bar__box .weui-search-bar__input:focus { + outline: none +} + +.weui-search-bar__box .weui-icon-search { + position: absolute; + top: 50%; + left: 8px; + margin-top: -8px +} + +.weui-search-bar__box .weui-icon-clear { + position: absolute; + top: 50%; + right: 0; + margin-top: -16px; + padding: 8px; + width: 16px; + height: 16px; + -webkit-mask-size: 16px; + mask-size: 16px +} + +.weui-search-bar__label { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 2; + font-size: 0; + border-radius: 4px; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; + color: var(--weui-FG-1); + background: var(--weui-BG-2) +} + +.weui-search-bar__label span { + display: inline-block; + font-size: 14px; + vertical-align: middle +} + +.weui-search-bar__label .weui-icon-search { + margin-right: 4px +} + +.weui-search-bar__cancel-btn { + display: none; + margin-left: 8px; + line-height: 28px; + color: var(--weui-LINK); + white-space: nowrap +} + +.weui-search-bar__input:not(:valid)+.weui-icon-clear { + display: none +} + +input[type=search]::-webkit-search-cancel-button, +input[type=search]::-webkit-search-decoration, +input[type=search]::-webkit-search-results-button, +input[type=search]::-webkit-search-results-decoration { + display: none +} + +.weui-picker { + position: fixed; + width: 100%; + box-sizing: border-box; + left: 0; + bottom: 0; + z-index: 5000; + background-color: var(--weui-BG-2); + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform: translateY(100%); + transform: translateY(100%); + -webkit-transition: -webkit-transform .3s; + transition: -webkit-transform .3s; + transition: transform .3s; + transition: transform .3s, -webkit-transform .3s +} + +.weui-picker__hd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + padding: 16px; + padding: 16px calc(16px + constant(safe-area-inset-right)) 16px calc(16px + constant(safe-area-inset-left)); + padding: 16px calc(16px + env(safe-area-inset-right)) 16px calc(16px + env(safe-area-inset-left)); + position: relative; + text-align: center; + font-size: 17px; + line-height: 1.4 +} + +.weui-picker__hd:after { + content: " "; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 1px; + border-bottom: 1px solid var(--weui-FG-3); + color: var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-picker__bd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + position: relative; + background-color: var(--weui-BG-2); + height: 240px; + overflow: hidden +} + +.weui-picker__group { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + position: relative; + height: 100% +} + +.weui-picker__group:first-child .weui-picker__item { + padding-left: constant(safe-area-inset-left); + padding-left: env(safe-area-inset-left) +} + +.weui-picker__group:last-child .weui-picker__item { + padding-right: constant(safe-area-inset-right); + padding-right: env(safe-area-inset-right) +} + +.weui-picker__mask { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0 auto; + z-index: 3; + background-image: -webkit-linear-gradient(top, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)), -webkit-linear-gradient(bottom, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)); + background-image: linear-gradient(180deg, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)), linear-gradient(0deg, hsla(0, 0%, 100%, .95), hsla(0, 0%, 100%, .6)); + background-position: top, bottom; + background-size: 100% 92px; + background-repeat: no-repeat; + -webkit-transform: translateZ(0); + transform: translateZ(0) +} + +@media(prefers-color-scheme: dark) { + .weui-picker__mask { + background-image: -webkit-linear-gradient(top, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)), -webkit-linear-gradient(bottom, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)); + background-image: linear-gradient(180deg, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)), linear-gradient(0deg, rgba(35, 35, 35, .95), rgba(35, 35, 35, .6)) + } +} + +.weui-picker__indicator { + width: 100%; + height: 56px; + position: absolute; + left: 0; + top: 92px; + z-index: 3 +} + +.weui-picker__indicator:before { + top: 0; + border-top: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-picker__indicator:after, +.weui-picker__indicator:before { + content: " "; + position: absolute; + left: 0; + right: 0; + height: 1px; + color: var(--weui-FG-3) +} + +.weui-picker__indicator:after { + bottom: 0; + border-bottom: 1px solid var(--weui-FG-3); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: scaleY(.5); + transform: scaleY(.5) +} + +.weui-picker__content { + position: absolute; + top: 0; + left: 0; + width: 100% +} + +.weui-picker__item { + height: 48px; + line-height: 48px; + text-align: center; + color: var(--weui-FG-0); + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden +} + +.weui-picker__item_disabled { + color: var(--weui-FG-1) +} + +@-webkit-keyframes a { + 0% { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) + } + + to { + -webkit-transform: translateZ(0); + transform: translateZ(0) + } +} + +@keyframes a { + 0% { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) + } + + to { + -webkit-transform: translateZ(0); + transform: translateZ(0) + } +} + +.weui-animate-slide-up { + -webkit-animation: a ease .3s forwards; + animation: a ease .3s forwards +} + +@-webkit-keyframes b { + 0% { + -webkit-transform: translateZ(0); + transform: translateZ(0) + } + + to { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) + } +} + +@keyframes b { + 0% { + -webkit-transform: translateZ(0); + transform: translateZ(0) + } + + to { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) + } +} + +.weui-animate-slide-down { + -webkit-animation: b ease .3s forwards; + animation: b ease .3s forwards +} + +@-webkit-keyframes c { + 0% { + opacity: 0 + } + + to { + opacity: 1 + } +} + +@keyframes c { + 0% { + opacity: 0 + } + + to { + opacity: 1 + } +} + +.weui-animate-fade-in { + -webkit-animation: c ease .3s forwards; + animation: c ease .3s forwards +} + +@-webkit-keyframes d { + 0% { + opacity: 1 + } + + to { + opacity: 0 + } +} + +@keyframes d { + 0% { + opacity: 1 + } + + to { + opacity: 0 + } +} + +.weui-animate-fade-out { + -webkit-animation: d ease .3s forwards; + animation: d ease .3s forwards +} + +.weui-agree { + display: block; + padding: 8px 15px 0; + font-size: 14px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.weui-agree a, +.weui-agree navigator { + color: var(--weui-LINK) +} + +.weui-agree navigator { + display: inline +} + +.weui-agree__text { + color: var(--weui-FG-1); + margin-left: 2px +} + +.weui-agree__checkbox { + -webkit-appearance: none; + appearance: none; + display: inline-block; + border: 0; + outline: 0; + vertical-align: middle; + background-color: currentColor; + -webkit-mask-position: 0 0; + mask-position: 0 0; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: 100%; + mask-size: 100%; + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%221000%22%20height%3D%221000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M500%20916.667C269.881%20916.667%2083.333%20730.119%2083.333%20500%2083.333%20269.881%20269.881%2083.333%20500%2083.333c230.119%200%20416.667%20186.548%20416.667%20416.667%200%20230.119-186.548%20416.667-416.667%20416.667zm0-50c202.504%200%20366.667-164.163%20366.667-366.667%200-202.504-164.163-366.667-366.667-366.667-202.504%200-366.667%20164.163-366.667%20366.667%200%20202.504%20164.163%20366.667%20366.667%20366.667z%22%20fill-rule%3D%22evenodd%22%20fill-opacity%3D%22.9%22%2F%3E%3C%2Fsvg%3E); + color: var(--weui-FG-2); + width: 1em; + height: 1em; + font-size: 17px; + margin-top: -.2em +} + +.weui-agree__checkbox-check { + position: absolute; + left: -9999px +} + +.weui-agree__checkbox-check[aria-checked=true]+.weui-agree__checkbox, +.weui-agree__checkbox:checked { + -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E); + color: var(--weui-BRAND) +} + +.weui-agree_animate { + -webkit-animation: e .3s 1; + animation: e .3s 1 +} + +@-webkit-keyframes e { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0) + } + + 16% { + -webkit-transform: translateX(-8px); + transform: translateX(-8px) + } + + 28% { + -webkit-transform: translateX(-16px); + transform: translateX(-16px) + } + + 44% { + -webkit-transform: translateX(0); + transform: translateX(0) + } + + 59% { + -webkit-transform: translateX(-16px); + transform: translateX(-16px) + } + + 73% { + -webkit-transform: translateX(0); + transform: translateX(0) + } + + 82% { + -webkit-transform: translateX(16px); + transform: translateX(16px) + } + + 94% { + -webkit-transform: translateX(8px); + transform: translateX(8px) + } + + to { + -webkit-transform: translateX(0); + transform: translateX(0) + } +} + +@keyframes e { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0) + } + + 16% { + -webkit-transform: translateX(-8px); + transform: translateX(-8px) + } + + 28% { + -webkit-transform: translateX(-16px); + transform: translateX(-16px) + } + + 44% { + -webkit-transform: translateX(0); + transform: translateX(0) + } + + 59% { + -webkit-transform: translateX(-16px); + transform: translateX(-16px) + } + + 73% { + -webkit-transform: translateX(0); + transform: translateX(0) + } + + 82% { + -webkit-transform: translateX(16px); + transform: translateX(16px) + } + + 94% { + -webkit-transform: translateX(8px); + transform: translateX(8px) + } + + to { + -webkit-transform: translateX(0); + transform: translateX(0) + } +} + +.weui-loading { + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + -webkit-animation: f 1s steps(12) infinite; + animation: f 1s steps(12) infinite; + background: transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat; + background-size: 100% +} + +.weui-btn_loading.weui-btn_primary .weui-loading, +.weui-loading.weui-loading_transparent { + background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") +} + +@-webkit-keyframes f { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg) + } + + to { + -webkit-transform: rotate(1turn); + transform: rotate(1turn) + } +} + +@keyframes f { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg) + } + + to { + -webkit-transform: rotate(1turn); + transform: rotate(1turn) + } +} + +.weui-slider { + padding: 15px 18px; + -webkit-user-select: none; + user-select: none +} + +.weui-slider__inner { + position: relative; + height: 2px; + background-color: var(--weui-FG-3) +} + +.weui-slider__track { + height: 2px; + background-color: var(--weui-BRAND); + width: 0 +} + +.weui-slider__handler { + position: absolute; + left: 0; + top: 50%; + width: 28px; + height: 28px; + margin-left: -14px; + margin-top: -14px; + border-radius: 50%; + background-color: #fff; + box-shadow: 0 0 4px var(--weui-FG-3) +} + +.weui-slider-box { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-slider-box .weui-slider { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1 +} + +.weui-slider-box__value { + margin-left: .5em; + min-width: 24px; + color: var(--weui-FG-1); + text-align: center; + font-size: 14px +} + +.wx_dot_loading, +.wx_dot_loading:after, +.wx_dot_loading:before { + display: inline-block; + vertical-align: middle; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: rgba(0, 0, 0, .3); + font-size: 0; + -webkit-animation: h 1.6s step-start infinite; + animation: h 1.6s step-start infinite +} + +.wx_dot_loading { + position: relative +} + +.wx_dot_loading:before { + content: ""; + position: absolute; + left: -12px; + background-color: rgba(0, 0, 0, .1); + -webkit-animation: g 1.6s step-start infinite; + animation: g 1.6s step-start infinite +} + +.wx_dot_loading:after { + content: ""; + position: absolute; + right: -12px; + background-color: rgba(0, 0, 0, .5); + -webkit-animation: i 1.6s step-start infinite; + animation: i 1.6s step-start infinite +} + +@-webkit-keyframes g { + + 0%, + to { + background-color: rgba(0, 0, 0, .1) + } + + 30% { + background-color: rgba(0, 0, 0, .5) + } + + 60% { + background-color: rgba(0, 0, 0, .3) + } +} + +@keyframes g { + + 0%, + to { + background-color: rgba(0, 0, 0, .1) + } + + 30% { + background-color: rgba(0, 0, 0, .5) + } + + 60% { + background-color: rgba(0, 0, 0, .3) + } +} + +@-webkit-keyframes h { + + 0%, + to { + background-color: rgba(0, 0, 0, .3) + } + + 30% { + background-color: rgba(0, 0, 0, .1) + } + + 60% { + background-color: rgba(0, 0, 0, .5) + } +} + +@keyframes h { + + 0%, + to { + background-color: rgba(0, 0, 0, .3) + } + + 30% { + background-color: rgba(0, 0, 0, .1) + } + + 60% { + background-color: rgba(0, 0, 0, .5) + } +} + +@-webkit-keyframes i { + + 0%, + to { + background-color: rgba(0, 0, 0, .5) + } + + 30% { + background-color: rgba(0, 0, 0, .3) + } + + 60% { + background-color: rgba(0, 0, 0, .1) + } +} + +@keyframes i { + + 0%, + to { + background-color: rgba(0, 0, 0, .5) + } + + 30% { + background-color: rgba(0, 0, 0, .3) + } + + 60% { + background-color: rgba(0, 0, 0, .1) + } +} + +.wx_dot_loading_white { + background-color: hsla(0, 0%, 100%, .3); + -webkit-animation: k 1.6s step-start infinite; + animation: k 1.6s step-start infinite +} + +.wx_dot_loading_white:before { + background-color: hsla(0, 0%, 100%, .5); + -webkit-animation: j 1.6s step-start infinite; + animation: j 1.6s step-start infinite +} + +.wx_dot_loading_white:after { + background-color: hsla(0, 0%, 100%, .1); + -webkit-animation: l 1.6s step-start infinite; + animation: l 1.6s step-start infinite +} + +@-webkit-keyframes j { + + 0%, + to { + background-color: hsla(0, 0%, 100%, .5) + } + + 30% { + background-color: hsla(0, 0%, 100%, .1) + } + + 60% { + background-color: hsla(0, 0%, 100%, .3) + } +} + +@keyframes j { + + 0%, + to { + background-color: hsla(0, 0%, 100%, .5) + } + + 30% { + background-color: hsla(0, 0%, 100%, .1) + } + + 60% { + background-color: hsla(0, 0%, 100%, .3) + } +} + +@-webkit-keyframes k { + + 0%, + to { + background-color: hsla(0, 0%, 100%, .3) + } + + 30% { + background-color: hsla(0, 0%, 100%, .5) + } + + 60% { + background-color: hsla(0, 0%, 100%, .1) + } +} + +@keyframes k { + + 0%, + to { + background-color: hsla(0, 0%, 100%, .3) + } + + 30% { + background-color: hsla(0, 0%, 100%, .5) + } + + 60% { + background-color: hsla(0, 0%, 100%, .1) + } +} + +@-webkit-keyframes l { + + 0%, + to { + background-color: hsla(0, 0%, 100%, .1) + } + + 30% { + background-color: hsla(0, 0%, 100%, .3) + } + + 60% { + background-color: hsla(0, 0%, 100%, .5) + } +} + +@keyframes l { + + 0%, + to { + background-color: hsla(0, 0%, 100%, .1) + } + + 30% { + background-color: hsla(0, 0%, 100%, .3) + } + + 60% { + background-color: hsla(0, 0%, 100%, .5) + } +} + +:host { + width: 100% +} + +.weui-slideview { + position: relative; + overflow: hidden +} + +.weui-slideview__left { + position: relative; + z-index: 10 +} + +.weui-slideview__right { + position: absolute; + z-index: 1; + left: 100%; + top: 0; + height: 100% +} + +.weui-slideview__btn__wrp { + position: absolute; + left: 0; + bottom: 0; + text-align: center; + min-width: 69px; + height: 100%; + white-space: nowrap +} + +.weui-slideview__btn { + color: #fff; + padding: 0 17px +} + +.weui-slideview__btn-group_default .weui-slideview__btn { + background: #c7c7cc +} + +@media(prefers-color-scheme: dark) { + .weui-slideview__btn-group_default .weui-slideview__btn { + background: var(--weui-BG-4) + } +} + +.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid #fff; + color: #fff; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +@media(prefers-color-scheme: dark) { + .weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before { + border-left-color: var(--weui-FG-3) + } +} + +.weui-slideview__btn-group_default:first-child:before { + display: none +} + +.weui-slideview__btn-group_warn .weui-slideview__btn { + background: #fe3b30 +} + +.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before { + content: " "; + position: absolute; + left: 0; + top: 0; + width: 1px; + bottom: 0; + border-left: 1px solid #fff; + color: #fff; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + -webkit-transform: scaleX(.5); + transform: scaleX(.5) +} + +.weui-slideview__btn-group_warn:first-child:before { + display: none +} + +.weui-slideview_icon .weui-slideview__btn__wrp { + background: transparent; + font-size: 0 +} + +.weui-slideview_icon .weui-slideview__btn__wrp:first-child { + padding-left: 16px +} + +.weui-slideview_icon .weui-slideview__btn__wrp:last-child { + padding-right: 8px +} + +.weui-slideview_icon .weui-slideview__btn { + width: 48px; + height: 48px; + line-height: 48px; + padding: 0; + display: inline-block; + vertical-align: middle; + border-radius: 50%; + background-color: #fff +} + +@media(prefers-color-scheme: dark) { + .weui-slideview_icon .weui-slideview__btn { + background-color: var(--weui-BG-4) + } +} + +.weui-slideview_icon .weui-slideview__btn__icon { + display: inline-block; + vertical-align: middle; + width: 22px; + height: 22px +} + +page { + --height: 44px; + --right: 190rpx +} + +.weui-navigation-bar { + overflow: hidden; + color: var(--weui-FG-0) +} + +.weui-navigation-bar .android { + --height: 48px; + --right: 222rpx +} + +.weui-navigation-bar__inner { + position: fixed; + top: 0; + left: 0; + z-index: 5001; + height: var(--height); + padding-right: var(--right); + width: calc(100% - var(--right)) +} + +.weui-navigation-bar__inner, +.weui-navigation-bar__inner .weui-navigation-bar__left { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-navigation-bar__inner .weui-navigation-bar__left { + position: relative; + width: var(--right); + padding-left: 16px +} + +.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn { + display: inline-block; + vertical-align: middle; + background-repeat: no-repeat +} + +.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback { + font-size: 12px; + width: 1em; + height: 2em; + -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%; + -webkit-mask-size: cover; + mask-size: cover; + background-color: currentColor +} + +.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active { + opacity: .5 +} + +.weui-navigation-bar__inner .weui-navigation-bar__center { + font-size: 17px; + text-align: center; + position: relative; + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center +} + +.weui-navigation-bar__inner .weui-navigation-bar__loading { + margin-right: 4px; + font-size: 0 +} + +.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading { + margin-left: 0 +} + +.weui-navigation-bar__inner .weui-navigation-bar__right { + margin-right: 16px +} + +.weui-navigation-bar__placeholder { + height: var(--height); + background: var(--weui-BG-1); + position: relative; + z-index: 50 +} + +.weui-uploader__hd { + display: block +} + +.weui-uploader__overview { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center +} + +.weui-uploader__tips { + color: var(--weui-FG-2); + font-size: 14px; + line-height: 1.4; + padding-top: 4px +} + +.weui-uploader__img { + display: block; + width: 100%; + height: 100% +} + +.weui-gallery { + display: -webkit-box; + display: -webkit-flex; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-flex-wrap: nowrap; + flex-wrap: nowrap +} + +.weui-gallery__info { + color: #fff; + font-size: 17px; + line-height: 60px; + min-height: 60px; + text-align: center +} + +.weui-gallery__img__wrp { + -webkit-box-flex: 1; + -webkit-flex: 1; + flex: 1; + position: relative; + font-size: 0 +} + +.weui-gallery__img { + position: absolute; + width: 100%; + height: 100% +} + +.weui-gallery__opr { + position: static +} + +.weui-search-bar .weui-search-bar__box .weui-search-bar__input { + height: inherit; + line-height: inherit +} + +.weui-search-bar .weui-search-bar__box .weui-icon-clear { + display: block +} + +.weui-loadmore .weui-loading { + margin-right: .3em +} + +.weui-btn_input-clear { + display: block +} \ No newline at end of file diff --git a/miniprogram/config.js b/miniprogram/config.js index 553482be..0f249e4e 100644 --- a/miniprogram/config.js +++ b/miniprogram/config.js @@ -37,13 +37,13 @@ const config = { uploadFileUrl: `https://${host}/upload`, // 下载示例图片接口 - downloadExampleUrl: `https://${host}/static/weapp.jpg`, + downloadExampleUrl: 'cloud://release-b86096.7265-release-b86096-1258211818/demo.jpg', // 云开发环境 ID envId: 'release-b86096', // 云开发-存储 示例文件的文件 ID - demoImageFileId: 'cloud://release-b86096.7265-release-b86096/demo.jpg', + demoImageFileId: 'cloud://release-b86096.7265-release-b86096-1258211818/demo.jpg', demoVideoFileId: 'cloud://release-b86096.7265-release-b86096/demo.mp4', } diff --git a/miniprogram/demo.theme.json b/miniprogram/demo.theme.json new file mode 100644 index 00000000..bfa22242 --- /dev/null +++ b/miniprogram/demo.theme.json @@ -0,0 +1,40 @@ +{ + "light": { + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#F7F7F7", + "backgroundColor": "#F7F7F7", + + "tabBarColor": "#7A7E83", + "tabBarSelectedColor": "#3cc51f", + "tabBarBorderStyle": "black", + "tabBarBackgroundColor": "#F7F7F7", + + "iconPathComponent": "image/icon_component.png", + "selectedIconPathComponent": "image/icon_component_HL.png", + "iconPathAPI": "image/icon_API.png", + "selectedIconPathAPI": "image/icon_API_HL.png", + "iconPathCloud": "image/icon_cloud.png", + "selectedIconPathCloud": "image/icon_cloud_HL.png", + + "backgroundTextStyle": "dark" + }, + "dark": { + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#1F1F1F", + "backgroundColor": "#1F1F1F", + + "tabBarColor": "#FFFFFFCC", + "tabBarSelectedColor": "#51A937", + "tabBarBorderStyle": "white", + "tabBarBackgroundColor": "#1F1F1F", + + "iconPathComponent": "image/icon_component_dark.png", + "selectedIconPathComponent": "image/icon_component_HL.png", + "iconPathAPI": "image/icon_API_dark.png", + "selectedIconPathAPI": "image/icon_API_HL.png", + "iconPathCloud": "image/icon_cloud_dark.png", + "selectedIconPathCloud": "image/icon_cloud_HL.png", + + "backgroundTextStyle": "light" + } +} \ No newline at end of file diff --git a/miniprogram/image/icon_API_HL.png b/miniprogram/image/icon_API_HL.png index 5b7ae94b..6fa3707f 100644 Binary files a/miniprogram/image/icon_API_HL.png and b/miniprogram/image/icon_API_HL.png differ diff --git a/miniprogram/image/icon_API_dark.png b/miniprogram/image/icon_API_dark.png new file mode 100644 index 00000000..7b8f2e25 Binary files /dev/null and b/miniprogram/image/icon_API_dark.png differ diff --git a/miniprogram/image/icon_cloud_dark.png b/miniprogram/image/icon_cloud_dark.png new file mode 100644 index 00000000..d30fc6f9 Binary files /dev/null and b/miniprogram/image/icon_cloud_dark.png differ diff --git a/miniprogram/image/icon_component_dark.png b/miniprogram/image/icon_component_dark.png new file mode 100644 index 00000000..12285204 Binary files /dev/null and b/miniprogram/image/icon_component_dark.png differ diff --git a/miniprogram/image/plus_dark.png b/miniprogram/image/plus_dark.png new file mode 100644 index 00000000..b9bb6833 Binary files /dev/null and b/miniprogram/image/plus_dark.png differ diff --git a/miniprogram/miniprogram_npm/eventemitter3/index.js b/miniprogram/miniprogram_npm/eventemitter3/index.js new file mode 100644 index 00000000..3ea05841 --- /dev/null +++ b/miniprogram/miniprogram_npm/eventemitter3/index.js @@ -0,0 +1,348 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1591242034685, function(require, module, exports) { + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1591242034685); +})() +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/eventemitter3/index.js.map b/miniprogram/miniprogram_npm/eventemitter3/index.js.map new file mode 100644 index 00000000..4f2cb7b6 --- /dev/null +++ b/miniprogram/miniprogram_npm/eventemitter3/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n"]} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.js b/miniprogram/miniprogram_npm/miniprogram-barrage/index.js new file mode 100644 index 00000000..06cbf7bb --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.js @@ -0,0 +1,1368 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 1); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// 获取字节长度,中文算2个字节 +function getStrLen(str) { + // eslint-disable-next-line no-control-regex + return str.replace(/[^\x00-\xff]/g, 'aa').length; +} + +// 截取指定字节长度的子串 +function substring(str, n) { + if (!str) return ''; + + var len = getStrLen(str); + if (n >= len) return str; + + var l = 0; + var result = ''; + for (var i = 0; i < str.length; i++) { + var ch = str.charAt(i); + // eslint-disable-next-line no-control-regex + l = /[^\x00-\xff]/i.test(ch) ? l + 2 : l + 1; + result += ch; + if (l >= n) break; + } + return result; +} + +function getRandom() { + var max = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10; + var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + return Math.floor(Math.random() * (max - min) + min); +} + +function getFontSize(font) { + var reg = /(\d+)(px)/i; + var match = font.match(reg); + return match && match[1] || 10; +} + +function compareVersion(v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + var len = Math.max(v1.length, v2.length); + + while (v1.length < len) { + v1.push('0'); + } + while (v2.length < len) { + v2.push('0'); + } + + for (var i = 0; i < len; i++) { + var num1 = parseInt(v1[i], 10); + var num2 = parseInt(v2[i], 10); + + if (num1 > num2) { + return 1; + } else if (num1 < num2) { + return -1; + } + } + return 0; +} + +module.exports = { + getStrLen: getStrLen, + substring: substring, + getRandom: getRandom, + getFontSize: getFontSize, + compareVersion: compareVersion +}; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _barrageDom = __webpack_require__(2); + +var _barrageDom2 = _interopRequireDefault(_barrageDom); + +var _barrageCanvas = __webpack_require__(3); + +var _barrageCanvas2 = _interopRequireDefault(_barrageCanvas); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +Component({ + options: { + addGlobalClass: true + }, + + properties: { + zIndex: { + type: Number, + value: 10 + }, + + renderingMode: { + type: String, + value: 'canvas' + } + }, + + methods: { + getBarrageInstance: function getBarrageInstance() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + opt.comp = this; + this.barrageInstance = this.data.renderingMode === 'dom' ? new _barrageDom2.default(opt) : new _barrageCanvas2.default(opt); + return this.barrageInstance; + }, + onAnimationend: function onAnimationend(e) { + var _e$currentTarget$data = e.currentTarget.dataset, + tunnelid = _e$currentTarget$data.tunnelid, + bulletid = _e$currentTarget$data.bulletid; + + this.barrageInstance.animationend({ + tunnelId: tunnelid, + bulletId: bulletid + }); + }, + onTapBullet: function onTapBullet(e) { + var _e$currentTarget$data2 = e.currentTarget.dataset, + tunnelid = _e$currentTarget$data2.tunnelid, + bulletid = _e$currentTarget$data2.bulletid; + + this.barrageInstance.tapBullet({ + tunnelId: tunnelid, + bulletId: bulletid + }); + } + } +}); + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _require = __webpack_require__(0), + substring = _require.substring, + getRandom = _require.getRandom, + getFontSize = _require.getFontSize; + +var Bullet = function () { + function Bullet() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Bullet); + + this.bulletId = opt.bulletId; + this.addContent(opt); + } + + /** + * image 结构 + * { + * head: {src, width, height}, + * tail: {src, width, height}, + * gap: 4 // 图片与文本间隔 + * } + */ + + + Bullet.prototype.addContent = function addContent() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var defaultBulletOpt = { + duration: 0, // 动画时长 + passtime: 0, // 弹幕穿越右边界耗时 + content: '', // 文本 + color: '#000000', // 默认黑色 + width: 0, // 弹幕宽度 + height: 0, // 弹幕高度 + image: {}, // 图片 + paused: false // 是否暂停 + }; + Object.assign(this, defaultBulletOpt, opt); + }; + + Bullet.prototype.removeContent = function removeContent() { + this.addContent({}); + }; + + return Bullet; +}(); + +// tunnel(轨道) + + +var Tunnel = function () { + function Tunnel() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Tunnel); + + var defaultTunnelOpt = { + tunnelId: 0, + height: 0, // 轨道高度 + width: 0, // 轨道宽度 + safeGap: 4, // 相邻弹幕安全间隔 + maxNum: 10, // 缓冲队列长度 + bullets: [], // 弹幕 + last: -1, // 上一条发送的弹幕序号 + bulletStatus: [], // 0 空闲,1 占用中 + disabled: false, // 禁用中 + sending: false, // 弹幕正在发送 + timer: null // 定时器 + }; + Object.assign(this, defaultTunnelOpt, opt); + this.bulletStatus = new Array(this.maxNum).fill(0); + for (var i = 0; i < this.maxNum; i++) { + this.bullets.push(new Bullet({ + bulletId: i + })); + } + } + + Tunnel.prototype.disable = function disable() { + this.disabled = true; + this.last = -1; + this.sending = false; + this.bulletStatus = new Array(this.maxNum).fill(1); + this.bullets.forEach(function (bullet) { + return bullet.removeContent(); + }); + }; + + Tunnel.prototype.enable = function enable() { + if (this.disabled) { + this.bulletStatus = new Array(this.maxNum).fill(0); + } + this.disabled = false; + }; + + Tunnel.prototype.clear = function clear() { + this.last = -1; + this.sending = false; + this.bulletStatus = new Array(this.maxNum).fill(0); + this.bullets.forEach(function (bullet) { + return bullet.removeContent(); + }); + if (this.timer) { + clearTimeout(this.timer); + } + }; + + Tunnel.prototype.getIdleBulletIdx = function getIdleBulletIdx() { + var idle = this.bulletStatus.indexOf(0, this.last + 1); + if (idle === -1) { + idle = this.bulletStatus.indexOf(0); + } + + return idle; + }; + + Tunnel.prototype.getIdleBulletNum = function getIdleBulletNum() { + var count = 0; + this.bulletStatus.forEach(function (status) { + if (status === 0) count++; + }); + return count; + }; + + Tunnel.prototype.addBullet = function addBullet(opt) { + if (this.disabled) return; + var idx = this.getIdleBulletIdx(); + if (idx >= 0) { + this.bulletStatus[idx] = 1; + this.bullets[idx].addContent(opt); + } + }; + + Tunnel.prototype.removeBullet = function removeBullet(bulletId) { + if (this.disabled) return; + this.bulletStatus[bulletId] = 0; + var bullet = this.bullets[bulletId]; + bullet.removeContent(); + }; + + return Tunnel; +}(); + +// Barrage(控制中心) + + +var Barrage = function () { + function Barrage() { + var _this = this; + + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Barrage); + + var defaultBarrageOpt = { + duration: 10, // 弹幕动画时长 + lineHeight: 1.2, // 弹幕行高 + padding: [0, 0, 0, 0], // 弹幕区四周留白 + alpha: 1, // 全局透明度 + font: '10px sans-serif', // 全局字体 + mode: 'separate', // 弹幕重叠 overlap 不重叠 separate + range: [0, 1], // 弹幕显示的垂直范围,支持两个值。[0,1]表示弹幕整个随机分布, + tunnelShow: false, // 显示轨道线 + tunnelMaxNum: 30, // 隧道最大缓冲长度 + maxLength: 30, // 弹幕最大字节长度,汉字算双字节 + safeGap: 4, // 发送时的安全间隔 + enableTap: false, // 点击弹幕停止动画高亮显示 + tunnelHeight: 0, + tunnelNum: 0, + tunnels: [], + idleTunnels: null, + enableTunnels: null, + distance: 2000, + comp: null // 组件实例 + }; + Object.assign(this, defaultBarrageOpt, opt); + this._ready = false; + this._deferred = []; + + var query = this.comp.createSelectorQuery(); + query.select('.barrage-area').boundingClientRect(function (res) { + _this.init(res); + _this.ready(); + }).exec(); + } + + Barrage.prototype.ready = function ready() { + var _this2 = this; + + this._ready = true; + this._deferred.forEach(function (item) { + // eslint-disable-next-line prefer-spread + _this2[item.callback].apply(_this2, item.args); + }); + + this._deferred = []; + }; + + Barrage.prototype._delay = function _delay(method, args) { + this._deferred.push({ + callback: method, + args: args + }); + }; + + Barrage.prototype.init = function init(opt) { + this.width = opt.width; + this.height = opt.height; + this.fontSize = getFontSize(this.font); + this.idleTunnels = new Set(); + this.enableTunnels = new Set(); + this.tunnels = []; + this.availableHeight = this.height - this.padding[0] - this.padding[2]; + this.tunnelHeight = this.fontSize * this.lineHeight; + this.tunnelNum = Math.floor(this.availableHeight / this.tunnelHeight); + for (var i = 0; i < this.tunnelNum; i++) { + this.idleTunnels.add(i); // 空闲的隧道id集合 + this.enableTunnels.add(i); // 可用的隧道id集合 + + this.tunnels.push(new Tunnel({ // 隧道集合 + width: this.width, + height: this.tunnelHeight, + safeGap: this.safeGap, + maxNum: this.tunnelMaxNum, + tunnelId: i + })); + } + this.comp.setData({ + fontSize: this.fontSize, + tunnelShow: this.tunnelShow, + tunnels: this.tunnels, + font: this.font, + alpha: this.alpha, + padding: this.padding.map(function (item) { + return item + 'px'; + }).join(' ') + }); + // 筛选符合范围的隧道 + this.setRange(); + }; + + // 设置显示范围 range: [0,1] + + + Barrage.prototype.setRange = function setRange(range) { + var _this3 = this; + + if (!this._ready) { + this._delay('setRange', range); + return; + } + + range = range || this.range; + var top = range[0] * this.tunnelNum; + var bottom = range[1] * this.tunnelNum; + // 释放符合要求的隧道 + // 找到目前空闲的隧道 + var idleTunnels = new Set(); + var enableTunnels = new Set(); + this.tunnels.forEach(function (tunnel, tunnelId) { + if (tunnelId >= top && tunnelId < bottom) { + var disabled = tunnel.disabled; + tunnel.enable(); + enableTunnels.add(tunnelId); + + if (disabled || _this3.idleTunnels.has(tunnelId)) { + idleTunnels.add(tunnelId); + } + } else { + tunnel.disable(); + } + }); + this.idleTunnels = idleTunnels; + this.enableTunnels = enableTunnels; + this.range = range; + this.comp.setData({ tunnels: this.tunnels }); + }; + + Barrage.prototype.setFont = function setFont(font) { + if (!this._ready) { + this._delay('setFont', font); + return; + } + + if (typeof font !== 'string') return; + this.font = font; + this.comp.setData({ font: font }); + }; + + Barrage.prototype.setAlpha = function setAlpha(alpha) { + if (!this._ready) { + this._delay('setAlpha', alpha); + return; + } + + if (typeof alpha !== 'number') return; + this.alpha = alpha; + this.comp.setData({ alpha: alpha }); + }; + + Barrage.prototype.setDuration = function setDuration(duration) { + if (!this._ready) { + this._delay('setDuration', duration); + return; + } + + if (typeof duration !== 'number') return; + this.duration = duration; + this.clear(); + }; + + // 开启弹幕 + + + Barrage.prototype.open = function open() { + if (!this._ready) { + this._delay('open'); + return; + } + + this._isActive = true; + }; + + // 关闭弹幕,清除所有数据 + + + Barrage.prototype.close = function close() { + if (!this._ready) { + this._delay('close'); + return; + } + + this._isActive = false; + this.clear(); + }; + + Barrage.prototype.clear = function clear() { + this.tunnels.forEach(function (tunnel) { + return tunnel.clear(); + }); + this.idleTunnels = new Set(this.enableTunnels); + this.comp.setData({ tunnels: this.tunnels }); + }; + + // 添加一批弹幕,轨道满时会被丢弃 + + + Barrage.prototype.addData = function addData() { + var _this4 = this; + + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if (!this._ready) { + this._delay('addData', data); + return; + } + + if (!this._isActive) return; + + data.forEach(function (item) { + item.content = substring(item.content, _this4.maxLength); + _this4.addBullet2Tunnel(item); + }); + this.comp.setData({ + tunnels: this.tunnels + }, function () { + _this4.updateBullets(); + }); + }; + + // 发送一条弹幕 + + + Barrage.prototype.send = function send() { + var _this5 = this; + + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + if (!this._ready) { + this._delay('send', opt); + return; + } + var tunnel = this.getEnableTunnel(); + if (tunnel === null) return; + + var timer = setInterval(function () { + var tunnel = _this5.getIdleTunnel(); + if (tunnel) { + _this5.addData([opt]); + clearInterval(timer); + } + }, 16); + }; + + // 添加至轨道 + + + Barrage.prototype.addBullet2Tunnel = function addBullet2Tunnel() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var tunnel = this.getIdleTunnel(); + if (tunnel === null) return; + + var tunnelId = tunnel.tunnelId; + tunnel.addBullet(opt); + if (tunnel.getIdleBulletNum() === 0) this.removeIdleTunnel(tunnelId); + }; + + Barrage.prototype.updateBullets = function updateBullets() { + var _this6 = this; + + var self = this; + var query = this.comp.createSelectorQuery(); + query.selectAll('.bullet-item').boundingClientRect(function (res) { + if (!_this6._isActive) return; + + for (var i = 0; i < res.length; i++) { + var _res$i$dataset = res[i].dataset, + tunnelid = _res$i$dataset.tunnelid, + bulletid = _res$i$dataset.bulletid; + + var tunnel = self.tunnels[tunnelid]; + var bullet = tunnel.bullets[bulletid]; + bullet.width = res[i].width; + bullet.height = res[i].height; + } + self.animate(); + }).exec(); + }; + + Barrage.prototype.animate = function animate() { + var _this7 = this; + + this.tunnels.forEach(function (tunnel) { + _this7.tunnelAnimate(tunnel); + }); + }; + + Barrage.prototype.tunnelAnimate = function tunnelAnimate(tunnel) { + var _this8 = this; + + if (tunnel.disabled || tunnel.sending || !this._isActive) return; + + var next = (tunnel.last + 1) % tunnel.maxNum; + var bullet = tunnel.bullets[next]; + + if (!bullet) return; + + if (bullet.content || bullet.image.head || bullet.image.tail) { + var _comp$setData; + + tunnel.sending = true; + tunnel.last = next; + var duration = this.duration; + if (this.mode === 'overlap') { + duration = this.distance * this.duration / (this.distance + bullet.width); + } + var passDistance = bullet.width + tunnel.safeGap; + bullet.duration = duration; + // 等上一条通过右边界 + bullet.passtime = Math.ceil(passDistance * bullet.duration * 1000 / this.distance); + this.comp.setData((_comp$setData = {}, _comp$setData['tunnels[' + tunnel.tunnelId + '].bullets[' + bullet.bulletId + ']'] = bullet, _comp$setData), function () { + tunnel.timer = setTimeout(function () { + tunnel.sending = false; + _this8.tunnelAnimate(tunnel); + }, bullet.passtime); + }); + } + }; + + Barrage.prototype.showTunnel = function showTunnel() { + this.comp.setData({ + tunnelShow: true + }); + }; + + Barrage.prototype.hideTunnel = function hideTunnel() { + this.comp.setData({ + tunnelShow: false + }); + }; + + Barrage.prototype.removeIdleTunnel = function removeIdleTunnel(tunnelId) { + this.idleTunnels.delete(tunnelId); + }; + + Barrage.prototype.addIdleTunnel = function addIdleTunnel(tunnelId) { + this.idleTunnels.add(tunnelId); + }; + + // 从可用的隧道中随机挑选一个 + + + Barrage.prototype.getEnableTunnel = function getEnableTunnel() { + if (this.enableTunnels.size === 0) return null; + var enableTunnels = Array.from(this.enableTunnels); + var index = getRandom(enableTunnels.length); + return this.tunnels[enableTunnels[index]]; + }; + + // 从还有余量的隧道中随机挑选一个 + + + Barrage.prototype.getIdleTunnel = function getIdleTunnel() { + if (this.idleTunnels.size === 0) return null; + var idleTunnels = Array.from(this.idleTunnels); + var index = getRandom(idleTunnels.length); + return this.tunnels[idleTunnels[index]]; + }; + + Barrage.prototype.animationend = function animationend(opt) { + var _comp$setData2; + + var tunnelId = opt.tunnelId, + bulletId = opt.bulletId; + + var tunnel = this.tunnels[tunnelId]; + var bullet = tunnel.bullets[bulletId]; + + if (!tunnel || !bullet) return; + + tunnel.removeBullet(bulletId); + this.addIdleTunnel(tunnelId); + this.comp.setData((_comp$setData2 = {}, _comp$setData2['tunnels[' + tunnelId + '].bullets[' + bulletId + ']'] = bullet, _comp$setData2)); + }; + + Barrage.prototype.tapBullet = function tapBullet(opt) { + var _comp$setData3; + + if (!this.enableTap) return; + + var tunnelId = opt.tunnelId, + bulletId = opt.bulletId; + + var tunnel = this.tunnels[tunnelId]; + var bullet = tunnel.bullets[bulletId]; + bullet.paused = !bullet.paused; + this.comp.setData((_comp$setData3 = {}, _comp$setData3['tunnels[' + tunnelId + '].bullets[' + bulletId + ']'] = bullet, _comp$setData3)); + }; + + return Barrage; +}(); + +exports.default = Barrage; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _utils = __webpack_require__(0); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Bullet = function () { + function Bullet(barrage) { + var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Bullet); + + var defaultBulletOpt = { + color: '#000000', // 默认黑色 + font: '10px sans-serif', + fontSize: 10, // 全局字体大小 + content: '', + textWidth: 0, + speed: 0, // 根据屏幕停留时长计算 + x: 0, + y: 0, + tunnelId: 0, + // image: { + // head: {src, width, height}, // 弹幕头部添加图片 + // tail: {src, width, height}, // 弹幕尾部添加图片 + // gap: 4 // 图片与文本间隔 + // } + image: {}, + imageHead: null, // Image 对象 + imageTail: null + // status: 0 //0:待播放 1: 未完全进入屏幕 2: 完全进入屏幕 3: 完全退出屏幕 + }; + Object.assign(this, defaultBulletOpt, opt); + + this.barrage = barrage; + this.ctx = barrage.ctx; + this.canvas = barrage.canvas; + } + + Bullet.prototype.move = function move() { + var _this = this; + + if (this.image.head && !this.imageHead) { + var Image = this.canvas.createImage(); + Image.src = this.image.head.src; + Image.onload = function () { + _this.imageHead = Image; + }; + Image.onerror = function () { + // eslint-disable-next-line no-console + console.log('Fail to load image: ' + _this.image.head.src); + }; + } + + if (this.image.tail && !this.imageTail) { + var _Image = this.canvas.createImage(); + _Image.src = this.image.tail.src; + _Image.onload = function () { + _this.imageTail = _Image; + }; + _Image.onerror = function () { + // eslint-disable-next-line no-console + console.log('Fail to load image: ' + _this.image.tail.src); + }; + } + + if (this.imageHead) { + var _image$head = this.image.head, + _image$head$width = _image$head.width, + width = _image$head$width === undefined ? this.fontSize : _image$head$width, + _image$head$height = _image$head.height, + height = _image$head$height === undefined ? this.fontSize : _image$head$height, + _image$head$gap = _image$head.gap, + gap = _image$head$gap === undefined ? 4 : _image$head$gap; + + var x = this.x - gap - width; + var y = this.y - 0.5 * height; + this.ctx.drawImage(this.imageHead, x, y, width, height); + } + + if (this.imageTail) { + var _image$tail = this.image.tail, + _image$tail$width = _image$tail.width, + _width = _image$tail$width === undefined ? this.fontSize : _image$tail$width, + _image$tail$height = _image$tail.height, + _height = _image$tail$height === undefined ? this.fontSize : _image$tail$height, + _image$tail$gap = _image$tail.gap, + _gap = _image$tail$gap === undefined ? 4 : _image$tail$gap; + + var _x2 = this.x + this.textWidth + _gap; + var _y = this.y - 0.5 * _height; + this.ctx.drawImage(this.imageTail, _x2, _y, _width, _height); + } + + this.x = this.x - this.speed; + this.ctx.fillStyle = this.color; + this.ctx.fillText(this.content, this.x, this.y); + }; + + return Bullet; +}(); + +// tunnel(轨道) + + +var Tunnel = function () { + function Tunnel(barrage) { + var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Tunnel); + + var defaultTunnelOpt = { + activeQueue: [], // 正在屏幕中列表 + nextQueue: [], // 待播放列表 + maxNum: 30, + freeNum: 30, // 剩余可添加量 + height: 0, + width: 0, + disabled: false, + tunnelId: 0, + safeArea: 4, + sending: false // 弹幕正在发送 + }; + Object.assign(this, defaultTunnelOpt, opt); + + this.freeNum = this.maxNum; + this.barrage = barrage; // 控制中心 + this.ctx = barrage.ctx; + } + + Tunnel.prototype.disable = function disable() { + this.disabled = true; + }; + + Tunnel.prototype.enable = function enable() { + this.disabled = false; + }; + + Tunnel.prototype.clear = function clear() { + this.activeQueue = []; + this.nextQueue = []; + this.sending = false; + this.freeNum = this.maxNum; + this.barrage.addIdleTunnel(this.tunnelId); + }; + + Tunnel.prototype.addBullet = function addBullet(bullet) { + if (this.disabled) return; + if (this.freeNum === 0) return; + this.nextQueue.push(bullet); + this.freeNum--; + if (this.freeNum === 0) { + this.barrage.removeIdleTunnel(this.tunnelId); + } + }; + + Tunnel.prototype.animate = function animate() { + if (this.disabled) return; + // 无正在发送弹幕,添加一条 + var nextQueue = this.nextQueue; + var activeQueue = this.activeQueue; + if (!this.sending && nextQueue.length > 0) { + var bullet = nextQueue.shift(); + activeQueue.push(bullet); + this.freeNum++; + this.sending = true; + this.barrage.addIdleTunnel(this.tunnelId); + } + + if (activeQueue.length > 0) { + activeQueue.forEach(function (bullet) { + return bullet.move(); + }); + var head = activeQueue[0]; + var tail = activeQueue[activeQueue.length - 1]; + // 队首移出屏幕 + if (head.x + head.textWidth < 0) { + activeQueue.shift(); + } + // 队尾离开超过安全区 + if (tail.x + tail.textWidth + this.safeArea < this.width) { + this.sending = false; + } + } + }; + + return Tunnel; +}(); + +var Barrage = function () { + function Barrage() { + var _this2 = this; + + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Barrage); + + var defaultBarrageOpt = { + font: '10px sans-serif', + duration: 15, // 弹幕屏幕停留时长 + lineHeight: 1.2, + padding: [0, 0, 0, 0], + tunnelHeight: 0, + tunnelNum: 0, + tunnelMaxNum: 30, // 隧道最大缓冲长度 + maxLength: 30, // 最大字节长度,汉字算双字节 + safeArea: 4, // 发送时的安全间隔 + tunnels: [], + idleTunnels: [], + enableTunnels: [], + alpha: 1, // 全局透明度 + mode: 'separate', // 弹幕重叠 overlap 不重叠 separate + range: [0, 1], // 弹幕显示的垂直范围,支持两个值。[0,1]表示弹幕整个随机分布, + fps: 60, // 刷新率 + tunnelShow: false, // 显示轨道线 + comp: null // 组件实例 + }; + Object.assign(this, defaultBarrageOpt, opt); + var systemInfo = wx.getSystemInfoSync(); + this.ratio = systemInfo.pixelRatio; + this.selector = '#weui-canvas'; + this._ready = false; + this._deferred = []; + + var query = this.comp.createSelectorQuery(); + query.select(this.selector).boundingClientRect(); + query.select(this.selector).node(); + query.exec(function (res) { + _this2.canvas = res[1].node; + _this2.init(res[0]); + _this2.ready(); + }); + } + + Barrage.prototype.ready = function ready() { + var _this3 = this; + + this._ready = true; + this._deferred.forEach(function (item) { + // eslint-disable-next-line prefer-spread + _this3[item.callback].apply(_this3, item.args); + }); + + this._deferred = []; + }; + + Barrage.prototype._delay = function _delay(method, args) { + this._deferred.push({ + callback: method, + args: args + }); + }; + + Barrage.prototype.init = function init() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.width = opt.width; + this.height = opt.height; + this.fontSize = (0, _utils.getFontSize)(this.font); + this.innerDuration = this.transfromDuration2Canvas(this.duration); + + var ratio = this.ratio; // 设备像素比 + this.canvas.width = this.width * ratio; + this.canvas.height = this.height * ratio; + this.ctx = this.canvas.getContext('2d'); + this.ctx.scale(ratio, ratio); + + this.ctx.textBaseline = 'middle'; + this.ctx.globalAlpha = this.alpha; + this.ctx.font = this.font; + + this.idleTunnels = []; + this.enableTunnels = []; + this.tunnels = []; + + this.availableHeight = this.height - this.padding[0] - this.padding[2]; + this.tunnelHeight = this.fontSize * this.lineHeight; + this.tunnelNum = Math.floor(this.availableHeight / this.tunnelHeight); + for (var i = 0; i < this.tunnelNum; i++) { + this.idleTunnels.push(i); // 空闲的隧道id集合 + this.enableTunnels.push(i); // 可用的隧道id集合 + this.tunnels.push(new Tunnel(this, { // 隧道集合 + width: this.width, + height: this.tunnelHeight, + safeArea: this.safeArea, + maxNum: this.tunnelMaxNum, + tunnelId: i + })); + } + // 筛选符合范围的隧道 + this.setRange(); + this._isActive = false; + }; + + Barrage.prototype.transfromDuration2Canvas = function transfromDuration2Canvas(duration) { + // 2000 是 dom 中移动的距离 + return duration * this.width / 2000; + }; + + // 设置显示范围 range: [0,1] + + + Barrage.prototype.setRange = function setRange(range) { + var _this4 = this; + + if (!this._ready) { + this._delay('setRange', range); + return; + } + + range = range || this.range; + var top = range[0] * this.tunnelNum; + var bottom = range[1] * this.tunnelNum; + + // 释放符合要求的隧道 + // 找到目前空闲的隧道 + var idleTunnels = []; + var enableTunnels = []; + this.tunnels.forEach(function (tunnel, tunnelId) { + if (tunnelId >= top && tunnelId < bottom) { + tunnel.enable(); + enableTunnels.push(tunnelId); + if (_this4.idleTunnels.indexOf(tunnelId) >= 0) { + idleTunnels.push(tunnelId); + } + } else { + tunnel.disable(); + } + }); + this.idleTunnels = idleTunnels; + this.enableTunnels = enableTunnels; + this.range = range; + }; + + Barrage.prototype.setFont = function setFont(font) { + if (!this._ready) { + this._delay('setFont', font); + return; + } + + this.font = font; + this.fontSize = (0, _utils.getFontSize)(this.font); + this.ctx.font = font; + }; + + Barrage.prototype.setAlpha = function setAlpha(alpha) { + if (!this._ready) { + this._delay('setAlpha', alpha); + return; + } + + this.alpha = alpha; + this.ctx.globalAlpha = alpha; + }; + + Barrage.prototype.setDuration = function setDuration(duration) { + if (!this._ready) { + this._delay('setDuration', duration); + return; + } + + this.clear(); + this.duration = duration; + this.innerDuration = this.transfromDuration2Canvas(duration); + }; + + // 开启弹幕 + + + Barrage.prototype.open = function open() { + if (!this._ready) { + this._delay('open'); + return; + } + + if (this._isActive) return; + this._isActive = true; + this.play(); + }; + + // 关闭弹幕,清除所有数据 + + + Barrage.prototype.close = function close() { + if (!this._ready) { + this._delay('close'); + return; + } + + if (!this._isActive) return; + this._isActive = false; + this.pause(); + this.clear(); + }; + + // 开启弹幕滚动 + + + Barrage.prototype.play = function play() { + var _this5 = this; + + this._rAFId = this.canvas.requestAnimationFrame(function () { + _this5.animate(); + _this5.play(); + }); + }; + + // 停止弹幕滚动 + + + Barrage.prototype.pause = function pause() { + if (typeof this._rAFId === 'number') { + this.canvas.cancelAnimationFrame(this._rAFId); + } + }; + + // 清空屏幕和缓冲的数据 + + + Barrage.prototype.clear = function clear() { + this.ctx.clearRect(0, 0, this.width, this.height); + this.tunnels.forEach(function (tunnel) { + return tunnel.clear(); + }); + }; + + // 添加一批弹幕,轨道满时会被丢弃 + + + Barrage.prototype.addData = function addData() { + var _this6 = this; + + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if (!this._ready) { + this._delay('addData', data); + return; + } + + if (!this._isActive) return; + data.forEach(function (item) { + return _this6.addBullet2Tunnel(item); + }); + }; + + // 发送一条弹幕 + // 为保证发送成功,选取一条可用隧道,替换待发送队列队头元素 + + + Barrage.prototype.send = function send() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + if (!this._ready) { + this._delay('send', opt); + return; + } + + var tunnel = this.getEnableTunnel(); + if (tunnel === null) return; + + opt.tunnelId = tunnel.tunnelId; + var bullet = this.registerBullet(opt); + tunnel.nextQueue[0] = bullet; + }; + + // 添加至轨道 {content, color} + + + Barrage.prototype.addBullet2Tunnel = function addBullet2Tunnel() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var tunnel = this.getIdleTunnel(); + if (tunnel === null) return; + + opt.tunnelId = tunnel.tunnelId; + var bullet = this.registerBullet(opt); + tunnel.addBullet(bullet); + }; + + Barrage.prototype.registerBullet = function registerBullet() { + var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + opt.tunnelId = opt.tunnelId || 0; + opt.content = (0, _utils.substring)(opt.content, this.maxLength); + var textWidth = this.getTextWidth(opt.content); + var distance = this.mode === 'overlap' ? this.width + textWidth : this.width; + opt.textWidth = textWidth; + opt.speed = distance / (this.innerDuration * this.fps); + opt.fontSize = this.fontSize; + opt.x = this.width; + opt.y = this.tunnelHeight * (opt.tunnelId + 0.5) + this.padding[0]; + return new Bullet(this, opt); + }; + + // 每帧执行的操作 + + + Barrage.prototype.animate = function animate() { + // 清空画面后重绘 + this.ctx.clearRect(0, 0, this.width, this.height); + if (this.tunnelShow) { + this.drawTunnel(); + } + this.tunnels.forEach(function (tunnel) { + return tunnel.animate(); + }); + }; + + Barrage.prototype.showTunnel = function showTunnel() { + this.tunnelShow = true; + }; + + Barrage.prototype.hideTunnel = function hideTunnel() { + this.tunnelShow = false; + }; + + Barrage.prototype.removeIdleTunnel = function removeIdleTunnel(tunnelId) { + var idx = this.idleTunnels.indexOf(tunnelId); + if (idx >= 0) this.idleTunnels.splice(idx, 1); + }; + + Barrage.prototype.addIdleTunnel = function addIdleTunnel(tunnelId) { + var idx = this.idleTunnels.indexOf(tunnelId); + if (idx < 0) this.idleTunnels.push(tunnelId); + }; + + // 从可用的隧道中随机挑选一个 + + + Barrage.prototype.getEnableTunnel = function getEnableTunnel() { + if (this.enableTunnels.length === 0) return null; + var index = (0, _utils.getRandom)(this.enableTunnels.length); + return this.tunnels[this.enableTunnels[index]]; + }; + + // 从还有余量的隧道中随机挑选一个 + + + Barrage.prototype.getIdleTunnel = function getIdleTunnel() { + if (this.idleTunnels.length === 0) return null; + var index = (0, _utils.getRandom)(this.idleTunnels.length); + return this.tunnels[this.idleTunnels[index]]; + }; + + Barrage.prototype.getTextWidth = function getTextWidth(content) { + this.ctx.font = this.font; + return Math.ceil(this.ctx.measureText(content).width); + }; + + Barrage.prototype.drawTunnel = function drawTunnel() { + var ctx = this.ctx; + var tunnelColor = '#CCB24D'; + for (var i = 0; i <= this.tunnelNum; i++) { + var y = this.padding[0] + i * this.tunnelHeight; + ctx.beginPath(); + ctx.strokeStyle = tunnelColor; + ctx.setLineDash([5, 10]); + ctx.moveTo(0, y); + ctx.lineTo(this.width, y); + ctx.stroke(); + if (i < this.tunnelNum) { + ctx.fillStyle = tunnelColor; + ctx.fillText('\u5F39\u9053' + (i + 1), 10, this.tunnelHeight / 2 + y); + } + } + }; + + return Barrage; +}(); + +exports.default = Barrage; + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.json b/miniprogram/miniprogram_npm/miniprogram-barrage/index.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxml b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxml new file mode 100644 index 00000000..baceeffe --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + {{bullet.content}} + + + + + + + diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxss b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxss new file mode 100644 index 00000000..b4ce68f8 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-barrage/index.wxss @@ -0,0 +1,61 @@ +.barrage-area { + position: relative; + box-sizing: border-box; + width: 100%; + height: 100%; + pointer-events: auto; +} + +.barrage-tunnel { + box-sizing: border-box; + position: relative; + display: flex; + align-items: center; + border-top: 1px dashed #CCB24D; + width: 100%; +} + +.tunnel-tips { + display: inline-block; + margin-left: 10px; + color: #CCB24D; +} + +.bullet-item { + position: absolute; + display: flex; + align-items: center; + top: 0; + left: 100%; + white-space: nowrap; +} + +.bullet-item.paused { + background: #000; + opacity: 0.6; + padding: 0 10px; + z-index: 1001; +} + +.bullet-item_img { + max-height: 100%; + display: inline-block; +} + +.bullet-item_text { + display: inline-block; + margin: 0; +} + +.bullet-move { + animation: 0s linear slidein +} + +@keyframes slidein { + 0% { + transform: translate3d(0, 0, 0) + } + 100% { + transform: translate3d(-2000px, 0, 0) + } +} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-barrage/utils.js b/miniprogram/miniprogram_npm/miniprogram-barrage/utils.js new file mode 100644 index 00000000..e39a5e3d --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-barrage/utils.js @@ -0,0 +1,67 @@ +// 获取字节长度,中文算2个字节 +function getStrLen(str) { + // eslint-disable-next-line no-control-regex + return str.replace(/[^\x00-\xff]/g, 'aa').length +} + +// 截取指定字节长度的子串 +function substring(str, n) { + if (!str) return '' + + const len = getStrLen(str) + if (n >= len) return str + + let l = 0 + let result = '' + for (let i = 0; i < str.length; i++) { + const ch = str.charAt(i) + // eslint-disable-next-line no-control-regex + l = /[^\x00-\xff]/i.test(ch) ? l + 2 : l + 1 + result += ch + if (l >= n) break + } + return result +} + +function getRandom(max = 10, min = 0) { + return Math.floor(Math.random() * (max - min) + min) +} + +function getFontSize(font) { + const reg = /(\d+)(px)/i + const match = font.match(reg) + return (match && match[1]) || 10 +} + +function compareVersion(v1, v2) { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10) + const num2 = parseInt(v2[i], 10) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + return 0 +} + +module.exports = { + getStrLen, + substring, + getRandom, + getFontSize, + compareVersion +} diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.d.ts b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.d.ts new file mode 100644 index 00000000..8ec8cb16 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.d.ts @@ -0,0 +1,45 @@ +declare namespace recycleContext { + interface itemSize { + width: number; + height: number; + } + + type Component = any; + type Page = any; + + type itemSizeFunc = (item: T, index: number) => itemSize + + interface options { + id: string; + dataKey: string; + page: Component | Page; + itemSize: itemSizeFunc | itemSize; + useInPage?: boolean; + root?: Page; + } + + interface position { + left: number; + top: number; + width: number; + height: number; + } + + interface RecycleContext { + append(list: T[], callback?: () => void): RecycleContext + appendList(list: T[], callback?: () => void): RecycleContext + splice(begin: number, deleteCount: number, appendList: T[], callback?: () => void): RecycleContext; + updateList(beginIndex: number, list: T[], callback?: () => void): RecycleContext + update(beginIndex: number, list: T[], callback?: () => void): RecycleContext + destroy(): RecycleContext + forceUpdate(callback: () => void, reinitSlot: boolean): RecycleContext + getBoundingClientRect(index: number | undefined): position | position[] + getScrollTop(): number; + transformRpx(rpx: number, addPxSuffix?: string): number; + getViewportItems(inViewportPx: number): T[] + getList(): T[] + } +} +declare function createRecycleContext(op: recycleContext.options): recycleContext.RecycleContext + +export = createRecycleContext; \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.js b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.js new file mode 100644 index 00000000..9293610a --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/index.js @@ -0,0 +1,851 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 2); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isIPhone = false; +var deviceWidth = void 0; +var deviceDPR = void 0; +var BASE_DEVICE_WIDTH = 750; +var checkDeviceWidth = function checkDeviceWidth() { + var info = wx.getSystemInfoSync(); + // console.log('info', info) + isIPhone = info.platform === 'ios'; + var newDeviceWidth = info.screenWidth || 375; + var newDeviceDPR = info.pixelRatio || 2; + + if (!isIPhone) { + // HACK switch width and height when landscape + // const newDeviceHeight = info.screenHeight || 375 + // 暂时不处理转屏的情况 + } + + if (newDeviceWidth !== deviceWidth || newDeviceDPR !== deviceDPR) { + deviceWidth = newDeviceWidth; + deviceDPR = newDeviceDPR; + // console.info('Updated device width: ' + newDeviceWidth + 'px DPR ' + newDeviceDPR) + } +}; +checkDeviceWidth(); + +var eps = 1e-4; +var transformByDPR = function transformByDPR(number) { + if (number === 0) { + return 0; + } + number = number / BASE_DEVICE_WIDTH * deviceWidth; + number = Math.floor(number + eps); + if (number === 0) { + if (deviceDPR === 1 || !isIPhone) { + return 1; + } + return 0.5; + } + return number; +}; + +var rpxRE = /([+-]?\d+(?:\.\d+)?)rpx/gi; +// const inlineRpxRE = /(?::|\s|\(|\/)([+-]?\d+(?:\.\d+)?)rpx/g + +var transformRpx = function transformRpx(style, inline) { + if (typeof style !== 'string') { + return style; + } + var re = rpxRE; + return style.replace(re, function (match, num) { + return transformByDPR(Number(num)) + (inline ? 'px' : ''); + }); +}; + +module.exports = { + transformRpx: transformRpx +}; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = {}; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * recycle-view组件的api使用 + * 提供wx.createRecycleContext进行管理功能 + */ +var RecycleContext = __webpack_require__(3); + +/** + * @params options参数是object对象,展开的结构如下 + id: recycle-view的id + dataKey: recycle-item的wx:for绑定的数据变量 + page: recycle-view所在的页面或组件的实例 + itemSize: 函数或者是Object对象,生成每个recycle-item的宽和高 + * @return RecycleContext对象 + */ +module.exports = function (options) { + return new RecycleContext(options); +}; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +/* eslint complexity: ["error", {"max": 50}] */ +var recycleData = __webpack_require__(1); +var recycleViewportChangeFunc = __webpack_require__(4); +var transformRpx = __webpack_require__(0); + +var RECT_SIZE = 200; + +// eslint-disable-next-line no-complexity +function RecycleContext(_ref) { + var _this = this; + + var id = _ref.id, + dataKey = _ref.dataKey, + page = _ref.page, + itemSize = _ref.itemSize, + useInPage = _ref.useInPage, + placeholderClass = _ref.placeholderClass, + root = _ref.root; + + if (!id || !dataKey || !page || !itemSize) { + throw new Error('parameter id, dataKey, page, itemSize is required'); + } + if (typeof itemSize !== 'function' && (typeof itemSize === 'undefined' ? 'undefined' : _typeof(itemSize)) !== 'object') { + throw new Error('parameter itemSize must be function or object with key width and height'); + } + if ((typeof itemSize === 'undefined' ? 'undefined' : _typeof(itemSize)) === 'object' && (!itemSize.width || !itemSize.height) && (!itemSize.props || !itemSize.queryClass || !itemSize.dataKey)) { + throw new Error('parameter itemSize must be function or object with key width and height'); + } + this.id = id; + this.dataKey = dataKey; + this.page = page; + // 加root参数给useInPage单独使用 + this.root = root; + this.placeholderClass = placeholderClass; + page._recycleViewportChange = recycleViewportChangeFunc; + this.comp = page.selectComponent('#' + id); + this.itemSize = itemSize; + this.itemSizeOpt = itemSize; + // if (!this.comp) { + // throw ` with id ${id} not found` + // } + this.useInPage = useInPage || false; + if (this.comp) { + this.comp.context = this; + this.comp.setPage(page); + this.comp.setUseInPage(this.useInPage); + } + if (this.useInPage && !this.root) { + throw new Error('parameter root is required when useInPage is true'); + } + if (this.useInPage) { + this.oldPageScroll = this.root.onPageScroll; + // 重写onPageScroll事件 + this.root.onPageScroll = function (e) { + // this.checkComp(); + if (_this.comp) { + _this.comp._scrollViewDidScroll({ + detail: { + scrollLeft: 0, + scrollTop: e.scrollTop + } + }); + } + _this.oldPageScroll.apply(_this.root, [e]); + }; + this.oldReachBottom = this.root.onReachBottom; + this.root.onReachBottom = function (e) { + if (_this.comp) { + _this.comp.triggerEvent('scrolltolower', {}); + } + _this.oldReachBottom.apply(_this.root, [e]); + }; + this.oldPullDownRefresh = this.root.onPullDownRefresh; + this.root.onPullDownRefresh = function (e) { + if (_this.comp) { + _this.comp.triggerEvent('scrolltoupper', {}); + } + _this.oldPullDownRefresh.apply(_this.root, [e]); + }; + } +} +RecycleContext.prototype.checkComp = function () { + if (!this.comp) { + this.comp = this.page.selectComponent('#' + this.id); + if (this.comp) { + this.comp.setUseInPage(this.useInPage); + this.comp.context = this; + this.comp.setPage(this.page); + } else { + throw new Error('the recycle-view correspond to this context is detached, pls create another RecycleContext'); + } + } +}; +RecycleContext.prototype.appendList = function (list, cb) { + this.checkComp(); + var id = this.id; + var dataKey = this.dataKey; + if (!recycleData[id]) { + recycleData[id] = { + key: dataKey, + id: id, + list: list, + sizeMap: {}, + sizeArray: [] + }; + } else { + recycleData[id].dataKey = dataKey; + recycleData[id].list = recycleData[id].list.concat(list); + } + this._forceRerender(id, cb); + return this; +}; +RecycleContext.prototype._forceRerender = function (id, cb) { + this.isDataReady = true; // 首次调用说明数据已经ready了 + // 动态计算高度并缓存 + var that = this; + var allrect = null; + var parentRect = null; + var count = 0; + + function setPlaceholderImage() { + if (!allrect || !parentRect) return; + var svgRects = []; + for (var i = 0; i < count; i++) { + svgRects.push({ + left: allrect[i].left - parentRect.left, + top: allrect[i].top - parentRect.top, + width: allrect[i].width, + height: allrect[i].height + }); + } + that.comp.setPlaceholderImage(svgRects, { + width: parentRect.width, + height: parentRect.height + }); + } + function newcb() { + if (cb) { + cb(); + } + // 计算placeholder, 只有在动态计算高度的时候才支持 + if (that.autoCalculateSize && that.placeholderClass) { + var newQueryClass = []; + that.placeholderClass.forEach(function (item) { + newQueryClass.push('.' + that.itemSizeOpt.queryClass + ' .' + item); + }); + // newQueryClass.push(`.` + that.itemSizeOpt.queryClass) + count = newQueryClass.length; + wx.createSelectorQuery().selectAll(newQueryClass.join(',')).boundingClientRect(function (rect) { + if (rect.length < count) return; + allrect = rect; + setPlaceholderImage(); + }).exec(); + wx.createSelectorQuery().select('.' + that.itemSizeOpt.queryClass).boundingClientRect(function (rect) { + parentRect = rect; + setPlaceholderImage(); + }).exec(); + } + } + if (Object.prototype.toString.call(this.itemSizeOpt) === '[object Object]' && this.itemSizeOpt && !this.itemSizeOpt.width) { + this._recalculateSizeByProp(recycleData[id].list, function (sizeData) { + recycleData[id].sizeMap = sizeData.map; + recycleData[id].sizeArray = sizeData.array; + // 触发强制渲染 + that.comp.forceUpdate(newcb); + }); + return; + } + var sizeData = this._recalculateSize(recycleData[id].list); + recycleData[id].sizeMap = sizeData.map; + // console.log('size is', sizeData.array, sizeData.map, 'totalHeight', sizeData.totalHeight) + // console.log('sizeArray', sizeData.array) + recycleData[id].sizeArray = sizeData.array; + // 触发强制渲染 + this.comp.forceUpdate(cb); +}; +function getValue(item, key) { + if (!key) return item; + if (typeof item[key] !== 'undefined') return item[key]; + var keyItems = key.split('.'); + for (var i = 0; i < keyItems.length; i++) { + item = item[keyItems[i]]; + if (typeof item === 'undefined' || (typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' && !item) { + return undefined; + } + } + return item; +} +function getValues(item, keys) { + if (Object.prototype.toString.call(keys) !== '[object Array]') { + keys = [keys]; + } + var vals = {}; + for (var i = 0; i < keys.length; i++) { + vals[keys[i]] = getValue(item, keys[i]); + } + return vals; +} +function isArray(arr) { + return Object.prototype.toString.call(arr) === '[object Array]'; +} +function isSamePureValue(item1, item2) { + if ((typeof item1 === 'undefined' ? 'undefined' : _typeof(item1)) !== (typeof item2 === 'undefined' ? 'undefined' : _typeof(item2))) return false; + if (isArray(item1) && isArray(item2)) { + if (item1.length !== item2.length) return false; + for (var i = 0; i < item1.length; i++) { + if (item1[i] !== item2[i]) return false; + } + return true; + } + return item1 === item2; +} +function isSameValue(item1, item2, keys) { + if (!isArray(keys)) { + keys = [keys]; + } + for (var i = 0; i < keys.length; i++) { + if (!isSamePureValue(getValue(item1, keys[i]), getValue(item2, keys[i]))) return false; + } + return true; +} +RecycleContext.prototype._recalculateSizeByProp = function (list, cb) { + var itemSize = this.itemSizeOpt; + var propValueMap = this.propValueMap || []; + var calcNewItems = []; + var needCalcPropIndex = []; + if (itemSize.cacheKey) { + propValueMap = wx.getStorageSync(itemSize.cacheKey) || []; + // eslint-disable-next-line no-console + // console.log('[recycle-view] get itemSize from cache', propValueMap) + } + this.autoCalculateSize = true; + var item2PropValueMap = []; + for (var i = 0; i < list.length; i++) { + var item2PropValueIndex = propValueMap.length; + if (!propValueMap.length) { + var val = getValues(list[i], itemSize.props); + val.__index__ = i; + propValueMap.push(val); + calcNewItems.push(list[i]); + needCalcPropIndex.push(item2PropValueIndex); + item2PropValueMap.push({ + index: i, + sizeIndex: item2PropValueIndex + }); + continue; + } + var found = false; + for (var j = 0; j < propValueMap.length; j++) { + if (isSameValue(propValueMap[j], list[i], itemSize.props)) { + item2PropValueIndex = j; + found = true; + break; + } + } + if (!found) { + var _val = getValues(list[i], itemSize.props); + _val.__index__ = i; + propValueMap.push(_val); + calcNewItems.push(list[i]); + needCalcPropIndex.push(item2PropValueIndex); + } + item2PropValueMap.push({ + index: i, + sizeIndex: item2PropValueIndex + }); + } + // this.item2PropValueMap = item2PropValueMap + this.propValueMap = propValueMap; + if (propValueMap.length > 10) { + // eslint-disable-next-line no-console + console.warn('[recycle-view] get itemSize count exceed maximum of 10, now got', propValueMap); + } + // console.log('itemsize', propValueMap, item2PropValueMap) + // 预先渲染 + var that = this; + function newItemSize(item, index) { + var sizeIndex = item2PropValueMap[index]; + if (!sizeIndex) { + // eslint-disable-next-line no-console + console.error('[recycle-view] auto calculate size array error, no map size found', item, index, item2PropValueMap); + throw new Error('[recycle-view] auto calculate size array error, no map size found'); + } + var size = propValueMap[sizeIndex.sizeIndex]; + if (!size) { + // eslint-disable-next-line no-console + console.log('[recycle-view] auto calculate size array error, no size found', item, index, sizeIndex, propValueMap); + throw new Error('[recycle-view] auto calculate size array error, no size found'); + } + return { + width: size.width, + height: size.height + }; + } + function sizeReady(rects) { + rects.forEach(function (rect, index) { + var propValueIndex = needCalcPropIndex[index]; + propValueMap[propValueIndex].width = rect.width; + propValueMap[propValueIndex].height = rect.height; + }); + that.itemSize = newItemSize; + var sizeData = that._recalculateSize(list); + if (itemSize.cacheKey) { + wx.setStorageSync(itemSize.cacheKey, propValueMap); // 把数据缓存起来 + } + if (cb) { + cb(sizeData); + } + } + if (calcNewItems.length) { + var obj = {}; + obj[itemSize.dataKey] = calcNewItems; + this.page.setData(obj, function () { + // wx.createSelectorQuery().select(itemSize.componentClass).boundingClientRect(rects => { + // compSize = rects; + // if (compSize && allItemSize) { + // sizeReady(); + // } + // }).exec(); + wx.createSelectorQuery().selectAll('.' + itemSize.queryClass).boundingClientRect(function (rects) { + sizeReady(rects); + }).exec(); + }); + } else { + that.itemSize = newItemSize; + var sizeData = that._recalculateSize(list); + if (cb) { + cb(sizeData); + } + } +}; +// 当before和after这2个slot发生变化的时候调用一下此接口 +RecycleContext.prototype._recalculateSize = function (list) { + // 遍历所有的数据 + // 应该最多就千量级的, 遍历没有问题 + var sizeMap = {}; + var func = this.itemSize; + var funcExist = typeof func === 'function'; + var comp = this.comp; + var compData = comp.data; + var offsetLeft = 0; + var offsetTop = 0; + var line = 0; + var column = 0; + var sizeArray = []; + var listLen = list.length; + // 把整个页面拆分成200*200的很多个方格, 判断每个数据落在哪个方格上 + for (var i = 0; i < listLen; i++) { + list[i].__index__ = i; + var itemSize = {}; + // 获取到每一项的宽和高 + if (funcExist) { + // 必须保证返回的每一行的高度一样 + itemSize = func && func.call(this, list[i], i); + } else { + itemSize = { + width: func.width, + height: func.height + }; + } + itemSize = Object.assign({}, itemSize); + sizeArray.push(itemSize); + // 判断数据落到哪个方格上 + // 超过了宽度, 移动到下一行, 再根据高度判断是否需要移动到下一个方格 + if (offsetLeft + itemSize.width > compData.width) { + column = 0; + offsetLeft = itemSize.width; + // Fixed issue #22 + if (sizeArray.length >= 2) { + offsetTop += sizeArray[sizeArray.length - 2].height || 0; // 加上最后一个数据的高度 + } else { + offsetTop += itemSize.height; + } + // offsetTop += sizeArray[sizeArray.length - 2].height // 加上最后一个数据的高度 + // 根据高度判断是否需要移动到下一个方格 + if (offsetTop >= RECT_SIZE * (line + 1)) { + // fix: 当区块比较大时,会缺失块区域信息 + var lastIdx = i - 1; + var lastLine = line; + + line += parseInt((offsetTop - RECT_SIZE * line) / RECT_SIZE, 10); + + for (var idx = lastLine; idx < line; idx++) { + var _key = idx + '.' + column; + if (!sizeMap[_key]) { + sizeMap[_key] = []; + } + sizeMap[_key].push(lastIdx); + } + } + + // 新起一行的元素, beforeHeight是前一个元素的beforeHeight和height相加 + if (i === 0) { + itemSize.beforeHeight = 0; + } else { + var prevItemSize = sizeArray[sizeArray.length - 2]; + itemSize.beforeHeight = prevItemSize.beforeHeight + prevItemSize.height; + } + } else { + if (offsetLeft >= RECT_SIZE * (column + 1)) { + column++; + } + offsetLeft += itemSize.width; + if (i === 0) { + itemSize.beforeHeight = 0; + } else { + // 同一行的元素, beforeHeight和前面一个元素的beforeHeight一样 + itemSize.beforeHeight = sizeArray[sizeArray.length - 2].beforeHeight; + } + } + var key = line + '.' + column; + if (!sizeMap[key]) { + sizeMap[key] = []; + } + sizeMap[key].push(i); + + // fix: 当区块比较大时,会缺失块区域信息 + if (listLen - 1 === i && itemSize.height > RECT_SIZE) { + var _lastIdx = line; + offsetTop += itemSize.height; + line += parseInt((offsetTop - RECT_SIZE * line) / RECT_SIZE, 10); + for (var _idx = _lastIdx; _idx <= line; _idx++) { + var _key2 = _idx + '.' + column; + if (!sizeMap[_key2]) { + sizeMap[_key2] = []; + } + sizeMap[_key2].push(i); + } + } + } + // console.log('sizeMap', sizeMap) + var obj = { + array: sizeArray, + map: sizeMap, + totalHeight: sizeArray.length ? sizeArray[sizeArray.length - 1].beforeHeight + sizeArray[sizeArray.length - 1].height : 0 + }; + comp.setItemSize(obj); + return obj; +}; +RecycleContext.prototype.deleteList = function (beginIndex, count, cb) { + this.checkComp(); + var id = this.id; + if (!recycleData[id]) { + return this; + } + recycleData[id].list.splice(beginIndex, count); + this._forceRerender(id, cb); + return this; +}; +RecycleContext.prototype.updateList = function (beginIndex, list, cb) { + this.checkComp(); + var id = this.id; + if (!recycleData[id]) { + return this; + } + var len = recycleData[id].list.length; + for (var i = 0; i < list.length && beginIndex < len; i++) { + recycleData[id].list[beginIndex++] = list[i]; + } + this._forceRerender(id, cb); + return this; +}; +RecycleContext.prototype.update = RecycleContext.prototype.updateList; +RecycleContext.prototype.splice = function (begin, deleteCount, appendList, cb) { + this.checkComp(); + var id = this.id; + var dataKey = this.dataKey; + // begin是数组 + if ((typeof begin === 'undefined' ? 'undefined' : _typeof(begin)) === 'object' && begin.length) { + cb = deleteCount; + appendList = begin; + } + if (typeof appendList === 'function') { + cb = appendList; + appendList = []; + } + if (!recycleData[id]) { + recycleData[id] = { + key: dataKey, + id: id, + list: appendList || [], + sizeMap: {}, + sizeArray: [] + }; + } else { + recycleData[id].dataKey = dataKey; + var list = recycleData[id].list; + if (appendList && appendList.length) { + list.splice.apply(list, [begin, deleteCount].concat(appendList)); + } else { + list.splice(begin, deleteCount); + } + } + this._forceRerender(id, cb); + return this; +}; + +RecycleContext.prototype.append = RecycleContext.prototype.appendList; + +RecycleContext.prototype.destroy = function () { + if (this.useInPage) { + this.page.onPullDownRefresh = this.oldPullDownRefresh; + this.page.onReachBottom = this.oldReachBottom; + this.page.onPageScroll = this.oldPageScroll; + this.oldPageScroll = this.oldReachBottom = this.oldPullDownRefresh = null; + } + this.page = null; + this.comp = null; + if (recycleData[this.id]) { + delete recycleData[this.id]; + } + return this; +}; +// 重新更新下页面的数据 +RecycleContext.prototype.forceUpdate = function (cb, reinitSlot) { + var _this2 = this; + + this.checkComp(); + if (reinitSlot) { + this.comp.reRender(function () { + _this2._forceRerender(_this2.id, cb); + }); + } else { + this._forceRerender(this.id, cb); + } + return this; +}; +RecycleContext.prototype.getBoundingClientRect = function (index) { + this.checkComp(); + if (!recycleData[this.id]) { + return null; + } + var sizeArray = recycleData[this.id].sizeArray; + if (!sizeArray || !sizeArray.length) { + return null; + } + if (typeof index === 'undefined') { + var list = []; + for (var i = 0; i < sizeArray.length; i++) { + list.push({ + left: 0, + top: sizeArray[i].beforeHeight, + width: sizeArray[i].width, + height: sizeArray[i].height + }); + } + return list; + } + index = parseInt(index, 10); + if (index >= sizeArray.length || index < 0) return null; + return { + left: 0, + top: sizeArray[index].beforeHeight, + width: sizeArray[index].width, + height: sizeArray[index].height + }; +}; +RecycleContext.prototype.getScrollTop = function () { + this.checkComp(); + return this.comp.currentScrollTop || 0; +}; +// 将px转化为rpx +RecycleContext.prototype.transformRpx = RecycleContext.transformRpx = function (str, addPxSuffix) { + if (typeof str === 'number') str += 'rpx'; + return parseFloat(transformRpx.transformRpx(str, addPxSuffix)); +}; +RecycleContext.prototype.getViewportItems = function (inViewportPx) { + this.checkComp(); + var indexes = this.comp.getIndexesInViewport(inViewportPx); + if (indexes.length <= 0) return []; + var viewportItems = []; + var list = recycleData[this.id].list; + for (var i = 0; i < indexes.length; i++) { + viewportItems.push(list[indexes[i]]); + } + return viewportItems; +}; +RecycleContext.prototype.getTotalHeight = function () { + this.checkComp(); + return this.comp.getTotalHeight(); +}; +// 返回完整的列表数据 +RecycleContext.prototype.getList = function () { + if (!recycleData[this.id]) { + return []; + } + return recycleData[this.id].list; +}; +module.exports = RecycleContext; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* eslint complexity: ["error", {"max": 50}] */ +var recycleData = __webpack_require__(1); + +module.exports = function (e, cb) { + var detail = e.detail; + // console.log('data change transfer use time', Date.now() - e.detail.timeStamp) + var newList = []; + var item = recycleData[detail.id]; + // 边界值判断, 避免造成异常, 假设先调用了createRecycleContext, 然后再延迟2s调用append插入数据的情况 + if (!item || !item.list) return; + var dataList = item.list; + var pos = detail.data; + var beginIndex = pos.beginIndex; + var endIndex = pos.endIndex; + item.pos = pos; + // 加ignoreBeginIndex和ignoreEndIndex + if (typeof beginIndex === 'undefined' || beginIndex === -1 || typeof endIndex === 'undefined' || endIndex === -1) { + newList = []; + } else { + var i = -1; + for (i = beginIndex; i < dataList.length && i <= endIndex; i++) { + if (i >= pos.ignoreBeginIndex && i <= pos.ignoreEndIndex) continue; + newList.push(dataList[i]); + } + } + var obj = { + // batchSetRecycleData: !this.data.batchSetRecycleData + }; + obj[item.key] = newList; + var comp = this.selectComponent('#' + detail.id); + obj[comp.data.batchKey] = !this.data.batchSetRecycleData; + comp._setInnerBeforeAndAfterHeight({ + beforeHeight: pos.minTop, + afterHeight: pos.afterHeight + }); + this.setData(obj, function () { + if (typeof cb === 'function') { + cb(); + } + }); + // Fix #1 + // 去掉了batchSetDataKey,支持一个页面内显示2个recycle-view + // const groupSetData = () => { + // this.setData(obj) + // comp._recycleInnerBatchDataChanged(() => { + // if (typeof cb === 'function') { + // cb() + // } + // }) + // } + // if (typeof this.groupSetData === 'function') { + // this.groupSetData(groupSetData) + // } else { + // groupSetData() + // } +}; + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.js b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.js new file mode 100644 index 00000000..062c2a95 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.js @@ -0,0 +1,126 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 5); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 5: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// components/recycle-item/recycle-item.js +Component({ + relations: { + './recycle-view': { + type: 'parent', // 关联的目标节点应为子节点 + linked: function linked() {} + } + }, + /** + * 组件的属性列表 + */ + properties: {}, + + /** + * 组件的初始数据 + */ + data: { + // height: 100 + }, + + /** + * 组件的方法列表 + */ + methods: { + heightChange: function heightChange() {} + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.json b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxml b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxml new file mode 100644 index 00000000..cbe93625 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss new file mode 100644 index 00000000..6e6d9067 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-item.wxss @@ -0,0 +1,7 @@ +/* components/recycle-item/recycle-item.wxss */ +:host { + display: inline-block; +} +.wx-recycle-item { + height: 100%; +} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.js b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.js new file mode 100644 index 00000000..9505d302 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.js @@ -0,0 +1,925 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 6); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 0: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isIPhone = false; +var deviceWidth = void 0; +var deviceDPR = void 0; +var BASE_DEVICE_WIDTH = 750; +var checkDeviceWidth = function checkDeviceWidth() { + var info = wx.getSystemInfoSync(); + // console.log('info', info) + isIPhone = info.platform === 'ios'; + var newDeviceWidth = info.screenWidth || 375; + var newDeviceDPR = info.pixelRatio || 2; + + if (!isIPhone) { + // HACK switch width and height when landscape + // const newDeviceHeight = info.screenHeight || 375 + // 暂时不处理转屏的情况 + } + + if (newDeviceWidth !== deviceWidth || newDeviceDPR !== deviceDPR) { + deviceWidth = newDeviceWidth; + deviceDPR = newDeviceDPR; + // console.info('Updated device width: ' + newDeviceWidth + 'px DPR ' + newDeviceDPR) + } +}; +checkDeviceWidth(); + +var eps = 1e-4; +var transformByDPR = function transformByDPR(number) { + if (number === 0) { + return 0; + } + number = number / BASE_DEVICE_WIDTH * deviceWidth; + number = Math.floor(number + eps); + if (number === 0) { + if (deviceDPR === 1 || !isIPhone) { + return 1; + } + return 0.5; + } + return number; +}; + +var rpxRE = /([+-]?\d+(?:\.\d+)?)rpx/gi; +// const inlineRpxRE = /(?::|\s|\(|\/)([+-]?\d+(?:\.\d+)?)rpx/g + +var transformRpx = function transformRpx(style, inline) { + if (typeof style !== 'string') { + return style; + } + var re = rpxRE; + return style.replace(re, function (match, num) { + return transformByDPR(Number(num)) + (inline ? 'px' : ''); + }); +}; + +module.exports = { + transformRpx: transformRpx +}; + +/***/ }), + +/***/ 6: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* eslint complexity: ["error", {"max": 50}] */ +/* eslint-disable indent */ +var DEFAULT_SHOW_SCREENS = 4; +var RECT_SIZE = 200; +var systemInfo = wx.getSystemInfoSync(); +var DEBUG = false; +var transformRpx = __webpack_require__(0).transformRpx; + +Component({ + options: { + multipleSlots: true // 在组件定义时的选项中启用多slot支持 + }, + relations: { + '../recycle-item/recycle-item': { + type: 'child', // 关联的目标节点应为子节点 + linked: function linked(target) { + // 检查第一个的尺寸就好了吧 + if (!this._hasCheckSize) { + this._hasCheckSize = true; + var size = this.boundingClientRect(this._pos.beginIndex); + if (!size) { + return; + } + setTimeout(function () { + try { + target.createSelectorQuery().select('.wx-recycle-item').boundingClientRect(function (rect) { + if (rect && (rect.width !== size.width || rect.height !== size.height)) { + // eslint-disable-next-line no-console + console.warn('[recycle-view] the size in is not the same with param ' + ('itemSize, expect {width: ' + rect.width + ', height: ' + rect.height + '} but got ') + ('{width: ' + size.width + ', height: ' + size.height + '}')); + } + }).exec(); + } catch (e) { + // do nothing + } + }, 10); + } + } + } + }, + /** + * 组件的属性列表 + */ + properties: { + debug: { + type: Boolean, + value: false + }, + scrollY: { + type: Boolean, + value: true + }, + batch: { + type: Boolean, + value: false, + public: true, + observer: '_recycleInnerBatchDataChanged' + }, + batchKey: { + type: String, + value: 'batchSetRecycleData', + public: true + }, + scrollTop: { + type: Number, + value: 0, + public: true, + observer: '_scrollTopChanged', + observeAssignments: true + }, + height: { + type: Number, + value: systemInfo.windowHeight, + public: true, + observer: '_heightChanged' + }, + width: { + type: Number, + value: systemInfo.windowWidth, + public: true, + observer: '_widthChanged' + }, + // 距顶部/左边多远时,触发bindscrolltoupper + upperThreshold: { + type: Number, + value: 50, + public: true + }, + // 距底部/右边多远时,触发bindscrolltolower + lowerThreshold: { + type: Number, + value: 50, + public: true + }, + scrollToIndex: { + type: Number, + public: true, + value: 0, + observer: '_scrollToIndexChanged', + observeAssignments: true + }, + scrollWithAnimation: { + type: Boolean, + public: true, + value: false + }, + enableBackToTop: { + type: Boolean, + public: true, + value: false + }, + // 是否节流,默认是 + throttle: { + type: Boolean, + public: true, + value: true + }, + placeholderImage: { + type: String, + public: true, + value: '' + }, + screen: { // 默认渲染多少屏的数据 + type: Number, + public: true, + value: DEFAULT_SHOW_SCREENS + } + }, + + /** + * 组件的初始数据 + */ + data: { + innerBeforeHeight: 0, + innerAfterHeight: 0, + innerScrollTop: 0, + innerScrollIntoView: '', + placeholderImageStr: '', + totalHeight: 0, + useInPage: false + }, + attached: function attached() { + if (this.data.placeholderImage) { + this.setData({ + placeholderImageStr: transformRpx(this.data.placeholderImage, true) + }); + } + this.setItemSize({ + array: [], + map: {}, + totalHeight: 0 + }); + }, + ready: function ready() { + var _this = this; + + this._initPosition(function () { + _this._isReady = true; // DOM结构ready了 + // 有一个更新的timer在了 + if (_this._updateTimerId) return; + + _this._scrollViewDidScroll({ + detail: { + scrollLeft: _this._pos.left, + scrollTop: _this._pos.top, + ignoreScroll: true + } + }, true); + }); + }, + detached: function detached() { + this.page = null; + // 销毁对应的RecycleContext + if (this.context) { + this.context.destroy(); + this.context = null; + } + }, + + /** + * 组件的方法列表 + */ + methods: { + _log: function _log() { + var _console; + + if (!DEBUG && !this.data.debug) return; + var h = new Date(); + var str = h.getHours() + ':' + h.getMinutes() + ':' + h.getSeconds() + '.' + h.getMilliseconds(); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + Array.prototype.splice.call(args, 0, 0, str); + // eslint-disable-next-line no-console + (_console = console).log.apply(_console, args); + }, + _scrollToUpper: function _scrollToUpper(e) { + this.triggerEvent('scrolltoupper', e.detail); + }, + _scrollToLower: function _scrollToLower(e) { + this.triggerEvent('scrolltolower', e.detail); + }, + _beginToScroll: function _beginToScroll() { + if (!this._lastScrollTop) { + this._lastScrollTop = this._pos && (this._pos.top || 0); + } + }, + _clearList: function _clearList(cb) { + this.currentScrollTop = 0; + this._lastScrollTop = 0; + var pos = this._pos; + pos.beginIndex = this._pos.endIndex = -1; + pos.afterHeight = pos.minTop = pos.maxTop = 0; + this.page._recycleViewportChange({ + detail: { + data: pos, + id: this.id + } + }, cb); + }, + + // 判断RecycleContext是否Ready + _isValid: function _isValid() { + return this.page && this.context && this.context.isDataReady; + }, + + // eslint-disable-next-line no-complexity + _scrollViewDidScroll: function _scrollViewDidScroll(e, force) { + // 如果RecycleContext还没有初始化, 不做任何事情 + if (!this._isValid()) { + return; + } + // 监测白屏时间 + if (!e.detail.ignoreScroll) { + this.triggerEvent('scroll', e.detail); + } + this.currentScrollTop = e.detail.scrollTop; + // 高度为0的情况, 不做任何渲染逻辑 + if (!this._pos.height || !this.sizeArray.length) { + // 没有任何数据的情况下, 直接清理所有的状态 + this._clearList(e.detail.cb); + return; + } + + // 在scrollWithAnimation动画最后会触发一次scroll事件, 这次scroll事件必须要被忽略 + if (this._isScrollingWithAnimation) { + this._isScrollingWithAnimation = false; + return; + } + var pos = this._pos; + var that = this; + var scrollLeft = e.detail.scrollLeft; + var scrollTop = e.detail.scrollTop; + var scrollDistance = Math.abs(scrollTop - this._lastScrollTop); + if (!force && Math.abs(scrollTop - pos.top) < pos.height * 1.5) { + this._log('【not exceed height'); + return; + } + this._lastScrollTop = scrollTop; + var SHOW_SCREENS = this.data.screen; // 固定4屏幕 + this._log('SHOW_SCREENS', SHOW_SCREENS, scrollTop); + this._calcViewportIndexes(scrollLeft, scrollTop, function (beginIndex, endIndex, minTop, afterHeight, maxTop) { + that._log('scrollDistance', scrollDistance, 'indexes', beginIndex, endIndex); + // 渲染的数据不变 + if (!force && pos.beginIndex === beginIndex && pos.endIndex === endIndex && pos.minTop === minTop && pos.afterHeight === afterHeight) { + that._log('------------is the same beginIndex and endIndex'); + return; + } + // 如果这次渲染的范围比上一次的范围小,则忽略 + that._log('【check】before setData, old pos is', pos.minTop, pos.maxTop, minTop, maxTop); + that._throttle = false; + pos.left = scrollLeft; + pos.top = scrollTop; + pos.beginIndex = beginIndex; + pos.endIndex = endIndex; + // console.log('render indexes', endIndex - beginIndex + 1, endIndex, beginIndex) + pos.minTop = minTop; + pos.maxTop = maxTop; + pos.afterHeight = afterHeight; + pos.ignoreBeginIndex = pos.ignoreEndIndex = -1; + that.page._recycleViewportChange({ + detail: { + data: that._pos, + id: that.id + } + }, function () { + if (e.detail.cb) { + e.detail.cb(); + } + }); + }); + }, + + // 计算在视窗内渲染的数据 + _calcViewportIndexes: function _calcViewportIndexes(left, top, cb) { + var that = this; + // const st = +new Date + this._getBeforeSlotHeight(function () { + var _that$__calcViewportI = that.__calcViewportIndexes(left, top), + beginIndex = _that$__calcViewportI.beginIndex, + endIndex = _that$__calcViewportI.endIndex, + minTop = _that$__calcViewportI.minTop, + afterHeight = _that$__calcViewportI.afterHeight, + maxTop = _that$__calcViewportI.maxTop; + + if (cb) { + cb(beginIndex, endIndex, minTop, afterHeight, maxTop); + } + }); + }, + _getBeforeSlotHeight: function _getBeforeSlotHeight(cb) { + if (typeof this.data.beforeSlotHeight !== 'undefined') { + if (cb) { + cb(this.data.beforeSlotHeight); + } + } else { + this.reRender(cb); + } + }, + _getAfterSlotHeight: function _getAfterSlotHeight(cb) { + if (typeof this.data.afterSlotHeight !== 'undefined') { + if (cb) { + cb(this.data.afterSlotHeight); + } + // cb && cb(this.data.afterSlotHeight) + } else { + this.reRender(cb); + } + }, + _getIndexes: function _getIndexes(minTop, maxTop) { + if (minTop === maxTop && maxTop === 0) { + return { + beginIndex: -1, + endIndex: -1 + }; + } + var startLine = Math.floor(minTop / RECT_SIZE); + var endLine = Math.ceil(maxTop / RECT_SIZE); + var rectEachLine = Math.floor(this.data.width / RECT_SIZE); + var beginIndex = void 0; + var endIndex = void 0; + var sizeMap = this.sizeMap; + for (var i = startLine; i <= endLine; i++) { + for (var col = 0; col < rectEachLine; col++) { + var key = i + '.' + col; + // 找到sizeMap里面的最小值和最大值即可 + if (!sizeMap[key]) continue; + for (var j = 0; j < sizeMap[key].length; j++) { + if (typeof beginIndex === 'undefined') { + beginIndex = endIndex = sizeMap[key][j]; + continue; + } + if (beginIndex > sizeMap[key][j]) { + beginIndex = sizeMap[key][j]; + } else if (endIndex < sizeMap[key][j]) { + endIndex = sizeMap[key][j]; + } + } + } + } + return { + beginIndex: beginIndex, + endIndex: endIndex + }; + }, + _isIndexValid: function _isIndexValid(beginIndex, endIndex) { + if (typeof beginIndex === 'undefined' || beginIndex === -1 || typeof endIndex === 'undefined' || endIndex === -1 || endIndex >= this.sizeArray.length) { + return false; + } + return true; + }, + __calcViewportIndexes: function __calcViewportIndexes(left, top) { + if (!this.sizeArray.length) return {}; + var pos = this._pos; + if (typeof left === 'undefined') { + left = pos.left; + } + if (typeof top === 'undefined') { + top = pos.top; + } + // top = Math.max(top, this.data.beforeSlotHeight) + var beforeSlotHeight = this.data.beforeSlotHeight || 0; + // 和direction无关了 + var SHOW_SCREENS = this.data.screen; + var minTop = top - pos.height * SHOW_SCREENS - beforeSlotHeight; + var maxTop = top + pos.height * SHOW_SCREENS - beforeSlotHeight; + // maxTop或者是minTop超出了范围 + if (maxTop > this.totalHeight) { + minTop -= maxTop - this.totalHeight; + maxTop = this.totalHeight; + } + if (minTop < beforeSlotHeight) { + maxTop += Math.min(beforeSlotHeight - minTop, this.totalHeight); + minTop = 0; + } + // 计算落在minTop和maxTop之间的方格有哪些 + var indexObj = this._getIndexes(minTop, maxTop); + var beginIndex = indexObj.beginIndex; + var endIndex = indexObj.endIndex; + if (endIndex >= this.sizeArray.length) { + endIndex = this.sizeArray.length - 1; + } + // 校验一下beginIndex和endIndex的有效性, + if (!this._isIndexValid(beginIndex, endIndex)) { + return { + beginIndex: -1, + endIndex: -1, + minTop: 0, + afterHeight: 0, + maxTop: 0 + }; + } + // 计算白屏的默认占位的区域 + var maxTopFull = this.sizeArray[endIndex].beforeHeight + this.sizeArray[endIndex].height; + var minTopFull = this.sizeArray[beginIndex].beforeHeight; + + // console.log('render indexes', beginIndex, endIndex) + var afterHeight = this.totalHeight - maxTopFull; + return { + beginIndex: beginIndex, + endIndex: endIndex, + minTop: minTopFull, // 取整, beforeHeight的距离 + afterHeight: afterHeight, + maxTop: maxTop + }; + }, + setItemSize: function setItemSize(size) { + this.sizeArray = size.array; + this.sizeMap = size.map; + if (size.totalHeight !== this.totalHeight) { + // console.log('---totalHeight is', size.totalHeight); + this.setData({ + totalHeight: size.totalHeight, + useInPage: this.useInPage || false + }); + } + this.totalHeight = size.totalHeight; + }, + setList: function setList(key, newList) { + this._currentSetDataKey = key; + this._currentSetDataList = newList; + }, + setPage: function setPage(page) { + this.page = page; + }, + forceUpdate: function forceUpdate(cb, reInit) { + var _this2 = this; + + if (!this._isReady) { + if (this._updateTimerId) { + // 合并多次的forceUpdate + clearTimeout(this._updateTimerId); + } + this._updateTimerId = setTimeout(function () { + _this2.forceUpdate(cb, reInit); + }, 10); + return; + } + this._updateTimerId = null; + var that = this; + if (reInit) { + this.reRender(function () { + that._scrollViewDidScroll({ + detail: { + scrollLeft: that._pos.left, + scrollTop: that.currentScrollTop || that.data.scrollTop || 0, + ignoreScroll: true, + cb: cb + } + }, true); + }); + } else { + this._scrollViewDidScroll({ + detail: { + scrollLeft: that._pos.left, + scrollTop: that.currentScrollTop || that.data.scrollTop || 0, + ignoreScroll: true, + cb: cb + } + }, true); + } + }, + _initPosition: function _initPosition(cb) { + var that = this; + that._pos = { + left: that.data.scrollLeft || 0, + top: that.data.scrollTop || 0, + width: this.data.width, + height: Math.max(500, this.data.height), // 一个屏幕的高度 + direction: 0 + }; + this.reRender(cb); + }, + _widthChanged: function _widthChanged(newVal) { + if (!this._isReady) return newVal; + this._pos.width = newVal; + this.forceUpdate(); + return newVal; + }, + _heightChanged: function _heightChanged(newVal) { + if (!this._isReady) return newVal; + this._pos.height = Math.max(500, newVal); + this.forceUpdate(); + return newVal; + }, + reRender: function reRender(cb) { + var _this3 = this; + + var beforeSlotHeight = void 0; + var afterSlotHeight = void 0; + var that = this; + // const reRenderStart = Date.now() + function newCb() { + if (that._lastBeforeSlotHeight !== beforeSlotHeight || that._lastAfterSlotHeight !== afterSlotHeight) { + that.setData({ + hasBeforeSlotHeight: true, + hasAfterSlotHeight: true, + beforeSlotHeight: beforeSlotHeight, + afterSlotHeight: afterSlotHeight + }); + } + that._lastBeforeSlotHeight = beforeSlotHeight; + that._lastAfterSlotHeight = afterSlotHeight; + // console.log('_getBeforeSlotHeight use time', Date.now() - reRenderStart) + if (cb) { + cb(); + } + } + // 重新渲染事件发生 + var beforeReady = false; + var afterReady = false; + // fix:#16 确保获取slot节点实际高度 + this.setData({ + hasBeforeSlotHeight: false, + hasAfterSlotHeight: false + }, function () { + _this3.createSelectorQuery().select('.slot-before').boundingClientRect(function (rect) { + beforeSlotHeight = rect.height; + beforeReady = true; + if (afterReady) { + if (newCb) { + newCb(); + } + } + }).exec(); + _this3.createSelectorQuery().select('.slot-after').boundingClientRect(function (rect) { + afterSlotHeight = rect.height; + afterReady = true; + if (beforeReady) { + if (newCb) { + newCb(); + } + } + }).exec(); + }); + }, + _setInnerBeforeAndAfterHeight: function _setInnerBeforeAndAfterHeight(obj) { + if (typeof obj.beforeHeight !== 'undefined') { + this._tmpBeforeHeight = obj.beforeHeight; + } + if (obj.afterHeight) { + this._tmpAfterHeight = obj.afterHeight; + } + }, + _recycleInnerBatchDataChanged: function _recycleInnerBatchDataChanged(cb) { + var _this4 = this; + + if (typeof this._tmpBeforeHeight !== 'undefined') { + var setObj = { + innerBeforeHeight: this._tmpBeforeHeight || 0, + innerAfterHeight: this._tmpAfterHeight || 0 + }; + if (typeof this._tmpInnerScrollTop !== 'undefined') { + setObj.innerScrollTop = this._tmpInnerScrollTop; + } + var pageObj = {}; + var hasPageData = false; + if (typeof this._currentSetDataKey !== 'undefined') { + pageObj[this._currentSetDataKey] = this._currentSetDataList; + hasPageData = true; + } + var saveScrollWithAnimation = this.data.scrollWithAnimation; + var groupSetData = function groupSetData() { + // 如果有分页数据的话 + if (hasPageData) { + _this4.page.setData(pageObj); + } + _this4.setData(setObj, function () { + _this4.setData({ + scrollWithAnimation: saveScrollWithAnimation + }); + if (typeof cb === 'function') { + cb(); + } + }); + }; + groupSetData(); + delete this._currentSetDataKey; + delete this._currentSetDataList; + this._tmpBeforeHeight = undefined; + this._tmpAfterHeight = undefined; + this._tmpInnerScrollTop = undefined; + } + }, + _renderByScrollTop: function _renderByScrollTop(scrollTop) { + // 先setData把目标位置的数据补齐 + this._scrollViewDidScroll({ + detail: { + scrollLeft: this._pos.scrollLeft, + scrollTop: scrollTop, + ignoreScroll: true + } + }, true); + if (this.data.scrollWithAnimation) { + this._isScrollingWithAnimation = true; + } + this.setData({ + innerScrollTop: scrollTop + }); + }, + _scrollTopChanged: function _scrollTopChanged(newVal, oldVal) { + var _this5 = this; + + // if (newVal === oldVal && newVal === 0) return + if (!this._isInitScrollTop && newVal === 0) { + this._isInitScrollTop = true; + return newVal; + } + this.currentScrollTop = newVal; + if (!this._isReady) { + if (this._scrollTopTimerId) { + clearTimeout(this._scrollTopTimerId); + } + this._scrollTopTimerId = setTimeout(function () { + _this5._scrollTopChanged(newVal, oldVal); + }, 10); + return newVal; + } + this._isInitScrollTop = true; + this._scrollTopTimerId = null; + // this._lastScrollTop = oldVal + if (typeof this._lastScrollTop === 'undefined') { + this._lastScrollTop = this.data.scrollTop; + } + // 滑动距离小于一个屏幕的高度, 直接setData + if (Math.abs(newVal - this._lastScrollTop) < this._pos.height) { + this.setData({ + innerScrollTop: newVal + }); + return newVal; + } + if (!this._isScrollTopChanged) { + // 首次的值需要延后一点执行才能生效 + setTimeout(function () { + _this5._isScrollTopChanged = true; + _this5._renderByScrollTop(newVal); + }, 10); + } else { + this._renderByScrollTop(newVal); + } + return newVal; + }, + _scrollToIndexChanged: function _scrollToIndexChanged(newVal, oldVal) { + var _this6 = this; + + // if (newVal === oldVal && newVal === 0) return + // 首次滚动到0的不执行 + if (!this._isInitScrollToIndex && newVal === 0) { + this._isInitScrollToIndex = true; + return newVal; + } + if (!this._isReady) { + if (this._scrollToIndexTimerId) { + clearTimeout(this._scrollToIndexTimerId); + } + this._scrollToIndexTimerId = setTimeout(function () { + _this6._scrollToIndexChanged(newVal, oldVal); + }, 10); + return newVal; + } + this._isInitScrollToIndex = true; + this._scrollToIndexTimerId = null; + if (typeof this._lastScrollTop === 'undefined') { + this._lastScrollTop = this.data.scrollTop; + } + var rect = this.boundingClientRect(newVal); + if (!rect) return newVal; + // console.log('rect top', rect, this.data.beforeSlotHeight) + var calScrollTop = rect.top + (this.data.beforeSlotHeight || 0); + this.currentScrollTop = calScrollTop; + if (Math.abs(calScrollTop - this._lastScrollTop) < this._pos.height) { + this.setData({ + innerScrollTop: calScrollTop + }); + return newVal; + } + if (!this._isScrollToIndexChanged) { + setTimeout(function () { + _this6._isScrollToIndexChanged = true; + _this6._renderByScrollTop(calScrollTop); + }, 10); + } else { + this._renderByScrollTop(calScrollTop); + } + return newVal; + }, + + // 提供给开发者使用的接口 + boundingClientRect: function boundingClientRect(idx) { + if (idx < 0 || idx >= this.sizeArray.length) { + return null; + } + return { + left: 0, + top: this.sizeArray[idx].beforeHeight, + width: this.sizeArray[idx].width, + height: this.sizeArray[idx].height + }; + }, + + // 获取当前出现在屏幕内数据项, 返回数据项组成的数组 + // 参数inViewportPx表示当数据项至少有多少像素出现在屏幕内才算是出现在屏幕内,默认是1 + getIndexesInViewport: function getIndexesInViewport(inViewportPx) { + if (!inViewportPx) { + inViewportPx = 1; + } + var scrollTop = this.currentScrollTop; + var minTop = scrollTop + inViewportPx; + if (minTop < 0) minTop = 0; + var maxTop = scrollTop + this.data.height - inViewportPx; + if (maxTop > this.totalHeight) maxTop = this.totalHeight; + var indexes = []; + for (var i = 0; i < this.sizeArray.length; i++) { + if (this.sizeArray[i].beforeHeight + this.sizeArray[i].height >= minTop && this.sizeArray[i].beforeHeight <= maxTop) { + indexes.push(i); + } + if (this.sizeArray[i].beforeHeight > maxTop) break; + } + return indexes; + }, + getTotalHeight: function getTotalHeight() { + return this.totalHeight; + }, + setUseInPage: function setUseInPage(useInPage) { + this.useInPage = useInPage; + }, + setPlaceholderImage: function setPlaceholderImage(svgs, size) { + var fill = 'style=\'fill:rgb(204,204,204);\''; + var placeholderImages = ['data:image/svg+xml,%3Csvg height=\'' + size.height + '\' width=\'' + size.width + '\' xmlns=\'http://www.w3.org/2000/svg\'%3E']; + svgs.forEach(function (svg) { + placeholderImages.push('%3Crect width=\'' + svg.width + '\' x=\'' + svg.left + '\' height=\'' + svg.height + '\' y=\'' + svg.top + '\' ' + fill + ' /%3E'); + }); + placeholderImages.push('%3C/svg%3E'); + this.setData({ + placeholderImageStr: placeholderImages.join('') + }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.json b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml new file mode 100644 index 00000000..f7d60639 --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss new file mode 100644 index 00000000..033f08fb --- /dev/null +++ b/miniprogram/miniprogram_npm/miniprogram-recycle-view/recycle-view.wxss @@ -0,0 +1,5 @@ +/* components/recycle-view/recycle-view.wxss */ +:host { + display: block; + width: 100%; +} diff --git a/miniprogram/miniprogram_npm/widget-ui/index.js b/miniprogram/miniprogram_npm/widget-ui/index.js new file mode 100644 index 00000000..37e791dc --- /dev/null +++ b/miniprogram/miniprogram_npm/widget-ui/index.js @@ -0,0 +1,12 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1591242034686, function(require, module, exports) { +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var r in o)("object"==typeof exports?exports:t)[r]=o[r]}}(this,(function(){return function(t){var e={};function o(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(r,i,function(e){return t[e]}.bind(null,i));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(o(1)),l=o(2),n=0,a=function(){function t(e){var o=this;void 0===e&&(e={}),this.parent=null,this.id=t.uuid(),this.style={},this.computedStyle={},this.lastComputedStyle={},this.children={},this.layoutBox={left:0,top:0,width:0,height:0},e=Object.assign(l.getDefaultStyle(),e),this.computedStyle=Object.assign(l.getDefaultStyle(),e),this.lastComputedStyle=Object.assign(l.getDefaultStyle(),e),Object.keys(e).forEach((function(t){Object.defineProperty(o.style,t,{configurable:!0,enumerable:!0,get:function(){return e[t]},set:function(r){r!==e[t]&&void 0!==r&&(o.lastComputedStyle=o.computedStyle[t],e[t]=r,o.computedStyle[t]=r,l.scalableStyles.includes(t)&&o.style.scale&&(o.computedStyle[t]=r*o.style.scale),"scale"===t&&l.scalableStyles.forEach((function(t){e[t]&&(o.computedStyle[t]=e[t]*r)})),"hidden"===t&&(r?l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=0})):l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=o.lastComputedStyle[t]}))))}})})),this.style.scale&&l.scalableStyles.forEach((function(t){if(o.style[t]){var e=o.style[t]*o.style.scale;o.computedStyle[t]=e}})),e.hidden&&l.layoutAffectedStyles.forEach((function(t){o.computedStyle[t]=0}))}return t.uuid=function(){return n++},t.prototype.getAbsolutePosition=function(t){if(!t)return this.getAbsolutePosition(this);if(!t.parent)return{left:0,top:0};var e=this.getAbsolutePosition(t.parent),o=e.left,r=e.top;return{left:o+t.layoutBox.left,top:r+t.layoutBox.top}},t.prototype.add=function(t){t.parent=this,this.children[t.id]=t},t.prototype.remove=function(t){var e=this;t?this.children[t.id]&&(t.remove(),delete this.children[t.id]):Object.keys(this.children).forEach((function(t){e.children[t].remove(),delete e.children[t]}))},t.prototype.getNodeTree=function(){var t=this;return{id:this.id,style:this.computedStyle,children:Object.keys(this.children).map((function(e){return t.children[e].getNodeTree()}))}},t.prototype.applyLayout=function(t){var e=this;["left","top","width","height"].forEach((function(o){t.layout&&"number"==typeof t.layout[o]&&(e.layoutBox[o]=t.layout[o],!e.parent||"left"!==o&&"top"!==o||(e.layoutBox[o]+=e.parent.layoutBox[o]))})),t.children.forEach((function(t){e.children[t.id].applyLayout(t)}))},t.prototype.layout=function(){var t=this.getNodeTree();i.default(t),this.applyLayout(t)},t}();e.default=a},function(t,e,o){o.r(e);var r=function(){var t,e="inherit",o="ltr",r="rtl",i="row",l="row-reverse",n="column",a="column-reverse",u="flex-start",d="center",s="flex-end",y="space-between",c="space-around",f="flex-start",h="center",p="flex-end",g="stretch",v="relative",m="absolute",b={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},x={row:"right","row-reverse":"left",column:"bottom","column-reverse":"top"},w={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},S={row:"width","row-reverse":"width",column:"height","column-reverse":"height"};function W(t){return void 0===t}function L(t){return t===i||t===l}function k(t,e){if(void 0!==t.style.marginStart&&L(e))return t.style.marginStart;var o=null;switch(e){case"row":o=t.style.marginLeft;break;case"row-reverse":o=t.style.marginRight;break;case"column":o=t.style.marginTop;break;case"column-reverse":o=t.style.marginBottom}return void 0!==o?o:void 0!==t.style.margin?t.style.margin:0}function j(t,e){if(void 0!==t.style.marginEnd&&L(e))return t.style.marginEnd;var o=null;switch(e){case"row":o=t.style.marginRight;break;case"row-reverse":o=t.style.marginLeft;break;case"column":o=t.style.marginBottom;break;case"column-reverse":o=t.style.marginTop}return null!=o?o:void 0!==t.style.margin?t.style.margin:0}function B(t,e){if(void 0!==t.style.borderStartWidth&&t.style.borderStartWidth>=0&&L(e))return t.style.borderStartWidth;var o=null;switch(e){case"row":o=t.style.borderLeftWidth;break;case"row-reverse":o=t.style.borderRightWidth;break;case"column":o=t.style.borderTopWidth;break;case"column-reverse":o=t.style.borderBottomWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function E(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&L(e))return t.style.borderEndWidth;var o=null;switch(e){case"row":o=t.style.borderRightWidth;break;case"row-reverse":o=t.style.borderLeftWidth;break;case"column":o=t.style.borderBottomWidth;break;case"column-reverse":o=t.style.borderTopWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function C(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&L(e))return t.style.paddingStart;var o=null;switch(e){case"row":o=t.style.paddingLeft;break;case"row-reverse":o=t.style.paddingRight;break;case"column":o=t.style.paddingTop;break;case"column-reverse":o=t.style.paddingBottom}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+B(t,e)}function T(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&L(e))return t.style.paddingEnd;var o=null;switch(e){case"row":o=t.style.paddingRight;break;case"row-reverse":o=t.style.paddingLeft;break;case"column":o=t.style.paddingBottom;break;case"column-reverse":o=t.style.paddingTop}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+E(t,e)}function O(t,e){return B(t,e)+E(t,e)}function _(t,e){return k(t,e)+j(t,e)}function R(t,e){return C(t,e)+T(t,e)}function A(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:"stretch"}function P(t,e){if(e===r){if(t===i)return l;if(t===l)return i}return t}function D(t,e){return function(t){return t===n||t===a}(t)?P(i,e):n}function H(t){return t.style.position?t.style.position:"relative"}function M(t){return H(t)===v&&t.style.flex>0}function I(t,e){return t.layout[S[e]]+_(t,e)}function N(t,e){return void 0!==t.style[S[e]]&&t.style[S[e]]>=0}function F(t,e){return void 0!==t.style[e]}function q(t,e){return void 0!==t.style[e]?t.style[e]:0}function z(t,e,o){var r={row:t.style.minWidth,"row-reverse":t.style.minWidth,column:t.style.minHeight,"column-reverse":t.style.minHeight}[e],i={row:t.style.maxWidth,"row-reverse":t.style.maxWidth,column:t.style.maxHeight,"column-reverse":t.style.maxHeight}[e],l=o;return void 0!==i&&i>=0&&l>i&&(l=i),void 0!==r&&r>=0&&le?t:e}function G(t,e){void 0===t.layout[S[e]]&&N(t,e)&&(t.layout[S[e]]=U(z(t,e,t.style[S[e]]),R(t,e)))}function J(t,e,o){e.layout[x[o]]=t.layout[S[o]]-e.layout[S[o]]-e.layout[w[o]]}function K(t,e){return void 0!==t.style[b[e]]?q(t,b[e]):-q(t,x[e])}function Q(r,E,Q){var X=function(t,r){var i;return(i=t.style.direction?t.style.direction:e)===e&&(i=void 0===r?o:r),i}(r,Q),Y=P(function(t){return t.style.flexDirection?t.style.flexDirection:n}(r),X),Z=D(Y,X),$=P(i,X);G(r,Y),G(r,Z),r.layout.direction=X,r.layout[b[Y]]+=k(r,Y)+K(r,Y),r.layout[x[Y]]+=j(r,Y)+K(r,Y),r.layout[b[Z]]+=k(r,Z)+K(r,Z),r.layout[x[Z]]+=j(r,Z)+K(r,Z);var tt=r.children.length,et=R(r,$);if(function(t){return void 0!==t.style.measure}(r)){var ot=!W(r.layout[S[$]]),rt=t;rt=N(r,$)?r.style.width:ot?r.layout[S[$]]:E-_(r,$),rt-=et;var it=!N(r,$)&&!ot,lt=!N(r,n)&&W(r.layout[S[n]]);if(it||lt){var nt=r.style.measure(rt);it&&(r.layout.width=nt.width+et),lt&&(r.layout.height=nt.height+R(r,n))}if(0===tt)return}var at,ut,dt,st,yt=function(t){return"wrap"===t.style.flexWrap}(r),ct=function(t){return t.style.justifyContent?t.style.justifyContent:"flex-start"}(r),ft=C(r,Y),ht=C(r,Z),pt=R(r,Y),gt=R(r,Z),vt=!W(r.layout[S[Y]]),mt=!W(r.layout[S[Z]]),bt=L(Y),xt=null,wt=null,St=t;vt&&(St=r.layout[S[Y]]-pt);for(var Wt=0,Lt=0,kt=0,jt=0,Bt=0,Et=0;LtSt&&at!==Wt){Rt--,kt=1;break}At&&(H(dt)!==v||M(dt))&&(At=!1,Pt=at),Dt&&(H(dt)!==v||Xt!==g&&Xt!==f||W(dt.layout[S[Z]]))&&(Dt=!1,Ht=at),At&&(dt.layout[w[Y]]+=Nt,vt&&J(r,dt,Y),Nt+=I(dt,Y),Ft=U(Ft,z(dt,Z,I(dt,Z)))),Dt&&(dt.layout[w[Z]]+=jt+ht,mt&&J(r,dt,Z)),kt=0,Tt+=qt,Lt=at+1}var zt=0,Ut=0,Gt=0;if(Gt=vt?St-Tt:U(Tt,0)-Tt,0!==Ot){var Jt,Kt,Qt=Gt/_t;for(It=Mt;null!==It;)(Jt=Qt*It.style.flex+R(It,Y))!==(Kt=z(It,Y,Jt))&&(Gt-=Kt,_t-=It.style.flex),It=It.nextFlexChild;for((Qt=Gt/_t)<0&&(Qt=0),It=Mt;null!==It;)It.layout[S[Y]]=z(It,Y,Qt*It.style.flex+R(It,Y)),Ct=t,N(r,$)?Ct=r.layout[S[$]]-et:bt||(Ct=E-_(r,$)-et),V(It,Ct,X),dt=It,It=It.nextFlexChild,dt.nextFlexChild=null}else ct!==u&&(ct===d?zt=Gt/2:ct===s?zt=Gt:ct===y?(Gt=U(Gt,0),Ut=Ot+Rt-1!=0?Gt/(Ot+Rt-1):0):ct===c&&(zt=(Ut=Gt/(Ot+Rt))/2));for(Nt+=zt,at=Pt;at1&&mt){var $t=r.layout[S[Z]]-gt,te=$t-jt,ee=0,oe=ht,re=function(t){return t.style.alignContent?t.style.alignContent:"flex-start"}(r);re===p?oe+=te:re===h?oe+=te/2:re===g&&$t>jt&&(ee=te/Et);var ie=0;for(at=0;at=0&&L(e))return t.style.borderStartWidth;var o=null;switch(e){case\"row\":o=t.style.borderLeftWidth;break;case\"row-reverse\":o=t.style.borderRightWidth;break;case\"column\":o=t.style.borderTopWidth;break;case\"column-reverse\":o=t.style.borderBottomWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function E(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&L(e))return t.style.borderEndWidth;var o=null;switch(e){case\"row\":o=t.style.borderRightWidth;break;case\"row-reverse\":o=t.style.borderLeftWidth;break;case\"column\":o=t.style.borderBottomWidth;break;case\"column-reverse\":o=t.style.borderTopWidth}return null!=o&&o>=0?o:void 0!==t.style.borderWidth&&t.style.borderWidth>=0?t.style.borderWidth:0}function C(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&L(e))return t.style.paddingStart;var o=null;switch(e){case\"row\":o=t.style.paddingLeft;break;case\"row-reverse\":o=t.style.paddingRight;break;case\"column\":o=t.style.paddingTop;break;case\"column-reverse\":o=t.style.paddingBottom}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+B(t,e)}function T(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&L(e))return t.style.paddingEnd;var o=null;switch(e){case\"row\":o=t.style.paddingRight;break;case\"row-reverse\":o=t.style.paddingLeft;break;case\"column\":o=t.style.paddingBottom;break;case\"column-reverse\":o=t.style.paddingTop}return null!=o&&o>=0?o:void 0!==t.style.padding&&t.style.padding>=0?t.style.padding:0}(t,e)+E(t,e)}function O(t,e){return B(t,e)+E(t,e)}function _(t,e){return k(t,e)+j(t,e)}function R(t,e){return C(t,e)+T(t,e)}function A(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:\"stretch\"}function P(t,e){if(e===r){if(t===i)return l;if(t===l)return i}return t}function D(t,e){return function(t){return t===n||t===a}(t)?P(i,e):n}function H(t){return t.style.position?t.style.position:\"relative\"}function M(t){return H(t)===v&&t.style.flex>0}function I(t,e){return t.layout[S[e]]+_(t,e)}function N(t,e){return void 0!==t.style[S[e]]&&t.style[S[e]]>=0}function F(t,e){return void 0!==t.style[e]}function q(t,e){return void 0!==t.style[e]?t.style[e]:0}function z(t,e,o){var r={row:t.style.minWidth,\"row-reverse\":t.style.minWidth,column:t.style.minHeight,\"column-reverse\":t.style.minHeight}[e],i={row:t.style.maxWidth,\"row-reverse\":t.style.maxWidth,column:t.style.maxHeight,\"column-reverse\":t.style.maxHeight}[e],l=o;return void 0!==i&&i>=0&&l>i&&(l=i),void 0!==r&&r>=0&&le?t:e}function G(t,e){void 0===t.layout[S[e]]&&N(t,e)&&(t.layout[S[e]]=U(z(t,e,t.style[S[e]]),R(t,e)))}function J(t,e,o){e.layout[x[o]]=t.layout[S[o]]-e.layout[S[o]]-e.layout[w[o]]}function K(t,e){return void 0!==t.style[b[e]]?q(t,b[e]):-q(t,x[e])}function Q(r,E,Q){var X=function(t,r){var i;return(i=t.style.direction?t.style.direction:e)===e&&(i=void 0===r?o:r),i}(r,Q),Y=P(function(t){return t.style.flexDirection?t.style.flexDirection:n}(r),X),Z=D(Y,X),$=P(i,X);G(r,Y),G(r,Z),r.layout.direction=X,r.layout[b[Y]]+=k(r,Y)+K(r,Y),r.layout[x[Y]]+=j(r,Y)+K(r,Y),r.layout[b[Z]]+=k(r,Z)+K(r,Z),r.layout[x[Z]]+=j(r,Z)+K(r,Z);var tt=r.children.length,et=R(r,$);if(function(t){return void 0!==t.style.measure}(r)){var ot=!W(r.layout[S[$]]),rt=t;rt=N(r,$)?r.style.width:ot?r.layout[S[$]]:E-_(r,$),rt-=et;var it=!N(r,$)&&!ot,lt=!N(r,n)&&W(r.layout[S[n]]);if(it||lt){var nt=r.style.measure(rt);it&&(r.layout.width=nt.width+et),lt&&(r.layout.height=nt.height+R(r,n))}if(0===tt)return}var at,ut,dt,st,yt=function(t){return\"wrap\"===t.style.flexWrap}(r),ct=function(t){return t.style.justifyContent?t.style.justifyContent:\"flex-start\"}(r),ft=C(r,Y),ht=C(r,Z),pt=R(r,Y),gt=R(r,Z),vt=!W(r.layout[S[Y]]),mt=!W(r.layout[S[Z]]),bt=L(Y),xt=null,wt=null,St=t;vt&&(St=r.layout[S[Y]]-pt);for(var Wt=0,Lt=0,kt=0,jt=0,Bt=0,Et=0;LtSt&&at!==Wt){Rt--,kt=1;break}At&&(H(dt)!==v||M(dt))&&(At=!1,Pt=at),Dt&&(H(dt)!==v||Xt!==g&&Xt!==f||W(dt.layout[S[Z]]))&&(Dt=!1,Ht=at),At&&(dt.layout[w[Y]]+=Nt,vt&&J(r,dt,Y),Nt+=I(dt,Y),Ft=U(Ft,z(dt,Z,I(dt,Z)))),Dt&&(dt.layout[w[Z]]+=jt+ht,mt&&J(r,dt,Z)),kt=0,Tt+=qt,Lt=at+1}var zt=0,Ut=0,Gt=0;if(Gt=vt?St-Tt:U(Tt,0)-Tt,0!==Ot){var Jt,Kt,Qt=Gt/_t;for(It=Mt;null!==It;)(Jt=Qt*It.style.flex+R(It,Y))!==(Kt=z(It,Y,Jt))&&(Gt-=Kt,_t-=It.style.flex),It=It.nextFlexChild;for((Qt=Gt/_t)<0&&(Qt=0),It=Mt;null!==It;)It.layout[S[Y]]=z(It,Y,Qt*It.style.flex+R(It,Y)),Ct=t,N(r,$)?Ct=r.layout[S[$]]-et:bt||(Ct=E-_(r,$)-et),V(It,Ct,X),dt=It,It=It.nextFlexChild,dt.nextFlexChild=null}else ct!==u&&(ct===d?zt=Gt/2:ct===s?zt=Gt:ct===y?(Gt=U(Gt,0),Ut=Ot+Rt-1!=0?Gt/(Ot+Rt-1):0):ct===c&&(zt=(Ut=Gt/(Ot+Rt))/2));for(Nt+=zt,at=Pt;at1&&mt){var $t=r.layout[S[Z]]-gt,te=$t-jt,ee=0,oe=ht,re=function(t){return t.style.alignContent?t.style.alignContent:\"flex-start\"}(r);re===p?oe+=te:re===h?oe+=te/2:re===g&&$t>jt&&(ee=te/Et);var ie=0;for(at=0;at { + return (...args) => { + if (!this.inited) { + throw new error_1.CloudSDKError({ + errMsg: 'Cloud API isn\'t enabled, please call init first\n' + + '请先调用 init 完成初始化后再调用其他云 API。init 方法可传入一个对象用于设置默认配置,详见文档。' + }); + } + return func.apply(this, args); + }; + }; + this.exportAPI = { + version, + get DYNAMIC_CURRENT_ENV() { + const env = process.env.TCB_ENV || process.env.SCF_NAMESPACE; + if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') { + return symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV; + } + return env || symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV; + }, + // @ts-ignore + init: this.init.bind(this), + // @ts-ignore + updateConfig: this.updateConfig.bind(this), + registerService: (serviceProvider) => { + this.registerService(serviceProvider.createService(this)); + }, + // @ts-ignore + createNewInstance: (config) => { + const instance = new Cloud(); + instance.init(config); + return instance.exportAPI; + } + }; + index_1.registerServices(this); + this.meta = { + session_id: (+new Date).toString() + }; + this.config = { + env: {}, + }; + this.provider = provider_1.default(); + this.exportAPI.logger = this.provider.api.logger; + } + getMetaData() { + return this.meta; + } + getAPIs() { + return Object.assign({}, this.exportAPI); + } + init(config = {}) { + if (this.inited) + return; + this.inited = true; + this.updateConfig(config); + } + updateConfig(config = {}) { + this.provider.init(Object.assign(Object.assign({}, config), { version: `wx-server-sdk/${version}` })); + const _config = Object.assign(Object.assign({}, config), { env: type_1.isObject(config.env) ? config.env : { default: config.env } }); + this.config = _config; + } + registerService(service) { + this.services[service.name] = service; + if (service.getAPIs) { + const functions = service.getAPIs(); + for (const name in functions) { + this.registerFunction(name, functions[name], service.initRequired); + } + } + else if (service.getNamespace) { + const { namespace, apis } = service.getNamespace(); + this.exportAPI[namespace] = apis; + } + } + registerFunction(name, func, initRequired) { + this.exportAPI[name] = initRequired === false ? func : this.wrapCommonAPICheck(func); + } +} +exports.Cloud = Cloud; +const cloud = new Cloud(); +exports.default = cloud; + + +/***/ }), + +/***/ "./src/api/cloud/provider/index.ts": +/*!*****************************************!*\ + !*** ./src/api/cloud/provider/index.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const tcb_1 = __webpack_require__(/*! ./tcb */ "./src/api/cloud/provider/tcb/index.ts"); +var PROVIDER; +(function (PROVIDER) { + PROVIDER[PROVIDER["TCB"] = 0] = "TCB"; +})(PROVIDER = exports.PROVIDER || (exports.PROVIDER = {})); +function getProvider(provider = PROVIDER.TCB) { + switch (provider) { + default: { + return tcb_1.default; + } + } +} +exports.default = getProvider; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/callFunction.ts": +/*!********************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/callFunction.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +// const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)) +async function callFunction(options, config) { + // await sleep() + /* + const res = await tcbRequest({ + params: { + action: 'functions.invokeFunction', + function_name: options.name, + request_data: options.dataStr, + }, + // TODO + timeout: 5 * 60 * 1000, + config: mergeConfig(tcb.config, config), + method: 'post', + headers: { + 'content-type': 'application/json' + } + }) + */ + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + const res = await tcbInstance.callFunction(options); + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: `requestID ${res.requestId}, ${res.message}`, + requestId: res.requestId, + }; + } + else { + return { + result: res.result, + requestId: res.requestId, + }; + } +} +exports.callFunction = callFunction; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/callOpenAPI.ts": +/*!*******************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/callOpenAPI.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +// DEPRECATED +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +async function callOpenAPI(options, config) { + await sleep(); + // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options) + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + const res = await tcbInstance.callWxOpenApi({ + apiName: options.api, + requestData: options.data, + event: options.event, + }); + // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res) + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + return { + result: res.result, + }; + } +} +exports.callOpenAPI = callOpenAPI; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts": +/*!*********************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ "./src/config/error.config.ts"); +const error_1 = __webpack_require__(/*! ../../../../../utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! ../../../../../utils/msg */ "./src/utils/msg.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const openapi_1 = __webpack_require__(/*! ../../../../../protobuf/openapi */ "./src/protobuf/openapi.js"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +async function callWXOpenAPI(options, config) { + await sleep(); + let res; + try { + // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options) + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + res = await tcbInstance.callCompatibleWxOpenApi({ + apiName: options.api, + requestData: options.data, + }); + // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res) + } + catch (err) { + throw { + errCode: (err && err.code && error_config_1.TCB_ERR_CODE[err.code]) || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: (err && err.message) || err || 'empty error message', + }; + } + if (!Buffer.isBuffer(res)) { + // is object + // must be error + // tcb must not return object + if (res.code && res.hasOwnProperty('message')) { + // tcb error + throw new error_1.CloudSDKError({ + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: msg_1.apiFailMsg(options.api, res.message) + }); + } + if (res.errcode) { + // wx error + throw new error_1.CloudSDKError({ + errCode: res.errcode, + errMsg: msg_1.apiFailMsg(options.api, res.errmsg), + }); + } + if (res.byteLength === 0) { + throw new error_1.CloudSDKError({ + errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: msg_1.apiFailMsg(options.api, `empty response`) + }); + } + throw new error_1.CloudSDKError({ + errCode: error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: msg_1.apiFailMsg(options.api, `unknown response ${res}`) + }); + } + else { + // is buffer + let wxResp; + try { + wxResp = openapi_1.CommOpenApiResp.decode(res); + } + catch (decodeError) { + // fail to parse pb, may well be tcb error + let jsonParseResult; + try { + jsonParseResult = JSON.parse(res.toString()); + } + catch (parseTCBRespError) { + // unknown error + throw new error_1.CloudSDKError({ + errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: msg_1.apiFailMsg(options.api, `unknown wx response received: ${decodeError}`) + }); + } + if (jsonParseResult.code && jsonParseResult.hasOwnProperty('message')) { + // tcb error + throw new error_1.CloudSDKError({ + errCode: error_config_1.TCB_ERR_CODE[jsonParseResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: msg_1.apiFailMsg(options.api, jsonParseResult.message) + }); + } + else { + // unknown tcb error + throw new error_1.CloudSDKError({ + errCode: error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: msg_1.apiFailMsg(options.api, JSON.stringify(jsonParseResult)), + }); + } + } + if (wxResp) { + if (wxResp.errorCode) { + // wx system error, for example: no permission + throw new error_1.CloudSDKError({ + errCode: error_config_2.ERR_CODE[error_config_2.ERR_CODE[wxResp.errorCode]] || wxResp.errorCode, + errMsg: `${error_config_2.ERR_CODE[error_config_2.ERR_CODE.WX_SYSTEM_ERROR]}: error code: ${wxResp.errorCode}` + }); + } + } + else { + throw new error_1.CloudSDKError({ + errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: msg_1.apiFailMsg(options.api, `empty wx response buffer`) + }); + } + return wxResp; + } +} +exports.callWXOpenAPI = callWXOpenAPI; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/database.ts": +/*!****************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/database.ts ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const tcb = __webpack_require__(/*! tcb-admin-node */ "tcb-admin-node"); +const tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ "tcb-admin-node/src/utils/httpRequest"); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +const mergeConfig = (tcbConfig, config) => { + const ret = Object.assign({}, tcbConfig); + if (config.env) { + // @ts-ignore + ret.env = config.env; + } + return ret; +}; +async function addDocument(options, config) { + // 不得已而 sleep(0),因为 tcb-admin-node 的 httpRequest 在返回 promise 之前竟然有逻辑可能抛错 !!!!! + await sleep(); + const res = await tcbRequest({ + params: { + action: 'database.addDocument', + _id: options._id, + collectionName: options.collectionName, + data: options.data, + }, + config: mergeConfig(tcb.config, config), + method: 'post', + headers: { + 'content-type': 'application/json' + } + }); + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + return { + _id: res.data._id, + requestId: res.requestId, + }; + } +} +exports.addDocument = addDocument; +async function queryDocument(options, config) { + await sleep(); + const res = await tcbRequest({ + params: Object.assign(Object.assign({}, options), { action: 'database.queryDocument', collectionName: options.collectionName }), + config: mergeConfig(tcb.config, config), + method: 'post', + headers: { + 'content-type': 'application/json' + } + }); + if (res.code) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + return { + list: res.data.list || [], + limit: res.Limit, + offset: res.Offset, + total: res.TotalCount, + requestId: res.requestId, + }; + } +} +exports.queryDocument = queryDocument; +async function updateDocument(options, config) { + await sleep(); + const res = await tcbRequest({ + params: Object.assign(Object.assign({}, options), { action: 'database.updateDocument', collectionName: options.collectionName }), + config: mergeConfig(tcb.config, config), + method: 'post', + headers: { + 'content-type': 'application/json' + } + }); + if (res.code) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + return { + updated: res.data.updated, + upsertedId: res.data.upserted_id, + requestId: res.requestId, + }; + } +} +exports.updateDocument = updateDocument; +async function removeDocument(options, config) { + await sleep(); + const res = await tcbRequest({ + params: Object.assign(Object.assign({}, options), { action: 'database.removeDocument', collectionName: options.collectionName }), + config: mergeConfig(tcb.config, config), + method: 'post', + headers: { + 'content-type': 'application/json' + } + }); + if (res.code) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + return { + removed: res.deleted, + requestId: res.requestId, + }; + } +} +exports.removeDocument = removeDocument; +async function countDocument(options, config) { + await sleep(); + const res = await tcbRequest({ + params: Object.assign(Object.assign({}, options), { action: 'database.countDocument', collectionName: options.collectionName }), + config: mergeConfig(tcb.config, config), + method: 'post', + headers: { + 'content-type': 'application/json' + } + }); + if (res.code) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + return { + total: res.data.total, + requestId: res.requestId, + }; + } +} +exports.countDocument = countDocument; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/deleteFile.ts": +/*!******************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/deleteFile.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ "./src/config/error.config.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +async function deleteFile(options, config) { + await sleep(); + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + const res = await tcbInstance.deleteFile({ + fileList: options.fileList + }); + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f) => { + if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) { + const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR; + return { + fileID: f.fileID, + status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: error_config_2.ERR_CODE[code] + }; + } + return { + fileID: f.fileID, + status: 0, + errMsg: 'ok', + }; + }); + //@ts-ignore + return { + fileList: fileList, + requestId: res.requestId, + }; + } +} +exports.deleteFile = deleteFile; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/downloadFile.ts": +/*!********************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/downloadFile.ts ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +async function downloadFile(options, config) { + await sleep(); + const statusCode = 200; + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + const res = await tcbInstance.downloadFile({ + fileID: options.fileID + }); + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + return { + statusCode: statusCode, + fileContent: res.fileContent, + }; +} +exports.downloadFile = downloadFile; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/getTempFileURL.ts": +/*!**********************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/getTempFileURL.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ "./src/config/error.config.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +async function getTempFileURL(options, config) { + await sleep(); + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + const res = await tcbInstance.getTempFileURL({ + fileList: options.fileList, + }); + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f, i) => { + if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) { + const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR; + return { + fileID: f.fileID, + status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: error_config_2.ERR_CODE[code], + maxAge: f.maxAge, + tempFileURL: '', + }; + } + return { + fileID: f.fileID, + status: 0, + errMsg: 'ok', + maxAge: f.maxAge, + tempFileURL: f.tempFileURL, + }; + }); + return { + fileList: fileList, + requestId: res.requestId, + }; + } +} +exports.getTempFileURL = getTempFileURL; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/api/uploadFile.ts": +/*!******************************************************!*\ + !*** ./src/api/cloud/provider/tcb/api/uploadFile.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_config_1 = __webpack_require__(/*! ../config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +const instance_1 = __webpack_require__(/*! ../utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); +async function uploadFile(options, config) { + await sleep(); + let statusCode = -1; + const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig)); + const res = await tcbInstance.uploadFile({ + cloudPath: options.cloudPath, + fileContent: options.fileContent, + }, { + onResponseReceived(resp) { + statusCode = resp ? resp.statusCode : statusCode; + } + }); + if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) { + throw { + errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: res.message, + }; + } + else { + //@ts-ignore + return { + fileID: res.fileID, + requestId: res.requestId, + statusCode, + }; + } +} +exports.uploadFile = uploadFile; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/config/error.config.ts": +/*!***********************************************************!*\ + !*** ./src/api/cloud/provider/tcb/config/error.config.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +// provider should also register the error codes in src/config/error.config.ts +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TCB_ERR_CODE = { + // 通用 + SUCCESS: 0, + SYS_ERR: -501001, + SERVER_TIMEOUT: -501002, + EXCEED_REQUEST_LIMIT: -501003, + EXCEED_CONCURRENT_REQUEST_LIMIT: -501004, + INVALIID_ENV: -501005, + INVALID_COMMON_PARAM: -501006, + INVALID_PARAM: -501007, + INVALID_REQUEST_SOURCE: -501008, + RESOURCE_NOT_INITIAL: -501009, + // 数据库 + DATABASE_REQUEST_FAILED: -502001, + DATABASE_INVALID_OPERRATOR: -502002, + DATABASE_PERMISSION_DENIED: -502003, + DATABASE_COLLECTION_EXCEED_LIMIT: -502004, + DATABASE_COLLECTION_NOT_EXIST: -502005, + // 文件 + STORAGE_REQUEST_FAIL: -503001, + STORAGE_EXCEED_AUTHORITY: -503002, + STORAGE_FILE_NONEXIST: -503003, + STORAGE_SIGN_PARAM_INVALID: -503004, + // 云函数 + FUNCTIONS_REQUEST_FAIL: -504001, + FUNCTIONS_EXECUTE_FAIL: -504002, +}; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/index.ts": +/*!*********************************************!*\ + !*** ./src/api/cloud/provider/tcb/index.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const tcb = __webpack_require__(/*! tcb-admin-node */ "tcb-admin-node"); +const tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ "tcb-admin-node/src/utils/httpRequest"); +const database_1 = __webpack_require__(/*! ./api/database */ "./src/api/cloud/provider/tcb/api/database.ts"); +const callFunction_1 = __webpack_require__(/*! ./api/callFunction */ "./src/api/cloud/provider/tcb/api/callFunction.ts"); +const downloadFile_1 = __webpack_require__(/*! ./api/downloadFile */ "./src/api/cloud/provider/tcb/api/downloadFile.ts"); +const uploadFile_1 = __webpack_require__(/*! ./api/uploadFile */ "./src/api/cloud/provider/tcb/api/uploadFile.ts"); +const deleteFile_1 = __webpack_require__(/*! ./api/deleteFile */ "./src/api/cloud/provider/tcb/api/deleteFile.ts"); +const getTempFileURL_1 = __webpack_require__(/*! ./api/getTempFileURL */ "./src/api/cloud/provider/tcb/api/getTempFileURL.ts"); +const callOpenAPI_1 = __webpack_require__(/*! ./api/callOpenAPI */ "./src/api/cloud/provider/tcb/api/callOpenAPI.ts"); +const callWXOpenAPI_1 = __webpack_require__(/*! ./api/callWXOpenAPI */ "./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts"); +const provider = { + // init + init: (config) => { + tcb.init(Object.assign(Object.assign({}, config), { isHttp: process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF' })); + }, + get config() { + return tcb.config; + }, + // request + sendRequest: async function (options) { + return tcbRequest(Object.assign({ config: tcb.config, params: options.data }, options)); + }, + // api + api: { + addDocument: database_1.addDocument, + queryDocument: database_1.queryDocument, + updateDocument: database_1.updateDocument, + removeDocument: database_1.removeDocument, + countDocument: database_1.countDocument, + callFunction: callFunction_1.callFunction, + downloadFile: downloadFile_1.downloadFile, + uploadFile: uploadFile_1.uploadFile, + deleteFile: deleteFile_1.deleteFile, + getTempFileURL: getTempFileURL_1.getTempFileURL, + callOpenAPI: callOpenAPI_1.callOpenAPI, + callWXOpenAPI: callWXOpenAPI_1.callWXOpenAPI, + logger: tcb.logger, + } +}; +exports.default = provider; + + +/***/ }), + +/***/ "./src/api/cloud/provider/tcb/utils/instance.ts": +/*!******************************************************!*\ + !*** ./src/api/cloud/provider/tcb/utils/instance.ts ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const tcb = __webpack_require__(/*! tcb-admin-node */ "tcb-admin-node"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +const symbol_config_1 = __webpack_require__(/*! config/symbol.config */ "./src/config/symbol.config.ts"); +exports.getInstance = (config = {}) => { + if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') { + // @ts-ignore + const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env), isHttp: true })); + instance.config.secretId = undefined; + instance.config.secretKey = undefined; + instance.config.sessionToken = undefined; + return instance; + } + else { + // @ts-ignore + const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env) })); + instance.config.secretId = undefined; + instance.config.secretKey = undefined; + instance.config.sessionToken = undefined; + return instance; + } +}; +exports.fixInstance = (instance, env) => { + instance = instance || tcb; + if (env) { + instance.config.envName = utils_1.translateEnv(env); + } + else if (instance.config.envName === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) { + instance.config.envName = utils_1.translateEnv(instance.config.envName); + } + if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') { + instance.config.secretId = undefined; + instance.config.secretKey = undefined; + instance.config.sessionToken = undefined; + instance.config.isHttp = true; + } +}; + + +/***/ }), + +/***/ "./src/api/database/api/api.ts": +/*!*************************************!*\ + !*** ./src/api/database/api/api.ts ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const database_1 = __webpack_require__(/*! ./database */ "./src/api/database/api/database.ts"); +function getAPIs(cloud) { + return { + database: database_1.default.bind(null, cloud), + }; +} +exports.getAPIs = getAPIs; + + +/***/ }), + +/***/ "./src/api/database/api/database.ts": +/*!******************************************!*\ + !*** ./src/api/database/api/database.ts ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const collection_1 = __webpack_require__(/*! ./database/collection */ "./src/api/database/api/database/collection.ts"); +const transaction_1 = __webpack_require__(/*! ./database/transaction/transaction */ "./src/api/database/api/database/transaction/transaction.ts"); +const geo_1 = __webpack_require__(/*! ./database/geo/geo */ "./src/api/database/api/database/geo/geo.ts"); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const error_checker_1 = __webpack_require__(/*! ./database/helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +const instance_1 = __webpack_require__(/*! ../../../api/cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const symbol_config_1 = __webpack_require__(/*! config/symbol.config */ "./src/config/symbol.config.ts"); +function getDatabase(cloud, config) { + const Database = getDatabaseClass(cloud); + return new Database(config); +} +exports.default = getDatabase; +const getDatabaseClass = (cloud) => { + return class Database { + constructor(config = {}) { + this.runTransaction = (run, retryTimes) => { + return transaction_1.runTransaction.call(this, run, retryTimes); + }; + this.cloud = cloud; + this.config = config; + if (config.env) { + assert_1.assertType(config.env, 'string'); + } + else if (cloud.config.env) { + if (cloud.config.env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) { + config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV; + } + else if (cloud.config.env.database === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) { + config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV; + } + else if (!cloud.config.env.database && cloud.config.env.default === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) { + config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV; + } + } + this._instance = instance_1.getInstance(Object.assign(Object.assign({}, utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'database')), config)); + this._db = this._instance.database(); + this.command = this._db.command; + this.Geo = geo_1.initGeo(this._db.Geo); + this.serverDate = this._db.serverDate; + this.RegExp = this._db.RegExp; + } + collection(collectionName) { + return new collection_1.CollectionReference(this._db.collection(collectionName), collectionName, this); + } + startTransaction() { + return transaction_1.startTransaction.call(this); + } + async createCollection(collectionName) { + const apiName = 'createCollection'; + try { + const result = await this._db.createCollection(collectionName); + error_checker_1.checkError(result); + return { + errMsg: msg_1.apiSuccessMsg(apiName), + requestId: result.requestId, + }; + } + catch (e) { + throw error_1.returnAsFinalCloudSDKError(e, apiName); + } + } + }; +}; + + +/***/ }), + +/***/ "./src/api/database/api/database/aggregate.ts": +/*!****************************************************!*\ + !*** ./src/api/database/api/database/aggregate.ts ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts"); +const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +var ORDER_DIRECTION; +(function (ORDER_DIRECTION) { + ORDER_DIRECTION["ASC"] = "asc"; + ORDER_DIRECTION["DESC"] = "desc"; +})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {})); +class Aggregate { + constructor(_aggregate, collectionName, database) { + this._aggregate = _aggregate; + this.collectionName = collectionName; + this.database = database; + } + pushStage(stage, val) { + return new Aggregate(this._aggregate[stage](val), this.collectionName, this.database); + } + addFields(val) { + return this.pushStage('addFields', val); + } + bucket(val) { + return this.pushStage('bucket', val); + } + bucketAuto(val) { + return this.pushStage('bucketAuto', val); + } + collStats(val) { + return this.pushStage('collStats', val); + } + count(val) { + return this.pushStage('count', val); + } + facet(val) { + return this.pushStage('facet', val); + } + geoNear(val) { + return this.pushStage('geoNear', val); + } + graphLookup(val) { + return this.pushStage('graphLookup', val); + } + group(val) { + return this.pushStage('group', val); + } + indexStats() { + return this.pushStage('indexStats', {}); + } + limit(val) { + return this.pushStage('limit', val); + } + lookup(val) { + return this.pushStage('lookup', val); + } + match(val) { + return this.pushStage('match', val); + } + out(val) { + return this.pushStage('out', val); + } + project(val) { + return this.pushStage('project', val); + } + redact(val) { + return this.pushStage('redact', val); + } + replaceRoot(val) { + return this.pushStage('replaceRoot', val); + } + sample(val) { + return this.pushStage('sample', val); + } + skip(val) { + return this.pushStage('skip', val); + } + sort(val) { + return this.pushStage('sort', val); + } + sortByCount(val) { + return this.pushStage('sortByCount', val); + } + unwind(val) { + return this.pushStage('unwind', val); + } + end() { + const apiName = 'collection.aggregate'; + return new Promise(async (resolve, reject) => { + try { + instance_1.fixInstance(this.database._instance, this.database.config.env); + const result = await this._aggregate.end(); + error_checker_1.checkError(result); + resolve({ + list: result.data, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(err, apiName)); + } + }); + } +} +exports.Aggregate = Aggregate; + + +/***/ }), + +/***/ "./src/api/database/api/database/collection.ts": +/*!*****************************************************!*\ + !*** ./src/api/database/api/database/collection.ts ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const query_1 = __webpack_require__(/*! ./query */ "./src/api/database/api/database/query.ts"); +const document_1 = __webpack_require__(/*! ./document */ "./src/api/database/api/database/document.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts"); +const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const aggregate_1 = __webpack_require__(/*! ./aggregate */ "./src/api/database/api/database/aggregate.ts"); +class CollectionReference extends query_1.Query { + constructor(_collection, collectionName, database) { + super(_collection, collectionName, database); + this._collection = _collection; + this.collectionName = collectionName; + this.database = database; + } + doc(docId) { + return new document_1.DocumentReference(this._collection.doc(docId), this, docId, this.database); + } + add(options) { + const apiName = 'collection.add'; + return new Promise(async (resolve, reject) => { + try { + assert_1.assertType(options, { + data: 'object' + }); + assert_1.assertObjectNotEmpty({ + name: 'options.data', + target: options.data, + }); + instance_1.fixInstance(this.database._instance, this.database.config.env); + const addResult = await this._collection.add(options.data); + error_checker_1.checkError(addResult); + resolve({ + _id: addResult.id, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName)); + } + }); + } + aggregate() { + return new aggregate_1.Aggregate(this._collection.aggregate(), this.collectionName, this.database); + } +} +exports.CollectionReference = CollectionReference; + + +/***/ }), + +/***/ "./src/api/database/api/database/document.ts": +/*!***************************************************!*\ + !*** ./src/api/database/api/database/document.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts"); +const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +const GET_API_NAME = 'document.get'; +const UPDATE_API_NAME = 'document.update'; +const SET_API_NAME = 'document.set'; +const REMOVE_API_NAME = 'document.remove'; +class DocumentReference { + constructor(_document, collection, docId, database) { + this._document = _document; + this.collection = collection; + this.database = database; + this._id = docId; + } + field(object) { + assert_1.assertRequiredParam(object, 'object', 'field'); + assert_1.assertType(object, 'object', 'field'); + return new DocumentReference(this._document.field(object), this.collection, this._id, this.database); + } + get() { + return new Promise(async (resolve, reject) => { + try { + const throwOnNotFound = this.database.config.hasOwnProperty('throwOnNotFound') ? Boolean(this.database.config.throwOnNotFound) : true; + const _id = this._id; + instance_1.fixInstance(this.database._instance, this.database.config.env); + const queryResult = await this._document.get(); + error_checker_1.checkError(queryResult); + // in normal doc.get, queryResult.data is array, in transaction, it is object instead + if (!queryResult.data || (Array.isArray(queryResult.data) && !queryResult.data.length)) { + if (throwOnNotFound) { + throw `document with _id ${_id} does not exist`; + } + else { + resolve({ + data: null, + errMsg: msg_1.apiSuccessMsg(GET_API_NAME), + }); + } + } + else { + resolve({ + data: Array.isArray(queryResult.data) ? queryResult.data[0] : queryResult.data, + errMsg: msg_1.apiSuccessMsg(GET_API_NAME), + }); + } + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), GET_API_NAME)); + } + }); + } + set(options) { + return new Promise(async (resolve, reject) => { + try { + assert_1.assertType(options, { + data: 'object', + }); + assert_1.assertObjectNotEmpty({ + name: 'options.data', + target: options.data, + }); + const _id = this._id; + instance_1.fixInstance(this.database._instance, this.database.config.env); + const setResult = await this._document.set(options.data); + error_checker_1.checkError(setResult); + resolve({ + _id, + errMsg: msg_1.apiSuccessMsg(SET_API_NAME), + stats: { + updated: setResult.updated, + created: setResult.upsertedId ? 1 : 0, + } + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), SET_API_NAME)); + } + }); + } + update(options) { + return new Promise(async (resolve, reject) => { + try { + assert_1.assertType(options, { + data: 'object', + }); + assert_1.assertObjectNotEmpty({ + name: 'options.data', + target: options.data, + }); + instance_1.fixInstance(this.database._instance, this.database.config.env); + const updateResult = await this._document.update(options.data); + error_checker_1.checkError(updateResult); + resolve({ + stats: { + updated: updateResult.updated, + }, + errMsg: msg_1.apiSuccessMsg(UPDATE_API_NAME), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), UPDATE_API_NAME)); + } + }); + } + remove(options) { + return new Promise(async (resolve, reject) => { + try { + instance_1.fixInstance(this.database._instance, this.database.config.env); + // normal doc.remove -> _doc.remove + // transaction doc.remove -> _doc.delete + const removeResult = await (this._document.remove ? this._document.remove() : this._document.delete()); + error_checker_1.checkError(removeResult); + resolve({ + stats: { + removed: removeResult.deleted || 0, + }, + errMsg: msg_1.apiSuccessMsg(REMOVE_API_NAME), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), REMOVE_API_NAME)); + } + }); + } +} +exports.DocumentReference = DocumentReference; + + +/***/ }), + +/***/ "./src/api/database/api/database/geo/geo.ts": +/*!**************************************************!*\ + !*** ./src/api/database/api/database/geo/geo.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initGeo = (_geo) => { + const Geo = {}; + for (const key in _geo) { + if (_geo.hasOwnProperty(key)) { + if (typeof _geo[key] === 'function') { + Geo[key] = function () { + return new _geo[key](...arguments); + }; + } + else { + Geo[key] = _geo[key]; + } + } + } + return Geo; +}; + + +/***/ }), + +/***/ "./src/api/database/api/database/helper/error-checker.ts": +/*!***************************************************************!*\ + !*** ./src/api/database/api/database/helper/error-checker.ts ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const error_config_1 = __webpack_require__(/*! api/cloud/provider/tcb/config/error.config */ "./src/api/cloud/provider/tcb/config/error.config.ts"); +function checkError(tcbResult) { + if (tcbResult && tcbResult.code) { + throw error_1.returnAsCloudSDKError({ + errCode: error_config_1.TCB_ERR_CODE[tcbResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: tcbResult.message, + }); + } +} +exports.checkError = checkError; +function maybeTransformError(maybeTcbError) { + if (maybeTcbError && maybeTcbError.code) { + return { + errCode: error_config_1.TCB_ERR_CODE[maybeTcbError.code] || error_config_1.TCB_ERR_CODE.SYS_ERR, + errMsg: maybeTcbError.message, + }; + } + return maybeTcbError; +} +exports.maybeTransformError = maybeTransformError; + + +/***/ }), + +/***/ "./src/api/database/api/database/query.ts": +/*!************************************************!*\ + !*** ./src/api/database/api/database/query.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ "./src/api/database/api/database/helper/error-checker.ts"); +const instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +var ORDER_DIRECTION; +(function (ORDER_DIRECTION) { + ORDER_DIRECTION["ASC"] = "asc"; + ORDER_DIRECTION["DESC"] = "desc"; +})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {})); +class Query { + constructor(_query, collectionName, database) { + this._query = _query; + this.collectionName = collectionName; + this.database = database; + } + field(object) { + return new Query(this._query.field(object), this.collectionName, this.database); + } + where(condition) { + return new Query(this._query.where(condition), this.collectionName, this.database); + } + orderBy(fieldPath, order) { + return new Query(this._query.orderBy(fieldPath, order), this.collectionName, this.database); + } + limit(max) { + return new Query(this._query.limit(max), this.collectionName, this.database); + } + skip(offset) { + return new Query(this._query.skip(offset), this.collectionName, this.database); + } + get(options) { + const apiName = 'collection.get'; + return new Promise(async (resolve, reject) => { + try { + instance_1.fixInstance(this.database._instance, this.database.config.env); + const queryResult = await this._query.get(); + error_checker_1.checkError(queryResult); + resolve({ + data: queryResult.data, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName)); + } + }); + } + update(options) { + const apiName = 'collection.update'; + return new Promise(async (resolve, reject) => { + try { + assert_1.assertType(options, { + data: 'object', + }); + assert_1.assertObjectNotEmpty({ + name: 'options.data', + target: options.data, + }); + instance_1.fixInstance(this.database._instance, this.database.config.env); + const updateResult = await this._query.update(options.data); + error_checker_1.checkError(updateResult); + resolve({ + stats: { + updated: updateResult.updated || 0, + }, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName)); + } + }); + } + remove(options) { + const apiName = 'collection.remove'; + return new Promise(async (resolve, reject) => { + try { + instance_1.fixInstance(this.database._instance, this.database.config.env); + const removeResult = await this._query.remove(); + error_checker_1.checkError(removeResult); + resolve({ + stats: { + removed: removeResult.deleted, + }, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName)); + } + }); + } + count(options) { + const apiName = 'collection.count'; + return new Promise(async (resolve, reject) => { + try { + instance_1.fixInstance(this.database._instance, this.database.config.env); + const queryResult = await this._query.count(); + error_checker_1.checkError(queryResult); + resolve({ + total: queryResult.total, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (err) { + reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName)); + } + }); + } +} +exports.Query = Query; + + +/***/ }), + +/***/ "./src/api/database/api/database/transaction/transaction.ts": +/*!******************************************************************!*\ + !*** ./src/api/database/api/database/transaction/transaction.ts ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const collection_1 = __webpack_require__(/*! ../collection */ "./src/api/database/api/database/collection.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const instance_1 = __webpack_require__(/*! ../../../../cloud/provider/tcb/utils/instance */ "./src/api/cloud/provider/tcb/utils/instance.ts"); +class Transaction { + constructor(transaction, db) { + this._transaction = transaction; + this._db = db; + } + async init() { + return this._transaction.init(); + } + collection(collName) { + if (!collName) { + throw new Error('Collection name is required'); + } + return new collection_1.CollectionReference(this._transaction.collection(collName), collName, this._db); + } + async commit() { + try { + return this._transaction.commit(); + } + catch (e) { + throw error_1.returnAsFinalCloudSDKError(e, `transaction.commit`); + } + } + async rollback(reason) { + try { + return this._transaction.rollback(reason); + } + catch (e) { + throw error_1.returnAsFinalCloudSDKError(e, `transaction.rollback`); + } + } +} +exports.Transaction = Transaction; +async function runTransaction(callback, times = 3) { + instance_1.fixInstance(this._instance, this.config.env); + return this._db.runTransaction((_transaction) => { + const transaction = new Transaction(_transaction, this); + return callback(transaction); + }, times); +} +exports.runTransaction = runTransaction; +async function startTransaction() { + instance_1.fixInstance(this._instance, this.config.env); + const _transaction = await this._db.startTransaction(); + return new Transaction(_transaction, this); +} +exports.startTransaction = startTransaction; + + +/***/ }), + +/***/ "./src/api/database/index.ts": +/*!***********************************!*\ + !*** ./src/api/database/index.ts ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/database/api/api.ts"); +exports.DATABASE_SERVICE_NAME = 'database'; +function createDatabaseService(cloud) { + return { + name: exports.DATABASE_SERVICE_NAME, + getAPIs: api_1.getAPIs.bind(null, cloud), + }; +} +function registerService(cloud) { + cloud.registerService(createDatabaseService(cloud)); +} +exports.registerService = registerService; + + +/***/ }), + +/***/ "./src/api/functions/api/api.ts": +/*!**************************************!*\ + !*** ./src/api/functions/api/api.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const callFunction_1 = __webpack_require__(/*! ./callFunction */ "./src/api/functions/api/callFunction.ts"); +function getAPIs(cloud) { + return { + callFunction: callFunction_1.default(cloud), + }; +} +exports.getAPIs = getAPIs; + + +/***/ }), + +/***/ "./src/api/functions/api/callFunction.ts": +/*!***********************************************!*\ + !*** ./src/api/functions/api/callFunction.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +function getCallFunction(cloud) { + return function callFunction(options) { + const apiName = 'callFunction'; + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for callFunction must be an object instead of ' + typeof options, + }, apiName)); + } + try { + assert_1.assertType(options, { + name: 'string' + }); + if (options.hasOwnProperty('data')) { + assert_1.assertType(options, { + data: 'object' + }); + } + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + try { + const result = await cloud.provider.api.callFunction({ + name: options.name, + data: options.data || {}, + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'functions'), + apiConfig: options.config, + }); + let parsedResult = result.result; + try { + if (typeof parsedResult === 'string') { + parsedResult = JSON.parse(result.result); + } + } + catch (_) { + // no nothing + } + return resolve({ + result: parsedResult, + errMsg: msg_1.apiSuccessMsg(apiName), + requestID: result.requestId, + }); + } + catch (e) { + const error = error_1.returnAsFinalCloudSDKError(e, apiName); + // @ts-ignore + error.requestID = e.requestID; + return reject(error); + } + }); + }; +} +exports.default = getCallFunction; + + +/***/ }), + +/***/ "./src/api/functions/index.ts": +/*!************************************!*\ + !*** ./src/api/functions/index.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/functions/api/api.ts"); +exports.FUNCTIONS_SERVICE_NAME = 'functions'; +function createFunctionsService(cloud) { + return { + name: exports.FUNCTIONS_SERVICE_NAME, + getAPIs: api_1.getAPIs.bind(null, cloud), + }; +} +function registerService(cloud) { + cloud.registerService(createFunctionsService(cloud)); +} +exports.registerService = registerService; + + +/***/ }), + +/***/ "./src/api/index.ts": +/*!**************************!*\ + !*** ./src/api/index.ts ***! + \**************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const database_1 = __webpack_require__(/*! ./database */ "./src/api/database/index.ts"); +const storage_1 = __webpack_require__(/*! ./storage */ "./src/api/storage/index.ts"); +const functions_1 = __webpack_require__(/*! ./functions */ "./src/api/functions/index.ts"); +const open_1 = __webpack_require__(/*! ./open */ "./src/api/open/index.ts"); +const utils_1 = __webpack_require__(/*! ./utils */ "./src/api/utils/index.ts"); +const openapi_1 = __webpack_require__(/*! ./openapi */ "./src/api/openapi/index.ts"); +function registerServices(cloud) { + database_1.registerService(cloud); + storage_1.registerService(cloud); + functions_1.registerService(cloud); + open_1.registerService(cloud); + utils_1.registerService(cloud); + openapi_1.registerService(cloud); +} +exports.registerServices = registerServices; + + +/***/ }), + +/***/ "./src/api/open/api/api.ts": +/*!*********************************!*\ + !*** ./src/api/open/api/api.ts ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const callOpenAPI_1 = __webpack_require__(/*! ./callOpenAPI */ "./src/api/open/api/callOpenAPI.ts"); +const getOpenData_1 = __webpack_require__(/*! ./getOpenData */ "./src/api/open/api/getOpenData.ts"); +const getVoIPSign_1 = __webpack_require__(/*! ./getVoIPSign */ "./src/api/open/api/getVoIPSign.ts"); +function getAPIs(cloud) { + return { + callOpenAPI: callOpenAPI_1.default(cloud), + getOpenData: getOpenData_1.default(cloud), + getVoIPSign: getVoIPSign_1.default(cloud), + }; +} +exports.getAPIs = getAPIs; + + +/***/ }), + +/***/ "./src/api/open/api/callOpenAPI.ts": +/*!*****************************************!*\ + !*** ./src/api/open/api/callOpenAPI.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +// THIS IS THE LEGACY CALLOPENAPI, TO BE DEPRECATED +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +function getCallOpenAPI(cloud) { + return function callOpenAPI(options) { + const apiName = 'callOpenAPI'; + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for callOpenAPI must be an object instead of ' + typeof options, + }, apiName)); + } + try { + assert_1.assertType(options, { + api: 'string' + }); + if (options.data) { + assert_1.assertType(options, { + data: 'object' + }); + } + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + try { + const result = await cloud.provider.api.callOpenAPI({ + api: options.api, + data: options.data || {}, + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config), + apiConfig: options.config, + }); + let parsedResult = result.result; + try { + if (typeof parsedResult === 'string') { + parsedResult = JSON.parse(result.result); + } + } + catch (_) { + // no nothing + } + return resolve({ + result: parsedResult, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (e) { + const error = error_1.returnAsFinalCloudSDKError(e, apiName); + return reject(error); + } + }); + }; +} +exports.default = getCallOpenAPI; + + +/***/ }), + +/***/ "./src/api/open/api/getOpenData.ts": +/*!*****************************************!*\ + !*** ./src/api/open/api/getOpenData.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ "./src/protobuf/openapi.js"); +const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +const API_NAME = 'getOpenData'; +function getGetOpenData(cloud) { + return function getOpenData(options) { + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for getOpenData must be an object instead of ' + typeof options, + }, API_NAME)); + } + try { + if (!options.list) { + throw new Error('list must be provided'); + } + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME)); + } + try { + const getOpenDataReqBuffer = openapi_1.ApiGetOpenDataByCloudIdReq.encode({ + cloudidList: options.list, + }).finish(); + const svrkitData = { + apiName: 'ApiGetOpenDataByCloudId', + reqData: getOpenDataReqBuffer, + }; + const pbMessage = openapi_1.CommApiData.encode({ + apiType: openapi_1.CommApiData.ApiType.SVRKIT_API, + svrkitData, + }).finish(); + const wxResp = await cloud.provider.api.callWXOpenAPI({ + api: 'ApiGetOpenDataByCloudId', + data: Buffer.from(pbMessage), + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config), + apiConfig: options.config, + }); + if (wxResp.svrkitErrorCode !== 0) { + throw { + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`, + }; + } + if (!wxResp.respData) { + throw { + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: `internal svrkit error, empty respData`, + }; + } + const pbRespMsg = openapi_1.ApiGetOpenDataByCloudIdResp.decode(wxResp.respData); + // const svrkitResponse = GetOpenDataRespMessage.toObject(pbRespMsg, { + // longs: String, + // }) + const openDataList = pbRespMsg.dataList.map(item => { + if (!item.json) { + throw { + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: `internal svrkit error, empty openData json field for ${item.cloudId}`, + }; + } + return JSON.parse(item.json); + }); + resolve({ + list: openDataList, + errMsg: msg_1.apiSuccessMsg(API_NAME), + errCode: 0, + }); + } + catch (e) { + const error = error_1.returnAsFinalCloudSDKError(e, API_NAME); + return reject(error); + } + }); + }; +} +exports.default = getGetOpenData; + + +/***/ }), + +/***/ "./src/api/open/api/getVoIPSign.ts": +/*!*****************************************!*\ + !*** ./src/api/open/api/getVoIPSign.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ "./src/protobuf/openapi.js"); +const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +const API_NAME = 'getVoIPSign'; +function getGetVoIPSign(cloud) { + return function getVoIPSign(options) { + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for getVoIPSign must be an object instead of ' + typeof options, + }, API_NAME)); + } + try { + assert_1.assertType(options, { + groupId: 'string', + timestamp: 'number', + nonce: 'string', + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME)); + } + try { + const getVoIPSignReqBuffer = openapi_1.ApiVoipSignReq.encode({ + groupId: options.groupId, + timestamp: options.timestamp, + nonce: options.nonce, + }).finish(); + const svrkitData = { + apiName: 'ApiVoipSign', + reqData: getVoIPSignReqBuffer, + }; + const pbMessage = openapi_1.CommApiData.encode({ + apiType: openapi_1.CommApiData.ApiType.SVRKIT_API, + svrkitData, + }).finish(); + const wxResp = await cloud.provider.api.callWXOpenAPI({ + api: 'ApiVoipSign', + data: Buffer.from(pbMessage), + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config), + apiConfig: options.config, + }); + if (wxResp.svrkitErrorCode !== 0) { + throw { + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`, + }; + } + if (!wxResp.respData) { + throw { + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: `internal svrkit error, empty respData`, + }; + } + const pbRespMsg = openapi_1.ApiVoipSignResp.decode(wxResp.respData); + resolve({ + signature: pbRespMsg.signature, + errMsg: msg_1.apiSuccessMsg(API_NAME), + errCode: 0, + }); + } + catch (e) { + const error = error_1.returnAsFinalCloudSDKError(e, API_NAME); + return reject(error); + } + }); + }; +} +exports.default = getGetVoIPSign; + + +/***/ }), + +/***/ "./src/api/open/index.ts": +/*!*******************************!*\ + !*** ./src/api/open/index.ts ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/open/api/api.ts"); +const OPEN_SERVICE_NAME = 'open'; +function createOpenService(cloud) { + return { + name: OPEN_SERVICE_NAME, + getAPIs: api_1.getAPIs.bind(null, cloud), + }; +} +function registerService(cloud) { + cloud.registerService(createOpenService(cloud)); +} +exports.registerService = registerService; + + +/***/ }), + +/***/ "./src/api/openapi/index.ts": +/*!**********************************!*\ + !*** ./src/api/openapi/index.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const namespace_1 = __webpack_require__(/*! ./namespace */ "./src/api/openapi/namespace/index.ts"); +exports.OPENAPI_SERVICE_NAME = 'openapi'; +exports.OPENAPI_SERVICE_NAMESPACE_NAME = 'openapi'; +function createStorageService(cloud) { + return { + name: exports.OPENAPI_SERVICE_NAME, + getNamespace: () => { + return { + namespace: exports.OPENAPI_SERVICE_NAMESPACE_NAME, + apis: namespace_1.getAPIs(cloud), + }; + }, + }; +} +function registerService(cloud) { + cloud.registerService(createStorageService(cloud)); +} +exports.registerService = registerService; + + +/***/ }), + +/***/ "./src/api/openapi/namespace/generic.ts": +/*!**********************************************!*\ + !*** ./src/api/openapi/namespace/generic.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ "./src/protobuf/openapi.js"); +const type_1 = __webpack_require__(/*! ../../../utils/type */ "./src/utils/type.ts"); +const error_1 = __webpack_require__(/*! ../../../utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! ../../../utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! ../../../utils/utils */ "./src/utils/utils.ts"); +const mimetype_1 = __webpack_require__(/*! ../../../utils/mimetype */ "./src/utils/mimetype.ts"); +const error_config_1 = __webpack_require__(/*! ../../../config/error.config */ "./src/config/error.config.ts"); +const functionIntrinsicProperties = new Set(Object.getOwnPropertyNames(Function.prototype)); +const getCallableObject = (options) => { + const f = function () { }; + return new Proxy(f, { + get(target, prop) { + if (functionIntrinsicProperties.has(prop)) { + // @ts-ignore + return options.callable[prop]; + } + else { + return getCallableObject(Object.assign(Object.assign({}, options), { paths: [...options.paths, prop] })); + } + }, + apply(target, thisArg, args) { + return options.callable.call(thisArg, options, ...args); + }, + }); +}; +const getProxyObject = (options) => { + const f = () => { }; + const proxy = new Proxy(f, { + get(target, prop) { + return getCallableObject(Object.assign(Object.assign({}, options), { paths: [prop] })); + }, + apply(target, thisArg, args) { + // set options + if (!args[0] || !type_1.isObject(args[0])) { + throw new Error('an options object is expected'); + } + return getProxyObject(Object.assign(Object.assign({}, args[0]), { + // some options are not writable + callable: options.callable, paths: options.paths })); + } + }); + return proxy; +}; +function getGenericOpenAPI(cloud) { + const callable = (innerContext, data) => { + if (cloud.debug) { + console.log(`openapi.${innerContext.paths.join('.')} called with data:`, data); + } + const api = innerContext.paths.join('.'); + return callWXOpenAPI({ + api, + data, + convertCase: innerContext.convertCase, + }); + }; + return getProxyObject({ + callable: cloud.wrapCommonAPICheck(callable), + paths: [], + }); + async function callWXOpenAPI(options) { + const displayAPIName = `openapi.${options.api}`; + const shouldConvertCase = options.convertCase !== false; + try { + // convert camel case to snake case + const data = shouldConvertCase ? utils_1.convertCase(options.data, { + from: 'camelcase', + to: 'snakecase', + recursive: true, + }) : options.data; + // convert data to pb buffer + const pairs = []; + for (const key in data) { + const val = data[key]; + // check whether it is a form-data item + if (type_1.isObject(val) && (val.contentType || val.content_type) && val.value && type_1.isBuffer(val.value)) { + const contentType = (val.contentType || val.content_type).toString(); + const fileExtension = mimetype_1.mimeTypeToFileExtension(contentType); + if (!fileExtension) { + console.warn(`[${displayAPIName}] the input param ${key}.contentType is not a valid mime type`); + } + let filename = val.fileName; + if (!filename) { + filename = `${key}.${fileExtension || 'png'}`; + } + pairs.push({ + key, + value: val.value, + contentType, + filename, + }); + } + else { + const valStr = JSON.stringify(val); + if (valStr !== undefined) { + pairs.push({ + key, + value: Buffer.from(valStr), + }); + } + } + } + const pbMessage = openapi_1.CommApiData.encode({ + apiType: openapi_1.CommApiData.ApiType.OPEN_API, + openapiData: { + pairs, + }, + }).finish(); + const wxResp = await cloud.provider.api.callWXOpenAPI({ + api: options.api, + data: Buffer.from(pbMessage), + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config), + apiConfig: options.config, + }); + let result; + if (wxResp) { + if (/(application\/json)|(text\/plain)/.test(wxResp.contentType)) { + // json response + // NOTICE: sometimes the wx sever, for no reason, returns a json with content-type text/plain, and we have to deal with it... + try { + result = JSON.parse(wxResp.respData.toString()); + } + catch (parseWXRespJSONError) { + // wx server says it's a json but instead it is not a valid json + // if the content-type is text/plain and is not a valid json, we can safely return the string back + if (/text\/plain/.test(wxResp.contentType)) { + result = { + result: wxResp.respData.toString() + }; + } + else { + // internal error + throw new error_1.CloudSDKError({ + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: msg_1.apiFailMsg(displayAPIName, `wechat server internal error, response body is invalid json: ${wxResp.respData.toString()}`) + }); + } + } + if (result.errcode) { + // wx error + throw new error_1.CloudSDKError({ + errCode: result.errcode, + errMsg: msg_1.apiFailMsg(displayAPIName, result.errmsg), + }); + } + else { + delete result.errcode; + delete result.errmsg; + if (shouldConvertCase) { + // convert snake case to camel case + result = utils_1.convertCase(result, { + from: 'snakecase', + to: 'camelcase', + recursive: true, + }); + } + } + } + else { + // buffer response + result = { + contentType: wxResp.contentType.trim(), + buffer: wxResp.respData, + }; + } + } + else { + throw { + errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR, + errMsg: `internal server error, empty resp buffer`, + }; + } + return Object.assign(Object.assign({}, result), { errMsg: msg_1.apiSuccessMsg(displayAPIName), errCode: 0 }); + } + catch (e) { + throw error_1.returnAsFinalCloudSDKError(e, displayAPIName); + } + } +} +exports.default = getGenericOpenAPI; + + +/***/ }), + +/***/ "./src/api/openapi/namespace/index.ts": +/*!********************************************!*\ + !*** ./src/api/openapi/namespace/index.ts ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const generic_1 = __webpack_require__(/*! ./generic */ "./src/api/openapi/namespace/generic.ts"); +function getAPIs(cloud) { + return generic_1.default(cloud); +} +exports.getAPIs = getAPIs; + + +/***/ }), + +/***/ "./src/api/storage/api/api.ts": +/*!************************************!*\ + !*** ./src/api/storage/api/api.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const uploadFile_1 = __webpack_require__(/*! ./uploadFile */ "./src/api/storage/api/uploadFile.ts"); +const downloadFile_1 = __webpack_require__(/*! ./downloadFile */ "./src/api/storage/api/downloadFile.ts"); +const getTempFileURL_1 = __webpack_require__(/*! ./getTempFileURL */ "./src/api/storage/api/getTempFileURL.ts"); +const deleteFile_1 = __webpack_require__(/*! ./deleteFile */ "./src/api/storage/api/deleteFile.ts"); +function getAPIs(cloud) { + return { + uploadFile: uploadFile_1.default(cloud), + downloadFile: downloadFile_1.default(cloud), + getTempFileURL: getTempFileURL_1.default(cloud), + deleteFile: deleteFile_1.default(cloud), + }; +} +exports.getAPIs = getAPIs; + + +/***/ }), + +/***/ "./src/api/storage/api/deleteFile.ts": +/*!*******************************************!*\ + !*** ./src/api/storage/api/deleteFile.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +function getDeleteFile(cloud) { + return function deleteFile(options) { + const apiName = 'deleteFile'; + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for deleteFile must be an object instead of ' + typeof options, + }, apiName)); + } + try { + assert_1.assertType(options, { + fileList: 'array' + }); + options.fileList.forEach((f, i) => { + if (typeof f !== 'string') { + throw new Error(`Type of fileList[${i}] must be string instead of ${typeof f}`); + } + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + try { + const result = await cloud.provider.api.deleteFile({ + fileList: options.fileList + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'), + apiConfig: options.config, + }); + return resolve({ + fileList: result.fileList, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + }); + }; +} +exports.default = getDeleteFile; + + +/***/ }), + +/***/ "./src/api/storage/api/downloadFile.ts": +/*!*********************************************!*\ + !*** ./src/api/storage/api/downloadFile.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +function getDownloadFile(cloud) { + return function downloadFile(options) { + const apiName = 'downloadFile'; + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for downloadFile must be an object instead of ' + typeof options, + }, apiName)); + } + try { + assert_1.assertType(options, { + fileID: 'string', + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + try { + const result = await cloud.provider.api.downloadFile({ + fileID: options.fileID, + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'), + apiConfig: options.config, + }); + return resolve({ + fileContent: result.fileContent, + statusCode: result.statusCode, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + }); + }; +} +exports.default = getDownloadFile; + + +/***/ }), + +/***/ "./src/api/storage/api/getTempFileURL.ts": +/*!***********************************************!*\ + !*** ./src/api/storage/api/getTempFileURL.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +function getGetTempFileURL(cloud) { + return function getTempFileURL(options) { + const apiName = 'getTempFileURL'; + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for getTempFileURL must be an object instead of ' + typeof options, + }, apiName)); + } + try { + assert_1.assertType(options, { + fileList: 'array', + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + try { + const result = await cloud.provider.api.getTempFileURL({ + fileList: options.fileList, + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'), + apiConfig: options.config, + }); + return resolve({ + fileList: result.fileList, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + }); + }; +} +exports.default = getGetTempFileURL; + + +/***/ }), + +/***/ "./src/api/storage/api/uploadFile.ts": +/*!*******************************************!*\ + !*** ./src/api/storage/api/uploadFile.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __webpack_require__(/*! utils/assert */ "./src/utils/assert.ts"); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const msg_1 = __webpack_require__(/*! utils/msg */ "./src/utils/msg.ts"); +const utils_1 = __webpack_require__(/*! utils/utils */ "./src/utils/utils.ts"); +function getUploadFile(cloud) { + return function uploadFile(options) { + const apiName = 'uploadFile'; + return new Promise(async (resolve, reject) => { + if (!options) { + return reject(error_1.returnAsFinalCloudSDKError({ + errMsg: 'Params for uploadFile must be an object instead of ' + typeof options, + }, apiName)); + } + try { + assert_1.assertType(options, { + cloudPath: 'string', + }); + if (!options.fileContent) { + return reject(error_1.returnAsFinalCloudSDKError(new Error('Type of fileContent must be fs.ReadStream instead of ' + typeof options.fileContent), apiName)); + } + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + const header = options.header || {}; + try { + const result = await cloud.provider.api.uploadFile({ + fileContent: options.fileContent, + cloudPath: options.cloudPath, + header, + }, { + defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'), + apiConfig: options.config, + }); + return resolve({ + fileID: result.fileID, + statusCode: result.statusCode, + errMsg: msg_1.apiSuccessMsg(apiName), + }); + } + catch (e) { + return reject(error_1.returnAsFinalCloudSDKError(e, apiName)); + } + }); + }; +} +exports.default = getUploadFile; + + +/***/ }), + +/***/ "./src/api/storage/index.ts": +/*!**********************************!*\ + !*** ./src/api/storage/index.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/storage/api/api.ts"); +exports.STORAGE_SERVICE_NAME = 'storage'; +function createStorageService(cloud) { + return { + name: exports.STORAGE_SERVICE_NAME, + getAPIs: api_1.getAPIs.bind(null, cloud), + }; +} +function registerService(cloud) { + cloud.registerService(createStorageService(cloud)); +} +exports.registerService = registerService; + + +/***/ }), + +/***/ "./src/api/utils/api/api.ts": +/*!**********************************!*\ + !*** ./src/api/utils/api/api.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const getWXContext_1 = __webpack_require__(/*! ./getWXContext */ "./src/api/utils/api/getWXContext.ts"); +function getAPIs() { + return { + getWXContext: getWXContext_1.default, + }; +} +exports.getAPIs = getAPIs; + + +/***/ }), + +/***/ "./src/api/utils/api/getWXContext.ts": +/*!*******************************************!*\ + !*** ./src/api/utils/api/getWXContext.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const error_1 = __webpack_require__(/*! utils/error */ "./src/utils/error.ts"); +const WX_PREFIX = 'WX_'; +const CONTEXT_KEYS_BLACKLIST = [ + 'API_TOKEN', + 'TRIGGER_API_TOKEN_V0', +]; +function isContextKeyInBlacklist(key) { + return CONTEXT_KEYS_BLACKLIST.some(v => v === key || (WX_PREFIX + v) === key); +} +exports.isContextKeyInBlacklist = isContextKeyInBlacklist; +function isNumber(val) { + return /^[-]?\d+$/.test(val); +} +exports.isNumber = isNumber; +function getWXContext() { + const apiName = 'getWXContext'; + const wxContext = {}; + if (!process.env.WX_CONTEXT_KEYS) + return wxContext; + try { + const contextKeys = process.env.WX_CONTEXT_KEYS.split(','); + for (const key of contextKeys) { + if (!key) + continue; + if (isContextKeyInBlacklist(key)) + continue; + let val = process.env[key]; + if (val === undefined) + continue; + if (isNumber(val)) { + val = parseInt(val); + } + if (key.startsWith(WX_PREFIX) && key.length > 3) { + wxContext[key.slice(3)] = val; + } + else { + wxContext[key] = val; + } + } + wxContext.ENV = process.env.TCB_ENV || process.env.SCF_NAMESPACE; + if (process.env.TCB_SOURCE) { + wxContext.SOURCE = process.env.TCB_SOURCE; + } + return wxContext; + } + catch (e) { + const error = error_1.returnAsFinalCloudSDKError(e, apiName); + throw error; + } +} +exports.default = getWXContext; + + +/***/ }), + +/***/ "./src/api/utils/index.ts": +/*!********************************!*\ + !*** ./src/api/utils/index.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const api_1 = __webpack_require__(/*! ./api/api */ "./src/api/utils/api/api.ts"); +const UTILS_SERVICE_NAME = 'utils'; +function createUtilsService() { + return { + name: UTILS_SERVICE_NAME, + getAPIs: api_1.getAPIs, + initRequired: false, + }; +} +function registerService(cloud) { + cloud.registerService(createUtilsService()); +} +exports.registerService = registerService; + + +/***/ }), + +/***/ "./src/config/error.config.ts": +/*!************************************!*\ + !*** ./src/config/error.config.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ERR_CODE = { + '-1': 'unknown error', + UNKNOWN_ERROR: -1, + // 以 6 开始的是由微信服务器侧产生的错误码 + // 以 5 开始的是由腾讯云侧产生的错误码 + // 以 4 开始的是本地 SDK 产生的错误 + // 接下来两位表示具体业务类型:01通用,02数据库,03文件,04云函数 + // 最后三位表示具体的错误 + // 小程序 SDK 云函数 + '-404001': 'empty call result', + SDK_FUNCTIONS_EMPTY_CALL_RESULT: -404001, + '-404002': 'empty event id', + SDK_FUNCTIONS_EMPTY_EVENT_ID: -404002, + '-404003': 'empty poll url', + SDK_FUNCTIONS_EMPTY_POLL_URL: -404003, + '-404004': 'empty poll result json', + SDK_FUNCTIONS_EMPTY_POLL_RESULT_JSON: -404004, + '-404005': 'exceed max poll retry', + SDK_FUNCTIONS_EXCEED_MAX_POLL_RETRY: -404005, + '-404006': 'empty poll result base resp', + SDK_FUNCTIONS_EMPTY_POLL_RESULT_BASE_RESP: -404006, + '-404007': 'error while polling for the result, poll result base resp ret %s', + SDK_FUNCTIONS_POLL_RESULT_BASE_RESP_RET_ABNORMAL: -404007, + '-404008': 'error while polling for the result, polling server return a status code of %s', + SDK_FUNCTIONS_POLL_RESULT_STATUS_CODE_ERROR: -404008, + '-404009': 'error while polling for the result: %s', + SDK_FUNCTIONS_POLL_ERROR: -404009, + // 微信服务器 + '-601001': 'system error', + WX_SYSTEM_ERROR: -601001, + '-601002': 'system args error', + WX_SYSTEM_ARGS_ERROR: -601002, + '-601003': 'system network error', + WX_SYSTEM_NETWORK_ERROR: -601003, + '-604100': 'API not found', + WX_FUNCTIONS_SERVER_OPENAPI_NOT_FOUND: -604100, + '-604101': 'function has no permission to call this API', + WX_FUNCTIONS_SERVER_OPENAPI_NO_PERMISSION: -604101, + '-604102': 'call open API timeout', + WX_FUNCTIONS_SERVER_OPENAPI_TIMEOUT: -604102, + '-604103': 'call open API system error', + WX_FUNCTIONS_SERVER_OPENAPI_SYSTEM_ERROR: -604102, + // 腾讯云通用 + '-501001': 'resource system error', + TCB_RESOURCE_SYSTEM_ERROR: -501001, + '-501002': 'resource server timeout', + TCB_RESOURCE_SERVER_TIMEOUT: -501002, + '-501003': 'exceed request limit', + TCB_EXCEED_REQUEST_LIMIT: -501003, + '-501004': 'exceed concurrent request limit', + TCB_EXCEED_CONCURRENT_REQUEST_LIMIT: -501004, + '-501005': 'invalid env', + TCB_INVALID_ENV: -501005, + '-501006': 'invalid common parameters', + TCB_INVALID_COMMON_PARAM: -501006, + '-501007': 'invalid parameters', + TCB_INVALID_PARAM: -501007, + '-501008': 'invalid request source', + TCB_INVALID_REQUEST_SOURCE: -501008, + '-501009': 'resource not initialized', + TCB_RESOURCE_NOT_INITIALIZED: -501009, + // 腾讯云数据库 + '-502001': 'database request fail', + TCB_DB_REQUEST_FAIL: -502001, + '-502002': 'database invalid command', + TCB_DB_INVALID_COMMAND: -502002, + '-502003': 'database permission denied', + TCB_DB_PERMISSION_DENIED: -502003, + '-502004': 'database exceed collection limit', + TCB_DB_EXCEED_COLLECTION_LIMIT: -502004, + '-502005': 'database collection not exists', + TCB_DB_COLLECTION_NOT_EXISTS: -502005, + // 腾讯云文件管理 + '-503001': 'storage request fail', + TCB_STORAGE_REQUEST_FAIL: -503001, + '-503002': 'storage permission denied', + TCB_STORAGE_PERMISSION_DENIED: -503002, + '-503003': 'storage file not exists', + TCB_STORAGE_FILE_NOT_EXISTS: -503003, + '-503004': 'storage invalid sign parameter', + TCB_STORAGE_INVALID_SIGN_PARAM: -503004, + // 腾讯云云函数 + '-504001': 'functions request fail', + TCB_FUNCTIONS_REQUEST_FAIL: -504001, + '-504002': 'functions execute fail', + TCB_FUNCTIONS_EXEC_FAIL: -504002, +}; + + +/***/ }), + +/***/ "./src/config/symbol.config.ts": +/*!*************************************!*\ + !*** ./src/config/symbol.config.ts ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SYMBOL_DYNAMIC_CURRENT_ENV = Symbol.for('DYNAMIC_CURRENT_ENV'); + + +/***/ }), + +/***/ "./src/index.ts": +/*!**********************!*\ + !*** ./src/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +const cloud_1 = __webpack_require__(/*! ./api/cloud */ "./src/api/cloud/index.ts"); +module.exports = cloud_1.default.exportAPI; + + +/***/ }), + +/***/ "./src/protobuf/openapi.js": +/*!*********************************!*\ + !*** ./src/protobuf/openapi.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ + + +var $protobuf = __webpack_require__(/*! protobufjs/minimal */ "protobufjs/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +$root.KeyValuePair = (function() { + + /** + * Properties of a KeyValuePair. + * @exports IKeyValuePair + * @interface IKeyValuePair + * @property {string|null} [key] KeyValuePair key + * @property {Uint8Array|null} [value] KeyValuePair value + * @property {string|null} [contenttype] KeyValuePair contenttype + * @property {string|null} [filename] KeyValuePair filename + */ + + /** + * Constructs a new KeyValuePair. + * @exports KeyValuePair + * @classdesc Represents a KeyValuePair. + * @implements IKeyValuePair + * @constructor + * @param {IKeyValuePair=} [properties] Properties to set + */ + function KeyValuePair(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyValuePair key. + * @member {string} key + * @memberof KeyValuePair + * @instance + */ + KeyValuePair.prototype.key = ""; + + /** + * KeyValuePair value. + * @member {Uint8Array} value + * @memberof KeyValuePair + * @instance + */ + KeyValuePair.prototype.value = $util.newBuffer([]); + + /** + * KeyValuePair contenttype. + * @member {string} contenttype + * @memberof KeyValuePair + * @instance + */ + KeyValuePair.prototype.contenttype = ""; + + /** + * KeyValuePair filename. + * @member {string} filename + * @memberof KeyValuePair + * @instance + */ + KeyValuePair.prototype.filename = ""; + + /** + * Creates a new KeyValuePair instance using the specified properties. + * @function create + * @memberof KeyValuePair + * @static + * @param {IKeyValuePair=} [properties] Properties to set + * @returns {KeyValuePair} KeyValuePair instance + */ + KeyValuePair.create = function create(properties) { + return new KeyValuePair(properties); + }; + + /** + * Encodes the specified KeyValuePair message. Does not implicitly {@link KeyValuePair.verify|verify} messages. + * @function encode + * @memberof KeyValuePair + * @static + * @param {IKeyValuePair} message KeyValuePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValuePair.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.contenttype != null && message.hasOwnProperty("contenttype")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.contenttype); + if (message.filename != null && message.hasOwnProperty("filename")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename); + return writer; + }; + + /** + * Encodes the specified KeyValuePair message, length delimited. Does not implicitly {@link KeyValuePair.verify|verify} messages. + * @function encodeDelimited + * @memberof KeyValuePair + * @static + * @param {IKeyValuePair} message KeyValuePair message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValuePair.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyValuePair message from the specified reader or buffer. + * @function decode + * @memberof KeyValuePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {KeyValuePair} KeyValuePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValuePair.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.KeyValuePair(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.contenttype = reader.string(); + break; + case 4: + message.filename = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyValuePair message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof KeyValuePair + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {KeyValuePair} KeyValuePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValuePair.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyValuePair message. + * @function verify + * @memberof KeyValuePair + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValuePair.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + if (message.contenttype != null && message.hasOwnProperty("contenttype")) + if (!$util.isString(message.contenttype)) + return "contenttype: string expected"; + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + return null; + }; + + /** + * Creates a KeyValuePair message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof KeyValuePair + * @static + * @param {Object.} object Plain object + * @returns {KeyValuePair} KeyValuePair + */ + KeyValuePair.fromObject = function fromObject(object) { + if (object instanceof $root.KeyValuePair) + return object; + var message = new $root.KeyValuePair(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + if (object.contenttype != null) + message.contenttype = String(object.contenttype); + if (object.filename != null) + message.filename = String(object.filename); + return message; + }; + + /** + * Creates a plain object from a KeyValuePair message. Also converts values to other types if specified. + * @function toObject + * @memberof KeyValuePair + * @static + * @param {KeyValuePair} message KeyValuePair + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValuePair.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + object.contenttype = ""; + object.filename = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.contenttype != null && message.hasOwnProperty("contenttype")) + object.contenttype = message.contenttype; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + return object; + }; + + /** + * Converts this KeyValuePair to JSON. + * @function toJSON + * @memberof KeyValuePair + * @instance + * @returns {Object.} JSON object + */ + KeyValuePair.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyValuePair; +})(); + +$root.OpenApiData = (function() { + + /** + * Properties of an OpenApiData. + * @exports IOpenApiData + * @interface IOpenApiData + * @property {Array.|null} [pairs] OpenApiData pairs + */ + + /** + * Constructs a new OpenApiData. + * @exports OpenApiData + * @classdesc Represents an OpenApiData. + * @implements IOpenApiData + * @constructor + * @param {IOpenApiData=} [properties] Properties to set + */ + function OpenApiData(properties) { + this.pairs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenApiData pairs. + * @member {Array.} pairs + * @memberof OpenApiData + * @instance + */ + OpenApiData.prototype.pairs = $util.emptyArray; + + /** + * Creates a new OpenApiData instance using the specified properties. + * @function create + * @memberof OpenApiData + * @static + * @param {IOpenApiData=} [properties] Properties to set + * @returns {OpenApiData} OpenApiData instance + */ + OpenApiData.create = function create(properties) { + return new OpenApiData(properties); + }; + + /** + * Encodes the specified OpenApiData message. Does not implicitly {@link OpenApiData.verify|verify} messages. + * @function encode + * @memberof OpenApiData + * @static + * @param {IOpenApiData} message OpenApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pairs != null && message.pairs.length) + for (var i = 0; i < message.pairs.length; ++i) + $root.KeyValuePair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OpenApiData message, length delimited. Does not implicitly {@link OpenApiData.verify|verify} messages. + * @function encodeDelimited + * @memberof OpenApiData + * @static + * @param {IOpenApiData} message OpenApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiData message from the specified reader or buffer. + * @function decode + * @memberof OpenApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {OpenApiData} OpenApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpenApiData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.KeyValuePair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof OpenApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {OpenApiData} OpenApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiData message. + * @function verify + * @memberof OpenApiData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (var i = 0; i < message.pairs.length; ++i) { + var error = $root.KeyValuePair.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } + } + return null; + }; + + /** + * Creates an OpenApiData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof OpenApiData + * @static + * @param {Object.} object Plain object + * @returns {OpenApiData} OpenApiData + */ + OpenApiData.fromObject = function fromObject(object) { + if (object instanceof $root.OpenApiData) + return object; + var message = new $root.OpenApiData(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".OpenApiData.pairs: array expected"); + message.pairs = []; + for (var i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".OpenApiData.pairs: object expected"); + message.pairs[i] = $root.KeyValuePair.fromObject(object.pairs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OpenApiData message. Also converts values to other types if specified. + * @function toObject + * @memberof OpenApiData + * @static + * @param {OpenApiData} message OpenApiData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pairs = []; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (var j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.KeyValuePair.toObject(message.pairs[j], options); + } + return object; + }; + + /** + * Converts this OpenApiData to JSON. + * @function toJSON + * @memberof OpenApiData + * @instance + * @returns {Object.} JSON object + */ + OpenApiData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OpenApiData; +})(); + +$root.CommApiData = (function() { + + /** + * Properties of a CommApiData. + * @exports ICommApiData + * @interface ICommApiData + * @property {CommApiData.ApiType|null} [apiType] CommApiData apiType + * @property {IOpenApiData|null} [openapiData] CommApiData openapiData + * @property {IInnerApiData|null} [innerData] CommApiData innerData + * @property {ISvrkitApiData|null} [svrkitData] CommApiData svrkitData + */ + + /** + * Constructs a new CommApiData. + * @exports CommApiData + * @classdesc Represents a CommApiData. + * @implements ICommApiData + * @constructor + * @param {ICommApiData=} [properties] Properties to set + */ + function CommApiData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommApiData apiType. + * @member {CommApiData.ApiType} apiType + * @memberof CommApiData + * @instance + */ + CommApiData.prototype.apiType = 0; + + /** + * CommApiData openapiData. + * @member {IOpenApiData|null|undefined} openapiData + * @memberof CommApiData + * @instance + */ + CommApiData.prototype.openapiData = null; + + /** + * CommApiData innerData. + * @member {IInnerApiData|null|undefined} innerData + * @memberof CommApiData + * @instance + */ + CommApiData.prototype.innerData = null; + + /** + * CommApiData svrkitData. + * @member {ISvrkitApiData|null|undefined} svrkitData + * @memberof CommApiData + * @instance + */ + CommApiData.prototype.svrkitData = null; + + /** + * Creates a new CommApiData instance using the specified properties. + * @function create + * @memberof CommApiData + * @static + * @param {ICommApiData=} [properties] Properties to set + * @returns {CommApiData} CommApiData instance + */ + CommApiData.create = function create(properties) { + return new CommApiData(properties); + }; + + /** + * Encodes the specified CommApiData message. Does not implicitly {@link CommApiData.verify|verify} messages. + * @function encode + * @memberof CommApiData + * @static + * @param {ICommApiData} message CommApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommApiData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiType != null && message.hasOwnProperty("apiType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.apiType); + if (message.openapiData != null && message.hasOwnProperty("openapiData")) + $root.OpenApiData.encode(message.openapiData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.innerData != null && message.hasOwnProperty("innerData")) + $root.InnerApiData.encode(message.innerData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.svrkitData != null && message.hasOwnProperty("svrkitData")) + $root.SvrkitApiData.encode(message.svrkitData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommApiData message, length delimited. Does not implicitly {@link CommApiData.verify|verify} messages. + * @function encodeDelimited + * @memberof CommApiData + * @static + * @param {ICommApiData} message CommApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommApiData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommApiData message from the specified reader or buffer. + * @function decode + * @memberof CommApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {CommApiData} CommApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommApiData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommApiData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.apiType = reader.int32(); + break; + case 2: + message.openapiData = $root.OpenApiData.decode(reader, reader.uint32()); + break; + case 3: + message.innerData = $root.InnerApiData.decode(reader, reader.uint32()); + break; + case 4: + message.svrkitData = $root.SvrkitApiData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommApiData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof CommApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {CommApiData} CommApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommApiData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommApiData message. + * @function verify + * @memberof CommApiData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommApiData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiType != null && message.hasOwnProperty("apiType")) + switch (message.apiType) { + default: + return "apiType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.openapiData != null && message.hasOwnProperty("openapiData")) { + var error = $root.OpenApiData.verify(message.openapiData); + if (error) + return "openapiData." + error; + } + if (message.innerData != null && message.hasOwnProperty("innerData")) { + var error = $root.InnerApiData.verify(message.innerData); + if (error) + return "innerData." + error; + } + if (message.svrkitData != null && message.hasOwnProperty("svrkitData")) { + var error = $root.SvrkitApiData.verify(message.svrkitData); + if (error) + return "svrkitData." + error; + } + return null; + }; + + /** + * Creates a CommApiData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof CommApiData + * @static + * @param {Object.} object Plain object + * @returns {CommApiData} CommApiData + */ + CommApiData.fromObject = function fromObject(object) { + if (object instanceof $root.CommApiData) + return object; + var message = new $root.CommApiData(); + switch (object.apiType) { + case "OPEN_API": + case 0: + message.apiType = 0; + break; + case "INNER_API": + case 1: + message.apiType = 1; + break; + case "SVRKIT_API": + case 2: + message.apiType = 2; + break; + } + if (object.openapiData != null) { + if (typeof object.openapiData !== "object") + throw TypeError(".CommApiData.openapiData: object expected"); + message.openapiData = $root.OpenApiData.fromObject(object.openapiData); + } + if (object.innerData != null) { + if (typeof object.innerData !== "object") + throw TypeError(".CommApiData.innerData: object expected"); + message.innerData = $root.InnerApiData.fromObject(object.innerData); + } + if (object.svrkitData != null) { + if (typeof object.svrkitData !== "object") + throw TypeError(".CommApiData.svrkitData: object expected"); + message.svrkitData = $root.SvrkitApiData.fromObject(object.svrkitData); + } + return message; + }; + + /** + * Creates a plain object from a CommApiData message. Also converts values to other types if specified. + * @function toObject + * @memberof CommApiData + * @static + * @param {CommApiData} message CommApiData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommApiData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiType = options.enums === String ? "OPEN_API" : 0; + object.openapiData = null; + object.innerData = null; + object.svrkitData = null; + } + if (message.apiType != null && message.hasOwnProperty("apiType")) + object.apiType = options.enums === String ? $root.CommApiData.ApiType[message.apiType] : message.apiType; + if (message.openapiData != null && message.hasOwnProperty("openapiData")) + object.openapiData = $root.OpenApiData.toObject(message.openapiData, options); + if (message.innerData != null && message.hasOwnProperty("innerData")) + object.innerData = $root.InnerApiData.toObject(message.innerData, options); + if (message.svrkitData != null && message.hasOwnProperty("svrkitData")) + object.svrkitData = $root.SvrkitApiData.toObject(message.svrkitData, options); + return object; + }; + + /** + * Converts this CommApiData to JSON. + * @function toJSON + * @memberof CommApiData + * @instance + * @returns {Object.} JSON object + */ + CommApiData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ApiType enum. + * @name CommApiData.ApiType + * @enum {string} + * @property {number} OPEN_API=0 OPEN_API value + * @property {number} INNER_API=1 INNER_API value + * @property {number} SVRKIT_API=2 SVRKIT_API value + */ + CommApiData.ApiType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPEN_API"] = 0; + values[valuesById[1] = "INNER_API"] = 1; + values[valuesById[2] = "SVRKIT_API"] = 2; + return values; + })(); + + return CommApiData; +})(); + +$root.CommOpenApiResp = (function() { + + /** + * Properties of a CommOpenApiResp. + * @exports ICommOpenApiResp + * @interface ICommOpenApiResp + * @property {Uint8Array|null} [respData] CommOpenApiResp respData + * @property {string|null} [contentType] CommOpenApiResp contentType + * @property {number|null} [errorCode] CommOpenApiResp errorCode + * @property {number|null} [httpCode] CommOpenApiResp httpCode + * @property {Array.|null} [headers] CommOpenApiResp headers + * @property {number|null} [svrkitErrorCode] CommOpenApiResp svrkitErrorCode + */ + + /** + * Constructs a new CommOpenApiResp. + * @exports CommOpenApiResp + * @classdesc Represents a CommOpenApiResp. + * @implements ICommOpenApiResp + * @constructor + * @param {ICommOpenApiResp=} [properties] Properties to set + */ + function CommOpenApiResp(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommOpenApiResp respData. + * @member {Uint8Array} respData + * @memberof CommOpenApiResp + * @instance + */ + CommOpenApiResp.prototype.respData = $util.newBuffer([]); + + /** + * CommOpenApiResp contentType. + * @member {string} contentType + * @memberof CommOpenApiResp + * @instance + */ + CommOpenApiResp.prototype.contentType = ""; + + /** + * CommOpenApiResp errorCode. + * @member {number} errorCode + * @memberof CommOpenApiResp + * @instance + */ + CommOpenApiResp.prototype.errorCode = 0; + + /** + * CommOpenApiResp httpCode. + * @member {number} httpCode + * @memberof CommOpenApiResp + * @instance + */ + CommOpenApiResp.prototype.httpCode = 0; + + /** + * CommOpenApiResp headers. + * @member {Array.} headers + * @memberof CommOpenApiResp + * @instance + */ + CommOpenApiResp.prototype.headers = $util.emptyArray; + + /** + * CommOpenApiResp svrkitErrorCode. + * @member {number} svrkitErrorCode + * @memberof CommOpenApiResp + * @instance + */ + CommOpenApiResp.prototype.svrkitErrorCode = 0; + + /** + * Creates a new CommOpenApiResp instance using the specified properties. + * @function create + * @memberof CommOpenApiResp + * @static + * @param {ICommOpenApiResp=} [properties] Properties to set + * @returns {CommOpenApiResp} CommOpenApiResp instance + */ + CommOpenApiResp.create = function create(properties) { + return new CommOpenApiResp(properties); + }; + + /** + * Encodes the specified CommOpenApiResp message. Does not implicitly {@link CommOpenApiResp.verify|verify} messages. + * @function encode + * @memberof CommOpenApiResp + * @static + * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommOpenApiResp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.respData != null && message.hasOwnProperty("respData")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.respData); + if (message.contentType != null && message.hasOwnProperty("contentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.contentType); + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCode); + if (message.httpCode != null && message.hasOwnProperty("httpCode")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.httpCode); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.HttpHeader.encode(message.headers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.svrkitErrorCode != null && message.hasOwnProperty("svrkitErrorCode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.svrkitErrorCode); + return writer; + }; + + /** + * Encodes the specified CommOpenApiResp message, length delimited. Does not implicitly {@link CommOpenApiResp.verify|verify} messages. + * @function encodeDelimited + * @memberof CommOpenApiResp + * @static + * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommOpenApiResp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommOpenApiResp message from the specified reader or buffer. + * @function decode + * @memberof CommOpenApiResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {CommOpenApiResp} CommOpenApiResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommOpenApiResp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommOpenApiResp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.respData = reader.bytes(); + break; + case 2: + message.contentType = reader.string(); + break; + case 3: + message.errorCode = reader.int32(); + break; + case 4: + message.httpCode = reader.uint32(); + break; + case 5: + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.HttpHeader.decode(reader, reader.uint32())); + break; + case 6: + message.svrkitErrorCode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommOpenApiResp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof CommOpenApiResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {CommOpenApiResp} CommOpenApiResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommOpenApiResp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommOpenApiResp message. + * @function verify + * @memberof CommOpenApiResp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommOpenApiResp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.respData != null && message.hasOwnProperty("respData")) + if (!(message.respData && typeof message.respData.length === "number" || $util.isString(message.respData))) + return "respData: buffer expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + if (!$util.isInteger(message.errorCode)) + return "errorCode: integer expected"; + if (message.httpCode != null && message.hasOwnProperty("httpCode")) + if (!$util.isInteger(message.httpCode)) + return "httpCode: integer expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.HttpHeader.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.svrkitErrorCode != null && message.hasOwnProperty("svrkitErrorCode")) + if (!$util.isInteger(message.svrkitErrorCode)) + return "svrkitErrorCode: integer expected"; + return null; + }; + + /** + * Creates a CommOpenApiResp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof CommOpenApiResp + * @static + * @param {Object.} object Plain object + * @returns {CommOpenApiResp} CommOpenApiResp + */ + CommOpenApiResp.fromObject = function fromObject(object) { + if (object instanceof $root.CommOpenApiResp) + return object; + var message = new $root.CommOpenApiResp(); + if (object.respData != null) + if (typeof object.respData === "string") + $util.base64.decode(object.respData, message.respData = $util.newBuffer($util.base64.length(object.respData)), 0); + else if (object.respData.length) + message.respData = object.respData; + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.errorCode != null) + message.errorCode = object.errorCode | 0; + if (object.httpCode != null) + message.httpCode = object.httpCode >>> 0; + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".CommOpenApiResp.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".CommOpenApiResp.headers: object expected"); + message.headers[i] = $root.HttpHeader.fromObject(object.headers[i]); + } + } + if (object.svrkitErrorCode != null) + message.svrkitErrorCode = object.svrkitErrorCode | 0; + return message; + }; + + /** + * Creates a plain object from a CommOpenApiResp message. Also converts values to other types if specified. + * @function toObject + * @memberof CommOpenApiResp + * @static + * @param {CommOpenApiResp} message CommOpenApiResp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommOpenApiResp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (options.defaults) { + if (options.bytes === String) + object.respData = ""; + else { + object.respData = []; + if (options.bytes !== Array) + object.respData = $util.newBuffer(object.respData); + } + object.contentType = ""; + object.errorCode = 0; + object.httpCode = 0; + object.svrkitErrorCode = 0; + } + if (message.respData != null && message.hasOwnProperty("respData")) + object.respData = options.bytes === String ? $util.base64.encode(message.respData, 0, message.respData.length) : options.bytes === Array ? Array.prototype.slice.call(message.respData) : message.respData; + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = message.errorCode; + if (message.httpCode != null && message.hasOwnProperty("httpCode")) + object.httpCode = message.httpCode; + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.HttpHeader.toObject(message.headers[j], options); + } + if (message.svrkitErrorCode != null && message.hasOwnProperty("svrkitErrorCode")) + object.svrkitErrorCode = message.svrkitErrorCode; + return object; + }; + + /** + * Converts this CommOpenApiResp to JSON. + * @function toJSON + * @memberof CommOpenApiResp + * @instance + * @returns {Object.} JSON object + */ + CommOpenApiResp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommOpenApiResp; +})(); + +$root.InnerApiData = (function() { + + /** + * Properties of an InnerApiData. + * @exports IInnerApiData + * @interface IInnerApiData + * @property {number|null} [modid] InnerApiData modid + * @property {number|null} [cmdid] InnerApiData cmdid + * @property {string|null} [url] InnerApiData url + * @property {boolean|null} [useHttps] InnerApiData useHttps + * @property {HTTP_METHODS|null} [method] InnerApiData method + * @property {Array.|null} [headers] InnerApiData headers + * @property {Uint8Array|null} [body] InnerApiData body + */ + + /** + * Constructs a new InnerApiData. + * @exports InnerApiData + * @classdesc Represents an InnerApiData. + * @implements IInnerApiData + * @constructor + * @param {IInnerApiData=} [properties] Properties to set + */ + function InnerApiData(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InnerApiData modid. + * @member {number} modid + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.modid = 0; + + /** + * InnerApiData cmdid. + * @member {number} cmdid + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.cmdid = 0; + + /** + * InnerApiData url. + * @member {string} url + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.url = ""; + + /** + * InnerApiData useHttps. + * @member {boolean} useHttps + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.useHttps = false; + + /** + * InnerApiData method. + * @member {HTTP_METHODS} method + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.method = 1; + + /** + * InnerApiData headers. + * @member {Array.} headers + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.headers = $util.emptyArray; + + /** + * InnerApiData body. + * @member {Uint8Array} body + * @memberof InnerApiData + * @instance + */ + InnerApiData.prototype.body = $util.newBuffer([]); + + /** + * Creates a new InnerApiData instance using the specified properties. + * @function create + * @memberof InnerApiData + * @static + * @param {IInnerApiData=} [properties] Properties to set + * @returns {InnerApiData} InnerApiData instance + */ + InnerApiData.create = function create(properties) { + return new InnerApiData(properties); + }; + + /** + * Encodes the specified InnerApiData message. Does not implicitly {@link InnerApiData.verify|verify} messages. + * @function encode + * @memberof InnerApiData + * @static + * @param {IInnerApiData} message InnerApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InnerApiData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modid != null && message.hasOwnProperty("modid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.modid); + if (message.cmdid != null && message.hasOwnProperty("cmdid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.cmdid); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.url); + if (message.useHttps != null && message.hasOwnProperty("useHttps")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useHttps); + if (message.method != null && message.hasOwnProperty("method")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.method); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.headers[i]); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.body); + return writer; + }; + + /** + * Encodes the specified InnerApiData message, length delimited. Does not implicitly {@link InnerApiData.verify|verify} messages. + * @function encodeDelimited + * @memberof InnerApiData + * @static + * @param {IInnerApiData} message InnerApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InnerApiData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InnerApiData message from the specified reader or buffer. + * @function decode + * @memberof InnerApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {InnerApiData} InnerApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InnerApiData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.InnerApiData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modid = reader.uint32(); + break; + case 2: + message.cmdid = reader.uint32(); + break; + case 3: + message.url = reader.string(); + break; + case 4: + message.useHttps = reader.bool(); + break; + case 5: + message.method = reader.int32(); + break; + case 6: + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push(reader.string()); + break; + case 7: + message.body = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InnerApiData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof InnerApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {InnerApiData} InnerApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InnerApiData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InnerApiData message. + * @function verify + * @memberof InnerApiData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InnerApiData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modid != null && message.hasOwnProperty("modid")) + if (!$util.isInteger(message.modid)) + return "modid: integer expected"; + if (message.cmdid != null && message.hasOwnProperty("cmdid")) + if (!$util.isInteger(message.cmdid)) + return "cmdid: integer expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.useHttps != null && message.hasOwnProperty("useHttps")) + if (typeof message.useHttps !== "boolean") + return "useHttps: boolean expected"; + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) + if (!$util.isString(message.headers[i])) + return "headers: string[] expected"; + } + if (message.body != null && message.hasOwnProperty("body")) + if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body))) + return "body: buffer expected"; + return null; + }; + + /** + * Creates an InnerApiData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof InnerApiData + * @static + * @param {Object.} object Plain object + * @returns {InnerApiData} InnerApiData + */ + InnerApiData.fromObject = function fromObject(object) { + if (object instanceof $root.InnerApiData) + return object; + var message = new $root.InnerApiData(); + if (object.modid != null) + message.modid = object.modid >>> 0; + if (object.cmdid != null) + message.cmdid = object.cmdid >>> 0; + if (object.url != null) + message.url = String(object.url); + if (object.useHttps != null) + message.useHttps = Boolean(object.useHttps); + switch (object.method) { + case "HTTP_GET": + case 1: + message.method = 1; + break; + case "HTTP_POST": + case 2: + message.method = 2; + break; + case "HTTP_PUT": + case 3: + message.method = 3; + break; + case "HTTP_DELETE": + case 4: + message.method = 4; + break; + case "HTTP_HEAD": + case 5: + message.method = 5; + break; + case "HTTP_PATCH": + case 6: + message.method = 6; + break; + } + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".InnerApiData.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) + message.headers[i] = String(object.headers[i]); + } + if (object.body != null) + if (typeof object.body === "string") + $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0); + else if (object.body.length) + message.body = object.body; + return message; + }; + + /** + * Creates a plain object from an InnerApiData message. Also converts values to other types if specified. + * @function toObject + * @memberof InnerApiData + * @static + * @param {InnerApiData} message InnerApiData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InnerApiData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (options.defaults) { + object.modid = 0; + object.cmdid = 0; + object.url = ""; + object.useHttps = false; + object.method = options.enums === String ? "HTTP_GET" : 1; + if (options.bytes === String) + object.body = ""; + else { + object.body = []; + if (options.bytes !== Array) + object.body = $util.newBuffer(object.body); + } + } + if (message.modid != null && message.hasOwnProperty("modid")) + object.modid = message.modid; + if (message.cmdid != null && message.hasOwnProperty("cmdid")) + object.cmdid = message.cmdid; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.useHttps != null && message.hasOwnProperty("useHttps")) + object.useHttps = message.useHttps; + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.HTTP_METHODS[message.method] : message.method; + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = message.headers[j]; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body; + return object; + }; + + /** + * Converts this InnerApiData to JSON. + * @function toJSON + * @memberof InnerApiData + * @instance + * @returns {Object.} JSON object + */ + InnerApiData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InnerApiData; +})(); + +$root.SvrkitApiData = (function() { + + /** + * Properties of a SvrkitApiData. + * @exports ISvrkitApiData + * @interface ISvrkitApiData + * @property {string|null} [apiName] SvrkitApiData apiName + * @property {Uint8Array|null} [reqData] SvrkitApiData reqData + */ + + /** + * Constructs a new SvrkitApiData. + * @exports SvrkitApiData + * @classdesc Represents a SvrkitApiData. + * @implements ISvrkitApiData + * @constructor + * @param {ISvrkitApiData=} [properties] Properties to set + */ + function SvrkitApiData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SvrkitApiData apiName. + * @member {string} apiName + * @memberof SvrkitApiData + * @instance + */ + SvrkitApiData.prototype.apiName = ""; + + /** + * SvrkitApiData reqData. + * @member {Uint8Array} reqData + * @memberof SvrkitApiData + * @instance + */ + SvrkitApiData.prototype.reqData = $util.newBuffer([]); + + /** + * Creates a new SvrkitApiData instance using the specified properties. + * @function create + * @memberof SvrkitApiData + * @static + * @param {ISvrkitApiData=} [properties] Properties to set + * @returns {SvrkitApiData} SvrkitApiData instance + */ + SvrkitApiData.create = function create(properties) { + return new SvrkitApiData(properties); + }; + + /** + * Encodes the specified SvrkitApiData message. Does not implicitly {@link SvrkitApiData.verify|verify} messages. + * @function encode + * @memberof SvrkitApiData + * @static + * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SvrkitApiData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiName != null && message.hasOwnProperty("apiName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiName); + if (message.reqData != null && message.hasOwnProperty("reqData")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.reqData); + return writer; + }; + + /** + * Encodes the specified SvrkitApiData message, length delimited. Does not implicitly {@link SvrkitApiData.verify|verify} messages. + * @function encodeDelimited + * @memberof SvrkitApiData + * @static + * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SvrkitApiData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SvrkitApiData message from the specified reader or buffer. + * @function decode + * @memberof SvrkitApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {SvrkitApiData} SvrkitApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SvrkitApiData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SvrkitApiData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.apiName = reader.string(); + break; + case 2: + message.reqData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SvrkitApiData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof SvrkitApiData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {SvrkitApiData} SvrkitApiData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SvrkitApiData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SvrkitApiData message. + * @function verify + * @memberof SvrkitApiData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SvrkitApiData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiName != null && message.hasOwnProperty("apiName")) + if (!$util.isString(message.apiName)) + return "apiName: string expected"; + if (message.reqData != null && message.hasOwnProperty("reqData")) + if (!(message.reqData && typeof message.reqData.length === "number" || $util.isString(message.reqData))) + return "reqData: buffer expected"; + return null; + }; + + /** + * Creates a SvrkitApiData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof SvrkitApiData + * @static + * @param {Object.} object Plain object + * @returns {SvrkitApiData} SvrkitApiData + */ + SvrkitApiData.fromObject = function fromObject(object) { + if (object instanceof $root.SvrkitApiData) + return object; + var message = new $root.SvrkitApiData(); + if (object.apiName != null) + message.apiName = String(object.apiName); + if (object.reqData != null) + if (typeof object.reqData === "string") + $util.base64.decode(object.reqData, message.reqData = $util.newBuffer($util.base64.length(object.reqData)), 0); + else if (object.reqData.length) + message.reqData = object.reqData; + return message; + }; + + /** + * Creates a plain object from a SvrkitApiData message. Also converts values to other types if specified. + * @function toObject + * @memberof SvrkitApiData + * @static + * @param {SvrkitApiData} message SvrkitApiData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SvrkitApiData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiName = ""; + if (options.bytes === String) + object.reqData = ""; + else { + object.reqData = []; + if (options.bytes !== Array) + object.reqData = $util.newBuffer(object.reqData); + } + } + if (message.apiName != null && message.hasOwnProperty("apiName")) + object.apiName = message.apiName; + if (message.reqData != null && message.hasOwnProperty("reqData")) + object.reqData = options.bytes === String ? $util.base64.encode(message.reqData, 0, message.reqData.length) : options.bytes === Array ? Array.prototype.slice.call(message.reqData) : message.reqData; + return object; + }; + + /** + * Converts this SvrkitApiData to JSON. + * @function toJSON + * @memberof SvrkitApiData + * @instance + * @returns {Object.} JSON object + */ + SvrkitApiData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SvrkitApiData; +})(); + +/** + * HTTP_METHODS enum. + * @exports HTTP_METHODS + * @enum {string} + * @property {number} HTTP_GET=1 HTTP_GET value + * @property {number} HTTP_POST=2 HTTP_POST value + * @property {number} HTTP_PUT=3 HTTP_PUT value + * @property {number} HTTP_DELETE=4 HTTP_DELETE value + * @property {number} HTTP_HEAD=5 HTTP_HEAD value + * @property {number} HTTP_PATCH=6 HTTP_PATCH value + */ +$root.HTTP_METHODS = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "HTTP_GET"] = 1; + values[valuesById[2] = "HTTP_POST"] = 2; + values[valuesById[3] = "HTTP_PUT"] = 3; + values[valuesById[4] = "HTTP_DELETE"] = 4; + values[valuesById[5] = "HTTP_HEAD"] = 5; + values[valuesById[6] = "HTTP_PATCH"] = 6; + return values; +})(); + +$root.HttpHeader = (function() { + + /** + * Properties of a HttpHeader. + * @exports IHttpHeader + * @interface IHttpHeader + * @property {string|null} [key] HttpHeader key + * @property {string|null} [value] HttpHeader value + */ + + /** + * Constructs a new HttpHeader. + * @exports HttpHeader + * @classdesc Represents a HttpHeader. + * @implements IHttpHeader + * @constructor + * @param {IHttpHeader=} [properties] Properties to set + */ + function HttpHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpHeader key. + * @member {string} key + * @memberof HttpHeader + * @instance + */ + HttpHeader.prototype.key = ""; + + /** + * HttpHeader value. + * @member {string} value + * @memberof HttpHeader + * @instance + */ + HttpHeader.prototype.value = ""; + + /** + * Creates a new HttpHeader instance using the specified properties. + * @function create + * @memberof HttpHeader + * @static + * @param {IHttpHeader=} [properties] Properties to set + * @returns {HttpHeader} HttpHeader instance + */ + HttpHeader.create = function create(properties) { + return new HttpHeader(properties); + }; + + /** + * Encodes the specified HttpHeader message. Does not implicitly {@link HttpHeader.verify|verify} messages. + * @function encode + * @memberof HttpHeader + * @static + * @param {IHttpHeader} message HttpHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link HttpHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof HttpHeader + * @static + * @param {IHttpHeader} message HttpHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpHeader message from the specified reader or buffer. + * @function decode + * @memberof HttpHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {HttpHeader} HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HttpHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof HttpHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {HttpHeader} HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpHeader message. + * @function verify + * @memberof HttpHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof HttpHeader + * @static + * @param {Object.} object Plain object + * @returns {HttpHeader} HttpHeader + */ + HttpHeader.fromObject = function fromObject(object) { + if (object instanceof $root.HttpHeader) + return object; + var message = new $root.HttpHeader(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a HttpHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof HttpHeader + * @static + * @param {HttpHeader} message HttpHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this HttpHeader to JSON. + * @function toJSON + * @memberof HttpHeader + * @instance + * @returns {Object.} JSON object + */ + HttpHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpHeader; +})(); + +$root.ApiGetOpenDataByCloudIdReq = (function() { + + /** + * Properties of an ApiGetOpenDataByCloudIdReq. + * @exports IApiGetOpenDataByCloudIdReq + * @interface IApiGetOpenDataByCloudIdReq + * @property {Array.|null} [cloudidList] ApiGetOpenDataByCloudIdReq cloudidList + */ + + /** + * Constructs a new ApiGetOpenDataByCloudIdReq. + * @exports ApiGetOpenDataByCloudIdReq + * @classdesc Represents an ApiGetOpenDataByCloudIdReq. + * @implements IApiGetOpenDataByCloudIdReq + * @constructor + * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set + */ + function ApiGetOpenDataByCloudIdReq(properties) { + this.cloudidList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiGetOpenDataByCloudIdReq cloudidList. + * @member {Array.} cloudidList + * @memberof ApiGetOpenDataByCloudIdReq + * @instance + */ + ApiGetOpenDataByCloudIdReq.prototype.cloudidList = $util.emptyArray; + + /** + * Creates a new ApiGetOpenDataByCloudIdReq instance using the specified properties. + * @function create + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set + * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq instance + */ + ApiGetOpenDataByCloudIdReq.create = function create(properties) { + return new ApiGetOpenDataByCloudIdReq(properties); + }; + + /** + * Encodes the specified ApiGetOpenDataByCloudIdReq message. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages. + * @function encode + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiGetOpenDataByCloudIdReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudidList != null && message.cloudidList.length) + for (var i = 0; i < message.cloudidList.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cloudidList[i]); + return writer; + }; + + /** + * Encodes the specified ApiGetOpenDataByCloudIdReq message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages. + * @function encodeDelimited + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiGetOpenDataByCloudIdReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer. + * @function decode + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiGetOpenDataByCloudIdReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.cloudidList && message.cloudidList.length)) + message.cloudidList = []; + message.cloudidList.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiGetOpenDataByCloudIdReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiGetOpenDataByCloudIdReq message. + * @function verify + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiGetOpenDataByCloudIdReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudidList != null && message.hasOwnProperty("cloudidList")) { + if (!Array.isArray(message.cloudidList)) + return "cloudidList: array expected"; + for (var i = 0; i < message.cloudidList.length; ++i) + if (!$util.isString(message.cloudidList[i])) + return "cloudidList: string[] expected"; + } + return null; + }; + + /** + * Creates an ApiGetOpenDataByCloudIdReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {Object.} object Plain object + * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq + */ + ApiGetOpenDataByCloudIdReq.fromObject = function fromObject(object) { + if (object instanceof $root.ApiGetOpenDataByCloudIdReq) + return object; + var message = new $root.ApiGetOpenDataByCloudIdReq(); + if (object.cloudidList) { + if (!Array.isArray(object.cloudidList)) + throw TypeError(".ApiGetOpenDataByCloudIdReq.cloudidList: array expected"); + message.cloudidList = []; + for (var i = 0; i < object.cloudidList.length; ++i) + message.cloudidList[i] = String(object.cloudidList[i]); + } + return message; + }; + + /** + * Creates a plain object from an ApiGetOpenDataByCloudIdReq message. Also converts values to other types if specified. + * @function toObject + * @memberof ApiGetOpenDataByCloudIdReq + * @static + * @param {ApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiGetOpenDataByCloudIdReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cloudidList = []; + if (message.cloudidList && message.cloudidList.length) { + object.cloudidList = []; + for (var j = 0; j < message.cloudidList.length; ++j) + object.cloudidList[j] = message.cloudidList[j]; + } + return object; + }; + + /** + * Converts this ApiGetOpenDataByCloudIdReq to JSON. + * @function toJSON + * @memberof ApiGetOpenDataByCloudIdReq + * @instance + * @returns {Object.} JSON object + */ + ApiGetOpenDataByCloudIdReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApiGetOpenDataByCloudIdReq; +})(); + +$root.ApiGetOpenDataByCloudIdResp = (function() { + + /** + * Properties of an ApiGetOpenDataByCloudIdResp. + * @exports IApiGetOpenDataByCloudIdResp + * @interface IApiGetOpenDataByCloudIdResp + * @property {Array.|null} [dataList] ApiGetOpenDataByCloudIdResp dataList + */ + + /** + * Constructs a new ApiGetOpenDataByCloudIdResp. + * @exports ApiGetOpenDataByCloudIdResp + * @classdesc Represents an ApiGetOpenDataByCloudIdResp. + * @implements IApiGetOpenDataByCloudIdResp + * @constructor + * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set + */ + function ApiGetOpenDataByCloudIdResp(properties) { + this.dataList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiGetOpenDataByCloudIdResp dataList. + * @member {Array.} dataList + * @memberof ApiGetOpenDataByCloudIdResp + * @instance + */ + ApiGetOpenDataByCloudIdResp.prototype.dataList = $util.emptyArray; + + /** + * Creates a new ApiGetOpenDataByCloudIdResp instance using the specified properties. + * @function create + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set + * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp instance + */ + ApiGetOpenDataByCloudIdResp.create = function create(properties) { + return new ApiGetOpenDataByCloudIdResp(properties); + }; + + /** + * Encodes the specified ApiGetOpenDataByCloudIdResp message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages. + * @function encode + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiGetOpenDataByCloudIdResp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataList != null && message.dataList.length) + for (var i = 0; i < message.dataList.length; ++i) + $root.ApiGetOpenDataByCloudIdResp.OpDataItem.encode(message.dataList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiGetOpenDataByCloudIdResp message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages. + * @function encodeDelimited + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiGetOpenDataByCloudIdResp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer. + * @function decode + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiGetOpenDataByCloudIdResp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataList && message.dataList.length)) + message.dataList = []; + message.dataList.push($root.ApiGetOpenDataByCloudIdResp.OpDataItem.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiGetOpenDataByCloudIdResp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiGetOpenDataByCloudIdResp message. + * @function verify + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiGetOpenDataByCloudIdResp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataList != null && message.hasOwnProperty("dataList")) { + if (!Array.isArray(message.dataList)) + return "dataList: array expected"; + for (var i = 0; i < message.dataList.length; ++i) { + var error = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.verify(message.dataList[i]); + if (error) + return "dataList." + error; + } + } + return null; + }; + + /** + * Creates an ApiGetOpenDataByCloudIdResp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {Object.} object Plain object + * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp + */ + ApiGetOpenDataByCloudIdResp.fromObject = function fromObject(object) { + if (object instanceof $root.ApiGetOpenDataByCloudIdResp) + return object; + var message = new $root.ApiGetOpenDataByCloudIdResp(); + if (object.dataList) { + if (!Array.isArray(object.dataList)) + throw TypeError(".ApiGetOpenDataByCloudIdResp.dataList: array expected"); + message.dataList = []; + for (var i = 0; i < object.dataList.length; ++i) { + if (typeof object.dataList[i] !== "object") + throw TypeError(".ApiGetOpenDataByCloudIdResp.dataList: object expected"); + message.dataList[i] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.fromObject(object.dataList[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiGetOpenDataByCloudIdResp message. Also converts values to other types if specified. + * @function toObject + * @memberof ApiGetOpenDataByCloudIdResp + * @static + * @param {ApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiGetOpenDataByCloudIdResp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataList = []; + if (message.dataList && message.dataList.length) { + object.dataList = []; + for (var j = 0; j < message.dataList.length; ++j) + object.dataList[j] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.toObject(message.dataList[j], options); + } + return object; + }; + + /** + * Converts this ApiGetOpenDataByCloudIdResp to JSON. + * @function toJSON + * @memberof ApiGetOpenDataByCloudIdResp + * @instance + * @returns {Object.} JSON object + */ + ApiGetOpenDataByCloudIdResp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ApiGetOpenDataByCloudIdResp.OpDataItem = (function() { + + /** + * Properties of an OpDataItem. + * @memberof ApiGetOpenDataByCloudIdResp + * @interface IOpDataItem + * @property {string|null} [cloudId] OpDataItem cloudId + * @property {string|null} [json] OpDataItem json + */ + + /** + * Constructs a new OpDataItem. + * @memberof ApiGetOpenDataByCloudIdResp + * @classdesc Represents an OpDataItem. + * @implements IOpDataItem + * @constructor + * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set + */ + function OpDataItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpDataItem cloudId. + * @member {string} cloudId + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @instance + */ + OpDataItem.prototype.cloudId = ""; + + /** + * OpDataItem json. + * @member {string} json + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @instance + */ + OpDataItem.prototype.json = ""; + + /** + * Creates a new OpDataItem instance using the specified properties. + * @function create + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set + * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem instance + */ + OpDataItem.create = function create(properties) { + return new OpDataItem(properties); + }; + + /** + * Encodes the specified OpDataItem message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages. + * @function encode + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpDataItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudId != null && message.hasOwnProperty("cloudId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudId); + if (message.json != null && message.hasOwnProperty("json")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.json); + return writer; + }; + + /** + * Encodes the specified OpDataItem message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages. + * @function encodeDelimited + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpDataItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpDataItem message from the specified reader or buffer. + * @function decode + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpDataItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cloudId = reader.string(); + break; + case 2: + message.json = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpDataItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpDataItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpDataItem message. + * @function verify + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpDataItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudId != null && message.hasOwnProperty("cloudId")) + if (!$util.isString(message.cloudId)) + return "cloudId: string expected"; + if (message.json != null && message.hasOwnProperty("json")) + if (!$util.isString(message.json)) + return "json: string expected"; + return null; + }; + + /** + * Creates an OpDataItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {Object.} object Plain object + * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem + */ + OpDataItem.fromObject = function fromObject(object) { + if (object instanceof $root.ApiGetOpenDataByCloudIdResp.OpDataItem) + return object; + var message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem(); + if (object.cloudId != null) + message.cloudId = String(object.cloudId); + if (object.json != null) + message.json = String(object.json); + return message; + }; + + /** + * Creates a plain object from an OpDataItem message. Also converts values to other types if specified. + * @function toObject + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @static + * @param {ApiGetOpenDataByCloudIdResp.OpDataItem} message OpDataItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpDataItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cloudId = ""; + object.json = ""; + } + if (message.cloudId != null && message.hasOwnProperty("cloudId")) + object.cloudId = message.cloudId; + if (message.json != null && message.hasOwnProperty("json")) + object.json = message.json; + return object; + }; + + /** + * Converts this OpDataItem to JSON. + * @function toJSON + * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem + * @instance + * @returns {Object.} JSON object + */ + OpDataItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OpDataItem; + })(); + + return ApiGetOpenDataByCloudIdResp; +})(); + +$root.ApiVoipSignReq = (function() { + + /** + * Properties of an ApiVoipSignReq. + * @exports IApiVoipSignReq + * @interface IApiVoipSignReq + * @property {string|null} [groupId] ApiVoipSignReq groupId + * @property {number|null} [timestamp] ApiVoipSignReq timestamp + * @property {string|null} [nonce] ApiVoipSignReq nonce + */ + + /** + * Constructs a new ApiVoipSignReq. + * @exports ApiVoipSignReq + * @classdesc Represents an ApiVoipSignReq. + * @implements IApiVoipSignReq + * @constructor + * @param {IApiVoipSignReq=} [properties] Properties to set + */ + function ApiVoipSignReq(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiVoipSignReq groupId. + * @member {string} groupId + * @memberof ApiVoipSignReq + * @instance + */ + ApiVoipSignReq.prototype.groupId = ""; + + /** + * ApiVoipSignReq timestamp. + * @member {number} timestamp + * @memberof ApiVoipSignReq + * @instance + */ + ApiVoipSignReq.prototype.timestamp = 0; + + /** + * ApiVoipSignReq nonce. + * @member {string} nonce + * @memberof ApiVoipSignReq + * @instance + */ + ApiVoipSignReq.prototype.nonce = ""; + + /** + * Creates a new ApiVoipSignReq instance using the specified properties. + * @function create + * @memberof ApiVoipSignReq + * @static + * @param {IApiVoipSignReq=} [properties] Properties to set + * @returns {ApiVoipSignReq} ApiVoipSignReq instance + */ + ApiVoipSignReq.create = function create(properties) { + return new ApiVoipSignReq(properties); + }; + + /** + * Encodes the specified ApiVoipSignReq message. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages. + * @function encode + * @memberof ApiVoipSignReq + * @static + * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVoipSignReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupId != null && message.hasOwnProperty("groupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.timestamp); + if (message.nonce != null && message.hasOwnProperty("nonce")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.nonce); + return writer; + }; + + /** + * Encodes the specified ApiVoipSignReq message, length delimited. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages. + * @function encodeDelimited + * @memberof ApiVoipSignReq + * @static + * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVoipSignReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiVoipSignReq message from the specified reader or buffer. + * @function decode + * @memberof ApiVoipSignReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ApiVoipSignReq} ApiVoipSignReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVoipSignReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.groupId = reader.string(); + break; + case 3: + message.timestamp = reader.uint32(); + break; + case 4: + message.nonce = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiVoipSignReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ApiVoipSignReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ApiVoipSignReq} ApiVoipSignReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVoipSignReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiVoipSignReq message. + * @function verify + * @memberof ApiVoipSignReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiVoipSignReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp)) + return "timestamp: integer expected"; + if (message.nonce != null && message.hasOwnProperty("nonce")) + if (!$util.isString(message.nonce)) + return "nonce: string expected"; + return null; + }; + + /** + * Creates an ApiVoipSignReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ApiVoipSignReq + * @static + * @param {Object.} object Plain object + * @returns {ApiVoipSignReq} ApiVoipSignReq + */ + ApiVoipSignReq.fromObject = function fromObject(object) { + if (object instanceof $root.ApiVoipSignReq) + return object; + var message = new $root.ApiVoipSignReq(); + if (object.groupId != null) + message.groupId = String(object.groupId); + if (object.timestamp != null) + message.timestamp = object.timestamp >>> 0; + if (object.nonce != null) + message.nonce = String(object.nonce); + return message; + }; + + /** + * Creates a plain object from an ApiVoipSignReq message. Also converts values to other types if specified. + * @function toObject + * @memberof ApiVoipSignReq + * @static + * @param {ApiVoipSignReq} message ApiVoipSignReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiVoipSignReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupId = ""; + object.timestamp = 0; + object.nonce = ""; + } + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = message.timestamp; + if (message.nonce != null && message.hasOwnProperty("nonce")) + object.nonce = message.nonce; + return object; + }; + + /** + * Converts this ApiVoipSignReq to JSON. + * @function toJSON + * @memberof ApiVoipSignReq + * @instance + * @returns {Object.} JSON object + */ + ApiVoipSignReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApiVoipSignReq; +})(); + +$root.ApiVoipSignResp = (function() { + + /** + * Properties of an ApiVoipSignResp. + * @exports IApiVoipSignResp + * @interface IApiVoipSignResp + * @property {string|null} [signature] ApiVoipSignResp signature + */ + + /** + * Constructs a new ApiVoipSignResp. + * @exports ApiVoipSignResp + * @classdesc Represents an ApiVoipSignResp. + * @implements IApiVoipSignResp + * @constructor + * @param {IApiVoipSignResp=} [properties] Properties to set + */ + function ApiVoipSignResp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiVoipSignResp signature. + * @member {string} signature + * @memberof ApiVoipSignResp + * @instance + */ + ApiVoipSignResp.prototype.signature = ""; + + /** + * Creates a new ApiVoipSignResp instance using the specified properties. + * @function create + * @memberof ApiVoipSignResp + * @static + * @param {IApiVoipSignResp=} [properties] Properties to set + * @returns {ApiVoipSignResp} ApiVoipSignResp instance + */ + ApiVoipSignResp.create = function create(properties) { + return new ApiVoipSignResp(properties); + }; + + /** + * Encodes the specified ApiVoipSignResp message. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages. + * @function encode + * @memberof ApiVoipSignResp + * @static + * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVoipSignResp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signature != null && message.hasOwnProperty("signature")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature); + return writer; + }; + + /** + * Encodes the specified ApiVoipSignResp message, length delimited. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages. + * @function encodeDelimited + * @memberof ApiVoipSignResp + * @static + * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVoipSignResp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiVoipSignResp message from the specified reader or buffer. + * @function decode + * @memberof ApiVoipSignResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {ApiVoipSignResp} ApiVoipSignResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVoipSignResp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignResp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiVoipSignResp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof ApiVoipSignResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {ApiVoipSignResp} ApiVoipSignResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVoipSignResp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiVoipSignResp message. + * @function verify + * @memberof ApiVoipSignResp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiVoipSignResp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!$util.isString(message.signature)) + return "signature: string expected"; + return null; + }; + + /** + * Creates an ApiVoipSignResp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof ApiVoipSignResp + * @static + * @param {Object.} object Plain object + * @returns {ApiVoipSignResp} ApiVoipSignResp + */ + ApiVoipSignResp.fromObject = function fromObject(object) { + if (object instanceof $root.ApiVoipSignResp) + return object; + var message = new $root.ApiVoipSignResp(); + if (object.signature != null) + message.signature = String(object.signature); + return message; + }; + + /** + * Creates a plain object from an ApiVoipSignResp message. Also converts values to other types if specified. + * @function toObject + * @memberof ApiVoipSignResp + * @static + * @param {ApiVoipSignResp} message ApiVoipSignResp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiVoipSignResp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.signature = ""; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = message.signature; + return object; + }; + + /** + * Converts this ApiVoipSignResp to JSON. + * @function toJSON + * @memberof ApiVoipSignResp + * @instance + * @returns {Object.} JSON object + */ + ApiVoipSignResp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApiVoipSignResp; +})(); + +module.exports = $root; + + +/***/ }), + +/***/ "./src/utils/assert.ts": +/*!*****************************!*\ + !*** ./src/utils/assert.ts ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const type_1 = __webpack_require__(/*! ./type */ "./src/utils/type.ts"); +const error_1 = __webpack_require__(/*! ./error */ "./src/utils/error.ts"); +const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts"); +function sameType(input, ref, name) { + function sameTypeImpl(input, ref, name) { + const inputType = type_1.getType(input); + const refType = type_1.getType(ref); + if (inputType !== refType) { + return `${name} should be ${refType} instead of ${inputType}; `; + } + let errors = ''; + switch (inputType) { + case 'object': { + for (const key in ref) { + errors += sameTypeImpl(input[key], ref[key], `${name}.${key}`); + } + break; + } + case 'array': { + for (let i = 0; i < ref.length; i++) { + errors += sameTypeImpl(input[i], ref[i], `${name}[${i}]`); + } + break; + } + default: { + break; + } + } + return errors; + } + const error = sameTypeImpl(input, ref, name); + return { + passed: !error, + reason: error, + }; +} +exports.sameType = sameType; +function validType(input, ref, name = 'parameter') { + function validTypeImpl(input, ref, name) { + const inputType = type_1.getType(input); + const refType = type_1.getType(ref); + if (refType === 'string') { + if (inputType !== ref) { + return `${name} should be ${ref} instead of ${inputType};`; + } + return ''; + } + else { + if (inputType !== refType) { + return `${name} should be ${refType} instead of ${inputType}; `; + } + let errors = ''; + switch (inputType) { + case 'object': { + for (const key in ref) { + errors += validTypeImpl(input[key], ref[key], `${name}.${key}`); + } + break; + } + case 'array': { + for (let i = 0; i < ref.length; i++) { + errors += validTypeImpl(input[i], ref[i], `${name}[${i}]`); + } + break; + } + default: { + break; + } + } + return errors; + } + } + const error = validTypeImpl(input, ref, name); + return { + passed: !error, + reason: error, + }; +} +exports.validType = validType; +function validObjectOptionalType(input, ref, name = 'parameter') { + function validImpl(input, ref, name) { + const inputType = type_1.getType(input); + const refType = type_1.getType(ref); + if (refType !== 'object') + return ''; + if (inputType === 'object') { + for (const key in input) { + const val = input[key]; + if (val === undefined || key === null) { + continue; + } + const assertResult = validType(val, ref[key], `${name}.${key}`); + return assertResult.passed ? '' : assertResult.reason; + } + } + else { + return `${name} should be object instead of ${inputType}`; + } + return ''; + } + const error = validImpl(input, ref, name); + return { + passed: !error, + reason: error, + }; +} +exports.validObjectOptionalType = validObjectOptionalType; +function assertType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) { + // check param validity + let paramCheckResult = validType(param, ref, name); + if (!paramCheckResult.passed) { + throw new ErrorClass({ + errMsg: paramCheckResult.reason, + }); + } +} +exports.assertType = assertType; +function assertObjectOptionalType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) { + // check param validity + let paramCheckResult = validObjectOptionalType(param, ref, name); + if (!paramCheckResult.passed) { + throw new ErrorClass({ + errMsg: paramCheckResult.reason, + }); + } +} +exports.assertObjectOptionalType = assertObjectOptionalType; +function assertRequiredParam(param, name, funcName, ErrorClass = error_1.CloudSDKError) { + if (param === undefined || param === null) { + throw new ErrorClass({ + errMsg: `parameter ${name} of function ${funcName} must be provided`, + }); + } +} +exports.assertRequiredParam = assertRequiredParam; +function assertObjectNotEmpty({ target, name, ErrorClass = error_1.CloudSDKError }) { + if (Object.keys(target).length === 0) { + throw new ErrorClass({ + errCode: error_config_1.ERR_CODE.SDK_API_PARAMETER_ERROR, + errMsg: `${name} must not be empty` + }); + } +} +exports.assertObjectNotEmpty = assertObjectNotEmpty; +/* +export function constructTypeRef(typeDef: any): any { + + const type = getType(typeDef) + + switch(type) { + case 'string': { + return '' + } + case 'number': { + + } + } + +} +*/ + + +/***/ }), + +/***/ "./src/utils/error.ts": +/*!****************************!*\ + !*** ./src/utils/error.ts ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const type_1 = __webpack_require__(/*! ./type */ "./src/utils/type.ts"); +const msg_1 = __webpack_require__(/*! ./msg */ "./src/utils/msg.ts"); +const error_config_1 = __webpack_require__(/*! config/error.config */ "./src/config/error.config.ts"); +class CloudSDKError extends Error { + constructor(options) { + super(options.errMsg); + this.errCode = -1; + Object.defineProperties(this, { + message: { + get() { + return `errCode: ${this.errCode} ${error_config_1.ERR_CODE[this.errCode] || ''} | errMsg: ` + this.errMsg; + }, + set(msg) { + this.errMsg = msg; + } + } + }); + this.errCode = options.errCode || -1; + this.errMsg = options.errMsg; + } + get message() { + return `errCode: ${this.errCode} | errMsg: ` + this.errMsg; + } + set message(msg) { + this.errMsg = msg; + } +} +exports.CloudSDKError = CloudSDKError; +function createError({ errCode = 1, errMsg = '', errClass = CloudSDKError, } = {}) { + return new errClass({ + errCode, + errMsg, + }); +} +exports.createError = createError; +function isSDKError(error) { + return error && (error instanceof Error) && type_1.isString(error.errMsg); +} +exports.isSDKError = isSDKError; +function returnAsCloudSDKError(err, appendMsg = '') { + if (err) { + if (isSDKError(err)) { + if (appendMsg) { + err.errMsg += '; ' + appendMsg; + } + return err; + } + const errCode = err ? err.errCode : undefined; + const errMsg = (err && err.errMsg || err.toString() || 'unknown error') + '; ' + appendMsg; + return new CloudSDKError({ + errCode, + errMsg, + }); + } + return new CloudSDKError({ + errMsg: appendMsg + }); +} +exports.returnAsCloudSDKError = returnAsCloudSDKError; +function returnAsFinalCloudSDKError(err, apiName) { + if (err && isSDKError(err)) { + return err; + } + const e = returnAsCloudSDKError(err, `at ${apiName} api; `); + e.errMsg = msg_1.apiFailMsg(apiName, e.errMsg); + return e; +} +exports.returnAsFinalCloudSDKError = returnAsFinalCloudSDKError; + + +/***/ }), + +/***/ "./src/utils/mimetype.ts": +/*!*******************************!*\ + !*** ./src/utils/mimetype.ts ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const mimeDB = __webpack_require__(/*! mime-db */ "mime-db"); +exports.mimeTypeToFileExtension = (mimeType, defaultExtension) => { + const mime = mimeDB[mimeType]; + if (mime && mime.extensions && mime.extensions.length) { + return mime.extensions[0]; + } + else { + return defaultExtension; + } +}; + + +/***/ }), + +/***/ "./src/utils/msg.ts": +/*!**************************!*\ + !*** ./src/utils/msg.ts ***! + \**************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +function apiSuccessMsg(apiName) { + return `${apiName}:ok`; +} +exports.apiSuccessMsg = apiSuccessMsg; +function apiCancelMsg(apiName, msg) { + return `${apiName}:cancel ${msg}`; +} +exports.apiCancelMsg = apiCancelMsg; +function apiFailMsg(apiName, msg) { + return `${apiName}:fail ${msg}`; +} +exports.apiFailMsg = apiFailMsg; + + +/***/ }), + +/***/ "./src/utils/symbol.ts": +/*!*****************************!*\ + !*** ./src/utils/symbol.ts ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const _symbols = []; +const __internalMark__ = {}; +class HiddenSymbol { + constructor(target) { + Object.defineProperties(this, { + target: { + enumerable: false, + writable: false, + configurable: false, + value: target, + }, + }); + } +} +class InternalSymbol extends HiddenSymbol { + constructor(target, __mark__) { + if (__mark__ !== __internalMark__) { + throw new TypeError('InternalSymbol cannot be constructed with new operator'); + } + super(target); + } + static for(target) { + for (let i = 0, len = _symbols.length; i < len; i++) { + if (_symbols[i].target === target) { + return _symbols[i].instance; + } + } + const symbol = new InternalSymbol(target, __internalMark__); + _symbols.push({ + target, + instance: symbol, + }); + return symbol; + } +} +exports.InternalSymbol = InternalSymbol; +exports.default = InternalSymbol; + + +/***/ }), + +/***/ "./src/utils/type.ts": +/*!***************************!*\ + !*** ./src/utils/type.ts ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const symbol_1 = __webpack_require__(/*! ./symbol */ "./src/utils/symbol.ts"); +exports.getType = (x) => Object.prototype.toString.call(x).slice(8, -1).toLowerCase(); +exports.isObject = (x) => exports.getType(x) === 'object'; +exports.isString = (x) => exports.getType(x) === 'string'; +exports.isNumber = (x) => exports.getType(x) === 'number'; +exports.isPromise = (x) => exports.getType(x) === 'promise'; +exports.isFunction = (x) => typeof x === 'function'; +exports.isArray = (x) => Array.isArray(x); +exports.isDate = (x) => exports.getType(x) === 'date'; +exports.isBuffer = (x) => Buffer.isBuffer(x); +exports.isInternalObject = (x) => x && (x._internalType instanceof symbol_1.InternalSymbol); +exports.isPlainObject = (obj) => { + if (typeof obj !== 'object' || obj === null) + return false; + let proto = obj; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + return Object.getPrototypeOf(obj) === proto; +}; + + +/***/ }), + +/***/ "./src/utils/utils.ts": +/*!****************************!*\ + !*** ./src/utils/utils.ts ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", { value: true }); +const type_1 = __webpack_require__(/*! ./type */ "./src/utils/type.ts"); +const symbol_config_1 = __webpack_require__(/*! config/symbol.config */ "./src/config/symbol.config.ts"); +exports.convertCase = (input, options) => { + const { from, to, recursive } = options; + if (type_1.isString(input)) { + if (from === 'camelcase' && to === 'snakecase') { + return input.replace(/[A-Z]/g, (match, ind) => `${ind ? '_' : ''}${match.toLowerCase()}`); + } + else if (from === 'snakecase' && to === 'camelcase') { + return input.replace(/_[a-z]/g, (match, ind) => `${match[1].toUpperCase()}`); + } + } + else if (type_1.isObject(input)) { + return convertObject(input); + } + else if (type_1.isArray(input)) { + const array = []; + for (const item of input) { + if (type_1.isObject(item)) { + array.push(convertObject(item)); + } + else if (type_1.isArray(item)) { + if (options.recursive) { + array.push(exports.convertCase(item, options)); + } + else { + array.push(item); + } + } + else { + array.push(item); + } + } + return array; + } + else + return input; + function convertObject(input) { + const data = Object.assign({}, input); + for (const key in data) { + const val = recursive && (type_1.isObject(data[key]) || type_1.isArray(data[key])) ? exports.convertCase(data[key], options) : data[key]; + const convertedKey = exports.convertCase(key, options); + data[convertedKey] = val; + if (convertedKey !== key) { + delete data[key]; + } + } + return data; + } +}; +exports.isSCFEnvReady = () => Boolean(process.env.TCB_ENV); +exports.translateEnv = (env) => { + if (!env) { + return undefined; + } + if (env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) { + env = process.env.TCB_ENV || process.env.SCF_NAMESPACE; + } + // in scf local debug, we should not use 'local' as env in api invocation + if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') { + return undefined; + } + return env; +}; +exports.getEnvFromCloudConfig = (config, serviceName = 'default') => { + const env = config.env[serviceName] || config.env.default; + return exports.translateEnv(env); +}; +exports.getEnvFromAPIConfig = (apiConfig, cloudConfig, serviceName = 'default') => { + if (apiConfig && apiConfig.env) { + return exports.translateEnv(apiConfig.env); + } + return exports.getEnvFromCloudConfig(cloudConfig, serviceName); +}; +exports.getServiceConfigFromDefaultConfig = (defaultConfig, serviceName = 'default') => { + return Object.assign(Object.assign({}, defaultConfig), { env: exports.getEnvFromCloudConfig(defaultConfig, serviceName) }); +}; +exports.getMergedAPIConfig = (defaultConfig, newConfig, serviceName = 'default') => { + const merged = Object.assign(Object.assign({}, defaultConfig), newConfig); + if (newConfig && newConfig.env) { + merged.env = exports.translateEnv(newConfig.env); + } + else { + merged.env = exports.getEnvFromCloudConfig(defaultConfig, serviceName); + } + return merged; +}; + + +/***/ }), + +/***/ "mime-db": +/*!**************************!*\ + !*** external "mime-db" ***! + \**************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("mime-db"); + +/***/ }), + +/***/ "protobufjs/minimal": +/*!*************************************!*\ + !*** external "protobufjs/minimal" ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("protobufjs/minimal"); + +/***/ }), + +/***/ "tcb-admin-node": +/*!*********************************!*\ + !*** external "tcb-admin-node" ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("tcb-admin-node"); + +/***/ }), + +/***/ "tcb-admin-node/src/utils/httpRequest": +/*!*******************************************************!*\ + !*** external "tcb-admin-node/src/utils/httpRequest" ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = require("tcb-admin-node/src/utils/httpRequest"); + +/***/ }) + +/******/ }); +}, function(modId) {var map = {"./package.json":1587547894850}; return __REQUIRE__(map[modId], modId); }) +__DEFINE__(1587547894850, function(require, module, exports) { +module.exports = { + "_from": "wx-server-sdk@latest", + "_id": "wx-server-sdk@1.8.3", + "_inBundle": false, + "_integrity": "sha1-VE9wCQJ0RCKFzQBdf0i7tt+wAow=", + "_location": "/wx-server-sdk", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "wx-server-sdk@latest", + "name": "wx-server-sdk", + "escapedName": "wx-server-sdk", + "rawSpec": "latest", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-1.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwx-server-sdk%2Fdownload%2Fwx-server-sdk-1.8.3.tgz", + "_shasum": "544f70090274442285cd005d7f48bbb6dfb0028c", + "_spec": "wx-server-sdk@latest", + "_where": "/Users/romchung/Wechat-Miniprogram/miniprogram-demo/cloudfunctions/wxContext", + "author": { + "name": "wechat mini program team" + }, + "bundleDependencies": false, + "dependencies": { + "protobufjs": "6.8.8", + "tcb-admin-node": "1.22.0", + "tslib": "^1.9.3" + }, + "deprecated": false, + "description": "mini program cloud server sdk", + "homepage": "https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html", + "license": "MIT", + "main": "index.js", + "name": "wx-server-sdk", + "types": "index.d.ts", + "version": "1.8.3" +} + +}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1587547894849); +})() +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/wx-server-sdk/index.js.map b/miniprogram/miniprogram_npm/wx-server-sdk/index.js.map new file mode 100644 index 00000000..65e5d39f --- /dev/null +++ b/miniprogram/miniprogram_npm/wx-server-sdk/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","package.json"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["module.exports =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/api/cloud/index.ts\":\n/*!********************************!*\\\n !*** ./src/api/cloud/index.ts ***!\n \\********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst provider_1 = __webpack_require__(/*! ./provider */ \"./src/api/cloud/provider/index.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst type_1 = __webpack_require__(/*! utils/type */ \"./src/utils/type.ts\");\nconst index_1 = __webpack_require__(/*! ../index */ \"./src/api/index.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\n// @ts-ignore\nconst { version } = require('./package.json');\nclass Cloud {\n constructor() {\n this.inited = false;\n this.services = {};\n this.debug = false;\n this.wrapCommonAPICheck = (func) => {\n return (...args) => {\n if (!this.inited) {\n throw new error_1.CloudSDKError({\n errMsg: 'Cloud API isn\\'t enabled, please call init first\\n' +\n '请先调用 init 完成初始化后再调用其他云 API。init 方法可传入一个对象用于设置默认配置,详见文档。'\n });\n }\n return func.apply(this, args);\n };\n };\n this.exportAPI = {\n version,\n get DYNAMIC_CURRENT_ENV() {\n const env = process.env.TCB_ENV || process.env.SCF_NAMESPACE;\n if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n return symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n return env || symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n },\n // @ts-ignore\n init: this.init.bind(this),\n // @ts-ignore\n updateConfig: this.updateConfig.bind(this),\n registerService: (serviceProvider) => {\n this.registerService(serviceProvider.createService(this));\n },\n // @ts-ignore\n createNewInstance: (config) => {\n const instance = new Cloud();\n instance.init(config);\n return instance.exportAPI;\n }\n };\n index_1.registerServices(this);\n this.meta = {\n session_id: (+new Date).toString()\n };\n this.config = {\n env: {},\n };\n this.provider = provider_1.default();\n this.exportAPI.logger = this.provider.api.logger;\n }\n getMetaData() {\n return this.meta;\n }\n getAPIs() {\n return Object.assign({}, this.exportAPI);\n }\n init(config = {}) {\n if (this.inited)\n return;\n this.inited = true;\n this.updateConfig(config);\n }\n updateConfig(config = {}) {\n this.provider.init(Object.assign(Object.assign({}, config), { version: `wx-server-sdk/${version}` }));\n const _config = Object.assign(Object.assign({}, config), { env: type_1.isObject(config.env) ? config.env : { default: config.env } });\n this.config = _config;\n }\n registerService(service) {\n this.services[service.name] = service;\n if (service.getAPIs) {\n const functions = service.getAPIs();\n for (const name in functions) {\n this.registerFunction(name, functions[name], service.initRequired);\n }\n }\n else if (service.getNamespace) {\n const { namespace, apis } = service.getNamespace();\n this.exportAPI[namespace] = apis;\n }\n }\n registerFunction(name, func, initRequired) {\n this.exportAPI[name] = initRequired === false ? func : this.wrapCommonAPICheck(func);\n }\n}\nexports.Cloud = Cloud;\nconst cloud = new Cloud();\nexports.default = cloud;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/index.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/cloud/provider/index.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb_1 = __webpack_require__(/*! ./tcb */ \"./src/api/cloud/provider/tcb/index.ts\");\nvar PROVIDER;\n(function (PROVIDER) {\n PROVIDER[PROVIDER[\"TCB\"] = 0] = \"TCB\";\n})(PROVIDER = exports.PROVIDER || (exports.PROVIDER = {}));\nfunction getProvider(provider = PROVIDER.TCB) {\n switch (provider) {\n default: {\n return tcb_1.default;\n }\n }\n}\nexports.default = getProvider;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/callFunction.ts\":\n/*!********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/callFunction.ts ***!\n \\********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\n// const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms))\nasync function callFunction(options, config) {\n // await sleep()\n /*\n const res = await tcbRequest({\n params: {\n action: 'functions.invokeFunction',\n function_name: options.name,\n request_data: options.dataStr,\n },\n // TODO\n timeout: 5 * 60 * 1000,\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n })\n */\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.callFunction(options);\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: `requestID ${res.requestId}, ${res.message}`,\n requestId: res.requestId,\n };\n }\n else {\n return {\n result: res.result,\n requestId: res.requestId,\n };\n }\n}\nexports.callFunction = callFunction;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/callOpenAPI.ts\":\n/*!*******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/callOpenAPI.ts ***!\n \\*******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\n// DEPRECATED\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function callOpenAPI(options, config) {\n await sleep();\n // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options)\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.callWxOpenApi({\n apiName: options.api,\n requestData: options.data,\n event: options.event,\n });\n // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res)\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n result: res.result,\n };\n }\n}\nexports.callOpenAPI = callOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts\":\n/*!*********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts ***!\n \\*********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ \"./src/config/error.config.ts\");\nconst error_1 = __webpack_require__(/*! ../../../../../utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! ../../../../../utils/msg */ \"./src/utils/msg.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst openapi_1 = __webpack_require__(/*! ../../../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function callWXOpenAPI(options, config) {\n await sleep();\n let res;\n try {\n // console.log('wx-server-sdk tcb.callWxOpenApi options: ', options)\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n res = await tcbInstance.callCompatibleWxOpenApi({\n apiName: options.api,\n requestData: options.data,\n });\n // console.log('wx-server-sdk tcb.callWxOpenApi res: ', res)\n }\n catch (err) {\n throw {\n errCode: (err && err.code && error_config_1.TCB_ERR_CODE[err.code]) || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: (err && err.message) || err || 'empty error message',\n };\n }\n if (!Buffer.isBuffer(res)) {\n // is object\n // must be error\n // tcb must not return object\n if (res.code && res.hasOwnProperty('message')) {\n // tcb error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, res.message)\n });\n }\n if (res.errcode) {\n // wx error\n throw new error_1.CloudSDKError({\n errCode: res.errcode,\n errMsg: msg_1.apiFailMsg(options.api, res.errmsg),\n });\n }\n if (res.byteLength === 0) {\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(options.api, `empty response`)\n });\n }\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, `unknown response ${res}`)\n });\n }\n else {\n // is buffer\n let wxResp;\n try {\n wxResp = openapi_1.CommOpenApiResp.decode(res);\n }\n catch (decodeError) {\n // fail to parse pb, may well be tcb error\n let jsonParseResult;\n try {\n jsonParseResult = JSON.parse(res.toString());\n }\n catch (parseTCBRespError) {\n // unknown error\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(options.api, `unknown wx response received: ${decodeError}`)\n });\n }\n if (jsonParseResult.code && jsonParseResult.hasOwnProperty('message')) {\n // tcb error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE[jsonParseResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, jsonParseResult.message)\n });\n }\n else {\n // unknown tcb error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: msg_1.apiFailMsg(options.api, JSON.stringify(jsonParseResult)),\n });\n }\n }\n if (wxResp) {\n if (wxResp.errorCode) {\n // wx system error, for example: no permission\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE[error_config_2.ERR_CODE[wxResp.errorCode]] || wxResp.errorCode,\n errMsg: `${error_config_2.ERR_CODE[error_config_2.ERR_CODE.WX_SYSTEM_ERROR]}: error code: ${wxResp.errorCode}`\n });\n }\n }\n else {\n throw new error_1.CloudSDKError({\n errCode: error_config_2.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(options.api, `empty wx response buffer`)\n });\n }\n return wxResp;\n }\n}\nexports.callWXOpenAPI = callWXOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/database.ts\":\n/*!****************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/database.ts ***!\n \\****************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb = __webpack_require__(/*! tcb-admin-node */ \"tcb-admin-node\");\nconst tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ \"tcb-admin-node/src/utils/httpRequest\");\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nconst mergeConfig = (tcbConfig, config) => {\n const ret = Object.assign({}, tcbConfig);\n if (config.env) {\n // @ts-ignore\n ret.env = config.env;\n }\n return ret;\n};\nasync function addDocument(options, config) {\n // 不得已而 sleep(0),因为 tcb-admin-node 的 httpRequest 在返回 promise 之前竟然有逻辑可能抛错 !!!!!\n await sleep();\n const res = await tcbRequest({\n params: {\n action: 'database.addDocument',\n _id: options._id,\n collectionName: options.collectionName,\n data: options.data,\n },\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n _id: res.data._id,\n requestId: res.requestId,\n };\n }\n}\nexports.addDocument = addDocument;\nasync function queryDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.queryDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n list: res.data.list || [],\n limit: res.Limit,\n offset: res.Offset,\n total: res.TotalCount,\n requestId: res.requestId,\n };\n }\n}\nexports.queryDocument = queryDocument;\nasync function updateDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.updateDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n updated: res.data.updated,\n upsertedId: res.data.upserted_id,\n requestId: res.requestId,\n };\n }\n}\nexports.updateDocument = updateDocument;\nasync function removeDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.removeDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n removed: res.deleted,\n requestId: res.requestId,\n };\n }\n}\nexports.removeDocument = removeDocument;\nasync function countDocument(options, config) {\n await sleep();\n const res = await tcbRequest({\n params: Object.assign(Object.assign({}, options), { action: 'database.countDocument', collectionName: options.collectionName }),\n config: mergeConfig(tcb.config, config),\n method: 'post',\n headers: {\n 'content-type': 'application/json'\n }\n });\n if (res.code) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n return {\n total: res.data.total,\n requestId: res.requestId,\n };\n }\n}\nexports.countDocument = countDocument;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/deleteFile.ts\":\n/*!******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/deleteFile.ts ***!\n \\******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ \"./src/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function deleteFile(options, config) {\n await sleep();\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.deleteFile({\n fileList: options.fileList\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f) => {\n if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) {\n const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR;\n return {\n fileID: f.fileID,\n status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: error_config_2.ERR_CODE[code]\n };\n }\n return {\n fileID: f.fileID,\n status: 0,\n errMsg: 'ok',\n };\n });\n //@ts-ignore\n return {\n fileList: fileList,\n requestId: res.requestId,\n };\n }\n}\nexports.deleteFile = deleteFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/downloadFile.ts\":\n/*!********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/downloadFile.ts ***!\n \\********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function downloadFile(options, config) {\n await sleep();\n const statusCode = 200;\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.downloadFile({\n fileID: options.fileID\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n return {\n statusCode: statusCode,\n fileContent: res.fileContent,\n };\n}\nexports.downloadFile = downloadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/getTempFileURL.ts\":\n/*!**********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/getTempFileURL.ts ***!\n \\**********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst error_config_2 = __webpack_require__(/*! ../../../../../config/error.config */ \"./src/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function getTempFileURL(options, config) {\n await sleep();\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.getTempFileURL({\n fileList: options.fileList,\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n const fileList = (res.fileList || []).filter((s) => Boolean(s)).map((f, i) => {\n if (f.code && error_config_1.TCB_ERR_CODE[f.code] !== 0) {\n const code = error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR;\n return {\n fileID: f.fileID,\n status: error_config_1.TCB_ERR_CODE[f.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: error_config_2.ERR_CODE[code],\n maxAge: f.maxAge,\n tempFileURL: '',\n };\n }\n return {\n fileID: f.fileID,\n status: 0,\n errMsg: 'ok',\n maxAge: f.maxAge,\n tempFileURL: f.tempFileURL,\n };\n });\n return {\n fileList: fileList,\n requestId: res.requestId,\n };\n }\n}\nexports.getTempFileURL = getTempFileURL;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/api/uploadFile.ts\":\n/*!******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/api/uploadFile.ts ***!\n \\******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_config_1 = __webpack_require__(/*! ../config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nconst instance_1 = __webpack_require__(/*! ../utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));\nasync function uploadFile(options, config) {\n await sleep();\n let statusCode = -1;\n const tcbInstance = instance_1.getInstance(Object.assign(Object.assign({}, config.defaultConfig), config.apiConfig));\n const res = await tcbInstance.uploadFile({\n cloudPath: options.cloudPath,\n fileContent: options.fileContent,\n }, {\n onResponseReceived(resp) {\n statusCode = resp ? resp.statusCode : statusCode;\n }\n });\n if (res.code && error_config_1.TCB_ERR_CODE[res.code] !== 0) {\n throw {\n errCode: error_config_1.TCB_ERR_CODE[res.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: res.message,\n };\n }\n else {\n //@ts-ignore\n return {\n fileID: res.fileID,\n requestId: res.requestId,\n statusCode,\n };\n }\n}\nexports.uploadFile = uploadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/config/error.config.ts\":\n/*!***********************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/config/error.config.ts ***!\n \\***********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\n// provider should also register the error codes in src/config/error.config.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TCB_ERR_CODE = {\n // 通用\n SUCCESS: 0,\n SYS_ERR: -501001,\n SERVER_TIMEOUT: -501002,\n EXCEED_REQUEST_LIMIT: -501003,\n EXCEED_CONCURRENT_REQUEST_LIMIT: -501004,\n INVALIID_ENV: -501005,\n INVALID_COMMON_PARAM: -501006,\n INVALID_PARAM: -501007,\n INVALID_REQUEST_SOURCE: -501008,\n RESOURCE_NOT_INITIAL: -501009,\n // 数据库\n DATABASE_REQUEST_FAILED: -502001,\n DATABASE_INVALID_OPERRATOR: -502002,\n DATABASE_PERMISSION_DENIED: -502003,\n DATABASE_COLLECTION_EXCEED_LIMIT: -502004,\n DATABASE_COLLECTION_NOT_EXIST: -502005,\n // 文件\n STORAGE_REQUEST_FAIL: -503001,\n STORAGE_EXCEED_AUTHORITY: -503002,\n STORAGE_FILE_NONEXIST: -503003,\n STORAGE_SIGN_PARAM_INVALID: -503004,\n // 云函数\n FUNCTIONS_REQUEST_FAIL: -504001,\n FUNCTIONS_EXECUTE_FAIL: -504002,\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/index.ts\":\n/*!*********************************************!*\\\n !*** ./src/api/cloud/provider/tcb/index.ts ***!\n \\*********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb = __webpack_require__(/*! tcb-admin-node */ \"tcb-admin-node\");\nconst tcbRequest = __webpack_require__(/*! tcb-admin-node/src/utils/httpRequest */ \"tcb-admin-node/src/utils/httpRequest\");\nconst database_1 = __webpack_require__(/*! ./api/database */ \"./src/api/cloud/provider/tcb/api/database.ts\");\nconst callFunction_1 = __webpack_require__(/*! ./api/callFunction */ \"./src/api/cloud/provider/tcb/api/callFunction.ts\");\nconst downloadFile_1 = __webpack_require__(/*! ./api/downloadFile */ \"./src/api/cloud/provider/tcb/api/downloadFile.ts\");\nconst uploadFile_1 = __webpack_require__(/*! ./api/uploadFile */ \"./src/api/cloud/provider/tcb/api/uploadFile.ts\");\nconst deleteFile_1 = __webpack_require__(/*! ./api/deleteFile */ \"./src/api/cloud/provider/tcb/api/deleteFile.ts\");\nconst getTempFileURL_1 = __webpack_require__(/*! ./api/getTempFileURL */ \"./src/api/cloud/provider/tcb/api/getTempFileURL.ts\");\nconst callOpenAPI_1 = __webpack_require__(/*! ./api/callOpenAPI */ \"./src/api/cloud/provider/tcb/api/callOpenAPI.ts\");\nconst callWXOpenAPI_1 = __webpack_require__(/*! ./api/callWXOpenAPI */ \"./src/api/cloud/provider/tcb/api/callWXOpenAPI.ts\");\nconst provider = {\n // init\n init: (config) => {\n tcb.init(Object.assign(Object.assign({}, config), { isHttp: process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF' }));\n },\n get config() {\n return tcb.config;\n },\n // request\n sendRequest: async function (options) {\n return tcbRequest(Object.assign({ config: tcb.config, params: options.data }, options));\n },\n // api\n api: {\n addDocument: database_1.addDocument,\n queryDocument: database_1.queryDocument,\n updateDocument: database_1.updateDocument,\n removeDocument: database_1.removeDocument,\n countDocument: database_1.countDocument,\n callFunction: callFunction_1.callFunction,\n downloadFile: downloadFile_1.downloadFile,\n uploadFile: uploadFile_1.uploadFile,\n deleteFile: deleteFile_1.deleteFile,\n getTempFileURL: getTempFileURL_1.getTempFileURL,\n callOpenAPI: callOpenAPI_1.callOpenAPI,\n callWXOpenAPI: callWXOpenAPI_1.callWXOpenAPI,\n logger: tcb.logger,\n }\n};\nexports.default = provider;\n\n\n/***/ }),\n\n/***/ \"./src/api/cloud/provider/tcb/utils/instance.ts\":\n/*!******************************************************!*\\\n !*** ./src/api/cloud/provider/tcb/utils/instance.ts ***!\n \\******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tcb = __webpack_require__(/*! tcb-admin-node */ \"tcb-admin-node\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\nexports.getInstance = (config = {}) => {\n if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n // @ts-ignore\n const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env), isHttp: true }));\n instance.config.secretId = undefined;\n instance.config.secretKey = undefined;\n instance.config.sessionToken = undefined;\n return instance;\n }\n else {\n // @ts-ignore\n const instance = tcb.init(Object.assign(Object.assign({}, config), { env: utils_1.translateEnv(config.env) }));\n instance.config.secretId = undefined;\n instance.config.secretKey = undefined;\n instance.config.sessionToken = undefined;\n return instance;\n }\n};\nexports.fixInstance = (instance, env) => {\n instance = instance || tcb;\n if (env) {\n instance.config.envName = utils_1.translateEnv(env);\n }\n else if (instance.config.envName === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n instance.config.envName = utils_1.translateEnv(instance.config.envName);\n }\n if (process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n instance.config.secretId = undefined;\n instance.config.secretKey = undefined;\n instance.config.sessionToken = undefined;\n instance.config.isHttp = true;\n }\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/api.ts\":\n/*!*************************************!*\\\n !*** ./src/api/database/api/api.ts ***!\n \\*************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst database_1 = __webpack_require__(/*! ./database */ \"./src/api/database/api/database.ts\");\nfunction getAPIs(cloud) {\n return {\n database: database_1.default.bind(null, cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database.ts\":\n/*!******************************************!*\\\n !*** ./src/api/database/api/database.ts ***!\n \\******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst collection_1 = __webpack_require__(/*! ./database/collection */ \"./src/api/database/api/database/collection.ts\");\nconst transaction_1 = __webpack_require__(/*! ./database/transaction/transaction */ \"./src/api/database/api/database/transaction/transaction.ts\");\nconst geo_1 = __webpack_require__(/*! ./database/geo/geo */ \"./src/api/database/api/database/geo/geo.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./database/helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../api/cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\nfunction getDatabase(cloud, config) {\n const Database = getDatabaseClass(cloud);\n return new Database(config);\n}\nexports.default = getDatabase;\nconst getDatabaseClass = (cloud) => {\n return class Database {\n constructor(config = {}) {\n this.runTransaction = (run, retryTimes) => {\n return transaction_1.runTransaction.call(this, run, retryTimes);\n };\n this.cloud = cloud;\n this.config = config;\n if (config.env) {\n assert_1.assertType(config.env, 'string');\n }\n else if (cloud.config.env) {\n if (cloud.config.env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n else if (cloud.config.env.database === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n else if (!cloud.config.env.database && cloud.config.env.default === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n config.env = symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV;\n }\n }\n this._instance = instance_1.getInstance(Object.assign(Object.assign({}, utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'database')), config));\n this._db = this._instance.database();\n this.command = this._db.command;\n this.Geo = geo_1.initGeo(this._db.Geo);\n this.serverDate = this._db.serverDate;\n this.RegExp = this._db.RegExp;\n }\n collection(collectionName) {\n return new collection_1.CollectionReference(this._db.collection(collectionName), collectionName, this);\n }\n startTransaction() {\n return transaction_1.startTransaction.call(this);\n }\n async createCollection(collectionName) {\n const apiName = 'createCollection';\n try {\n const result = await this._db.createCollection(collectionName);\n error_checker_1.checkError(result);\n return {\n errMsg: msg_1.apiSuccessMsg(apiName),\n requestId: result.requestId,\n };\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, apiName);\n }\n }\n };\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/aggregate.ts\":\n/*!****************************************************!*\\\n !*** ./src/api/database/api/database/aggregate.ts ***!\n \\****************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nvar ORDER_DIRECTION;\n(function (ORDER_DIRECTION) {\n ORDER_DIRECTION[\"ASC\"] = \"asc\";\n ORDER_DIRECTION[\"DESC\"] = \"desc\";\n})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {}));\nclass Aggregate {\n constructor(_aggregate, collectionName, database) {\n this._aggregate = _aggregate;\n this.collectionName = collectionName;\n this.database = database;\n }\n pushStage(stage, val) {\n return new Aggregate(this._aggregate[stage](val), this.collectionName, this.database);\n }\n addFields(val) {\n return this.pushStage('addFields', val);\n }\n bucket(val) {\n return this.pushStage('bucket', val);\n }\n bucketAuto(val) {\n return this.pushStage('bucketAuto', val);\n }\n collStats(val) {\n return this.pushStage('collStats', val);\n }\n count(val) {\n return this.pushStage('count', val);\n }\n facet(val) {\n return this.pushStage('facet', val);\n }\n geoNear(val) {\n return this.pushStage('geoNear', val);\n }\n graphLookup(val) {\n return this.pushStage('graphLookup', val);\n }\n group(val) {\n return this.pushStage('group', val);\n }\n indexStats() {\n return this.pushStage('indexStats', {});\n }\n limit(val) {\n return this.pushStage('limit', val);\n }\n lookup(val) {\n return this.pushStage('lookup', val);\n }\n match(val) {\n return this.pushStage('match', val);\n }\n out(val) {\n return this.pushStage('out', val);\n }\n project(val) {\n return this.pushStage('project', val);\n }\n redact(val) {\n return this.pushStage('redact', val);\n }\n replaceRoot(val) {\n return this.pushStage('replaceRoot', val);\n }\n sample(val) {\n return this.pushStage('sample', val);\n }\n skip(val) {\n return this.pushStage('skip', val);\n }\n sort(val) {\n return this.pushStage('sort', val);\n }\n sortByCount(val) {\n return this.pushStage('sortByCount', val);\n }\n unwind(val) {\n return this.pushStage('unwind', val);\n }\n end() {\n const apiName = 'collection.aggregate';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const result = await this._aggregate.end();\n error_checker_1.checkError(result);\n resolve({\n list: result.data,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(err, apiName));\n }\n });\n }\n}\nexports.Aggregate = Aggregate;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/collection.ts\":\n/*!*****************************************************!*\\\n !*** ./src/api/database/api/database/collection.ts ***!\n \\*****************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst query_1 = __webpack_require__(/*! ./query */ \"./src/api/database/api/database/query.ts\");\nconst document_1 = __webpack_require__(/*! ./document */ \"./src/api/database/api/database/document.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst aggregate_1 = __webpack_require__(/*! ./aggregate */ \"./src/api/database/api/database/aggregate.ts\");\nclass CollectionReference extends query_1.Query {\n constructor(_collection, collectionName, database) {\n super(_collection, collectionName, database);\n this._collection = _collection;\n this.collectionName = collectionName;\n this.database = database;\n }\n doc(docId) {\n return new document_1.DocumentReference(this._collection.doc(docId), this, docId, this.database);\n }\n add(options) {\n const apiName = 'collection.add';\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object'\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const addResult = await this._collection.add(options.data);\n error_checker_1.checkError(addResult);\n resolve({\n _id: addResult.id,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n aggregate() {\n return new aggregate_1.Aggregate(this._collection.aggregate(), this.collectionName, this.database);\n }\n}\nexports.CollectionReference = CollectionReference;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/document.ts\":\n/*!***************************************************!*\\\n !*** ./src/api/database/api/database/document.ts ***!\n \\***************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nconst GET_API_NAME = 'document.get';\nconst UPDATE_API_NAME = 'document.update';\nconst SET_API_NAME = 'document.set';\nconst REMOVE_API_NAME = 'document.remove';\nclass DocumentReference {\n constructor(_document, collection, docId, database) {\n this._document = _document;\n this.collection = collection;\n this.database = database;\n this._id = docId;\n }\n field(object) {\n assert_1.assertRequiredParam(object, 'object', 'field');\n assert_1.assertType(object, 'object', 'field');\n return new DocumentReference(this._document.field(object), this.collection, this._id, this.database);\n }\n get() {\n return new Promise(async (resolve, reject) => {\n try {\n const throwOnNotFound = this.database.config.hasOwnProperty('throwOnNotFound') ? Boolean(this.database.config.throwOnNotFound) : true;\n const _id = this._id;\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const queryResult = await this._document.get();\n error_checker_1.checkError(queryResult);\n // in normal doc.get, queryResult.data is array, in transaction, it is object instead\n if (!queryResult.data || (Array.isArray(queryResult.data) && !queryResult.data.length)) {\n if (throwOnNotFound) {\n throw `document with _id ${_id} does not exist`;\n }\n else {\n resolve({\n data: null,\n errMsg: msg_1.apiSuccessMsg(GET_API_NAME),\n });\n }\n }\n else {\n resolve({\n data: Array.isArray(queryResult.data) ? queryResult.data[0] : queryResult.data,\n errMsg: msg_1.apiSuccessMsg(GET_API_NAME),\n });\n }\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), GET_API_NAME));\n }\n });\n }\n set(options) {\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object',\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n const _id = this._id;\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const setResult = await this._document.set(options.data);\n error_checker_1.checkError(setResult);\n resolve({\n _id,\n errMsg: msg_1.apiSuccessMsg(SET_API_NAME),\n stats: {\n updated: setResult.updated,\n created: setResult.upsertedId ? 1 : 0,\n }\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), SET_API_NAME));\n }\n });\n }\n update(options) {\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object',\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const updateResult = await this._document.update(options.data);\n error_checker_1.checkError(updateResult);\n resolve({\n stats: {\n updated: updateResult.updated,\n },\n errMsg: msg_1.apiSuccessMsg(UPDATE_API_NAME),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), UPDATE_API_NAME));\n }\n });\n }\n remove(options) {\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n // normal doc.remove -> _doc.remove\n // transaction doc.remove -> _doc.delete\n const removeResult = await (this._document.remove ? this._document.remove() : this._document.delete());\n error_checker_1.checkError(removeResult);\n resolve({\n stats: {\n removed: removeResult.deleted || 0,\n },\n errMsg: msg_1.apiSuccessMsg(REMOVE_API_NAME),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), REMOVE_API_NAME));\n }\n });\n }\n}\nexports.DocumentReference = DocumentReference;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/geo/geo.ts\":\n/*!**************************************************!*\\\n !*** ./src/api/database/api/database/geo/geo.ts ***!\n \\**************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initGeo = (_geo) => {\n const Geo = {};\n for (const key in _geo) {\n if (_geo.hasOwnProperty(key)) {\n if (typeof _geo[key] === 'function') {\n Geo[key] = function () {\n return new _geo[key](...arguments);\n };\n }\n else {\n Geo[key] = _geo[key];\n }\n }\n }\n return Geo;\n};\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/helper/error-checker.ts\":\n/*!***************************************************************!*\\\n !*** ./src/api/database/api/database/helper/error-checker.ts ***!\n \\***************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_config_1 = __webpack_require__(/*! api/cloud/provider/tcb/config/error.config */ \"./src/api/cloud/provider/tcb/config/error.config.ts\");\nfunction checkError(tcbResult) {\n if (tcbResult && tcbResult.code) {\n throw error_1.returnAsCloudSDKError({\n errCode: error_config_1.TCB_ERR_CODE[tcbResult.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: tcbResult.message,\n });\n }\n}\nexports.checkError = checkError;\nfunction maybeTransformError(maybeTcbError) {\n if (maybeTcbError && maybeTcbError.code) {\n return {\n errCode: error_config_1.TCB_ERR_CODE[maybeTcbError.code] || error_config_1.TCB_ERR_CODE.SYS_ERR,\n errMsg: maybeTcbError.message,\n };\n }\n return maybeTcbError;\n}\nexports.maybeTransformError = maybeTransformError;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/query.ts\":\n/*!************************************************!*\\\n !*** ./src/api/database/api/database/query.ts ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst error_checker_1 = __webpack_require__(/*! ./helper/error-checker */ \"./src/api/database/api/database/helper/error-checker.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nvar ORDER_DIRECTION;\n(function (ORDER_DIRECTION) {\n ORDER_DIRECTION[\"ASC\"] = \"asc\";\n ORDER_DIRECTION[\"DESC\"] = \"desc\";\n})(ORDER_DIRECTION = exports.ORDER_DIRECTION || (exports.ORDER_DIRECTION = {}));\nclass Query {\n constructor(_query, collectionName, database) {\n this._query = _query;\n this.collectionName = collectionName;\n this.database = database;\n }\n field(object) {\n return new Query(this._query.field(object), this.collectionName, this.database);\n }\n where(condition) {\n return new Query(this._query.where(condition), this.collectionName, this.database);\n }\n orderBy(fieldPath, order) {\n return new Query(this._query.orderBy(fieldPath, order), this.collectionName, this.database);\n }\n limit(max) {\n return new Query(this._query.limit(max), this.collectionName, this.database);\n }\n skip(offset) {\n return new Query(this._query.skip(offset), this.collectionName, this.database);\n }\n get(options) {\n const apiName = 'collection.get';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const queryResult = await this._query.get();\n error_checker_1.checkError(queryResult);\n resolve({\n data: queryResult.data,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n update(options) {\n const apiName = 'collection.update';\n return new Promise(async (resolve, reject) => {\n try {\n assert_1.assertType(options, {\n data: 'object',\n });\n assert_1.assertObjectNotEmpty({\n name: 'options.data',\n target: options.data,\n });\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const updateResult = await this._query.update(options.data);\n error_checker_1.checkError(updateResult);\n resolve({\n stats: {\n updated: updateResult.updated || 0,\n },\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n remove(options) {\n const apiName = 'collection.remove';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const removeResult = await this._query.remove();\n error_checker_1.checkError(removeResult);\n resolve({\n stats: {\n removed: removeResult.deleted,\n },\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n count(options) {\n const apiName = 'collection.count';\n return new Promise(async (resolve, reject) => {\n try {\n instance_1.fixInstance(this.database._instance, this.database.config.env);\n const queryResult = await this._query.count();\n error_checker_1.checkError(queryResult);\n resolve({\n total: queryResult.total,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (err) {\n reject(error_1.returnAsFinalCloudSDKError(error_checker_1.maybeTransformError(err), apiName));\n }\n });\n }\n}\nexports.Query = Query;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/api/database/transaction/transaction.ts\":\n/*!******************************************************************!*\\\n !*** ./src/api/database/api/database/transaction/transaction.ts ***!\n \\******************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst collection_1 = __webpack_require__(/*! ../collection */ \"./src/api/database/api/database/collection.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst instance_1 = __webpack_require__(/*! ../../../../cloud/provider/tcb/utils/instance */ \"./src/api/cloud/provider/tcb/utils/instance.ts\");\nclass Transaction {\n constructor(transaction, db) {\n this._transaction = transaction;\n this._db = db;\n }\n async init() {\n return this._transaction.init();\n }\n collection(collName) {\n if (!collName) {\n throw new Error('Collection name is required');\n }\n return new collection_1.CollectionReference(this._transaction.collection(collName), collName, this._db);\n }\n async commit() {\n try {\n return this._transaction.commit();\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, `transaction.commit`);\n }\n }\n async rollback(reason) {\n try {\n return this._transaction.rollback(reason);\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, `transaction.rollback`);\n }\n }\n}\nexports.Transaction = Transaction;\nasync function runTransaction(callback, times = 3) {\n instance_1.fixInstance(this._instance, this.config.env);\n return this._db.runTransaction((_transaction) => {\n const transaction = new Transaction(_transaction, this);\n return callback(transaction);\n }, times);\n}\nexports.runTransaction = runTransaction;\nasync function startTransaction() {\n instance_1.fixInstance(this._instance, this.config.env);\n const _transaction = await this._db.startTransaction();\n return new Transaction(_transaction, this);\n}\nexports.startTransaction = startTransaction;\n\n\n/***/ }),\n\n/***/ \"./src/api/database/index.ts\":\n/*!***********************************!*\\\n !*** ./src/api/database/index.ts ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/database/api/api.ts\");\nexports.DATABASE_SERVICE_NAME = 'database';\nfunction createDatabaseService(cloud) {\n return {\n name: exports.DATABASE_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createDatabaseService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/functions/api/api.ts\":\n/*!**************************************!*\\\n !*** ./src/api/functions/api/api.ts ***!\n \\**************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst callFunction_1 = __webpack_require__(/*! ./callFunction */ \"./src/api/functions/api/callFunction.ts\");\nfunction getAPIs(cloud) {\n return {\n callFunction: callFunction_1.default(cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/functions/api/callFunction.ts\":\n/*!***********************************************!*\\\n !*** ./src/api/functions/api/callFunction.ts ***!\n \\***********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getCallFunction(cloud) {\n return function callFunction(options) {\n const apiName = 'callFunction';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for callFunction must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n name: 'string'\n });\n if (options.hasOwnProperty('data')) {\n assert_1.assertType(options, {\n data: 'object'\n });\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.callFunction({\n name: options.name,\n data: options.data || {},\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'functions'),\n apiConfig: options.config,\n });\n let parsedResult = result.result;\n try {\n if (typeof parsedResult === 'string') {\n parsedResult = JSON.parse(result.result);\n }\n }\n catch (_) {\n // no nothing\n }\n return resolve({\n result: parsedResult,\n errMsg: msg_1.apiSuccessMsg(apiName),\n requestID: result.requestId,\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, apiName);\n // @ts-ignore\n error.requestID = e.requestID;\n return reject(error);\n }\n });\n };\n}\nexports.default = getCallFunction;\n\n\n/***/ }),\n\n/***/ \"./src/api/functions/index.ts\":\n/*!************************************!*\\\n !*** ./src/api/functions/index.ts ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/functions/api/api.ts\");\nexports.FUNCTIONS_SERVICE_NAME = 'functions';\nfunction createFunctionsService(cloud) {\n return {\n name: exports.FUNCTIONS_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createFunctionsService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/index.ts\":\n/*!**************************!*\\\n !*** ./src/api/index.ts ***!\n \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst database_1 = __webpack_require__(/*! ./database */ \"./src/api/database/index.ts\");\nconst storage_1 = __webpack_require__(/*! ./storage */ \"./src/api/storage/index.ts\");\nconst functions_1 = __webpack_require__(/*! ./functions */ \"./src/api/functions/index.ts\");\nconst open_1 = __webpack_require__(/*! ./open */ \"./src/api/open/index.ts\");\nconst utils_1 = __webpack_require__(/*! ./utils */ \"./src/api/utils/index.ts\");\nconst openapi_1 = __webpack_require__(/*! ./openapi */ \"./src/api/openapi/index.ts\");\nfunction registerServices(cloud) {\n database_1.registerService(cloud);\n storage_1.registerService(cloud);\n functions_1.registerService(cloud);\n open_1.registerService(cloud);\n utils_1.registerService(cloud);\n openapi_1.registerService(cloud);\n}\nexports.registerServices = registerServices;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/api.ts\":\n/*!*********************************!*\\\n !*** ./src/api/open/api/api.ts ***!\n \\*********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst callOpenAPI_1 = __webpack_require__(/*! ./callOpenAPI */ \"./src/api/open/api/callOpenAPI.ts\");\nconst getOpenData_1 = __webpack_require__(/*! ./getOpenData */ \"./src/api/open/api/getOpenData.ts\");\nconst getVoIPSign_1 = __webpack_require__(/*! ./getVoIPSign */ \"./src/api/open/api/getVoIPSign.ts\");\nfunction getAPIs(cloud) {\n return {\n callOpenAPI: callOpenAPI_1.default(cloud),\n getOpenData: getOpenData_1.default(cloud),\n getVoIPSign: getVoIPSign_1.default(cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/callOpenAPI.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/open/api/callOpenAPI.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\n// THIS IS THE LEGACY CALLOPENAPI, TO BE DEPRECATED\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getCallOpenAPI(cloud) {\n return function callOpenAPI(options) {\n const apiName = 'callOpenAPI';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for callOpenAPI must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n api: 'string'\n });\n if (options.data) {\n assert_1.assertType(options, {\n data: 'object'\n });\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.callOpenAPI({\n api: options.api,\n data: options.data || {},\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n let parsedResult = result.result;\n try {\n if (typeof parsedResult === 'string') {\n parsedResult = JSON.parse(result.result);\n }\n }\n catch (_) {\n // no nothing\n }\n return resolve({\n result: parsedResult,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, apiName);\n return reject(error);\n }\n });\n };\n}\nexports.default = getCallOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/getOpenData.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/open/api/getOpenData.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst API_NAME = 'getOpenData';\nfunction getGetOpenData(cloud) {\n return function getOpenData(options) {\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for getOpenData must be an object instead of ' + typeof options,\n }, API_NAME));\n }\n try {\n if (!options.list) {\n throw new Error('list must be provided');\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME));\n }\n try {\n const getOpenDataReqBuffer = openapi_1.ApiGetOpenDataByCloudIdReq.encode({\n cloudidList: options.list,\n }).finish();\n const svrkitData = {\n apiName: 'ApiGetOpenDataByCloudId',\n reqData: getOpenDataReqBuffer,\n };\n const pbMessage = openapi_1.CommApiData.encode({\n apiType: openapi_1.CommApiData.ApiType.SVRKIT_API,\n svrkitData,\n }).finish();\n const wxResp = await cloud.provider.api.callWXOpenAPI({\n api: 'ApiGetOpenDataByCloudId',\n data: Buffer.from(pbMessage),\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n if (wxResp.svrkitErrorCode !== 0) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`,\n };\n }\n if (!wxResp.respData) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, empty respData`,\n };\n }\n const pbRespMsg = openapi_1.ApiGetOpenDataByCloudIdResp.decode(wxResp.respData);\n // const svrkitResponse = GetOpenDataRespMessage.toObject(pbRespMsg, {\n // longs: String,\n // })\n const openDataList = pbRespMsg.dataList.map(item => {\n if (!item.json) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, empty openData json field for ${item.cloudId}`,\n };\n }\n return JSON.parse(item.json);\n });\n resolve({\n list: openDataList,\n errMsg: msg_1.apiSuccessMsg(API_NAME),\n errCode: 0,\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, API_NAME);\n return reject(error);\n }\n });\n };\n}\nexports.default = getGetOpenData;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/api/getVoIPSign.ts\":\n/*!*****************************************!*\\\n !*** ./src/api/open/api/getVoIPSign.ts ***!\n \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nconst API_NAME = 'getVoIPSign';\nfunction getGetVoIPSign(cloud) {\n return function getVoIPSign(options) {\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for getVoIPSign must be an object instead of ' + typeof options,\n }, API_NAME));\n }\n try {\n assert_1.assertType(options, {\n groupId: 'string',\n timestamp: 'number',\n nonce: 'string',\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, API_NAME));\n }\n try {\n const getVoIPSignReqBuffer = openapi_1.ApiVoipSignReq.encode({\n groupId: options.groupId,\n timestamp: options.timestamp,\n nonce: options.nonce,\n }).finish();\n const svrkitData = {\n apiName: 'ApiVoipSign',\n reqData: getVoIPSignReqBuffer,\n };\n const pbMessage = openapi_1.CommApiData.encode({\n apiType: openapi_1.CommApiData.ApiType.SVRKIT_API,\n svrkitData,\n }).finish();\n const wxResp = await cloud.provider.api.callWXOpenAPI({\n api: 'ApiVoipSign',\n data: Buffer.from(pbMessage),\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n if (wxResp.svrkitErrorCode !== 0) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, code ${wxResp.svrkitErrorCode}`,\n };\n }\n if (!wxResp.respData) {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal svrkit error, empty respData`,\n };\n }\n const pbRespMsg = openapi_1.ApiVoipSignResp.decode(wxResp.respData);\n resolve({\n signature: pbRespMsg.signature,\n errMsg: msg_1.apiSuccessMsg(API_NAME),\n errCode: 0,\n });\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, API_NAME);\n return reject(error);\n }\n });\n };\n}\nexports.default = getGetVoIPSign;\n\n\n/***/ }),\n\n/***/ \"./src/api/open/index.ts\":\n/*!*******************************!*\\\n !*** ./src/api/open/index.ts ***!\n \\*******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/open/api/api.ts\");\nconst OPEN_SERVICE_NAME = 'open';\nfunction createOpenService(cloud) {\n return {\n name: OPEN_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createOpenService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/openapi/index.ts\":\n/*!**********************************!*\\\n !*** ./src/api/openapi/index.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst namespace_1 = __webpack_require__(/*! ./namespace */ \"./src/api/openapi/namespace/index.ts\");\nexports.OPENAPI_SERVICE_NAME = 'openapi';\nexports.OPENAPI_SERVICE_NAMESPACE_NAME = 'openapi';\nfunction createStorageService(cloud) {\n return {\n name: exports.OPENAPI_SERVICE_NAME,\n getNamespace: () => {\n return {\n namespace: exports.OPENAPI_SERVICE_NAMESPACE_NAME,\n apis: namespace_1.getAPIs(cloud),\n };\n },\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createStorageService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/openapi/namespace/generic.ts\":\n/*!**********************************************!*\\\n !*** ./src/api/openapi/namespace/generic.ts ***!\n \\**********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst openapi_1 = __webpack_require__(/*! ../../../protobuf/openapi */ \"./src/protobuf/openapi.js\");\nconst type_1 = __webpack_require__(/*! ../../../utils/type */ \"./src/utils/type.ts\");\nconst error_1 = __webpack_require__(/*! ../../../utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! ../../../utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! ../../../utils/utils */ \"./src/utils/utils.ts\");\nconst mimetype_1 = __webpack_require__(/*! ../../../utils/mimetype */ \"./src/utils/mimetype.ts\");\nconst error_config_1 = __webpack_require__(/*! ../../../config/error.config */ \"./src/config/error.config.ts\");\nconst functionIntrinsicProperties = new Set(Object.getOwnPropertyNames(Function.prototype));\nconst getCallableObject = (options) => {\n const f = function () { };\n return new Proxy(f, {\n get(target, prop) {\n if (functionIntrinsicProperties.has(prop)) {\n // @ts-ignore\n return options.callable[prop];\n }\n else {\n return getCallableObject(Object.assign(Object.assign({}, options), { paths: [...options.paths, prop] }));\n }\n },\n apply(target, thisArg, args) {\n return options.callable.call(thisArg, options, ...args);\n },\n });\n};\nconst getProxyObject = (options) => {\n const f = () => { };\n const proxy = new Proxy(f, {\n get(target, prop) {\n return getCallableObject(Object.assign(Object.assign({}, options), { paths: [prop] }));\n },\n apply(target, thisArg, args) {\n // set options\n if (!args[0] || !type_1.isObject(args[0])) {\n throw new Error('an options object is expected');\n }\n return getProxyObject(Object.assign(Object.assign({}, args[0]), { \n // some options are not writable\n callable: options.callable, paths: options.paths }));\n }\n });\n return proxy;\n};\nfunction getGenericOpenAPI(cloud) {\n const callable = (innerContext, data) => {\n if (cloud.debug) {\n console.log(`openapi.${innerContext.paths.join('.')} called with data:`, data);\n }\n const api = innerContext.paths.join('.');\n return callWXOpenAPI({\n api,\n data,\n convertCase: innerContext.convertCase,\n });\n };\n return getProxyObject({\n callable: cloud.wrapCommonAPICheck(callable),\n paths: [],\n });\n async function callWXOpenAPI(options) {\n const displayAPIName = `openapi.${options.api}`;\n const shouldConvertCase = options.convertCase !== false;\n try {\n // convert camel case to snake case\n const data = shouldConvertCase ? utils_1.convertCase(options.data, {\n from: 'camelcase',\n to: 'snakecase',\n recursive: true,\n }) : options.data;\n // convert data to pb buffer\n const pairs = [];\n for (const key in data) {\n const val = data[key];\n // check whether it is a form-data item\n if (type_1.isObject(val) && (val.contentType || val.content_type) && val.value && type_1.isBuffer(val.value)) {\n const contentType = (val.contentType || val.content_type).toString();\n const fileExtension = mimetype_1.mimeTypeToFileExtension(contentType);\n if (!fileExtension) {\n console.warn(`[${displayAPIName}] the input param ${key}.contentType is not a valid mime type`);\n }\n let filename = val.fileName;\n if (!filename) {\n filename = `${key}.${fileExtension || 'png'}`;\n }\n pairs.push({\n key,\n value: val.value,\n contentType,\n filename,\n });\n }\n else {\n const valStr = JSON.stringify(val);\n if (valStr !== undefined) {\n pairs.push({\n key,\n value: Buffer.from(valStr),\n });\n }\n }\n }\n const pbMessage = openapi_1.CommApiData.encode({\n apiType: openapi_1.CommApiData.ApiType.OPEN_API,\n openapiData: {\n pairs,\n },\n }).finish();\n const wxResp = await cloud.provider.api.callWXOpenAPI({\n api: options.api,\n data: Buffer.from(pbMessage),\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config),\n apiConfig: options.config,\n });\n let result;\n if (wxResp) {\n if (/(application\\/json)|(text\\/plain)/.test(wxResp.contentType)) {\n // json response\n // NOTICE: sometimes the wx sever, for no reason, returns a json with content-type text/plain, and we have to deal with it...\n try {\n result = JSON.parse(wxResp.respData.toString());\n }\n catch (parseWXRespJSONError) {\n // wx server says it's a json but instead it is not a valid json\n // if the content-type is text/plain and is not a valid json, we can safely return the string back\n if (/text\\/plain/.test(wxResp.contentType)) {\n result = {\n result: wxResp.respData.toString()\n };\n }\n else {\n // internal error\n throw new error_1.CloudSDKError({\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: msg_1.apiFailMsg(displayAPIName, `wechat server internal error, response body is invalid json: ${wxResp.respData.toString()}`)\n });\n }\n }\n if (result.errcode) {\n // wx error\n throw new error_1.CloudSDKError({\n errCode: result.errcode,\n errMsg: msg_1.apiFailMsg(displayAPIName, result.errmsg),\n });\n }\n else {\n delete result.errcode;\n delete result.errmsg;\n if (shouldConvertCase) {\n // convert snake case to camel case\n result = utils_1.convertCase(result, {\n from: 'snakecase',\n to: 'camelcase',\n recursive: true,\n });\n }\n }\n }\n else {\n // buffer response\n result = {\n contentType: wxResp.contentType.trim(),\n buffer: wxResp.respData,\n };\n }\n }\n else {\n throw {\n errCode: error_config_1.ERR_CODE.WX_SYSTEM_ERROR,\n errMsg: `internal server error, empty resp buffer`,\n };\n }\n return Object.assign(Object.assign({}, result), { errMsg: msg_1.apiSuccessMsg(displayAPIName), errCode: 0 });\n }\n catch (e) {\n throw error_1.returnAsFinalCloudSDKError(e, displayAPIName);\n }\n }\n}\nexports.default = getGenericOpenAPI;\n\n\n/***/ }),\n\n/***/ \"./src/api/openapi/namespace/index.ts\":\n/*!********************************************!*\\\n !*** ./src/api/openapi/namespace/index.ts ***!\n \\********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst generic_1 = __webpack_require__(/*! ./generic */ \"./src/api/openapi/namespace/generic.ts\");\nfunction getAPIs(cloud) {\n return generic_1.default(cloud);\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/api.ts\":\n/*!************************************!*\\\n !*** ./src/api/storage/api/api.ts ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst uploadFile_1 = __webpack_require__(/*! ./uploadFile */ \"./src/api/storage/api/uploadFile.ts\");\nconst downloadFile_1 = __webpack_require__(/*! ./downloadFile */ \"./src/api/storage/api/downloadFile.ts\");\nconst getTempFileURL_1 = __webpack_require__(/*! ./getTempFileURL */ \"./src/api/storage/api/getTempFileURL.ts\");\nconst deleteFile_1 = __webpack_require__(/*! ./deleteFile */ \"./src/api/storage/api/deleteFile.ts\");\nfunction getAPIs(cloud) {\n return {\n uploadFile: uploadFile_1.default(cloud),\n downloadFile: downloadFile_1.default(cloud),\n getTempFileURL: getTempFileURL_1.default(cloud),\n deleteFile: deleteFile_1.default(cloud),\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/deleteFile.ts\":\n/*!*******************************************!*\\\n !*** ./src/api/storage/api/deleteFile.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getDeleteFile(cloud) {\n return function deleteFile(options) {\n const apiName = 'deleteFile';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for deleteFile must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n fileList: 'array'\n });\n options.fileList.forEach((f, i) => {\n if (typeof f !== 'string') {\n throw new Error(`Type of fileList[${i}] must be string instead of ${typeof f}`);\n }\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.deleteFile({\n fileList: options.fileList\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileList: result.fileList,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getDeleteFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/downloadFile.ts\":\n/*!*********************************************!*\\\n !*** ./src/api/storage/api/downloadFile.ts ***!\n \\*********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getDownloadFile(cloud) {\n return function downloadFile(options) {\n const apiName = 'downloadFile';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for downloadFile must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n fileID: 'string',\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.downloadFile({\n fileID: options.fileID,\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileContent: result.fileContent,\n statusCode: result.statusCode,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getDownloadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/getTempFileURL.ts\":\n/*!***********************************************!*\\\n !*** ./src/api/storage/api/getTempFileURL.ts ***!\n \\***********************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getGetTempFileURL(cloud) {\n return function getTempFileURL(options) {\n const apiName = 'getTempFileURL';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for getTempFileURL must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n fileList: 'array',\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n try {\n const result = await cloud.provider.api.getTempFileURL({\n fileList: options.fileList,\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileList: result.fileList,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getGetTempFileURL;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/api/uploadFile.ts\":\n/*!*******************************************!*\\\n !*** ./src/api/storage/api/uploadFile.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst assert_1 = __webpack_require__(/*! utils/assert */ \"./src/utils/assert.ts\");\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst msg_1 = __webpack_require__(/*! utils/msg */ \"./src/utils/msg.ts\");\nconst utils_1 = __webpack_require__(/*! utils/utils */ \"./src/utils/utils.ts\");\nfunction getUploadFile(cloud) {\n return function uploadFile(options) {\n const apiName = 'uploadFile';\n return new Promise(async (resolve, reject) => {\n if (!options) {\n return reject(error_1.returnAsFinalCloudSDKError({\n errMsg: 'Params for uploadFile must be an object instead of ' + typeof options,\n }, apiName));\n }\n try {\n assert_1.assertType(options, {\n cloudPath: 'string',\n });\n if (!options.fileContent) {\n return reject(error_1.returnAsFinalCloudSDKError(new Error('Type of fileContent must be fs.ReadStream instead of ' + typeof options.fileContent), apiName));\n }\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n const header = options.header || {};\n try {\n const result = await cloud.provider.api.uploadFile({\n fileContent: options.fileContent,\n cloudPath: options.cloudPath,\n header,\n }, {\n defaultConfig: utils_1.getServiceConfigFromDefaultConfig(cloud.config, 'storage'),\n apiConfig: options.config,\n });\n return resolve({\n fileID: result.fileID,\n statusCode: result.statusCode,\n errMsg: msg_1.apiSuccessMsg(apiName),\n });\n }\n catch (e) {\n return reject(error_1.returnAsFinalCloudSDKError(e, apiName));\n }\n });\n };\n}\nexports.default = getUploadFile;\n\n\n/***/ }),\n\n/***/ \"./src/api/storage/index.ts\":\n/*!**********************************!*\\\n !*** ./src/api/storage/index.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/storage/api/api.ts\");\nexports.STORAGE_SERVICE_NAME = 'storage';\nfunction createStorageService(cloud) {\n return {\n name: exports.STORAGE_SERVICE_NAME,\n getAPIs: api_1.getAPIs.bind(null, cloud),\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createStorageService(cloud));\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/api/utils/api/api.ts\":\n/*!**********************************!*\\\n !*** ./src/api/utils/api/api.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst getWXContext_1 = __webpack_require__(/*! ./getWXContext */ \"./src/api/utils/api/getWXContext.ts\");\nfunction getAPIs() {\n return {\n getWXContext: getWXContext_1.default,\n };\n}\nexports.getAPIs = getAPIs;\n\n\n/***/ }),\n\n/***/ \"./src/api/utils/api/getWXContext.ts\":\n/*!*******************************************!*\\\n !*** ./src/api/utils/api/getWXContext.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst error_1 = __webpack_require__(/*! utils/error */ \"./src/utils/error.ts\");\nconst WX_PREFIX = 'WX_';\nconst CONTEXT_KEYS_BLACKLIST = [\n 'API_TOKEN',\n 'TRIGGER_API_TOKEN_V0',\n];\nfunction isContextKeyInBlacklist(key) {\n return CONTEXT_KEYS_BLACKLIST.some(v => v === key || (WX_PREFIX + v) === key);\n}\nexports.isContextKeyInBlacklist = isContextKeyInBlacklist;\nfunction isNumber(val) {\n return /^[-]?\\d+$/.test(val);\n}\nexports.isNumber = isNumber;\nfunction getWXContext() {\n const apiName = 'getWXContext';\n const wxContext = {};\n if (!process.env.WX_CONTEXT_KEYS)\n return wxContext;\n try {\n const contextKeys = process.env.WX_CONTEXT_KEYS.split(',');\n for (const key of contextKeys) {\n if (!key)\n continue;\n if (isContextKeyInBlacklist(key))\n continue;\n let val = process.env[key];\n if (val === undefined)\n continue;\n if (isNumber(val)) {\n val = parseInt(val);\n }\n if (key.startsWith(WX_PREFIX) && key.length > 3) {\n wxContext[key.slice(3)] = val;\n }\n else {\n wxContext[key] = val;\n }\n }\n wxContext.ENV = process.env.TCB_ENV || process.env.SCF_NAMESPACE;\n if (process.env.TCB_SOURCE) {\n wxContext.SOURCE = process.env.TCB_SOURCE;\n }\n return wxContext;\n }\n catch (e) {\n const error = error_1.returnAsFinalCloudSDKError(e, apiName);\n throw error;\n }\n}\nexports.default = getWXContext;\n\n\n/***/ }),\n\n/***/ \"./src/api/utils/index.ts\":\n/*!********************************!*\\\n !*** ./src/api/utils/index.ts ***!\n \\********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst api_1 = __webpack_require__(/*! ./api/api */ \"./src/api/utils/api/api.ts\");\nconst UTILS_SERVICE_NAME = 'utils';\nfunction createUtilsService() {\n return {\n name: UTILS_SERVICE_NAME,\n getAPIs: api_1.getAPIs,\n initRequired: false,\n };\n}\nfunction registerService(cloud) {\n cloud.registerService(createUtilsService());\n}\nexports.registerService = registerService;\n\n\n/***/ }),\n\n/***/ \"./src/config/error.config.ts\":\n/*!************************************!*\\\n !*** ./src/config/error.config.ts ***!\n \\************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERR_CODE = {\n '-1': 'unknown error',\n UNKNOWN_ERROR: -1,\n // 以 6 开始的是由微信服务器侧产生的错误码\n // 以 5 开始的是由腾讯云侧产生的错误码\n // 以 4 开始的是本地 SDK 产生的错误\n // 接下来两位表示具体业务类型:01通用,02数据库,03文件,04云函数\n // 最后三位表示具体的错误\n // 小程序 SDK 云函数\n '-404001': 'empty call result',\n SDK_FUNCTIONS_EMPTY_CALL_RESULT: -404001,\n '-404002': 'empty event id',\n SDK_FUNCTIONS_EMPTY_EVENT_ID: -404002,\n '-404003': 'empty poll url',\n SDK_FUNCTIONS_EMPTY_POLL_URL: -404003,\n '-404004': 'empty poll result json',\n SDK_FUNCTIONS_EMPTY_POLL_RESULT_JSON: -404004,\n '-404005': 'exceed max poll retry',\n SDK_FUNCTIONS_EXCEED_MAX_POLL_RETRY: -404005,\n '-404006': 'empty poll result base resp',\n SDK_FUNCTIONS_EMPTY_POLL_RESULT_BASE_RESP: -404006,\n '-404007': 'error while polling for the result, poll result base resp ret %s',\n SDK_FUNCTIONS_POLL_RESULT_BASE_RESP_RET_ABNORMAL: -404007,\n '-404008': 'error while polling for the result, polling server return a status code of %s',\n SDK_FUNCTIONS_POLL_RESULT_STATUS_CODE_ERROR: -404008,\n '-404009': 'error while polling for the result: %s',\n SDK_FUNCTIONS_POLL_ERROR: -404009,\n // 微信服务器\n '-601001': 'system error',\n WX_SYSTEM_ERROR: -601001,\n '-601002': 'system args error',\n WX_SYSTEM_ARGS_ERROR: -601002,\n '-601003': 'system network error',\n WX_SYSTEM_NETWORK_ERROR: -601003,\n '-604100': 'API not found',\n WX_FUNCTIONS_SERVER_OPENAPI_NOT_FOUND: -604100,\n '-604101': 'function has no permission to call this API',\n WX_FUNCTIONS_SERVER_OPENAPI_NO_PERMISSION: -604101,\n '-604102': 'call open API timeout',\n WX_FUNCTIONS_SERVER_OPENAPI_TIMEOUT: -604102,\n '-604103': 'call open API system error',\n WX_FUNCTIONS_SERVER_OPENAPI_SYSTEM_ERROR: -604102,\n // 腾讯云通用\n '-501001': 'resource system error',\n TCB_RESOURCE_SYSTEM_ERROR: -501001,\n '-501002': 'resource server timeout',\n TCB_RESOURCE_SERVER_TIMEOUT: -501002,\n '-501003': 'exceed request limit',\n TCB_EXCEED_REQUEST_LIMIT: -501003,\n '-501004': 'exceed concurrent request limit',\n TCB_EXCEED_CONCURRENT_REQUEST_LIMIT: -501004,\n '-501005': 'invalid env',\n TCB_INVALID_ENV: -501005,\n '-501006': 'invalid common parameters',\n TCB_INVALID_COMMON_PARAM: -501006,\n '-501007': 'invalid parameters',\n TCB_INVALID_PARAM: -501007,\n '-501008': 'invalid request source',\n TCB_INVALID_REQUEST_SOURCE: -501008,\n '-501009': 'resource not initialized',\n TCB_RESOURCE_NOT_INITIALIZED: -501009,\n // 腾讯云数据库\n '-502001': 'database request fail',\n TCB_DB_REQUEST_FAIL: -502001,\n '-502002': 'database invalid command',\n TCB_DB_INVALID_COMMAND: -502002,\n '-502003': 'database permission denied',\n TCB_DB_PERMISSION_DENIED: -502003,\n '-502004': 'database exceed collection limit',\n TCB_DB_EXCEED_COLLECTION_LIMIT: -502004,\n '-502005': 'database collection not exists',\n TCB_DB_COLLECTION_NOT_EXISTS: -502005,\n // 腾讯云文件管理\n '-503001': 'storage request fail',\n TCB_STORAGE_REQUEST_FAIL: -503001,\n '-503002': 'storage permission denied',\n TCB_STORAGE_PERMISSION_DENIED: -503002,\n '-503003': 'storage file not exists',\n TCB_STORAGE_FILE_NOT_EXISTS: -503003,\n '-503004': 'storage invalid sign parameter',\n TCB_STORAGE_INVALID_SIGN_PARAM: -503004,\n // 腾讯云云函数\n '-504001': 'functions request fail',\n TCB_FUNCTIONS_REQUEST_FAIL: -504001,\n '-504002': 'functions execute fail',\n TCB_FUNCTIONS_EXEC_FAIL: -504002,\n};\n\n\n/***/ }),\n\n/***/ \"./src/config/symbol.config.ts\":\n/*!*************************************!*\\\n !*** ./src/config/symbol.config.ts ***!\n \\*************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SYMBOL_DYNAMIC_CURRENT_ENV = Symbol.for('DYNAMIC_CURRENT_ENV');\n\n\n/***/ }),\n\n/***/ \"./src/index.ts\":\n/*!**********************!*\\\n !*** ./src/index.ts ***!\n \\**********************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nconst cloud_1 = __webpack_require__(/*! ./api/cloud */ \"./src/api/cloud/index.ts\");\nmodule.exports = cloud_1.default.exportAPI;\n\n\n/***/ }),\n\n/***/ \"./src/protobuf/openapi.js\":\n/*!*********************************!*\\\n !*** ./src/protobuf/openapi.js ***!\n \\*********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\n\nvar $protobuf = __webpack_require__(/*! protobufjs/minimal */ \"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\n\n$root.KeyValuePair = (function() {\n\n /**\n * Properties of a KeyValuePair.\n * @exports IKeyValuePair\n * @interface IKeyValuePair\n * @property {string|null} [key] KeyValuePair key\n * @property {Uint8Array|null} [value] KeyValuePair value\n * @property {string|null} [contenttype] KeyValuePair contenttype\n * @property {string|null} [filename] KeyValuePair filename\n */\n\n /**\n * Constructs a new KeyValuePair.\n * @exports KeyValuePair\n * @classdesc Represents a KeyValuePair.\n * @implements IKeyValuePair\n * @constructor\n * @param {IKeyValuePair=} [properties] Properties to set\n */\n function KeyValuePair(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * KeyValuePair key.\n * @member {string} key\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.key = \"\";\n\n /**\n * KeyValuePair value.\n * @member {Uint8Array} value\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.value = $util.newBuffer([]);\n\n /**\n * KeyValuePair contenttype.\n * @member {string} contenttype\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.contenttype = \"\";\n\n /**\n * KeyValuePair filename.\n * @member {string} filename\n * @memberof KeyValuePair\n * @instance\n */\n KeyValuePair.prototype.filename = \"\";\n\n /**\n * Creates a new KeyValuePair instance using the specified properties.\n * @function create\n * @memberof KeyValuePair\n * @static\n * @param {IKeyValuePair=} [properties] Properties to set\n * @returns {KeyValuePair} KeyValuePair instance\n */\n KeyValuePair.create = function create(properties) {\n return new KeyValuePair(properties);\n };\n\n /**\n * Encodes the specified KeyValuePair message. Does not implicitly {@link KeyValuePair.verify|verify} messages.\n * @function encode\n * @memberof KeyValuePair\n * @static\n * @param {IKeyValuePair} message KeyValuePair message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n KeyValuePair.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.key != null && message.hasOwnProperty(\"key\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);\n if (message.value != null && message.hasOwnProperty(\"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);\n if (message.contenttype != null && message.hasOwnProperty(\"contenttype\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.contenttype);\n if (message.filename != null && message.hasOwnProperty(\"filename\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename);\n return writer;\n };\n\n /**\n * Encodes the specified KeyValuePair message, length delimited. Does not implicitly {@link KeyValuePair.verify|verify} messages.\n * @function encodeDelimited\n * @memberof KeyValuePair\n * @static\n * @param {IKeyValuePair} message KeyValuePair message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n KeyValuePair.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a KeyValuePair message from the specified reader or buffer.\n * @function decode\n * @memberof KeyValuePair\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {KeyValuePair} KeyValuePair\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n KeyValuePair.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.KeyValuePair();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.string();\n break;\n case 2:\n message.value = reader.bytes();\n break;\n case 3:\n message.contenttype = reader.string();\n break;\n case 4:\n message.filename = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a KeyValuePair message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof KeyValuePair\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {KeyValuePair} KeyValuePair\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n KeyValuePair.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a KeyValuePair message.\n * @function verify\n * @memberof KeyValuePair\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n KeyValuePair.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.key != null && message.hasOwnProperty(\"key\"))\n if (!$util.isString(message.key))\n return \"key: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!(message.value && typeof message.value.length === \"number\" || $util.isString(message.value)))\n return \"value: buffer expected\";\n if (message.contenttype != null && message.hasOwnProperty(\"contenttype\"))\n if (!$util.isString(message.contenttype))\n return \"contenttype: string expected\";\n if (message.filename != null && message.hasOwnProperty(\"filename\"))\n if (!$util.isString(message.filename))\n return \"filename: string expected\";\n return null;\n };\n\n /**\n * Creates a KeyValuePair message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof KeyValuePair\n * @static\n * @param {Object.} object Plain object\n * @returns {KeyValuePair} KeyValuePair\n */\n KeyValuePair.fromObject = function fromObject(object) {\n if (object instanceof $root.KeyValuePair)\n return object;\n var message = new $root.KeyValuePair();\n if (object.key != null)\n message.key = String(object.key);\n if (object.value != null)\n if (typeof object.value === \"string\")\n $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);\n else if (object.value.length)\n message.value = object.value;\n if (object.contenttype != null)\n message.contenttype = String(object.contenttype);\n if (object.filename != null)\n message.filename = String(object.filename);\n return message;\n };\n\n /**\n * Creates a plain object from a KeyValuePair message. Also converts values to other types if specified.\n * @function toObject\n * @memberof KeyValuePair\n * @static\n * @param {KeyValuePair} message KeyValuePair\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n KeyValuePair.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.key = \"\";\n if (options.bytes === String)\n object.value = \"\";\n else {\n object.value = [];\n if (options.bytes !== Array)\n object.value = $util.newBuffer(object.value);\n }\n object.contenttype = \"\";\n object.filename = \"\";\n }\n if (message.key != null && message.hasOwnProperty(\"key\"))\n object.key = message.key;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;\n if (message.contenttype != null && message.hasOwnProperty(\"contenttype\"))\n object.contenttype = message.contenttype;\n if (message.filename != null && message.hasOwnProperty(\"filename\"))\n object.filename = message.filename;\n return object;\n };\n\n /**\n * Converts this KeyValuePair to JSON.\n * @function toJSON\n * @memberof KeyValuePair\n * @instance\n * @returns {Object.} JSON object\n */\n KeyValuePair.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return KeyValuePair;\n})();\n\n$root.OpenApiData = (function() {\n\n /**\n * Properties of an OpenApiData.\n * @exports IOpenApiData\n * @interface IOpenApiData\n * @property {Array.|null} [pairs] OpenApiData pairs\n */\n\n /**\n * Constructs a new OpenApiData.\n * @exports OpenApiData\n * @classdesc Represents an OpenApiData.\n * @implements IOpenApiData\n * @constructor\n * @param {IOpenApiData=} [properties] Properties to set\n */\n function OpenApiData(properties) {\n this.pairs = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * OpenApiData pairs.\n * @member {Array.} pairs\n * @memberof OpenApiData\n * @instance\n */\n OpenApiData.prototype.pairs = $util.emptyArray;\n\n /**\n * Creates a new OpenApiData instance using the specified properties.\n * @function create\n * @memberof OpenApiData\n * @static\n * @param {IOpenApiData=} [properties] Properties to set\n * @returns {OpenApiData} OpenApiData instance\n */\n OpenApiData.create = function create(properties) {\n return new OpenApiData(properties);\n };\n\n /**\n * Encodes the specified OpenApiData message. Does not implicitly {@link OpenApiData.verify|verify} messages.\n * @function encode\n * @memberof OpenApiData\n * @static\n * @param {IOpenApiData} message OpenApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpenApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.pairs != null && message.pairs.length)\n for (var i = 0; i < message.pairs.length; ++i)\n $root.KeyValuePair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified OpenApiData message, length delimited. Does not implicitly {@link OpenApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof OpenApiData\n * @static\n * @param {IOpenApiData} message OpenApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpenApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an OpenApiData message from the specified reader or buffer.\n * @function decode\n * @memberof OpenApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {OpenApiData} OpenApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpenApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.OpenApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (!(message.pairs && message.pairs.length))\n message.pairs = [];\n message.pairs.push($root.KeyValuePair.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an OpenApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof OpenApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {OpenApiData} OpenApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpenApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an OpenApiData message.\n * @function verify\n * @memberof OpenApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OpenApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.pairs != null && message.hasOwnProperty(\"pairs\")) {\n if (!Array.isArray(message.pairs))\n return \"pairs: array expected\";\n for (var i = 0; i < message.pairs.length; ++i) {\n var error = $root.KeyValuePair.verify(message.pairs[i]);\n if (error)\n return \"pairs.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates an OpenApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof OpenApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {OpenApiData} OpenApiData\n */\n OpenApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.OpenApiData)\n return object;\n var message = new $root.OpenApiData();\n if (object.pairs) {\n if (!Array.isArray(object.pairs))\n throw TypeError(\".OpenApiData.pairs: array expected\");\n message.pairs = [];\n for (var i = 0; i < object.pairs.length; ++i) {\n if (typeof object.pairs[i] !== \"object\")\n throw TypeError(\".OpenApiData.pairs: object expected\");\n message.pairs[i] = $root.KeyValuePair.fromObject(object.pairs[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from an OpenApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof OpenApiData\n * @static\n * @param {OpenApiData} message OpenApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OpenApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.pairs = [];\n if (message.pairs && message.pairs.length) {\n object.pairs = [];\n for (var j = 0; j < message.pairs.length; ++j)\n object.pairs[j] = $root.KeyValuePair.toObject(message.pairs[j], options);\n }\n return object;\n };\n\n /**\n * Converts this OpenApiData to JSON.\n * @function toJSON\n * @memberof OpenApiData\n * @instance\n * @returns {Object.} JSON object\n */\n OpenApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return OpenApiData;\n})();\n\n$root.CommApiData = (function() {\n\n /**\n * Properties of a CommApiData.\n * @exports ICommApiData\n * @interface ICommApiData\n * @property {CommApiData.ApiType|null} [apiType] CommApiData apiType\n * @property {IOpenApiData|null} [openapiData] CommApiData openapiData\n * @property {IInnerApiData|null} [innerData] CommApiData innerData\n * @property {ISvrkitApiData|null} [svrkitData] CommApiData svrkitData\n */\n\n /**\n * Constructs a new CommApiData.\n * @exports CommApiData\n * @classdesc Represents a CommApiData.\n * @implements ICommApiData\n * @constructor\n * @param {ICommApiData=} [properties] Properties to set\n */\n function CommApiData(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * CommApiData apiType.\n * @member {CommApiData.ApiType} apiType\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.apiType = 0;\n\n /**\n * CommApiData openapiData.\n * @member {IOpenApiData|null|undefined} openapiData\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.openapiData = null;\n\n /**\n * CommApiData innerData.\n * @member {IInnerApiData|null|undefined} innerData\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.innerData = null;\n\n /**\n * CommApiData svrkitData.\n * @member {ISvrkitApiData|null|undefined} svrkitData\n * @memberof CommApiData\n * @instance\n */\n CommApiData.prototype.svrkitData = null;\n\n /**\n * Creates a new CommApiData instance using the specified properties.\n * @function create\n * @memberof CommApiData\n * @static\n * @param {ICommApiData=} [properties] Properties to set\n * @returns {CommApiData} CommApiData instance\n */\n CommApiData.create = function create(properties) {\n return new CommApiData(properties);\n };\n\n /**\n * Encodes the specified CommApiData message. Does not implicitly {@link CommApiData.verify|verify} messages.\n * @function encode\n * @memberof CommApiData\n * @static\n * @param {ICommApiData} message CommApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.apiType != null && message.hasOwnProperty(\"apiType\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.apiType);\n if (message.openapiData != null && message.hasOwnProperty(\"openapiData\"))\n $root.OpenApiData.encode(message.openapiData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.innerData != null && message.hasOwnProperty(\"innerData\"))\n $root.InnerApiData.encode(message.innerData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.svrkitData != null && message.hasOwnProperty(\"svrkitData\"))\n $root.SvrkitApiData.encode(message.svrkitData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified CommApiData message, length delimited. Does not implicitly {@link CommApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof CommApiData\n * @static\n * @param {ICommApiData} message CommApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a CommApiData message from the specified reader or buffer.\n * @function decode\n * @memberof CommApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {CommApiData} CommApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.apiType = reader.int32();\n break;\n case 2:\n message.openapiData = $root.OpenApiData.decode(reader, reader.uint32());\n break;\n case 3:\n message.innerData = $root.InnerApiData.decode(reader, reader.uint32());\n break;\n case 4:\n message.svrkitData = $root.SvrkitApiData.decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a CommApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof CommApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {CommApiData} CommApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a CommApiData message.\n * @function verify\n * @memberof CommApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CommApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.apiType != null && message.hasOwnProperty(\"apiType\"))\n switch (message.apiType) {\n default:\n return \"apiType: enum value expected\";\n case 0:\n case 1:\n case 2:\n break;\n }\n if (message.openapiData != null && message.hasOwnProperty(\"openapiData\")) {\n var error = $root.OpenApiData.verify(message.openapiData);\n if (error)\n return \"openapiData.\" + error;\n }\n if (message.innerData != null && message.hasOwnProperty(\"innerData\")) {\n var error = $root.InnerApiData.verify(message.innerData);\n if (error)\n return \"innerData.\" + error;\n }\n if (message.svrkitData != null && message.hasOwnProperty(\"svrkitData\")) {\n var error = $root.SvrkitApiData.verify(message.svrkitData);\n if (error)\n return \"svrkitData.\" + error;\n }\n return null;\n };\n\n /**\n * Creates a CommApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof CommApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {CommApiData} CommApiData\n */\n CommApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.CommApiData)\n return object;\n var message = new $root.CommApiData();\n switch (object.apiType) {\n case \"OPEN_API\":\n case 0:\n message.apiType = 0;\n break;\n case \"INNER_API\":\n case 1:\n message.apiType = 1;\n break;\n case \"SVRKIT_API\":\n case 2:\n message.apiType = 2;\n break;\n }\n if (object.openapiData != null) {\n if (typeof object.openapiData !== \"object\")\n throw TypeError(\".CommApiData.openapiData: object expected\");\n message.openapiData = $root.OpenApiData.fromObject(object.openapiData);\n }\n if (object.innerData != null) {\n if (typeof object.innerData !== \"object\")\n throw TypeError(\".CommApiData.innerData: object expected\");\n message.innerData = $root.InnerApiData.fromObject(object.innerData);\n }\n if (object.svrkitData != null) {\n if (typeof object.svrkitData !== \"object\")\n throw TypeError(\".CommApiData.svrkitData: object expected\");\n message.svrkitData = $root.SvrkitApiData.fromObject(object.svrkitData);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a CommApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof CommApiData\n * @static\n * @param {CommApiData} message CommApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CommApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.apiType = options.enums === String ? \"OPEN_API\" : 0;\n object.openapiData = null;\n object.innerData = null;\n object.svrkitData = null;\n }\n if (message.apiType != null && message.hasOwnProperty(\"apiType\"))\n object.apiType = options.enums === String ? $root.CommApiData.ApiType[message.apiType] : message.apiType;\n if (message.openapiData != null && message.hasOwnProperty(\"openapiData\"))\n object.openapiData = $root.OpenApiData.toObject(message.openapiData, options);\n if (message.innerData != null && message.hasOwnProperty(\"innerData\"))\n object.innerData = $root.InnerApiData.toObject(message.innerData, options);\n if (message.svrkitData != null && message.hasOwnProperty(\"svrkitData\"))\n object.svrkitData = $root.SvrkitApiData.toObject(message.svrkitData, options);\n return object;\n };\n\n /**\n * Converts this CommApiData to JSON.\n * @function toJSON\n * @memberof CommApiData\n * @instance\n * @returns {Object.} JSON object\n */\n CommApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * ApiType enum.\n * @name CommApiData.ApiType\n * @enum {string}\n * @property {number} OPEN_API=0 OPEN_API value\n * @property {number} INNER_API=1 INNER_API value\n * @property {number} SVRKIT_API=2 SVRKIT_API value\n */\n CommApiData.ApiType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"OPEN_API\"] = 0;\n values[valuesById[1] = \"INNER_API\"] = 1;\n values[valuesById[2] = \"SVRKIT_API\"] = 2;\n return values;\n })();\n\n return CommApiData;\n})();\n\n$root.CommOpenApiResp = (function() {\n\n /**\n * Properties of a CommOpenApiResp.\n * @exports ICommOpenApiResp\n * @interface ICommOpenApiResp\n * @property {Uint8Array|null} [respData] CommOpenApiResp respData\n * @property {string|null} [contentType] CommOpenApiResp contentType\n * @property {number|null} [errorCode] CommOpenApiResp errorCode\n * @property {number|null} [httpCode] CommOpenApiResp httpCode\n * @property {Array.|null} [headers] CommOpenApiResp headers\n * @property {number|null} [svrkitErrorCode] CommOpenApiResp svrkitErrorCode\n */\n\n /**\n * Constructs a new CommOpenApiResp.\n * @exports CommOpenApiResp\n * @classdesc Represents a CommOpenApiResp.\n * @implements ICommOpenApiResp\n * @constructor\n * @param {ICommOpenApiResp=} [properties] Properties to set\n */\n function CommOpenApiResp(properties) {\n this.headers = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * CommOpenApiResp respData.\n * @member {Uint8Array} respData\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.respData = $util.newBuffer([]);\n\n /**\n * CommOpenApiResp contentType.\n * @member {string} contentType\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.contentType = \"\";\n\n /**\n * CommOpenApiResp errorCode.\n * @member {number} errorCode\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.errorCode = 0;\n\n /**\n * CommOpenApiResp httpCode.\n * @member {number} httpCode\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.httpCode = 0;\n\n /**\n * CommOpenApiResp headers.\n * @member {Array.} headers\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.headers = $util.emptyArray;\n\n /**\n * CommOpenApiResp svrkitErrorCode.\n * @member {number} svrkitErrorCode\n * @memberof CommOpenApiResp\n * @instance\n */\n CommOpenApiResp.prototype.svrkitErrorCode = 0;\n\n /**\n * Creates a new CommOpenApiResp instance using the specified properties.\n * @function create\n * @memberof CommOpenApiResp\n * @static\n * @param {ICommOpenApiResp=} [properties] Properties to set\n * @returns {CommOpenApiResp} CommOpenApiResp instance\n */\n CommOpenApiResp.create = function create(properties) {\n return new CommOpenApiResp(properties);\n };\n\n /**\n * Encodes the specified CommOpenApiResp message. Does not implicitly {@link CommOpenApiResp.verify|verify} messages.\n * @function encode\n * @memberof CommOpenApiResp\n * @static\n * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommOpenApiResp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.respData != null && message.hasOwnProperty(\"respData\"))\n writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.respData);\n if (message.contentType != null && message.hasOwnProperty(\"contentType\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.contentType);\n if (message.errorCode != null && message.hasOwnProperty(\"errorCode\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int32(message.errorCode);\n if (message.httpCode != null && message.hasOwnProperty(\"httpCode\"))\n writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.httpCode);\n if (message.headers != null && message.headers.length)\n for (var i = 0; i < message.headers.length; ++i)\n $root.HttpHeader.encode(message.headers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.svrkitErrorCode != null && message.hasOwnProperty(\"svrkitErrorCode\"))\n writer.uint32(/* id 6, wireType 0 =*/48).int32(message.svrkitErrorCode);\n return writer;\n };\n\n /**\n * Encodes the specified CommOpenApiResp message, length delimited. Does not implicitly {@link CommOpenApiResp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof CommOpenApiResp\n * @static\n * @param {ICommOpenApiResp} message CommOpenApiResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n CommOpenApiResp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a CommOpenApiResp message from the specified reader or buffer.\n * @function decode\n * @memberof CommOpenApiResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {CommOpenApiResp} CommOpenApiResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommOpenApiResp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CommOpenApiResp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.respData = reader.bytes();\n break;\n case 2:\n message.contentType = reader.string();\n break;\n case 3:\n message.errorCode = reader.int32();\n break;\n case 4:\n message.httpCode = reader.uint32();\n break;\n case 5:\n if (!(message.headers && message.headers.length))\n message.headers = [];\n message.headers.push($root.HttpHeader.decode(reader, reader.uint32()));\n break;\n case 6:\n message.svrkitErrorCode = reader.int32();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a CommOpenApiResp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof CommOpenApiResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {CommOpenApiResp} CommOpenApiResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n CommOpenApiResp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a CommOpenApiResp message.\n * @function verify\n * @memberof CommOpenApiResp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n CommOpenApiResp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.respData != null && message.hasOwnProperty(\"respData\"))\n if (!(message.respData && typeof message.respData.length === \"number\" || $util.isString(message.respData)))\n return \"respData: buffer expected\";\n if (message.contentType != null && message.hasOwnProperty(\"contentType\"))\n if (!$util.isString(message.contentType))\n return \"contentType: string expected\";\n if (message.errorCode != null && message.hasOwnProperty(\"errorCode\"))\n if (!$util.isInteger(message.errorCode))\n return \"errorCode: integer expected\";\n if (message.httpCode != null && message.hasOwnProperty(\"httpCode\"))\n if (!$util.isInteger(message.httpCode))\n return \"httpCode: integer expected\";\n if (message.headers != null && message.hasOwnProperty(\"headers\")) {\n if (!Array.isArray(message.headers))\n return \"headers: array expected\";\n for (var i = 0; i < message.headers.length; ++i) {\n var error = $root.HttpHeader.verify(message.headers[i]);\n if (error)\n return \"headers.\" + error;\n }\n }\n if (message.svrkitErrorCode != null && message.hasOwnProperty(\"svrkitErrorCode\"))\n if (!$util.isInteger(message.svrkitErrorCode))\n return \"svrkitErrorCode: integer expected\";\n return null;\n };\n\n /**\n * Creates a CommOpenApiResp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof CommOpenApiResp\n * @static\n * @param {Object.} object Plain object\n * @returns {CommOpenApiResp} CommOpenApiResp\n */\n CommOpenApiResp.fromObject = function fromObject(object) {\n if (object instanceof $root.CommOpenApiResp)\n return object;\n var message = new $root.CommOpenApiResp();\n if (object.respData != null)\n if (typeof object.respData === \"string\")\n $util.base64.decode(object.respData, message.respData = $util.newBuffer($util.base64.length(object.respData)), 0);\n else if (object.respData.length)\n message.respData = object.respData;\n if (object.contentType != null)\n message.contentType = String(object.contentType);\n if (object.errorCode != null)\n message.errorCode = object.errorCode | 0;\n if (object.httpCode != null)\n message.httpCode = object.httpCode >>> 0;\n if (object.headers) {\n if (!Array.isArray(object.headers))\n throw TypeError(\".CommOpenApiResp.headers: array expected\");\n message.headers = [];\n for (var i = 0; i < object.headers.length; ++i) {\n if (typeof object.headers[i] !== \"object\")\n throw TypeError(\".CommOpenApiResp.headers: object expected\");\n message.headers[i] = $root.HttpHeader.fromObject(object.headers[i]);\n }\n }\n if (object.svrkitErrorCode != null)\n message.svrkitErrorCode = object.svrkitErrorCode | 0;\n return message;\n };\n\n /**\n * Creates a plain object from a CommOpenApiResp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof CommOpenApiResp\n * @static\n * @param {CommOpenApiResp} message CommOpenApiResp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n CommOpenApiResp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.headers = [];\n if (options.defaults) {\n if (options.bytes === String)\n object.respData = \"\";\n else {\n object.respData = [];\n if (options.bytes !== Array)\n object.respData = $util.newBuffer(object.respData);\n }\n object.contentType = \"\";\n object.errorCode = 0;\n object.httpCode = 0;\n object.svrkitErrorCode = 0;\n }\n if (message.respData != null && message.hasOwnProperty(\"respData\"))\n object.respData = options.bytes === String ? $util.base64.encode(message.respData, 0, message.respData.length) : options.bytes === Array ? Array.prototype.slice.call(message.respData) : message.respData;\n if (message.contentType != null && message.hasOwnProperty(\"contentType\"))\n object.contentType = message.contentType;\n if (message.errorCode != null && message.hasOwnProperty(\"errorCode\"))\n object.errorCode = message.errorCode;\n if (message.httpCode != null && message.hasOwnProperty(\"httpCode\"))\n object.httpCode = message.httpCode;\n if (message.headers && message.headers.length) {\n object.headers = [];\n for (var j = 0; j < message.headers.length; ++j)\n object.headers[j] = $root.HttpHeader.toObject(message.headers[j], options);\n }\n if (message.svrkitErrorCode != null && message.hasOwnProperty(\"svrkitErrorCode\"))\n object.svrkitErrorCode = message.svrkitErrorCode;\n return object;\n };\n\n /**\n * Converts this CommOpenApiResp to JSON.\n * @function toJSON\n * @memberof CommOpenApiResp\n * @instance\n * @returns {Object.} JSON object\n */\n CommOpenApiResp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return CommOpenApiResp;\n})();\n\n$root.InnerApiData = (function() {\n\n /**\n * Properties of an InnerApiData.\n * @exports IInnerApiData\n * @interface IInnerApiData\n * @property {number|null} [modid] InnerApiData modid\n * @property {number|null} [cmdid] InnerApiData cmdid\n * @property {string|null} [url] InnerApiData url\n * @property {boolean|null} [useHttps] InnerApiData useHttps\n * @property {HTTP_METHODS|null} [method] InnerApiData method\n * @property {Array.|null} [headers] InnerApiData headers\n * @property {Uint8Array|null} [body] InnerApiData body\n */\n\n /**\n * Constructs a new InnerApiData.\n * @exports InnerApiData\n * @classdesc Represents an InnerApiData.\n * @implements IInnerApiData\n * @constructor\n * @param {IInnerApiData=} [properties] Properties to set\n */\n function InnerApiData(properties) {\n this.headers = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * InnerApiData modid.\n * @member {number} modid\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.modid = 0;\n\n /**\n * InnerApiData cmdid.\n * @member {number} cmdid\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.cmdid = 0;\n\n /**\n * InnerApiData url.\n * @member {string} url\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.url = \"\";\n\n /**\n * InnerApiData useHttps.\n * @member {boolean} useHttps\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.useHttps = false;\n\n /**\n * InnerApiData method.\n * @member {HTTP_METHODS} method\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.method = 1;\n\n /**\n * InnerApiData headers.\n * @member {Array.} headers\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.headers = $util.emptyArray;\n\n /**\n * InnerApiData body.\n * @member {Uint8Array} body\n * @memberof InnerApiData\n * @instance\n */\n InnerApiData.prototype.body = $util.newBuffer([]);\n\n /**\n * Creates a new InnerApiData instance using the specified properties.\n * @function create\n * @memberof InnerApiData\n * @static\n * @param {IInnerApiData=} [properties] Properties to set\n * @returns {InnerApiData} InnerApiData instance\n */\n InnerApiData.create = function create(properties) {\n return new InnerApiData(properties);\n };\n\n /**\n * Encodes the specified InnerApiData message. Does not implicitly {@link InnerApiData.verify|verify} messages.\n * @function encode\n * @memberof InnerApiData\n * @static\n * @param {IInnerApiData} message InnerApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n InnerApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.modid != null && message.hasOwnProperty(\"modid\"))\n writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.modid);\n if (message.cmdid != null && message.hasOwnProperty(\"cmdid\"))\n writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.cmdid);\n if (message.url != null && message.hasOwnProperty(\"url\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.url);\n if (message.useHttps != null && message.hasOwnProperty(\"useHttps\"))\n writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useHttps);\n if (message.method != null && message.hasOwnProperty(\"method\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int32(message.method);\n if (message.headers != null && message.headers.length)\n for (var i = 0; i < message.headers.length; ++i)\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.headers[i]);\n if (message.body != null && message.hasOwnProperty(\"body\"))\n writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.body);\n return writer;\n };\n\n /**\n * Encodes the specified InnerApiData message, length delimited. Does not implicitly {@link InnerApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof InnerApiData\n * @static\n * @param {IInnerApiData} message InnerApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n InnerApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an InnerApiData message from the specified reader or buffer.\n * @function decode\n * @memberof InnerApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {InnerApiData} InnerApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n InnerApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.InnerApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.modid = reader.uint32();\n break;\n case 2:\n message.cmdid = reader.uint32();\n break;\n case 3:\n message.url = reader.string();\n break;\n case 4:\n message.useHttps = reader.bool();\n break;\n case 5:\n message.method = reader.int32();\n break;\n case 6:\n if (!(message.headers && message.headers.length))\n message.headers = [];\n message.headers.push(reader.string());\n break;\n case 7:\n message.body = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an InnerApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof InnerApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {InnerApiData} InnerApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n InnerApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an InnerApiData message.\n * @function verify\n * @memberof InnerApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n InnerApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.modid != null && message.hasOwnProperty(\"modid\"))\n if (!$util.isInteger(message.modid))\n return \"modid: integer expected\";\n if (message.cmdid != null && message.hasOwnProperty(\"cmdid\"))\n if (!$util.isInteger(message.cmdid))\n return \"cmdid: integer expected\";\n if (message.url != null && message.hasOwnProperty(\"url\"))\n if (!$util.isString(message.url))\n return \"url: string expected\";\n if (message.useHttps != null && message.hasOwnProperty(\"useHttps\"))\n if (typeof message.useHttps !== \"boolean\")\n return \"useHttps: boolean expected\";\n if (message.method != null && message.hasOwnProperty(\"method\"))\n switch (message.method) {\n default:\n return \"method: enum value expected\";\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n break;\n }\n if (message.headers != null && message.hasOwnProperty(\"headers\")) {\n if (!Array.isArray(message.headers))\n return \"headers: array expected\";\n for (var i = 0; i < message.headers.length; ++i)\n if (!$util.isString(message.headers[i]))\n return \"headers: string[] expected\";\n }\n if (message.body != null && message.hasOwnProperty(\"body\"))\n if (!(message.body && typeof message.body.length === \"number\" || $util.isString(message.body)))\n return \"body: buffer expected\";\n return null;\n };\n\n /**\n * Creates an InnerApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof InnerApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {InnerApiData} InnerApiData\n */\n InnerApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.InnerApiData)\n return object;\n var message = new $root.InnerApiData();\n if (object.modid != null)\n message.modid = object.modid >>> 0;\n if (object.cmdid != null)\n message.cmdid = object.cmdid >>> 0;\n if (object.url != null)\n message.url = String(object.url);\n if (object.useHttps != null)\n message.useHttps = Boolean(object.useHttps);\n switch (object.method) {\n case \"HTTP_GET\":\n case 1:\n message.method = 1;\n break;\n case \"HTTP_POST\":\n case 2:\n message.method = 2;\n break;\n case \"HTTP_PUT\":\n case 3:\n message.method = 3;\n break;\n case \"HTTP_DELETE\":\n case 4:\n message.method = 4;\n break;\n case \"HTTP_HEAD\":\n case 5:\n message.method = 5;\n break;\n case \"HTTP_PATCH\":\n case 6:\n message.method = 6;\n break;\n }\n if (object.headers) {\n if (!Array.isArray(object.headers))\n throw TypeError(\".InnerApiData.headers: array expected\");\n message.headers = [];\n for (var i = 0; i < object.headers.length; ++i)\n message.headers[i] = String(object.headers[i]);\n }\n if (object.body != null)\n if (typeof object.body === \"string\")\n $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0);\n else if (object.body.length)\n message.body = object.body;\n return message;\n };\n\n /**\n * Creates a plain object from an InnerApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof InnerApiData\n * @static\n * @param {InnerApiData} message InnerApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n InnerApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.headers = [];\n if (options.defaults) {\n object.modid = 0;\n object.cmdid = 0;\n object.url = \"\";\n object.useHttps = false;\n object.method = options.enums === String ? \"HTTP_GET\" : 1;\n if (options.bytes === String)\n object.body = \"\";\n else {\n object.body = [];\n if (options.bytes !== Array)\n object.body = $util.newBuffer(object.body);\n }\n }\n if (message.modid != null && message.hasOwnProperty(\"modid\"))\n object.modid = message.modid;\n if (message.cmdid != null && message.hasOwnProperty(\"cmdid\"))\n object.cmdid = message.cmdid;\n if (message.url != null && message.hasOwnProperty(\"url\"))\n object.url = message.url;\n if (message.useHttps != null && message.hasOwnProperty(\"useHttps\"))\n object.useHttps = message.useHttps;\n if (message.method != null && message.hasOwnProperty(\"method\"))\n object.method = options.enums === String ? $root.HTTP_METHODS[message.method] : message.method;\n if (message.headers && message.headers.length) {\n object.headers = [];\n for (var j = 0; j < message.headers.length; ++j)\n object.headers[j] = message.headers[j];\n }\n if (message.body != null && message.hasOwnProperty(\"body\"))\n object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body;\n return object;\n };\n\n /**\n * Converts this InnerApiData to JSON.\n * @function toJSON\n * @memberof InnerApiData\n * @instance\n * @returns {Object.} JSON object\n */\n InnerApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return InnerApiData;\n})();\n\n$root.SvrkitApiData = (function() {\n\n /**\n * Properties of a SvrkitApiData.\n * @exports ISvrkitApiData\n * @interface ISvrkitApiData\n * @property {string|null} [apiName] SvrkitApiData apiName\n * @property {Uint8Array|null} [reqData] SvrkitApiData reqData\n */\n\n /**\n * Constructs a new SvrkitApiData.\n * @exports SvrkitApiData\n * @classdesc Represents a SvrkitApiData.\n * @implements ISvrkitApiData\n * @constructor\n * @param {ISvrkitApiData=} [properties] Properties to set\n */\n function SvrkitApiData(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * SvrkitApiData apiName.\n * @member {string} apiName\n * @memberof SvrkitApiData\n * @instance\n */\n SvrkitApiData.prototype.apiName = \"\";\n\n /**\n * SvrkitApiData reqData.\n * @member {Uint8Array} reqData\n * @memberof SvrkitApiData\n * @instance\n */\n SvrkitApiData.prototype.reqData = $util.newBuffer([]);\n\n /**\n * Creates a new SvrkitApiData instance using the specified properties.\n * @function create\n * @memberof SvrkitApiData\n * @static\n * @param {ISvrkitApiData=} [properties] Properties to set\n * @returns {SvrkitApiData} SvrkitApiData instance\n */\n SvrkitApiData.create = function create(properties) {\n return new SvrkitApiData(properties);\n };\n\n /**\n * Encodes the specified SvrkitApiData message. Does not implicitly {@link SvrkitApiData.verify|verify} messages.\n * @function encode\n * @memberof SvrkitApiData\n * @static\n * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SvrkitApiData.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.apiName != null && message.hasOwnProperty(\"apiName\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiName);\n if (message.reqData != null && message.hasOwnProperty(\"reqData\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.reqData);\n return writer;\n };\n\n /**\n * Encodes the specified SvrkitApiData message, length delimited. Does not implicitly {@link SvrkitApiData.verify|verify} messages.\n * @function encodeDelimited\n * @memberof SvrkitApiData\n * @static\n * @param {ISvrkitApiData} message SvrkitApiData message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SvrkitApiData.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a SvrkitApiData message from the specified reader or buffer.\n * @function decode\n * @memberof SvrkitApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {SvrkitApiData} SvrkitApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SvrkitApiData.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SvrkitApiData();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.apiName = reader.string();\n break;\n case 2:\n message.reqData = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a SvrkitApiData message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof SvrkitApiData\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {SvrkitApiData} SvrkitApiData\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SvrkitApiData.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a SvrkitApiData message.\n * @function verify\n * @memberof SvrkitApiData\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n SvrkitApiData.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.apiName != null && message.hasOwnProperty(\"apiName\"))\n if (!$util.isString(message.apiName))\n return \"apiName: string expected\";\n if (message.reqData != null && message.hasOwnProperty(\"reqData\"))\n if (!(message.reqData && typeof message.reqData.length === \"number\" || $util.isString(message.reqData)))\n return \"reqData: buffer expected\";\n return null;\n };\n\n /**\n * Creates a SvrkitApiData message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof SvrkitApiData\n * @static\n * @param {Object.} object Plain object\n * @returns {SvrkitApiData} SvrkitApiData\n */\n SvrkitApiData.fromObject = function fromObject(object) {\n if (object instanceof $root.SvrkitApiData)\n return object;\n var message = new $root.SvrkitApiData();\n if (object.apiName != null)\n message.apiName = String(object.apiName);\n if (object.reqData != null)\n if (typeof object.reqData === \"string\")\n $util.base64.decode(object.reqData, message.reqData = $util.newBuffer($util.base64.length(object.reqData)), 0);\n else if (object.reqData.length)\n message.reqData = object.reqData;\n return message;\n };\n\n /**\n * Creates a plain object from a SvrkitApiData message. Also converts values to other types if specified.\n * @function toObject\n * @memberof SvrkitApiData\n * @static\n * @param {SvrkitApiData} message SvrkitApiData\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n SvrkitApiData.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.apiName = \"\";\n if (options.bytes === String)\n object.reqData = \"\";\n else {\n object.reqData = [];\n if (options.bytes !== Array)\n object.reqData = $util.newBuffer(object.reqData);\n }\n }\n if (message.apiName != null && message.hasOwnProperty(\"apiName\"))\n object.apiName = message.apiName;\n if (message.reqData != null && message.hasOwnProperty(\"reqData\"))\n object.reqData = options.bytes === String ? $util.base64.encode(message.reqData, 0, message.reqData.length) : options.bytes === Array ? Array.prototype.slice.call(message.reqData) : message.reqData;\n return object;\n };\n\n /**\n * Converts this SvrkitApiData to JSON.\n * @function toJSON\n * @memberof SvrkitApiData\n * @instance\n * @returns {Object.} JSON object\n */\n SvrkitApiData.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return SvrkitApiData;\n})();\n\n/**\n * HTTP_METHODS enum.\n * @exports HTTP_METHODS\n * @enum {string}\n * @property {number} HTTP_GET=1 HTTP_GET value\n * @property {number} HTTP_POST=2 HTTP_POST value\n * @property {number} HTTP_PUT=3 HTTP_PUT value\n * @property {number} HTTP_DELETE=4 HTTP_DELETE value\n * @property {number} HTTP_HEAD=5 HTTP_HEAD value\n * @property {number} HTTP_PATCH=6 HTTP_PATCH value\n */\n$root.HTTP_METHODS = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[1] = \"HTTP_GET\"] = 1;\n values[valuesById[2] = \"HTTP_POST\"] = 2;\n values[valuesById[3] = \"HTTP_PUT\"] = 3;\n values[valuesById[4] = \"HTTP_DELETE\"] = 4;\n values[valuesById[5] = \"HTTP_HEAD\"] = 5;\n values[valuesById[6] = \"HTTP_PATCH\"] = 6;\n return values;\n})();\n\n$root.HttpHeader = (function() {\n\n /**\n * Properties of a HttpHeader.\n * @exports IHttpHeader\n * @interface IHttpHeader\n * @property {string|null} [key] HttpHeader key\n * @property {string|null} [value] HttpHeader value\n */\n\n /**\n * Constructs a new HttpHeader.\n * @exports HttpHeader\n * @classdesc Represents a HttpHeader.\n * @implements IHttpHeader\n * @constructor\n * @param {IHttpHeader=} [properties] Properties to set\n */\n function HttpHeader(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * HttpHeader key.\n * @member {string} key\n * @memberof HttpHeader\n * @instance\n */\n HttpHeader.prototype.key = \"\";\n\n /**\n * HttpHeader value.\n * @member {string} value\n * @memberof HttpHeader\n * @instance\n */\n HttpHeader.prototype.value = \"\";\n\n /**\n * Creates a new HttpHeader instance using the specified properties.\n * @function create\n * @memberof HttpHeader\n * @static\n * @param {IHttpHeader=} [properties] Properties to set\n * @returns {HttpHeader} HttpHeader instance\n */\n HttpHeader.create = function create(properties) {\n return new HttpHeader(properties);\n };\n\n /**\n * Encodes the specified HttpHeader message. Does not implicitly {@link HttpHeader.verify|verify} messages.\n * @function encode\n * @memberof HttpHeader\n * @static\n * @param {IHttpHeader} message HttpHeader message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HttpHeader.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.key != null && message.hasOwnProperty(\"key\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);\n if (message.value != null && message.hasOwnProperty(\"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);\n return writer;\n };\n\n /**\n * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link HttpHeader.verify|verify} messages.\n * @function encodeDelimited\n * @memberof HttpHeader\n * @static\n * @param {IHttpHeader} message HttpHeader message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HttpHeader.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a HttpHeader message from the specified reader or buffer.\n * @function decode\n * @memberof HttpHeader\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {HttpHeader} HttpHeader\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HttpHeader.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.HttpHeader();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.key = reader.string();\n break;\n case 2:\n message.value = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a HttpHeader message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof HttpHeader\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {HttpHeader} HttpHeader\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HttpHeader.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a HttpHeader message.\n * @function verify\n * @memberof HttpHeader\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n HttpHeader.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.key != null && message.hasOwnProperty(\"key\"))\n if (!$util.isString(message.key))\n return \"key: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!$util.isString(message.value))\n return \"value: string expected\";\n return null;\n };\n\n /**\n * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof HttpHeader\n * @static\n * @param {Object.} object Plain object\n * @returns {HttpHeader} HttpHeader\n */\n HttpHeader.fromObject = function fromObject(object) {\n if (object instanceof $root.HttpHeader)\n return object;\n var message = new $root.HttpHeader();\n if (object.key != null)\n message.key = String(object.key);\n if (object.value != null)\n message.value = String(object.value);\n return message;\n };\n\n /**\n * Creates a plain object from a HttpHeader message. Also converts values to other types if specified.\n * @function toObject\n * @memberof HttpHeader\n * @static\n * @param {HttpHeader} message HttpHeader\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n HttpHeader.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.key = \"\";\n object.value = \"\";\n }\n if (message.key != null && message.hasOwnProperty(\"key\"))\n object.key = message.key;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = message.value;\n return object;\n };\n\n /**\n * Converts this HttpHeader to JSON.\n * @function toJSON\n * @memberof HttpHeader\n * @instance\n * @returns {Object.} JSON object\n */\n HttpHeader.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return HttpHeader;\n})();\n\n$root.ApiGetOpenDataByCloudIdReq = (function() {\n\n /**\n * Properties of an ApiGetOpenDataByCloudIdReq.\n * @exports IApiGetOpenDataByCloudIdReq\n * @interface IApiGetOpenDataByCloudIdReq\n * @property {Array.|null} [cloudidList] ApiGetOpenDataByCloudIdReq cloudidList\n */\n\n /**\n * Constructs a new ApiGetOpenDataByCloudIdReq.\n * @exports ApiGetOpenDataByCloudIdReq\n * @classdesc Represents an ApiGetOpenDataByCloudIdReq.\n * @implements IApiGetOpenDataByCloudIdReq\n * @constructor\n * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set\n */\n function ApiGetOpenDataByCloudIdReq(properties) {\n this.cloudidList = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiGetOpenDataByCloudIdReq cloudidList.\n * @member {Array.} cloudidList\n * @memberof ApiGetOpenDataByCloudIdReq\n * @instance\n */\n ApiGetOpenDataByCloudIdReq.prototype.cloudidList = $util.emptyArray;\n\n /**\n * Creates a new ApiGetOpenDataByCloudIdReq instance using the specified properties.\n * @function create\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {IApiGetOpenDataByCloudIdReq=} [properties] Properties to set\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq instance\n */\n ApiGetOpenDataByCloudIdReq.create = function create(properties) {\n return new ApiGetOpenDataByCloudIdReq(properties);\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdReq message. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages.\n * @function encode\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdReq.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.cloudidList != null && message.cloudidList.length)\n for (var i = 0; i < message.cloudidList.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.cloudidList[i]);\n return writer;\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdReq message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdReq.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {IApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdReq.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer.\n * @function decode\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdReq.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdReq();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2:\n if (!(message.cloudidList && message.cloudidList.length))\n message.cloudidList = [];\n message.cloudidList.push(reader.string());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdReq message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdReq.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiGetOpenDataByCloudIdReq message.\n * @function verify\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiGetOpenDataByCloudIdReq.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.cloudidList != null && message.hasOwnProperty(\"cloudidList\")) {\n if (!Array.isArray(message.cloudidList))\n return \"cloudidList: array expected\";\n for (var i = 0; i < message.cloudidList.length; ++i)\n if (!$util.isString(message.cloudidList[i]))\n return \"cloudidList: string[] expected\";\n }\n return null;\n };\n\n /**\n * Creates an ApiGetOpenDataByCloudIdReq message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiGetOpenDataByCloudIdReq} ApiGetOpenDataByCloudIdReq\n */\n ApiGetOpenDataByCloudIdReq.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiGetOpenDataByCloudIdReq)\n return object;\n var message = new $root.ApiGetOpenDataByCloudIdReq();\n if (object.cloudidList) {\n if (!Array.isArray(object.cloudidList))\n throw TypeError(\".ApiGetOpenDataByCloudIdReq.cloudidList: array expected\");\n message.cloudidList = [];\n for (var i = 0; i < object.cloudidList.length; ++i)\n message.cloudidList[i] = String(object.cloudidList[i]);\n }\n return message;\n };\n\n /**\n * Creates a plain object from an ApiGetOpenDataByCloudIdReq message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiGetOpenDataByCloudIdReq\n * @static\n * @param {ApiGetOpenDataByCloudIdReq} message ApiGetOpenDataByCloudIdReq\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiGetOpenDataByCloudIdReq.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.cloudidList = [];\n if (message.cloudidList && message.cloudidList.length) {\n object.cloudidList = [];\n for (var j = 0; j < message.cloudidList.length; ++j)\n object.cloudidList[j] = message.cloudidList[j];\n }\n return object;\n };\n\n /**\n * Converts this ApiGetOpenDataByCloudIdReq to JSON.\n * @function toJSON\n * @memberof ApiGetOpenDataByCloudIdReq\n * @instance\n * @returns {Object.} JSON object\n */\n ApiGetOpenDataByCloudIdReq.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ApiGetOpenDataByCloudIdReq;\n})();\n\n$root.ApiGetOpenDataByCloudIdResp = (function() {\n\n /**\n * Properties of an ApiGetOpenDataByCloudIdResp.\n * @exports IApiGetOpenDataByCloudIdResp\n * @interface IApiGetOpenDataByCloudIdResp\n * @property {Array.|null} [dataList] ApiGetOpenDataByCloudIdResp dataList\n */\n\n /**\n * Constructs a new ApiGetOpenDataByCloudIdResp.\n * @exports ApiGetOpenDataByCloudIdResp\n * @classdesc Represents an ApiGetOpenDataByCloudIdResp.\n * @implements IApiGetOpenDataByCloudIdResp\n * @constructor\n * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set\n */\n function ApiGetOpenDataByCloudIdResp(properties) {\n this.dataList = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiGetOpenDataByCloudIdResp dataList.\n * @member {Array.} dataList\n * @memberof ApiGetOpenDataByCloudIdResp\n * @instance\n */\n ApiGetOpenDataByCloudIdResp.prototype.dataList = $util.emptyArray;\n\n /**\n * Creates a new ApiGetOpenDataByCloudIdResp instance using the specified properties.\n * @function create\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {IApiGetOpenDataByCloudIdResp=} [properties] Properties to set\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp instance\n */\n ApiGetOpenDataByCloudIdResp.create = function create(properties) {\n return new ApiGetOpenDataByCloudIdResp(properties);\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdResp message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages.\n * @function encode\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdResp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.dataList != null && message.dataList.length)\n for (var i = 0; i < message.dataList.length; ++i)\n $root.ApiGetOpenDataByCloudIdResp.OpDataItem.encode(message.dataList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified ApiGetOpenDataByCloudIdResp message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {IApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiGetOpenDataByCloudIdResp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer.\n * @function decode\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdResp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (!(message.dataList && message.dataList.length))\n message.dataList = [];\n message.dataList.push($root.ApiGetOpenDataByCloudIdResp.OpDataItem.decode(reader, reader.uint32()));\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiGetOpenDataByCloudIdResp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiGetOpenDataByCloudIdResp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiGetOpenDataByCloudIdResp message.\n * @function verify\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiGetOpenDataByCloudIdResp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.dataList != null && message.hasOwnProperty(\"dataList\")) {\n if (!Array.isArray(message.dataList))\n return \"dataList: array expected\";\n for (var i = 0; i < message.dataList.length; ++i) {\n var error = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.verify(message.dataList[i]);\n if (error)\n return \"dataList.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates an ApiGetOpenDataByCloudIdResp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiGetOpenDataByCloudIdResp} ApiGetOpenDataByCloudIdResp\n */\n ApiGetOpenDataByCloudIdResp.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiGetOpenDataByCloudIdResp)\n return object;\n var message = new $root.ApiGetOpenDataByCloudIdResp();\n if (object.dataList) {\n if (!Array.isArray(object.dataList))\n throw TypeError(\".ApiGetOpenDataByCloudIdResp.dataList: array expected\");\n message.dataList = [];\n for (var i = 0; i < object.dataList.length; ++i) {\n if (typeof object.dataList[i] !== \"object\")\n throw TypeError(\".ApiGetOpenDataByCloudIdResp.dataList: object expected\");\n message.dataList[i] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.fromObject(object.dataList[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from an ApiGetOpenDataByCloudIdResp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiGetOpenDataByCloudIdResp\n * @static\n * @param {ApiGetOpenDataByCloudIdResp} message ApiGetOpenDataByCloudIdResp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiGetOpenDataByCloudIdResp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.dataList = [];\n if (message.dataList && message.dataList.length) {\n object.dataList = [];\n for (var j = 0; j < message.dataList.length; ++j)\n object.dataList[j] = $root.ApiGetOpenDataByCloudIdResp.OpDataItem.toObject(message.dataList[j], options);\n }\n return object;\n };\n\n /**\n * Converts this ApiGetOpenDataByCloudIdResp to JSON.\n * @function toJSON\n * @memberof ApiGetOpenDataByCloudIdResp\n * @instance\n * @returns {Object.} JSON object\n */\n ApiGetOpenDataByCloudIdResp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n ApiGetOpenDataByCloudIdResp.OpDataItem = (function() {\n\n /**\n * Properties of an OpDataItem.\n * @memberof ApiGetOpenDataByCloudIdResp\n * @interface IOpDataItem\n * @property {string|null} [cloudId] OpDataItem cloudId\n * @property {string|null} [json] OpDataItem json\n */\n\n /**\n * Constructs a new OpDataItem.\n * @memberof ApiGetOpenDataByCloudIdResp\n * @classdesc Represents an OpDataItem.\n * @implements IOpDataItem\n * @constructor\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set\n */\n function OpDataItem(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * OpDataItem cloudId.\n * @member {string} cloudId\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @instance\n */\n OpDataItem.prototype.cloudId = \"\";\n\n /**\n * OpDataItem json.\n * @member {string} json\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @instance\n */\n OpDataItem.prototype.json = \"\";\n\n /**\n * Creates a new OpDataItem instance using the specified properties.\n * @function create\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem=} [properties] Properties to set\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem instance\n */\n OpDataItem.create = function create(properties) {\n return new OpDataItem(properties);\n };\n\n /**\n * Encodes the specified OpDataItem message. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages.\n * @function encode\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpDataItem.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.cloudId != null && message.hasOwnProperty(\"cloudId\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudId);\n if (message.json != null && message.hasOwnProperty(\"json\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.json);\n return writer;\n };\n\n /**\n * Encodes the specified OpDataItem message, length delimited. Does not implicitly {@link ApiGetOpenDataByCloudIdResp.OpDataItem.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.IOpDataItem} message OpDataItem message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OpDataItem.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an OpDataItem message from the specified reader or buffer.\n * @function decode\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpDataItem.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.cloudId = reader.string();\n break;\n case 2:\n message.json = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an OpDataItem message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OpDataItem.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an OpDataItem message.\n * @function verify\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OpDataItem.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.cloudId != null && message.hasOwnProperty(\"cloudId\"))\n if (!$util.isString(message.cloudId))\n return \"cloudId: string expected\";\n if (message.json != null && message.hasOwnProperty(\"json\"))\n if (!$util.isString(message.json))\n return \"json: string expected\";\n return null;\n };\n\n /**\n * Creates an OpDataItem message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiGetOpenDataByCloudIdResp.OpDataItem} OpDataItem\n */\n OpDataItem.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiGetOpenDataByCloudIdResp.OpDataItem)\n return object;\n var message = new $root.ApiGetOpenDataByCloudIdResp.OpDataItem();\n if (object.cloudId != null)\n message.cloudId = String(object.cloudId);\n if (object.json != null)\n message.json = String(object.json);\n return message;\n };\n\n /**\n * Creates a plain object from an OpDataItem message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @static\n * @param {ApiGetOpenDataByCloudIdResp.OpDataItem} message OpDataItem\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OpDataItem.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.cloudId = \"\";\n object.json = \"\";\n }\n if (message.cloudId != null && message.hasOwnProperty(\"cloudId\"))\n object.cloudId = message.cloudId;\n if (message.json != null && message.hasOwnProperty(\"json\"))\n object.json = message.json;\n return object;\n };\n\n /**\n * Converts this OpDataItem to JSON.\n * @function toJSON\n * @memberof ApiGetOpenDataByCloudIdResp.OpDataItem\n * @instance\n * @returns {Object.} JSON object\n */\n OpDataItem.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return OpDataItem;\n })();\n\n return ApiGetOpenDataByCloudIdResp;\n})();\n\n$root.ApiVoipSignReq = (function() {\n\n /**\n * Properties of an ApiVoipSignReq.\n * @exports IApiVoipSignReq\n * @interface IApiVoipSignReq\n * @property {string|null} [groupId] ApiVoipSignReq groupId\n * @property {number|null} [timestamp] ApiVoipSignReq timestamp\n * @property {string|null} [nonce] ApiVoipSignReq nonce\n */\n\n /**\n * Constructs a new ApiVoipSignReq.\n * @exports ApiVoipSignReq\n * @classdesc Represents an ApiVoipSignReq.\n * @implements IApiVoipSignReq\n * @constructor\n * @param {IApiVoipSignReq=} [properties] Properties to set\n */\n function ApiVoipSignReq(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiVoipSignReq groupId.\n * @member {string} groupId\n * @memberof ApiVoipSignReq\n * @instance\n */\n ApiVoipSignReq.prototype.groupId = \"\";\n\n /**\n * ApiVoipSignReq timestamp.\n * @member {number} timestamp\n * @memberof ApiVoipSignReq\n * @instance\n */\n ApiVoipSignReq.prototype.timestamp = 0;\n\n /**\n * ApiVoipSignReq nonce.\n * @member {string} nonce\n * @memberof ApiVoipSignReq\n * @instance\n */\n ApiVoipSignReq.prototype.nonce = \"\";\n\n /**\n * Creates a new ApiVoipSignReq instance using the specified properties.\n * @function create\n * @memberof ApiVoipSignReq\n * @static\n * @param {IApiVoipSignReq=} [properties] Properties to set\n * @returns {ApiVoipSignReq} ApiVoipSignReq instance\n */\n ApiVoipSignReq.create = function create(properties) {\n return new ApiVoipSignReq(properties);\n };\n\n /**\n * Encodes the specified ApiVoipSignReq message. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages.\n * @function encode\n * @memberof ApiVoipSignReq\n * @static\n * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignReq.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId);\n if (message.timestamp != null && message.hasOwnProperty(\"timestamp\"))\n writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.timestamp);\n if (message.nonce != null && message.hasOwnProperty(\"nonce\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.nonce);\n return writer;\n };\n\n /**\n * Encodes the specified ApiVoipSignReq message, length delimited. Does not implicitly {@link ApiVoipSignReq.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiVoipSignReq\n * @static\n * @param {IApiVoipSignReq} message ApiVoipSignReq message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignReq.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiVoipSignReq message from the specified reader or buffer.\n * @function decode\n * @memberof ApiVoipSignReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiVoipSignReq} ApiVoipSignReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignReq.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignReq();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 2:\n message.groupId = reader.string();\n break;\n case 3:\n message.timestamp = reader.uint32();\n break;\n case 4:\n message.nonce = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiVoipSignReq message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiVoipSignReq\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiVoipSignReq} ApiVoipSignReq\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignReq.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiVoipSignReq message.\n * @function verify\n * @memberof ApiVoipSignReq\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiVoipSignReq.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n if (!$util.isString(message.groupId))\n return \"groupId: string expected\";\n if (message.timestamp != null && message.hasOwnProperty(\"timestamp\"))\n if (!$util.isInteger(message.timestamp))\n return \"timestamp: integer expected\";\n if (message.nonce != null && message.hasOwnProperty(\"nonce\"))\n if (!$util.isString(message.nonce))\n return \"nonce: string expected\";\n return null;\n };\n\n /**\n * Creates an ApiVoipSignReq message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiVoipSignReq\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiVoipSignReq} ApiVoipSignReq\n */\n ApiVoipSignReq.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiVoipSignReq)\n return object;\n var message = new $root.ApiVoipSignReq();\n if (object.groupId != null)\n message.groupId = String(object.groupId);\n if (object.timestamp != null)\n message.timestamp = object.timestamp >>> 0;\n if (object.nonce != null)\n message.nonce = String(object.nonce);\n return message;\n };\n\n /**\n * Creates a plain object from an ApiVoipSignReq message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiVoipSignReq\n * @static\n * @param {ApiVoipSignReq} message ApiVoipSignReq\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiVoipSignReq.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.groupId = \"\";\n object.timestamp = 0;\n object.nonce = \"\";\n }\n if (message.groupId != null && message.hasOwnProperty(\"groupId\"))\n object.groupId = message.groupId;\n if (message.timestamp != null && message.hasOwnProperty(\"timestamp\"))\n object.timestamp = message.timestamp;\n if (message.nonce != null && message.hasOwnProperty(\"nonce\"))\n object.nonce = message.nonce;\n return object;\n };\n\n /**\n * Converts this ApiVoipSignReq to JSON.\n * @function toJSON\n * @memberof ApiVoipSignReq\n * @instance\n * @returns {Object.} JSON object\n */\n ApiVoipSignReq.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ApiVoipSignReq;\n})();\n\n$root.ApiVoipSignResp = (function() {\n\n /**\n * Properties of an ApiVoipSignResp.\n * @exports IApiVoipSignResp\n * @interface IApiVoipSignResp\n * @property {string|null} [signature] ApiVoipSignResp signature\n */\n\n /**\n * Constructs a new ApiVoipSignResp.\n * @exports ApiVoipSignResp\n * @classdesc Represents an ApiVoipSignResp.\n * @implements IApiVoipSignResp\n * @constructor\n * @param {IApiVoipSignResp=} [properties] Properties to set\n */\n function ApiVoipSignResp(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ApiVoipSignResp signature.\n * @member {string} signature\n * @memberof ApiVoipSignResp\n * @instance\n */\n ApiVoipSignResp.prototype.signature = \"\";\n\n /**\n * Creates a new ApiVoipSignResp instance using the specified properties.\n * @function create\n * @memberof ApiVoipSignResp\n * @static\n * @param {IApiVoipSignResp=} [properties] Properties to set\n * @returns {ApiVoipSignResp} ApiVoipSignResp instance\n */\n ApiVoipSignResp.create = function create(properties) {\n return new ApiVoipSignResp(properties);\n };\n\n /**\n * Encodes the specified ApiVoipSignResp message. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages.\n * @function encode\n * @memberof ApiVoipSignResp\n * @static\n * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignResp.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.signature != null && message.hasOwnProperty(\"signature\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature);\n return writer;\n };\n\n /**\n * Encodes the specified ApiVoipSignResp message, length delimited. Does not implicitly {@link ApiVoipSignResp.verify|verify} messages.\n * @function encodeDelimited\n * @memberof ApiVoipSignResp\n * @static\n * @param {IApiVoipSignResp} message ApiVoipSignResp message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ApiVoipSignResp.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an ApiVoipSignResp message from the specified reader or buffer.\n * @function decode\n * @memberof ApiVoipSignResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {ApiVoipSignResp} ApiVoipSignResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignResp.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ApiVoipSignResp();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n message.signature = reader.string();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an ApiVoipSignResp message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof ApiVoipSignResp\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {ApiVoipSignResp} ApiVoipSignResp\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ApiVoipSignResp.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an ApiVoipSignResp message.\n * @function verify\n * @memberof ApiVoipSignResp\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ApiVoipSignResp.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.signature != null && message.hasOwnProperty(\"signature\"))\n if (!$util.isString(message.signature))\n return \"signature: string expected\";\n return null;\n };\n\n /**\n * Creates an ApiVoipSignResp message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof ApiVoipSignResp\n * @static\n * @param {Object.} object Plain object\n * @returns {ApiVoipSignResp} ApiVoipSignResp\n */\n ApiVoipSignResp.fromObject = function fromObject(object) {\n if (object instanceof $root.ApiVoipSignResp)\n return object;\n var message = new $root.ApiVoipSignResp();\n if (object.signature != null)\n message.signature = String(object.signature);\n return message;\n };\n\n /**\n * Creates a plain object from an ApiVoipSignResp message. Also converts values to other types if specified.\n * @function toObject\n * @memberof ApiVoipSignResp\n * @static\n * @param {ApiVoipSignResp} message ApiVoipSignResp\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ApiVoipSignResp.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.signature = \"\";\n if (message.signature != null && message.hasOwnProperty(\"signature\"))\n object.signature = message.signature;\n return object;\n };\n\n /**\n * Converts this ApiVoipSignResp to JSON.\n * @function toJSON\n * @memberof ApiVoipSignResp\n * @instance\n * @returns {Object.} JSON object\n */\n ApiVoipSignResp.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ApiVoipSignResp;\n})();\n\nmodule.exports = $root;\n\n\n/***/ }),\n\n/***/ \"./src/utils/assert.ts\":\n/*!*****************************!*\\\n !*** ./src/utils/assert.ts ***!\n \\*****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst type_1 = __webpack_require__(/*! ./type */ \"./src/utils/type.ts\");\nconst error_1 = __webpack_require__(/*! ./error */ \"./src/utils/error.ts\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nfunction sameType(input, ref, name) {\n function sameTypeImpl(input, ref, name) {\n const inputType = type_1.getType(input);\n const refType = type_1.getType(ref);\n if (inputType !== refType) {\n return `${name} should be ${refType} instead of ${inputType}; `;\n }\n let errors = '';\n switch (inputType) {\n case 'object': {\n for (const key in ref) {\n errors += sameTypeImpl(input[key], ref[key], `${name}.${key}`);\n }\n break;\n }\n case 'array': {\n for (let i = 0; i < ref.length; i++) {\n errors += sameTypeImpl(input[i], ref[i], `${name}[${i}]`);\n }\n break;\n }\n default: {\n break;\n }\n }\n return errors;\n }\n const error = sameTypeImpl(input, ref, name);\n return {\n passed: !error,\n reason: error,\n };\n}\nexports.sameType = sameType;\nfunction validType(input, ref, name = 'parameter') {\n function validTypeImpl(input, ref, name) {\n const inputType = type_1.getType(input);\n const refType = type_1.getType(ref);\n if (refType === 'string') {\n if (inputType !== ref) {\n return `${name} should be ${ref} instead of ${inputType};`;\n }\n return '';\n }\n else {\n if (inputType !== refType) {\n return `${name} should be ${refType} instead of ${inputType}; `;\n }\n let errors = '';\n switch (inputType) {\n case 'object': {\n for (const key in ref) {\n errors += validTypeImpl(input[key], ref[key], `${name}.${key}`);\n }\n break;\n }\n case 'array': {\n for (let i = 0; i < ref.length; i++) {\n errors += validTypeImpl(input[i], ref[i], `${name}[${i}]`);\n }\n break;\n }\n default: {\n break;\n }\n }\n return errors;\n }\n }\n const error = validTypeImpl(input, ref, name);\n return {\n passed: !error,\n reason: error,\n };\n}\nexports.validType = validType;\nfunction validObjectOptionalType(input, ref, name = 'parameter') {\n function validImpl(input, ref, name) {\n const inputType = type_1.getType(input);\n const refType = type_1.getType(ref);\n if (refType !== 'object')\n return '';\n if (inputType === 'object') {\n for (const key in input) {\n const val = input[key];\n if (val === undefined || key === null) {\n continue;\n }\n const assertResult = validType(val, ref[key], `${name}.${key}`);\n return assertResult.passed ? '' : assertResult.reason;\n }\n }\n else {\n return `${name} should be object instead of ${inputType}`;\n }\n return '';\n }\n const error = validImpl(input, ref, name);\n return {\n passed: !error,\n reason: error,\n };\n}\nexports.validObjectOptionalType = validObjectOptionalType;\nfunction assertType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) {\n // check param validity\n let paramCheckResult = validType(param, ref, name);\n if (!paramCheckResult.passed) {\n throw new ErrorClass({\n errMsg: paramCheckResult.reason,\n });\n }\n}\nexports.assertType = assertType;\nfunction assertObjectOptionalType(param, ref, name = 'parameter', ErrorClass = error_1.CloudSDKError) {\n // check param validity\n let paramCheckResult = validObjectOptionalType(param, ref, name);\n if (!paramCheckResult.passed) {\n throw new ErrorClass({\n errMsg: paramCheckResult.reason,\n });\n }\n}\nexports.assertObjectOptionalType = assertObjectOptionalType;\nfunction assertRequiredParam(param, name, funcName, ErrorClass = error_1.CloudSDKError) {\n if (param === undefined || param === null) {\n throw new ErrorClass({\n errMsg: `parameter ${name} of function ${funcName} must be provided`,\n });\n }\n}\nexports.assertRequiredParam = assertRequiredParam;\nfunction assertObjectNotEmpty({ target, name, ErrorClass = error_1.CloudSDKError }) {\n if (Object.keys(target).length === 0) {\n throw new ErrorClass({\n errCode: error_config_1.ERR_CODE.SDK_API_PARAMETER_ERROR,\n errMsg: `${name} must not be empty`\n });\n }\n}\nexports.assertObjectNotEmpty = assertObjectNotEmpty;\n/*\nexport function constructTypeRef(typeDef: any): any {\n\n const type = getType(typeDef)\n\n switch(type) {\n case 'string': {\n return ''\n }\n case 'number': {\n\n }\n }\n\n}\n*/ \n\n\n/***/ }),\n\n/***/ \"./src/utils/error.ts\":\n/*!****************************!*\\\n !*** ./src/utils/error.ts ***!\n \\****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst type_1 = __webpack_require__(/*! ./type */ \"./src/utils/type.ts\");\nconst msg_1 = __webpack_require__(/*! ./msg */ \"./src/utils/msg.ts\");\nconst error_config_1 = __webpack_require__(/*! config/error.config */ \"./src/config/error.config.ts\");\nclass CloudSDKError extends Error {\n constructor(options) {\n super(options.errMsg);\n this.errCode = -1;\n Object.defineProperties(this, {\n message: {\n get() {\n return `errCode: ${this.errCode} ${error_config_1.ERR_CODE[this.errCode] || ''} | errMsg: ` + this.errMsg;\n },\n set(msg) {\n this.errMsg = msg;\n }\n }\n });\n this.errCode = options.errCode || -1;\n this.errMsg = options.errMsg;\n }\n get message() {\n return `errCode: ${this.errCode} | errMsg: ` + this.errMsg;\n }\n set message(msg) {\n this.errMsg = msg;\n }\n}\nexports.CloudSDKError = CloudSDKError;\nfunction createError({ errCode = 1, errMsg = '', errClass = CloudSDKError, } = {}) {\n return new errClass({\n errCode,\n errMsg,\n });\n}\nexports.createError = createError;\nfunction isSDKError(error) {\n return error && (error instanceof Error) && type_1.isString(error.errMsg);\n}\nexports.isSDKError = isSDKError;\nfunction returnAsCloudSDKError(err, appendMsg = '') {\n if (err) {\n if (isSDKError(err)) {\n if (appendMsg) {\n err.errMsg += '; ' + appendMsg;\n }\n return err;\n }\n const errCode = err ? err.errCode : undefined;\n const errMsg = (err && err.errMsg || err.toString() || 'unknown error') + '; ' + appendMsg;\n return new CloudSDKError({\n errCode,\n errMsg,\n });\n }\n return new CloudSDKError({\n errMsg: appendMsg\n });\n}\nexports.returnAsCloudSDKError = returnAsCloudSDKError;\nfunction returnAsFinalCloudSDKError(err, apiName) {\n if (err && isSDKError(err)) {\n return err;\n }\n const e = returnAsCloudSDKError(err, `at ${apiName} api; `);\n e.errMsg = msg_1.apiFailMsg(apiName, e.errMsg);\n return e;\n}\nexports.returnAsFinalCloudSDKError = returnAsFinalCloudSDKError;\n\n\n/***/ }),\n\n/***/ \"./src/utils/mimetype.ts\":\n/*!*******************************!*\\\n !*** ./src/utils/mimetype.ts ***!\n \\*******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst mimeDB = __webpack_require__(/*! mime-db */ \"mime-db\");\nexports.mimeTypeToFileExtension = (mimeType, defaultExtension) => {\n const mime = mimeDB[mimeType];\n if (mime && mime.extensions && mime.extensions.length) {\n return mime.extensions[0];\n }\n else {\n return defaultExtension;\n }\n};\n\n\n/***/ }),\n\n/***/ \"./src/utils/msg.ts\":\n/*!**************************!*\\\n !*** ./src/utils/msg.ts ***!\n \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction apiSuccessMsg(apiName) {\n return `${apiName}:ok`;\n}\nexports.apiSuccessMsg = apiSuccessMsg;\nfunction apiCancelMsg(apiName, msg) {\n return `${apiName}:cancel ${msg}`;\n}\nexports.apiCancelMsg = apiCancelMsg;\nfunction apiFailMsg(apiName, msg) {\n return `${apiName}:fail ${msg}`;\n}\nexports.apiFailMsg = apiFailMsg;\n\n\n/***/ }),\n\n/***/ \"./src/utils/symbol.ts\":\n/*!*****************************!*\\\n !*** ./src/utils/symbol.ts ***!\n \\*****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst _symbols = [];\nconst __internalMark__ = {};\nclass HiddenSymbol {\n constructor(target) {\n Object.defineProperties(this, {\n target: {\n enumerable: false,\n writable: false,\n configurable: false,\n value: target,\n },\n });\n }\n}\nclass InternalSymbol extends HiddenSymbol {\n constructor(target, __mark__) {\n if (__mark__ !== __internalMark__) {\n throw new TypeError('InternalSymbol cannot be constructed with new operator');\n }\n super(target);\n }\n static for(target) {\n for (let i = 0, len = _symbols.length; i < len; i++) {\n if (_symbols[i].target === target) {\n return _symbols[i].instance;\n }\n }\n const symbol = new InternalSymbol(target, __internalMark__);\n _symbols.push({\n target,\n instance: symbol,\n });\n return symbol;\n }\n}\nexports.InternalSymbol = InternalSymbol;\nexports.default = InternalSymbol;\n\n\n/***/ }),\n\n/***/ \"./src/utils/type.ts\":\n/*!***************************!*\\\n !*** ./src/utils/type.ts ***!\n \\***************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst symbol_1 = __webpack_require__(/*! ./symbol */ \"./src/utils/symbol.ts\");\nexports.getType = (x) => Object.prototype.toString.call(x).slice(8, -1).toLowerCase();\nexports.isObject = (x) => exports.getType(x) === 'object';\nexports.isString = (x) => exports.getType(x) === 'string';\nexports.isNumber = (x) => exports.getType(x) === 'number';\nexports.isPromise = (x) => exports.getType(x) === 'promise';\nexports.isFunction = (x) => typeof x === 'function';\nexports.isArray = (x) => Array.isArray(x);\nexports.isDate = (x) => exports.getType(x) === 'date';\nexports.isBuffer = (x) => Buffer.isBuffer(x);\nexports.isInternalObject = (x) => x && (x._internalType instanceof symbol_1.InternalSymbol);\nexports.isPlainObject = (obj) => {\n if (typeof obj !== 'object' || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto;\n};\n\n\n/***/ }),\n\n/***/ \"./src/utils/utils.ts\":\n/*!****************************!*\\\n !*** ./src/utils/utils.ts ***!\n \\****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst type_1 = __webpack_require__(/*! ./type */ \"./src/utils/type.ts\");\nconst symbol_config_1 = __webpack_require__(/*! config/symbol.config */ \"./src/config/symbol.config.ts\");\nexports.convertCase = (input, options) => {\n const { from, to, recursive } = options;\n if (type_1.isString(input)) {\n if (from === 'camelcase' && to === 'snakecase') {\n return input.replace(/[A-Z]/g, (match, ind) => `${ind ? '_' : ''}${match.toLowerCase()}`);\n }\n else if (from === 'snakecase' && to === 'camelcase') {\n return input.replace(/_[a-z]/g, (match, ind) => `${match[1].toUpperCase()}`);\n }\n }\n else if (type_1.isObject(input)) {\n return convertObject(input);\n }\n else if (type_1.isArray(input)) {\n const array = [];\n for (const item of input) {\n if (type_1.isObject(item)) {\n array.push(convertObject(item));\n }\n else if (type_1.isArray(item)) {\n if (options.recursive) {\n array.push(exports.convertCase(item, options));\n }\n else {\n array.push(item);\n }\n }\n else {\n array.push(item);\n }\n }\n return array;\n }\n else\n return input;\n function convertObject(input) {\n const data = Object.assign({}, input);\n for (const key in data) {\n const val = recursive && (type_1.isObject(data[key]) || type_1.isArray(data[key])) ? exports.convertCase(data[key], options) : data[key];\n const convertedKey = exports.convertCase(key, options);\n data[convertedKey] = val;\n if (convertedKey !== key) {\n delete data[key];\n }\n }\n return data;\n }\n};\nexports.isSCFEnvReady = () => Boolean(process.env.TCB_ENV);\nexports.translateEnv = (env) => {\n if (!env) {\n return undefined;\n }\n if (env === symbol_config_1.SYMBOL_DYNAMIC_CURRENT_ENV) {\n env = process.env.TCB_ENV || process.env.SCF_NAMESPACE;\n }\n // in scf local debug, we should not use 'local' as env in api invocation\n if (env === 'local' && process.env.TENCENTCLOUD_RUNENV === 'WX_LOCAL_SCF') {\n return undefined;\n }\n return env;\n};\nexports.getEnvFromCloudConfig = (config, serviceName = 'default') => {\n const env = config.env[serviceName] || config.env.default;\n return exports.translateEnv(env);\n};\nexports.getEnvFromAPIConfig = (apiConfig, cloudConfig, serviceName = 'default') => {\n if (apiConfig && apiConfig.env) {\n return exports.translateEnv(apiConfig.env);\n }\n return exports.getEnvFromCloudConfig(cloudConfig, serviceName);\n};\nexports.getServiceConfigFromDefaultConfig = (defaultConfig, serviceName = 'default') => {\n return Object.assign(Object.assign({}, defaultConfig), { env: exports.getEnvFromCloudConfig(defaultConfig, serviceName) });\n};\nexports.getMergedAPIConfig = (defaultConfig, newConfig, serviceName = 'default') => {\n const merged = Object.assign(Object.assign({}, defaultConfig), newConfig);\n if (newConfig && newConfig.env) {\n merged.env = exports.translateEnv(newConfig.env);\n }\n else {\n merged.env = exports.getEnvFromCloudConfig(defaultConfig, serviceName);\n }\n return merged;\n};\n\n\n/***/ }),\n\n/***/ \"mime-db\":\n/*!**************************!*\\\n !*** external \"mime-db\" ***!\n \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"mime-db\");\n\n/***/ }),\n\n/***/ \"protobufjs/minimal\":\n/*!*************************************!*\\\n !*** external \"protobufjs/minimal\" ***!\n \\*************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"protobufjs/minimal\");\n\n/***/ }),\n\n/***/ \"tcb-admin-node\":\n/*!*********************************!*\\\n !*** external \"tcb-admin-node\" ***!\n \\*********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"tcb-admin-node\");\n\n/***/ }),\n\n/***/ \"tcb-admin-node/src/utils/httpRequest\":\n/*!*******************************************************!*\\\n !*** external \"tcb-admin-node/src/utils/httpRequest\" ***!\n \\*******************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"tcb-admin-node/src/utils/httpRequest\");\n\n/***/ })\n\n/******/ });","module.exports = {\n \"_from\": \"wx-server-sdk@latest\",\n \"_id\": \"wx-server-sdk@1.8.3\",\n \"_inBundle\": false,\n \"_integrity\": \"sha1-VE9wCQJ0RCKFzQBdf0i7tt+wAow=\",\n \"_location\": \"/wx-server-sdk\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"type\": \"tag\",\n \"registry\": true,\n \"raw\": \"wx-server-sdk@latest\",\n \"name\": \"wx-server-sdk\",\n \"escapedName\": \"wx-server-sdk\",\n \"rawSpec\": \"latest\",\n \"saveSpec\": null,\n \"fetchSpec\": \"latest\"\n },\n \"_requiredBy\": [\n \"#USER\",\n \"/\"\n ],\n \"_resolved\": \"https://registry.npm.taobao.org/wx-server-sdk/download/wx-server-sdk-1.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwx-server-sdk%2Fdownload%2Fwx-server-sdk-1.8.3.tgz\",\n \"_shasum\": \"544f70090274442285cd005d7f48bbb6dfb0028c\",\n \"_spec\": \"wx-server-sdk@latest\",\n \"_where\": \"/Users/romchung/Wechat-Miniprogram/miniprogram-demo/cloudfunctions/wxContext\",\n \"author\": {\n \"name\": \"wechat mini program team\"\n },\n \"bundleDependencies\": false,\n \"dependencies\": {\n \"protobufjs\": \"6.8.8\",\n \"tcb-admin-node\": \"1.22.0\",\n \"tslib\": \"^1.9.3\"\n },\n \"deprecated\": false,\n \"description\": \"mini program cloud server sdk\",\n \"homepage\": \"https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html\",\n \"license\": \"MIT\",\n \"main\": \"index.js\",\n \"name\": \"wx-server-sdk\",\n \"types\": \"index.d.ts\",\n \"version\": \"1.8.3\"\n}\n"]} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/index.js b/miniprogram/miniprogram_npm/wxml-to-canvas/index.js new file mode 100644 index 00000000..2a4f21e5 --- /dev/null +++ b/miniprogram/miniprogram_npm/wxml-to-canvas/index.js @@ -0,0 +1,779 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else { + var a = factory(); + for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; + } +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 1); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +const hex = (color) => { + let result = null + + if (/^#/.test(color) && (color.length === 7 || color.length === 9)) { + return color + // eslint-disable-next-line no-cond-assign + } else if ((result = /^(rgb|rgba)\((.+)\)/.exec(color)) !== null) { + return '#' + result[2].split(',').map((part, index) => { + part = part.trim() + part = index === 3 ? Math.floor(parseFloat(part) * 255) : parseInt(part, 10) + part = part.toString(16) + if (part.length === 1) { + part = '0' + part + } + return part + }).join('') + } else { + return '#00000000' + } +} + +const splitLineToCamelCase = (str) => str.split('-').map((part, index) => { + if (index === 0) { + return part + } + return part[0].toUpperCase() + part.slice(1) +}).join('') + +const compareVersion = (v1, v2) => { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10) + const num2 = parseInt(v2[i], 10) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + + return 0 +} + +module.exports = { + hex, + splitLineToCamelCase, + compareVersion +} + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + +const xmlParse = __webpack_require__(2) +const {Widget} = __webpack_require__(3) +const {Draw} = __webpack_require__(5) +const {compareVersion} = __webpack_require__(0) + +const canvasId = 'weui-canvas' + +Component({ + properties: { + width: { + type: Number, + value: 400 + }, + height: { + type: Number, + value: 300 + } + }, + data: { + use2dCanvas: false, // 2.9.2 后可用canvas 2d 接口 + }, + lifetimes: { + attached() { + const {SDKVersion, pixelRatio: dpr} = wx.getSystemInfoSync() + const use2dCanvas = compareVersion(SDKVersion, '2.9.2') >= 0 + this.dpr = dpr + this.setData({use2dCanvas}, () => { + if (use2dCanvas) { + const query = this.createSelectorQuery() + query.select(`#${canvasId}`) + .fields({node: true, size: true}) + .exec(res => { + const canvas = res[0].node + const ctx = canvas.getContext('2d') + canvas.width = res[0].width * dpr + canvas.height = res[0].height * dpr + ctx.scale(dpr, dpr) + this.ctx = ctx + this.canvas = canvas + }) + } else { + this.ctx = wx.createCanvasContext(canvasId, this) + } + }) + } + }, + methods: { + async renderToCanvas(args) { + const {wxml, style} = args + const ctx = this.ctx + const canvas = this.canvas + const use2dCanvas = this.data.use2dCanvas + + if (use2dCanvas && !canvas) { + return Promise.reject(new Error('renderToCanvas: fail canvas has not been created')) + } + + ctx.clearRect(0, 0, this.data.width, this.data.height) + const {root: xom} = xmlParse(wxml) + + const widget = new Widget(xom, style) + const container = widget.init() + this.boundary = { + top: container.layoutBox.top, + left: container.layoutBox.left, + width: container.computedStyle.width, + height: container.computedStyle.height, + } + const draw = new Draw(ctx, canvas, use2dCanvas) + await draw.drawNode(container) + + if (!use2dCanvas) { + await this.canvasDraw(ctx) + } + return Promise.resolve(container) + }, + + canvasDraw(ctx, reserve) { + return new Promise(resolve => { + ctx.draw(reserve, () => { + resolve() + }) + }) + }, + + canvasToTempFilePath(args = {}) { + const use2dCanvas = this.data.use2dCanvas + + return new Promise((resolve, reject) => { + const { + top, left, width, height + } = this.boundary + + const copyArgs = { + x: left, + y: top, + width, + height, + destWidth: width * this.dpr, + destHeight: height * this.dpr, + canvasId, + fileType: args.fileType || 'png', + quality: args.quality || 1, + success: resolve, + fail: reject + } + + if (use2dCanvas) { + delete copyArgs.canvasId + copyArgs.canvas = this.canvas + } + wx.canvasToTempFilePath(copyArgs, this) + }) + } + } +}) + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + + +/** + * Module dependencies. + */ + + +/** + * Expose `parse`. + */ + + +/** + * Parse the given string of `xml`. + * + * @param {String} xml + * @return {Object} + * @api public + */ + +function parse(xml) { + xml = xml.trim() + + // strip comments + xml = xml.replace(//g, '') + + return document() + + /** + * XML document. + */ + + function document() { + return { + declaration: declaration(), + root: tag() + } + } + + /** + * Declaration. + */ + + function declaration() { + const m = match(/^<\?xml\s*/) + if (!m) return + + // tag + const node = { + attributes: {} + } + + // attributes + while (!(eos() || is('?>'))) { + const attr = attribute() + if (!attr) return node + node.attributes[attr.name] = attr.value + } + + match(/\?>\s*/) + + return node + } + + /** + * Tag. + */ + + function tag() { + const m = match(/^<([\w-:.]+)\s*/) + if (!m) return + + // name + const node = { + name: m[1], + attributes: {}, + children: [] + } + + // attributes + while (!(eos() || is('>') || is('?>') || is('/>'))) { + const attr = attribute() + if (!attr) return node + node.attributes[attr.name] = attr.value + } + + // self closing tag + if (match(/^\s*\/>\s*/)) { + return node + } + + match(/\??>\s*/) + + // content + node.content = content() + + // children + let child + while (child = tag()) { + node.children.push(child) + } + + // closing + match(/^<\/[\w-:.]+>\s*/) + + return node + } + + /** + * Text content. + */ + + function content() { + const m = match(/^([^<]*)/) + if (m) return m[1] + return '' + } + + /** + * Attribute. + */ + + function attribute() { + const m = match(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/) + if (!m) return + return {name: m[1], value: strip(m[2])} + } + + /** + * Strip quotes from `val`. + */ + + function strip(val) { + return val.replace(/^['"]|['"]$/g, '') + } + + /** + * Match `re` and advance the string. + */ + + function match(re) { + const m = xml.match(re) + if (!m) return + xml = xml.slice(m[0].length) + return m + } + + /** + * End-of-source. + */ + + function eos() { + return xml.length == 0 + } + + /** + * Check for `prefix`. + */ + + function is(prefix) { + return xml.indexOf(prefix) == 0 + } +} + +module.exports = parse + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +const Block = __webpack_require__(4) +const {splitLineToCamelCase} = __webpack_require__(0) + +class Element extends Block { + constructor(prop) { + super(prop.style) + this.name = prop.name + this.attributes = prop.attributes + } +} + + +class Widget { + constructor(xom, style) { + this.xom = xom + this.style = style + + this.inheritProps = ['fontSize', 'lineHeight', 'textAlign', 'verticalAlign', 'color'] + } + + init() { + this.container = this.create(this.xom) + this.container.layout() + + this.inheritStyle(this.container) + return this.container + } + + // 继承父节点的样式 + inheritStyle(node) { + const parent = node.parent || null + const children = node.children || {} + const computedStyle = node.computedStyle + + if (parent) { + this.inheritProps.forEach(prop => { + computedStyle[prop] = computedStyle[prop] || parent.computedStyle[prop] + }) + } + + Object.values(children).forEach(child => { + this.inheritStyle(child) + }) + } + + create(node) { + let classNames = (node.attributes.class || '').split(' ') + classNames = classNames.map(item => splitLineToCamelCase(item.trim())) + const style = {} + classNames.forEach(item => { + Object.assign(style, this.style[item] || {}) + }) + + const args = {name: node.name, style} + + const attrs = Object.keys(node.attributes) + const attributes = {} + for (const attr of attrs) { + const value = node.attributes[attr] + const CamelAttr = splitLineToCamelCase(attr) + + if (value === '' || value === 'true') { + attributes[CamelAttr] = true + } else if (value === 'false') { + attributes[CamelAttr] = false + } else { + attributes[CamelAttr] = value + } + } + attributes.text = node.content + args.attributes = attributes + const element = new Element(args) + node.children.forEach(childNode => { + const childElement = this.create(childNode) + element.add(childElement) + }) + return element + } +} + +module.exports = {Widget} + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = require("widget-ui"); + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + +class Draw { + constructor(context, canvas, use2dCanvas = false) { + this.ctx = context + this.canvas = canvas || null + this.use2dCanvas = use2dCanvas + } + + roundRect(x, y, w, h, r, fill = true, stroke = false) { + if (r < 0) return + const ctx = this.ctx + + ctx.beginPath() + ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 3 / 2) + ctx.arc(x + w - r, y + r, r, Math.PI * 3 / 2, 0) + ctx.arc(x + w - r, y + h - r, r, 0, Math.PI / 2) + ctx.arc(x + r, y + h - r, r, Math.PI / 2, Math.PI) + ctx.lineTo(x, y + r) + if (stroke) ctx.stroke() + if (fill) ctx.fill() + } + + drawView(box, style) { + const ctx = this.ctx + const { + left: x, top: y, width: w, height: h + } = box + const { + borderRadius = 0, + borderWidth = 0, + borderColor, + color = '#000', + backgroundColor = 'transparent', + } = style + ctx.save() + // 外环 + if (borderWidth > 0) { + ctx.fillStyle = borderColor || color + this.roundRect(x, y, w, h, borderRadius) + } + + // 内环 + ctx.fillStyle = backgroundColor + const innerWidth = w - 2 * borderWidth + const innerHeight = h - 2 * borderWidth + const innerRadius = borderRadius - borderWidth >= 0 ? borderRadius - borderWidth : 0 + this.roundRect(x + borderWidth, y + borderWidth, innerWidth, innerHeight, innerRadius) + ctx.restore() + } + + async drawImage(img, box, style) { + await new Promise((resolve, reject) => { + const ctx = this.ctx + const canvas = this.canvas + + const { + borderRadius = 0 + } = style + const { + left: x, top: y, width: w, height: h + } = box + ctx.save() + this.roundRect(x, y, w, h, borderRadius, false, false) + ctx.clip() + + const _drawImage = (img) => { + if (this.use2dCanvas) { + const Image = canvas.createImage() + Image.onload = () => { + ctx.drawImage(Image, x, y, w, h) + ctx.restore() + resolve() + } + Image.onerror = () => { reject(new Error(`createImage fail: ${img}`)) } + Image.src = img + } else { + ctx.drawImage(img, x, y, w, h) + ctx.restore() + resolve() + } + } + + const isTempFile = /^wxfile:\/\//.test(img) + const isNetworkFile = /^https?:\/\//.test(img) + + if (isTempFile) { + _drawImage(img) + } else if (isNetworkFile) { + wx.downloadFile({ + url: img, + success(res) { + if (res.statusCode === 200) { + _drawImage(res.tempFilePath) + } else { + reject(new Error(`downloadFile:fail ${img}`)) + } + }, + fail() { + reject(new Error(`downloadFile:fail ${img}`)) + } + }) + } else { + reject(new Error(`image format error: ${img}`)) + } + }) + } + + // eslint-disable-next-line complexity + drawText(text, box, style) { + const ctx = this.ctx + let { + left: x, top: y, width: w, height: h + } = box + let { + color = '#000', + lineHeight = '1.4em', + fontSize = 14, + textAlign = 'left', + verticalAlign = 'top', + backgroundColor = 'transparent' + } = style + + if (typeof lineHeight === 'string') { // 2em + lineHeight = Math.ceil(parseFloat(lineHeight.replace('em')) * fontSize) + } + if (!text || (lineHeight > h)) return + + ctx.save() + ctx.textBaseline = 'top' + ctx.font = `${fontSize}px sans-serif` + ctx.textAlign = textAlign + + // 背景色 + ctx.fillStyle = backgroundColor + this.roundRect(x, y, w, h, 0) + + // 文字颜色 + ctx.fillStyle = color + + // 水平布局 + switch (textAlign) { + case 'left': + break + case 'center': + x += 0.5 * w + break + case 'right': + x += w + break + default: break + } + + const textWidth = ctx.measureText(text).width + const actualHeight = Math.ceil(textWidth / w) * lineHeight + let paddingTop = Math.ceil((h - actualHeight) / 2) + if (paddingTop < 0) paddingTop = 0 + + // 垂直布局 + switch (verticalAlign) { + case 'top': + break + case 'middle': + y += paddingTop + break + case 'bottom': + y += 2 * paddingTop + break + default: break + } + + const inlinePaddingTop = Math.ceil((lineHeight - fontSize) / 2) + + // 不超过一行 + if (textWidth <= w) { + ctx.fillText(text, x, y + inlinePaddingTop) + return + } + + // 多行文本 + const chars = text.split('') + const _y = y + + // 逐行绘制 + let line = '' + for (const ch of chars) { + const testLine = line + ch + const testWidth = ctx.measureText(testLine).width + + if (testWidth > w) { + ctx.fillText(line, x, y + inlinePaddingTop) + y += lineHeight + line = ch + if ((y + lineHeight) > (_y + h)) break + } else { + line = testLine + } + } + + // 避免溢出 + if ((y + lineHeight) <= (_y + h)) { + ctx.fillText(line, x, y + inlinePaddingTop) + } + ctx.restore() + } + + async drawNode(element) { + const {layoutBox, computedStyle, name} = element + const {src, text} = element.attributes + if (name === 'view') { + this.drawView(layoutBox, computedStyle) + } else if (name === 'image') { + await this.drawImage(src, layoutBox, computedStyle) + } else if (name === 'text') { + this.drawText(text, layoutBox, computedStyle) + } + const childs = Object.values(element.children) + for (const child of childs) { + await this.drawNode(child) + } + } +} + + +module.exports = { + Draw +} + + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/index.json b/miniprogram/miniprogram_npm/wxml-to-canvas/index.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/miniprogram/miniprogram_npm/wxml-to-canvas/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxml b/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxml new file mode 100644 index 00000000..a0010adc --- /dev/null +++ b/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/miniprogram/page/API/pages/custom-service/custom-service.wxss b/miniprogram/miniprogram_npm/wxml-to-canvas/index.wxss similarity index 100% rename from miniprogram/page/API/pages/custom-service/custom-service.wxss rename to miniprogram/miniprogram_npm/wxml-to-canvas/index.wxss diff --git a/miniprogram/miniprogram_npm/wxml-to-canvas/utils.js b/miniprogram/miniprogram_npm/wxml-to-canvas/utils.js new file mode 100644 index 00000000..c3cf7d73 --- /dev/null +++ b/miniprogram/miniprogram_npm/wxml-to-canvas/utils.js @@ -0,0 +1,57 @@ +const hex = (color) => { + let result = null + + if (/^#/.test(color) && (color.length === 7 || color.length === 9)) { + return color + // eslint-disable-next-line no-cond-assign + } else if ((result = /^(rgb|rgba)\((.+)\)/.exec(color)) !== null) { + return '#' + result[2].split(',').map((part, index) => { + part = part.trim() + part = index === 3 ? Math.floor(parseFloat(part) * 255) : parseInt(part, 10) + part = part.toString(16) + if (part.length === 1) { + part = '0' + part + } + return part + }).join('') + } else { + return '#00000000' + } +} + +const splitLineToCamelCase = (str) => str.split('-').map((part, index) => { + if (index === 0) { + return part + } + return part[0].toUpperCase() + part.slice(1) +}).join('') + +const compareVersion = (v1, v2) => { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10) + const num2 = parseInt(v2[i], 10) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + + return 0 +} + +module.exports = { + hex, + splitLineToCamelCase, + compareVersion +} diff --git a/miniprogram/package.json b/miniprogram/package.json new file mode 100644 index 00000000..a5081aca --- /dev/null +++ b/miniprogram/package.json @@ -0,0 +1,17 @@ +{ + "name": "miniprogram", + "version": "1.0.0", + "description": "", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "miniprogram-barrage": "^1.1.0", + "miniprogram-recycle-view": "^0.1.5", + "wxml-to-canvas": "^1.1.1" + } +} diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.js b/miniprogram/packageAPI/pages/action-sheet/action-sheet.js similarity index 81% rename from miniprogram/page/API/pages/action-sheet/action-sheet.js rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.js index 93a99670..0386e335 100644 --- a/miniprogram/page/API/pages/action-sheet/action-sheet.js +++ b/miniprogram/packageAPI/pages/action-sheet/action-sheet.js @@ -2,7 +2,7 @@ Page({ onShareAppMessage() { return { title: '操作菜单', - path: 'page/API/pages/action-sheet/action-sheet' + path: 'packageAPI/pages/action-sheet/action-sheet' } }, diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.json b/miniprogram/packageAPI/pages/action-sheet/action-sheet.json similarity index 100% rename from miniprogram/page/API/pages/action-sheet/action-sheet.json rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.json diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.wxml b/miniprogram/packageAPI/pages/action-sheet/action-sheet.wxml similarity index 100% rename from miniprogram/page/API/pages/action-sheet/action-sheet.wxml rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.wxml diff --git a/miniprogram/page/API/pages/action-sheet/action-sheet.wxss b/miniprogram/packageAPI/pages/action-sheet/action-sheet.wxss similarity index 100% rename from miniprogram/page/API/pages/action-sheet/action-sheet.wxss rename to miniprogram/packageAPI/pages/action-sheet/action-sheet.wxss diff --git a/miniprogram/page/API/pages/add-contact/add-contact.js b/miniprogram/packageAPI/pages/add-contact/add-contact.js similarity index 87% rename from miniprogram/page/API/pages/add-contact/add-contact.js rename to miniprogram/packageAPI/pages/add-contact/add-contact.js index 7c867501..111cc610 100644 --- a/miniprogram/page/API/pages/add-contact/add-contact.js +++ b/miniprogram/packageAPI/pages/add-contact/add-contact.js @@ -2,7 +2,7 @@ Page({ onShareAppMessage() { return { title: '新增联系人', - path: 'page/API/pages/add-contact/add-contact' + path: 'packageAPI/pages/add-contact/add-contact' } }, diff --git a/miniprogram/page/API/pages/add-contact/add-contact.json b/miniprogram/packageAPI/pages/add-contact/add-contact.json similarity index 100% rename from miniprogram/page/API/pages/add-contact/add-contact.json rename to miniprogram/packageAPI/pages/add-contact/add-contact.json diff --git a/miniprogram/page/API/pages/add-contact/add-contact.wxml b/miniprogram/packageAPI/pages/add-contact/add-contact.wxml similarity index 100% rename from miniprogram/page/API/pages/add-contact/add-contact.wxml rename to miniprogram/packageAPI/pages/add-contact/add-contact.wxml diff --git a/miniprogram/page/API/pages/add-contact/add-contact.wxss b/miniprogram/packageAPI/pages/add-contact/add-contact.wxss similarity index 100% rename from miniprogram/page/API/pages/add-contact/add-contact.wxss rename to miniprogram/packageAPI/pages/add-contact/add-contact.wxss diff --git a/miniprogram/packageAPI/pages/animation/animation.js b/miniprogram/packageAPI/pages/animation/animation.js new file mode 100644 index 00000000..cdad2809 --- /dev/null +++ b/miniprogram/packageAPI/pages/animation/animation.js @@ -0,0 +1,46 @@ +Page({ + onShareAppMessage() { + return { + title: '动画', + path: 'package/API/pages/animation/animation', + containerStyle1: '', + + } + }, + data: { + canIUse: true, + }, + onLoad() { + const canIUse = this.animate !== undefined + if(!canIUse) { + wx.showModal({ + title: '微信版本过低,暂不支持本功能', + }) + this.setData({ + canIUse, + }) + } + }, + + change: function () { + this.animate('#container1', [ + { opacity: 1.0, rotate: 0, backgroundColor: '#FF0000' }, + { opacity: 0.5, rotate: 45, backgroundColor: '#00FF00', offset: 0.9}, + { opacity: 0.0, rotate: 90, backgroundColor: '#FF0000' }, + ], 5000, function () { + this.clearAnimation('#container1', { opacity: true, rotate: true }, function () { + console.log("清除了#container上的动画属性") + }) + }.bind(this)) + this.animate('.block1', [ + { scale: [1, 1], rotate: 0, ease: 'ease-out' }, + { scale: [1.5, 1.5], rotate: 45, ease: 'ease-in', offset: 0.9}, + { scale: [2, 2], rotate: 90}, + ], 5000, function () { + this.clearAnimation('.block1', { scale: true, rotate: true}, function () { + console.log("清除了.block1上的动画属性") + }) + }.bind(this) + ) + }, +}) diff --git a/miniprogram/page/API/pages/animation/animation.json b/miniprogram/packageAPI/pages/animation/animation.json similarity index 100% rename from miniprogram/page/API/pages/animation/animation.json rename to miniprogram/packageAPI/pages/animation/animation.json diff --git a/miniprogram/packageAPI/pages/animation/animation.wxml b/miniprogram/packageAPI/pages/animation/animation.wxml new file mode 100644 index 00000000..461926db --- /dev/null +++ b/miniprogram/packageAPI/pages/animation/animation.wxml @@ -0,0 +1,21 @@ + + + + +