@cloudbase/js-sdk 3.4.6 → 3.4.7-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/dist/index.esm.js +2 -3
- package/ai/dist/index.esm.js.map +1 -0
- package/ai/dist/index.js +2 -21
- package/ai/dist/index.js.map +1 -0
- package/apis/dist/index.esm.js +2 -3
- package/apis/dist/index.esm.js.map +1 -0
- package/apis/dist/index.js +2 -21
- package/apis/dist/index.js.map +1 -0
- package/app/dist/index.esm.js +2 -11
- package/app/dist/index.esm.js.map +1 -0
- package/app/dist/index.js +2 -18
- package/app/dist/index.js.map +1 -0
- package/auth/dist/index.esm.js +3 -8
- package/auth/dist/index.esm.js.LICENSE.txt +12 -0
- package/auth/dist/index.esm.js.map +1 -0
- package/auth/dist/index.js +3 -13
- package/auth/dist/index.js.LICENSE.txt +12 -0
- package/auth/dist/index.js.map +1 -0
- package/cloudrun/dist/index.esm.js +2 -3
- package/cloudrun/dist/index.esm.js.map +1 -0
- package/cloudrun/dist/index.js +2 -21
- package/cloudrun/dist/index.js.map +1 -0
- package/container/dist/index.esm.js +2 -8
- package/container/dist/index.esm.js.map +1 -0
- package/container/dist/index.js +2 -13
- package/container/dist/index.js.map +1 -0
- package/database/package.json +34 -4
- package/dist/index.cjs.js +3 -38
- package/dist/index.cjs.js.LICENSE.txt +12 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +3 -33
- package/dist/index.esm.js.LICENSE.txt +12 -0
- package/dist/index.esm.js.map +1 -0
- package/functions/dist/index.esm.js +2 -8
- package/functions/dist/index.esm.js.map +1 -0
- package/functions/dist/index.js +2 -13
- package/functions/dist/index.js.map +1 -0
- package/miniprogram_dist/ai.js +1 -1
- package/miniprogram_dist/apis.js +1 -1
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/auth.js +1 -1
- package/miniprogram_dist/cloudrun.js +1 -1
- package/miniprogram_dist/container.js +1 -1
- package/miniprogram_dist/database.js +1 -1
- package/miniprogram_dist/functions.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/model.js +1 -1
- package/miniprogram_dist/mysql.js +1 -1
- package/miniprogram_dist/oauth.js +2 -1
- package/miniprogram_dist/realtime.js +1 -1
- package/miniprogram_dist/storage.js +1 -1
- package/model/dist/index.esm.js +2 -3
- package/model/dist/index.esm.js.map +1 -0
- package/model/dist/index.js +2 -21
- package/model/dist/index.js.map +1 -0
- package/mysql/dist/index.esm.js +2 -3
- package/mysql/dist/index.esm.js.map +1 -0
- package/mysql/dist/index.js +2 -21
- package/mysql/dist/index.js.map +1 -0
- package/oauth/dist/index.esm.js +3 -3
- package/oauth/dist/index.esm.js.LICENSE.txt +12 -0
- package/oauth/dist/index.esm.js.map +1 -0
- package/oauth/dist/index.js +3 -21
- package/oauth/dist/index.js.LICENSE.txt +12 -0
- package/oauth/dist/index.js.map +1 -0
- package/package.json +29 -47
- package/realtime/dist/index.esm.js +2 -8
- package/realtime/dist/index.esm.js.map +1 -0
- package/realtime/dist/index.js +2 -13
- package/realtime/dist/index.js.map +1 -0
- package/storage/dist/index.esm.js +2 -4
- package/storage/dist/index.esm.js.map +1 -0
- package/storage/dist/index.js +2 -9
- package/storage/dist/index.js.map +1 -0
- package/types/analytics.d.ts +51 -0
- package/types/container.d.ts +93 -0
- package/{node_modules/@cloudbase/types → types}/package.json +1 -1
- package/{node_modules/@cloudbase/utilities → utilities}/package.json +2 -2
- package/ai/src/index.d.ts +0 -1
- package/ai/src/index.ts +0 -1
- package/apis/src/index.d.ts +0 -1
- package/apis/src/index.ts +0 -1
- package/app/src/index.ts +0 -17
- package/auth/src/index.d.ts +0 -2
- package/auth/src/index.ts +0 -8
- package/cloudrun/src/index.d.ts +0 -1
- package/cloudrun/src/index.ts +0 -1
- package/container/src/index.d.ts +0 -2
- package/container/src/index.ts +0 -8
- package/database/dist/index.d.ts +0 -3
- package/database/dist/index.esm.js +0 -503
- package/database/dist/index.js +0 -509
- package/database/src/index.d.ts +0 -3
- package/database/src/index.ts +0 -486
- package/functions/src/index.d.ts +0 -2
- package/functions/src/index.ts +0 -8
- package/model/src/index.d.ts +0 -1
- package/model/src/index.ts +0 -1
- package/mysql/src/index.d.ts +0 -1
- package/mysql/src/index.ts +0 -1
- package/node_modules/@cloudbase/ai/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/ai/dist/cjs/AI.d.ts +0 -27
- package/node_modules/@cloudbase/ai/dist/cjs/AI.js +0 -224
- package/node_modules/@cloudbase/ai/dist/cjs/bot/index.d.ts +0 -41
- package/node_modules/@cloudbase/ai/dist/cjs/bot/index.js +0 -376
- package/node_modules/@cloudbase/ai/dist/cjs/bot/types.d.ts +0 -144
- package/node_modules/@cloudbase/ai/dist/cjs/bot/types.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/index.d.ts +0 -2
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/index.js +0 -6
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/parse.d.ts +0 -2
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/parse.js +0 -126
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/stream.d.ts +0 -5
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/stream.js +0 -40
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/types.d.ts +0 -16
- package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/types.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/index.d.ts +0 -40
- package/node_modules/@cloudbase/ai/dist/cjs/index.js +0 -187
- package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/index.js +0 -130
- package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/type.d.ts +0 -71
- package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/type.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/index.js +0 -130
- package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/type.d.ts +0 -74
- package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/type.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/models/DeepSeek/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/DeepSeek/index.js +0 -126
- package/node_modules/@cloudbase/ai/dist/cjs/models/Default/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/Default/index.js +0 -122
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/index.js +0 -135
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/type.d.ts +0 -74
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/type.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/util.d.ts +0 -4
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/util.js +0 -56
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanBeta/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanBeta/index.js +0 -127
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanExp/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanExp/index.js +0 -125
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanOpen/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanOpen/index.js +0 -127
- package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/index.js +0 -130
- package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/type.d.ts +0 -85
- package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/type.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/index.js +0 -133
- package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/type.d.ts +0 -75
- package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/type.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/index.js +0 -139
- package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/type.d.ts +0 -71
- package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/type.js +0 -3
- package/node_modules/@cloudbase/ai/dist/cjs/models/image-model.d.ts +0 -18
- package/node_modules/@cloudbase/ai/dist/cjs/models/image-model.js +0 -85
- package/node_modules/@cloudbase/ai/dist/cjs/models/index.d.ts +0 -26
- package/node_modules/@cloudbase/ai/dist/cjs/models/index.js +0 -42
- package/node_modules/@cloudbase/ai/dist/cjs/models/model.d.ts +0 -40
- package/node_modules/@cloudbase/ai/dist/cjs/models/model.js +0 -481
- package/node_modules/@cloudbase/ai/dist/cjs/type.d.ts +0 -190
- package/node_modules/@cloudbase/ai/dist/cjs/type.js +0 -10
- package/node_modules/@cloudbase/ai/dist/cjs/utils.d.ts +0 -38
- package/node_modules/@cloudbase/ai/dist/cjs/utils.js +0 -263
- package/node_modules/@cloudbase/ai/dist/esm/AI.d.ts +0 -27
- package/node_modules/@cloudbase/ai/dist/esm/AI.js +0 -198
- package/node_modules/@cloudbase/ai/dist/esm/bot/index.d.ts +0 -41
- package/node_modules/@cloudbase/ai/dist/esm/bot/index.js +0 -373
- package/node_modules/@cloudbase/ai/dist/esm/bot/types.d.ts +0 -144
- package/node_modules/@cloudbase/ai/dist/esm/bot/types.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/index.d.ts +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/index.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/parse.d.ts +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/parse.js +0 -122
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/stream.d.ts +0 -5
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/stream.js +0 -37
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/types.d.ts +0 -16
- package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/types.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/index.d.ts +0 -40
- package/node_modules/@cloudbase/ai/dist/esm/index.js +0 -152
- package/node_modules/@cloudbase/ai/dist/esm/models/Ark/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/Ark/index.js +0 -127
- package/node_modules/@cloudbase/ai/dist/esm/models/Ark/type.d.ts +0 -71
- package/node_modules/@cloudbase/ai/dist/esm/models/Ark/type.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/index.js +0 -127
- package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/type.d.ts +0 -74
- package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/type.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/models/DeepSeek/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/DeepSeek/index.js +0 -123
- package/node_modules/@cloudbase/ai/dist/esm/models/Default/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/Default/index.js +0 -119
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/index.js +0 -132
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/type.d.ts +0 -74
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/type.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/util.d.ts +0 -4
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/util.js +0 -51
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanBeta/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanBeta/index.js +0 -124
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanExp/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanExp/index.js +0 -122
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanOpen/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanOpen/index.js +0 -124
- package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/index.js +0 -127
- package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/type.d.ts +0 -85
- package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/type.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/models/Yi/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/Yi/index.js +0 -130
- package/node_modules/@cloudbase/ai/dist/esm/models/Yi/type.d.ts +0 -75
- package/node_modules/@cloudbase/ai/dist/esm/models/Yi/type.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/index.d.ts +0 -10
- package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/index.js +0 -136
- package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/type.d.ts +0 -71
- package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/type.js +0 -2
- package/node_modules/@cloudbase/ai/dist/esm/models/image-model.d.ts +0 -18
- package/node_modules/@cloudbase/ai/dist/esm/models/image-model.js +0 -82
- package/node_modules/@cloudbase/ai/dist/esm/models/index.d.ts +0 -26
- package/node_modules/@cloudbase/ai/dist/esm/models/index.js +0 -27
- package/node_modules/@cloudbase/ai/dist/esm/models/model.d.ts +0 -40
- package/node_modules/@cloudbase/ai/dist/esm/models/model.js +0 -478
- package/node_modules/@cloudbase/ai/dist/esm/type.d.ts +0 -190
- package/node_modules/@cloudbase/ai/dist/esm/type.js +0 -7
- package/node_modules/@cloudbase/ai/dist/esm/utils.d.ts +0 -38
- package/node_modules/@cloudbase/ai/dist/esm/utils.js +0 -252
- package/node_modules/@cloudbase/ai/dist/miniprogram/index.js +0 -2
- package/node_modules/@cloudbase/ai/dist/miniprogram/index.js.LICENSE.txt +0 -22
- package/node_modules/@cloudbase/ai/package.json +0 -32
- package/node_modules/@cloudbase/apis/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/apis/dist/cjs/callApis.d.ts +0 -20
- package/node_modules/@cloudbase/apis/dist/cjs/callApis.js +0 -154
- package/node_modules/@cloudbase/apis/dist/cjs/index.d.ts +0 -5
- package/node_modules/@cloudbase/apis/dist/cjs/index.js +0 -53
- package/node_modules/@cloudbase/apis/dist/cjs/type.d.ts +0 -14
- package/node_modules/@cloudbase/apis/dist/cjs/type.js +0 -3
- package/node_modules/@cloudbase/apis/dist/esm/callApis.d.ts +0 -20
- package/node_modules/@cloudbase/apis/dist/esm/callApis.js +0 -148
- package/node_modules/@cloudbase/apis/dist/esm/index.d.ts +0 -5
- package/node_modules/@cloudbase/apis/dist/esm/index.js +0 -35
- package/node_modules/@cloudbase/apis/dist/esm/type.d.ts +0 -14
- package/node_modules/@cloudbase/apis/dist/esm/type.js +0 -2
- package/node_modules/@cloudbase/apis/dist/miniprogram/index.js +0 -1
- package/node_modules/@cloudbase/apis/package.json +0 -28
- package/node_modules/@cloudbase/app/.eslintrc.js +0 -12
- package/node_modules/@cloudbase/app/dist/cjs/constants/common.d.ts +0 -38
- package/node_modules/@cloudbase/app/dist/cjs/constants/common.js +0 -103
- package/node_modules/@cloudbase/app/dist/cjs/index.d.ts +0 -65
- package/node_modules/@cloudbase/app/dist/cjs/index.js +0 -340
- package/node_modules/@cloudbase/app/dist/cjs/index.node.d.ts +0 -6
- package/node_modules/@cloudbase/app/dist/cjs/index.node.js +0 -27
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/constants.d.ts +0 -33
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/constants.js +0 -38
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/context.d.ts +0 -17
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/context.js +0 -189
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/index.d.ts +0 -25
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/index.js +0 -150
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/metadata.d.ts +0 -14
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/metadata.js +0 -130
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/request.d.ts +0 -41
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/request.js +0 -521
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/tool.d.ts +0 -2
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/tool.js +0 -354
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/types.d.ts +0 -102
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/types.js +0 -3
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/utils.d.ts +0 -37
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/utils.js +0 -286
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/wx.d.ts +0 -39
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/wx.js +0 -272
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter.d.ts +0 -3
- package/node_modules/@cloudbase/app/dist/cjs/libs/adapter.js +0 -163
- package/node_modules/@cloudbase/app/dist/cjs/libs/cache.d.ts +0 -6
- package/node_modules/@cloudbase/app/dist/cjs/libs/cache.js +0 -38
- package/node_modules/@cloudbase/app/dist/cjs/libs/component.d.ts +0 -3
- package/node_modules/@cloudbase/app/dist/cjs/libs/component.js +0 -126
- package/node_modules/@cloudbase/app/dist/cjs/libs/lang.d.ts +0 -23
- package/node_modules/@cloudbase/app/dist/cjs/libs/lang.js +0 -59
- package/node_modules/@cloudbase/app/dist/cjs/libs/request.d.ts +0 -62
- package/node_modules/@cloudbase/app/dist/cjs/libs/request.js +0 -480
- package/node_modules/@cloudbase/app/dist/esm/constants/common.d.ts +0 -38
- package/node_modules/@cloudbase/app/dist/esm/constants/common.js +0 -91
- package/node_modules/@cloudbase/app/dist/esm/index.d.ts +0 -65
- package/node_modules/@cloudbase/app/dist/esm/index.js +0 -335
- package/node_modules/@cloudbase/app/dist/esm/index.node.d.ts +0 -6
- package/node_modules/@cloudbase/app/dist/esm/index.node.js +0 -19
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/constants.d.ts +0 -33
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/constants.js +0 -35
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/context.d.ts +0 -17
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/context.js +0 -181
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/index.d.ts +0 -25
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/index.js +0 -120
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/metadata.d.ts +0 -14
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/metadata.js +0 -123
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/request.d.ts +0 -41
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/request.js +0 -495
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/tool.d.ts +0 -2
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/tool.js +0 -350
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/types.d.ts +0 -102
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/types.js +0 -2
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/utils.d.ts +0 -37
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/utils.js +0 -264
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/wx.d.ts +0 -39
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/wx.js +0 -237
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter.d.ts +0 -3
- package/node_modules/@cloudbase/app/dist/esm/libs/adapter.js +0 -136
- package/node_modules/@cloudbase/app/dist/esm/libs/cache.d.ts +0 -6
- package/node_modules/@cloudbase/app/dist/esm/libs/cache.js +0 -32
- package/node_modules/@cloudbase/app/dist/esm/libs/component.d.ts +0 -3
- package/node_modules/@cloudbase/app/dist/esm/libs/component.js +0 -121
- package/node_modules/@cloudbase/app/dist/esm/libs/lang.d.ts +0 -23
- package/node_modules/@cloudbase/app/dist/esm/libs/lang.js +0 -54
- package/node_modules/@cloudbase/app/dist/esm/libs/request.d.ts +0 -62
- package/node_modules/@cloudbase/app/dist/esm/libs/request.js +0 -475
- package/node_modules/@cloudbase/app/dist/miniprogram/index.js +0 -2
- package/node_modules/@cloudbase/app/dist/miniprogram/index.js.LICENSE.txt +0 -7
- package/node_modules/@cloudbase/app/package.json +0 -59
- package/node_modules/@cloudbase/auth/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/auth/dist/cjs/adapter.d.ts +0 -2
- package/node_modules/@cloudbase/auth/dist/cjs/adapter.js +0 -272
- package/node_modules/@cloudbase/auth/dist/cjs/index.d.ts +0 -283
- package/node_modules/@cloudbase/auth/dist/cjs/index.js +0 -3018
- package/node_modules/@cloudbase/auth/dist/cjs/type.d.ts +0 -258
- package/node_modules/@cloudbase/auth/dist/cjs/type.js +0 -6
- package/node_modules/@cloudbase/auth/dist/cjs/utilities.d.ts +0 -7
- package/node_modules/@cloudbase/auth/dist/cjs/utilities.js +0 -23
- package/node_modules/@cloudbase/auth/dist/cjs/utils.d.ts +0 -5
- package/node_modules/@cloudbase/auth/dist/cjs/utils.js +0 -60
- package/node_modules/@cloudbase/auth/dist/cjs/v1-compat.d.ts +0 -77
- package/node_modules/@cloudbase/auth/dist/cjs/v1-compat.js +0 -423
- package/node_modules/@cloudbase/auth/dist/esm/adapter.d.ts +0 -2
- package/node_modules/@cloudbase/auth/dist/esm/adapter.js +0 -268
- package/node_modules/@cloudbase/auth/dist/esm/index.d.ts +0 -283
- package/node_modules/@cloudbase/auth/dist/esm/index.js +0 -3008
- package/node_modules/@cloudbase/auth/dist/esm/type.d.ts +0 -258
- package/node_modules/@cloudbase/auth/dist/esm/type.js +0 -3
- package/node_modules/@cloudbase/auth/dist/esm/utilities.d.ts +0 -7
- package/node_modules/@cloudbase/auth/dist/esm/utilities.js +0 -8
- package/node_modules/@cloudbase/auth/dist/esm/utils.d.ts +0 -5
- package/node_modules/@cloudbase/auth/dist/esm/utils.js +0 -52
- package/node_modules/@cloudbase/auth/dist/esm/v1-compat.d.ts +0 -77
- package/node_modules/@cloudbase/auth/dist/esm/v1-compat.js +0 -419
- package/node_modules/@cloudbase/auth/dist/miniprogram/index.js +0 -1
- package/node_modules/@cloudbase/auth/package.json +0 -31
- package/node_modules/@cloudbase/cloudrun/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/cloudrun/dist/cjs/index.d.ts +0 -4
- package/node_modules/@cloudbase/cloudrun/dist/cjs/index.js +0 -154
- package/node_modules/@cloudbase/cloudrun/dist/esm/index.d.ts +0 -4
- package/node_modules/@cloudbase/cloudrun/dist/esm/index.js +0 -149
- package/node_modules/@cloudbase/cloudrun/package.json +0 -30
- package/node_modules/@cloudbase/container/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/container/.prettierrc.js +0 -41
- package/node_modules/@cloudbase/container/dist/cjs/constants/index.d.ts +0 -1
- package/node_modules/@cloudbase/container/dist/cjs/constants/index.js +0 -5
- package/node_modules/@cloudbase/container/dist/cjs/go_wams_exec.d.ts +0 -2
- package/node_modules/@cloudbase/container/dist/cjs/go_wams_exec.js +0 -538
- package/node_modules/@cloudbase/container/dist/cjs/index.d.ts +0 -13
- package/node_modules/@cloudbase/container/dist/cjs/index.js +0 -343
- package/node_modules/@cloudbase/container/dist/cjs/utils/index.d.ts +0 -3
- package/node_modules/@cloudbase/container/dist/cjs/utils/index.js +0 -83
- package/node_modules/@cloudbase/container/dist/cjs/utils/loader.d.ts +0 -8
- package/node_modules/@cloudbase/container/dist/cjs/utils/loader.js +0 -186
- package/node_modules/@cloudbase/container/dist/cjs/utils/request.d.ts +0 -12
- package/node_modules/@cloudbase/container/dist/cjs/utils/request.js +0 -106
- package/node_modules/@cloudbase/container/dist/esm/constants/index.d.ts +0 -1
- package/node_modules/@cloudbase/container/dist/esm/constants/index.js +0 -2
- package/node_modules/@cloudbase/container/dist/esm/go_wams_exec.d.ts +0 -2
- package/node_modules/@cloudbase/container/dist/esm/go_wams_exec.js +0 -536
- package/node_modules/@cloudbase/container/dist/esm/index.d.ts +0 -13
- package/node_modules/@cloudbase/container/dist/esm/index.js +0 -338
- package/node_modules/@cloudbase/container/dist/esm/utils/index.d.ts +0 -3
- package/node_modules/@cloudbase/container/dist/esm/utils/index.js +0 -77
- package/node_modules/@cloudbase/container/dist/esm/utils/loader.d.ts +0 -8
- package/node_modules/@cloudbase/container/dist/esm/utils/loader.js +0 -178
- package/node_modules/@cloudbase/container/dist/esm/utils/request.d.ts +0 -12
- package/node_modules/@cloudbase/container/dist/esm/utils/request.js +0 -102
- package/node_modules/@cloudbase/container/package.json +0 -30
- package/node_modules/@cloudbase/database/README.md +0 -119
- package/node_modules/@cloudbase/database/package.json +0 -36
- package/node_modules/@cloudbase/database/tsconfig.test.json +0 -15
- package/node_modules/@cloudbase/functions/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/functions/dist/cjs/index.d.ts +0 -2
- package/node_modules/@cloudbase/functions/dist/cjs/index.js +0 -223
- package/node_modules/@cloudbase/functions/dist/esm/index.d.ts +0 -2
- package/node_modules/@cloudbase/functions/dist/esm/index.js +0 -219
- package/node_modules/@cloudbase/functions/package.json +0 -32
- package/node_modules/@cloudbase/model/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/model/dist/cjs/index.d.ts +0 -5
- package/node_modules/@cloudbase/model/dist/cjs/index.js +0 -144
- package/node_modules/@cloudbase/model/dist/esm/index.d.ts +0 -5
- package/node_modules/@cloudbase/model/dist/esm/index.js +0 -125
- package/node_modules/@cloudbase/model/package.json +0 -29
- package/node_modules/@cloudbase/mysql/.eslintrc.js +0 -6
- package/node_modules/@cloudbase/mysql/dist/cjs/index.d.ts +0 -4
- package/node_modules/@cloudbase/mysql/dist/cjs/index.d.ts.map +0 -1
- package/node_modules/@cloudbase/mysql/dist/cjs/index.js +0 -173
- package/node_modules/@cloudbase/mysql/dist/esm/index.d.ts +0 -3
- package/node_modules/@cloudbase/mysql/dist/esm/index.js +0 -155
- package/node_modules/@cloudbase/mysql/package.json +0 -30
- package/node_modules/@cloudbase/oauth/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/apis.d.ts +0 -142
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/apis.js +0 -1280
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/auth-error.d.ts +0 -22
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/auth-error.js +0 -278
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/consts.d.ts +0 -139
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/consts.js +0 -147
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/models.d.ts +0 -557
- package/node_modules/@cloudbase/oauth/dist/cjs/auth/models.js +0 -3
- package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha-dom.d.ts +0 -3
- package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha-dom.js +0 -223
- package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha.d.ts +0 -42
- package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha.js +0 -205
- package/node_modules/@cloudbase/oauth/dist/cjs/index.d.ts +0 -22
- package/node_modules/@cloudbase/oauth/dist/cjs/index.js +0 -107
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/consts.d.ts +0 -20
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/consts.js +0 -26
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/interface.d.ts +0 -15
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/interface.js +0 -10
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/models.d.ts +0 -74
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/models.js +0 -3
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/oauth2client.d.ts +0 -129
- package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/oauth2client.js +0 -1174
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/base64.d.ts +0 -9
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/base64.js +0 -112
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/encrypt.d.ts +0 -4
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/encrypt.js +0 -26
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/encryptlong/index.d.ts +0 -546
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/encryptlong/index.js +0 -2982
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/function/single-promise.d.ts +0 -6
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/function/single-promise.js +0 -94
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/index.d.ts +0 -2
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/index.js +0 -56
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/mp.d.ts +0 -2
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/mp.js +0 -66
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/urlSearchParams.d.ts +0 -13
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/urlSearchParams.js +0 -66
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/uuid.d.ts +0 -1
- package/node_modules/@cloudbase/oauth/dist/cjs/utils/uuid.js +0 -12
- package/node_modules/@cloudbase/oauth/dist/esm/auth/apis.d.ts +0 -142
- package/node_modules/@cloudbase/oauth/dist/esm/auth/apis.js +0 -768
- package/node_modules/@cloudbase/oauth/dist/esm/auth/auth-error.d.ts +0 -22
- package/node_modules/@cloudbase/oauth/dist/esm/auth/auth-error.js +0 -255
- package/node_modules/@cloudbase/oauth/dist/esm/auth/consts.d.ts +0 -139
- package/node_modules/@cloudbase/oauth/dist/esm/auth/consts.js +0 -144
- package/node_modules/@cloudbase/oauth/dist/esm/auth/models.d.ts +0 -557
- package/node_modules/@cloudbase/oauth/dist/esm/auth/models.js +0 -2
- package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha-dom.d.ts +0 -3
- package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha-dom.js +0 -130
- package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha.d.ts +0 -42
- package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha.js +0 -104
- package/node_modules/@cloudbase/oauth/dist/esm/index.d.ts +0 -22
- package/node_modules/@cloudbase/oauth/dist/esm/index.js +0 -64
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/consts.d.ts +0 -20
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/consts.js +0 -22
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/interface.d.ts +0 -15
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/interface.js +0 -3
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/models.d.ts +0 -74
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/models.js +0 -2
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/oauth2client.d.ts +0 -129
- package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/oauth2client.js +0 -711
- package/node_modules/@cloudbase/oauth/dist/esm/utils/base64.d.ts +0 -9
- package/node_modules/@cloudbase/oauth/dist/esm/utils/base64.js +0 -104
- package/node_modules/@cloudbase/oauth/dist/esm/utils/encrypt.d.ts +0 -4
- package/node_modules/@cloudbase/oauth/dist/esm/utils/encrypt.js +0 -18
- package/node_modules/@cloudbase/oauth/dist/esm/utils/encryptlong/index.d.ts +0 -546
- package/node_modules/@cloudbase/oauth/dist/esm/utils/encryptlong/index.js +0 -2953
- package/node_modules/@cloudbase/oauth/dist/esm/utils/function/single-promise.d.ts +0 -6
- package/node_modules/@cloudbase/oauth/dist/esm/utils/function/single-promise.js +0 -34
- package/node_modules/@cloudbase/oauth/dist/esm/utils/index.d.ts +0 -2
- package/node_modules/@cloudbase/oauth/dist/esm/utils/index.js +0 -51
- package/node_modules/@cloudbase/oauth/dist/esm/utils/mp.d.ts +0 -2
- package/node_modules/@cloudbase/oauth/dist/esm/utils/mp.js +0 -61
- package/node_modules/@cloudbase/oauth/dist/esm/utils/urlSearchParams.d.ts +0 -13
- package/node_modules/@cloudbase/oauth/dist/esm/utils/urlSearchParams.js +0 -58
- package/node_modules/@cloudbase/oauth/dist/esm/utils/uuid.d.ts +0 -1
- package/node_modules/@cloudbase/oauth/dist/esm/utils/uuid.js +0 -8
- package/node_modules/@cloudbase/oauth/dist/miniprogram/index.js +0 -1
- package/node_modules/@cloudbase/oauth/package.json +0 -20
- package/node_modules/@cloudbase/realtime/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/realtime/dist/cjs/common.d.ts +0 -4
- package/node_modules/@cloudbase/realtime/dist/cjs/common.js +0 -22
- package/node_modules/@cloudbase/realtime/dist/cjs/error.d.ts +0 -36
- package/node_modules/@cloudbase/realtime/dist/cjs/error.js +0 -106
- package/node_modules/@cloudbase/realtime/dist/cjs/index.d.ts +0 -2
- package/node_modules/@cloudbase/realtime/dist/cjs/index.js +0 -36
- package/node_modules/@cloudbase/realtime/dist/cjs/listener.d.ts +0 -14
- package/node_modules/@cloudbase/realtime/dist/cjs/listener.js +0 -18
- package/node_modules/@cloudbase/realtime/dist/cjs/message.d.ts +0 -3
- package/node_modules/@cloudbase/realtime/dist/cjs/message.js +0 -13
- package/node_modules/@cloudbase/realtime/dist/cjs/snapshot.d.ts +0 -17
- package/node_modules/@cloudbase/realtime/dist/cjs/snapshot.js +0 -45
- package/node_modules/@cloudbase/realtime/dist/cjs/utils.d.ts +0 -1
- package/node_modules/@cloudbase/realtime/dist/cjs/utils.js +0 -9
- package/node_modules/@cloudbase/realtime/dist/cjs/virtual-websocket-client.d.ts +0 -62
- package/node_modules/@cloudbase/realtime/dist/cjs/virtual-websocket-client.js +0 -960
- package/node_modules/@cloudbase/realtime/dist/cjs/websocket-client.d.ts +0 -78
- package/node_modules/@cloudbase/realtime/dist/cjs/websocket-client.js +0 -750
- package/node_modules/@cloudbase/realtime/dist/cjs/ws-event.d.ts +0 -126
- package/node_modules/@cloudbase/realtime/dist/cjs/ws-event.js +0 -141
- package/node_modules/@cloudbase/realtime/dist/esm/common.d.ts +0 -4
- package/node_modules/@cloudbase/realtime/dist/esm/common.js +0 -15
- package/node_modules/@cloudbase/realtime/dist/esm/error.d.ts +0 -36
- package/node_modules/@cloudbase/realtime/dist/esm/error.js +0 -100
- package/node_modules/@cloudbase/realtime/dist/esm/index.d.ts +0 -2
- package/node_modules/@cloudbase/realtime/dist/esm/index.js +0 -32
- package/node_modules/@cloudbase/realtime/dist/esm/listener.d.ts +0 -14
- package/node_modules/@cloudbase/realtime/dist/esm/listener.js +0 -15
- package/node_modules/@cloudbase/realtime/dist/esm/message.d.ts +0 -3
- package/node_modules/@cloudbase/realtime/dist/esm/message.js +0 -8
- package/node_modules/@cloudbase/realtime/dist/esm/snapshot.d.ts +0 -17
- package/node_modules/@cloudbase/realtime/dist/esm/snapshot.js +0 -42
- package/node_modules/@cloudbase/realtime/dist/esm/utils.d.ts +0 -1
- package/node_modules/@cloudbase/realtime/dist/esm/utils.js +0 -5
- package/node_modules/@cloudbase/realtime/dist/esm/virtual-websocket-client.d.ts +0 -62
- package/node_modules/@cloudbase/realtime/dist/esm/virtual-websocket-client.js +0 -954
- package/node_modules/@cloudbase/realtime/dist/esm/websocket-client.d.ts +0 -78
- package/node_modules/@cloudbase/realtime/dist/esm/websocket-client.js +0 -747
- package/node_modules/@cloudbase/realtime/dist/esm/ws-event.d.ts +0 -126
- package/node_modules/@cloudbase/realtime/dist/esm/ws-event.js +0 -137
- package/node_modules/@cloudbase/realtime/package.json +0 -29
- package/node_modules/@cloudbase/storage/.eslintrc.js +0 -15
- package/node_modules/@cloudbase/storage/dist/cjs/index.d.ts +0 -195
- package/node_modules/@cloudbase/storage/dist/cjs/index.js +0 -1426
- package/node_modules/@cloudbase/storage/dist/cjs/supabase/errors.d.ts +0 -20
- package/node_modules/@cloudbase/storage/dist/cjs/supabase/errors.js +0 -65
- package/node_modules/@cloudbase/storage/dist/cjs/supabase/types.d.ts +0 -64
- package/node_modules/@cloudbase/storage/dist/cjs/supabase/types.js +0 -3
- package/node_modules/@cloudbase/storage/dist/esm/index.d.ts +0 -195
- package/node_modules/@cloudbase/storage/dist/esm/index.js +0 -1422
- package/node_modules/@cloudbase/storage/dist/esm/supabase/errors.d.ts +0 -20
- package/node_modules/@cloudbase/storage/dist/esm/supabase/errors.js +0 -61
- package/node_modules/@cloudbase/storage/dist/esm/supabase/types.d.ts +0 -64
- package/node_modules/@cloudbase/storage/dist/esm/supabase/types.js +0 -2
- package/node_modules/@cloudbase/storage/package.json +0 -28
- package/node_modules/@cloudbase/types/index.js +0 -1
- package/node_modules/@cloudbase/utilities/.eslintrc.js +0 -15
- package/oauth/src/index.d.ts +0 -1
- package/oauth/src/index.ts +0 -1
- package/realtime/src/index.d.ts +0 -2
- package/realtime/src/index.ts +0 -8
- package/storage/src/index.d.ts +0 -2
- package/storage/src/index.js +0 -5
- package/storage/src/index.ts +0 -4
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/aggregate.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/aggregate.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/collection.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/collection.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/command.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/command.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/logic.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/logic.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/update.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/update.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/app.config.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/app.config.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/error.config.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/error.config.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/const/code.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/const/code.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/constant.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/constant.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/document.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/document.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/interface.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/interface.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/lineString.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/lineString.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiLineString.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiLineString.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPoint.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPoint.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPolygon.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPolygon.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/point.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/point.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/polygon.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/polygon.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/helper/symbol.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/helper/symbol.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/lib/util.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/lib/util.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/operator-map.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/operator-map.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/regexp/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/regexp/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/common.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/common.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/datatype.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/datatype.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/update.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/update.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serverDate/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serverDate/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/collection.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/collection.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/document.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/document.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/realtime.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/realtime.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/util.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/util.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/error.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/error.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/msg.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/msg.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/symbol.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/symbol.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/type.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/type.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/utils.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/utils.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/validate.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/commonjs/validate.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/aggregate.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/aggregate.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/collection.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/collection.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/command.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/command.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/logic.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/logic.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/update.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/update.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/config/app.config.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/config/app.config.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/config/error.config.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/config/error.config.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/const/code.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/const/code.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/constant.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/constant.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/document.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/document.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/interface.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/interface.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/lineString.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/lineString.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiLineString.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiLineString.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPoint.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPoint.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPolygon.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPolygon.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/point.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/point.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/polygon.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/polygon.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/helper/symbol.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/helper/symbol.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/lib/util.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/lib/util.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/operator-map.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/operator-map.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/regexp/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/regexp/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/common.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/common.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/datatype.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/datatype.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/update.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/update.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serverDate/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/serverDate/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/collection.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/collection.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/document.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/document.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/query.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/query.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/index.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/realtime.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/realtime.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/util.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/util.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/error.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/error.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/msg.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/msg.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/symbol.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/symbol.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/type.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/type.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/utils.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/utils.js +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/validate.d.ts +0 -0
- /package/{node_modules/@cloudbase/database → database}/dist/esm/validate.js +0 -0
- /package/{app/src → dist}/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/auth.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/cache.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/cloudrun.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/component.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/database.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/events.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/functions.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/realtime.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/request.d.ts +0 -0
- /package/{node_modules/@cloudbase/types → types}/storage.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/platforms/web.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/platforms/web.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/common.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/common.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/errors.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/errors.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/decorators.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/decorators.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/abortController.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/abortController.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/cache.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/cache.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/events.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/events.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/langEvent.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/langEvent.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/util.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/util.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/platforms/web.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/platforms/web.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/common.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/common.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/errors.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/errors.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/decorators.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/decorators.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/index.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/index.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/abortController.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/abortController.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/cache.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/cache.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/events.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/events.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/langEvent.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/langEvent.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/util.d.ts +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/util.js +0 -0
- /package/{node_modules/@cloudbase/utilities → utilities}/dist/miniprogram/index.js +0 -0
package/auth/dist/index.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
var auth_1 = require("@cloudbase/auth");
|
|
5
|
-
exports.registerAuth = auth_1.registerAuth;
|
|
6
|
-
try {
|
|
7
|
-
window.registerAuth = exports.registerAuth;
|
|
8
|
-
}
|
|
9
|
-
catch (e) { }
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUFxRTtBQUd4RCxRQUFBLFlBQVksR0FBRyxtQkFBK0MsQ0FBQztBQUU1RSxJQUFJO0lBQ0QsTUFBYyxDQUFDLFlBQVksR0FBRyxvQkFBWSxDQUFBO0NBQzVDO0FBQUMsT0FBTyxDQUFDLEVBQUUsR0FBRSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHJlZ2lzdGVyQXV0aCBhcyByZWdpc3RlckF1dGhPcmlnaW4gfSBmcm9tICdAY2xvdWRiYXNlL2F1dGgnO1xuaW1wb3J0IHsgSUNsb3VkYmFzZSB9IGZyb20gJ0BjbG91ZGJhc2UvdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgcmVnaXN0ZXJBdXRoID0gcmVnaXN0ZXJBdXRoT3JpZ2luIGFzIChhcHA6IElDbG91ZGJhc2UpID0+IHZvaWQ7XG5cbnRyeSB7XG4gICh3aW5kb3cgYXMgYW55KS5yZWdpc3RlckF1dGggPSByZWdpc3RlckF1dGhcbn0gY2F0Y2ggKGUpIHt9Il19
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUFxRTtBQUd4RCxRQUFBLFlBQVksR0FBRyxtQkFBK0MsQ0FBQztBQUU1RSxJQUFJO0lBQ0QsTUFBYyxDQUFDLFlBQVksR0FBRyxvQkFBWSxDQUFBO0NBQzVDO0FBQUMsT0FBTyxDQUFDLEVBQUUsR0FBRSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHJlZ2lzdGVyQXV0aCBhcyByZWdpc3RlckF1dGhPcmlnaW4gfSBmcm9tICdAY2xvdWRiYXNlL2F1dGgnO1xuaW1wb3J0IHsgSUNsb3VkYmFzZSB9IGZyb20gJ0BjbG91ZGJhc2UvdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgcmVnaXN0ZXJBdXRoID0gcmVnaXN0ZXJBdXRoT3JpZ2luIGFzIChhcHA6IElDbG91ZGJhc2UpID0+IHZvaWQ7XG5cbnRyeSB7XG4gICh3aW5kb3cgYXMgYW55KS5yZWdpc3RlckF1dGggPSByZWdpc3RlckF1dGhcbn0gY2F0Y2ggKGUpIHt9Il19
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
!function(){"use strict";var t,e,r={548:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAuthAdapter=void 0;var s=r(19),a=function(){function t(t){var e,r;try{this.localStorage=(null==t?void 0:t.localStorage)||((null===(r=null===(e=null==t?void 0:t.adapter)||void 0===e?void 0:e.root)||void 0===r?void 0:r.globalThis)||globalThis).localStorage}catch(e){this.localStorage=(null==t?void 0:t.localStorage)||{}}}return t.prototype.getItem=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.localStorage.getItem(t)]}))}))},t.prototype.removeItem=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return this.localStorage.removeItem(t),[2]}))}))},t.prototype.setItem=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(r){return this.localStorage.setItem(t,e),[2]}))}))},t.prototype.getItemSync=function(t){return this.localStorage.getItem(t)},t.prototype.setItemSync=function(t,e){this.localStorage.setItem(t,e)},t.prototype.removeItemSync=function(t){this.localStorage.removeItem(t)},t}(),u=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,c=function(t,e){var r,n,i,o,s=null===(r=null==e?void 0:e.headers)||void 0===r?void 0:r["x-request-id"];return t||(t={}),((null==t?void 0:t.code)||(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.error_code))&&(t={error:t.code||t.data.error,error_description:t.data.error_description||t.message||t.code||t.data.error_code,request_id:t.requestId,error_code:null===(i=t.data)||void 0===i?void 0:i.error_code}),(null==t?void 0:t.request_id)||(t.request_id=t.request_id||s),(null==t?void 0:t.error)?(t.error_uri=(o=null==e?void 0:e.url,u.test(o)?RegExp.$1:o),t):(null==t?void 0:t.data)||{}};e.useAuthAdapter=function(t){return t.adapter&&"default"!==t.adapter.type?function(t,e){var r=n({},t);try{if(!(null==t?void 0:t.storage)&&(null==e?void 0:e.localStorage)&&(r.storage=new a({localStorage:e.localStorage,adapter:e})),!t.captchaOptions&&(null==e?void 0:e.captchaOptions)&&(r.captchaOptions=e.captchaOptions),!t.baseRequest&&!t.request&&(null==e?void 0:e.reqClass)){var s={timeout:1e4,restrictedMethods:["get","post","upload","download","request"],auth:t.auth},u=new e.reqClass(s);r.baseRequest=function(t,e){var r,s,a,h,l;return i(this,void 0,void 0,(function(){var i,d,p,f;return o(this,(function(o){switch(o.label){case 0:if(i={},d=(null===(r=e.method)||void 0===r?void 0:r.toLocaleLowerCase())||"post","function"!=typeof(p=null===(a=null===(s=null==u?void 0:u[d])||void 0===s?void 0:s.bind)||void 0===a?void 0:a.call(s,u)))throw new Error("invalid 【".concat(d,"】 request method"));o.label=1;case 1:return o.trys.push([1,3,,4]),(null===(h=e.headers)||void 0===h?void 0:h["content-type"])&&!(null===(l=e.headers)||void 0===l?void 0:l["content-type"].includes("application/json"))||["string","undefined"].includes(typeof e.body)||(e.data=e.data||e.body,e.body=JSON.stringify(e.body)),[4,p(n({url:t},e))];case 2:return i=o.sent(),i=c(i,n(n({},e),{url:t})),[3,4];case 3:throw f=o.sent(),i=n(n({},null==f?void 0:f.data),f);case 4:if(null==i?void 0:i.error)throw i;return[2,i]}}))}))}}}catch(t){console.error("user adapter generate fail:",t)}return r}(t,t.adapter):function(t,e){var r=n({},t),u={};if((null==e?void 0:e.captchaOptions)&&(r.captchaOptions=e.captchaOptions),!s.adapterForWxMp.isMatch()||t.storage&&t.baseRequest)return r;try{var h=s.adapterForWxMp.genAdapter({}),l=h.localStorage,d=h.reqClass;if(l&&(u.storage=new a({localStorage:l,adapter:e})),d){var p=new d({timeout:1e4,restrictedMethods:["get","post","upload","download","request"]});u.request=function(t){return function(e,r){return i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,new Promise((function(i,o){var s=Object.assign({},r);s.body&&"string"!=typeof s.body&&(s.body=JSON.stringify(s.body));var a=wx.request({url:e,data:s.body,timeout:t._timeout,method:s.method||"GET",header:s.headers,success:function(t){(t=c(t,n(n({},r),{url:e}))).error&&o(t),i(t)},fail:function(t){o({error:"unreachable",error_description:t.message})},complete:function(e){if(e&&e.errMsg&&t._timeout&&-1!==t._restrictedMethods.indexOf("request")&&"request:fail timeout"===e.errMsg){console.warn(t._timeoutMsg);try{a.abort()}catch(t){}}}})}))]}))}))}}(p)}return r.captchaOptions&&(u.baseRequest=u.request,u.request=void 0),n(n({},r),u)}catch(t){console.error("adapter generate fail:",t)}return r}(t,t.adapter)}},895:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)},s=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},c=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},h=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.registerAuth=e.AuthError=e.AuthErrorCategory=e.AnonymousAuthProvider=e.CustomAuthProvider=e.WeixinAuthProvider=e.Auth=e.generateAuthInstance=e.LoginState=e.User=void 0;var l=r(722),d=r(548),p=r(19),f=r(266),v=r(916);Object.defineProperty(e,"WeixinAuthProvider",{enumerable:!0,get:function(){return v.WeixinAuthProvider}}),Object.defineProperty(e,"CustomAuthProvider",{enumerable:!0,get:function(){return v.CustomAuthProvider}}),Object.defineProperty(e,"AnonymousAuthProvider",{enumerable:!0,get:function(){return v.AnonymousAuthProvider}});var g=r(683),y=function(){return"undefined"!=typeof window&&"undefined"!=typeof document},m=e.User=function(){function t(t){var e=t.cache,r=t.oauthInstance;this.cache=e,this.oauthInstance=r,this.setUserInfo()}var e,r,n;return t.prototype.checkLocalInfo=function(){return u(this,void 0,void 0,(function(){return c(this,(function(t){return this.uid=this.getLocalUserInfo("uid"),this.gender=this.getLocalUserInfo("gender"),this.picture=this.getLocalUserInfo("picture"),this.email=this.getLocalUserInfo("email"),this.emailVerified=this.getLocalUserInfo("email_verified"),this.phoneNumber=this.getLocalUserInfo("phone_number"),this.username=this.getLocalUserInfo("username"),this.name=this.getLocalUserInfo("name"),this.birthdate=this.getLocalUserInfo("birthdate"),this.zoneinfo=this.getLocalUserInfo("zoneinfo"),this.locale=this.getLocalUserInfo("locale"),this.sub=this.getLocalUserInfo("sub"),this.createdFrom=this.getLocalUserInfo("created_from"),this.providers=this.getLocalUserInfo("providers"),[2]}))}))},t.prototype.checkLocalInfoAsync=function(){return u(this,void 0,void 0,(function(){var t,e,r,n;return c(this,(function(i){switch(i.label){case 0:return t=this,[4,this.getLocalUserInfoAsync("uid")];case 1:return t.uid=i.sent(),e=this,[4,this.getLocalUserInfoAsync("gender")];case 2:return e.gender=i.sent(),this.picture=this.getLocalUserInfo("picture"),r=this,[4,this.getLocalUserInfoAsync("email")];case 3:return r.email=i.sent(),this.emailVerified=this.getLocalUserInfo("email_verified"),this.phoneNumber=this.getLocalUserInfo("phone_number"),n=this,[4,this.getLocalUserInfoAsync("username")];case 4:return n.username=i.sent(),this.name=this.getLocalUserInfo("name"),this.birthdate=this.getLocalUserInfo("birthdate"),this.zoneinfo=this.getLocalUserInfo("zoneinfo"),this.locale=this.getLocalUserInfo("locale"),this.sub=this.getLocalUserInfo("sub"),this.createdFrom=this.getLocalUserInfo("created_from"),this.providers=this.getLocalUserInfo("providers"),[2]}}))}))},t.prototype.update=function(t){return u(this,void 0,Promise,(function(){var e;return c(this,(function(r){switch(r.label){case 0:return[4,this.oauthInstance.authApi.setUserProfile(o({},t))];case 1:return e=r.sent(),this.setLocalUserInfo(e),[2]}}))}))},t.prototype.updateUserBasicInfo=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.authApi.updateUserBasicInfo(o({},t))];case 1:return e.sent(),[4,this.refresh()];case 2:return e.sent(),[2]}}))}))},t.prototype.updatePassword=function(t,e){return this.oauthInstance.authApi.updatePasswordByOld({old_password:e,new_password:t})},t.prototype.updateUsername=function(t){return"string"!=typeof t&&(0,p.throwError)(p.ERRORS.INVALID_PARAMS,"username must be a string"),this.update({username:t})},t.prototype.refresh=function(t){return u(this,void 0,Promise,(function(){var e;return c(this,(function(r){switch(r.label){case 0:return[4,this.oauthInstance.authApi.getUserInfo(t)];case 1:if("INVALID_ACCESS_TOKEN"===(e=r.sent()).code)throw this.setLocalUserInfo({}),e;return this.setLocalUserInfo(e),[2,e]}}))}))},t.prototype.getLocalUserInfo=function(t){var e=this.cache.keys.userInfoKey,r=this.cache.getStore(e);return t?r[t]:r||{}},t.prototype.setLocalUserInfo=function(t){var e=this.cache.keys.userInfoKey;this.cache.setStore(e,t),this.setUserInfo()},t.prototype.getLocalUserInfoAsync=function(t){return u(this,void 0,Promise,(function(){var e;return c(this,(function(r){switch(r.label){case 0:return e=this.cache.keys.userInfoKey,[4,this.cache.getStoreAsync(e)];case 1:return[2,r.sent()[t]]}}))}))},t.prototype.setUserInfo=function(){var t=this,e=this.cache.keys.userInfoKey,r=this.cache.getStore(e);["uid","email","name","gender","picture","email_verified","phone_number","birthdate","zoneinfo","locale","sub","created_from","providers","username","created_at","open_id"].forEach((function(e){t[e]=r[e]}))},s([(0,p.catchErrorsDecorator)({title:"更新用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.update() 的语法或参数是否正确"," 2 - 用户信息中是否包含非法值","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(e=void 0!==l.authModels&&l.authModels.UserProfile)?e:Object]),a("design:returntype","function"==typeof(r="undefined"!=typeof Promise&&Promise)?r:Object)],t.prototype,"update",null),s([(0,p.catchErrorsDecorator)({title:"更新密码失败",messages:["请确认以下各项:"," 1 - 调用 User.updatePassword() 的语法或参数是否正确"," 3 - 新密码中是否包含非法字符","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[String,String]),a("design:returntype",void 0)],t.prototype,"updatePassword",null),s([(0,p.catchErrorsDecorator)({title:"更新用户名失败",messages:["请确认以下各项:"," 1 - 调用 User.updateUsername() 的语法或参数是否正确"," 2 - 当前环境是否开通了用户名密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",void 0)],t.prototype,"updateUsername",null),s([(0,p.catchErrorsDecorator)({title:"刷新本地用户信息失败",messages:["请确认以下各项:"," 1 - 调用 User.refresh() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype","function"==typeof(n="undefined"!=typeof Promise&&Promise)?n:Object)],t.prototype,"refresh",null),t}();(0,v.applyUserV1Compat)(m);var _=function(){function t(t){var e=t.envId,r=t.cache,n=t.oauthInstance;e||(0,p.throwError)(p.ERRORS.INVALID_PARAMS,"envId is not defined"),this.cache=r,this.oauthInstance=n,this.user=new m({cache:this.cache,oauthInstance:n})}return t.prototype.checkLocalState=function(){var t;this.oauthLoginState=null===(t=this.oauthInstance)||void 0===t?void 0:t.authApi.hasLoginStateSync(),this.user.checkLocalInfo()},t.prototype.checkLocalStateAsync=function(){var t;return u(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,null===(t=this.oauthInstance)||void 0===t?void 0:t.authApi.getLoginState()];case 1:return e.sent(),[4,this.user.checkLocalInfoAsync()];case 2:return e.sent(),[2]}}))}))},t}();e.LoginState=_;var b=function(t){function e(e){var r=t.call(this)||this;return r.listeners=new Map,r.hasListenerSetUp=!1,r.config=e,r.oauthInstance=e.oauthInstance,r.cache=e.cache,r.init(),r.setAccessKey(),r}var r,n,d,v,m,b,E,I,w,A,S,T,P,O,R,C,U,N,D,L;return i(e,t),e.prototype.signInAnonymously=function(t){return u(this,void 0,Promise,(function(){var e,r,n,i,s;return c(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.oauthInstance.authApi.signInAnonymously(t)];case 1:return a.sent(),[4,this.createLoginState()];case 2:return e=a.sent(),[4,this.getSession()];case 3:return r=a.sent().data,n=(void 0===r?{}:r).session,[2,o(o({},e),{data:{user:n.user,session:n},error:null})];case 4:return i=a.sent(),(s=new l.AuthError(i,{method:"signInAnonymously"})).category===l.AuthErrorCategory.PROVIDER_NOT_ENABLED?(console.error(s.helpMessage),console.error("[CloudBase Auth] 提示:匿名登录需要在控制台开启「匿名登录」。\n 如果您需要使用用户名密码登录,请改用 auth.signInWithPassword({ username, password })。\n 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。")):(console.warn("[CloudBase Auth] signInAnonymously 失败 [".concat(s.category,"]: ").concat(s.message)),s.loginMethodHint&&console.warn(s.loginMethodHint)),[2,{data:{},error:s}];case 5:return[2]}}))}))},e.prototype.signUp=function(t){return u(this,void 0,Promise,(function(){var e,r,n=this;return c(this,(function(i){switch(i.label){case 0:return t.phone_number||t.verification_code||t.verification_token||t.provider_token?(t.phone_number&&(t.phone_number=this.formatPhone(t.phone_number)),[4,this.oauthInstance.authApi.signUp(t)]):[3,2];case 1:return i.sent(),[2,this.createLoginState()];case 2:return i.trys.push([2,4,,5]),this.validateAtLeastOne(t,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(t.email?{email:t.email}:{phone_number:this.formatPhone(t.phone)})];case 3:return e=i.sent(),[2,{data:{verifyOtp:function(r){var i=r.token,s=r.messageId,a=void 0===s?e.verification_id:s;return u(n,void 0,Promise,(function(){var r,n,s,u,h;return c(this,(function(c){switch(c.label){case 0:return c.trys.push([0,8,,9]),[4,this.verify({verification_id:a||e.verification_id,verification_code:i})];case 1:return r=c.sent(),e.is_user?[4,this.signIn({username:t.email||this.formatPhone(t.phone),verification_token:r.verification_token})]:[3,3];case 2:return c.sent(),[3,6];case 3:return delete(n=JSON.parse(JSON.stringify(t))).email,delete n.phone,[4,this.oauthInstance.authApi.signUp(o(o(o({},n),t.email?{email:t.email}:{phone_number:this.formatPhone(t.phone)}),{verification_token:r.verification_token,verification_code:i}))];case 4:return c.sent(),[4,this.createLoginState()];case 5:c.sent(),c.label=6;case 6:return[4,this.getSession()];case 7:return s=c.sent().data,[2,{data:{user:(u=(void 0===s?{}:s).session).user,session:u},error:null}];case 8:return h=c.sent(),[2,{data:{},error:new l.AuthError(h,{method:"signUp"})}];case 9:return[2]}}))}))}},error:null}];case 4:return r=i.sent(),[2,{data:{},error:new l.AuthError(r,{method:"signUp"})}];case 5:return[2]}}))}))},e.prototype.signOut=function(t){var e,r;return u(this,void 0,Promise,(function(){var n,i,s;return c(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),n=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(t)];case 1:return i=a.sent(),[4,this.cache.removeStoreAsync(n)];case 2:return a.sent(),this.setAccessKey(),null===(e=this.config.eventBus)||void 0===e||e.fire(l.EVENTS.LOGIN_STATE_CHANGED,{eventType:l.LOGIN_STATE_CHANGED_TYPE.SIGN_OUT}),null===(r=this.config.eventBus)||void 0===r||r.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.SIGNED_OUT}),[2,o(o({},i),{data:{},error:null})];case 3:return s=a.sent(),[2,{data:{},error:new l.AuthError(s,{method:"signOut"})}];case 4:return[2]}}))}))},e.prototype.onAuthStateChange=function(t){var e=this;this.hasListenerSetUp||(this.setupListeners(),this.hasListenerSetUp=!0);var r=Math.random().toString(36);return this.listeners.has(r)||this.listeners.set(r,new Set),this.listeners.get(r).add(t),{data:{subscription:{id:r,callback:t,unsubscribe:function(){var n=e.listeners.get(r);n&&(n.delete(t),0===n.size&&e.listeners.delete(r))}}}}},e.prototype.signInWithPassword=function(t){return u(this,void 0,Promise,(function(){var e,r,n,i;return c(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),this.validateAtLeastOne(t,[["username"],["email"],["phone"]],"You must provide either username, email, or phone"),this.validateParams(t,{password:{required:!0,message:"Password is required"}}),[4,this.signIn(o({username:t.username||t.email||this.formatPhone(t.phone),password:t.password},t.is_encrypt?{isEncrypt:!0,version:"v2"}:{}))];case 1:return s.sent(),[4,this.getSession()];case 2:return e=s.sent().data,[2,{data:{user:(r=(void 0===e?{}:e).session).user,session:r},error:null}];case 3:return n=s.sent(),(i=new l.AuthError(n,{method:"signInWithPassword"})).category===l.AuthErrorCategory.PROVIDER_NOT_ENABLED?console.error(i.helpMessage):i.category===l.AuthErrorCategory.INVALID_CREDENTIALS||i.category===l.AuthErrorCategory.USER_NOT_FOUND?console.warn(i.helpMessage):console.warn("[CloudBase Auth] signInWithPassword 失败 [".concat(i.category,"]: ").concat(i.message)),i.loginMethodHint&&console.info(i.loginMethodHint),[2,{data:{},error:i}];case 4:return[2]}}))}))},e.prototype.signInWithIdToken=function(t){return u(this,void 0,Promise,(function(){var e,r,n;return c(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(t,{token:{required:!0,message:"Token is required"}}),[4,this.signInWithProvider({provider_token:t.token})];case 1:return i.sent(),[4,this.getSession()];case 2:return e=i.sent().data,[2,{data:{user:(r=(void 0===e?{}:e).session).user,session:r},error:null}];case 3:return n=i.sent(),[2,{data:{},error:new l.AuthError(n,{method:"signInWithIdToken"})}];case 4:return[2]}}))}))},e.prototype.signInWithOtp=function(t){var e,r,n,i;return u(this,void 0,Promise,(function(){var s,a,h=this;return c(this,(function(d){switch(d.label){case 0:if(!(null===(e=t.options)||void 0===e?void 0:e.emailRedirectTo)&&(void 0===(null===(r=t.options)||void 0===r?void 0:r.shouldCreateUser)||(null===(n=t.options)||void 0===n?void 0:n.shouldCreateUser)))return[2,this.signUp({email:t.email,phone:t.phone})];d.label=1;case 1:return d.trys.push([1,3,,4]),this.validateAtLeastOne(t,[["email"],["phone"]],"You must provide either an email or phone number"),[4,this.getVerification(o({email_redirect_to:null===(i=t.options)||void 0===i?void 0:i.emailRedirectTo},t.email?{email:t.email}:{phone_number:this.formatPhone(t.phone)}))];case 2:return s=d.sent(),[2,{data:{user:null,session:null,verifyOtp:function(e){var r=e.token,n=e.messageId,i=void 0===n?s.verification_id:n;return u(h,void 0,Promise,(function(){return c(this,(function(e){return[2,this.verifyOtp({email:t.email,phone:t.phone,token:r,messageId:i})]}))}))}},error:null}];case 3:return a=d.sent(),[2,{data:{},error:new l.AuthError(a,{method:"signInWithOtp"})}];case 4:return[2]}}))}))},e.prototype.verifyOAuth=function(t){return u(this,void 0,Promise,(function(){var e,r,n,i,s,a,u,h,d;return c(this,(function(c){switch(c.label){case 0:e={},c.label=1;case 1:return c.trys.push([1,7,,8]),r=(null==t?void 0:t.code)||g.utils.getQuery("code"),n=(null==t?void 0:t.state)||g.utils.getQuery("state"),r?n?(i=(0,f.getBrowserSession)(n),e.type=null==i?void 0:i.type,(s=(null==t?void 0:t.provider)||(null==i?void 0:i.provider)||g.utils.getQuery("provider"))?[4,this.grantProviderToken({provider_id:s,provider_redirect_uri:location.origin+location.pathname,provider_code:r})]:[2,{data:e,error:new l.AuthError({message:"Provider is required"})}]):[2,{data:{},error:new l.AuthError({message:"State is required"})}]:[2,{data:{},error:new l.AuthError({message:"Code is required"})}];case 2:return a=c.sent().provider_token,u=void 0,i.type!==l.OAUTH_TYPE.BIND_IDENTITY?[3,4]:[4,this.oauthInstance.authApi.toBindIdentity({provider_token:a,provider:s,fireEvent:!0})];case 3:return u=c.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:a})];case 5:(u=c.sent()).data=o(o({},e),u.data),c.label=6;case 6:return(h=new URLSearchParams(null===location||void 0===location?void 0:location.search)).delete("code"),h.delete("state"),u.data.redirectUrl=(0,f.addUrlSearch)(void 0===(null==i?void 0:i.search)?"?".concat(h.toString()):null==i?void 0:i.search,(null==i?void 0:i.hash)||location.hash),(0,f.removeBrowserSession)(n),[2,u];case 7:return d=c.sent(),[2,{data:e,error:new l.AuthError(d,{method:"verifyOAuth"})}];case 8:return[2]}}))}))},e.prototype.signInWithOAuth=function(t){var e,r,n,i,o;return u(this,void 0,Promise,(function(){var s,a,u,h,d,p,v,g,m;return c(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),this.validateParams(t,{provider:{required:!0,message:"Provider is required"}}),s=(null===(e=t.options)||void 0===e?void 0:e.redirectTo)||location.href,a=new URL(s),u=a.origin+a.pathname,h=(null===(r=t.options)||void 0===r?void 0:r.state)||"prd-".concat(t.provider,"-").concat(Math.random().toString(36).slice(2)),[4,this.genProviderRedirectUri({provider_id:t.provider,provider_redirect_uri:u,state:h})];case 1:return d=c.sent().uri,p=decodeURIComponent(d),v=p,(null===(n=t.options)||void 0===n?void 0:n.queryParams)&&(g=new URL(p),Object.entries(t.options.queryParams).forEach((function(t){var e=t[0],r=t[1];g.searchParams.set(e,r)})),v=g.toString()),(0,f.saveToBrowserSession)(h,{provider:t.provider,search:a.search,hash:a.hash,type:(null===(i=t.options)||void 0===i?void 0:i.type)||l.OAUTH_TYPE.SIGN_IN}),y()&&!(null===(o=t.options)||void 0===o?void 0:o.skipBrowserRedirect)&&window.location.assign(v),[2,{data:{url:v,provider:t.provider},error:null}];case 2:return m=c.sent(),[2,{data:{},error:new l.AuthError(m,{method:"signInWithOAuth"})}];case 3:return[2]}}))}))},e.prototype.getClaims=function(){return u(this,void 0,Promise,(function(){var t,e;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return t=r.sent().accessToken,[2,{data:(0,l.weAppJwtDecodeAll)(t),error:null}];case 2:return e=r.sent(),[2,{data:{},error:new l.AuthError(e,{method:"getClaims"})}];case 3:return[2]}}))}))},e.prototype.resetPasswordForEmail=function(t,e){return u(this,void 0,Promise,(function(){var r,n,i,o,s,a,h=this;return c(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this.validateParams({emailOrPhone:t},{emailOrPhone:{required:!0,message:"Email or phone is required"}}),r=(e||{}).redirectTo,n=t.includes("@"),i=void 0,n?i={email:t}:(o=this.formatPhone(t),i={phone_number:o}),[4,this.getVerification(i)];case 1:return s=d.sent(),[2,{data:{updateUser:function(e){return u(h,void 0,Promise,(function(){var i,o,a,u;return c(this,(function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:"Nonce is required"},password:{required:!0,message:"Password is required"}}),c.label=1;case 1:return c.trys.push([1,5,,6]),[4,this.verify({verification_id:s.verification_id,verification_code:e.nonce})];case 2:return i=c.sent(),[4,this.oauthInstance.authApi.resetPassword({email:n?t:void 0,phone_number:n?void 0:t,new_password:e.password,verification_token:i.verification_token})];case 3:return c.sent(),null===(u=this.config.eventBus)||void 0===u||u.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.PASSWORD_RECOVERY}),[4,this.signInWithPassword({email:n?t:void 0,phone:n?void 0:t,password:e.password})];case 4:return o=c.sent(),r&&y()&&window.location.assign(r),[2,o];case 5:return a=c.sent(),[2,{data:{},error:new l.AuthError(a,{method:"resetPasswordForEmail"})}];case 6:return[2]}}))}))}},error:null}];case 2:return a=d.sent(),[2,{data:{},error:new l.AuthError(a,{method:"resetPasswordForEmail"})}];case 3:return[2]}}))}))},e.prototype.resetPasswordForOld=function(t){return u(this,void 0,void 0,(function(){var e,r,n;return c(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.authApi.updatePasswordByOld({old_password:t.old_password,new_password:t.new_password})];case 1:return i.sent(),[4,this.getSession()];case 2:return e=i.sent().data,[2,{data:{user:(r=(void 0===e?{}:e).session).user,session:r},error:null}];case 3:return n=i.sent(),[2,{data:{},error:new l.AuthError(n,{method:"resetPasswordForOld"})}];case 4:return[2]}}))}))},e.prototype.verifyOtp=function(t){return u(this,void 0,Promise,(function(){var e,r,n,i;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,6,,7]),e=t.type,this.validateParams(t,{token:{required:!0,message:"Token is required"},messageId:{required:!0,message:"messageId is required"}}),["phone_change","email_change"].includes(e)?[4,this.verify({verification_id:t.messageId,verification_code:t.token})]:[3,2];case 1:return o.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:t.messageId,is_user:!0},verificationCode:t.token,username:t.email||this.formatPhone(t.phone)||"",loginType:t.email?"email":"phone"})];case 3:o.sent(),o.label=4;case 4:return[4,this.getSession()];case 5:return r=o.sent().data,[2,{data:{user:(n=(void 0===r?{}:r).session).user,session:n},error:null}];case 6:return i=o.sent(),[2,{data:{},error:new l.AuthError(i,{method:"verifyOtp"})}];case 7:return[2]}}))}))},e.prototype.getSession=function(){return u(this,void 0,Promise,(function(){var t,e,r,n;return c(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(t=i.sent())&&"accessKey"!==t.scope?[4,this.getUser(!1)]:[2,{data:{session:null},error:null}];case 2:return e=i.sent().data,r=(void 0===e?{}:e).user,[2,{data:{session:o(o({},t),{user:r}),user:r},error:null}];case 3:return n=i.sent(),[2,{data:{},error:new l.AuthError(n,{method:"getSession"})}];case 4:return[2]}}))}))},e.prototype.refreshSession=function(t){return u(this,void 0,Promise,(function(){var e,r,n,i,s;return c(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(e=a.sent()).refresh_token=t||e.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(e)];case 2:return r=a.sent(),[4,this.getUser(!1)];case 3:return n=a.sent().data,[2,{data:{user:i=(void 0===n?{}:n).user,session:o(o({},r),{user:i})},error:null}];case 4:return s=a.sent(),[2,{data:{},error:new l.AuthError(s,{method:"refreshSession"})}];case 5:return[2]}}))}))},e.prototype.getUser=function(t){return void 0===t&&(t=!0),u(this,void 0,Promise,(function(){var e,r;return c(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this.convertToUser,[4,this.getCurrentUser(t)];case 1:return[2,{data:{user:e.apply(this,[n.sent()])},error:null}];case 2:return r=n.sent(),[2,{data:{},error:new l.AuthError(r,{method:"getUser"})}];case 3:return[2]}}))}))},e.prototype.refreshUser=function(){return u(this,void 0,Promise,(function(){var t,e,r;return c(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.currentUser.refresh()];case 1:return n.sent(),[4,this.getSession()];case 2:return t=n.sent().data,[2,{data:{user:(e=(void 0===t?{}:t).session).user,session:e},error:null}];case 3:return r=n.sent(),[2,{data:{},error:new l.AuthError(r,{method:"refreshUser"})}];case 4:return[2]}}))}))},e.prototype.updateUser=function(t){var e;return u(this,void 0,Promise,(function(){var r,n,i,s,a,d,p,f,v,g,y,m,_=this;return c(this,(function(b){switch(b.label){case 0:if(b.trys.push([0,8,,9]),!Object.keys(t).some((function(e){return void 0!==t[e]&&null!==t[e]&&""!==t[e]})))throw new l.AuthError({message:"At least one field must be provided for update"});return r=t.email,n=t.phone,i=h(t,["email","phone"]),a=void 0!==n,d={},(s=void 0!==r)||a?(p=void 0,s?(p={email:t.email},f="email_change"):(v=this.formatPhone(t.phone),p={phone_number:v},f="phone_change"),[4,this.getVerification(p)]):[3,4];case 1:return g=b.sent(),Object.keys(i).length>0?[4,this.updateUserBasicInfo(i)]:[3,3];case 2:b.sent(),b.label=3;case 3:return d={messageId:g.verification_id,verifyOtp:function(e){return u(_,void 0,Promise,(function(){var r,n,i;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,11,,12]),e.email&&t.email===e.email?[4,this.verifyOtp({type:"email_change",email:t.email,token:e.token,messageId:g.verification_id})]:[3,3];case 1:return o.sent(),[4,this.updateUserBasicInfo({email:t.email})];case 2:return o.sent(),[3,9];case 3:return e.phone&&t.phone===e.phone?[4,this.verifyOtp({type:"phone_change",phone:t.phone,token:e.token,messageId:g.verification_id})]:[3,6];case 4:return o.sent(),[4,this.updateUserBasicInfo({phone:this.formatPhone(t.phone)})];case 5:return o.sent(),[3,9];case 6:return[4,this.verifyOtp({type:f,email:s?t.email:void 0,phone:s?void 0:t.phone,token:e.token,messageId:g.verification_id})];case 7:return o.sent(),[4,this.updateUserBasicInfo(t)];case 8:o.sent(),o.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=o.sent().data.user,null===(i=this.config.eventBus)||void 0===i||i.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.USER_UPDATED}),[2,{data:{user:r},error:null}];case 11:return n=o.sent(),[2,{data:{},error:new l.AuthError(n,{method:"updateUser"})}];case 12:return[2]}}))}))}},[3,6];case 4:return[4,this.updateUserBasicInfo(t)];case 5:b.sent(),b.label=6;case 6:return[4,this.getUser(!1)];case 7:return y=b.sent().data.user,null===(e=this.config.eventBus)||void 0===e||e.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.USER_UPDATED}),[2,{data:o({user:y},d),error:null}];case 8:return m=b.sent(),[2,{data:{},error:new l.AuthError(m,{method:"updateUser"})}];case 9:return[2]}}))}))},e.prototype.getUserIdentities=function(){var t;return u(this,void 0,Promise,(function(){var e,r;return c(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.oauthInstance.authApi.getProviders()];case 1:return e=n.sent(),[2,{data:{identities:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.filter((function(t){return!!t.bind}))},error:null}];case 2:return r=n.sent(),[2,{data:{},error:new l.AuthError(r,{method:"getUserIdentities"})}];case 3:return[2]}}))}))},e.prototype.linkIdentity=function(t){return u(this,void 0,Promise,(function(){var e;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.validateParams(t,{provider:{required:!0,message:"Provider is required"}}),[4,this.signInWithOAuth({provider:t.provider,options:{type:l.OAUTH_TYPE.BIND_IDENTITY}})];case 1:return r.sent(),[2,{data:{provider:t.provider},error:null}];case 2:return e=r.sent(),[2,{data:{},error:new l.AuthError(e,{method:"linkIdentity"})}];case 3:return[2]}}))}))},e.prototype.unlinkIdentity=function(t){return u(this,void 0,Promise,(function(){var e;return c(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.validateParams(t,{provider:{required:!0,message:"Provider is required"}}),[4,this.oauthInstance.authApi.unbindProvider({provider_id:t.provider})];case 1:return r.sent(),[2,{data:{},error:null}];case 2:return e=r.sent(),[2,{data:{},error:new l.AuthError(e,{method:"unlinkIdentity"})}];case 3:return[2]}}))}))},e.prototype.reauthenticate=function(){return u(this,void 0,Promise,(function(){var t,e,r,n,i=this;return c(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return t=s.sent().data.user,this.validateAtLeastOne(t,[["email","phone"]],"You must provide either an email or phone number"),e=t.email?{email:t.email}:{phone_number:this.formatPhone(t.phone)},[4,this.getVerification(e)];case 2:return r=s.sent(),[2,{data:{updateUser:function(t){return u(i,void 0,Promise,(function(){var n,i,s,a,u;return c(this,(function(c){switch(c.label){case 0:this.validateParams(t,{nonce:{required:!0,message:"Nonce is required"}}),c.label=1;case 1:return c.trys.push([1,9,,10]),t.password?[4,this.verify({verification_id:r.verification_id,verification_code:t.nonce})]:[3,5];case 2:return n=c.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:n.verification_token})];case 3:return i=c.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:t.password,sudo_token:i.sudo_token})];case 4:return c.sent(),[3,7];case 5:return[4,this.signInWithUsername(o(o({verificationInfo:r,verificationCode:t.nonce},e),{loginType:e.email?"email":"phone"}))];case 6:c.sent(),c.label=7;case 7:return[4,this.getSession()];case 8:return s=c.sent().data,[2,{data:{user:(a=(void 0===s?{}:s).session).user,session:a},error:null}];case 9:return u=c.sent(),[2,{data:{},error:new l.AuthError(u,{method:"reauthenticate"})}];case 10:return[2]}}))}))}},error:null}];case 3:return n=s.sent(),[2,{data:{},error:new l.AuthError(n,{method:"reauthenticate"})}];case 4:return[2]}}))}))},e.prototype.resend=function(t){return u(this,void 0,Promise,(function(){var e,r,n;return c(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.validateAtLeastOne(t,[["email"],["phone"]],"You must provide either an email or phone number"),e="signup"===t.type?"ANY":"USER",r={target:e},"email"in t&&(r.email=t.email),"phone"in t&&(r.phone_number=this.formatPhone(t.phone)),[4,this.oauthInstance.authApi.getVerification(r)];case 1:return[2,{data:{messageId:i.sent().verification_id},error:null}];case 2:return n=i.sent(),[2,{data:{},error:new l.AuthError(n,{method:"resend"})}];case 3:return[2]}}))}))},e.prototype.setSession=function(t){var e;return u(this,void 0,Promise,(function(){var r,n,i;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.validateParams(t,{access_token:{required:!0,message:"Access token is required"},refresh_token:{required:!0,message:"Refresh token is required"}}),[4,this.oauthInstance.oauth2client.refreshToken(t,{throwError:!0})];case 1:return o.sent(),[4,this.getSession()];case 2:return r=o.sent().data,n=(void 0===r?{}:r).session,null===(e=this.config.eventBus)||void 0===e||e.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.SIGNED_IN}),[2,{data:{user:n.user,session:n},error:null}];case 3:return i=o.sent(),[2,{data:{},error:new l.AuthError(i,{method:"setSession"})}];case 4:return[2]}}))}))},e.prototype.exchangeCodeForSession=function(){return u(this,void 0,void 0,(function(){return c(this,(function(t){return[2]}))}))},e.prototype.deleteUser=function(t){return u(this,void 0,Promise,(function(){var e,r;return c(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),this.validateParams(t,{password:{required:!0,message:"Password is required"}}),[4,this.oauthInstance.authApi.sudo(t)];case 1:return e=n.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:e})];case 2:return n.sent(),[2,{data:{},error:null}];case 3:return r=n.sent(),[2,{data:{},error:new l.AuthError(r,{method:"deleteUser"})}];case 4:return[2]}}))}))},e.prototype.toDefaultLoginPage=function(t){return void 0===t&&(t={}),u(this,void 0,Promise,(function(){var e,r,n,i,o;return c(this,(function(s){try{return e=t.config_version||"env",r=Object.keys(t.query||{}).map((function(e){return"".concat(e,"=").concat(t.query[e])})).join("&"),p.adapterForWxMp.isMatch()?wx.navigateTo({url:"/packages/$wd_system/pages/login/index".concat(r?"?".concat(r):"")}):(n=t.redirect_uri||window.location.href,i=new URL(n),o="".concat(i.origin,"/__auth/?app_id=").concat(t.app_id||"","&env_id=").concat(this.config.env,"&client_id=").concat(this.config.clientId||this.config.env,"&config_version=").concat(e,"&redirect_uri=").concat(encodeURIComponent(n)).concat(r?"&".concat(r):""),window.location.href=o),[2,{data:{},error:null}]}catch(t){return[2,{data:{},error:new l.AuthError(t,{method:"toDefaultLoginPage"})}]}return[2]}))}))},e.prototype.signInWithCustomTicket=function(t){return u(this,void 0,Promise,(function(){var e,r,n,i;return c(this,(function(s){switch(s.label){case 0:t&&this.setCustomSignFunc(t),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return s.sent(),[4,this.createLoginState()];case 3:return e=s.sent(),[4,this.getSession()];case 4:return r=s.sent().data,n=(void 0===r?{}:r).session,[2,o(o({},e),{data:{user:n.user,session:n},error:null})];case 5:return i=s.sent(),[2,{data:{},error:new l.AuthError(i,{method:"signInWithCustomTicket"})}];case 6:return[2]}}))}))},e.prototype.signInWithOpenId=function(t){var e=(void 0===t?{}:t).useWxCloud,r=void 0===e||e;return u(this,void 0,Promise,(function(){var t,e,n,i,s,a,h=this;return c(this,(function(d){switch(d.label){case 0:if(!p.adapterForWxMp.isMatch())throw Error("wx api undefined");t=wx.getAccountInfoSync().miniProgram,e=function(e){return u(h,void 0,void 0,(function(){var n,i;return c(this,(function(o){switch(o.label){case 0:n=void 0,i=void 0,o.label=1;case 1:return o.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==t?void 0:t.appId,provider_code:e,provider_params:{provider_code_type:"open_id",appid:null==t?void 0:t.appId}},r)];case 2:if((null==(n=o.sent())?void 0:n.error_code)||!n.provider_token)throw n;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:n.provider_token},r)];case 3:if(null==(i=o.sent())?void 0:i.error_code)throw i;return[3,5];case 4:throw o.sent();case 5:return[4,this.oauthInstance.oauth2client.setCredentials(i)];case 6:return o.sent(),[2]}}))}))},d.label=1;case 1:return d.trys.push([1,5,,6]),[4,new Promise((function(t,r){wx.login({success:function(n){return u(h,void 0,void 0,(function(){var i;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e(n.code)];case 1:return o.sent(),t(!0),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}))},fail:function(t){var e=new Error(null==t?void 0:t.errMsg);e.code=null==t?void 0:t.errno,r(e)}})}))];case 2:return d.sent(),[4,this.createLoginState()];case 3:return n=d.sent(),[4,this.getSession()];case 4:return i=d.sent().data,s=(void 0===i?{}:i).session,[2,o(o({},n),{data:{user:s.user,session:s},error:null})];case 5:return a=d.sent(),[2,{data:{},error:new l.AuthError(a,{method:"signInWithOpenId"})}];case 6:return[2]}}))}))},e.prototype.signInWithPhoneAuth=function(t){var e=t.phoneCode,r=void 0===e?"":e,n=t.useWxCloud,i=void 0!==n&&n;return u(this,void 0,Promise,(function(){var t,e,n,s,a,u,h,d,f;return c(this,(function(c){switch(c.label){case 0:return p.adapterForWxMp.isMatch()?(t=wx.getAccountInfoSync().miniProgram,e={provider_params:{provider_code_type:"phone",code:r,appid:t.appId},provider_id:t.appId},[4,wx.login()]):[2,{data:{},error:new l.AuthError({message:"wx api undefined"})}];case 1:n=c.sent().code,e.provider_code=n,c.label=2;case 2:return c.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(e,i)];case 3:if((s=c.sent()).error_code)throw s;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:s.provider_token},i)];case 4:if(null==(a=c.sent())?void 0:a.error_code)throw a;return[3,6];case 5:return u=c.sent(),[2,{data:{},error:new l.AuthError(u,{method:"signInWithPhoneAuth"})}];case 6:return[4,this.createLoginState()];case 7:return h=c.sent(),[4,this.getSession()];case 8:return d=c.sent().data,f=(void 0===d?{}:d).session,[2,o(o({},h),{data:{user:f.user,session:f},error:null})]}}))}))},e.prototype.bindPhoneNumber=function(t){return u(this,void 0,void 0,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.editContact(t)]}))}))},e.prototype.unbindProvider=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.unbindProvider(t)]}))}))},e.prototype.bindEmail=function(t){return this.oauthInstance.authApi.editContact(t)},e.prototype.verify=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.verify(t)]}))}))},e.prototype.getVerification=function(t,e){return u(this,void 0,Promise,(function(){return c(this,(function(r){return t.phone_number&&(t.phone_number=this.formatPhone(t.phone_number)),[2,this.oauthInstance.authApi.getVerification(t,e)]}))}))},Object.defineProperty(e.prototype,"currentUser",{get:function(){if("async"!==this.cache.mode){var t=this.hasLoginState();return t&&t.user||null}(0,p.printWarn)(p.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getCurrentUser instead")},enumerable:!1,configurable:!0}),e.prototype.getCurrentUser=function(t){return void 0===t&&(t=!0),u(this,void 0,Promise,(function(){var e,r,n;return c(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),t?[4,this.getLoginState()]:[3,3];case 1:return(e=i.sent())?[4,e.user.refresh()]:[3,3];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:return i.sent(),[3,5];case 5:return[4,this.getLoginState()];case 6:return(r=i.sent())?(n=r.user.getLocalUserInfo(),[4,r.user.checkLocalInfoAsync()]):[3,8];case 7:return i.sent(),[2,o(o({},r.user),n)];case 8:return[2,null]}}))}))},e.prototype.signInAnonymouslyInWx=function(t){var e=(void 0===t?{}:t).useWxCloud;return u(this,void 0,Promise,(function(){var t,r,n=this;return c(this,(function(i){switch(i.label){case 0:if(!p.adapterForWxMp.isMatch())throw Error("wx api undefined");return t=wx.getAccountInfoSync().miniProgram,r=function(r){return u(n,void 0,void 0,(function(){var n,i;return c(this,(function(o){switch(o.label){case 0:n=void 0,i=void 0,o.label=1;case 1:return o.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==t?void 0:t.appId,provider_code:r,provider_params:{provider_code_type:"open_id",appid:null==t?void 0:t.appId}},e)];case 2:if((null==(n=o.sent())?void 0:n.error_code)||!n.provider_token)throw n;return[4,this.oauthInstance.authApi.signInAnonymously({provider_token:n.provider_token},e)];case 3:if(null==(i=o.sent())?void 0:i.error_code)throw i;return[3,5];case 4:throw o.sent();case 5:return[2]}}))}))},[4,new Promise((function(t,e){wx.login({success:function(i){return u(n,void 0,void 0,(function(){var n;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,r(i.code)];case 1:return o.sent(),t(!0),[3,3];case 2:return n=o.sent(),e(n),[3,3];case 3:return[2]}}))}))},fail:function(t){var r=new Error(null==t?void 0:t.errMsg);r.code=null==t?void 0:t.errno,e(r)}})}))];case 1:return i.sent(),[2,this.createLoginState(void 0,{asyncRefreshUser:!0})]}}))}))},e.prototype.bindOpenId=function(){return u(this,void 0,Promise,(function(){var t,e,r=this;return c(this,(function(n){switch(n.label){case 0:if(!p.adapterForWxMp.isMatch())throw Error("wx api undefined");return t=wx.getAccountInfoSync().miniProgram,e=function(e){return u(r,void 0,void 0,(function(){var r;return c(this,(function(n){switch(n.label){case 0:r=void 0,n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:null==t?void 0:t.appId,provider_code:e,provider_params:{provider_code_type:"open_id",appid:null==t?void 0:t.appId}})];case 2:if((null==(r=n.sent())?void 0:r.error_code)||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.bindWithProvider({provider_token:r.provider_token})];case 3:return n.sent(),[3,5];case 4:throw n.sent();case 5:return[2]}}))}))},[4,new Promise((function(t,n){wx.login({success:function(i){return u(r,void 0,void 0,(function(){var r;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e(i.code)];case 1:return o.sent(),t(!0),[3,3];case 2:return r=o.sent(),n(r),[3,3];case 3:return[2]}}))}))},fail:function(t){var e=new Error(null==t?void 0:t.errMsg);e.code=null==t?void 0:t.errno,n(e)}})}))];case 1:return n.sent(),[2]}}))}))},e.prototype.signInWithUnionId=function(){return u(this,void 0,Promise,(function(){var t=this;return c(this,(function(e){switch(e.label){case 0:if(!p.adapterForWxMp.isMatch())throw Error("wx api undefined");e.label=1;case 1:return e.trys.push([1,3,,4]),[4,new Promise((function(e,r){var n=wx.getAccountInfoSync().miniProgram;wx.login({success:function(i){return u(t,void 0,void 0,(function(){var t,o,s,a,u;return c(this,(function(c){switch(c.label){case 0:t=null==n?void 0:n.appId,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_code:i.code,provider_id:t,provider_params:{provider_code_type:"union_id",appid:null==n?void 0:n.appId}})];case 2:return o=c.sent(),(s=o.provider_token)?[4,this.oauthInstance.authApi.signInWithProvider({provider_id:t,provider_token:s})]:(r(o),[2]);case 3:return(null==(a=c.sent())?void 0:a.error_code)?(r(a),[2]):(e(!0),[3,5]);case 4:return u=c.sent(),r(u),[3,5];case 5:return[2]}}))}))},fail:function(t){var e=new Error(null==t?void 0:t.errMsg);e.code=null==t?void 0:t.errno,r(e)}})}))];case 2:return e.sent(),[3,4];case 3:throw e.sent();case 4:return[2,this.createLoginState()]}}))}))},e.prototype.signInWithSms=function(t){var e=t.verificationInfo,r=void 0===e?{verification_id:"",is_user:!1}:e,n=t.verificationCode,i=void 0===n?"":n,o=t.phoneNum,s=void 0===o?"":o,a=t.bindInfo,h=void 0===a?void 0:a;return u(this,void 0,Promise,(function(){return c(this,(function(t){try{return[2,this.signInWithUsername({verificationInfo:r,verificationCode:i,bindInfo:h,username:s,loginType:"sms"})]}catch(t){throw t}return[2]}))}))},e.prototype.signInWithEmail=function(t){var e=t.verificationInfo,r=void 0===e?{verification_id:"",is_user:!1}:e,n=t.verificationCode,i=void 0===n?"":n,o=t.bindInfo,s=void 0===o?void 0:o,a=t.email,h=void 0===a?"":a;return u(this,void 0,Promise,(function(){return c(this,(function(t){try{return[2,this.signInWithUsername({verificationInfo:r,verificationCode:i,bindInfo:s,username:h,loginType:"email"})]}catch(t){throw t}return[2]}))}))},e.prototype.setCustomSignFunc=function(t){this.oauthInstance.authApi.setCustomSignFunc(t)},e.prototype.signIn=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.authApi.signIn(t)];case 1:return e.sent(),[2,this.createLoginState(t)]}}))}))},e.prototype.setPassword=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.setPassword(t)]}))}))},e.prototype.isUsernameRegistered=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return"string"!=typeof t&&(0,p.throwError)(p.ERRORS.INVALID_PARAMS,"username must be a string"),[4,this.oauthInstance.authApi.checkIfUserExist({username:t})];case 1:return[2,e.sent().exist]}}))}))},e.prototype.hasLoginState=function(){var t;if("async"!==this.cache.mode)return(null===(t=this.oauthInstance)||void 0===t?void 0:t.authApi.hasLoginStateSync())?new _({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,p.printWarn)(p.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getLoginState instead")},e.prototype.getLoginState=function(){return u(this,void 0,void 0,(function(){var t;return c(this,(function(e){switch(e.label){case 0:t=null,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.oauthInstance.authApi.getLoginState()];case 2:return t=e.sent(),[3,4];case 3:return e.sent(),[2,null];case 4:return t?[2,new _({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}}))}))},e.prototype.getUserInfo=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.getCurrentUser()]}))}))},e.prototype.getWedaUserInfo=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.oauthInstance.authApi.getWedaUserInfo()]}))}))},e.prototype.updateUserBasicInfo=function(t){return u(this,void 0,void 0,(function(){var e;return c(this,(function(r){switch(r.label){case 0:return[4,this.getLoginState()];case 1:return(e=r.sent())?[4,e.user.updateUserBasicInfo(t)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.getAuthHeader=function(){return console.error("Auth.getAuthHeader API 已废弃"),{}},e.prototype.bindWithProvider=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.bindWithProvider(t)]}))}))},e.prototype.queryUser=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.queryUserProfile(t)]}))}))},e.prototype.getAccessToken=function(){return u(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.getAccessToken()];case 1:return[2,{accessToken:t.sent(),env:this.config.env}]}}))}))},e.prototype.grantProviderToken=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.grantProviderToken(t)]}))}))},e.prototype.patchProviderToken=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.patchProviderToken(t)]}))}))},e.prototype.signInWithProvider=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(t)];case 1:return e.sent(),[2,this.createLoginState(t)]}}))}))},e.prototype.signInWithWechat=function(t){return void 0===t&&(t={}),u(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(t)];case 1:return e.sent(),[2,this.createLoginState(t)]}}))}))},e.prototype.grantToken=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.authApi.grantToken(t)];case 1:return e.sent(),[2,this.createLoginState()]}}))}))},e.prototype.genProviderRedirectUri=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.genProviderRedirectUri(t)]}))}))},e.prototype.resetPassword=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.resetPassword(t)]}))}))},e.prototype.deviceAuthorize=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.deviceAuthorize(t)]}))}))},e.prototype.sudo=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.sudo(t)]}))}))},e.prototype.deleteMe=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.deleteMe(t)]}))}))},e.prototype.getProviders=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.oauthInstance.authApi.getProviders()]}))}))},e.prototype.loginScope=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.oauthInstance.authApi.loginScope()]}))}))},e.prototype.loginGroups=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.oauthInstance.authApi.loginGroups()]}))}))},e.prototype.onLoginStateChanged=function(t){var e;return u(this,void 0,void 0,(function(){var r,n=this;return c(this,(function(i){switch(i.label){case 0:return null===(e=this.config.eventBus)||void 0===e||e.on(l.EVENTS.LOGIN_STATE_CHANGED,(function(e){return u(n,void 0,void 0,(function(){var r,n,i;return c(this,(function(s){switch(s.label){case 0:return(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.eventType)===l.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR?[3,2]:[4,this.getLoginState()];case 1:return n=s.sent(),[3,3];case 2:n={},s.label=3;case 3:return r=n,t.call(this,o(o({},e),r)),[2]}}))}))})),[4,this.getLoginState()];case 1:return r=i.sent(),t.call(this,r),[2]}}))}))},e.prototype.refreshTokenForce=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.refreshTokenForce(t)]}))}))},e.prototype.getCredentials=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.oauthInstance.authApi.getCredentials()]}))}))},e.prototype.setCredentials=function(t){return u(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(t)];case 1:return e.sent(),[2]}}))}))},e.prototype.getProviderSubType=function(){return u(this,void 0,Promise,(function(){return c(this,(function(t){return[2,this.oauthInstance.authApi.getProviderSubType()]}))}))},e.prototype.createCaptchaData=function(t){return u(this,void 0,void 0,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.createCaptchaData(t)]}))}))},e.prototype.verifyCaptchaData=function(t){return u(this,void 0,void 0,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.verifyCaptchaData(t)]}))}))},e.prototype.getMiniProgramQrCode=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.getMiniProgramCode(t)]}))}))},e.prototype.getMiniProgramQrCodeStatus=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(t)]}))}))},e.prototype.modifyPassword=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.modifyPassword(t)]}))}))},e.prototype.modifyPasswordWithoutLogin=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(t)]}))}))},e.prototype.getUserBehaviorLog=function(t){return u(this,void 0,Promise,(function(){return c(this,(function(e){return[2,this.oauthInstance.authApi.getUserBehaviorLog(t)]}))}))},e.prototype.signInWithUsername=function(t){var e=t.verificationInfo,r=void 0===e?{verification_id:"",is_user:!1}:e,n=t.verificationCode,i=void 0===n?"":n,s=t.username,a=void 0===s?"":s,h=t.bindInfo,l=void 0===h?void 0:h,d=t.loginType,p=void 0===d?"":d;return u(this,void 0,Promise,(function(){var t,e,n,s,u,h,d;return c(this,(function(c){switch(c.label){case 0:return c.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:r.verification_id,verification_code:i})];case 1:if(null==(t=c.sent())?void 0:t.error_code)throw t;return e=t.verification_token,n=this.formatPhone(a),s={phone_number:n},"email"===p&&(s={email:n=a}),r.is_user?[4,this.oauthInstance.authApi.signIn({username:n,verification_token:e})]:[3,5];case 2:if(null==(u=c.sent())?void 0:u.error_code)throw u;return l?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:null==l?void 0:l.providerToken})]:[3,4];case 3:if(null==(h=c.sent())?void 0:h.error_code)throw h;c.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(o(o({},s),{verification_token:e,provider_token:null==l?void 0:l.providerId}))];case 6:if(null==(d=c.sent())?void 0:d.error_code)throw d;c.label=7;case 7:return[2,this.createLoginState()];case 8:throw c.sent();case 9:return[2]}}))}))},e.prototype.createLoginState=function(t,e){var r,n;return u(this,void 0,Promise,(function(){var i;return c(this,(function(o){switch(o.label){case 0:return[4,(i=new _({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return o.sent(),(null==e?void 0:e.userInfo)?(i.user.setLocalUserInfo(e.userInfo),[3,5]):[3,2];case 2:return(null==e?void 0:e.asyncRefreshUser)?(i.user.refresh(t),[3,5]):[3,3];case 3:return[4,i.user.refresh(t)];case 4:o.sent(),o.label=5;case 5:return null===(r=this.config.eventBus)||void 0===r||r.fire(l.EVENTS.LOGIN_STATE_CHANGED,{eventType:l.LOGIN_STATE_CHANGED_TYPE.SIGN_IN}),null===(n=this.config.eventBus)||void 0===n||n.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.SIGNED_IN}),[2,i]}}))}))},e.prototype.setAccessKey=function(){var t,e;return u(this,void 0,void 0,(function(){var r,n;return c(this,(function(i){if(r="",n="",this.config.accessKey?(r=this.config.accessKey,n="accessKey"):(null===(t=this.config.auth)||void 0===t?void 0:t.secretId)&&(null===(e=this.config.auth)||void 0===e?void 0:e.secretKey)&&(r="",n=l.DEFAULT_NODE_ACCESS_SCOPE),!n)return[2];try{this.oauthInstance.oauth2client.setAccessKeyCredentials({access_token:r,token_type:"Bearer",scope:n,expires_at:new Date(+new Date+ +new Date),expires_in:+new Date+ +new Date})}catch(t){console.warn("accessKey error: ",t)}return[2]}))}))},e.prototype.formatPhone=function(t){return!/\s+/.test(t)&&/^\+\d{1,3}\d+/.test(t)?t.replace(/^(\+\d{1,2})(\d+)$/,"$1 $2"):/^\+\d{1,3}\s+/.test(t)?t:"+86 ".concat(t)},e.prototype.notifyListeners=function(t,e,r){this.listeners.forEach((function(n){n.forEach((function(n){try{n(t,e,r)}catch(t){console.error("Error in auth state change callback:",t)}}))}))},e.prototype.setupListeners=function(){var t,e=this;null===(t=this.config.eventBus)||void 0===t||t.on(l.EVENTS.AUTH_STATE_CHANGED,(function(t){return u(e,void 0,void 0,(function(){var e,r,n,i,o;return c(this,(function(s){switch(s.label){case 0:return e=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.event,r=null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.info,[4,this.getSession()];case 1:return n=s.sent().data.session,this.notifyListeners(e,n,r),[2]}}))}))}))},e.prototype.convertToUser=function(t){var e,r,n,i,o,s;if(!t)return null;var a=(null==t?void 0:t.email)||"",u=(null==t?void 0:t.phone_number)||"",c=(null==t?void 0:t.sub)||(null==t?void 0:t.uid)||"";return{id:c,aud:"authenticated",role:null===(r=null===(e=t.groups)||void 0===e?void 0:e.map)||void 0===r?void 0:r.call(e,(function(t){return"string"==typeof t?t:t.id})),email:a||"",email_confirmed_at:(null==t||t.email_verified,t.created_at),phone:u,phone_confirmed_at:u?t.created_at:void 0,confirmed_at:t.created_at,last_sign_in_at:t.last_sign_in_at,app_metadata:{provider:(null===(n=t.loginType)||void 0===n?void 0:n.toLowerCase())||"cloudbase",providers:[(null===(i=t.loginType)||void 0===i?void 0:i.toLowerCase())||"cloudbase"]},user_metadata:{name:null==t?void 0:t.name,picture:null==t?void 0:t.picture,username:null==t?void 0:t.username,gender:null==t?void 0:t.gender,locale:null==t?void 0:t.locale,uid:t.uid,nickName:t.nickName||(null==t?void 0:t.name),avatarUrl:t.avatarUrl||t.picture,location:t.location,hasPassword:null!==(o=t.hasPassword)&&void 0!==o?o:"SET"===t.password,open_id:null==t?void 0:t.open_id},identities:(null===(s=null==t?void 0:t.providers)||void 0===s?void 0:s.map((function(e){return{id:e.id||"",identity_id:e.id||"",user_id:c,identity_data:{provider_id:e.id,provider_user_id:e.provider_user_id,name:e.name},provider:e.id||"cloudbase",created_at:t.created_at,updated_at:t.updated_at,last_sign_in_at:t.last_sign_in_at}})))||[],created_at:t.created_at,updated_at:t.updated_at,is_anonymous:"anonymous"===t.name}},e.prototype.validateParams=function(t,e){for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],s=i[1];if(s.required&&(void 0===(null==t?void 0:t[o])||null===(null==t?void 0:t[o])||""===(null==t?void 0:t[o])))throw new l.AuthError({message:s.message})}},e.prototype.validateAtLeastOne=function(t,e,r){if(!e.some((function(e){return e.some((function(e){return void 0!==(null==t?void 0:t[e])&&null!==(null==t?void 0:t[e])&&""!==(null==t?void 0:t[e])}))})))throw new l.AuthError({message:r})},e.prototype.init=function(){var t;return u(this,void 0,Promise,(function(){return c(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return e.sent()&&(null===(t=this.config.eventBus)||void 0===t||t.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.INITIAL_SESSION})),[3,3];case 2:return e.sent(),[3,3];case 3:return[2,{error:null}]}}))}))},s([(0,p.catchErrorsDecorator)({title:"绑定手机号失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确"," 2 - 当前环境是否开通了短信验证码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(r=void 0!==l.authModels&&l.authModels.BindPhoneRequest)?r:Object]),a("design:returntype",Promise)],e.prototype,"bindPhoneNumber",null),s([(0,p.catchErrorsDecorator)({title:"解除三方绑定失败",messages:["请确认以下各项:"," 1 - 调用 auth().unbindProvider() 的语法或参数是否正确"," 2 - 当前账户是否已经与此登录方式解绑","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(n=void 0!==l.authModels&&l.authModels.UnbindProviderRequest)?n:Object]),a("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],e.prototype,"unbindProvider",null),s([(0,p.catchErrorsDecorator)({title:"绑定邮箱地址失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindEmail() 的语法或参数是否正确"," 2 - 当前环境是否开通了邮箱密码登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(v=void 0!==l.authModels&&l.authModels.BindEmailRequest)?v:Object]),a("design:returntype",void 0)],e.prototype,"bindEmail",null),s([(0,p.catchErrorsDecorator)({title:"验证码验证失败",messages:["请确认以下各项:"," 1 - 调用 auth().verify() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(m=void 0!==l.authModels&&l.authModels.VerifyRequest)?m:Object]),a("design:returntype","function"==typeof(b="undefined"!=typeof Promise&&Promise)?b:Object)],e.prototype,"verify",null),s([(0,p.catchErrorsDecorator)({title:"获取验证码失败",messages:["请确认以下各项:"," 1 - 调用 auth().getVerification() 的语法或参数是否正确"," 2 - 当前环境是否开通了手机验证码/邮箱登录","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(E=void 0!==l.authModels&&l.authModels.GetVerificationRequest)?E:Object,Object]),a("design:returntype","function"==typeof(I="undefined"!=typeof Promise&&Promise)?I:Object)],e.prototype,"getVerification",null),s([(0,p.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype","function"==typeof(w="undefined"!=typeof Promise&&Promise)?w:Object)],e.prototype,"getCurrentUser",null),s([(0,p.catchErrorsDecorator)({title:"小程序匿名登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了匿名登录"," 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype","function"==typeof(A="undefined"!=typeof Promise&&Promise)?A:Object)],e.prototype,"signInAnonymouslyInWx",null),s([(0,p.catchErrorsDecorator)({title:"小程序绑定OpenID失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序openId静默登录"," 2 - 调用 auth().bindOpenId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype","function"==typeof(S="undefined"!=typeof Promise&&Promise)?S:Object)],e.prototype,"bindOpenId",null),s([(0,p.catchErrorsDecorator)({title:"小程序unionId静默登录失败",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序unionId静默登录"," 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype","function"==typeof(T="undefined"!=typeof Promise&&Promise)?T:Object)],e.prototype,"signInWithUnionId",null),s([(0,p.catchErrorsDecorator)({title:"短信验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了小程序短信验证码登陆"," 2 - 调用 auth().signInWithSms() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype","function"==typeof(P="undefined"!=typeof Promise&&Promise)?P:Object)],e.prototype,"signInWithSms",null),s([(0,p.catchErrorsDecorator)({title:"邮箱验证码登陆",messages:["请确认以下各项:"," 1 - 当前环境是否开启了邮箱登陆"," 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype","function"==typeof(O="undefined"!=typeof Promise&&Promise)?O:Object)],e.prototype,"signInWithEmail",null),s([(0,p.catchErrorsDecorator)({title:"获取用户是否被占用失败",messages:["请确认以下各项:"," 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype","function"==typeof(R="undefined"!=typeof Promise&&Promise)?R:Object)],e.prototype,"isUsernameRegistered",null),s([(0,p.catchErrorsDecorator)({title:"获取本地登录态失败",messages:["请确认以下各项:"," 1 - 调用 auth().getLoginState() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],e.prototype,"getLoginState",null),s([(0,p.catchErrorsDecorator)({title:"获取用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype","function"==typeof(C="undefined"!=typeof Promise&&Promise)?C:Object)],e.prototype,"getUserInfo",null),s([(0,p.catchErrorsDecorator)({title:"获取微搭插件用户信息失败",messages:["请确认以下各项:"," 1 - 是否已登录"," 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype","function"==typeof(U="undefined"!=typeof Promise&&Promise)?U:Object)],e.prototype,"getWedaUserInfo",null),s([(0,p.catchErrorsDecorator)({title:"绑定第三方登录方式失败",messages:["请确认以下各项:"," 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确"," 2 - 此账户是否已经绑定此第三方","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",["function"==typeof(N=void 0!==l.authModels&&l.authModels.BindWithProviderRequest)?N:Object]),a("design:returntype","function"==typeof(D="undefined"!=typeof Promise&&Promise)?D:Object)],e.prototype,"bindWithProvider",null),s([(0,p.catchErrorsDecorator)({title:"获取身份源类型",messages:["请确认以下各项:"," 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(p.COMMUNITY_SITE_URL)]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype","function"==typeof(L="undefined"!=typeof Promise&&Promise)?L:Object)],e.prototype,"getProviderSubType",null),e}(v.AuthV1Compat);function E(t,e){var r,n,i,s,a=this,h=t.region,f=void 0===h?"ap-shanghai":h,v=t.i18n,g=t.accessKey,y=t.useWxCloud,m=(null==e?void 0:e.platform)||p.useDefaultAdapter.bind(e)(),_=m.runtime,E=m.adapter,I=e||{},w=I.env,A=I.clientId,S=I.debug,T=I.cache,P=I.app,O=(e||{}).apiOrigin;O||(O="https://".concat(w,".").concat(f,".tcb-api.tencentcloudapi.com"));var R,C={env:w,clientId:A,i18n:v,accessKey:g,useWxCloud:y,eventBus:new p.CloudbaseEventEmitter},U=new l.CloudbaseOAuth((0,d.useAuthAdapter)(o(o({},C),{apiOrigin:O,apiPath:(null==t?void 0:t.apiPath)||l.AUTH_API_PREFIX,storage:null==t?void 0:t.storage,baseRequest:null==t?void 0:t.baseRequest,request:null==t?void 0:t.request,anonymousSignInFunc:null==t?void 0:t.anonymousSignInFunc,captchaOptions:null==t?void 0:t.captchaOptions,wxCloud:null==t?void 0:t.wxCloud,adapter:E,onCredentialsError:(R=C.eventBus,function(t){R.fire(l.EVENTS.LOGIN_STATE_CHANGED,o(o({},t),{eventType:l.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR}))}),headers:o({"X-SDK-Version":"@cloudbase/js-sdk/".concat(t.sdkVersion)},t.headers||{}),detectSessionInUrl:t.detectSessionInUrl,debug:S,auth:null===(n=null===(r=e.app)||void 0===r?void 0:r.config)||void 0===n?void 0:n.auth}))),N=new b(o(o({},C),{region:f,persistence:t.persistence,debug:S,cache:T||new p.CloudbaseCache({persistence:t.persistence,keys:{userInfoKey:"user_info_".concat(w)},platformInfo:m}),runtime:_||"web",_fromApp:P,oauthInstance:U,auth:null===(s=null===(i=e.app)||void 0===i?void 0:i.config)||void 0===s?void 0:s.auth}));return U.initializeSession((function(t,e){return u(a,void 0,void 0,(function(){return c(this,(function(r){return t?(t.type===l.OAUTH_TYPE.SIGN_IN?e?C.eventBus.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.SIGNED_IN,info:o(o({},t),{error:e})}):t.user&&N.createLoginState({},{userInfo:t.user}):t.type===l.OAUTH_TYPE.BIND_IDENTITY&&C.eventBus.fire(l.EVENTS.AUTH_STATE_CHANGED,{event:l.AUTH_STATE_CHANGED_TYPE.BIND_IDENTITY,info:o(o({},t),{error:e})}),[2]):[2]}))}))})),{authInstance:N,oauthInstance:U}}e.Auth=b,e.generateAuthInstance=E;var I="auth";function w(t,e){for(var r=[],n=0;n<=t.length;n++)r[n]=[n];for(var i=0;i<=e.length;i++)r[0][i]=i;for(n=1;n<=t.length;n++)for(i=1;i<=e.length;i++){var o=t[n-1].toLowerCase()===e[i-1].toLowerCase()?0:1;r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o)}return r[t.length][e.length]}var A={name:"auth",namespace:I,entity:function(t){var e=function(t){var e;if(this.authInstance&&!t)return this.authInstance;t=t||{region:"",persistence:"local",apiPath:l.AUTH_API_PREFIX};var r=this.platform.adapter,n=t.persistence||r.primaryStorage;n&&n!==this.config.persistence&&this.updateConfig({persistence:n});var i=E(o(o({wxCloud:this.config.wxCloud,storage:this.config.storage},t),{persistence:this.config.persistence,i18n:this.config.i18n,accessKey:this.config.accessKey,useWxCloud:this.config.useWxCloud,sdkVersion:this.version,detectSessionInUrl:null===(e=this.config.auth)||void 0===e?void 0:e.detectSessionInUrl}),{env:this.config.env,clientId:this.config.clientId,apiOrigin:this.request.getBaseEndPoint(this.config.endPointMode||"CLOUD_API"),platform:this.platform,cache:this.cache,app:this,debug:this.config.debug}),s=i.authInstance,a=i.oauthInstance;return this.oauthInstance=a,this.authInstance=s,this.authInstance},r=e.call(this,t);Object.assign(e,r),Object.setPrototypeOf(e,Object.getPrototypeOf(r));var n="undefined"!=typeof Proxy?new Proxy(e,{get:function(t,e,r){var n=Reflect.get(t,e,r);if(void 0!==n||"string"!=typeof e)return n;var i=function(t,e){for(var r=null,n=1/0,i=0,o=e;i<o.length;i++){var s=o[i];if(!s.startsWith("_")&&"constructor"!==s){var a=w(t,s);a<n&&(n=a,r=s)}}return r}(e,Object.getOwnPropertyNames(Object.getPrototypeOf(t)).concat(Object.keys(t)).filter((function(e){return"function"==typeof t[e]})));return i&&console.warn("[CloudBase Auth] auth.".concat(e," is not a function. Did you mean: auth.").concat(i,"() ?")),n}}):e;return this[I]=n,n}};try{cloudbase.registerComponent(A)}catch(t){}var S=r(722);Object.defineProperty(e,"AuthErrorCategory",{enumerable:!0,get:function(){return S.AuthErrorCategory}}),Object.defineProperty(e,"AuthError",{enumerable:!0,get:function(){return S.AuthError}}),e.registerAuth=function(t){try{t.registerComponent(A)}catch(t){console.warn(t)}}},19:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.adapterForWxMp=e.CloudbaseCache=e.CloudbaseEventEmitter=e.catchErrorsDecorator=e.COMMUNITY_SITE_URL=e.ERRORS=e.throwError=e.printWarn=void 0;var i=r(616);Object.defineProperty(e,"printWarn",{enumerable:!0,get:function(){return i.printWarn}}),Object.defineProperty(e,"throwError",{enumerable:!0,get:function(){return i.throwError}});var o=r(794);Object.defineProperty(e,"ERRORS",{enumerable:!0,get:function(){return o.ERRORS}}),Object.defineProperty(e,"COMMUNITY_SITE_URL",{enumerable:!0,get:function(){return o.COMMUNITY_SITE_URL}});var s=r(141);Object.defineProperty(e,"catchErrorsDecorator",{enumerable:!0,get:function(){return s.catchErrorsDecorator}});var a=r(689);Object.defineProperty(e,"CloudbaseEventEmitter",{enumerable:!0,get:function(){return a.CloudbaseEventEmitter}});var u=r(197);Object.defineProperty(e,"CloudbaseCache",{enumerable:!0,get:function(){return u.CloudbaseCache}});var c=r(917);Object.defineProperty(e,"adapterForWxMp",{enumerable:!0,get:function(){return n(c).default}});var h=r(182);Object.defineProperty(e,"useDefaultAdapter",{enumerable:!0,get:function(){return h.useDefaultAdapter}})},266:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.removeUrlParams=e.addUrlSearch=e.removeBrowserSession=e.getBrowserSession=e.saveToBrowserSession=void 0,e.saveToBrowserSession=function(t,e){try{sessionStorage.setItem(t,JSON.stringify(e))}catch(t){console.error("Failed to save to browser session:",t)}},e.getBrowserSession=function(t){try{return JSON.parse(sessionStorage.getItem(t))}catch(t){return console.error("Failed to get browser session:",t),null}},e.removeBrowserSession=function(t){try{return sessionStorage.removeItem(t),!0}catch(t){return console.error("Failed to remove browser session:",t),null}},e.addUrlSearch=function(t,e){if(void 0!==t){var r=new URL(window.location.href);return r.search=t,r.hash=e||r.hash,window.history.replaceState({},"",r.href),r.href}},e.removeUrlParams=function(t){if("undefined"!=typeof window)try{var e=new URL(window.location.href);t.forEach((function(t){e.searchParams.delete(t)})),window.history.replaceState({},"",e.href)}catch(t){console.error("Failed to remove URL params:",t)}}},916:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyUserV1Compat=e.AuthV1Compat=e.AnonymousAuthProvider=e.CustomAuthProvider=e.WeixinAuthProvider=void 0;var s=r(722),a=r(19),u=function(){function t(t){}return t.prototype.signInWithRedirect=function(){throw new Error("[v1 兼容] WeixinAuthProvider.signInWithRedirect() 在当前版本中无法实现。 建议使用 auth.signInWithOAuth({ provider: 'providerId' }) 替代。")},t.prototype.getRedirectResult=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(t){throw new Error("[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。")}))}))},t.prototype.getLinkRedirectResult=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(t){throw new Error("[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")}))}))},t}();e.WeixinAuthProvider=u;var c=function(){function t(t){this.authInstance=t.authInstance}return t.prototype.signIn=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.authInstance.signInWithCustomTicket((function(){return Promise.resolve(t)}))];case 1:return e.sent(),[2]}}))}))},t}();e.CustomAuthProvider=c;var h=function(){function t(t){this.authInstance=t.authInstance}return t.prototype.signIn=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return t.sent(),[2]}}))}))},t}();e.AnonymousAuthProvider=h;var l=function(){function t(){}return t.prototype.weixinAuthProvider=function(t){return new u({authInstance:this,appid:t.appid,scope:t.scope})},t.prototype.customAuthProvider=function(){return new c({authInstance:this})},t.prototype.anonymousAuthProvider=function(){return new h({authInstance:this})},t.prototype.signUpWithEmailAndPassword=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(r){switch(r.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof e&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signUp({email:t,password:e})];case 1:return[2,r.sent()]}}))}))},t.prototype.signInWithEmailAndPassword=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(r){switch(r.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"email must be a string"),"string"!=typeof e&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signIn({username:t,password:e})];case 1:return r.sent(),[2,this.createLoginState()]}}))}))},t.prototype.sendPasswordResetEmail=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){switch(e.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"email must be a string"),[4,this.getVerification({email:t})];case 1:return e.sent(),[2]}}))}))},t.prototype.signInWithUsernameAndPassword=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(r){switch(r.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"username must be a string"),"string"!=typeof e&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"password must be a string"),[4,this.signIn({username:t,password:e})];case 1:return r.sent(),[2,this.createLoginState()]}}))}))},t.prototype.sendPhoneCode=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),e=this.formatPhone(t),[4,this.getVerification({phone_number:e})];case 1:return r.sent(),[2,!0]}}))}))},t.prototype.signUpWithPhoneCode=function(t,e,r){return i(this,void 0,Promise,(function(){var i;return o(this,(function(o){switch(o.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof e&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),i=this.formatPhone(t),[4,this.signUp(n({phone_number:i,verification_code:e},r?{password:r}:{}))];case 1:return o.sent(),[2,this.createLoginState()]}}))}))},t.prototype.signInWithPhoneCodeOrPassword=function(t){return i(this,void 0,Promise,(function(){var e,r,n,i;return o(this,(function(o){switch(o.label){case 0:return e=t.phoneNumber,r=t.phoneCode,n=t.password,"string"!=typeof e&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),i=this.formatPhone(e),n?[4,this.signIn({username:i,password:n})]:[3,2];case 1:return o.sent(),[3,5];case 2:return r?[4,this.signIn({username:i,verification_token:r})]:[3,4];case 3:return o.sent(),[3,5];case 4:(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneCode or password must be provided"),o.label=5;case 5:return[2,this.createLoginState()]}}))}))},t.prototype.forceResetPwdByPhoneCode=function(t){return i(this,void 0,Promise,(function(){var e,r,n,i;return o(this,(function(o){switch(o.label){case 0:return e=t.phoneNumber,r=t.phoneCode,n=t.password,"string"!=typeof e&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneNumber must be a string"),"string"!=typeof r&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"phoneCode must be a string"),"string"!=typeof n&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"password must be a string"),i=this.formatPhone(e),[4,this.resetPassword({phone_number:i,new_password:n,verification_token:r})];case 1:return o.sent(),[4,this.signIn({username:i,password:n})];case 2:return o.sent(),[2,this.createLoginState()]}}))}))},t.prototype.shouldRefreshAccessToken=function(t){throw new Error("[v1 兼容] shouldRefreshAccessToken() 在当前版本中无法实现。 建议使用 auth.onAuthStateChange(callback) 来监听 TOKEN_REFRESHED 事件替代。")},t.prototype.onLoginStateExpired=function(t){var e=this;this.onLoginStateChanged((function(r){(null==r?void 0:r.eventType)===s.LOGIN_STATE_CHANGED_TYPE.CREDENTIALS_ERROR&&t.call(e)}))},t.prototype.onAccessTokenRefreshed=function(t){var e=this;this.onAuthStateChange((function(r){r===s.AUTH_STATE_CHANGED_TYPE.TOKEN_REFRESHED&&t.call(e)}))},t.prototype.onAnonymousConverted=function(t){var e=this;this.onAuthStateChange((function(r){r===s.AUTH_STATE_CHANGED_TYPE.SIGNED_IN&&t.call(e)}))},t.prototype.onLoginTypeChanged=function(t){var e=this;this.onAuthStateChange((function(r){r!==s.AUTH_STATE_CHANGED_TYPE.SIGNED_IN&&r!==s.AUTH_STATE_CHANGED_TYPE.SIGNED_OUT||t.call(e)}))},t}();e.AuthV1Compat=l,e.applyUserV1Compat=function(t){t.prototype.linkWithTicket=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(t){throw new Error("[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。")}))}))},t.prototype.linkWithRedirect=function(t){throw new Error("[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。")},t.prototype.updateEmail=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(e){switch(e.label){case 0:return"string"!=typeof t&&(0,a.throwError)(a.ERRORS.INVALID_PARAMS,"newEmail must be a string"),[4,this.updateUserBasicInfo({email:t})];case 1:return e.sent(),[2]}}))}))},t.prototype.linkWithPhoneNumber=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(t){throw new Error("[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。")}))}))},t.prototype.updatePhoneNumber=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(t){throw new Error("[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。")}))}))},t.prototype.unlink=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(t){throw new Error("[v1 兼容] User.unlink() 在当前版本中无法实现。 建议使用 auth.unlinkIdentity({ provider: loginType }) 替代。")}))}))}}},304:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAuth=void 0;var n=r(895);e.registerAuth=n.registerAuth;try{window.registerAuth=e.registerAuth}catch(t){}},413:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},s=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Auth=void 0;var u=r(949),c=r(257),h=r(462),l=r(631),d=a(r(639)),p=r(308);function f(t,e){var n;return i(this,void 0,void 0,(function(){var s,a=this;return o(this,(function(u){s=function(){return i(a,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,1,,6]),[2,r(814)];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,Promise.resolve().then(r.t.bind(r,814,23))];case 3:return[2,t.sent()];case 4:return t.sent(),[2];case 5:return[3,6];case 6:return[2]}}))}))};try{if(((null===(n=null==e?void 0:e.root)||void 0===n?void 0:n.globalThis)||globalThis).IS_MP_BUILD)return[2];if(t)return[2,s()]}catch(e){if(t)return[2,s()]}return[2]}))}))}var v=function(){function t(t){var e=t.request,r=t.credentialsClient;if(!r){var i={apiOrigin:t.apiOrigin,apiPath:t.apiPath,clientId:t.clientId,storage:t.storage,env:t.env,baseRequest:t.baseRequest,anonymousSignInFunc:t.anonymousSignInFunc,wxCloud:t.wxCloud,onCredentialsError:t.onCredentialsError,headers:t.headers||{},i18n:t.i18n,debug:t.debug};r=new c.OAuth2Client(i)}if(!e){var o=r.request.bind(r),s=new h.Captcha(n({env:t.env,clientId:t.clientId,request:o,storage:t.storage,adapter:t.adapter,oauthInstance:this},t.captchaOptions));e=s.request.bind(s)}this.config={env:t.env,apiOrigin:t.apiOrigin,apiPath:t.apiPath,clientId:t.clientId,request:e,credentialsClient:r,storage:t.storage||c.defaultStorage,adapter:t.adapter}}return t.parseParamsToSearch=function(t){return Object.keys(t).forEach((function(e){t[e]||delete t[e]})),new d.default(t).toString()},t.prototype.getParamsByVersion=function(t,e){var r,n=(0,l.deepClone)(t),i=(null===(r={v2:u.ApiUrlsV2}[null==n?void 0:n.version])||void 0===r?void 0:r[e])||u.ApiUrls[e];return n&&delete n.version,{params:n,url:i}},t.prototype.signIn=function(t){return i(this,void 0,Promise,(function(){var e,r,i,s;return o(this,(function(o){switch(o.label){case 0:return e=t.version||"v1",(r=this.getParamsByVersion(t,"AUTH_SIGN_IN_URL")).params.query&&delete r.params.query,[4,this.getEncryptParams(r.params)];case 1:return i=o.sent(),[4,this.config.request(r.url,{method:"POST",body:i})];case 2:return s=o.sent(),[4,this.config.credentialsClient.setCredentials(n(n({},s),{version:e}))];case 3:return o.sent(),[2,Promise.resolve(s)]}}))}))},t.prototype.signInAnonymously=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!1),i(this,void 0,Promise,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return[4,this.config.request(u.ApiUrls.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:t,useWxCloud:e})];case 1:return r=n.sent(),[4,this.config.credentialsClient.setCredentials(r)];case 2:return n.sent(),[2,Promise.resolve(r)]}}))}))},t.prototype.signUp=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.config.request(u.ApiUrls.AUTH_SIGN_UP_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signOut=function(t){return i(this,void 0,Promise,(function(){var e,r,n,i;return o(this,(function(o){switch(o.label){case 0:if(e={},!t)return[3,6];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.config.request(u.ApiUrls.AUTH_SIGNOUT_URL,{method:"POST",withCredentials:!0,body:t})];case 2:return e=o.sent(),[3,4];case 3:return(r=o.sent()).error!==u.ErrorType.UNAUTHENTICATED&&console.log("sign_out_error",r),[3,4];case 4:return[4,this.config.credentialsClient.setCredentials()];case 5:return o.sent(),[2,e];case 6:return[4,this.config.credentialsClient.getAccessToken()];case 7:return n=o.sent(),[4,this.config.request(u.ApiUrls.AUTH_REVOKE_URL,{method:"POST",body:{token:n}})];case 8:return i=o.sent(),[4,this.config.credentialsClient.setCredentials()];case 9:return o.sent(),[2,Promise.resolve(i)]}}))}))},t.prototype.revokeAllDevices=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.config.request(u.ApiUrls.AUTH_REVOKE_ALL_URL,{method:"DELETE",withCredentials:!0})];case 1:return t.sent(),[2]}}))}))},t.prototype.revokeDevice=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.config.request(u.ApiUrls.AUTHORIZED_DEVICES_DELETE_URL+t.device_id,{method:"DELETE",withCredentials:!0})];case 1:return e.sent(),[2]}}))}))},t.prototype.getVerification=function(t,e){return i(this,void 0,Promise,(function(){var r,n;return o(this,(function(i){switch(i.label){case 0:return r=!1,"CUR_USER"!==t.target?[3,1]:(r=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:i.sent()&&(r=!0),i.label=3;case 3:return(n=(0,l.deepClone)(t)).phone_number&&!/^\+\d{1,3}\s+\d+/.test(n.phone_number)&&(n.phone_number="+86 ".concat(n.phone_number)),[2,this.config.request(u.ApiUrls.VERIFICATION_URL,{method:"POST",body:n,withCaptcha:(null==e?void 0:e.withCaptcha)||!1,withCredentials:r})]}}))}))},t.prototype.verify=function(t){return i(this,void 0,Promise,(function(){var e,r;return o(this,(function(i){switch(i.label){case 0:return e=this.getParamsByVersion(t,"VERIFY_URL"),[4,this.config.request(e.url,{method:"POST",body:e.params})];case 1:return r=i.sent(),"v2"!==(null==t?void 0:t.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(n(n({},r),{version:"v2"}))];case 2:i.sent(),i.label=3;case 3:return[2,r]}}))}))},t.prototype.genProviderRedirectUri=function(e){return i(this,void 0,Promise,(function(){var r,n,i,a,c;return o(this,(function(o){return r=e.provider_redirect_uri,n=e.other_params,i=void 0===n?{}:n,a=s(e,["provider_redirect_uri","other_params"]),r&&!a.redirect_uri&&(a.redirect_uri=r),c="".concat(u.ApiUrls.PROVIDER_URI_URL,"?").concat(t.parseParamsToSearch(a)),Object.keys(i).forEach((function(t){var e=i[t];("sign_out_uri"!==t||(null==e?void 0:e.length)>0)&&(c+="&other_params[".concat(t,"]=").concat(encodeURIComponent(e)))})),[2,this.config.request(c,{method:"GET"})]}))}))},t.prototype.grantProviderToken=function(t,e){return void 0===e&&(e=!1),i(this,void 0,Promise,(function(){return o(this,(function(r){return[2,this.config.request(u.ApiUrls.PROVIDER_TOKEN_URL,{method:"POST",body:t,useWxCloud:e})]}))}))},t.prototype.patchProviderToken=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.PROVIDER_TOKEN_URL,{method:"PATCH",body:t})]}))}))},t.prototype.signInWithProvider=function(t,e){return void 0===e&&(e=!1),i(this,void 0,Promise,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return r=this.getParamsByVersion(t,"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(r.url,{method:"POST",body:r.params,useWxCloud:e})];case 1:return i=o.sent(),[4,this.config.credentialsClient.setCredentials(n(n({},i),{version:(null==t?void 0:t.version)||"v1"}))];case 2:return o.sent(),[2,Promise.resolve(i)]}}))}))},t.prototype.toBindIdentity=function(t){var e,r;return i(this,void 0,void 0,(function(){var n,i,s,a;return o(this,(function(o){switch(o.label){case 0:return(i=t.credentials)?[3,2]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 1:i=o.sent(),o.label=2;case 2:n=i,o.label=3;case 3:return o.trys.push([3,5,,6]),[4,this.bindWithProvider({provider_token:t.provider_token},n)];case 4:return o.sent(),s={data:{type:u.OAUTH_TYPE.BIND_IDENTITY,provider:t.provider},error:null},[3,6];case 5:return a=o.sent(),s={data:{type:u.OAUTH_TYPE.BIND_IDENTITY},error:new p.AuthError(a)},[3,6];case 6:return t.fireEvent&&(null===(r=null===(e=this.config.eventBus)||void 0===e?void 0:e.fire)||void 0===r||r.call(e,u.EVENTS.AUTH_STATE_CHANGED,{event:u.AUTH_STATE_CHANGED_TYPE.BIND_IDENTITY,info:s})),[2,s]}}))}))},t.prototype.getInitialSession=function(){return i(this,void 0,Promise,(function(){var t,e,r,i,s,a,c,h,l,d,f,v,g,y,m;return o(this,(function(o){switch(o.label){case 0:t={},o.label=1;case 1:if(o.trys.push([1,12,,13]),"undefined"==typeof window||"undefined"==typeof document)return[2,{data:null,error:null}];if(e=new URLSearchParams(null===location||void 0===location?void 0:location.search),r=e.get("code"),i=e.get("state"),!r||!i)return[2,{data:null,error:null}];s=null;try{s=JSON.parse(sessionStorage.getItem(i)||"null")}catch(t){}return t={type:null==s?void 0:s.type},a=e.get("error"),c=e.get("error_description"),a||c?[2,{data:t,error:new p.AuthError({message:c||a||"Unknown error from OAuth provider"})}]:(h=(null==s?void 0:s.provider)||e.get("provider"))?(l=location.origin+location.pathname,[4,this.grantProviderToken({provider_id:h,provider_redirect_uri:l,provider_code:r})]):[2,{data:t,error:new p.AuthError({message:"Provider is required for OAuth verification"})}];case 2:return d=o.sent().provider_token,f=void 0,v=null,g=void 0,s.type!==u.OAUTH_TYPE.BIND_IDENTITY?[3,5]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 3:return f=o.sent(),[4,this.toBindIdentity({provider:h,provider_token:d,credentials:f})];case 4:return g=o.sent(),[3,11];case 5:return s.type!==u.OAUTH_TYPE.SIGN_IN?[3,11]:(g=this.getParamsByVersion({provider:h},"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(g.url,{method:"POST",body:{provider_token:d}})]);case 6:f=o.sent(),o.label=7;case 7:return o.trys.push([7,9,,10]),[4,this.getUserInfo({credentials:f})];case 8:return v=o.sent(),[3,10];case 9:return y=o.sent(),console.error("get user info error",y),[3,10];case 10:g={data:n(n({},t),{session:f,user:v}),error:null},o.label=11;case 11:e.delete("code"),e.delete("state"),e.delete("provider"),this.restoreUrlState(void 0===(null==s?void 0:s.search)?"?".concat(e.toString()):s.search,(null==s?void 0:s.hash)||location.hash);try{sessionStorage.removeItem(i)}catch(t){}return[2,g];case 12:return m=o.sent(),[2,{data:t,error:new p.AuthError(m)}];case 13:return[2]}}))}))},t.prototype.signInCustom=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.config.request(u.ApiUrls.AUTH_SIGN_IN_CUSTOM,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signInWithWechat=function(t){return void 0===t&&(t={}),i(this,void 0,Promise,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.config.request(u.ApiUrls.AUTH_SIGN_IN_WITH_WECHAT_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.bindWithProvider=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(r){return[2,this.config.request(u.ApiUrls.PROVIDER_BIND_URL,{method:"POST",body:t,withCredentials:!0,getCredentials:e?function(){return e}:void 0})]}))}))},t.prototype.getUserProfile=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.getUserInfo(t)]}))}))},t.prototype.getUserInfo=function(t){var e,r,n;return void 0===t&&(t={}),i(this,void 0,Promise,(function(){var i,s,a,u,c;return o(this,(function(o){switch(o.label){case 0:return i=this.getParamsByVersion(t,"USER_ME_URL"),(null===(e=i.params)||void 0===e?void 0:e.query)&&(s=new d.default(i.params.query),i.url+="?".concat(s.toString())),[4,this.config.request(i.url,{method:"GET",withCredentials:!0,getCredentials:t.credentials?function(){return t.credentials}:void 0})];case 1:if((a=o.sent()).sub&&(a.uid=a.sub),null===(r=a.providers)||void 0===r?void 0:r.length)try{"undefined"!=typeof wx&&wx.getAccountInfoSync&&(u=null===(n=wx.getAccountInfoSync().miniProgram)||void 0===n?void 0:n.appId,(null==(c=a.providers.find((function(t){return t.id===u})))?void 0:c.provider_user_id)&&(a.open_id=c.provider_user_id))}catch(t){}return[2,a]}}))}))},t.prototype.getWedaUserInfo=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.config.request(u.ApiUrls.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,t.sent()]}}))}))},t.prototype.deleteMe=function(e){return i(this,void 0,Promise,(function(){var r,n;return o(this,(function(i){return r=this.getParamsByVersion(e,"USER_ME_URL"),n="".concat(r.url,"?").concat(t.parseParamsToSearch(r.params)),[2,this.config.request(n,{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.hasLoginState=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}}))}))},t.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},t.prototype.getLoginState=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},t.prototype.transByProvider=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.grantToken=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){return e=this.getParamsByVersion(t,"AUTH_TOKEN_URL"),[2,this.config.request(e.url,{method:"POST",body:e.params})]}))}))},t.prototype.getProviders=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){return[2,this.config.request(u.ApiUrls.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},t.prototype.unbindProvider=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request("".concat(u.ApiUrls.PROVIDER_UNBIND_URL,"/").concat(t.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.checkPassword=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request("".concat(u.ApiUrls.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.editContact=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request("".concat(u.ApiUrls.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.setPassword=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request("".concat(u.ApiUrls.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.updatePasswordByOld=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.sudo({password:t.old_password})];case 1:return e=r.sent(),[2,this.setPassword({sudo_token:e.sudo_token,new_password:t.new_password})]}}))}))},t.prototype.sudo=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request("".concat(u.ApiUrls.SUDO_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.sendVerificationCodeToCurrentUser=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return t.target="CUR_USER",[2,this.config.request(u.ApiUrls.VERIFICATION_URL,{method:"POST",body:t,withCredentials:!0,withCaptcha:!0})]}))}))},t.prototype.changeBoundProvider=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request("".concat(u.ApiUrls.PROVIDER_LIST,"/").concat(t.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:t.trans_token},withCredentials:!0})]}))}))},t.prototype.setUserProfile=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.USER_PRIFILE_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.updateUserBasicInfo=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.queryUserProfile=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){return e=new d.default(t),[2,this.config.request("".concat(u.ApiUrls.USER_QUERY_URL,"?").concat(e.toString()),{method:"GET",withCredentials:!0})]}))}))},t.prototype.setCustomSignFunc=function(t){this.getCustomSignTicketFn=t},t.prototype.signInWithCustomTicket=function(){return i(this,void 0,Promise,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return(t=this.getCustomSignTicketFn)?[4,t()]:[2,Promise.reject({error:"failed_precondition",error_description:"please use setCustomSignFunc to set custom sign function"})];case 1:return e=r.sent(),[2,this.signInCustom({provider_id:"custom",ticket:e})]}}))}))},t.prototype.resetPassword=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.AUTH_RESET_PASSWORD,{method:"POST",body:t})]}))}))},t.prototype.authorize=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.AUTHORIZE_URL,{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.authorizeDevice=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.AUTHORIZE_DEVICE_URL,{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.deviceAuthorize=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.AUTH_GET_DEVICE_CODE,{method:"POST",body:t})]}))}))},t.prototype.authorizeInfo=function(e){return i(this,void 0,Promise,(function(){var r,n,i;return o(this,(function(o){switch(o.label){case 0:return r="".concat(u.ApiUrls.AUTHORIZE_INFO_URL,"?").concat(t.parseParamsToSearch(e)),n=!0,i=!1,[4,this.hasLoginState()];case 1:return o.sent()&&(i=!0,n=!1),[2,this.config.request(r,{method:"GET",withBasicAuth:n,withCredentials:i})]}}))}))},t.prototype.checkUsername=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.CHECK_USERNAME,{method:"GET",body:t,withCredentials:!0})]}))}))},t.prototype.checkIfUserExist=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){return e=new d.default(t),[2,this.config.request("".concat(u.ApiUrls.CHECK_IF_USER_EXIST,"?").concat(e.toString()),{method:"GET"})]}))}))},t.prototype.loginScope=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){return[2,this.config.credentialsClient.getScope()]}))}))},t.prototype.loginGroups=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){return[2,this.config.credentialsClient.getGroups()]}))}))},t.prototype.refreshTokenForce=function(t){return i(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return e=r.sent(),[4,this.config.credentialsClient.refreshToken(n(n({},e),{version:(null==t?void 0:t.version)||"v1"}))];case 2:return[2,r.sent()]}}))}))},t.prototype.getCredentials=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.config.credentialsClient.getCredentials()]}))}))},t.prototype.getPublicKey=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){return[2,this.config.request(u.ApiUrlsV2.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},t.prototype.getEncryptParams=function(t){return i(this,void 0,Promise,(function(){var e,r,n,i,s,a;return o(this,(function(o){switch(o.label){case 0:return e=t.isEncrypt,delete t.isEncrypt,r=(0,l.deepClone)(t),[4,f(e,this.config.adapter)];case 1:if(!(n=o.sent()))return[2,t];i="",s="",o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(a=o.sent(),i=a.public_key,s=a.public_key_thumbprint,!i||!s)throw a;return[3,5];case 4:throw o.sent();case 5:return[2,{params:n.getEncryptInfo({publicKey:i,payload:r}),public_key_thumbprint:s}]}}))}))},t.prototype.getProviderSubType=function(){return i(this,void 0,Promise,(function(){return o(this,(function(t){return[2,this.config.request(u.ApiUrls.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},t.prototype.verifyCaptchaData=function(t){var e=t.token,r=t.key;return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.config.request(u.ApiUrls.VERIFY_CAPTCHA_DATA_URL,{method:"POST",body:{token:e,key:r},withCredentials:!1})]}))}))},t.prototype.createCaptchaData=function(t){var e=t.state,r=t.redirect_uri,n=void 0===r?void 0:r;return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.config.request(u.ApiUrls.CAPTCHA_DATA_URL,{method:"POST",body:{state:e,redirect_uri:n},withCredentials:!1})]}))}))},t.prototype.getMiniProgramCode=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.GET_MINIPROGRAM_QRCODE,{method:"POST",body:t})]}))}))},t.prototype.getMiniProgramQrCodeStatus=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,this.config.request(u.ApiUrls.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:t})]}))}))},t.prototype.getUserBehaviorLog=function(t){return i(this,void 0,Promise,(function(){var e,r;return o(this,(function(n){return e={LOGIN:"query[action]=USER_LOGIN",MODIFY:"ne_query[action]=USER_LOGIN"},r="".concat(u.ApiUrls.GET_USER_BEHAVIOR_LOG,"?").concat(e[t.type],"&limit=").concat(t.limit).concat(t.page_token?"&page_token=".concat(t.page_token):""),[2,this.config.request(r,{method:"GET",withCredentials:!0})]}))}))},t.prototype.modifyPassword=function(t){return i(this,void 0,Promise,(function(){var e,r,n,i,s,a;return o(this,(function(o){switch(o.label){case 0:return e="",r="",[4,f(!0,this.config.adapter)];case 1:if(!(n=o.sent()))throw new Error("do not support encrypt, a encrypt util required.");o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(i=o.sent(),e=i.public_key,r=i.public_key_thumbprint,!e||!r)throw i;return[3,5];case 4:throw o.sent();case 5:return s=t.password?n.getEncryptInfo({publicKey:e,payload:t.password}):"",a=n.getEncryptInfo({publicKey:e,payload:t.new_password}),[2,this.config.request(u.ApiUrls.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:{user_id:t.user_id,encrypt_password:s,encrypt_new_password:a,public_key_thumbprint:r}})]}}))}))},t.prototype.modifyPasswordWithoutLogin=function(t){return i(this,void 0,Promise,(function(){var e,r,n,i,s,a;return o(this,(function(o){switch(o.label){case 0:return e="",r="",[4,f(!0,this.config.adapter)];case 1:if(!(n=o.sent()))throw new Error("do not support encrypt, a encrypt util required.");o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(i=o.sent(),e=i.public_key,r=i.public_key_thumbprint,!e||!r)throw i;return[3,5];case 4:throw o.sent();case 5:return s=t.password?n.getEncryptInfo({publicKey:e,payload:t.password}):"",a=n.getEncryptInfo({publicKey:e,payload:t.new_password}),[2,this.config.request(u.ApiUrlsV2.AUTH_RESET_PASSWORD,{method:"POST",body:{username:t.username,password:s,new_password:a,public_key_thumbprint:r}})]}}))}))},t.prototype.restoreUrlState=function(t,e){if(void 0!==t)try{var r=new URL(window.location.href);r.search=t,r.hash=e||"",window.history.replaceState(null,"",r.toString()),window.location.replace(r.toString())}catch(t){}},t}();e.Auth=v},308:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.AuthError=e.AuthErrorCategory=void 0;var o,s=r(949);!function(t){t.PROVIDER_NOT_ENABLED="PROVIDER_NOT_ENABLED",t.INVALID_CREDENTIALS="INVALID_CREDENTIALS",t.USER_NOT_FOUND="USER_NOT_FOUND",t.USER_STATUS_ABNORMAL="USER_STATUS_ABNORMAL",t.SERVICE_ERROR="SERVICE_ERROR",t.INVALID_PARAMS="INVALID_PARAMS",t.AUTH_METHOD_MISMATCH="AUTH_METHOD_MISMATCH",t.UNKNOWN="UNKNOWN"}(o=e.AuthErrorCategory||(e.AuthErrorCategory={}));var a="https://tcb.cloud.tencent.com/dev?envId=#/identity/login-manage",u="https://docs.cloudbase.net/api-reference/webv3-next/initialization",c=function(t){function e(e,r){var n,i=this,c=e.error_description||e.message;return(i=t.call(this,c)||this).__isAuthError=!0,i.name="AuthError",i.status=e.error,i.code=e.error_code,i.requestId=e.requestId,i.category=function(t,e){if(!t&&!e)return o.UNKNOWN;try{var r=(t||"").toLowerCase();return e===s.ErrorType.FAILED_PRECONDITION||e===s.ErrorType.PROVIDER_NOT_ENABLED||e===s.ErrorType.LOGIN_METHOD_DISABLED||r.includes("身份源")||r.includes("开启")||r.includes("identity provider")||r.includes("provider not enabled")||r.includes("login method")||r.includes("登录方式")||r.includes("not enabled")||r.includes("未开启")||r.includes("未启用")||r.includes("请联系开发者")||r.includes("anonymous login is not enabled")||r.includes("匿名登录未开启")?o.PROVIDER_NOT_ENABLED:e===s.ErrorType.INVALID_PASSWORD||e===s.ErrorType.INVALID_GRANT||e===s.ErrorType.INVALID_VERIFICATION_CODE||e===s.ErrorType.INVALID_USERNAME_OR_PASSWORD||e===s.ErrorType.INVALID_CREDENTIALS||e===s.ErrorType.WRONG_PASSWORD||e===s.ErrorType.UNAUTHENTICATED||e===s.ErrorType.INVALID_TWO_FACTOR||e===s.ErrorType.INVALID_TWO_FACTOR_RECOVERY||e===s.ErrorType.PASSWORD_NOT_SET||r.includes("密码不正确")||r.includes("password")||r.includes("invalid_password")||r.includes("凭据")||r.includes("credentials")||r.includes("验证码")||r.includes("verification")||r.includes("invalid_verification_code")||r.includes("invalid_username_or_password")||r.includes("username or password")||r.includes("用户名或密码")||r.includes("wrong password")||r.includes("incorrect password")?o.INVALID_CREDENTIALS:e===s.ErrorType.NOT_FOUND||e===s.ErrorType.USER_NOT_FOUND||r.includes("用户不存在")||r.includes("not found")||r.includes("user not found")||r.includes("不存在")||r.includes("no such user")||r.includes("user does not exist")?o.USER_NOT_FOUND:e===s.ErrorType.USER_BLOCKED||e===s.ErrorType.USER_PENDING||e===s.ErrorType.UNDER_REVIEW||e===s.ErrorType.INVALID_STATUS||r.includes("被封禁")||r.includes("blocked")||r.includes("pending")||r.includes("审核")||r.includes("review")||r.includes("locked")||r.includes("已锁定")?o.USER_STATUS_ABNORMAL:e===s.ErrorType.SERVER_ERROR||e===s.ErrorType.UNAVAILABLE||e===s.ErrorType.TEMPORARILY_UNAVAILABLE||e===s.ErrorType.INTERNAL||e===s.ErrorType.UNREACHABLE||e===s.ErrorType.DEADLINE_EXCEEDED||e===s.ErrorType.DATA_LOSS||r.includes("network")||r.includes("timeout")||r.includes("服务")||r.includes("timed out")||r.includes("超时")?o.SERVICE_ERROR:e===s.ErrorType.INVALID_ARGUMENT||e===s.ErrorType.INVALID_REQUEST||e===s.ErrorType.INVALID_SCOPE||e===s.ErrorType.INVALID_REQUEST_URI||e===s.ErrorType.INVALID_REQUEST_OBJECT?o.INVALID_PARAMS:e===s.ErrorType.PERMISSION_DENIED||e===s.ErrorType.ACCESS_DENIED||e===s.ErrorType.UNAUTHORIZED_CLIENT?o.PROVIDER_NOT_ENABLED:o.UNKNOWN}catch(t){return e}}(c,i.status),i.helpMessage=function(t,e){var r=(null==e?void 0:e.method)||"signIn",n={signInWithPassword:"「用户名密码登录」",signInAnonymously:"「匿名登录」",signInWithOtp:"「短信验证码登录」或「邮箱验证码登录」",signUp:"「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"对应的第三方身份源",signInWithIdToken:"对应的第三方身份源",signInWithOpenId:"「微信小程序 OpenID 登录」",signInWithPhoneAuth:"「微信小程序手机号授权登录」",signInWithCustomTicket:"「自定义登录」"}[r]||"对应的登录方式";switch(t){case o.PROVIDER_NOT_ENABLED:return"[CloudBase Auth] 登录方式未开启\n\n"+" 当前调用的 ".concat(r,"() 所需的登录方式尚未在云开发控制台启用。\n")+" 需要开启的登录方式:".concat(n,"\n")+"\n 请按以下步骤开启:\n"+" 1. 打开云开发控制台:".concat(a,"\n")+" 2. 选择对应的云开发环境\n 3. 进入「登录授权」页面,在「登录方式」或「身份源列表」中开启所需的登录方式\n\n 各登录方法与所需登录方式的对应关系:\n - signInWithPassword → 「用户名密码登录」\n - signInAnonymously → 「匿名登录」\n - signInWithOtp/signUp → 「短信验证码登录」或「邮箱验证码登录」\n - signInWithOAuth/signInWithIdToken → 对应的第三方身份源\n\n 如使用 CLI/MCP 工具,可通过 auth 工具查询和配置身份源状态。\n"+" 更多帮助请参考文档:".concat(u);case o.INVALID_CREDENTIALS:return"[CloudBase Auth] 凭据验证失败\n\n"+" 调用 ".concat(r,"() 时凭据校验未通过。\n")+"\n 请按优先级逐项排查:\n 1. 确认用户名/邮箱/手机号是否拼写正确、格式完整\n 2. 确认密码是否正确(注意大小写、特殊字符、前后空格)\n 3. 确认用户账号确实存在(可通过 auth.isUsernameRegistered() 检查)\n 4. 确认凭据参数来源可靠(环境变量、配置文件中的值是否已正确设置)\n 5. 如使用加密登录(is_encrypt: true),请确认公钥版本正确\n\n 如忘记密码,可通过 auth.resetPasswordForEmail() 重置密码。\n\n 提示:如果是 AI agent / 自动化测试场景,请确认 ENV_ID、USERNAME、PASSWORD\n 等环境变量已正确传入,且对应用户已在目标环境中注册。";case o.USER_NOT_FOUND:return"[CloudBase Auth] 用户不存在\n\n 请检查以下项目:\n 1. 确认用户名/邮箱/手机号是否正确\n 2. 确认是在正确的云开发环境(envId)下操作\n 3. 如果是新用户,请先通过 auth.signUp() 注册\n"+" 4. 也可在云开发控制台手动创建用户:".concat(a,"\n")+"\n 提示:不同环境(开发/测试/生产)的用户库是隔离的,请确认 envId 正确。";case o.USER_STATUS_ABNORMAL:return"[CloudBase Auth] 用户状态异常\n\n 当前用户账号可能处于以下状态之一:\n - 账号已被封禁\n - 账号正在审核中\n - 账号已被锁定(多次密码错误)\n\n"+" 请联系管理员在云开发控制台检查用户状态:".concat(a);case o.SERVICE_ERROR:return"[CloudBase Auth] 服务异常\n\n 请检查以下项目:\n 1. 网络连接是否正常\n 2. 云开发环境是否正常运行\n 3. 稍后重试,如持续失败请联系技术支持\n\n 提示:如果是超时错误,请检查网络环境和请求频率。";case o.INVALID_PARAMS:return"[CloudBase Auth] 参数错误\n\n 请检查传入的参数是否符合要求,参考 API 文档确认各参数的格式和约束。\n"+" 文档地址:".concat(u);case o.AUTH_METHOD_MISMATCH:return"[CloudBase Auth] 登录方式不匹配\n\n"+" 调用 ".concat(r,"() 时遇到错误,可能原因:\n")+" - 匿名登录失败后尝试了用户名密码登录,但凭据不正确或用户不存在\n - 应使用匿名登录但传入了密码参数\n - 应使用密码登录但未传入正确的凭据\n\n 建议:\n 1. 明确当前场景需要的登录方式:\n - 无需用户注册 → auth.signInAnonymously()\n - 有用户名和密码 → auth.signInWithPassword({ username, password })\n - 第三方平台 → auth.signInWithOAuth({ provider })\n 2. 不要在同一流程中混合使用不同的登录方式\n 3. 每种登录方式需要在控制台开启对应的身份源\n"+" 4. 控制台地址:".concat(a);default:return"[CloudBase Auth] 操作失败\n\n 如果问题持续存在,建议:\n"+" 1. 检查云开发控制台的认证配置:".concat(a,"\n")+" 2. 到官方问答社区提问:https://cnb.cool/tencent/cloud/cloudbase/community/-/issues\n"+" 3. 查阅文档:".concat(u)}}(i.category,r),i.loginMethodHint=(n=null==r?void 0:r.method)&&{signInWithPassword:"当前使用「用户名密码登录」,需确保:\n ✓ 控制台已开启「用户名密码登录」\n ✓ 用户已注册且凭据正确\n 如果不需要用户系统,建议改用 auth.signInAnonymously()",signInAnonymously:"当前使用「匿名登录」,需确保:\n ✓ 控制台已开启「匿名登录」\n 注意:匿名用户无需用户名密码,适用于快速体验或临时访问场景",signInWithOtp:"当前使用「OTP 验证码登录」,需确保:\n ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」",signInWithOAuth:"当前使用「第三方 OAuth 登录」,需确保:\n ✓ 控制台已配置并开启对应的第三方身份源"}[n]||"",i}return i(e,t),e}(Error);e.AuthError=c},949:function(t,e){var r,n,i,o;Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_NODE_ACCESS_SCOPE=e.OAUTH_TYPE=e.EVENTS=e.AUTH_STATE_CHANGED_TYPE=e.LOGIN_STATE_CHANGED_TYPE=e.ErrorType=e.VerificationUsages=e.ApiUrlsV2=e.ApiUrls=e.AUTH_API_PREFIX=void 0,e.AUTH_API_PREFIX="/auth",(o=e.ApiUrls||(e.ApiUrls={})).AUTH_SIGN_UP_URL="/v1/signup",o.AUTH_TOKEN_URL="/v1/token",o.AUTH_REVOKE_URL="/v1/revoke",o.WEDA_USER_URL="/v1/plugin/weda/userinfo",o.AUTH_RESET_PASSWORD="/v1/reset",o.AUTH_GET_DEVICE_CODE="/v1/device/code",o.CHECK_USERNAME="/v1/checkUsername",o.CHECK_IF_USER_EXIST="/v1/checkIfUserExist",o.GET_PROVIDER_TYPE="/v1/mgr/provider/providerSubType",o.AUTH_SIGN_IN_URL="/v1/signin",o.AUTH_SIGN_IN_ANONYMOUSLY_URL="/v1/signin/anonymously",o.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v1/signin/with/provider",o.AUTH_SIGN_IN_WITH_WECHAT_URL="/v1/signin/wechat/noauth",o.AUTH_SIGN_IN_CUSTOM="/v1/signin/custom",o.PROVIDER_TOKEN_URL="/v1/provider/token",o.PROVIDER_URI_URL="/v1/provider/uri",o.USER_ME_URL="/v1/user/me",o.AUTH_SIGNOUT_URL="/v1/user/signout",o.USER_QUERY_URL="/v1/user/query",o.USER_PRIFILE_URL="/v1/user/profile",o.USER_BASIC_EDIT_URL="/v1/user/basic/edit",o.USER_TRANS_BY_PROVIDER_URL="/v1/user/trans/by/provider",o.PROVIDER_LIST="/v1/user/provider",o.PROVIDER_BIND_URL="/v1/user/provider/bind",o.PROVIDER_UNBIND_URL="/v1/user/provider",o.CHECK_PWD_URL="/v1/user/sudo",o.SUDO_URL="/v1/user/sudo",o.BIND_CONTACT_URL="/v1/user/contact",o.AUTH_SET_PASSWORD="/v1/user/password",o.AUTHORIZE_DEVICE_URL="/v1/user/device/authorize",o.AUTHORIZE_URL="/v1/user/authorize",o.AUTHORIZE_INFO_URL="/v1/user/authorize/info",o.AUTHORIZED_DEVICES_DELETE_URL="/v1/user/authorized/devices/",o.AUTH_REVOKE_ALL_URL="/v1/user/revoke/all",o.GET_USER_BEHAVIOR_LOG="/v1/user/security/history",o.VERIFICATION_URL="/v1/verification",o.VERIFY_URL="/v1/verification/verify",o.CAPTCHA_DATA_URL="/v1/captcha/data",o.VERIFY_CAPTCHA_DATA_URL="/v1/captcha/data/verify",o.GET_CAPTCHA_URL="/v1/captcha/init",o.GET_MINIPROGRAM_QRCODE="/v1/qrcode/generate",o.GET_MINIPROGRAM_QRCODE_STATUS="/v1/qrcode/get/status",(i=e.ApiUrlsV2||(e.ApiUrlsV2={})).AUTH_SIGN_IN_URL="/v2/signin/username",i.AUTH_TOKEN_URL="/v2/token",i.USER_ME_URL="/v2/user/me",i.VERIFY_URL="/v2/signin/verificationcode",i.AUTH_SIGN_IN_WITH_PROVIDER_URL="/v2/signin/with/provider",i.AUTH_PUBLIC_KEY="/v2/signin/publichkey",i.AUTH_RESET_PASSWORD="/v2/signin/password/update",(n=e.VerificationUsages||(e.VerificationUsages={})).REGISTER="REGISTER",n.SIGN_IN="SIGN_IN",n.PASSWORD_RESET="PASSWORD_RESET",n.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",n.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE",(r=e.ErrorType||(e.ErrorType={})).UNREACHABLE="unreachable",r.LOCAL="local",r.CANCELLED="cancelled",r.UNKNOWN="unknown",r.UNAUTHENTICATED="unauthenticated",r.RESOURCE_EXHAUSTED="resource_exhausted",r.FAILED_PRECONDITION="failed_precondition",r.INVALID_ARGUMENT="invalid_argument",r.DEADLINE_EXCEEDED="deadline_exceeded",r.NOT_FOUND="not_found",r.ALREADY_EXISTS="already_exists",r.PERMISSION_DENIED="permission_denied",r.ABORTED="aborted",r.OUT_OF_RANGE="out_of_range",r.UNIMPLEMENTED="unimplemented",r.INTERNAL="internal",r.UNAVAILABLE="unavailable",r.DATA_LOSS="data_loss",r.INVALID_PASSWORD="invalid_password",r.PASSWORD_NOT_SET="password_not_set",r.INVALID_STATUS="invalid_status",r.USER_PENDING="user_pending",r.USER_BLOCKED="user_blocked",r.INVALID_VERIFICATION_CODE="invalid_verification_code",r.TWO_FACTOR_REQUIRED="two_factor_required",r.INVALID_TWO_FACTOR="invalid_two_factor",r.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",r.UNDER_REVIEW="under_review",r.INVALID_REQUEST="invalid_request",r.UNAUTHORIZED_CLIENT="unauthorized_client",r.ACCESS_DENIED="access_denied",r.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",r.INVALID_SCOPE="invalid_scope",r.INVALID_GRANT="invalid_grant",r.SERVER_ERROR="server_error",r.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",r.INTERACTION_REQUIRED="interaction_required",r.LOGIN_REQUIRED="login_required",r.ACCOUNT_SELECTION_REQUIRED="account_selection_required",r.CONSENT_REQUIRED="consent_required",r.INVALID_REQUEST_URI="invalid_request_uri",r.INVALID_REQUEST_OBJECT="invalid_request_object",r.REQUEST_NOT_SUPPORTED="request_not_supported",r.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",r.REGISTRATION_NOT_SUPPORTED="registration_not_supported",r.CAPTCHA_REQUIRED="captcha_required",r.CAPTCHA_INVALID="captcha_invalid",r.PROVIDER_NOT_ENABLED="provider_not_enabled",r.LOGIN_METHOD_DISABLED="login_method_disabled",r.INVALID_USERNAME_OR_PASSWORD="invalid_username_or_password",r.INVALID_CREDENTIALS="invalid_credentials",r.WRONG_PASSWORD="wrong_password",r.USER_NOT_FOUND="user_not_found",e.LOGIN_STATE_CHANGED_TYPE={SIGN_OUT:"sign_out",SIGN_IN:"sign_in",CREDENTIALS_ERROR:"credentials_error"},e.AUTH_STATE_CHANGED_TYPE={SIGNED_OUT:"SIGNED_OUT",SIGNED_IN:"SIGNED_IN",INITIAL_SESSION:"INITIAL_SESSION",PASSWORD_RECOVERY:"PASSWORD_RECOVERY",TOKEN_REFRESHED:"TOKEN_REFRESHED",USER_UPDATED:"USER_UPDATED",BIND_IDENTITY:"BIND_IDENTITY"},e.EVENTS={LOGIN_STATE_CHANGED:"loginStateChanged",AUTH_STATE_CHANGED:"authStateChanged"},e.OAUTH_TYPE={SIGN_IN:"sign_in",BIND_IDENTITY:"bind_identity"},e.DEFAULT_NODE_ACCESS_SCOPE="node-sdk-scope"},538:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},84:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.openURIWithCallback=void 0;var s=r(689),a=r(616),u=function(t,e){var r;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];clearTimeout(r),r=setTimeout((function(){return t.apply(null,n)}),e)}},c=new s.CloudbaseEventEmitter,h="resolveCaptchaData",l="padding:10px 8px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer;flex:1;white-space:nowrap;margin-left:10px",d="width:100%;padding:10px;background:#007bff;color:#fff;border:none;border-radius:4px;cursor:pointer",p="background:#6c757d;cursor:not-allowed";e.openURIWithCallback=function(t,e){return i(void 0,void 0,Promise,(function(){var r,s,f,v;return o(this,(function(g){return r=(0,a.parseCaptcha)(t),s=r.captchaData,f=r.state,v=r.token,function(t){var e=t.oauthInstance,r=t.captchaState,s="captcha-image",a=function(){return i(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.createCaptchaData({state:r.state})];case 1:return t=o.sent(),r=n(n({},r),{captchaData:t.data,token:t.token}),document.getElementById(s).src=t.data,[3,3];case 2:return i=o.sent(),console.error("刷新图形验证码失败",i),[3,3];case 3:return[2]}}))}))},f=function(t,e,r){var n=document.createElement(t);return e&&(n.style.cssText=e),r&&(n.textContent=r),n},v=f("div","position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:999"),g=f("div","position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:320px;padding:20px;background:#fff;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,0.2);z-index:1000");g.appendChild(f("p","margin-bottom:15px","请输入你看到的字符:"));var y=f("div","display:flex;align-items:center;justify-content:space-between;margin-bottom:15px"),m=f("img","width:100%;height:auto;border:1px solid #eee");m.id=s,m.src=r.captchaData,y.appendChild(m);var _=f("button",l,"刷新");_.onclick=u((function(){return i(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:_.textContent="加载中...",_.disabled=!0,_.style.cssText="".concat(l,";").concat(p),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,a()];case 2:return t.sent(),[3,4];case 3:return _.textContent="刷新",_.disabled=!1,_.style.cssText=l,[7];case 4:return[2]}}))}))}),500),y.appendChild(_),g.appendChild(y);var b=f("input","width:100%;padding:14px 16px;margin-bottom:15px;box-sizing:border-box;border:2px solid #e8ecf4;border-radius:10px;font-size:15px");b.type="text",b.placeholder="输入字符",b.maxLength=4,g.appendChild(b);var E=f("div","color:#dc3545;font-size:12px;margin-bottom:10px;display:none;padding:8px;background:#f8d7da;border:1px solid #f5c6cb;border-radius:4px");g.appendChild(E);var I=function(t){E.textContent=t,E.style.display="block"},w=f("button",d,"确定");w.onclick=u((function(){return i(void 0,void 0,void 0,(function(){var t,n,i,s;return o(this,(function(o){switch(o.label){case 0:if(!(t=b.value.trim()))return I("请输入字符"),[2];E.style.display="none",w.textContent="验证中...",w.disabled=!0,w.style.cssText="".concat(d,";").concat(p),o.label=1;case 1:return o.trys.push([1,3,5,6]),[4,e.verifyCaptchaData({token:r.token,key:t})];case 2:return n=o.sent(),c.fire(h,n),console.log("图形验证码校验成功"),document.body.removeChild(v),document.body.removeChild(g),[3,6];case 3:return i=o.sent(),console.error("图形验证码校验失败",i),s=i.error_description||"图形验证码校验失败",I(s),b.value="",b.focus(),[4,a()];case 4:return o.sent(),[3,6];case 5:return w.textContent="确定",w.disabled=!1,w.style.cssText=d,[7];case 6:return[2]}}))}))}),500),g.appendChild(w),document.body.appendChild(v),document.body.appendChild(g)}({oauthInstance:e,captchaState:{captchaData:s,state:f,token:v}}),[2,new Promise((function(t){console.log("等待图形验证码校验结果..."),c.on(h,(function(e){t(null==e?void 0:e.data)}))}))]}))}))}},462:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Captcha=void 0;var o=r(949),s=r(257),a=r(425),u=r(84),c=function(){function t(t){t.openURIWithCallback||(t.openURIWithCallback=this.getDefaultOpenURIWithCallback()),t.storage||(t.storage=s.defaultStorage),this.config=t,this.tokenSectionName="captcha_".concat(t.clientId||t.env)}return t.prototype.isMatch=function(){var t,e,r;return(null===(r=null===(e=null===(t=this.config)||void 0===t?void 0:t.adapter)||void 0===e?void 0:e.isMatch)||void 0===r?void 0:r.call(e))||(0,a.isMp)()},t.prototype.request=function(t,e){return n(this,void 0,Promise,(function(){var r,n,s,a;return i(this,(function(i){switch(i.label){case 0:return e||(e={}),e.method||(e.method="GET"),r="".concat(e.method,":").concat(t),n=t,e.withCaptcha?[4,this.appendCaptchaTokenToURL(t,r,!1)]:[3,2];case 1:n=i.sent(),i.label=2;case 2:return i.trys.push([2,4,,7]),[4,this.config.request(n,e)];case 3:return s=i.sent(),[3,7];case 4:return(a=i.sent()).error!==o.ErrorType.CAPTCHA_REQUIRED&&a.error!==o.ErrorType.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(t,r,a.error===o.ErrorType.CAPTCHA_INVALID)];case 5:return t=i.sent(),[2,this.config.request(t,e)];case 6:return[2,Promise.reject(a)];case 7:return[2,s]}}))}))},t.prototype.getDefaultOpenURIWithCallback=function(){var t=this;return function(e){return(0,u.openURIWithCallback)(e,t.config.oauthInstance)}},t.prototype.getCaptchaToken=function(t,e){return n(this,void 0,Promise,(function(){var r,n,s,a;return i(this,(function(i){switch(i.label){case 0:return t?[3,2]:[4,this.findCaptchaToken()];case 1:if(r=i.sent())return[2,r];i.label=2;case 2:return[4,this.config.request(o.ApiUrls.CAPTCHA_DATA_URL,{method:"POST",body:{state:e,redirect_uri:""},withCredentials:!1})];case 3:return n=i.sent(),s="".concat(n.data,"?state=").concat(encodeURIComponent(e),"&token=").concat(encodeURIComponent(n.token)),[4,this.config.openURIWithCallback(s)];case 4:return a=i.sent(),this.saveCaptchaToken(a),[2,a.captcha_token]}}))}))},t.prototype.appendCaptchaTokenToURL=function(t,e,r){return n(this,void 0,Promise,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getCaptchaToken(r,e)];case 1:return n=i.sent(),t.indexOf("?")>0?t+="&captcha_token=".concat(n):t+="?captcha_token=".concat(n),[2,t]}}))}))},t.prototype.saveCaptchaToken=function(t){return n(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return t.expires_at=new Date(Date.now()+1e3*(t.expires_in-10)),e=JSON.stringify(t),[4,this.config.storage.setItem(this.tokenSectionName,e)];case 1:return r.sent(),[2]}}))}))},t.prototype.findCaptchaToken=function(){return n(this,void 0,Promise,(function(){var t,e;return i(this,(function(r){switch(r.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(t=r.sent()))return[3,5];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),e.expires_at<new Date?[2,null]:[2,e.captcha_token];case 3:return r.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),[2,null];case 5:return[2,null]}}))}))},t}();e.Captcha=c},722:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseOAuth=e.AUTH_STATE_CHANGED_TYPE=e.EVENTS=e.LOGIN_STATE_CHANGED_TYPE=e.DEFAULT_NODE_ACCESS_SCOPE=e.OAUTH_TYPE=e.AUTH_API_PREFIX=e.weAppJwtDecodeAll=e.authModels=e.AuthErrorCategory=e.AuthError=e.Auth=void 0;var a=r(257),u=r(413),c=r(949),h=r(413);Object.defineProperty(e,"Auth",{enumerable:!0,get:function(){return h.Auth}});var l=r(308);Object.defineProperty(e,"AuthError",{enumerable:!0,get:function(){return l.AuthError}}),Object.defineProperty(e,"AuthErrorCategory",{enumerable:!0,get:function(){return l.AuthErrorCategory}}),e.authModels=s(r(538));var d=r(344);Object.defineProperty(e,"weAppJwtDecodeAll",{enumerable:!0,get:function(){return d.weAppJwtDecodeAll}});var p=r(949);Object.defineProperty(e,"AUTH_API_PREFIX",{enumerable:!0,get:function(){return p.AUTH_API_PREFIX}}),Object.defineProperty(e,"OAUTH_TYPE",{enumerable:!0,get:function(){return p.OAUTH_TYPE}}),Object.defineProperty(e,"DEFAULT_NODE_ACCESS_SCOPE",{enumerable:!0,get:function(){return p.DEFAULT_NODE_ACCESS_SCOPE}}),Object.defineProperty(e,"LOGIN_STATE_CHANGED_TYPE",{enumerable:!0,get:function(){return p.LOGIN_STATE_CHANGED_TYPE}}),Object.defineProperty(e,"EVENTS",{enumerable:!0,get:function(){return p.EVENTS}}),Object.defineProperty(e,"AUTH_STATE_CHANGED_TYPE",{enumerable:!0,get:function(){return p.AUTH_STATE_CHANGED_TYPE}});var f=function(){function t(t){var e=t.apiOrigin,r=t.apiPath,i=void 0===r?c.AUTH_API_PREFIX:r,o=t.clientId,s=t.env,h=t.storage,l=t.request,d=t.baseRequest,p=t.anonymousSignInFunc,f=t.wxCloud,v=t.adapter,g=t.onCredentialsError,y=t.headers,m=t.i18n,_=t.useWxCloud,b=t.eventBus,E=t.detectSessionInUrl,I=t.debug;if(this.detectSessionInUrl=null!=E&&E,this.oauth2client=new a.OAuth2Client({apiOrigin:e,apiPath:i,clientId:o,env:s,storage:h,baseRequest:d||l,anonymousSignInFunc:p,wxCloud:f,onCredentialsError:g,headers:y||{},i18n:m,useWxCloud:_,eventBus:b,debug:I}),this.authApi=new u.Auth(n(n({credentialsClient:this.oauth2client},t),{request:l?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:v})),E)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var w=new URL(window.location.href),A=w.searchParams.get("code"),S=w.searchParams.get("state"),T=JSON.parse(sessionStorage.getItem(S)||"null");A&&S&&(null==T?void 0:T.hash)&&(w.hash=T.hash,window.history.replaceState(null,"",w.toString()),window.location.replace(w.toString()))}catch(t){}}return t.prototype.initializeSession=function(t){this.detectSessionInUrl?(this.oauth2client.setOnInitialSessionObtained(t),this.oauth2client.initialize()):this.oauth2client.initialize(Promise.resolve({error:null}))},t}();e.CloudbaseOAuth=f},877:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax=e.ErrorType=void 0;var n,i=r(949);Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return i.ErrorType}}),(n=e.Syntax||(e.Syntax={})).CLIENT_ID="client_id",n.CLIENT_SECRET="client_secret",n.RESPONSE_TYPE="response_type",n.SCOPE="scope",n.STATE="state",n.REDIRECT_URI="redirect_uri",n.ERROR="error",n.ERROR_DESCRIPTION="error_description",n.ERROR_URI="error_uri",n.GRANT_TYPE="grant_type",n.CODE="code",n.ACCESS_TOKEN="access_token",n.TOKEN_TYPE="token_type",n.EXPIRES_IN="expires_in",n.USERNAME="username",n.PASSWORD="password",n.REFRESH_TOKEN="refresh_token"},257:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.OAuth2Client=e.defaultStorage=e.generateRequestId=e.toResponseError=e.defaultRequest=void 0;var a=r(877),u=r(949),c=r(873),h=r(631),l=r(547),d=r(344),p=r(425),f=r(683),v="x-request-id",g="x-device-id",y="device_id";function m(){return(0,c.uuidv4)()}e.defaultRequest=function(t,e){return i(this,void 0,Promise,(function(){var r,n,i,s,u;return o(this,(function(o){switch(o.label){case 0:r=null,n=null,o.label=1;case 1:return o.trys.push([1,4,,5]),(i=Object.assign({},e)).method||(i.method="GET"),i.body&&"string"!=typeof i.body&&(i.body=JSON.stringify(i.body)),[4,fetch(t,i)];case 2:return[4,o.sent().json()];case 3:return(null==(s=o.sent())?void 0:s.error)?(n=s).error_uri=new URL(t).pathname:r=s,[3,5];case 4:return u=o.sent(),n={error:a.ErrorType.UNREACHABLE,error_description:u.message,error_uri:new URL(t).pathname},[3,5];case 5:if(n)throw n;return[2,r]}}))}))},e.toResponseError=function(t,e){var r,n=e||{};if(t instanceof Error)r={error:n.error||a.ErrorType.LOCAL,error_description:n.error_description||t.message,error_uri:n.error_uri,details:n.details||t.stack};else{var i=t||{};r={error:n.error||i.error||a.ErrorType.LOCAL,error_description:n.error_description||i.error_description,error_uri:n.error_uri||i.error_uri,details:n.details||i.details}}return r},e.generateRequestId=m;var _=function(){function t(t){this._env=(null==t?void 0:t.env)||""}return t.prototype.getItem=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,window.localStorage.getItem("".concat(t).concat(this._env))]}))}))},t.prototype.removeItem=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return window.localStorage.removeItem("".concat(t).concat(this._env)),[2]}))}))},t.prototype.setItem=function(t,e){return i(this,void 0,Promise,(function(){return o(this,(function(r){return window.localStorage.setItem("".concat(t).concat(this._env),e),[2]}))}))},t.prototype.getItemSync=function(t){return window.localStorage.getItem("".concat(t).concat(this._env))},t.prototype.removeItemSync=function(t){window.localStorage.removeItem("".concat(t).concat(this._env))},t.prototype.setItemSync=function(t,e){window.localStorage.setItem("".concat(t).concat(this._env),e)},t}();function b(t){var e=!0;return(null==t?void 0:t.expires_at)&&(null==t?void 0:t.access_token)&&(e=t.expires_at<new Date),e}e.defaultStorage=new _;var E=function(){function t(t){this.credentials=null,this.accessKeyCredentials=null,this.singlePromise=null,this.tokenSectionName=t.tokenSectionName,this.storage=t.storage,this.clientId=t.clientId,this.singlePromise=new l.SinglePromise({clientId:this.clientId}),this.credentials=t.credentials||null}return t.prototype.getStorageCredentialsSync=function(){var t=null,e=this.storage.getItemSync(this.tokenSectionName);if(null!=e)try{(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at))}catch(e){this.storage.removeItem(this.tokenSectionName),t=null}return t},t.prototype.setCredentials=function(t){return i(this,void 0,Promise,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return(null==t?void 0:t.expires_in)?((null==t?void 0:t.expires_at)||(t.expires_at=new Date(Date.now()+1e3*(t.expires_in-30))),this.storage?(e=JSON.stringify(t),[4,this.storage.setItem(this.tokenSectionName,e)]):[3,2]):[3,3];case 1:r.sent(),r.label=2;case 2:return this.credentials=t,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:r.sent(),r.label=5;case 5:this.credentials=null,r.label=6;case 6:return[2]}}))}))},t.prototype.setAccessKeyCredentials=function(t){this.accessKeyCredentials=t,t.scope===u.DEFAULT_NODE_ACCESS_SCOPE&&(this.credentials=t)},t.prototype.getCredentials=function(){return i(this,void 0,Promise,(function(){var t=this;return o(this,(function(e){return[2,this.singlePromise.run("getCredentials",(function(){return i(t,void 0,void 0,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return b(this.credentials)?[4,this.getStorageCredentials()]:[3,2];case 1:if(t=r.sent(),e=t.credentials,t.isAccessKeyCredentials)return[2,e];this.credentials=e,r.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},t.prototype.getStorageCredentials=function(){return i(this,void 0,Promise,(function(){var t=this;return o(this,(function(e){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return i(t,void 0,void 0,(function(){var t,e,r;return o(this,(function(n){switch(n.label){case 0:return t=null,e=!1,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(!(r=n.sent()))return[3,6];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(t=JSON.parse(r))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),[3,5];case 3:return n.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),t=null,[3,5];case 5:return[3,7];case 6:t=this.accessKeyCredentials||null,e=!0,n.label=7;case 7:return[2,{credentials:t,isAccessKeyCredentials:e}]}}))}))}))]}))}))},t}();e.OAuth2Client=function(){function t(r){var n,i=this;this.initializePromise=null,this.lockAcquired=!1,this.pendingInLock=[],this.singlePromise=null,r.clientSecret||(r.clientSecret=""),!r.clientId&&r.env&&(r.clientId=r.env),this.apiOrigin=r.apiOrigin,this.apiPath=r.apiPath||u.AUTH_API_PREFIX,this.clientId=r.clientId,this.i18n=r.i18n,this.eventBus=r.eventBus,this.singlePromise=new l.SinglePromise({clientId:this.clientId}),this.retry=this.formatRetry(r.retry,t.defaultRetry),r.baseRequest?this.baseRequest=r.baseRequest:this.baseRequest=e.defaultRequest,this.tokenInURL=r.tokenInURL,this.headers=r.headers,this.storage=r.storage||e.defaultStorage,this.localCredentials=new E({tokenSectionName:"credentials_".concat(r.clientId),storage:this.storage,clientId:r.clientId}),this.clientSecret=r.clientSecret,r.clientId&&(this.basicAuth="Basic ".concat((0,d.weBtoa)("".concat(r.clientId,":").concat(this.clientSecret)))),this.wxCloud=r.wxCloud;try{(0,p.isMp)()&&(this.useWxCloud=r.useWxCloud,void 0===this.wxCloud&&r.env&&(wx.cloud.init({env:r.env}),this.wxCloud=wx.cloud))}catch(t){}this.refreshTokenFunc=r.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=r.anonymousSignInFunc,this.onCredentialsError=r.onCredentialsError,this.getInitialSession=r.getInitialSession,this.onInitialSessionObtained=r.onInitialSessionObtained,this.logDebugMessages=null!==(n=r.debug)&&void 0!==n&&n,f.langEvent.bus.on(f.langEvent.LANG_CHANGE_EVENT,(function(t){var e;i.i18n=(null===(e=t.data)||void 0===e?void 0:e.i18n)||i.i18n}))}return t.prototype.setGetInitialSession=function(t){this.getInitialSession=t},t.prototype.setOnInitialSessionObtained=function(t){this.onInitialSessionObtained=t},t.prototype.initialize=function(t){return i(this,void 0,Promise,(function(){var e=this;return o(this,(function(r){switch(r.label){case 0:return this.initializePromise?[4,this.initializePromise]:[3,2];case 1:case 3:case 5:return[2,r.sent()];case 2:return void 0===t?[3,4]:(this.initializePromise=t,[4,this.initializePromise]);case 4:return this.initializePromise=i(e,void 0,void 0,(function(){var t=this;return o(this,(function(e){switch(e.label){case 0:return[4,this._acquireLock(-1,(function(){return i(t,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this._initialize()];case 1:return[2,t.sent()]}}))}))}))];case 1:return[2,e.sent()]}}))})),[4,this.initializePromise]}}))}))},t.prototype.setCredentials=function(t){return i(this,void 0,Promise,(function(){var e=this;return o(this,(function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[2,this._acquireLock(-1,(function(){return i(e,void 0,void 0,(function(){return o(this,(function(e){return[2,this.localCredentials.setCredentials(t)]}))}))}))]}}))}))},t.prototype.setAccessKeyCredentials=function(t){return this.localCredentials.setAccessKeyCredentials(t)},t.prototype.getAccessToken=function(){return i(this,void 0,Promise,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return[4,this.initializePromise];case 1:return r.sent(),[4,this.getCredentials()];case 2:return(null==(t=r.sent())?void 0:t.scope)===u.DEFAULT_NODE_ACCESS_SCOPE||(null==t?void 0:t.access_token)?[2,Promise.resolve(t.access_token)]:(e={error:a.ErrorType.UNAUTHENTICATED},[2,Promise.reject(e)])}}))}))},t.prototype.request=function(e,r){var s,u;return i(this,void 0,Promise,(function(){var i,c,h,l,d,p,f,y,_;return o(this,(function(o){switch(o.label){case 0:return r||(r={}),i=this.formatRetry(r.retry,this.retry),r.headers=n(n({},r.headers),((_={})[null===(s=this.i18n)||void 0===s?void 0:s.LANG_HEADER_KEY]=null===(u=this.i18n)||void 0===u?void 0:u.lang,_)),this.headers&&(r.headers=n(n({},this.headers),r.headers)),r.headers[v]||(r.headers[v]=m()),r.headers[g]?[3,2]:[4,this.getDeviceId()];case 1:c=o.sent(),r.headers[g]=c,o.label=2;case 2:return(null==r?void 0:r.withBasicAuth)&&this.basicAuth&&(r.headers.Authorization=this.basicAuth),(null==r?void 0:r.withCredentials)?r.getCredentials?[4,r.getCredentials()]:[3,4]:[3,7];case 3:return l=o.sent(),[3,6];case 4:return[4,this.getCredentials()];case 5:l=o.sent(),o.label=6;case 6:return(h=l)&&(this.tokenInURL?(e.indexOf("?")<0&&(e+="?"),e+="access_token=".concat(h.access_token)):r.headers.Authorization="".concat(h.token_type," ").concat(h.access_token)),[3,8];case 7:this.clientId&&e.indexOf("client_id")<0&&(e+=e.indexOf("?")<0?"?":"&",e+="client_id=".concat(this.clientId)),o.label=8;case 8:e.startsWith("/")&&(e="".concat(this.apiOrigin).concat(this.apiPath).concat(e)),d=null,p=i+1,f=0,o.label=9;case 9:if(!(f<p))return[3,21];o.label=10;case 10:return o.trys.push([10,15,,18]),r.useWxCloud||this.useWxCloud?[4,this.wxCloudCallFunction(e,r)]:[3,12];case 11:return d=o.sent(),[3,14];case 12:return[4,this.baseRequest(e,r)];case 13:d=o.sent(),o.label=14;case 14:if(null==d?void 0:d.code)throw{error:d.code,error_description:d.message,error_uri:new URL(e).pathname};return[3,21];case 15:y=o.sent();try{y.requestId=y.requestId||r.headers[v]||""}catch(t){}return r.withCredentials&&y&&y.error===a.ErrorType.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,17];case 16:return o.sent(),[2,Promise.reject(y)];case 17:return f!==i&&y&&"unreachable"===y.error?[3,18]:[2,Promise.reject(y)];case 18:return[4,this.sleep(t.retryInterval)];case 19:o.sent(),o.label=20;case 20:return f++,[3,9];case 21:return[2,d]}}))}))},t.prototype.wxCloudCallFunction=function(t,e){var r;return i(this,void 0,Promise,(function(){var i,s,u,c,l;return o(this,(function(o){switch(o.label){case 0:i=null,s=null,o.label=1;case 1:o.trys.push([1,7,,8]),u="",o.label=2;case 2:return o.trys.push([2,4,,5]),[4,wx.getRendererUserAgent()];case 3:return u=o.sent(),[3,5];case 4:return o.sent(),[3,5];case 5:return[4,this.wxCloud.callFunction({name:"httpOverCallFunction",data:{url:t,method:e.method,headers:n({origin:"https://servicewechat.com","User-Agent":u},e.headers),body:e.body}})];case 6:return c=o.sent().result,(null===(r=null==c?void 0:c.body)||void 0===r?void 0:r.error_code)?(s=null==c?void 0:c.body).error_uri=(0,h.getPathName)(t):i=null==c?void 0:c.body,[3,8];case 7:return l=o.sent(),s={error:a.ErrorType.UNREACHABLE,error_description:l.message,error_uri:(0,h.getPathName)(t)},[3,8];case 8:if(s)throw s;return[2,i]}}))}))},t.prototype.getCredentials=function(){return i(this,void 0,Promise,(function(){var t=this;return o(this,(function(e){switch(e.label){case 0:return[4,this.initializePromise];case 1:return e.sent(),[2,this._acquireLock(-1,(function(){return i(t,void 0,void 0,(function(){return o(this,(function(t){return[2,this._getCredentials()]}))}))}))]}}))}))},t.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},t.prototype.getCredentialsAsync=function(){return this.getCredentials()},t.prototype.getScope=function(){var t;return i(this,void 0,Promise,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(e=n.sent())?[2,e.scope]:(r="credentials not found",null===(t=this.onCredentialsError)||void 0===t||t.call(this,{msg:r}),[2,this.unAuthenticatedError(r)])}}))}))},t.prototype.getGroups=function(){var t;return i(this,void 0,Promise,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(e=n.sent())?[2,e.groups]:(r="credentials not found",null===(t=this.onCredentialsError)||void 0===t||t.call(this,{msg:r}),[2,this.unAuthenticatedError(r)])}}))}))},t.prototype.refreshToken=function(t,e){return i(this,void 0,Promise,(function(){var r=this;return o(this,(function(n){switch(n.label){case 0:return[4,this.initializePromise];case 1:return n.sent(),[2,this._acquireLock(-1,(function(){return i(r,void 0,void 0,(function(){return o(this,(function(r){return[2,this._refreshToken(t,e)]}))}))}))]}}))}))},t.prototype._refreshToken=function(t,e){return i(this,void 0,Promise,(function(){var r=this;return o(this,(function(n){return[2,this.singlePromise.run("_refreshToken",(function(){return i(r,void 0,void 0,(function(){var r,n,i,s,c,h,l;return o(this,(function(o){switch(o.label){case 0:if((null==t?void 0:t.scope)===u.DEFAULT_NODE_ACCESS_SCOPE)return[2,t];if(!t||!t.refresh_token)return i="no refresh token found in credentials",null===(s=this.onCredentialsError)||void 0===s||s.call(this,{msg:i}),[2,this.unAuthenticatedError(i)];o.label=1;case 1:return o.trys.push([1,4,,7]),[4,this.refreshTokenFunc(t.refresh_token,t)];case 2:return r=o.sent(),[4,this.localCredentials.setCredentials(r)];case 3:return o.sent(),null===(c=this.eventBus)||void 0===c||c.fire(u.EVENTS.AUTH_STATE_CHANGED,{event:u.AUTH_STATE_CHANGED_TYPE.TOKEN_REFRESHED}),[2,r];case 4:if(n=o.sent(),null==e?void 0:e.throwError)throw n;return n.error!==a.ErrorType.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return o.sent(),i=n.error_description,null===(h=this.onCredentialsError)||void 0===h||h.call(this,{msg:i}),[2,this.unAuthenticatedError(i)];case 6:return null===(l=this.onCredentialsError)||void 0===l||l.call(this,{msg:n.error_description}),[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},t.prototype.anonymousLogin=function(t){return i(this,void 0,void 0,(function(){var e=this;return o(this,(function(r){return[2,this.singlePromise.run("_anonymousLogin",(function(){return i(e,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return this.anonymousSignInFunc?[4,this.anonymousSignInFunc(t)]:[3,4];case 1:return e=n.sent(),(r=e)?[3,3]:[4,this.localCredentials.getCredentials()];case 2:r=n.sent(),n.label=3;case 3:return t=r,[3,6];case 4:return[4,this.anonymousSignIn(t)];case 5:t=n.sent(),n.label=6;case 6:return[2,t]}}))}))}))]}))}))},t.prototype.checkRetry=function(e){var r=null;if(("number"!=typeof e||e<t.minRetry||e>t.maxRetry)&&(r={error:a.ErrorType.UNREACHABLE,error_description:"wrong options param: retry"}),r)throw r;return e},t.prototype.formatRetry=function(t,e){return void 0===t?e:this.checkRetry(t)},t.prototype.sleep=function(t){return i(this,void 0,Promise,(function(){return o(this,(function(e){return[2,new Promise((function(e){setTimeout((function(){e()}),t)}))]}))}))},t.prototype.anonymousSignIn=function(t){return i(this,void 0,Promise,(function(){var e=this;return o(this,(function(r){return[2,this.singlePromise.run("_anonymous",(function(){return i(e,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:if(!t||"anonymous"!==t.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];n.label=1;case 1:return n.trys.push([1,4,,7]),[4,this.request(u.ApiUrls.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",withBasicAuth:!0,body:{}})];case 2:return e=n.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return n.sent(),[2,e];case 4:return(r=n.sent()).error!==a.ErrorType.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return n.sent(),[2,this.unAuthenticatedError(r.error_description)];case 6:return[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},t.prototype.defaultRefreshTokenFunc=function(t,e){var r;return i(this,void 0,Promise,(function(){var i,s,a;return o(this,(function(o){switch(o.label){case 0:return void 0===t||""===t?(i="refresh token not found",null===(r=this.onCredentialsError)||void 0===r||r.call(this,{msg:i}),[2,this.unAuthenticatedError(i)]):(s=u.ApiUrls.AUTH_TOKEN_URL,"v2"===(null==e?void 0:e.version)&&(s=u.ApiUrlsV2.AUTH_TOKEN_URL),[4,this.request(s,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:t}})]);case 1:return a=o.sent(),[2,n(n({},a),{version:(null==e?void 0:e.version)||"v1"})]}}))}))},t.prototype.getDeviceId=function(){return i(this,void 0,Promise,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(y)];case 1:return"string"==typeof(t=e.sent())&&t.length>=16&&t.length<=48?[3,3]:(t=(0,c.uuidv4)(),[4,this.storage.setItem(y,t)]);case 2:e.sent(),e.label=3;case 3:return this.deviceID=t,[2,t]}}))}))},t.prototype.unAuthenticatedError=function(t){var e={error:a.ErrorType.UNAUTHENTICATED,error_description:t};return Promise.reject(e)},t.prototype._debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logDebugMessages&&console.log.apply(console,s(["[OAuth2Client]"],t,!1))},t.prototype._initialize=function(){return i(this,void 0,Promise,(function(){var t,e,r,n,i,s;return o(this,(function(o){switch(o.label){case 0:if(o.trys.push([0,11,12,13]),!this.getInitialSession)return this._debug("#_initialize()","no getInitialSession callback set, skipping"),[2,{error:null}];this._debug("#_initialize()","calling getInitialSession callback"),o.label=1;case 1:return o.trys.push([1,9,,10]),[4,this.getInitialSession()];case 2:return s=o.sent(),t=s.data,e=s.error,(null==t?void 0:t.session)?(this._debug("#_initialize()","session obtained from getInitialSession",t.session),[4,this.localCredentials.setCredentials(null==t?void 0:t.session)]):[3,4];case 3:o.sent(),o.label=4;case 4:if(!this.onInitialSessionObtained)return[3,8];this._debug("#_initialize()","calling onInitialSessionObtained callback"),o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.onInitialSessionObtained(t,e)];case 6:return o.sent(),[3,8];case 7:return r=o.sent(),this._debug("#_initialize()","error in onInitialSessionObtained",r),[3,8];case 8:return e?(this._debug("#_initialize()","error from getInitialSession",e),[2,{error:e}]):[2,{error:null}];case 9:return n=o.sent(),this._debug("#_initialize()","exception during getInitialSession",n),[2,{error:n instanceof Error?n:new Error(String(n))}];case 10:return[3,13];case 11:return i=o.sent(),this._debug("#_initialize()","unexpected error",i),[2,{error:i instanceof Error?i:new Error(String(i))}];case 12:return this._debug("#_initialize()","end"),[7];case 13:return[2]}}))}))},t.prototype._acquireLock=function(t,e){return i(this,void 0,Promise,(function(){var r,n,a,u,c=this;return o(this,(function(h){switch(h.label){case 0:this._debug("#_acquireLock","begin",t),h.label=1;case 1:if(h.trys.push([1,,10,11]),this.lockAcquired)return r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=i(c,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,r];case 1:return t.sent(),[4,e()];case 2:return[2,t.sent()]}}))})),this.pendingInLock.push(i(c,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,n];case 1:case 2:return t.sent(),[3,3];case 3:return[2]}}))}))),[2,n];this._debug("#_acquireLock","acquiring lock for client",this.clientId),h.label=2;case 2:return h.trys.push([2,,8,9]),this.lockAcquired=!0,a=e(),this.pendingInLock.push(i(c,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,a];case 1:case 2:return t.sent(),[3,3];case 3:return[2]}}))}))),[4,a];case 3:h.sent(),h.label=4;case 4:return this.pendingInLock.length?(u=s([],this.pendingInLock,!0),[4,Promise.all(u)]):[3,6];case 5:return h.sent(),this.pendingInLock.splice(0,u.length),[3,4];case 6:return[4,a];case 7:return[2,h.sent()];case 8:return this._debug("#_acquireLock","releasing lock for client",this.clientId),this.lockAcquired=!1,[7];case 9:return[3,11];case 10:return this._debug("#_acquireLock","end"),[7];case 11:return[2]}}))}))},t.prototype._getCredentials=function(){var t,e,r;return i(this,void 0,Promise,(function(){var n,i,s;return o(this,(function(o){switch(o.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:if((null==(n=o.sent())?void 0:n.scope)===u.DEFAULT_NODE_ACCESS_SCOPE)return[2,n];if(!n)return s="credentials not found",null===(t=this.onCredentialsError)||void 0===t||t.call(this,{msg:s}),[2,this.unAuthenticatedError(s)];if(!b(n))return[3,12];if(!n.refresh_token)return[3,9];o.label=2;case 2:return o.trys.push([2,4,,8]),[4,this._refreshToken(n)];case 3:return n=o.sent(),[3,8];case 4:return i=o.sent(),"anonymous"!==n.scope?[3,6]:[4,this.anonymousLogin(n)];case 5:return n=o.sent(),[3,7];case 6:return null===(e=this.onCredentialsError)||void 0===e||e.call(this,{msg:i.error_description}),[2,Promise.reject(i)];case 7:return[3,8];case 8:return[3,12];case 9:return"anonymous"!==n.scope?[3,11]:[4,this.anonymousLogin(n)];case 10:return n=o.sent(),[3,12];case 11:return s="no refresh token found in credentials",null===(r=this.onCredentialsError)||void 0===r||r.call(this,{msg:s}),[2,this.unAuthenticatedError(s)];case 12:return[2,n]}}))}))},t.defaultRetry=2,t.minRetry=0,t.maxRetry=5,t.retryInterval=1e3,t}()},344:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.weAppJwtDecodeAll=e.weappJwtDecode=e.base64_url_decode=e.weAtob=e.weBtoa=void 0;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function i(t){var r=t.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(t){return decodeURIComponent((0,e.weAtob)(t).replace(/(.)/g,(function(t){var e=t.charCodeAt(0).toString(16).toUpperCase();return e.length<2&&(e="0".concat(e)),"%".concat(e)})))}(r)}catch(t){return(0,e.weAtob)(r)}}e.weBtoa=function(t){for(var e,n,i,o,s="",a=0,u=(t=String(t)).length%3;a<t.length;){if((n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255||(o=t.charCodeAt(a++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");s+=r.charAt((e=n<<16|i<<8|o)>>18&63)+r.charAt(e>>12&63)+r.charAt(e>>6&63)+r.charAt(63&e)}return u?s.slice(0,u-3)+"===".substring(u):s},e.weAtob=function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!n.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var e;t+="==".slice(2-(3&t.length));for(var i,o,s="",a=0;a<t.length;)e=r.indexOf(t.charAt(a++))<<18|r.indexOf(t.charAt(a++))<<12|(i=r.indexOf(t.charAt(a++)))<<6|(o=r.indexOf(t.charAt(a++))),s+=64===i?String.fromCharCode(e>>16&255):64===o?String.fromCharCode(e>>16&255,e>>8&255):String.fromCharCode(e>>16&255,e>>8&255,255&e);return s},e.base64_url_decode=i,e.weappJwtDecode=function(t,e){if("string"!=typeof t)throw new Error("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(i(t.split(".")[r]))}catch(t){throw new Error("Invalid token specified: ".concat(t)?t.message:0)}},e.weAppJwtDecodeAll=function(t){if("string"!=typeof t)throw new Error("Invalid token specified");try{var e=t.split(".").map((function(t,e){return 2===e?t:JSON.parse(i(t))}));return{claims:e[1],header:e[0],signature:e[2]}}catch(t){throw new Error("Invalid token specified: ".concat(t)?t.message:0)}}},814:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getEncryptInfo=void 0;var i=n(r(12)),o=r(631);e.getEncryptInfo=function(t){var e=void 0===t?{}:t,r=e.publicKey,n=void 0===r?"":r,s=e.payload,a=void 0===s?{}:s;if(!n)return"";try{var u=(0,o.deepClone)(a),c=new i.default;return c.setPublicKey(n),c.encryptLong("object"==typeof u?JSON.stringify(u):u)}catch(t){console.error("encrypt error:",t)}return""}},547:function(t,e){var r=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.SinglePromise=void 0;var i=new Map,o=function(){function t(t){this.clientId=(null==t?void 0:t.clientId)||"",i=i||new Map}return t.prototype.run=function(t,e){return r(this,void 0,Promise,(function(){var o,s=this;return n(this,(function(a){return t="".concat(this.clientId,"_").concat(t),(o=i.get(t))||(o=new Promise((function(o,a){r(s,void 0,void 0,(function(){var r,s,u;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return n.sent(),r=e(),s=o,[4,r];case 2:return s.apply(void 0,[n.sent()]),[3,5];case 3:return u=n.sent(),a(u),[3,5];case 4:return i.delete(t),[7];case 5:return[2]}}))}))})),i.set(t,o)),[2,o]}))}))},t.prototype.runIdlePromise=function(){return Promise.resolve()},t}();e.SinglePromise=o},631:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getPathName=e.deepClone=void 0,e.deepClone=function(t){var r=function(r){for(var n in t)t.hasOwnProperty(n)&&(r[n]=(0,e.deepClone)(t[n]));return r},n=null==t?"NullOrUndefined":Object.prototype.toString.call(t).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(n))return t.slice();switch(n){case"Object":return r(Object.create(Object.getPrototypeOf(t)));case"Array":return r([]);case"Date":return new Date(t.valueOf());case"RegExp":return new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""));default:return t}},e.getPathName=function(t){var e=t.match(/^(?:http(s)?:\/\/[^\/]+)?(\/[^\?#]*)/);return e&&e[2]||""}},425:function(t,e){function r(){if("undefined"==typeof globalThis)return!1;var t=globalThis.wx;if(void 0===t)return!1;if(void 0===globalThis.Page)return!1;if(!t.getDeviceInfo)return!1;if(!t.getStorageSync)return!1;if(!t.setStorageSync)return!1;if(!t.connectSocket)return!1;if(!t.request)return!1;try{if(!t.getDeviceInfo())return!1;if("qq"===t.getDeviceInfo().platform)return!1}catch(t){return!1}return!0}Object.defineProperty(e,"__esModule",{value:!0}),e.isInMpWebView=e.isMp=void 0,e.isMp=r;var n=!1;function i(){n=n||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{r()||(n=n||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?i():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",i,!1))}catch(t){}e.isInMpWebView=function(){return n}},639:function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){if(this.params={},"string"==typeof t)this.parse(t);else if(t&&"object"==typeof t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&this.append(e,t[e])}return t.prototype.parse=function(t){var e=this;t.split("&").forEach((function(t){var r=t.split("=").map(decodeURIComponent),n=r[0],i=r[1];e.append(n,i)}))},t.prototype.append=function(t,e){this.params[t]?this.params[t]=this.params[t].concat([e]):this.params[t]=[e]},t.prototype.get=function(t){return this.params[t]?this.params[t][0]:null},t.prototype.getAll=function(t){return this.params[t]||[]},t.prototype.delete=function(t){delete this.params[t]},t.prototype.has=function(t){return Object.prototype.hasOwnProperty.call(this.params,t)},t.prototype.set=function(t,e){this.params[t]=[e]},t.prototype.toString=function(){var t=[],e=function(e){Object.prototype.hasOwnProperty.call(r.params,e)&&r.params[e].forEach((function(r){t.push("".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(r)))}))},r=this;for(var n in this.params)e(n);return t.join("&")},t}();e.default=r},873:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.uuidv4=void 0,e.uuidv4=function(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},563:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var a,u=s(r(92)),c=r(962);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(a=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(t,e){for(var r=0,i=(0,c.isArray)(t)?t:[t];r<i.length;r++){var o=i[r],s=o.isMatch,a=o.genAdapter,u=o.runtime;if(s())return{adapter:n({isMatch:s},a(e)),runtime:u}}},e.useDefaultAdapter=function(){return{adapter:n({},u.genAdapter()),runtime:a.WEB}}},92:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRequest=e.genAdapter=void 0;var u=r(764),c=r(962),h=r(464),l=function(t){function e(e){var r=t.call(this)||this,n=e.timeout,i=e.timeoutMsg,o=e.restrictedMethods;return r.timeout=n||0,r.timeoutMsg=i||"请求超时",r.restrictedMethods=o||["get","post","upload","download"],r}return i(e,t),e.prototype.get=function(t){return this.request(o(o({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(o(o({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(o(o({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,n=t.name,i=t.method,s=t.headers,a=void 0===s?{}:s,u={post:"post",put:"put"}[null==i?void 0:i.toLowerCase()]||"put",c=new FormData;return"post"===u?(Object.keys(e).forEach((function(t){c.append(t,e[t])})),c.append("key",n),c.append("file",r),this.request(o(o({},t),{data:c,method:u}),this.restrictedMethods.includes("upload"))):this.request(o(o({},t),{method:"put",headers:a,body:r}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return s(this,void 0,Promise,(function(){var e,r,n,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.get(o(o({},t),{headers:{},responseType:"blob"}))];case 1:return e=s.sent().data,r=window.URL.createObjectURL(new Blob([e])),n=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(i=document.createElement("a")).href=r,i.setAttribute("download",n),i.style.display="none",document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(r),document.body.removeChild(i),[3,3];case 2:return s.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))}))},e.prototype.fetch=function(t){var e;return s(this,void 0,Promise,(function(){var r,n,i,u,c,h,l,d,p,f,v,g,y,m=this;return a(this,(function(_){switch(_.label){case 0:return r=new AbortController,n=t.url,i=t.enableAbort,u=void 0!==i&&i,c=t.stream,h=void 0!==c&&c,l=t.signal,d=t.timeout,p=t.shouldThrowOnError,f=void 0===p||p,v=null!=d?d:this.timeout,l&&(l.aborted&&r.abort(),l.addEventListener("abort",(function(){return r.abort()}))),g=null,u&&v&&(g=setTimeout((function(){console.warn(m.timeoutMsg),r.abort(new Error(m.timeoutMsg))}),v)),[4,fetch(n,o(o({},t),{signal:r.signal})).then((function(t){return s(m,void 0,void 0,(function(){var e,r,n;return a(this,(function(i){switch(i.label){case 0:return clearTimeout(g),f?t.ok?(e=t,[3,3]):[3,1]:[3,4];case 1:return n=(r=Promise).reject,[4,t.json()];case 2:e=n.apply(r,[i.sent()]),i.label=3;case 3:return[2,e];case 4:return[2,t]}}))}))})).catch((function(t){if(clearTimeout(g),f)return Promise.reject(t)}))];case 1:return y=_.sent(),[2,{data:h?y.body:(null===(e=y.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))?y.json():y.text(),statusCode:y.status,header:y.headers}]}}))}))},e.prototype.request=function(t,e){var r=this;void 0===e&&(e=!1);var n=String(t.method).toLowerCase()||"get";return new Promise((function(i){var o,s,a=t.url,u=t.headers,l=void 0===u?{}:u,d=t.data,p=t.responseType,f=t.withCredentials,v=t.body,g=t.onUploadProgress,y=(0,c.formatUrl)((0,h.getProtocol)(),a,"get"===n?d:{}),m=new XMLHttpRequest;m.open(n,y),p&&(m.responseType=p),Object.keys(l).forEach((function(t){m.setRequestHeader(t,l[t])})),g&&m.upload.addEventListener("progress",g),m.onreadystatechange=function(){var t={};if(4===m.readyState){var e=m.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach((function(t){var e=t.split(": "),n=e.shift().toLowerCase(),i=e.join(": ");r[n]=i})),t.header=r,t.statusCode=m.status;try{t.data="blob"===p?m.response:JSON.parse(m.responseText)}catch(e){t.data="blob"===p?m.response:m.responseText}clearTimeout(o),i(t)}},e&&r.timeout&&(o=setTimeout((function(){console.warn(r.timeoutMsg),m.abort()}),r.timeout)),s=(0,c.isFormData)(d)?d:"application/x-www-form-urlencoded"===l["content-type"]?(0,c.toQueryString)(d):v||(d?JSON.stringify(d):void 0),f&&(m.withCredentials=!0),m.send(s)}))},e}(u.AbstractSDKRequest);e.WebRequest=l,e.genAdapter=function(){return{type:"default",root:window,reqClass:l,wsClass:WebSocket,localStorage:localStorage}}},464:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.COMMUNITY_SITE_URL=e.IS_DEBUG_MODE=e.getProtocol=e.setProtocol=e.getSdkName=e.setSdkName=void 0;var r="@cloudbase/js-sdk";e.setSdkName=function(t){r=t},e.getSdkName=function(){return r};var n="https:";e.setProtocol=function(t){n=t},e.getProtocol=function(){return n},e.IS_DEBUG_MODE=!1,e.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},519:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ERRORS=void 0,e.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},778:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.OATUH_LOGINTYPE=void 0,i(r(464),e),i(r(519),e),e.OATUH_LOGINTYPE="constants"},517:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.catchErrorsDecorator=void 0;var o=r(962),s=r(778),a=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(a=-1!==navigator.userAgent.indexOf("Firefox"));var u=a?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,c=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function h(t){var e=t.err,r=t.className,n=t.methodName,i=t.sourceLink;if(!i)return null;var o,s=e.stack.split("\n"),u=a?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]\\s*\\(.*\\)$")),h=a?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]")),l=s.findIndex((function(t){return u.test(t)}));if(-1!==l){var d=s.filter((function(t,e){return e>l}));d.unshift(s[l].replace(h,"".concat(r,".").concat(n)).replace(c,i)),(o=new Error).stack="".concat(a?"@debugger":"Error","\n").concat(d.join("\n"))}return o}e.catchErrorsDecorator=function(t){var e=t.mode,r=void 0===e?"async":e,a=t.customInfo,l=void 0===a?{}:a,d=t.title,p=t.messages,f=void 0===p?[]:p;return function(t,e,a){if(s.IS_DEBUG_MODE){var p=l.className||t.constructor.name,v=l.methodName||e,g=a.value,y=function(){var t="",e=(new Error).stack.split("\n"),r=e.findIndex((function(t){return u.test(t)}));if(-1!==r){var n=c.exec(e[r+1]||"");t=n?n[0]:""}return t}();a.value="sync"===r?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=h({err:new Error,className:p,methodName:v,sourceLink:y});try{return g.apply(this,t)}catch(t){var n=t,i=t.message,s=t.error,a=t.error_description,u={title:d||"".concat(p,".").concat(v," failed"),content:[{type:"error",body:t}]};if(i&&/^\{.*\}$/.test(i)){var c=JSON.parse(i);u.subtitle=i,c.code&&(r?(r.code=c.code,r.msg=c.msg):(t.code=c.code,t.message=c.msg),n=r||t,u.content=f.map((function(t){return{type:"info",body:t}})))}throw s&&a&&(u.subtitle=a,r?(r.code=s,r.msg=a):(t.code=s,t.message=a),n=r||t,u.content=f.map((function(t){return{type:"info",body:t}}))),(0,o.printGroupLog)(u),n}}:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(this,void 0,void 0,(function(){var e,r,n,s,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:e=h({err:new Error,className:p,methodName:v,sourceLink:y}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,g.apply(this,t)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),n=r,s=r.message,a=r.error,u=r.error_description,c={title:d||"".concat(p,".").concat(v," failed"),content:[{type:"error",body:r}]},s&&/^\{.*\}$/.test(s)&&(l=JSON.parse(s),c.subtitle=l,l.code&&(e?(e.code=l.code,e.message=l.msg):(r.code=l.code,r.message=l.msg),n=e||r,c.content=f.map((function(t){return{type:"info",body:t}})))),a&&u&&(c.subtitle=u,e?(e.code=a,e.msg=u):(r.code=a,r.message=u),n=e||r,c.content=f.map((function(t){return{type:"info",body:t}}))),(0,o.printGroupLog)(c),n;case 4:return[2]}}))}))}}}}},260:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(517),e)},683:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.langEvent=e.AbortController=e.jwt=e.helpers=e.utils=e.events=e.cache=e.adapters=e.constants=void 0;var a=o(r(778));e.constants=a;var u=o(r(563));e.adapters=u;var c=o(r(865));e.cache=c;var h=o(r(940));e.events=h;var l=o(r(991));e.langEvent=l;var d=o(r(962));e.utils=d;var p=o(r(260));e.helpers=p;var f=s(r(829));e.AbortController=f.default;var v={decode:s(r(107)).default};e.jwt=v},829:function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){var t=this;this.listeners=[],this.signal={aborted:!1,addEventListener:function(e,r){"abort"===e&&t.listeners.push(r)}}}return t.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.listeners.forEach((function(t){return t()})))},t}();e.default=r},865:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseCache=void 0;var a=r(764),u=r(962),c=r(778),h=function(t){function e(e){var r=t.call(this)||this;return r.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return i(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}(a.AbstractStorage),l=function(){function t(t){this.keys={};var e=t.persistence,r=t.platformInfo,n=void 0===r?{}:r,i=t.keys,o=void 0===i?{}:i;this.platformInfo=n,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:((0,u.printWarn)(c.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new h(e.root));case"none":return new h(e.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=o)}return Object.defineProperty(t.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),t.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this.storage)try{var n={version:r||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(n))}catch(t){throw new Error(JSON.stringify({code:c.ERRORS.OPERATION_FAIL,msg:"[".concat((0,c.getSdkName)(),"][").concat(c.ERRORS.OPERATION_FAIL,"]setStore failed"),info:t}))}}else(0,u.printWarn)(c.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),n={version:r||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(n))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}}))}))},t.prototype.getStore=function(t,e){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var n=this.storage.getItem(t);return n&&n.indexOf(e)>=0?JSON.parse(n).content:""}(0,u.printWarn)(c.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(n=i.sent())&&n.indexOf(e)>=0?[2,JSON.parse(n).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):(0,u.printWarn)(c.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))},t}();e.CloudbaseCache=l},940:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.activateEvent=e.addEventListener=e.CloudbaseEventEmitter=e.IErrorEvent=e.CloudbaseEvent=void 0;var s=r(962),a=function(t,e){this.data=e||null,this.name=t};e.CloudbaseEvent=a;var u=function(t){function e(e,r){var n=t.call(this,"error",{error:e,data:r})||this;return n.error=e,n}return i(e,t),e}(a);e.IErrorEvent=u;var c=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if((0,s.isInstanceOf)(t,u))return console.error(t.error),this;var r=(0,s.isString)(t)?new a(t,e||{}):t,n=r.name;if(this.listens(n)){r.target=this;for(var i=0,c=this.listeners[n]?o([],this.listeners[n],!0):[];i<c.length;i++)c[i].call(this,r)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}();e.CloudbaseEventEmitter=c;var h=new c;e.addEventListener=function(t,e){h.on(t,e)},e.activateEvent=function(t,e){void 0===e&&(e={}),h.fire(t,e)},e.removeEventListener=function(t,e){h.off(t,e)}},991:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.LANG_CHANGE_EVENT=e.bus=void 0;var n=r(940);e.bus=new n.CloudbaseEventEmitter,e.LANG_CHANGE_EVENT="lang_change"},962:function(t,e,r){var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.parseCaptcha=e.parseQueryString=e.transformPhone=e.sleep=e.printGroupLog=e.throwError=e.printInfo=e.printError=e.printWarn=e.execCallback=e.createPromiseCallback=e.removeParam=e.getHash=e.getQuery=e.toQueryString=e.formatUrl=e.generateRequestId=e.genSeqId=e.isFormData=e.isInstanceOf=e.isNull=e.isPalinObject=e.isUndefined=e.isString=e.isArray=void 0;var i=r(778);e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isUndefined=function(t){return void 0===t},e.isPalinObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isNull=function(t){return"[object Null]"===Object.prototype.toString.call(t)},e.isInstanceOf=function(t,e){return t instanceof e},e.isFormData=function(t){return"[object FormData]"===Object.prototype.toString.call(t)},e.genSeqId=function(){return Math.random().toString(16).slice(2)},e.generateRequestId=function(){var t=(new Date).getTime(),e=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(r){var n=16*Math.random();return t>0?(n=(t+n)%16|0,t=Math.floor(t/16)):(n=(e+n)%16|0,e=Math.floor(e/16)),("x"===r?n:7&n|8).toString(16)}))},e.formatUrl=function(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),i="";return Object.keys(r).forEach((function(t){""===i?!n&&(e+="?"):i+="&",i+="".concat(t,"=").concat(encodeURIComponent(r[t]))})),/^http(s)?:\/\//.test(e+=i)?e:"".concat(t).concat(e)},e.toQueryString=function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(r){e.push("".concat(r,"=").concat(encodeURIComponent(t[r])))})),e.join("&")},e.getQuery=function(t,e){if("undefined"==typeof window)return!1;var r=e||decodeURIComponent(window.location.search),n=new RegExp("(^|&)".concat(t,"=([^&]*)(&|$)")),i=r.substr(r.indexOf("?")+1).match(n);return null!=i?i[2]:""},e.getHash=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]".concat(t,"=([^&#]*)")));return e?e[1]:""},e.removeParam=function(t,e){var r=e.split("?")[0],n=[],i=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==i){for(var o=(n=i.split("&")).length-1;o>=0;o-=1)n[o].split("=")[0]===t&&n.splice(o,1);r="".concat(r,"?").concat(n.join("&"))}return r},e.createPromiseCallback=function(){var t={};if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var r=new Promise((function(e,r){t=function(t,n){return t?r(t):e(n)}}));return t.promise=r,t},e.execCallback=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},e.printWarn=function(t,e){console.warn("[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e))},e.printError=function(t,e){console.error({code:t,msg:"[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e)})},e.printInfo=function(t,e){console.log("[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e))},e.throwError=function(t,e){throw new Error(JSON.stringify({code:t,msg:"[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e)}))},e.printGroupLog=function(t){var e,r=t.title,n=t.subtitle,i=void 0===n?"":n,o=t.content,s=void 0===o?[]:o,a=t.printTrace,u=void 0!==a&&a,c=t.collapsed;void 0!==c&&c?(console.groupCollapsed||console.error)(r,i):(console.group||console.error)(r,i);for(var h=0,l=s;h<l.length;h++){var d=l[h],p=d.type,f=d.body;switch(p){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}u&&(console.trace||console.log)("stack trace:"),null===(e=console.groupEnd)||void 0===e||e.call(console)},e.sleep=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},e.transformPhone=function(t){return"+86".concat(t)},e.parseQueryString=function(t){t=t.replace(/^\?/,"");var e={};return t.split("&").forEach((function(t){var r=t.split("="),n=r[0],i=r[1];n=decodeURIComponent(n),i=decodeURIComponent(i),n&&(e[n]?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i)})),e},e.parseCaptcha=function(t){var r={},i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){t=i[1];var o=i[2];o&&(r=(0,e.parseQueryString)(o))}var s=r.token,a=n(r,["token"]);return/^data:/.test(t)&&!s?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(t)}:s?{state:a.state,token:s,captchaData:t}:{error:"unimplemented",error_description:"need to impl captcha data"}}},12:function(t,e,r){var n;if(r.r(e),!globalThis.IS_MP_BUILD){var i="undefined"!=typeof globalThis?globalThis.navigator:window.globalThis,o="0123456789abcdefghijklmnopqrstuvwxyz";function M(t){return o.charAt(t)}function j(t,e){return t&e}function q(t,e){return t|e}function B(t,e){return t^e}function V(t,e){return t&~e}function H(t){if(0==t)return-1;var e=0;return 65535&t||(t>>=16,e+=16),255&t||(t>>=8,e+=8),15&t||(t>>=4,e+=4),3&t||(t>>=2,e+=2),1&t||++e,e}function W(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function G(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=s.charAt(r>>6)+s.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=s.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=s.charAt(r>>2)+s.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function F(t){var e,r="",n=0,i=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e){var o=s.indexOf(t.charAt(e));o<0||(0==n?(r+=M(o>>2),i=3&o,n=1):1==n?(r+=M(i<<2|o>>4),i=15&o,n=2):2==n?(r+=M(i),r+=M(o>>2),i=3&o,n=3):(r+=M(i<<2|o>>4),r+=M(15&o),n=0))}return 1==n&&(r+=M(i<<2)),r}var a,u,c={decode:function(t){var e;if(void 0===a){var r="0123456789ABCDEF";for(a={},e=0;e<16;++e)a[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)a[r.charAt(e)]=e;for(e=0;e<8;++e)a[" \f\n\r\t \u2028\u2029".charAt(e)]=-1}var n=[],i=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=a[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);i|=s,++o>=2?(n[n.length]=i,i=0,o=0):i<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},h={decode:function(t){var e;if(void 0===u){for(u=Object.create(null),e=0;e<64;++e)u["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;e<9;++e)u["= \f\n\r\t \u2028\u2029".charAt(e)]=-1}var r=[],n=0,i=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;if(-1!=(o=u[o])){if(void 0===o)throw new Error("Illegal character at offset "+e);n|=o,++i>=4?(r[r.length]=n>>16,r[r.length]=n>>8&255,r[r.length]=255&n,n=0,i=0):n<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=n>>10;break;case 3:r[r.length]=n>>16,r[r.length]=n>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=h.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return h.decode(t)}},l=1e13;class Y{constructor(t){this.buf=[+t||0]}mulAdd(t,e){var r,n,i=this.buf,o=i.length;for(r=0;r<o;++r)(n=i[r]*t+e)<l?e=0:n-=(e=0|n/l)*l,i[r]=n;e>0&&(i[r]=e)}sub(t){var e,r,n=this.buf,i=n.length;for(e=0;e<i;++e)(r=n[e]-t)<0?(r+=l,t=1):t=0,n[e]=r;for(;0===n[n.length-1];)n.pop()}toString(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,r=e[e.length-1].toString(),n=e.length-2;n>=0;--n)r+=(l+e[n]).toString().substring(1);return r}valueOf(){for(var t=this.buf,e=0,r=t.length-1;r>=0;--r)e=e*l+t[r];return e}simplify(){var t=this.buf;return 1==t.length?t[0]:this}}var d,p=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,f=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function K(t,e){return t.length>e&&(t=t.substring(0,e)+"…"),t}class z{constructor(t,e){this.hexDigits="0123456789ABCDEF",t instanceof z?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}get(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]}hexByte(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)}hexDump(t,e,r){for(var n="",i=t;i<e;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n}isASCII(t,e){for(var r=t;r<e;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0}parseStringISO(t,e){for(var r="",n=t;n<e;++n)r+=String.fromCharCode(this.get(n));return r}parseStringUTF(t,e){for(var r="",n=t;n<e;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r}parseStringBMP(t,e){for(var r,n,i="",o=t;o<e;)r=this.get(o++),n=this.get(o++),i+=String.fromCharCode(r<<8|n);return i}parseTime(t,e,r){var n=this.parseStringISO(t,e),i=(r?p:f).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n}parseInteger(t,e){for(var r,n=this.get(t),i=n>127,o=i?255:0,s="";n==o&&++t<e;)n=this.get(t);if(0==(r=e-t))return i?-1:0;if(r>4){for(s=n,r<<=3;!(128&(+s^o));)s=+s<<1,--r;s="("+r+" bit)\n"}i&&(n-=256);for(var a=new Y(n),u=t+1;u<e;++u)a.mulAdd(256,this.get(u));return s+a.toString()}parseBitString(t,e,r){for(var n=this.get(t),i="("+((e-t-1<<3)-n)+" bit)\n",o="",s=t+1;s<e;++s){for(var a=this.get(s),u=s==e-1?n:0,c=7;c>=u;--c)o+=a>>c&1?"1":"0";if(o.length>r)return i+K(o,r)}return i+o}parseOctetString(t,e,r){if(this.isASCII(t,e))return K(this.parseStringISO(t,e),r);var n=e-t,i="("+n+" byte)\n";n>(r/=2)&&(e=t+r);for(var o=t;o<e;++o)i+=this.hexByte(this.get(o));return n>r&&(i+="…"),i}parseOID(t,e,r){for(var n="",i=new Y,o=0,s=t;s<e;++s){var a=this.get(s);if(i.mulAdd(128,127&a),o+=7,!(128&a)){if(""===n)if((i=i.simplify())instanceof Y)i.sub(80),n="2."+i.toString();else{var u=i<80?i<40?0:1:2;n=u+"."+(i-40*u)}else n+="."+i.toString();if(n.length>r)return K(n,r);i=new Y,o=0}}return o>0&&(n+=".incomplete"),n}}class J{constructor(t,e,r,n,i){if(!(n instanceof Q))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=r,this.tag=n,this.sub=i}typeName(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}}content(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return K(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return K(this.stream.parseStringISO(e,e+r),t);case 30:return K(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null}toString(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"}toPrettyString(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var r=0,n=this.sub.length;r<n;++r)e+=this.sub[r].toPrettyString(t)}return e}posStart(){return this.stream.pos}posContent(){return this.stream.pos+this.header}posEnd(){return this.stream.pos+this.header+Math.abs(this.length)}toHexString(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)}static decodeLength(t){var e=t.get(),r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var n=0;n<r;++n)e=256*e+t.get();return e}getHexStringValue(){var t=this.toHexString(),e=2*this.header,r=2*this.length;return t.substr(e,r)}static decode(t){var e;e=t instanceof z?t:new z(t,0);var r=new z(e),n=new Q(e),i=J.decodeLength(e),o=e.pos,s=o-r.pos,a=null,u=function(){var t=[];if(null!==i){for(var r=o+i;e.pos<r;)t[t.length]=J.decode(e);if(e.pos!=r)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var n=J.decode(e);if(n.tag.isEOC())break;t[t.length]=n}i=o-e.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return t};if(n.tagConstructed)a=u();else if(n.isUniversal()&&(3==n.tagNumber||4==n.tagNumber))try{if(3==n.tagNumber&&0!=e.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");a=u();for(var c=0;c<a.length;++c)if(a[c].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){a=null}if(null===a){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);e.pos=o+Math.abs(i)}return new J(r,s,i,n,a)}}class Q{constructor(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=!!(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new Y;do{e=t.get(),r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}isUniversal(){return 0===this.tagClass}isEOC(){return 0===this.tagClass&&0===this.tagNumber}}var v=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],g=(1<<26)/v[v.length-1];class Z{constructor(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}toString(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=M(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=M(r));return i?o:"0"}negate(){var t=$();return Z.ZERO.subTo(this,t),t}abs(){return this.s<0?this.negate():this}compareTo(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0}bitLength(){return this.t<=0?0:this.DB*(this.t-1)+ot(this[this.t-1]^this.s&this.DM)}mod(t){var e=$();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Z.ZERO)>0&&t.subTo(e,e),e}modPowInt(t,e){var r;return r=t<256||e.isEven()?new m(e):new _(e),this.exp(t,r)}clone(){var t=$();return this.copyTo(t),t}intValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}byteValue(){return 0==this.t?this.s:this[0]<<24>>24}shortValue(){return 0==this.t?this.s:this[0]<<16>>16}signum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}toByteArray(){var t=this.t,e=[];e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e}equals(t){return 0==this.compareTo(t)}min(t){return this.compareTo(t)<0?this:t}max(t){return this.compareTo(t)>0?this:t}and(t){var e=$();return this.bitwiseTo(t,j,e),e}or(t){var e=$();return this.bitwiseTo(t,q,e),e}xor(t){var e=$();return this.bitwiseTo(t,B,e),e}andNot(t){var e=$();return this.bitwiseTo(t,V,e),e}not(){for(var t=$(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}shiftLeft(t){var e=$();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}shiftRight(t){var e=$();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}getLowestSetBit(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+H(this[t]);return this.s<0?this.t*this.DB:-1}bitCount(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=W(this[r]^e);return t}testBit(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:!!(this[e]&1<<t%this.DB)}setBit(t){return this.changeBit(t,q)}clearBit(t){return this.changeBit(t,V)}flipBit(t){return this.changeBit(t,B)}add(t){var e=$();return this.addTo(t,e),e}subtract(t){var e=$();return this.subTo(t,e),e}multiply(t){var e=$();return this.multiplyTo(t,e),e}divide(t){var e=$();return this.divRemTo(t,e,null),e}remainder(t){var e=$();return this.divRemTo(t,null,e),e}divideAndRemainder(t){var e=$(),r=$();return this.divRemTo(t,e,r),[e,r]}modPow(t,e){var r,n,i=t.bitLength(),o=it(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new m(e):e.isEven()?new b(e):new _(e);var s=[],a=3,u=r-1,c=(1<<r)-1;if(s[1]=n.convert(this),r>1){var h=$();for(n.sqrTo(s[1],h);a<=c;)s[a]=$(),n.mulTo(h,s[a-2],s[a]),a+=2}var l,d,p=t.t-1,f=!0,v=$();for(i=ot(t[p])-1;p>=0;){for(i>=u?l=t[p]>>i-u&c:(l=(t[p]&(1<<i+1)-1)<<u-i,p>0&&(l|=t[p-1]>>this.DB+i-u)),a=r;!(1&l);)l>>=1,--a;if((i-=a)<0&&(i+=this.DB,--p),f)s[l].copyTo(o),f=!1;else{for(;a>1;)n.sqrTo(o,v),n.sqrTo(v,o),a-=2;a>0?n.sqrTo(o,v):(d=o,o=v,v=d),n.mulTo(v,s[l],o)}for(;p>=0&&!(t[p]&1<<i);)n.sqrTo(o,v),d=o,o=v,v=d,--i<0&&(i=this.DB-1,--p)}return n.revert(o)}modInverse(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return Z.ZERO;for(var r=t.clone(),n=this.clone(),i=it(1),o=it(0),s=it(0),a=it(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(t,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(s,i),o.subTo(a,o)):(n.subTo(r,n),e&&s.subTo(i,s),a.subTo(o,a))}return 0!=n.compareTo(Z.ONE)?Z.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a}pow(t){return this.exp(t,new y)}gcd(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}isProbablePrime(t){var e,r=this.abs();if(1==r.t&&r[0]<=v[v.length-1]){for(e=0;e<v.length;++e)if(r[0]==v[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<v.length;){for(var n=v[e],i=e+1;i<v.length&&n<g;)n*=v[i++];for(n=r.modInt(n);e<i;)if(n%v[e++]==0)return!1}return r.millerRabin(t)}copyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}fromInt(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}fromString(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,o=0;--n>=0;){var s=8==r?255&+t[n]:nt(t,n);s<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=s:o+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&Z.ZERO.subTo(this,this)}clamp(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}dlShiftTo(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}drShiftTo(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}lShiftTo(t,e){for(var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,o=Math.floor(t/this.DB),s=this.s<<r&this.DM,a=this.t-1;a>=0;--a)e[a+o+1]=this[a]>>n|s,s=(this[a]&i)<<r;for(a=o-1;a>=0;--a)e[a]=0;e[o]=s,e.t=this.t+o+1,e.s=this.s,e.clamp()}rShiftTo(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<i,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}}subTo(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}multiplyTo(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e[i]=0;for(i=0;i<n.t;++i)e[i+r.t]=r.am(0,n[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&Z.ZERO.subTo(e,e)}squareTo(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}divRemTo(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=$());var o=$(),s=this.s,a=t.s,u=this.DB-ot(n[n.t-1]);u>0?(n.lShiftTo(u,o),i.lShiftTo(u,r)):(n.copyTo(o),i.copyTo(r));var c=o.t,h=o[c-1];if(0!=h){var l=h*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),d=this.FV/l,p=(1<<this.F1)/l,f=1<<this.F2,v=r.t,g=v-c,y=null==e?$():e;for(o.dlShiftTo(g,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),Z.ONE.dlShiftTo(c,y),y.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--g>=0;){var m=r[--v]==h?this.DM:Math.floor(r[v]*d+(r[v-1]+f)*p);if((r[v]+=o.am(0,m,r,g,0,c))<m)for(o.dlShiftTo(g,y),r.subTo(y,r);r[v]<--m;)r.subTo(y,r)}null!=e&&(r.drShiftTo(c,e),s!=a&&Z.ZERO.subTo(e,e)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&Z.ZERO.subTo(r,r)}}}invDigit(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e}isEven(){return 0==(this.t>0?1&this[0]:this.s)}exp(t,e){if(t>4294967295||t<1)return Z.ONE;var r=$(),n=$(),i=e.convert(this),o=ot(t)-1;for(i.copyTo(r);--o>=0;)if(e.sqrTo(r,n),(t&1<<o)>0)e.mulTo(n,i,r);else{var s=r;r=n,n=s}return e.revert(r)}chunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}toRadix(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=it(r),i=$(),o=$(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s}fromRadix(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,o=0,s=0,a=0;a<t.length;++a){var u=nt(t,a);u<0?"-"==t.charAt(a)&&0==this.signum()&&(i=!0):(s=e*s+u,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),i&&Z.ZERO.subTo(this,this)}fromNumber(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Z.ONE.shiftLeft(t-1),q,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Z.ONE.shiftLeft(t-1),this);else{var n=[],i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}bitwiseTo(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()}changeBit(t,e){var r=Z.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}addTo(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}dMultiply(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}dAddOffset(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}multiplyLowerTo(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()}multiplyUpperTo(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)}modInt(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r}millerRabin(t){var e=this.subtract(Z.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var n=e.shiftRight(r);(t=t+1>>1)>v.length&&(t=v.length);for(var i=$(),o=0;o<t;++o){i.fromInt(v[Math.floor(Math.random()*v.length)]);var s=i.modPow(n,this);if(0!=s.compareTo(Z.ONE)&&0!=s.compareTo(e)){for(var a=1;a++<r&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(Z.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0}square(){var t=$();return this.squareTo(t),t}gcda(t,e){var r=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var o=r.getLowestSetBit(),s=n.getLowestSetBit();if(s<0)e(r);else{o<s&&(s=o),s>0&&(r.rShiftTo(s,r),n.rShiftTo(s,n));var a=()=>{(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(a,0):(s>0&&n.lShiftTo(s,n),setTimeout((function(){e(n)}),0))};setTimeout(a,10)}}fromNumberAsync(t,e,r,n){if("number"==typeof e)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Z.ONE.shiftLeft(t-1),q,this),this.isEven()&&this.dAddOffset(1,0);var i=this,o=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(Z.ONE.shiftLeft(t-1),i),i.isProbablePrime(e)?setTimeout((function(){n()}),0):setTimeout(o,0)};setTimeout(o,0)}else{var s=[],a=7&t;s.length=1+(t>>3),e.nextBytes(s),a>0?s[0]&=(1<<a)-1:s[0]=0,this.fromString(s,256)}}}var y=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),m=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),_=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return t.prototype.convert=function(t){var e=$();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(Z.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=$();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),b=function(){function t(t){this.m=t,this.r2=$(),this.q3=$(),Z.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=$();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function $(){return new Z(null)}function X(t,e){return new Z(t,e)}function tt(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i}function et(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,h=a*u+c*s;i=((u=s*u+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i}function rt(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,h=a*u+c*s;i=((u=s*u+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+a*c,r[n++]=268435455&u}return i}void 0!==i&&"Microsoft Internet Explorer"==(null==i?void 0:i.appName)?(Z.prototype.am=et,d=30):"Netscape"!=(null==i?void 0:i.appName)?(Z.prototype.am=tt,d=26):(Z.prototype.am=rt,d=28),Z.prototype.DB=d,Z.prototype.DM=(1<<d)-1,Z.prototype.DV=1<<d,Z.prototype.FV=Math.pow(2,52),Z.prototype.F1=52-d,Z.prototype.F2=2*d-52;var E,I,w=[];for(E="0".charCodeAt(0),I=0;I<=9;++I)w[E++]=I;for(E="a".charCodeAt(0),I=10;I<36;++I)w[E++]=I;for(E="A".charCodeAt(0),I=10;I<36;++I)w[E++]=I;function nt(t,e){var r=w[t.charCodeAt(e)];return null==r?-1:r}function it(t){var e=$();return e.fromInt(t),e}function ot(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}Z.ZERO=it(0),Z.ONE=it(1);class st{constructor(){this.i=0,this.j=0,this.S=[]}init(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0}next(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}}var A,S,T=null;if(null==T){T=[],S=0;var P,O,R=void 0;if("undefined"!=typeof window&&null!==(P=window)&&void 0!==P&&P.crypto&&null!==(O=window)&&void 0!==O&&O.crypto.getRandomValues){var C,U=new Uint32Array(256);for(null===(C=window)||void 0===C||C.crypto.getRandomValues(U),R=0;R<U.length;++R)T[S++]=255&U[R]}var N,D,L,k=function(t){var e,r,n;if(this.count=this.count||0,this.count>=256||S>=256){if("undefined"!=typeof window)if(null!==(e=window)&&void 0!==e&&e.removeEventListener)null===(n=window)||void 0===n||n.removeEventListener("mousemove",k,!1);else if(null!==(r=window)&&void 0!==r&&r.detachEvent){var i;null===(i=window)||void 0===i||i.detachEvent("onmousemove",k)}}else try{var o=t.x+t.y;T[S++]=255&o,this.count+=1}catch(t){}};if("undefined"!=typeof window)if(null!==(N=window)&&void 0!==N&&N.addEventListener)null===(L=window)||void 0===L||L.addEventListener("mousemove",k,!1);else if(null!==(D=window)&&void 0!==D&&D.attachEvent){var x;null===(x=window)||void 0===x||x.attachEvent("onmousemove",k)}}function at(){if(null==A){for(A=new st;S<256;){var t=Math.floor(65536*Math.random());T[S++]=255&t}for(A.init(T),S=0;S<T.length;++S)T[S]=0;S=0}return A.next()}class ut{constructor(){}nextBytes(t){for(var e=0;e<t.length;++e)t[e]=at()}}function ct(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var o=new ut,s=[];e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);r[--e]=s[0]}return r[--e]=2,r[--e]=0,new Z(r)}class ht{constructor(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}doPublic(t){return t.modPowInt(this.e,this.n)}doPrivate(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)}setPublic(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=X(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")}encrypt(t){var e=ct(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var n=r.toString(16);return 1&n.length?"0"+n:n}encryptLong(t){var e=this,r=(this.n.bitLength()+7>>3)-11;try{var n="";return t.length>r?(t.match(/.{1,117}/g).forEach((function(t){var r=e.encrypt(t);n+=r})),G(n)):G(this.encrypt(t))}catch(t){return!1}}decryptLong(t){var e=this,r=this.n.bitLength()+7>>3;t=F(t);try{if(t.length>r){var n="";return t.match(/.{1,256}/g).forEach((function(t){var r=e.decrypt(t);n+=r})),n}return this.decrypt(t)}catch(t){return!1}}setPrivate(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=X(t,16),this.e=parseInt(e,16),this.d=X(r,16)):console.error("Invalid RSA private key")}setPrivateEx(t,e,r,n,i,o,s,a){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=X(t,16),this.e=parseInt(e,16),this.d=X(r,16),this.p=X(n,16),this.q=X(i,16),this.dmp1=X(o,16),this.dmq1=X(s,16),this.coeff=X(a,16)):console.error("Invalid RSA private key")}generate(t,e){var r=new ut,n=t>>1;this.e=parseInt(e,16);for(var i=new Z(e,16);;){for(;this.p=new Z(t-n,1,r),0!=this.p.subtract(Z.ONE).gcd(i).compareTo(Z.ONE)||!this.p.isProbablePrime(10););for(;this.q=new Z(n,1,r),0!=this.q.subtract(Z.ONE).gcd(i).compareTo(Z.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(Z.ONE),a=this.q.subtract(Z.ONE),u=s.multiply(a);if(0==u.gcd(i).compareTo(Z.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}}decrypt(t){var e=X(t,16),r=this.doPrivate(e);return null==r?null:lt(r,this.n.bitLength()+7>>3)}generateAsync(t,e,r){var n=new ut,i=t>>1;this.e=parseInt(e,16);var o=new Z(e,16),s=this,a=()=>{var e=()=>{if(s.p.compareTo(s.q)<=0){var t=s.p;s.p=s.q,s.q=t}var e=s.p.subtract(Z.ONE),n=s.q.subtract(Z.ONE),i=e.multiply(n);0==i.gcd(o).compareTo(Z.ONE)?(s.n=s.p.multiply(s.q),s.d=o.modInverse(i),s.dmp1=s.d.mod(e),s.dmq1=s.d.mod(n),s.coeff=s.q.modInverse(s.p),setTimeout((function(){r()}),0)):setTimeout(a,0)},u=()=>{s.q=$(),s.q.fromNumberAsync(i,1,n,(function(){s.q.subtract(Z.ONE).gcda(o,(function(t){0==t.compareTo(Z.ONE)&&s.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(u,0)}))}))},c=()=>{s.p=$(),s.p.fromNumberAsync(t-i,1,n,(function(){s.p.subtract(Z.ONE).gcda(o,(function(t){0==t.compareTo(Z.ONE)&&s.p.isProbablePrime(10)?setTimeout(u,0):setTimeout(c,0)}))}))};setTimeout(c,0)};setTimeout(a,0)}}function lt(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var o=255&r[n];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&o)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}class dt extends ht{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(),t&&("string"==typeof t?this.parseKey(t):(this.hasPrivateKeyProperty(t)||this.hasPublicKeyProperty(t))&&this.parsePropertiesFrom(t))}parseKey(t){try{var e=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?c.decode(t):h.unarmor(t),i=J.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=X(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var o=i.sub[3].getHexStringValue();this.d=X(o,16);var s=i.sub[4].getHexStringValue();this.p=X(s,16);var a=i.sub[5].getHexStringValue();this.q=X(a,16);var u=i.sub[6].getHexStringValue();this.dmp1=X(u,16);var l=i.sub[7].getHexStringValue();this.dmq1=X(l,16);var d=i.sub[8].getHexStringValue();this.coeff=X(d,16)}else{if(2!==i.sub.length)return!1;var p=i.sub[1].sub[0];e=p.sub[0].getHexStringValue(),this.n=X(e,16),r=p.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}}hasPublicKeyProperty(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")}hasPrivateKeyProperty(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")}parsePropertiesFrom(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)}}(n=function(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}).prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new dt(t)},n.prototype.setPrivateKey=function(t){this.setKey(t)},n.prototype.setPublicKey=function(t){this.setKey(t)},n.prototype.decrypt=function(t){try{return this.getKey().decrypt(F(t))}catch(t){return!1}},n.prototype.encrypt=function(t){try{return G(this.getKey().encrypt(t))}catch(t){return!1}},n.prototype.encryptLong=function(t){try{for(var e=this.getKey().encryptLong(t)||"",r=this.getKey().decryptLong(e)||"",n=0,i=/null$/g;i.test(r)&&(n++,e=this.getKey().encryptLong(t)||"",r=this.getKey().decryptLong(e)||"",!(n>10)););return e}catch(t){return!1}},n.prototype.getKey=function(t){if(!this.key){if(this.key=new dt,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},n.version="3.1.4"}e.default=n},182:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useDefaultAdapter=e.useAdapters=e.RUNTIME=void 0;var a,u=s(r(274)),c=r(616);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(a=e.RUNTIME||(e.RUNTIME={})),e.useAdapters=function(t,e){for(var r=0,i=(0,c.isArray)(t)?t:[t];r<i.length;r++){var o=i[r],s=o.isMatch,a=o.genAdapter,u=o.runtime;if(s())return{adapter:n({isMatch:s},a(e)),runtime:u}}},e.useDefaultAdapter=function(){return{adapter:n({},u.genAdapter()),runtime:a.WEB}}},274:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRequest=e.genAdapter=void 0;var u=r(764),c=r(616),h=r(946),l=function(t){function e(e){var r=t.call(this)||this,n=e.timeout,i=e.timeoutMsg,o=e.restrictedMethods;return r.timeout=n||0,r.timeoutMsg=i||"请求超时",r.restrictedMethods=o||["get","post","upload","download"],r}return i(e,t),e.prototype.get=function(t){return this.request(o(o({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(o(o({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(o(o({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,n=t.name,i=t.method,s=t.headers,a=void 0===s?{}:s,u={post:"post",put:"put"}[null==i?void 0:i.toLowerCase()]||"put",c=new FormData;return"post"===u?(Object.keys(e).forEach((function(t){c.append(t,e[t])})),c.append("key",n),c.append("file",r),this.request(o(o({},t),{data:c,method:u}),this.restrictedMethods.includes("upload"))):this.request(o(o({},t),{method:"put",headers:a,body:r}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return s(this,void 0,void 0,(function(){var e,r,n,i;return a(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.get(o(o({},t),{headers:{},responseType:"blob"}))];case 1:return e=s.sent().data,r=window.URL.createObjectURL(new Blob([e])),n=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(i=document.createElement("a")).href=r,i.setAttribute("download",n),i.style.display="none",document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(r),document.body.removeChild(i),[3,3];case 2:return s.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))}))},e.prototype.fetch=function(t){var e;return s(this,void 0,void 0,(function(){var r,n,i,u,c,h,l,d,p,f,v,g,y,m=this;return a(this,(function(_){switch(_.label){case 0:return r=new AbortController,n=t.url,i=t.enableAbort,u=void 0!==i&&i,c=t.stream,h=void 0!==c&&c,l=t.signal,d=t.timeout,p=t.shouldThrowOnError,f=void 0===p||p,v=null!=d?d:this.timeout,l&&(l.aborted&&r.abort(),l.addEventListener("abort",(function(){return r.abort()}))),g=null,u&&v&&(g=setTimeout((function(){console.warn(m.timeoutMsg),r.abort(new Error(m.timeoutMsg))}),v)),[4,fetch(n,o(o({},t),{signal:r.signal})).then((function(t){return s(m,void 0,void 0,(function(){var e,r,n;return a(this,(function(i){switch(i.label){case 0:return clearTimeout(g),f?t.ok?(e=t,[3,3]):[3,1]:[3,4];case 1:return n=(r=Promise).reject,[4,t.json()];case 2:e=n.apply(r,[i.sent()]),i.label=3;case 3:return[2,e];case 4:return[2,t]}}))}))})).catch((function(t){if(clearTimeout(g),f)return Promise.reject(t)}))];case 1:return y=_.sent(),[2,{data:h?y.body:(null===(e=y.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))?y.json():y.text(),statusCode:y.status,header:y.headers}]}}))}))},e.prototype.request=function(t,e){var r=this;void 0===e&&(e=!1);var n=String(t.method).toLowerCase()||"get";return new Promise((function(i){var o,s,a=t.url,u=t.headers,l=void 0===u?{}:u,d=t.data,p=t.responseType,f=t.withCredentials,v=t.body,g=t.onUploadProgress,y=(0,c.formatUrl)((0,h.getProtocol)(),a,"get"===n?d:{}),m=new XMLHttpRequest;m.open(n,y),p&&(m.responseType=p),Object.keys(l).forEach((function(t){m.setRequestHeader(t,l[t])})),g&&m.upload.addEventListener("progress",g),m.onreadystatechange=function(){var t={};if(4===m.readyState){var e=m.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach((function(t){var e=t.split(": "),n=e.shift().toLowerCase(),i=e.join(": ");r[n]=i})),t.header=r,t.statusCode=m.status;try{t.data="blob"===p?m.response:JSON.parse(m.responseText)}catch(e){t.data="blob"===p?m.response:m.responseText}clearTimeout(o),i(t)}},e&&r.timeout&&(o=setTimeout((function(){console.warn(r.timeoutMsg),m.abort()}),r.timeout)),s=(0,c.isFormData)(d)?d:"application/x-www-form-urlencoded"===l["content-type"]?(0,c.toQueryString)(d):v||(d?JSON.stringify(d):void 0),f&&(m.withCredentials=!0),m.send(s)}))},e}(u.AbstractSDKRequest);e.WebRequest=l,e.genAdapter=function(){return{type:"default",root:window,reqClass:l,wsClass:WebSocket,localStorage:localStorage}}},946:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.COMMUNITY_SITE_URL=e.IS_DEBUG_MODE=e.getProtocol=e.setProtocol=e.getSdkName=e.setSdkName=void 0;var r="@cloudbase/js-sdk";e.setSdkName=function(t){r=t},e.getSdkName=function(){return r};var n="https:";e.setProtocol=function(t){n=t},e.getProtocol=function(){return n},e.IS_DEBUG_MODE=!1,e.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},205:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ERRORS=void 0,e.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},794:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.OATUH_LOGINTYPE=void 0,i(r(946),e),i(r(205),e),e.OATUH_LOGINTYPE="constants"},718:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.catchErrorsDecorator=void 0;var o=r(616),s=r(794),a=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(a=-1!==navigator.userAgent.indexOf("Firefox"));var u=a?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,c=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function h(t){var e=t.err,r=t.className,n=t.methodName,i=t.sourceLink;if(!i)return null;var o,s=e.stack.split("\n"),u=a?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]\\s*\\(.*\\)$")),h=a?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(n,"\\]")),l=s.findIndex((function(t){return u.test(t)}));if(-1!==l){var d=s.filter((function(t,e){return e>l}));d.unshift(s[l].replace(h,"".concat(r,".").concat(n)).replace(c,i)),(o=new Error).stack="".concat(a?"@debugger":"Error","\n").concat(d.join("\n"))}return o}e.catchErrorsDecorator=function(t){var e=t.mode,r=void 0===e?"async":e,a=t.customInfo,l=void 0===a?{}:a,d=t.title,p=t.messages,f=void 0===p?[]:p;return function(t,e,a){if(s.IS_DEBUG_MODE){var p=l.className||t.constructor.name,v=l.methodName||e,g=a.value,y=function(){var t="",e=(new Error).stack.split("\n"),r=e.findIndex((function(t){return u.test(t)}));if(-1!==r){var n=c.exec(e[r+1]||"");t=n?n[0]:""}return t}();a.value="sync"===r?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=h({err:new Error,className:p,methodName:v,sourceLink:y});try{return g.apply(this,t)}catch(t){var n=t,i=t.message,s=t.error,a=t.error_description,u={title:d||"".concat(p,".").concat(v," failed"),content:[{type:"error",body:t}]};if(i&&/^\{.*\}$/.test(i)){var c=JSON.parse(i);u.subtitle=i,c.code&&(r?(r.code=c.code,r.msg=c.msg):(t.code=c.code,t.message=c.msg),n=r||t,u.content=f.map((function(t){return{type:"info",body:t}})))}throw s&&a&&(u.subtitle=a,r?(r.code=s,r.msg=a):(t.code=s,t.message=a),n=r||t,u.content=f.map((function(t){return{type:"info",body:t}}))),(0,o.printGroupLog)(u),n}}:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n(this,void 0,void 0,(function(){var e,r,n,s,a,u,c,l;return i(this,(function(i){switch(i.label){case 0:e=h({err:new Error,className:p,methodName:v,sourceLink:y}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,g.apply(this,t)];case 2:return[2,i.sent()];case 3:throw r=i.sent(),n=r,s=r.message,a=r.error,u=r.error_description,c={title:d||"".concat(p,".").concat(v," failed"),content:[{type:"error",body:r}]},s&&/^\{.*\}$/.test(s)&&(l=JSON.parse(s),c.subtitle=l,l.code&&(e?(e.code=l.code,e.message=l.msg):(r.code=l.code,r.message=l.msg),n=e||r,c.content=f.map((function(t){return{type:"info",body:t}})))),a&&u&&(c.subtitle=u,e?(e.code=a,e.msg=u):(r.code=a,r.message=u),n=e||r,c.content=f.map((function(t){return{type:"info",body:t}}))),(0,o.printGroupLog)(c),n;case 4:return[2]}}))}))}}}}},141:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(718),e)},197:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CloudbaseCache=void 0;var a=r(764),u=r(616),c=r(794),h=function(t){function e(e){var r=t.call(this)||this;return r.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return i(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}(a.AbstractStorage),l=function(){function t(t){this.keys={};var e=t.persistence,r=t.platformInfo,n=void 0===r?{}:r,i=t.keys,o=void 0===i?{}:i;this.platformInfo=n,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:((0,u.printWarn)(c.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new h(e.root));case"none":return new h(e.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=o)}return Object.defineProperty(t.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),t.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this.storage)try{var n={version:r||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(n))}catch(t){throw new Error(JSON.stringify({code:c.ERRORS.OPERATION_FAIL,msg:"[".concat((0,c.getSdkName)(),"][").concat(c.ERRORS.OPERATION_FAIL,"]setStore failed"),info:t}))}}else(0,u.printWarn)(c.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),n={version:r||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(n))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}}))}))},t.prototype.getStore=function(t,e){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var n=this.storage.getItem(t);return n&&n.indexOf(e)>=0?JSON.parse(n).content:""}(0,u.printWarn)(c.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(n=i.sent())&&n.indexOf(e)>=0?[2,JSON.parse(n).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):(0,u.printWarn)(c.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))},t}();e.CloudbaseCache=l},689:function(t,e,r){var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.removeEventListener=e.activateEvent=e.addEventListener=e.CloudbaseEventEmitter=e.IErrorEvent=e.CloudbaseEvent=void 0;var s=r(616),a=function(t,e){this.data=e||null,this.name=t};e.CloudbaseEvent=a;var u=function(t){function e(e,r){var n=t.call(this,"error",{error:e,data:r})||this;return n.error=e,n}return i(e,t),e}(a);e.IErrorEvent=u;var c=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if((0,s.isInstanceOf)(t,u))return console.error(t.error),this;var r=(0,s.isString)(t)?new a(t,e||{}):t,n=r.name;if(this.listens(n)){r.target=this;for(var i=0,c=this.listeners[n]?o([],this.listeners[n],!0):[];i<c.length;i++)c[i].call(this,r)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}();e.CloudbaseEventEmitter=c;var h=new c;e.addEventListener=function(t,e){h.on(t,e)},e.activateEvent=function(t,e){void 0===e&&(e={}),h.fire(t,e)},e.removeEventListener=function(t,e){h.off(t,e)}},616:function(t,e,r){var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};Object.defineProperty(e,"__esModule",{value:!0}),e.parseCaptcha=e.parseQueryString=e.transformPhone=e.sleep=e.printGroupLog=e.throwError=e.printInfo=e.printError=e.printWarn=e.execCallback=e.createPromiseCallback=e.removeParam=e.getHash=e.getQuery=e.toQueryString=e.formatUrl=e.generateRequestId=e.genSeqId=e.isFormData=e.isInstanceOf=e.isNull=e.isPalinObject=e.isUndefined=e.isString=e.isArray=void 0;var i=r(794);e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isUndefined=function(t){return void 0===t},e.isPalinObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isNull=function(t){return"[object Null]"===Object.prototype.toString.call(t)},e.isInstanceOf=function(t,e){return t instanceof e},e.isFormData=function(t){return"[object FormData]"===Object.prototype.toString.call(t)},e.genSeqId=function(){return Math.random().toString(16).slice(2)},e.generateRequestId=function(){var t=(new Date).getTime(),e=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(r){var n=16*Math.random();return t>0?(n=(t+n)%16|0,t=Math.floor(t/16)):(n=(e+n)%16|0,e=Math.floor(e/16)),("x"===r?n:7&n|8).toString(16)}))},e.formatUrl=function(t,e,r){void 0===r&&(r={});var n=/\?/.test(e),i="";return Object.keys(r).forEach((function(t){""===i?!n&&(e+="?"):i+="&",i+="".concat(t,"=").concat(encodeURIComponent(r[t]))})),/^http(s)?:\/\//.test(e+=i)?e:"".concat(t).concat(e)},e.toQueryString=function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(r){e.push("".concat(r,"=").concat(encodeURIComponent(t[r])))})),e.join("&")},e.getQuery=function(t,e){if("undefined"==typeof window)return!1;var r=e||decodeURIComponent(window.location.search),n=new RegExp("(^|&)".concat(t,"=([^&]*)(&|$)")),i=r.substr(r.indexOf("?")+1).match(n);return null!=i?i[2]:""},e.getHash=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]".concat(t,"=([^&#]*)")));return e?e[1]:""},e.removeParam=function(t,e){var r=e.split("?")[0],n=[],i=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==i){for(var o=(n=i.split("&")).length-1;o>=0;o-=1)n[o].split("=")[0]===t&&n.splice(o,1);r="".concat(r,"?").concat(n.join("&"))}return r},e.createPromiseCallback=function(){var t={};if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var r=new Promise((function(e,r){t=function(t,n){return t?r(t):e(n)}}));return t.promise=r,t},e.execCallback=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},e.printWarn=function(t,e){console.warn("[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e))},e.printError=function(t,e){console.error({code:t,msg:"[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e)})},e.printInfo=function(t,e){console.log("[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e))},e.throwError=function(t,e){throw new Error(JSON.stringify({code:t,msg:"[".concat((0,i.getSdkName)(),"][").concat(t,"]:").concat(e)}))},e.printGroupLog=function(t){var e,r=t.title,n=t.subtitle,i=void 0===n?"":n,o=t.content,s=void 0===o?[]:o,a=t.printTrace,u=void 0!==a&&a,c=t.collapsed;void 0!==c&&c?(console.groupCollapsed||console.error)(r,i):(console.group||console.error)(r,i);for(var h=0,l=s;h<l.length;h++){var d=l[h],p=d.type,f=d.body;switch(p){case"info":console.log(f);break;case"warn":console.warn(f);break;case"error":console.error(f)}}u&&(console.trace||console.log)("stack trace:"),null===(e=console.groupEnd)||void 0===e||e.call(console)},e.sleep=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},e.transformPhone=function(t){return"+86".concat(t)},e.parseQueryString=function(t){t=t.replace(/^\?/,"");var e={};return t.split("&").forEach((function(t){var r=t.split("="),n=r[0],i=r[1];n=decodeURIComponent(n),i=decodeURIComponent(i),n&&(e[n]?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i)})),e},e.parseCaptcha=function(t){var r={},i=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(i){t=i[1];var o=i[2];o&&(r=(0,e.parseQueryString)(o))}var s=r.token,a=n(r,["token"]);return/^data:/.test(t)&&!s?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(t)}:s?{state:a.state,token:s,captchaData:t}:{error:"unimplemented",error_description:"need to impl captcha data"}}},764:function(t){t.exports=require("@cloudbase/adapter-interface")},917:function(t){t.exports=require("@cloudbase/adapter-wx_mp")},107:function(t){t.exports=require("jwt-decode")}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={exports:{}};return r[t].call(o.exports,o,o.exports,i),o.exports}e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);i.r(o);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&n&&r;"object"==typeof a&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach((function(t){s[t]=function(){return r[t]}}));return s.default=function(){return r},i.d(o,s),o},i.d=function(t,e){for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o=i(304);module.exports=o}();
|
|
3
|
+
//# sourceMappingURL=index.js.map
|