easemob-websdk 4.24.1 → 5.0.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/README.md +95 -39
- package/bundle/im-sdk-web.iife.js +1 -0
- package/cache/cache-crypto.d.ts +26 -0
- package/cache/cache-eviction.d.ts +16 -0
- package/cache/cache-keys.d.ts +23 -0
- package/cache/cache-manager.d.ts +254 -0
- package/cache/cache-metadata.d.ts +14 -0
- package/cache/cache-store.d.ts +19 -0
- package/cache/cache-types.d.ts +225 -0
- package/cache/cache-utils.d.ts +7 -0
- package/cache/contact-cache.d.ts +35 -0
- package/cache/conversation-cache.d.ts +21 -0
- package/cache/group-namecard-cache.d.ts +20 -0
- package/cache/index.d.ts +24 -0
- package/cache/joined-group-preview-cache.d.ts +12 -0
- package/cache/session-list-cache.d.ts +10 -0
- package/cache/user-info-cache.d.ts +16 -0
- package/chat-client.d.ts +558 -0
- package/chunks/cache-utils-BwRPIZ7n.js +1 -0
- package/chunks/cache-utils-CKbcYPlM.cjs +1 -0
- package/chunks/chat-manager-ChdK26ck.cjs +1 -0
- package/chunks/chat-manager-DH8a6Qj9.js +2 -0
- package/chunks/common-CfAlncj9.cjs +1 -0
- package/chunks/common-DN_g4O3n.js +1 -0
- package/chunks/event-system-COBJFEIq.cjs +1 -0
- package/chunks/event-system-D6IJA0C4.js +1 -0
- package/chunks/group-user-info-resolver-C5pdiqox.cjs +1 -0
- package/chunks/group-user-info-resolver-FNRqDg18.js +1 -0
- package/chunks/index-BKg4EGcI.cjs +1 -0
- package/chunks/index-CK3GHdGU.cjs +1 -0
- package/chunks/index-CjofwvEQ.js +1 -0
- package/chunks/index-uKWbjx-u.js +1 -0
- package/chunks/profile-version-DLMz8lqW.js +1 -0
- package/chunks/profile-version-njNs7R5-.cjs +1 -0
- package/chunks/reflection-proto-codec-64ocOTHU.js +1 -0
- package/chunks/reflection-proto-codec-BnQFQdZC.cjs +1 -0
- package/chunks/session-list-query-B6dh-b4Y.cjs +1 -0
- package/chunks/session-list-query-Dnp2HbpW.js +1 -0
- package/chunks/user-info-BfRwS4ZA.js +1 -0
- package/chunks/user-info-icpL0Eaw.cjs +1 -0
- package/config/cache.d.ts +12 -0
- package/config/timeouts.d.ts +34 -0
- package/core/connection/connection-manager.d.ts +228 -0
- package/core/connection/connection-retry.d.ts +47 -0
- package/core/connection/heartbeat.d.ts +68 -0
- package/core/contact-sync/contact-roster-event-sidecar.d.ts +3 -0
- package/core/contact-sync/roster-sync-client.d.ts +21 -0
- package/core/contact-sync/roster-sync-controller.d.ts +20 -0
- package/core/contact-sync/roster-sync-session.d.ts +28 -0
- package/core/contact-sync/roster-sync-types.d.ts +74 -0
- package/core/events/event-hub.d.ts +13 -0
- package/core/group-sync/group-sync-client.d.ts +19 -0
- package/core/group-sync/group-sync-controller.d.ts +11 -0
- package/core/group-sync/group-sync-merge.d.ts +3 -0
- package/core/group-sync/group-sync-normalizer.d.ts +4 -0
- package/core/group-sync/group-sync-session.d.ts +17 -0
- package/core/group-sync/group-sync-types.d.ts +24 -0
- package/core/group-sync/index.d.ts +4 -0
- package/core/index.d.ts +95 -0
- package/core/message/attachment-downloader.d.ts +7 -0
- package/core/message/chatroom-operation-types.d.ts +6 -0
- package/core/message/combine-message-downloader.d.ts +7 -0
- package/core/message/message-action-types.d.ts +22 -0
- package/core/message/message-deduplicator.d.ts +11 -0
- package/core/message/message-receiver.d.ts +65 -0
- package/core/message/message-retry.d.ts +33 -0
- package/core/message/message-sender.d.ts +63 -0
- package/core/message/profile-sync/group-namecard-hydration-queue.d.ts +33 -0
- package/core/message/profile-sync/group-namecard-hydrator.d.ts +8 -0
- package/core/message/profile-sync/latest-message-version-projector.d.ts +3 -0
- package/core/message/profile-sync/profile-version-sidecar.d.ts +9 -0
- package/core/message/profile-sync/profile-version.d.ts +3 -0
- package/core/message/profile-sync/user-info-hydration-queue.d.ts +29 -0
- package/core/message/profile-sync/user-info-hydrator.d.ts +8 -0
- package/core/message/stream-message-cache.d.ts +38 -0
- package/core/message/stream-message-handler.d.ts +22 -0
- package/core/session-list-sync/session-list-query.d.ts +26 -0
- package/core/session-list-sync/session-list-sync-controller.d.ts +17 -0
- package/core/session-list-sync/session-list-sync-merge.d.ts +17 -0
- package/core/session-list-sync/session-list-sync-normalizer.d.ts +6 -0
- package/core/session-list-sync/session-list-sync-runner.d.ts +13 -0
- package/core/session-list-sync/session-list-sync-session.d.ts +26 -0
- package/core/session-list-sync/session-list-sync-types.d.ts +24 -0
- package/core/sync/shared-sync-websocket-session.d.ts +61 -0
- package/core/user-info/group-user-info-resolver.d.ts +40 -0
- package/data-report/bridge.d.ts +11 -0
- package/data-report/constants.d.ts +25 -0
- package/data-report/data-reporter.d.ts +21 -0
- package/data-report/event-queue.d.ts +38 -0
- package/data-report/index.d.ts +3 -0
- package/data-report/network-type.d.ts +1 -0
- package/data-report/operation-map.d.ts +8 -0
- package/data-report/transport.d.ts +17 -0
- package/data-report/types.d.ts +61 -0
- package/index.cjs +1 -0
- package/index.d.ts +134 -0
- package/index.js +3 -0
- package/managers/chat/index.cjs +1 -0
- package/managers/chat/index.d.ts +1 -0
- package/managers/chat/index.js +1 -0
- package/managers/chat-manager.d.ts +880 -0
- package/managers/chat-thread/chat-thread.d.ts +126 -0
- package/managers/chat-thread/index.cjs +1 -0
- package/managers/chat-thread/index.d.ts +2 -0
- package/managers/chat-thread/index.js +1 -0
- package/managers/chat-thread-manager.d.ts +257 -0
- package/managers/chatroom/chatroom-event-mapper.d.ts +17 -0
- package/managers/chatroom/chatroom-event-user-info-resolver.d.ts +15 -0
- package/managers/chatroom/chatroom-normalizers.d.ts +23 -0
- package/managers/chatroom/chatroom.d.ts +403 -0
- package/managers/chatroom/index.cjs +1 -0
- package/managers/chatroom/index.d.ts +2 -0
- package/managers/chatroom/index.js +1 -0
- package/managers/chatroom-manager.d.ts +604 -0
- package/managers/contact/contact-user-info-resolver.d.ts +15 -0
- package/managers/contact/index.cjs +1 -0
- package/managers/contact/index.d.ts +1 -0
- package/managers/contact/index.js +1 -0
- package/managers/contact-manager.d.ts +215 -0
- package/managers/group/group-event-mapper.d.ts +18 -0
- package/managers/group/group-event-user-info-resolver.d.ts +15 -0
- package/managers/group/group-normalizers.d.ts +15 -0
- package/managers/group/group.d.ts +504 -0
- package/managers/group/index.cjs +1 -0
- package/managers/group/index.d.ts +2 -0
- package/managers/group/index.js +1 -0
- package/managers/group/internal/group-event-sync.d.ts +13 -0
- package/managers/group/internal/group-repository.d.ts +31 -0
- package/managers/group/internal/group-snapshot-mapper.d.ts +6 -0
- package/managers/group/internal/internal-group.d.ts +24 -0
- package/managers/group-manager.d.ts +371 -0
- package/managers/presence/index.cjs +1 -0
- package/managers/presence/index.d.ts +1 -0
- package/managers/presence/index.js +1 -0
- package/managers/presence-manager.d.ts +201 -0
- package/managers/push/index.cjs +1 -0
- package/managers/push/index.d.ts +1 -0
- package/managers/push/index.js +1 -0
- package/managers/push-manager.d.ts +205 -0
- package/managers/user-info/index.cjs +1 -0
- package/managers/user-info/index.d.ts +4 -0
- package/managers/user-info/index.js +1 -0
- package/managers/user-info/user-info-notify-normalizer.d.ts +2 -0
- package/managers/user-info/user-info-runtime-store.d.ts +28 -0
- package/managers/user-info-manager.d.ts +196 -0
- package/message/combine-compatible-text-sidecar.d.ts +4 -0
- package/message/combine-message-constraints.d.ts +7 -0
- package/message/combine-payload-codec.d.ts +17 -0
- package/message/create-message.d.ts +64 -0
- package/package.json +64 -16
- package/platform/capability-validator.d.ts +7 -0
- package/platform/env.d.ts +68 -0
- package/platform/factory.d.ts +7 -0
- package/platform/image/miniapp-image-processor.d.ts +45 -0
- package/platform/image/web-image-processor.d.ts +2 -0
- package/platform/index.d.ts +17 -0
- package/platform/miniapp/miniapp-adapter.d.ts +3 -0
- package/platform/proto/proto-adapter.d.ts +17 -0
- package/platform/proto/reflection-proto-codec.d.ts +8 -0
- package/platform/proto/static-proto-adapter.d.ts +8 -0
- package/platform/request/web-request-adapter.d.ts +9 -0
- package/platform/runtime/connection-event-normalizer.d.ts +14 -0
- package/platform/runtime/runtime-event-bridge.d.ts +23 -0
- package/platform/runtime/web-runtime-adapter.d.ts +26 -0
- package/platform/socket/web-socket-adapter.d.ts +8 -0
- package/platform/types.d.ts +472 -0
- package/platform/upload/react-native-upload-adapter.d.ts +14 -0
- package/platform/upload/upload-error-mapper.d.ts +7 -0
- package/platform/upload/upload-source.d.ts +20 -0
- package/platform/upload/web-upload-adapter.d.ts +10 -0
- package/protocol/joined-groups/codec.d.ts +11 -0
- package/protocol/joined-groups/gateway.d.ts +2 -0
- package/protocol/joined-groups/index.d.ts +2 -0
- package/protocol/joined-groups/proto.d.ts +174 -0
- package/protocol/joined-groups/types.d.ts +65 -0
- package/protocol/msync/codec.d.ts +191 -0
- package/protocol/msync/context.d.ts +40 -0
- package/protocol/msync/lz4-compressor/index.d.ts +40 -0
- package/protocol/msync/lz4-compressor/utils.d.ts +27 -0
- package/protocol/msync/multi-device-normalizer.d.ts +75 -0
- package/protocol/msync/proto.d.ts +1306 -0
- package/protocol/msync/root.d.ts +5 -0
- package/protocol/msync/types.d.ts +96 -0
- package/protocol/msync/utils.d.ts +26 -0
- package/protocol/protobuf/decoder.d.ts +44 -0
- package/protocol/protobuf/encoder.d.ts +23 -0
- package/protocol/protobuf/types.d.ts +53 -0
- package/protocol/roster/codec.d.ts +9 -0
- package/protocol/roster/proto.d.ts +205 -0
- package/protocol/roster/root.d.ts +5 -0
- package/protocol/roster/types.d.ts +83 -0
- package/protocol/session-list/codec.d.ts +11 -0
- package/protocol/session-list/gateway.d.ts +19 -0
- package/protocol/session-list/payload-decoder.d.ts +1 -0
- package/protocol/session-list/proto.d.ts +207 -0
- package/protocol/session-list/types.d.ts +83 -0
- package/rest/chat-management.d.ts +26 -0
- package/rest/chat-thread-management.d.ts +14 -0
- package/rest/chatroom-management.d.ts +40 -0
- package/rest/client.d.ts +86 -0
- package/rest/contact-management.d.ts +27 -0
- package/rest/contact-metadata.d.ts +11 -0
- package/rest/conversation-management.d.ts +11 -0
- package/rest/dns-config.d.ts +20 -0
- package/rest/error-map-types.d.ts +32 -0
- package/rest/error-maps/chat.d.ts +888 -0
- package/rest/error-maps/chatroom.d.ts +592 -0
- package/rest/error-maps/common.d.ts +208 -0
- package/rest/error-maps/contact.d.ts +185 -0
- package/rest/error-maps/core.d.ts +21 -0
- package/rest/error-maps/group.d.ts +500 -0
- package/rest/error-maps/index.d.ts +9 -0
- package/rest/error-maps/presence.d.ts +62 -0
- package/rest/error-maps/push.d.ts +158 -0
- package/rest/error-maps/thread.d.ts +538 -0
- package/rest/error-maps/user-info.d.ts +289 -0
- package/rest/errors.d.ts +23 -0
- package/rest/group-management.d.ts +55 -0
- package/rest/rtc-token.d.ts +14 -0
- package/rest/speech-helpers.d.ts +24 -0
- package/rest/user-info-subscription.d.ts +10 -0
- package/rest/user-info.d.ts +34 -0
- package/types/chat-client.d.ts +226 -0
- package/types/chat-manager.d.ts +641 -0
- package/types/chat-thread.d.ts +311 -0
- package/types/chatroom.d.ts +1258 -0
- package/types/connection.d.ts +111 -0
- package/types/contact.d.ts +149 -0
- package/types/conversation.d.ts +270 -0
- package/types/event-system.d.ts +721 -0
- package/types/group.d.ts +980 -0
- package/types/index.d.ts +577 -44
- package/types/manager.d.ts +99 -0
- package/types/message-conversation.d.ts +22 -0
- package/types/message-create.d.ts +173 -0
- package/types/multi-device.d.ts +275 -0
- package/types/presence.d.ts +101 -0
- package/types/push.d.ts +296 -0
- package/types/sender.d.ts +12 -0
- package/types/sync-data.d.ts +54 -0
- package/types/user-info.d.ts +178 -0
- package/upload/attachment-file-store.d.ts +11 -0
- package/upload/attachment-uploader.d.ts +36 -0
- package/upload/constants.d.ts +8 -0
- package/upload/index.d.ts +2 -0
- package/upload/multipart-upload.d.ts +14 -0
- package/upload/simple-upload.d.ts +3 -0
- package/upload/types.d.ts +79 -0
- package/upload/utils.d.ts +71 -0
- package/utils/env.d.ts +4 -0
- package/utils/error-codes.d.ts +2 -0
- package/utils/error-codes.generated.d.ts +145 -0
- package/utils/error-sanitizer.d.ts +8 -0
- package/utils/errors.d.ts +139 -0
- package/utils/log-reporter.d.ts +61 -0
- package/utils/log-sanitizer.d.ts +6 -0
- package/utils/logger.d.ts +48 -0
- package/utils/md5.d.ts +1 -0
- package/utils/message-id.d.ts +12 -0
- package/utils/provision-error-mapping.d.ts +21 -0
- package/utils/retry.d.ts +26 -0
- package/utils/runtime-global.d.ts +4 -0
- package/utils/trace-id.d.ts +5 -0
- package/utils/utf8.d.ts +2 -0
- package/validators/chat-client.d.ts +787 -0
- package/validators/message-create.d.ts +419 -0
- package/validators/search-messages.d.ts +127 -0
- package/validators/validator.d.ts +49 -0
- package/version.d.ts +2 -0
- package/Easemob-chat.d.ts +0 -8457
- package/Easemob-chat.js +0 -2
- package/chatroom/chatroom.d.ts +0 -649
- package/chatroom/chatroom.js +0 -1
- package/contact/contact.d.ts +0 -726
- package/contact/contact.js +0 -1
- package/group/group.d.ts +0 -848
- package/group/group.js +0 -1
- package/localCache/localCache.d.ts +0 -59
- package/localCache/localCache.js +0 -1
- package/message/audio.d.ts +0 -183
- package/message/channel.d.ts +0 -82
- package/message/cmd.d.ts +0 -146
- package/message/combine.d.ts +0 -132
- package/message/custom.d.ts +0 -135
- package/message/delivery.d.ts +0 -77
- package/message/file.d.ts +0 -173
- package/message/img.d.ts +0 -200
- package/message/index.d.ts +0 -211
- package/message/location.d.ts +0 -134
- package/message/read.d.ts +0 -85
- package/message/text.d.ts +0 -149
- package/message/video.d.ts +0 -180
- package/miniCore/miniCore.d.ts +0 -217
- package/miniCore/miniCore.js +0 -2
- package/miniProgram/Easemob-chat.js +0 -2
- package/miniProgram/miniProgram.zip +0 -0
- package/presence/presence.d.ts +0 -69
- package/presence/presence.js +0 -1
- package/silent/silent.d.ts +0 -128
- package/silent/silent.js +0 -1
- package/status.d.ts +0 -184
- package/thread/thread.d.ts +0 -159
- package/thread/thread.js +0 -1
- package/translation/translation.d.ts +0 -30
- package/translation/translation.js +0 -1
- package/types/chatRoomApi.d.ts +0 -226
- package/types/common.d.ts +0 -89
- package/types/engineCore.d.ts +0 -194
- package/types/error.d.ts +0 -13
- package/types/eventHandler.d.ts +0 -437
- package/types/groupApi.d.ts +0 -306
- package/types/indexApi.d.ts +0 -366
- package/types/localCache.d.ts +0 -53
- package/types/message.d.ts +0 -959
- package/types/presenceApi.d.ts +0 -61
- package/types/reactionApi.d.ts +0 -74
- package/types/restApis.d.ts +0 -6
- package/types/silentModeApi.d.ts +0 -109
- package/types/threadApi.d.ts +0 -175
- package/types/translation.d.ts +0 -25
- package/types/utils.d.ts +0 -90
- package/uniApp/Easemob-chat.js +0 -2
- package/uniApp/uniApp.zip +0 -0
- package/websdk.zip +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function r(e){return!0===(e&&e.__isLong__)}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0}),t.isLong=r;var n={},o={};function s(e,t){var r,i,s;return t?(s=0<=(e>>>=0)&&e<256)&&(i=o[e])?i:(r=a(e,0,!0),s&&(o[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(i=n[e])?i:(r=a(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function u(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return _}else{if(e<=-d)return j;if(e+1>=d)return O}return e<0?u(-e,t).neg():a(e%c|0,e/c|0,t)}function a(e,r,i){return new t(e,r,i)}t.fromInt=s,t.fromNumber=u,t.fromBits=a;var f=Math.pow;function h(e,t,r){if(0===e.length)throw Error("empty string");if("number"==typeof t?(r=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?g:v;if((r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return h(e.substring(1),t,r).neg();for(var n=u(f(r,8)),o=v,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+a),r);if(a<8){var c=u(f(r,a));o=o.mul(c).add(u(l))}else o=(o=o.mul(n)).add(u(l))}return o.unsigned=t,o}function l(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?h(e,t):a(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}t.fromString=h,t.fromValue=l;var c=4294967296,p=c*c,d=p/2,y=s(1<<24),v=s(0);t.ZERO=v;var g=s(0,!0);t.UZERO=g;var m=s(1);t.ONE=m;var b=s(1,!0);t.UONE=b;var w=s(-1);t.NEG_ONE=w;var O=a(-1,2147483647,!1);t.MAX_VALUE=O;var _=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=_;var j=a(0,-2147483648,!1);t.MIN_VALUE=j;var A=t.prototype;A.toInt=function(){return this.unsigned?this.low>>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},A.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(j)){var t=u(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=u(f(e,6),this.unsigned),o=this,s="";;){var a=o.div(n),h=(o.sub(a.mul(n)).toInt()>>>0).toString(e);if((o=a).isZero())return h+s;for(;h.length<6;)h="0"+h;s=""+h+s}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(j)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},A.isSafeInteger=function(){var e=this.high>>21;return!e||!this.unsigned&&(-1===e&&!(0===this.low&&-2097152===this.high))},A.isZero=function(){return 0===this.high&&0===this.low},A.eqz=A.isZero,A.isNegative=function(){return!this.unsigned&&this.high<0},A.isPositive=function(){return this.unsigned||this.high>=0},A.isOdd=function(){return!(1&~this.low)},A.isEven=function(){return!(1&this.low)},A.equals=function(e){return r(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(e){return this.comp(e)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return this.comp(e)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(e){return this.comp(e)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return this.comp(e)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(e){if(r(e)||(e=l(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(j)?j:this.not().add(m)},A.neg=A.negate,A.add=function(e){r(e)||(e=l(e));var t=this.high>>>16,i=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,f=e.low>>>16,h=0,c=0,p=0,d=0;return p+=(d+=o+(65535&e.low))>>>16,c+=(p+=n+f)>>>16,h+=(c+=i+u)>>>16,h+=t+s,a((p&=65535)<<16|(d&=65535),(h&=65535)<<16|(c&=65535),this.unsigned)},A.subtract=function(e){return r(e)||(e=l(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(t){if(this.isZero())return this;if(r(t)||(t=l(t)),e)return a(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return this.unsigned?g:v;if(this.eq(j))return t.isOdd()?j:v;if(t.eq(j))return this.isOdd()?j:v;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(y)&&t.lt(y))return u(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,f=t.high>>>16,h=65535&t.high,c=t.low>>>16,p=65535&t.low,d=0,m=0,b=0,w=0;return b+=(w+=s*p)>>>16,m+=(b+=o*p)>>>16,b&=65535,m+=(b+=s*c)>>>16,d+=(m+=n*p)>>>16,m&=65535,d+=(m+=o*c)>>>16,m&=65535,d+=(m+=s*h)>>>16,d+=i*p+n*c+o*h+s*f,a((b&=65535)<<16|(w&=65535),(d&=65535)<<16|(m&=65535),this.unsigned)},A.mul=A.multiply,A.divide=function(t){if(r(t)||(t=l(t)),t.isZero())throw Error("division by zero");var i,n,o;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?a((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return g;if(t.gt(this.shru(1)))return b;o=g}else{if(this.eq(j))return t.eq(m)||t.eq(w)?j:t.eq(j)?m:(i=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?m:w:(n=this.sub(t.mul(i)),o=i.add(n.div(t)));if(t.eq(j))return this.unsigned?g:v;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=v}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),h=s<=48?1:f(2,s-48),c=u(i),p=c.mul(t);p.isNegative()||p.gt(n);)p=(c=u(i-=h,this.unsigned)).mul(t);c.isZero()&&(c=m),o=o.add(c),n=n.sub(p)}return o},A.div=A.divide,A.modulo=function(t){return r(t)||(t=l(t)),e?a((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return a(~this.low,~this.high,this.unsigned)},A.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},A.clz=A.countLeadingZeros,A.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},A.ctz=A.countTrailingZeros,A.and=function(e){return r(e)||(e=l(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return r(e)||(e=l(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return r(e)||(e=l(e)),a(this.low^e.low,this.high^e.high,this.unsigned)},A.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):a(0,this.low<<e-32,this.unsigned)},A.shl=A.shiftLeft,A.shiftRight=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):a(32===e?this.high:this.high>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?a(this.high,this.low,this.unsigned):e<32?(t=32-e,a(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),a(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},A.rotl=A.rotateLeft,A.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?a(this.high,this.low,this.unsigned):e<32?(t=32-e,a(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),a(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},A.rotr=A.rotateRight,A.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},A.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},t.fromBytes=function(e,r,i){return i?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},"function"==typeof BigInt&&(t.fromBigInt=function(e,t){return a(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},t.fromValue=function(e,r){return"bigint"==typeof e?t.fromBigInt(e,r):l(e,r)},A.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var E,k,T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N={exports:{}},S={},x={};function R(){if(k)return E;return k=1,E=function(e,t){var r=new Array(arguments.length-1),i=0,n=2,o=!0;for(;n<arguments.length;)r[i++]=arguments[n++];return new Promise(function(n,s){r[i]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(u){o&&(o=!1,s(u))}})},E}var B,I,L,F,D,P,C,$={};function q(){return C?P:(C=1,P=function(){return null})}var J,U,M,z,Z,H,W,V,G,X,K,Q,Y,ee,te={};function re(){return H||(H=1,function(){var e,t=x;function r(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)void 0!==e[i[n]]&&r||(e[i[n]]=t[i[n]]);return e}function i(e){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&r(this,i)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.asPromise=R(),t.base64=(B||(B=1,function(){var e=$;e.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var t=new Array(64),r=new Array(123),i=0;i<64;)r[t[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;e.encode=function(e,r,i){for(var n,o=null,s=[],u=0,a=0;r<i;){var f=e[r++];switch(a){case 0:s[u++]=t[f>>2],n=(3&f)<<4,a=1;break;case 1:s[u++]=t[n|f>>4],n=(15&f)<<2,a=2;break;case 2:s[u++]=t[n|f>>6],s[u++]=t[63&f],a=0}u>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),u=0)}return a&&(s[u++]=t[n],s[u++]=61,1===a&&(s[u++]=61)),o?(u&&o.push(String.fromCharCode.apply(String,s.slice(0,u))),o.join("")):String.fromCharCode.apply(String,s.slice(0,u))};var n="invalid encoding";e.decode=function(e,t,i){for(var o,s=i,u=0,a=0;a<e.length;){var f=e.charCodeAt(a++);if(61===f&&u>1)break;if(void 0===(f=r[f]))throw Error(n);switch(u){case 0:o=f,u=1;break;case 1:t[i++]=o<<2|(48&f)>>4,o=f,u=2;break;case 2:t[i++]=(15&o)<<4|(60&f)>>2,o=f,u=3;break;case 3:t[i++]=(3&o)<<6|f,u=0}}if(1===u)throw Error(n);return i-s},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}()),$),t.EventEmitter=function(){if(L)return I;function e(){this._listeners={}}return L=1,I=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this},I}(),t.float=function(){if(D)return F;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function o(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function s(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function u(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:o,e.writeFloatBE=i?o:n,e.readFloatLE=i?s:u,e.readFloatBE=i?u:s}():function(){function o(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,i)}}function s(e,t,r){var i=e(t,r),n=2*(i>>31)+1,o=i>>>23&255,s=8388607&i;return 255===o?s?NaN:n*(1/0):0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=o.bind(null,t),e.writeFloatBE=o.bind(null,r),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,n)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function o(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function s(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function u(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:o,e.writeDoubleBE=i?o:n,e.readDoubleLE=i?s:u,e.readDoubleBE=i?u:s}():function(){function o(e,t,r,i,n,o){var s=i<0?1:0;if(s&&(i=-i),0===i)e(0,n,o+t),e(1/i>0?0:2147483648,n,o+r);else if(isNaN(i))e(0,n,o+t),e(2146959360,n,o+r);else if(i>17976931348623157e292)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+r);else{var u;if(i<22250738585072014e-324)e((u=i/5e-324)>>>0,n,o+t),e((s<<31|u/4294967296)>>>0,n,o+r);else{var a=Math.floor(Math.log(i)/Math.LN2);1024===a&&(a=1023),e(4503599627370496*(u=i*Math.pow(2,-a))>>>0,n,o+t),e((s<<31|a+1023<<20|1048576*u&1048575)>>>0,n,o+r)}}}function s(e,t,r,i,n){var o=e(i,n+t),s=e(i,n+r),u=2*(s>>31)+1,a=s>>>20&2047,f=4294967296*(1048575&s)+o;return 2047===a?f?NaN:u*(1/0):0===a?5e-324*u*f:u*Math.pow(2,a-1075)*(f+4503599627370496)}e.writeDoubleLE=o.bind(null,t,0,4),e.writeDoubleBE=o.bind(null,r,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,n,4,0)}(),e}function t(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function r(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function n(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return D=1,F=e(e)}(),t.inquire=q(),t.utf8=(J||(J=1,(e=te).length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},e.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,o=[],s=0;t<r;)(i=e[t++])<128?o[s++]=i:i>191&&i<224?o[s++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},e.write=function(e,t,r){for(var i,n,o=r,s=0;s<e.length;++s)(i=e.charCodeAt(s))<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(s+1)))?(i=65536+((1023&i)<<10)+(1023&n),++s,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}),te),t.pool=M?U:(M=1,U=function(e,t,r){var i=r||8192,n=i>>>1,o=null,s=i;return function(r){if(r<1||r>n)return e(r);s+r>i&&(o=e(i),s=0);var u=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),u}}),t.LongBits=function(){if(Z)return z;Z=1,z=t;var e=re();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var i=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var i=e<0;i&&(e=-e);var n=e>>>0,o=(e-n)/4294967296>>>0;return i&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new t(n,o)},t.from=function(i){if("number"==typeof i)return t.fromNumber(i);if(e.isString(i)){if(!e.Long)return t.fromNumber(parseInt(i,10));i=e.Long.fromString(i)}return i.low||i.high?new t(i.low>>>0,i.high>>>0):r},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var n=String.prototype.charCodeAt;return t.fromHash=function(e){return e===i?r:new t((n.call(e,0)|n.call(e,1)<<8|n.call(e,2)<<16|n.call(e,3)<<24)>>>0,(n.call(e,4)|n.call(e,5)<<8|n.call(e,6)<<16|n.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10},z}(),t.isNode=Boolean(void 0!==T&&T&&T.process&&T.process.versions&&T.process.versions.node),t.global=t.isNode&&T||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||x,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(r){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,r){var i=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(i.lo,i.hi,r):i.toNumber(Boolean(r))},t.merge=r,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=i,t.ProtocolError=i("ProtocolError"),t.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},t.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}}()),x}function ie(){if(V)return W;V=1,W=a;var e,t=re(),r=t.LongBits,i=t.base64,n=t.utf8;function o(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function s(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function a(){this.len=0,this.head=new o(s,0,0),this.tail=this.head,this.states=null}var f=function(){return t.Buffer?function(){return(a.create=function(){return new e})()}:function(){return new a}};function h(e,t,r){t[r]=255&e}function l(e,t){this.len=e,this.next=void 0,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function p(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}a.create=f(),a.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(a.alloc=t.pool(a.alloc,t.Array.prototype.subarray)),a.prototype._push=function(e,t,r){return this.tail=this.tail.next=new o(e,t,r),this.len+=t,this},l.prototype=Object.create(o.prototype),l.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new l((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this._push(c,10,r.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=r.from(e);return this._push(c,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(c,t.length(),t)},a.prototype.bool=function(e){return this._push(h,1,e?1:0)},a.prototype.fixed32=function(e){return this._push(p,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=r.from(e);return this._push(p,4,t.lo)._push(p,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64,a.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},a.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var d=t.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};return a.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(h,1,0);if(t.isString(e)){var n=a.alloc(r=i.length(e));i.decode(e,n,0),e=n}return this.uint32(r)._push(d,r,e)},a.prototype.string=function(e){var t=n.length(e);return t?this.uint32(t)._push(n.write,t,e):this._push(h,1,0)},a.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new o(s,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(s,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},a._configure=function(t){e=t,a.create=f(),e._configure()},W}function ne(){if(Q)return K;Q=1,K=o;var e,t=re(),r=t.LongBits,i=t.utf8;function n(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function o(e){this.buf=e,this.pos=0,this.len=e.length}var s="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new o(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new o(e);throw Error("illegal buffer")},u=function(){return t.Buffer?function(r){return(o.create=function(r){return t.Buffer.isBuffer(r)?new e(r):s(r)})(r)}:s};function a(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw n(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw n(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw n(this,8);return new r(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}return o.create=u(),o.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,o.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,n(this,10);return e}}(),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw n(this,4);return f(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw n(this,4);return 0|f(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},o.prototype.double=function(){if(this.pos+8>this.len)throw n(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},o.prototype.bytes=function(){var e=this.uint32(),r=this.pos,i=this.pos+e;if(i>this.len)throw n(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,i);if(r===i){var o=t.Buffer;return o?o.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,i)},o.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},o.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw n(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw n(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},o._configure=function(r){e=r,o.create=u(),e._configure();var i=t.Long?"toLong":"toNumber";t.merge(o.prototype,{int64:function(){return a.call(this)[i](!1)},uint64:function(){return a.call(this)[i](!0)},sint64:function(){return a.call(this).zzDecode()[i](!1)},fixed64:function(){return h.call(this)[i](!0)},sfixed64:function(){return h.call(this)[i](!1)}})},K}var oe,se,ue,ae,fe,he,le={};function ce(){return ue||(ue=1,le.Service=function(){if(se)return oe;se=1,oe=t;var e=re();function t(t,r,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(r),this.responseDelimited=Boolean(i)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,i,n,o,s){if(!o)throw TypeError("request must be specified");var u=this;if(!s)return e.asPromise(t,u,r,i,n,o);if(u.rpcImpl)try{return u.rpcImpl(r,i[u.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,t){if(e)return u.emit("error",e,r),s(e);if(null!==t){if(!(t instanceof n))try{t=n[u.responseDelimited?"decodeDelimited":"decode"](t)}catch(i){return u.emit("error",i,r),s(i)}return u.emit("data",t,r),s(null,t)}u.end(!0)})}catch(a){return u.emit("error",a,r),void setTimeout(function(){s(a)},0)}else setTimeout(function(){s(Error("already ended"))},0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},oe}()),le}function pe(){return fe?ae:(fe=1,ae={})}function de(){return he||(he=1,function(){var e=S;function t(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=ie(),e.BufferWriter=function(){if(X)return G;X=1,G=r;var e=ie();(r.prototype=Object.create(e.prototype)).constructor=r;var t=re();function r(){e.call(this)}function i(e,r,i){e.length<40?t.utf8.write(e,r,i):r.utf8Write?r.utf8Write(e,i):r.write(e,i)}return r._configure=function(){r.alloc=t._Buffer_allocUnsafe,r.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]}},r.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var i=e.length>>>0;return this.uint32(i),i&&this._push(r.writeBytesBuffer,i,e),this},r.prototype.string=function(e){var r=t.Buffer.byteLength(e);return this.uint32(r),r&&this._push(i,r,e),this},r._configure(),G}(),e.Reader=ne(),e.BufferReader=function(){if(ee)return Y;ee=1,Y=r;var e=ne();(r.prototype=Object.create(e.prototype)).constructor=r;var t=re();function r(t){e.call(this,t)}return r._configure=function(){t.Buffer&&(r.prototype._slice=t.Buffer.prototype.slice)},r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},r._configure(),Y}(),e.util=re(),e.rpc=ce(),e.roots=pe(),e.configure=t,t()}()),S}var ye,ve,ge,me,be={},we={exports:{}};var Oe,_e,je,Ae,Ee,ke,Te,Ne,Se,xe,Re,Be,Ie,Le,Fe,De={};function Pe(){if(je)return _e;je=1,_e=a;var e=Ot();((a.prototype=Object.create(e.prototype)).constructor=a).className="Namespace";var t,r,i,n=bt(),o=gt(),s=wt();function u(e,t){if(e&&e.length){for(var r={},i=0;i<e.length;++i)r[e[i].name]=e[i].toJSON(t);return r}}function a(t,r){e.call(this,t,r),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function f(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}return a.fromJSON=function(e,t){return new a(e,t.options).addJSON(t.nested)},a.arrayToJSON=u,a.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},a.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(a.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=o.toArray(this.nested))}}),a.prototype.toJSON=function(e){return o.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},a.prototype.addJSON=function(e){if(e)for(var o,s=Object.keys(e),u=0;u<s.length;++u)o=e[s[u]],this.add((void 0!==o.fields?t.fromJSON:void 0!==o.values?i.fromJSON:void 0!==o.methods?r.fromJSON:void 0!==o.id?n.fromJSON:a.fromJSON)(s[u],o));return this},a.prototype.get=function(e){return this.nested&&this.nested[e]||null},a.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof i)return this.nested[e].values;throw Error("no such enum: "+e)},a.prototype.add=function(e){if(!(e instanceof n&&void 0!==e.extend||e instanceof t||e instanceof s||e instanceof i||e instanceof r||e instanceof a))throw TypeError("object must be a valid nested object");if(this.nested){var o=this.get(e.name);if(o){if(!(o instanceof a&&e instanceof a)||o instanceof t||o instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var u=o.nestedArray,h=0;h<u.length;++h)e.add(u[h]);this.remove(o),this.nested||(this.nested={}),e.setOptions(o.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof i||this instanceof n||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var l=this;l=l.parent;)l._needsRecursiveFeatureResolution=!0,l._needsRecursiveResolve=!0;return e.onAdd(this),f(this)},a.prototype.remove=function(t){if(!(t instanceof e))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),f(this)},a.prototype.define=function(e,t){if(o.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var i=e.shift();if(r.nested&&r.nested[i]){if(!((r=r.nested[i])instanceof a))throw Error("path conflicts with non-namespace objects")}else r.add(r=new a(i))}return t&&r.addJSON(t),r},a.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof a?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},a.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.nestedArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},a.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),o.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var i=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+i];if(n&&(!t||t.indexOf(n.constructor)>-1))return n;if((n=this._lookupImpl(e,i))&&(!t||t.indexOf(n.constructor)>-1))return n;if(r)return null;for(var s=this;s.parent;){if((n=s.parent._lookupImpl(e,i))&&(!t||t.indexOf(n.constructor)>-1))return n;s=s.parent}return null},a.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var r=this.get(e[0]),i=null;if(r)1===e.length?i=r:r instanceof a&&(e=e.slice(1),i=r._lookupImpl(e,e.join(".")));else for(var n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof a&&(r=this._nestedArray[n]._lookupImpl(e,t))&&(i=r);return this._lookupCache[t]=i,i},a.prototype.lookupType=function(e){var r=this.lookup(e,[t]);if(!r)throw Error("no such type: "+e);return r},a.prototype.lookupEnum=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},a.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[t,i]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r},a.prototype.lookupService=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},a._configure=function(e,n,o){t=e,r=n,i=o},_e}function Ce(){if(Ee)return Ae;Ee=1,Ae=i;var e=bt();((i.prototype=Object.create(e.prototype)).constructor=i).className="MapField";var t=mt(),r=gt();function i(t,i,n,o,s,u){if(e.call(this,t,i,o,void 0,void 0,s,u),!r.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}return i.fromJSON=function(e,t){return new i(e,t.id,t.keyType,t.type,t.options,t.comment)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},i.prototype.resolve=function(){if(this.resolved)return this;if(void 0===t.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return e.prototype.resolve.call(this)},i.d=function(e,t,n){return"function"==typeof n?n=r.decorateType(n).name:n&&"object"==typeof n&&(n=r.decorateEnum(n).name),function(o,s){r.decorateType(o.constructor).add(new i(s,e,t,n))}},Ae}function $e(){if(Te)return ke;Te=1,ke=r;var e=Ot();((r.prototype=Object.create(e.prototype)).constructor=r).className="Method";var t=gt();function r(r,i,n,o,s,u,a,f,h){if(t.isObject(s)?(a=s,s=u=void 0):t.isObject(u)&&(a=u,u=void 0),void 0!==i&&!t.isString(i))throw TypeError("type must be a string");if(!t.isString(n))throw TypeError("requestType must be a string");if(!t.isString(o))throw TypeError("responseType must be a string");e.call(this,r,a),this.type=i||"rpc",this.requestType=n,this.requestStream=!!s||void 0,this.responseType=o,this.responseStream=!!u||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=f,this.parsedOptions=h}return r.fromJSON=function(e,t){return new r(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},r.prototype.toJSON=function(e){var r=!!e&&Boolean(e.keepComments);return t.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),e.prototype.resolve.call(this))},ke}function qe(){if(Se)return Ne;Se=1,Ne=n;var e=Pe();((n.prototype=Object.create(e.prototype)).constructor=n).className="Service";var t=$e(),r=gt(),i=ce();function n(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function o(e){return e._methodsArray=null,e}return n.fromJSON=function(e,r){var i=new n(e,r.options);if(r.methods)for(var o=Object.keys(r.methods),s=0;s<o.length;++s)i.add(t.fromJSON(o[s],r.methods[o[s]]));return r.nested&&i.addJSON(r.nested),r.edition&&(i._edition=r.edition),i.comment=r.comment,i._defaultEdition="proto3",i},n.prototype.toJSON=function(t){var i=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",i&&i.options||void 0,"methods",e.arrayToJSON(this.methodsArray,t)||{},"nested",i&&i.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(n.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),n.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},n.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},n.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},n.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof t?(this.methods[r.name]=r,r.parent=this,o(this)):e.prototype.add.call(this,r)},n.prototype.remove=function(r){if(r instanceof t){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,o(this)}return e.prototype.remove.call(this,r)},n.prototype.create=function(e,t,n){for(var o,s=new i.Service(e,t,n),u=0;u<this.methodsArray.length;++u){var a=r.lcFirst((o=this._methodsArray[u]).resolve().name).replace(/[^$\w_]/g,"");s[a]=r.codegen(["r","c"],r.isReserved(a)?a+"_":a)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return s},Ne}function Je(){if(Re)return xe;Re=1,xe=t;var e=re();function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return t.create=function(e){return this.$type.create(e)},t.encode=function(e,t){return this.$type.encode(e,t)},t.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},t.decode=function(e){return this.$type.decode(e)},t.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},t.verify=function(e){return this.$type.verify(e)},t.fromObject=function(e){return this.$type.fromObject(e)},t.toObject=function(e,t){return this.$type.toObject(e,t)},t.prototype.toJSON=function(){return this.$type.toObject(this,e.toJSONOptions)},xe}function Ue(){if(Ie)return Be;Ie=1,Be=function(n){for(var o=r.codegen(["r","l","e"],n.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(n.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),s=0;s<n.fieldsArray.length;++s){var u=n._fieldsArray[s].resolve(),a=u.resolvedType instanceof e?"int32":u.type,f="m"+r.safeProp(u.name);o("case %i: {",u.id),u.map?(o("if(%s===util.emptyObject)",f)("%s={}",f)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[u.keyType]?o("k=%j",t.defaults[u.keyType]):o("k=null"),void 0!==t.defaults[a]?o("value=%j",t.defaults[a]):o("value=null"),o("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",u.keyType)("case 2:"),void 0===t.basic[a]?o("value=types[%i].decode(r,r.uint32())",s):o("value=r.%s()",a),o("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[u.keyType]?o('%s[typeof k==="object"?util.longToHash(k):k]=value',f):o("%s[k]=value",f)):u.repeated?(o("if(!(%s&&%s.length))",f,f)("%s=[]",f),void 0!==t.packed[a]&&o("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",f,a)("}else"),void 0===t.basic[a]?o(u.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",f,s):o("%s.push(r.%s())",f,a)):void 0===t.basic[a]?o(u.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",f,s):o("%s=r.%s()",f,a),o("break")("}")}for(o("default:")("r.skipType(t&7)")("break")("}")("}"),s=0;s<n._fieldsArray.length;++s){var h=n._fieldsArray[s];h.required&&o("if(!m.hasOwnProperty(%j))",h.name)("throw util.ProtocolError(%j,{instance:m})",i(h))}return o("return m")};var e=_t(),t=mt(),r=gt();function i(e){return"missing required '"+e.name+"'"}return Be}function Me(){if(Fe)return Le;Fe=1,Le=function(e){var o=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),s=e.oneofsArray,u={};s.length&&o("var p={}");for(var a=0;a<e.fieldsArray.length;++a){var f=e._fieldsArray[a].resolve(),h="m"+t.safeProp(f.name);if(f.optional&&o("if(%s!=null&&m.hasOwnProperty(%j)){",h,f.name),f.map)o("if(!util.isObject(%s))",h)("return%j",r(f,"object"))("var k=Object.keys(%s)",h)("for(var i=0;i<k.length;++i){"),n(o,f,"k[i]"),i(o,f,a,h+"[k[i]]")("}");else if(f.repeated)o("if(!Array.isArray(%s))",h)("return%j",r(f,"array"))("for(var i=0;i<%s.length;++i){",h),i(o,f,a,h+"[i]")("}");else{if(f.partOf){var l=t.safeProp(f.partOf.name);1===u[f.partOf.name]&&o("if(p%s===1)",l)("return%j",f.partOf.name+": multiple values"),u[f.partOf.name]=1,o("p%s=1",l)}i(o,f,a,h)}f.optional&&o("}")}return o("return null")};var e=_t(),t=gt();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function i(t,i,n,o){if(i.resolvedType)if(i.resolvedType instanceof e){t("switch(%s){",o)("default:")("return%j",r(i,"enum value"));for(var s=Object.keys(i.resolvedType.values),u=0;u<s.length;++u)t("case %i:",i.resolvedType.values[s[u]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",n,o)("if(e)")("return%j+e",i.name+".")("}");else switch(i.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",o)("return%j",r(i,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",r(i,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',o)("return%j",r(i,"number"));break;case"bool":t('if(typeof %s!=="boolean")',o)("return%j",r(i,"boolean"));break;case"string":t("if(!util.isString(%s))",o)("return%j",r(i,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",r(i,"buffer"))}return t}function n(e,t,i){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",i)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",i)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",i)("return%j",r(t,"boolean key"))}return e}return Le}var ze,Ze={};function He(){return ze||(ze=1,function(){var e=Ze,t=_t(),r=gt();function i(e,r,i,n){var o=!1;if(r.resolvedType)if(r.resolvedType instanceof t){e("switch(d%s){",n);for(var s=r.resolvedType.values,u=Object.keys(s),a=0;a<u.length;++a)s[u[a]]!==r.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),r.repeated||e("break"),o=!0),e("case%j:",u[a])("case %i:",s[u[a]])("m%s=%j",n,s[u[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",r.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,i,n);else{var f=!1;switch(r.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":f=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,f)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,f?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function n(e,r,i,n){if(r.resolvedType)r.resolvedType instanceof t?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,i,n,n,i,n,n):e("d%s=types[%i].toObject(m%s,o)",n,i,n);else{var o=!1;switch(r.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}e.fromObject=function(e){var n=e.fieldsArray,o=r.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return o("return new this.ctor");o("var m=new this.ctor");for(var s=0;s<n.length;++s){var u=n[s].resolve(),a=r.safeProp(u.name);u.map?(o("if(d%s){",a)('if(typeof d%s!=="object")',a)("throw TypeError(%j)",u.fullName+": object expected")("m%s={}",a)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",a),i(o,u,s,a+"[ks[i]]")("}")("}")):u.repeated?(o("if(d%s){",a)("if(!Array.isArray(d%s))",a)("throw TypeError(%j)",u.fullName+": array expected")("m%s=[]",a)("for(var i=0;i<d%s.length;++i){",a),i(o,u,s,a+"[i]")("}")("}")):(u.resolvedType instanceof t||o("if(d%s!=null){",a),i(o,u,s,a),u.resolvedType instanceof t||o("}"))}return o("return m")},e.toObject=function(e){var i=e.fieldsArray.slice().sort(r.compareFieldsById);if(!i.length)return r.codegen()("return {}");for(var o=r.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),s=[],u=[],a=[],f=0;f<i.length;++f)i[f].partOf||(i[f].resolve().repeated?s:i[f].map?u:a).push(i[f]);if(s.length){for(o("if(o.arrays||o.defaults){"),f=0;f<s.length;++f)o("d%s=[]",r.safeProp(s[f].name));o("}")}if(u.length){for(o("if(o.objects||o.defaults){"),f=0;f<u.length;++f)o("d%s={}",r.safeProp(u[f].name));o("}")}if(a.length){for(o("if(o.defaults){"),f=0;f<a.length;++f){var h=a[f],l=r.safeProp(h.name);if(h.resolvedType instanceof t)o("d%s=o.enums===String?%j:%j",l,h.resolvedType.valuesById[h.typeDefault],h.typeDefault);else if(h.long)o("if(util.Long){")("var n=new util.Long(%i,%i,%j)",h.typeDefault.low,h.typeDefault.high,h.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,h.typeDefault.toString(),h.typeDefault.toNumber());else if(h.bytes){var c="["+Array.prototype.slice.call(h.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,h.typeDefault))("else{")("d%s=%s",l,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else o("d%s=%j",l,h.typeDefault)}o("}")}var p=!1;for(f=0;f<i.length;++f){h=i[f];var d=e._fieldsArray.indexOf(h);l=r.safeProp(h.name);h.map?(p||(p=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),n(o,h,d,l+"[ks2[j]]")("}")):h.repeated?(o("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),n(o,h,d,l+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",l,h.name),n(o,h,d,l),h.partOf&&o("if(o.oneofs)")("d%s=%j",r.safeProp(h.partOf.name),h.name)),o("}")}return o("return d")}}()),Ze}var We,Ve,Ge,Xe,Ke,Qe,Ye,et,tt,rt,it,nt,ot,st,ut,at,ft,ht,lt,ct,pt={};function dt(){return We||(We=1,e=pt,t=Je(),e[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var i="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===i.indexOf("/")&&(i="/"+i),this.create({type_url:i,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,r){var i="",n="";if(r&&r.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),i=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof t){var s=e.$type.toObject(e,r);return""===i&&(i="type.googleapis.com/"),n=i+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,r)}}),pt;var e,t}function yt(){if(Ge)return Ve;Ge=1,Ve=y;var e=Pe();((y.prototype=Object.create(e.prototype)).constructor=y).className="Type";var t=_t(),r=wt(),i=bt(),n=Ce(),o=qe(),s=Je(),u=ne(),a=ie(),f=gt(),h=jt(),l=Ue(),c=Me(),p=He(),d=dt();function y(t,r){e.call(this,t,r),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],i=r.id;if(this._fieldsById[i])throw Error("duplicate id "+i+" in "+this);this._fieldsById[i]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=f.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=f.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof s||((e.prototype=new s).constructor=e,f.merge(e.prototype,t)),e.$type=e.prototype.$type=this,f.merge(e,s,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var i={};for(r=0;r<this.oneofsArray.length;++r)i[this._oneofsArray[r].resolve().name]={get:f.oneOfGetter(this._oneofsArray[r].oneof),set:f.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,i)}}}),y.generateConstructor=function(e){for(var t,r=f.codegen(["p"],e.name),i=0;i<e.fieldsArray.length;++i)(t=e._fieldsArray[i]).map?r("this%s={}",f.safeProp(t.name)):t.repeated&&r("this%s=[]",f.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},y.fromJSON=function(s,u){var a=new y(s,u.options);a.extensions=u.extensions,a.reserved=u.reserved;for(var f=Object.keys(u.fields),h=0;h<f.length;++h)a.add((void 0!==u.fields[f[h]].keyType?n.fromJSON:i.fromJSON)(f[h],u.fields[f[h]]));if(u.oneofs)for(f=Object.keys(u.oneofs),h=0;h<f.length;++h)a.add(r.fromJSON(f[h],u.oneofs[f[h]]));if(u.nested)for(f=Object.keys(u.nested),h=0;h<f.length;++h){var l=u.nested[f[h]];a.add((void 0!==l.id?i.fromJSON:void 0!==l.fields?y.fromJSON:void 0!==l.values?t.fromJSON:void 0!==l.methods?o.fromJSON:e.fromJSON)(f[h],l))}return u.extensions&&u.extensions.length&&(a.extensions=u.extensions),u.reserved&&u.reserved.length&&(a.reserved=u.reserved),u.group&&(a.group=!0),u.comment&&(a.comment=u.comment),u.edition&&(a._edition=u.edition),a._defaultEdition="proto3",a},y.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),i=!!t&&Boolean(t.keepComments);return f.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",e.arrayToJSON(this.oneofsArray,t),"fields",e.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",i?this.comment:void 0])},y.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolveAll.call(this);var t=this.oneofsArray;for(i=0;i<t.length;)t[i++].resolve();for(var r=this.fieldsArray,i=0;i<r.length;)r[i++].resolve();return this},y.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.oneofsArray.forEach(e=>{e._resolveFeatures(t)}),this.fieldsArray.forEach(e=>{e._resolveFeatures(t)}),this):this},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof i&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),v(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),v(this)):e.prototype.add.call(this,t)},y.prototype.remove=function(t){if(t instanceof i&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),v(this)}if(t instanceof r){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),v(this)}return e.prototype.remove.call(this,t)},y.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},y.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},y.prototype.create=function(e){return new this.ctor(e)},y.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=h(this)({Writer:a,types:t,util:f}),this.decode=l(this)({Reader:u,types:t,util:f}),this.verify=c(this)({types:t,util:f}),this.fromObject=p.fromObject(this)({types:t,util:f}),this.toObject=p.toObject(this)({types:t,util:f});var i=d[e];if(i){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(n),n.toObject=this.toObject,this.toObject=i.toObject.bind(n)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){f.decorateType(t,e)}},Ve}function vt(){if(Ke)return Xe;Ke=1,Xe=a;var e=Pe();((a.prototype=Object.create(e.prototype)).constructor=a).className="Root";var t,r,i,n=bt(),o=_t(),s=wt(),u=gt();function a(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function f(){}a.fromJSON=function(e,t){return t||(t=new a),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},a.prototype.resolvePath=u.path.resolve,a.prototype.fetch=u.fetch,a.prototype.load=function e(t,n,o){"function"==typeof n&&(o=n,n=void 0);var s=this;if(!o)return u.asPromise(e,s,t,n);var a=o===f;function h(e,t){if(o){if(a)throw e;t&&t.resolveAll();var r=o;o=null,r(e,t)}}function l(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in i)return r}return null}function c(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){r.filename=e;var i,o=r(t,s,n),f=0;if(o.imports)for(;f<o.imports.length;++f)(i=l(o.imports[f])||s.resolvePath(e,o.imports[f]))&&p(i);if(o.weakImports)for(f=0;f<o.weakImports.length;++f)(i=l(o.weakImports[f])||s.resolvePath(e,o.weakImports[f]))&&p(i,!0)}else s.setOptions(t.options).addJSON(t.nested)}catch(c){h(c)}a||d||h(null,s)}function p(e,t){if(e=l(e)||e,!(s.files.indexOf(e)>-1))if(s.files.push(e),e in i)a?c(e,i[e]):(++d,setTimeout(function(){--d,c(e,i[e])}));else if(a){var r;try{r=u.fs.readFileSync(e).toString("utf8")}catch(n){return void(t||h(n))}c(e,r)}else++d,s.fetch(e,function(r,i){--d,o&&(r?t?d||h(null,s):h(r):c(e,i))})}var d=0;u.isString(t)&&(t=[t]);for(var y,v=0;v<t.length;++v)(y=s.resolvePath("",t[v]))&&p(y);return a?(s.resolveAll(),s):(d||h(null,s),s)},a.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,f)},a.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return e.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function l(e,t){var r=t.parent.lookup(t.extend);if(r){var i=new n(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(i.name)||(i.declaringField=t,t.extensionField=i,r.add(i)),!0}return!1}return a.prototype._handleAdd=function(e){if(e instanceof n)void 0===e.extend||e.extensionField||l(0,e)||this.deferred.push(e);else if(e instanceof o)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof s)){if(e instanceof t)for(var r=0;r<this.deferred.length;)l(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var i=0;i<e.nestedArray.length;++i)this._handleAdd(e._nestedArray[i]);h.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof o||e instanceof n)&&(this._fullyQualifiedObjects[e.fullName]=e)},a.prototype._handleRemove=function(t){if(t instanceof n){if(void 0!==t.extend)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var r=this.deferred.indexOf(t);r>-1&&this.deferred.splice(r,1)}}else if(t instanceof o)h.test(t.name)&&delete t.parent[t.name];else if(t instanceof e){for(var i=0;i<t.nestedArray.length;++i)this._handleRemove(t._nestedArray[i]);h.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},a._configure=function(e,n,o){t=e,r=n,i=o},Xe}function gt(){if(Qe)return we.exports;Qe=1;var e,t,r,i,n,o=we.exports=re(),s=pe();o.codegen=function(){if(ve)return ye;function e(t,r){"string"==typeof t&&(r=t,t=void 0);var i=[];function n(t){if("string"!=typeof t){var r=o();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var s=Object.keys(t),u=new Array(s.length+1),a=new Array(s.length),f=0;f<s.length;)u[f]=s[f],a[f]=t[s[f++]];return u[f]=r,Function.apply(null,u).apply(null,a)}return Function(r)()}for(var h=new Array(arguments.length-1),l=0;l<h.length;)h[l]=arguments[++l];if(l=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=h[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"}),l!==h.length)throw Error("parameter count mismatch");return i.push(t),n}function o(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+i.join("\n ")+"\n}"}return n.toString=o,n}return ve=1,ye=e,e.verbose=!1,ye}(),o.fetch=function(){if(me)return ge;me=1,ge=r;var e=R(),t=q()("fs");function r(i,n,o){return"function"==typeof n?(o=n,n={}):n||(n={}),o?!n.xhr&&t&&t.readFile?t.readFile(i,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(i,n,o):e?o(e):o(null,n.binary?t:t.toString("utf8"))}):r.xhr(i,n,o):e(r,this,i,n)}return r.xhr=function(e,t,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(0!==i.status&&200!==i.status)return r(Error("status "+i.status));if(t.binary){var e=i.response;if(!e){e=[];for(var n=0;n<i.responseText.length;++n)e.push(255&i.responseText.charCodeAt(n))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,i.responseText)}},t.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()},ge}(),o.path=(Oe||(Oe=1,i=(r=De).isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return n+t.join("/")},r.resolve=function(e,t,r){return r||(t=n(t)),i(t)?t:(r||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}),De),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),i=0;i<t.length;)r[i]=e[t[i++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var i=e[r++],n=e[r++];void 0!==n&&(t[i]=n)}return t};var u=/\\/g,a=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(u,"\\\\").replace(a,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var f=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(f,function(e,t){return t.toUpperCase()})},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(t,r){if(t.$type)return r&&t.$type.name!==r&&(o.decorateRoot.remove(t.$type),t.$type.name=r,o.decorateRoot.add(t.$type)),t.$type;e||(e=yt());var i=new e(r||t.name);return o.decorateRoot.add(i),i.ctor=t,Object.defineProperty(t,"$type",{value:i,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:i,enumerable:!1}),i};var h=0;return o.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=_t());var r=new t("Enum"+h++,e);return o.decorateRoot.add(r),Object.defineProperty(e,"$type",{value:r,enumerable:!1}),r},o.setProperty=function(e,t,r,i){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o||"prototype"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var s=t[o];if(s&&i)return t;s&&(n=[].concat(s).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(vt()))}}),we.exports}function mt(){return Ye||(Ye=1,function(){var e=be,t=gt(),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(e,t){var i=0,n={};for(t|=0;i<e.length;)n[r[i+t]]=e[i++];return n}e.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),e.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",t.emptyArray,null]),e.long=i([0,0,0,1,1],7),e.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),e.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])}()),be}function bt(){if(tt)return et;tt=1,et=s;var e=Ot();((s.prototype=Object.create(e.prototype)).constructor=s).className="Field";var t,r=_t(),i=mt(),n=gt(),o=/^required|optional|repeated$/;function s(t,r,s,u,a,f,h){if(n.isObject(u)?(h=a,f=u,u=a=void 0):n.isObject(a)&&(h=f,f=a,a=void 0),e.call(this,t,f),!n.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!n.isString(s))throw TypeError("type must be a string");if(void 0!==u&&!o.test(u=u.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==a&&!n.isString(a))throw TypeError("extend must be a string");"proto3_optional"===u&&(u="optional"),this.rule=u&&"optional"!==u?u:void 0,this.type=s,this.id=r,this.extend=a||void 0,this.repeated="repeated"===u,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!n.Long&&void 0!==i.long[s],this.bytes="bytes"===s,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=h}return s.fromJSON=function(e,t){var r=new s(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},Object.defineProperty(s.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(s.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(s.prototype,"delimited",{get:function(){return this.resolvedType instanceof t&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(s.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(s.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),s.prototype.setOption=function(t,r,i){return e.prototype.setOption.call(this,t,r,i)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=i.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof t?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=n.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var o;n.base64.test(this.typeDefault)?n.base64.decode(this.typeDefault,o=n.newBuffer(n.base64.length(this.typeDefault)),0):n.utf8.write(this.typeDefault,o=n.newBuffer(n.utf8.length(this.typeDefault)),0),this.typeDefault=o}return this.map?this.defaultValue=n.emptyObject:this.repeated?this.defaultValue=n.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof t&&(this.parent.ctor.prototype[this.name]=this.defaultValue),e.prototype.resolve.call(this)},s.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var r={};if("required"===this.rule&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===i.defaults[this.type]){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof t&&n.group&&(r.message_encoding="DELIMITED")}return!0===this.getOption("packed")?r.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(r.repeated_field_encoding="EXPANDED"),r},s.prototype._resolveFeatures=function(t){return e.prototype._resolveFeatures.call(this,this._edition||t)},s.d=function(e,t,r,i){return"function"==typeof t?t=n.decorateType(t).name:t&&"object"==typeof t&&(t=n.decorateEnum(t).name),function(o,u){n.decorateType(o.constructor).add(new s(u,e,t,r,{default:i}))}},s._configure=function(e){t=e},et}function wt(){if(it)return rt;it=1,rt=i;var e=Ot();((i.prototype=Object.create(e.prototype)).constructor=i).className="OneOf";var t=bt(),r=gt();function i(t,r,i,n){if(Array.isArray(r)||(i=r,r=void 0),e.call(this,t,i),void 0!==r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.fieldsArray=[],this.comment=n}function n(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}return i.fromJSON=function(e,t){return new i(e,t.oneof,t.options,t.comment)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},i.prototype.add=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,n(this),this},i.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),(r=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(r,1),e.partOf=null,this},i.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var r=0;r<this.oneof.length;++r){var i=t.get(this.oneof[r]);i&&!i.partOf&&(i.partOf=this,this.fieldsArray.push(i))}n(this)},i.prototype.onRemove=function(t){for(var r,i=0;i<this.fieldsArray.length;++i)(r=this.fieldsArray[i]).parent&&r.parent.remove(r);e.prototype.onRemove.call(this,t)},Object.defineProperty(i.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),i.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){r.decorateType(t.constructor).add(new i(n,e)),Object.defineProperty(t,n,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}},rt}function Ot(){if(ot)return nt;ot=1,nt=s,s.className="ReflectionObject";const e=wt();var t,r=gt(),i={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},n={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},o={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function s(e,t){if(!r.isString(e))throw TypeError("name must be a string");if(t&&!r.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(s.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),s.prototype.toJSON=function(){throw Error()},s.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof t&&r._handleAdd(this)},s.prototype.onRemove=function(e){var r=e.root;r instanceof t&&r._handleRemove(this),this.parent=null,this.resolved=!1},s.prototype.resolve=function(){return this.resolved||this.root instanceof t&&(this.resolved=!0),this},s.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},s.prototype._resolveFeatures=function(t){if(!this._featuresResolved){var r={};if(!t)throw new Error("Unknown edition for "+this.fullName);var s=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(t));if(this._edition){if("proto2"===t)r=Object.assign({},n);else if("proto3"===t)r=Object.assign({},o);else{if("2023"!==t)throw new Error("Unknown edition: "+t);r=Object.assign({},i)}return this._features=Object.assign(r,s||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof e){var u=Object.assign({},this.partOf._features);this._features=Object.assign(u,s||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var a=Object.assign({},this.parent._features);this._features=Object.assign(a,s||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},s.prototype._inferLegacyProtoFeatures=function(){return{}},s.prototype.getOption=function(e){if(this.options)return this.options[e]},s.prototype.setOption=function(e,t,i){return this.options||(this.options={}),/^features\./.test(e)?r.setProperty(this.options,e,t,i):i&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},s.prototype.setParsedOption=function(e,t,i){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(i){var o=n.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(o){var s=o[e];r.setProperty(s,i,t)}else(o={})[e]=r.setProperty({},i,t),n.push(o)}else{var u={};u[e]=t,n.push(u)}return this},s.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),i=0;i<r.length;++i)this.setOption(r[i],e[r[i]],t);return this},s.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},s.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},s._configure=function(e){t=e},nt}function _t(){if(ut)return st;ut=1,st=i;var e=Ot();((i.prototype=Object.create(e.prototype)).constructor=i).className="Enum";var t=Pe(),r=gt();function i(t,r,i,n,o,s){if(e.call(this,t,i),r&&"object"!=typeof r)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=o||{},this.valuesOptions=s,this._valuesFeatures={},this.reserved=void 0,r)for(var u=Object.keys(r),a=0;a<u.length;++a)"number"==typeof r[u[a]]&&(this.valuesById[this.values[u[a]]=r[u[a]]]=u[a])}return i.prototype._resolveFeatures=function(t){return t=this._edition||t,e.prototype._resolveFeatures.call(this,t),Object.keys(this.values).forEach(e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},i.fromJSON=function(e,t){var r=new i(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},i.prototype.add=function(e,t,i,n){if(!r.isString(e))throw TypeError("name must be a string");if(!r.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=i||null,this},i.prototype.remove=function(e){if(!r.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},i.prototype.isReservedId=function(e){return t.isReservedId(this.reserved,e)},i.prototype.isReservedName=function(e){return t.isReservedName(this.reserved,e)},st}function jt(){if(ft)return at;ft=1,at=function(n){for(var o,s=r.codegen(["m","w"],n.name+"$encode")("if(!w)")("w=Writer.create()"),u=n.fieldsArray.slice().sort(r.compareFieldsById),a=0;a<u.length;++a){var f=u[a].resolve(),h=n._fieldsArray.indexOf(f),l=f.resolvedType instanceof e?"int32":f.type,c=t.basic[l];o="m"+r.safeProp(f.name),f.map?(s("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",o,f.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",o)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(f.id<<3|2)>>>0,8|t.mapKey[f.keyType],f.keyType),void 0===c?s("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",h,o):s(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,l,o),s("}")("}")):f.repeated?(s("if(%s!=null&&%s.length){",o,o),f.packed&&void 0!==t.packed[l]?s("w.uint32(%i).fork()",(f.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",o)("w.%s(%s[i])",l,o)("w.ldelim()"):(s("for(var i=0;i<%s.length;++i)",o),void 0===c?i(s,f,h,o+"[i]"):s("w.uint32(%i).%s(%s[i])",(f.id<<3|c)>>>0,l,o)),s("}")):(f.optional&&s("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",o,f.name),void 0===c?i(s,f,h,o):s("w.uint32(%i).%s(%s)",(f.id<<3|c)>>>0,l,o))}return s("return w")};var e=_t(),t=mt(),r=gt();function i(e,t,r,i){return t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,i,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,i,(t.id<<3|2)>>>0)}return at}var At=ct?lt:(ct=1,lt=function(){if(ht)return N.exports;ht=1;var e=N.exports=de();return e.build="light",e.load=function(t,r,i){return"function"==typeof r?(i=r,r=new e.Root):r||(r=new e.Root),r.load(t,i)},e.loadSync=function(t,r){return r||(r=new e.Root),r.loadSync(t)},e.encoder=jt(),e.decoder=Ue(),e.verifier=Me(),e.converter=He(),e.ReflectionObject=Ot(),e.Namespace=Pe(),e.Root=vt(),e.Enum=_t(),e.Type=yt(),e.Field=bt(),e.OneOf=wt(),e.MapField=Ce(),e.Service=qe(),e.Method=$e(),e.Message=Je(),e.wrappers=dt(),e.types=mt(),e.util=gt(),e.ReflectionObject._configure(e.Root),e.Namespace._configure(e.Type,e.Service,e.Enum),e.Root._configure(e.Type),e.Field._configure(e.Type),N.exports}());const Et=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),kt=e=>{class t extends At.Message{constructor(e){super(),((e,t)=>{if(t)for(const r of Object.keys(t)){const i=t[r];null!=i&&(e[r]=i)}})(this,e)}}const r=t;return r.$type=e,r.prototype.$type=e,r},Tt=e=>t.isLong(e),Nt=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"number"==typeof e.byteLength,St=e=>Object.prototype.hasOwnProperty.call(At.types.packed,e),xt=e=>{const t=e.resolve();return t.resolvedType instanceof At.Enum||St(t.type)},Rt=(e,t)=>t in e?e[t]:void 0,Bt=e=>{const t=e.resolve();return t.resolvedType instanceof At.Enum?0:(r=t.type,Object.prototype.hasOwnProperty.call(At.types.basic,r)?At.types.basic[t.type]:2);var r},It=(e,r)=>Tt(e)||"number"==typeof e||"string"==typeof e?e:Et(e)&&"number"==typeof e.low&&"number"==typeof e.high?new t(e.low,e.high,r):r?t.UZERO:t.ZERO,Lt=(e,t,r)=>{switch(t){case"double":return e.double(Number(r));case"float":return e.float(Number(r));case"int32":return e.int32(Number(r));case"uint32":return e.uint32(Number(r));case"sint32":return e.sint32(Number(r));case"fixed32":return e.fixed32(Number(r));case"sfixed32":return e.sfixed32(Number(r));case"int64":return e.int64(It(r,!1));case"uint64":return e.uint64(It(r,!0));case"sint64":return e.sint64(It(r,!1));case"fixed64":return e.fixed64(It(r,!0));case"sfixed64":return e.sfixed64(It(r,!1));case"bool":return e.bool(Boolean(r));case"string":return e.string(String(r));case"bytes":return e.bytes((e=>"string"==typeof e?e:Nt(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)?Uint8Array.from(e.filter(e=>"number"==typeof e)):new Uint8Array)(r));default:throw new TypeError(`Unsupported protobuf field type: ${t}`)}},Ft=(e,t,r)=>{if(t<0||e.pos+t>r)throw RangeError(`index out of range: ${e.pos} + ${t} > ${r}`)},Dt=(e,t)=>{const r=e.uint32();return Ft(e,r,t),r},Pt=(e,t,r)=>{const i=e.len;e.len=r;try{switch(t){case 0:return void e.skip();case 1:return Ft(e,8,r),void e.skip(8);case 2:{const t=Dt(e,r);return void e.skip(t)}case 5:return Ft(e,4,r),void e.skip(4);default:throw new Error(`Unsupported protobuf wire type: ${String(t)}`)}}finally{e.len=i}},Ct=(e,t,r)=>{const i=t.resolve(),n=i.resolvedType;if(n instanceof At.Type){const t=e.fork();return qt(n,Et(r)?r:{},t),t.ldelim(),e}return n instanceof At.Enum?(e.int32("number"==typeof r?r:Number(r)),e):Lt(e,i.type,r)},$t=(e,t,r)=>{if(0===r.length)return e;const i=t.resolve();if(St(i.type)&&t.packed){e.uint32(t.id<<3|2).fork();for(const i of r)Ct(e,t,i);return e.ldelim(),e}const n=Bt(t);for(const o of r)e.uint32(t.id<<3|n),Ct(e,t,o);return e},qt=(e,t,r=At.Writer.create())=>{const i=e.fieldsArray.slice().sort(At.util.compareFieldsById);for(const n of i){const e=Rt(t,n.name);null!=e&&(n.repeated?$t(r,n,Array.isArray(e)?e:[]):(r.uint32(n.id<<3|Bt(n)),Ct(r,n,e)))}return r},Jt=(e,t,r,i)=>{const n=t.resolve(),o=n.resolvedType;return o instanceof At.Type?2!==r?void Pt(e,r,i):Ut(o,e,Dt(e,i)):o instanceof At.Enum?e.int32():((e,t)=>{switch(t){case"double":return e.double();case"float":return e.float();case"int32":return e.int32();case"uint32":return e.uint32();case"sint32":return e.sint32();case"fixed32":return e.fixed32();case"sfixed32":return e.sfixed32();case"int64":return e.int64();case"uint64":return e.uint64();case"sint64":return e.sint64();case"fixed64":return e.fixed64();case"sfixed64":return e.sfixed64();case"bool":return e.bool();case"string":return e.string();case"bytes":return e.bytes();default:throw new TypeError(`Unsupported protobuf field type: ${t}`)}})(e,n.type)},Ut=(e,t,r)=>{const i=t instanceof At.Reader?t:At.Reader.create(t),n=void 0===r?i.len:i.pos+r,o=(e=>{const t={};for(const r of e.fieldsArray)r.repeated&&(t[r.name]=[]);return t})(e),s=e.fieldsById;for(;i.pos<n;){const t=i.pos,r=i.uint32(),a=s[r>>>3],f=7&r;try{if(!a){Pt(i,f,n);continue}if(a.repeated){const e=Array.isArray(o[a.name])?o[a.name]:[];if(xt(a)&&2===f){const t=Dt(i,n)+i.pos;for(;i.pos<t;)e.push(Jt(i,a,0,t))}else{const t=Jt(i,a,f,n);void 0!==t&&e.push(t)}o[a.name]=e;continue}const e=Jt(i,a,f,n);void 0!==e&&(o[a.name]=e)}catch(u){if(u instanceof RangeError){const o=a?`${a.name}#${a.id}`:`unknown#${r>>>3}`;throw new RangeError(`${u.message}; protobufType=${e.fullName}; field=${o}; tag=${r}; wireType=${f}; tagPosition=${t}; readerPosition=${i.pos}; messageEnd=${n}`)}throw u}}return o},Mt=(e,t)=>t?.longs===String?e.toString():t?.longs===Number?e.toNumber():e,zt=(e,t)=>{const r=e.resolve();if(r.resolvedType instanceof At.Type)return null;if(r.resolvedType instanceof At.Enum){if(t?.enums===String){return r.resolvedType.valuesById[r.typeDefault]??r.typeDefault}return r.typeDefault}return"bytes"===r.type?t?.bytes===String?"":t?.bytes===Array?[]:new Uint8Array:r.long&&Tt(r.typeDefault)?Mt(r.typeDefault,t):r.typeDefault},Zt=(e,t,r)=>{const i=e.resolve();if(void 0!==t)return i.resolvedType instanceof At.Type?Et(t)?Ht(i.resolvedType,t,r):t:i.resolvedType instanceof At.Enum?r?.enums===String&&"number"==typeof t?i.resolvedType.valuesById[t]??t:t:i.long&&Tt(t)?Mt(t,r):"bytes"===i.type&&Nt(t)?((e,t)=>t?.bytes===String?At.util.base64.encode(e,0,e.length):t?.bytes===Array?Array.prototype.slice.call(e):e)(t,r):t},Ht=(e,t,r)=>{const i={};for(const n of e.fieldsArray.slice().sort(At.util.compareFieldsById)){const e=Rt(t,n.name);n.repeated?Array.isArray(e)?i[n.name]=e.map(e=>Zt(n,e,r)):(r?.arrays||r?.defaults)&&(i[n.name]=[]):null==e?r?.defaults&&(i[n.name]=zt(n,r)):i[n.name]=Zt(n,e,r)}return i},Wt=e=>{const t=e;t.__reflectionCodecInstalled||(t.__reflectionCodecInstalled=!0,e.encode=(t,r)=>qt(e,Et(t)?t:{},r),e.decode=(t,r)=>Ut(e,t,r),e.fromObject=e=>Et(e)?e:{},e.toObject=(t,r)=>Ht(e,Et(t)?t:{},r),e.create=e=>e?{...e}:{},e.verify=()=>null)},Vt=e=>{Wt(e);for(const t of e.nestedArray)if(t instanceof At.Type)Vt(t);else if(t instanceof At.Namespace)for(const e of t.nestedArray)e instanceof At.Type&&Vt(e)},Gt=e=>{for(const t of e.nestedArray)t instanceof At.Type?Vt(t):t instanceof At.Namespace&&Gt(t)};exports.Long=t,exports.encodeWithReflection=qt,exports.installReflectionCodecInNamespace=Gt,exports.installReflectionCodecRecursive=Vt,exports.installReflectionRuntime=()=>{const e=At.Type;e.__reflectionRuntimeInstalled||(e.generateConstructor=e=>()=>kt(e),At.Type.prototype.setup=function(){return Wt(this),this},At.Type.prototype.create=function(e){return e?{...e}:{}},At.Type.prototype.encode=function(e,t){return qt(this,Et(e)?e:{},t)},At.Type.prototype.decode=function(e,t){return Ut(this,e,t)},At.Type.prototype.fromObject=function(e){return Et(e)?e:{}},At.Type.prototype.toObject=function(e,t){return Ht(this,Et(e)?e:{},t)},At.Type.prototype.verify=function(){return null},e.__reflectionRuntimeInstalled=!0)},exports.lightExports=At;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./common-CfAlncj9.cjs"),t=t=>new e.ValidationError(`${t} must be a local paging cursor returned by SDK`,{code:e.ERROR_CODES.VALIDATION_INVALID_FORMAT,details:{fields:[{path:t,message:`${t} must be a local paging cursor returned by SDK`,rule:"invalid_format"}]}}),s=(e,t,s)=>{const n=e+t;return n<s?String(n):""},n=e=>"AT"===e||"NONE"===e||"ALL"===e?e:null;exports.hasSessionMark=(e,t)=>e.marks.includes(t),exports.queryMutedConversationsFromSessionList=r=>{if(!Number.isInteger(r.pageSize)||r.pageSize<=0)throw new e.ValidationError("pageSize must be a positive integer",{code:e.ERROR_CODES.VALIDATION_INVALID_FORMAT,details:{fields:[{path:"pageSize",message:"pageSize must be a positive integer",rule:"range"}]}});const o=((e,s)=>{if(void 0===e||""===e)return 0;if(!/^\d+$/.test(e))throw t(s);const n=Number.parseInt(e,10);if(!Number.isSafeInteger(n)||n<0)throw t(s);return n})(r.cursor,"cursor"),i=[];for(const e of r.items){if("chatRoom"===e.conversationType)continue;const t=n(e.remindType);t&&i.push({conversationId:e.conversationId,conversationType:e.conversationType,remindType:t})}return{conversations:i.slice(o,o+r.pageSize),cursor:s(o,r.pageSize,i.length)}},exports.toConversationItem=e=>({...e}),exports.toConversationSummary=e=>{const t=(e=>e?{msgId:e.msgServerId,type:"string"==typeof e.body.type?e.body.type:"unknown",body:e.body,timestamp:e.timestamp,modifiedInfo:e.modifiedInfo,userInfoUpdateTime:e.userInfoUpdateTime,namecardUpdateTime:e.namecardUpdateTime}:null)(e.lastMessage),s=e.lastMessageAt??e.lastMessage?.timestamp??0;return{conversationId:e.conversationId,type:e.conversationType,lastMessage:t,unreadCount:e.unreadCount,isPinned:e.isPinned,pinnedTime:e.pinnedTimestamp,marks:e.marks,lastAccess:s,lastUpdate:s}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as e,E as s}from"./common-DN_g4O3n.js";const t=t=>new e(`${t} must be a local paging cursor returned by SDK`,{code:s.VALIDATION_INVALID_FORMAT,details:{fields:[{path:t,message:`${t} must be a local paging cursor returned by SDK`,rule:"invalid_format"}]}}),n=(e,s,t)=>{const n=e+s;return n<t?String(n):""},a=e=>({...e}),r=e=>{const s=(e=>e?{msgId:e.msgServerId,type:"string"==typeof e.body.type?e.body.type:"unknown",body:e.body,timestamp:e.timestamp,modifiedInfo:e.modifiedInfo,userInfoUpdateTime:e.userInfoUpdateTime,namecardUpdateTime:e.namecardUpdateTime}:null)(e.lastMessage),t=e.lastMessageAt??e.lastMessage?.timestamp??0;return{conversationId:e.conversationId,type:e.conversationType,lastMessage:s,unreadCount:e.unreadCount,isPinned:e.isPinned,pinnedTime:e.pinnedTimestamp,marks:e.marks,lastAccess:t,lastUpdate:t}},i=e=>"AT"===e||"NONE"===e||"ALL"===e?e:null,o=a=>{if(!Number.isInteger(a.pageSize)||a.pageSize<=0)throw new e("pageSize must be a positive integer",{code:s.VALIDATION_INVALID_FORMAT,details:{fields:[{path:"pageSize",message:"pageSize must be a positive integer",rule:"range"}]}});const r=((e,s)=>{if(void 0===e||""===e)return 0;if(!/^\d+$/.test(e))throw t(s);const n=Number.parseInt(e,10);if(!Number.isSafeInteger(n)||n<0)throw t(s);return n})(a.cursor,"cursor"),o=[];for(const e of a.items){if("chatRoom"===e.conversationType)continue;const s=i(e.remindType);s&&o.push({conversationId:e.conversationId,conversationType:e.conversationType,remindType:s})}return{conversations:o.slice(r,r+a.pageSize),cursor:n(r,a.pageSize,o.length)}},d=(e,s)=>e.marks.includes(s);export{r as a,d as h,o as q,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./cache-utils-BwRPIZ7n.js";import{p as r,V as t,E as a}from"./common-DN_g4O3n.js";const n={nickname:"nickname",avatarUrl:"avatarurl",mail:"mail",phone:"phone",gender:"gender",sign:"sign",birth:"birth",ext:"ext"},i=(e,r,n)=>new t(e,{code:"required"===n?a.VALIDATION_REQUIRED:a.VALIDATION_INVALID_FORMAT,details:{fields:[{path:r,message:e,rule:n}]}}),s=(e,r)=>{if("string"!=typeof e)throw i(`${r} must be a string`,r,"invalid_format");return e},o=(e,r)=>{if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;throw i(`${r} must be a string, number, or boolean`,r,"invalid_format")},p=(e,r="attribute")=>{const t=n[e];if(!t)throw i(`${r} is invalid`,r,"invalid_format");return t},m=(e,r="params.userIds")=>{if(!Array.isArray(e)||0===e.length)throw i(`${r} is required`,r,"required");const t=[],a=/* @__PURE__ */new Set;for(const[n,i]of e.entries()){const e=s(i,`${r}[${n}]`).trim();e&&(a.has(e)||(a.add(e),t.push(e)))}if(0===t.length)throw i(`${r} is required`,r,"required");return t},d=(e,r="params.attributes")=>{if(!Array.isArray(e)||0===e.length)throw i(`${r} is required`,r,"required");const t=[],a=/* @__PURE__ */new Set;for(const[o,p]of e.entries()){const e=s(p,`${r}[${o}]`);if(!(e in n))throw i(`${r}[${o}] is invalid`,`${r}[${o}]`,"invalid_format");a.has(e)||(a.add(e),t.push(e))}if(0===t.length)throw i(`${r} is required`,r,"required");return t},u=e=>{const{orgName:t,appName:a}=r(e.appKey);return`/${t}/${a}/metadata/user/get`},f=e=>{const{orgName:t,appName:a}=r(e.appKey);return`/${t}/${a}/metadata/user/${encodeURIComponent(e.userId)}`},l=e=>({targets:m(e)}),g=(e,r)=>({targets:m(e),properties:d(r).map(e=>p(e,"params.attributes"))}),c=r=>!!e(r)&&("nickname"in r||"avatarurl"in r||"avatarUrl"in r||"mail"in r||"phone"in r||"gender"in r||"sign"in r||"birth"in r||"ext"in r),h=(r,t)=>{if(Array.isArray(r))for(const a of r){if(!e(a))continue;const r="string"==typeof a.username?a.username:"";r&&t.set(r,a)}},b=(e,r)=>{const t={userId:e};return"string"==typeof r.nickname&&(t.nickname=r.nickname),"string"==typeof r.avatarurl?t.avatarUrl=r.avatarurl:"string"==typeof r.avatarUrl&&(t.avatarUrl=r.avatarUrl),"string"==typeof r.mail&&(t.mail=r.mail),"string"==typeof r.phone&&(t.phone=r.phone),"string"!=typeof r.gender&&"number"!=typeof r.gender&&"boolean"!=typeof r.gender||(t.gender=r.gender),"string"==typeof r.sign&&(t.sign=r.sign),"string"==typeof r.birth&&(t.birth=r.birth),"string"==typeof r.ext&&(t.ext=r.ext),t},y=(r,t)=>{const a=(r=>{const t=/* @__PURE__ */new Map,a=e(r)?r:null;if(a?.data&&e(a.data))for(const[e,n]of Object.entries(a.data))c(n)&&t.set(e,n);return h(a?.entities,t),h(a?.data&&e(a.data)?a.data.entities:void 0,t),t})(r),n=(r=>{const t=/* @__PURE__ */new Map,a=e(r)?r:null;if(!a?.lastModified||!e(a.lastModified))return t;for(const[e,n]of Object.entries(a.lastModified))"number"==typeof n&&t.set(e,n);return t})(r),i=[];for(const e of t){const r=a.get(e);r&&i.push({profile:b(e,r),lastModified:n.get(e)})}return i},v=(e,r)=>y(e,r).map(e=>e.profile),$=(e,r,t,a)=>{void 0!==t&&("gender"!==r?e.push([r,s(t,a)]):e.push([r,String(o(t,a))]))},w=e=>e.map(([e,r])=>`${encodeURIComponent(e)}=${encodeURIComponent(r)}`).join("&"),I=e=>{const r=[];if($(r,"nickname",e.nickname,"params.nickname"),$(r,"avatarurl",e.avatarUrl,"params.avatarUrl"),$(r,"mail",e.mail,"params.mail"),$(r,"phone",e.phone,"params.phone"),$(r,"gender",e.gender,"params.gender"),$(r,"sign",e.sign,"params.sign"),$(r,"birth",e.birth,"params.birth"),$(r,"ext",e.ext,"params.ext"),0===r.length)throw i("params must include at least one updatable field","params","required");return w(r)},A=(e,r)=>{const t=p(e,"attribute"),a=o(r,"value");if("gender"!==t&&"string"!=typeof a)throw i("value must be a string","value","invalid_format");return w([[t,String(a)]])};export{u as a,l as b,m as c,g as d,d as e,I as f,f as g,A as h,y as i,v as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./cache-utils-CKbcYPlM.cjs"),r=require("./common-CfAlncj9.cjs"),t={nickname:"nickname",avatarUrl:"avatarurl",mail:"mail",phone:"phone",gender:"gender",sign:"sign",birth:"birth",ext:"ext"},n=(e,t,n)=>new r.ValidationError(e,{code:"required"===n?r.ERROR_CODES.VALIDATION_REQUIRED:r.ERROR_CODES.VALIDATION_INVALID_FORMAT,details:{fields:[{path:t,message:e,rule:n}]}}),a=(e,r)=>{if("string"!=typeof e)throw n(`${r} must be a string`,r,"invalid_format");return e},i=(e,r)=>{if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;throw n(`${r} must be a string, number, or boolean`,r,"invalid_format")},s=(e,r="attribute")=>{const a=t[e];if(!a)throw n(`${r} is invalid`,r,"invalid_format");return a},o=(e,r="params.userIds")=>{if(!Array.isArray(e)||0===e.length)throw n(`${r} is required`,r,"required");const t=[],i=new Set;for(const[n,s]of e.entries()){const e=a(s,`${r}[${n}]`).trim();e&&(i.has(e)||(i.add(e),t.push(e)))}if(0===t.length)throw n(`${r} is required`,r,"required");return t},d=(e,r="params.attributes")=>{if(!Array.isArray(e)||0===e.length)throw n(`${r} is required`,r,"required");const i=[],s=new Set;for(const[o,d]of e.entries()){const e=a(d,`${r}[${o}]`);if(!(e in t))throw n(`${r}[${o}] is invalid`,`${r}[${o}]`,"invalid_format");s.has(e)||(s.add(e),i.push(e))}if(0===i.length)throw n(`${r} is required`,r,"required");return i},p=r=>!!e.isRecord(r)&&("nickname"in r||"avatarurl"in r||"avatarUrl"in r||"mail"in r||"phone"in r||"gender"in r||"sign"in r||"birth"in r||"ext"in r),u=(r,t)=>{if(Array.isArray(r))for(const n of r){if(!e.isRecord(n))continue;const r="string"==typeof n.username?n.username:"";r&&t.set(r,n)}},l=(e,r)=>{const t={userId:e};return"string"==typeof r.nickname&&(t.nickname=r.nickname),"string"==typeof r.avatarurl?t.avatarUrl=r.avatarurl:"string"==typeof r.avatarUrl&&(t.avatarUrl=r.avatarUrl),"string"==typeof r.mail&&(t.mail=r.mail),"string"==typeof r.phone&&(t.phone=r.phone),"string"!=typeof r.gender&&"number"!=typeof r.gender&&"boolean"!=typeof r.gender||(t.gender=r.gender),"string"==typeof r.sign&&(t.sign=r.sign),"string"==typeof r.birth&&(t.birth=r.birth),"string"==typeof r.ext&&(t.ext=r.ext),t},m=(r,t)=>{const n=(r=>{const t=new Map,n=e.isRecord(r)?r:null;if(n?.data&&e.isRecord(n.data))for(const[e,a]of Object.entries(n.data))p(a)&&t.set(e,a);return u(n?.entities,t),u(n?.data&&e.isRecord(n.data)?n.data.entities:void 0,t),t})(r),a=(r=>{const t=new Map,n=e.isRecord(r)?r:null;if(!n?.lastModified||!e.isRecord(n.lastModified))return t;for(const[e,a]of Object.entries(n.lastModified))"number"==typeof a&&t.set(e,a);return t})(r),i=[];for(const e of t){const r=n.get(e);r&&i.push({profile:l(e,r),lastModified:a.get(e)})}return i},f=(e,r,t,n)=>{void 0!==t&&("gender"!==r?e.push([r,a(t,n)]):e.push([r,String(i(t,n))]))},c=e=>e.map(([e,r])=>`${encodeURIComponent(e)}=${encodeURIComponent(r)}`).join("&");exports.buildFetchUserInfoByAttributeRequest=(e,r)=>({targets:o(e),properties:d(r).map(e=>s(e,"params.attributes"))}),exports.buildFetchUserInfoByUserIdRequest=e=>({targets:o(e)}),exports.buildUpdateOwnInfoByAttributeFormBody=(e,r)=>{const t=s(e,"attribute"),a=i(r,"value");if("gender"!==t&&"string"!=typeof a)throw n("value must be a string","value","invalid_format");return c([[t,String(a)]])},exports.buildUpdateOwnInfoFormBody=e=>{const r=[];if(f(r,"nickname",e.nickname,"params.nickname"),f(r,"avatarurl",e.avatarUrl,"params.avatarUrl"),f(r,"mail",e.mail,"params.mail"),f(r,"phone",e.phone,"params.phone"),f(r,"gender",e.gender,"params.gender"),f(r,"sign",e.sign,"params.sign"),f(r,"birth",e.birth,"params.birth"),f(r,"ext",e.ext,"params.ext"),0===r.length)throw n("params must include at least one updatable field","params","required");return c(r)},exports.buildUserInfoFetchEndpoint=e=>{const{orgName:t,appName:n}=r.parseAppKey(e.appKey);return`/${t}/${n}/metadata/user/get`},exports.buildUserInfoUpdateEndpoint=e=>{const{orgName:t,appName:n}=r.parseAppKey(e.appKey);return`/${t}/${n}/metadata/user/${encodeURIComponent(e.userId)}`},exports.normalizeFetchedUserInfos=(e,r)=>m(e,r).map(e=>e.profile),exports.normalizeUserInfoAttributes=d,exports.normalizeUserInfoFetchRecords=m,exports.normalizeUserInfoTargetIds=o;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 缓存模块配置常量
|
|
3
|
+
*/
|
|
4
|
+
export declare const CACHE_SCHEMA_VERSION = 1;
|
|
5
|
+
export declare const CACHE_TTL_SECONDS: number;
|
|
6
|
+
export declare const CACHE_FLUSH_INTERVAL_MS = 1000;
|
|
7
|
+
export declare const CACHE_MAX_USER_INFO_COUNT = 1000;
|
|
8
|
+
export declare const CACHE_MAX_GROUP_NAMECARD_COUNT = 1000;
|
|
9
|
+
export declare const CACHE_EVICTION_USER_INFO_RATIO = 0.2;
|
|
10
|
+
export declare const CACHE_EVICTION_GROUP_NAMECARD_RATIO = 0.2;
|
|
11
|
+
export declare const CACHE_EVICTION_CONVERSATION_RATIO = 0.05;
|
|
12
|
+
export declare const CACHE_EVICTION_MIN_BATCH = 1;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 超时配置(集中定义)
|
|
3
|
+
*/
|
|
4
|
+
export declare const MESSAGE_TIMEOUT: number;
|
|
5
|
+
export declare const CHANNEL_SEND_MESSAGE_TIMEOUT: number;
|
|
6
|
+
export declare const REQUEST_TIMEOUT: number;
|
|
7
|
+
export declare const DATA_REPORT_TIMEOUT: number;
|
|
8
|
+
export declare const LOG_REPORT_DEFAULT_INTERVAL_MS: number;
|
|
9
|
+
export declare const LOG_REPORT_MIN_INTERVAL_MS: number;
|
|
10
|
+
export declare const UPLOAD_TIMEOUT: number;
|
|
11
|
+
export declare const GROUP_SHARED_FILE_DOWNLOAD_TIMEOUT: number;
|
|
12
|
+
export declare const GROUP_SHARED_FILE_UPLOAD_TIMEOUT: number;
|
|
13
|
+
export declare const CONNECT_TIMEOUT: number;
|
|
14
|
+
export declare const PROVISION_TIMEOUT: number;
|
|
15
|
+
export declare const HEARTBEAT_INTERVAL: number;
|
|
16
|
+
export declare const HEARTBEAT_TIMEOUT: number;
|
|
17
|
+
export declare const RECONNECT_INITIAL_DELAY: number;
|
|
18
|
+
export declare const RECONNECT_MAX_DELAY: number;
|
|
19
|
+
export declare const RECONNECT_BACKOFF_MULTIPLIER = 2;
|
|
20
|
+
export declare const SYNC_WEBSOCKET_CONNECT_TIMEOUT: number;
|
|
21
|
+
export declare const SYNC_WEBSOCKET_IDLE_TIMEOUT: number;
|
|
22
|
+
export declare const SYNC_WEBSOCKET_RETRY_INITIAL_DELAY: number;
|
|
23
|
+
export declare const SYNC_WEBSOCKET_RETRY_MAX_DELAY: number;
|
|
24
|
+
export declare const SYNC_WEBSOCKET_RETRY_BACKOFF_MULTIPLIER = 2;
|
|
25
|
+
export declare const SYNC_WEBSOCKET_COMPLETE_CLOSE_DELAY = 0;
|
|
26
|
+
export declare const SESSION_LIST_SYNC_OVERLAP_MS: number;
|
|
27
|
+
export declare const USER_INFO_HYDRATION_WINDOW_MS: number;
|
|
28
|
+
export declare const USER_INFO_HYDRATION_BATCH_SIZE = 20;
|
|
29
|
+
export declare const USER_INFO_HYDRATION_MAX_CONCURRENCY = 3;
|
|
30
|
+
export declare const USER_INFO_HYDRATION_MAX_RETRIES = 1;
|
|
31
|
+
export declare const GROUP_NAMECARD_HYDRATION_WINDOW_MS: number;
|
|
32
|
+
export declare const GROUP_NAMECARD_HYDRATION_MIN_WINDOW_MS = 1000;
|
|
33
|
+
export declare const GROUP_NAMECARD_HYDRATION_BATCH_SIZE = 50;
|
|
34
|
+
export declare const GROUP_NAMECARD_HYDRATION_MAX_CONCURRENCY = 5;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 连接管理器
|
|
3
|
+
*
|
|
4
|
+
* 负责 WebSocket 连接管理、状态管理、事件处理
|
|
5
|
+
* 参考:engineCore/connection.ts
|
|
6
|
+
*/
|
|
7
|
+
import { EventHub } from '../events/event-hub';
|
|
8
|
+
import { ConnectionStatus } from '../../types';
|
|
9
|
+
import type { TokenRenewalResult } from '../../types';
|
|
10
|
+
import { type SocketAdapter, type SocketLike } from '../../platform';
|
|
11
|
+
import { MsyncCodec } from '../../protocol/msync/codec';
|
|
12
|
+
import type { MessageReceiver } from '../message/message-receiver';
|
|
13
|
+
/**
|
|
14
|
+
* 连接配置
|
|
15
|
+
*/
|
|
16
|
+
export interface ConnectionConfig {
|
|
17
|
+
serverUrl: string;
|
|
18
|
+
serverUrls?: ReadonlyArray<string>;
|
|
19
|
+
userId: string;
|
|
20
|
+
token: string;
|
|
21
|
+
appKey: string;
|
|
22
|
+
useCustomAttachmentUpload?: boolean;
|
|
23
|
+
heartBeatWait?: number;
|
|
24
|
+
autoReconnectNumMax?: number;
|
|
25
|
+
connectTimeout?: number;
|
|
26
|
+
useReplacedMessageContents?: boolean;
|
|
27
|
+
useFixedDeviceId?: boolean;
|
|
28
|
+
deviceId?: string;
|
|
29
|
+
customDeviceName?: string;
|
|
30
|
+
customOSPlatform?: number;
|
|
31
|
+
uiKitVersion?: string;
|
|
32
|
+
loginExtensionInfo?: string;
|
|
33
|
+
serviceId?: string;
|
|
34
|
+
socketAdapter?: SocketAdapter;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 连接管理器
|
|
38
|
+
*/
|
|
39
|
+
export declare class ConnectionManager {
|
|
40
|
+
private config;
|
|
41
|
+
private serverUrls;
|
|
42
|
+
private serverUrlIndex;
|
|
43
|
+
private websocket;
|
|
44
|
+
private connection;
|
|
45
|
+
private provisionTimeoutId;
|
|
46
|
+
private reconnectAttempts;
|
|
47
|
+
private eventHub;
|
|
48
|
+
private messageReceiver;
|
|
49
|
+
private msyncCodec;
|
|
50
|
+
private provisionPromise;
|
|
51
|
+
private provisionResolve;
|
|
52
|
+
private provisionReject;
|
|
53
|
+
private queues;
|
|
54
|
+
private currentQueueId;
|
|
55
|
+
private currentQueue;
|
|
56
|
+
private nextKey;
|
|
57
|
+
private offlineMessageSyncing;
|
|
58
|
+
private offlineMessageSyncLifecycleDispatched;
|
|
59
|
+
private offlineMessageSyncLifecycleActive;
|
|
60
|
+
private offlineMessageQueueNames;
|
|
61
|
+
private offlineMessageReport;
|
|
62
|
+
private readonly offlineMessageQueueReports;
|
|
63
|
+
private readonly offlineMessageQueueCounts;
|
|
64
|
+
private offlineMessageTotalCount;
|
|
65
|
+
private readonly connectionRetry;
|
|
66
|
+
private reconnectTimerId;
|
|
67
|
+
private reconnectInProgress;
|
|
68
|
+
private reconnectPaused;
|
|
69
|
+
private offlineRecoverPending;
|
|
70
|
+
private isLoginPhase;
|
|
71
|
+
private isLoggedIn;
|
|
72
|
+
private hasEverConnected;
|
|
73
|
+
private isOnline;
|
|
74
|
+
private readonly heartbeatManager;
|
|
75
|
+
private readonly internalHandlerId;
|
|
76
|
+
private suppressNextCloseEvent;
|
|
77
|
+
private readonly connectionEventNormalizer;
|
|
78
|
+
private readonly socketAdapter;
|
|
79
|
+
private socketDisposers;
|
|
80
|
+
private inboundMessageQueue;
|
|
81
|
+
private socketGeneration;
|
|
82
|
+
private tokenLifecycle;
|
|
83
|
+
private tokenWillExpireTimerId;
|
|
84
|
+
private tokenExpiredTimerId;
|
|
85
|
+
constructor(config: ConnectionConfig, eventHub: EventHub);
|
|
86
|
+
/**
|
|
87
|
+
* 获取连接状态
|
|
88
|
+
*/
|
|
89
|
+
getConnectionStatus(): ConnectionStatus;
|
|
90
|
+
/**
|
|
91
|
+
* 获取 WebSocket 实例(用于消息发送)
|
|
92
|
+
*/
|
|
93
|
+
getWebSocket(): SocketLike | null;
|
|
94
|
+
/**
|
|
95
|
+
* 获取 MSync 编解码器(供消息模块复用)
|
|
96
|
+
*/
|
|
97
|
+
getMsyncCodec(): MsyncCodec;
|
|
98
|
+
/**
|
|
99
|
+
* 获取客户端资源标识
|
|
100
|
+
*/
|
|
101
|
+
getClientResource(): string;
|
|
102
|
+
/**
|
|
103
|
+
* 绑定消息接收器(用于处理下行消息)
|
|
104
|
+
*/
|
|
105
|
+
setMessageReceiver(receiver: MessageReceiver): void;
|
|
106
|
+
/**
|
|
107
|
+
* 更新当前连接使用的 IM token。
|
|
108
|
+
* Updates the IM token used by the current connection.
|
|
109
|
+
*/
|
|
110
|
+
renewToken(token: string, expireAt: number): TokenRenewalResult;
|
|
111
|
+
/**
|
|
112
|
+
* 处理在线事件
|
|
113
|
+
*/
|
|
114
|
+
handleOnline(): void;
|
|
115
|
+
/**
|
|
116
|
+
* 处理离线事件
|
|
117
|
+
*/
|
|
118
|
+
handleOffline(): void;
|
|
119
|
+
/**
|
|
120
|
+
* 处理前台恢复事件
|
|
121
|
+
*/
|
|
122
|
+
handleForeground(): Promise<void>;
|
|
123
|
+
private resumeReconnect;
|
|
124
|
+
private handleSendTimeout;
|
|
125
|
+
private resetReconnectState;
|
|
126
|
+
private getReconnectDiagnostic;
|
|
127
|
+
private normalizeServerUrls;
|
|
128
|
+
private pickNextServerUrl;
|
|
129
|
+
private resolveEffectiveMaxAttempts;
|
|
130
|
+
private isNonRetryableError;
|
|
131
|
+
private isServerNormalClosePayload;
|
|
132
|
+
private clearReconnectTimer;
|
|
133
|
+
private waitForReconnectDelay;
|
|
134
|
+
private buildConnectionEventPayload;
|
|
135
|
+
private dispatchConnectionEvent;
|
|
136
|
+
private updateStatus;
|
|
137
|
+
private clampTimerDelay;
|
|
138
|
+
private clearTokenTimers;
|
|
139
|
+
private setupTokenLifecycle;
|
|
140
|
+
private setupTokenLifecycleFromProvision;
|
|
141
|
+
private emitTokenWillExpire;
|
|
142
|
+
private emitTokenExpired;
|
|
143
|
+
private isTokenExpiredConnectionError;
|
|
144
|
+
private handleTokenExpiredDisconnect;
|
|
145
|
+
private startHeartbeat;
|
|
146
|
+
private stopHeartbeat;
|
|
147
|
+
private checkHeartbeatOnce;
|
|
148
|
+
private sendHeartbeatPing;
|
|
149
|
+
/**
|
|
150
|
+
* 建立连接
|
|
151
|
+
*/
|
|
152
|
+
connect(): Promise<void>;
|
|
153
|
+
private connectWithRetry;
|
|
154
|
+
private connectOnce;
|
|
155
|
+
private prepareForConnectAttempt;
|
|
156
|
+
private handleConnectSuccess;
|
|
157
|
+
private sendPostProvisionInitialSync;
|
|
158
|
+
private triggerReconnect;
|
|
159
|
+
private handleDisconnection;
|
|
160
|
+
private closeWebSocket;
|
|
161
|
+
/**
|
|
162
|
+
* 创建 WebSocket 连接
|
|
163
|
+
*/
|
|
164
|
+
private createWebSocketConnection;
|
|
165
|
+
/**
|
|
166
|
+
* 处理 WebSocket 关闭
|
|
167
|
+
*/
|
|
168
|
+
private handleWebSocketClose;
|
|
169
|
+
private rejectProvisionAfterQueuedMessages;
|
|
170
|
+
/**
|
|
171
|
+
* 处理连接错误
|
|
172
|
+
*/
|
|
173
|
+
private handleConnectionError;
|
|
174
|
+
private handleTerminalConnectionError;
|
|
175
|
+
/**
|
|
176
|
+
* 处理 WebSocket 下行消息
|
|
177
|
+
*/
|
|
178
|
+
private handleWebSocketMessage;
|
|
179
|
+
/**
|
|
180
|
+
* 发送 provision 并等待回包
|
|
181
|
+
*/
|
|
182
|
+
private startProvision;
|
|
183
|
+
/**
|
|
184
|
+
* 处理 provision 回包
|
|
185
|
+
*/
|
|
186
|
+
private handleProvisionMessage;
|
|
187
|
+
private handleNoticeMessage;
|
|
188
|
+
/**
|
|
189
|
+
* 处理 UNREAD:对每个队列发起拉取
|
|
190
|
+
*/
|
|
191
|
+
private handleUnreadMessage;
|
|
192
|
+
private handleSyncMessage;
|
|
193
|
+
/**
|
|
194
|
+
* 根据 nextKey/isLast 续拉队列消息
|
|
195
|
+
*/
|
|
196
|
+
private handleSyncQueueState;
|
|
197
|
+
private resolveSyncQueueState;
|
|
198
|
+
private handleLogoutMessage;
|
|
199
|
+
private resolveStatisticDisconnectError;
|
|
200
|
+
private resetProvisionHandlers;
|
|
201
|
+
private rejectPendingProvision;
|
|
202
|
+
/**
|
|
203
|
+
* 断开连接
|
|
204
|
+
*/
|
|
205
|
+
disconnect(): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* 销毁连接管理器
|
|
208
|
+
*/
|
|
209
|
+
destroy(): void;
|
|
210
|
+
private resolveSocketAdapter;
|
|
211
|
+
private attachSocketListeners;
|
|
212
|
+
private clearSocketListeners;
|
|
213
|
+
private sendMsyncPayload;
|
|
214
|
+
private sendBackqueue;
|
|
215
|
+
private sendLastSession;
|
|
216
|
+
private sendNextQueue;
|
|
217
|
+
private removeQueueEntry;
|
|
218
|
+
private startOfflineMessageSync;
|
|
219
|
+
private finishOfflineMessageQueue;
|
|
220
|
+
private isQueueInList;
|
|
221
|
+
private isSelfQueue;
|
|
222
|
+
private getQueueName;
|
|
223
|
+
private getQueueResource;
|
|
224
|
+
private getQueueId;
|
|
225
|
+
private getQueueField;
|
|
226
|
+
private isSameQueue;
|
|
227
|
+
private resetSyncState;
|
|
228
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 连接重试逻辑
|
|
3
|
+
*
|
|
4
|
+
* 实现指数退避策略,最大 60 秒间隔
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 重试配置
|
|
8
|
+
*/
|
|
9
|
+
export interface RetryConfig {
|
|
10
|
+
maxAttempts?: number;
|
|
11
|
+
initialDelay?: number;
|
|
12
|
+
maxDelay?: number;
|
|
13
|
+
backoffMultiplier?: number;
|
|
14
|
+
randomSource?: () => number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 连接重试管理器
|
|
18
|
+
*/
|
|
19
|
+
export declare class ConnectionRetry {
|
|
20
|
+
private config;
|
|
21
|
+
private attemptCount;
|
|
22
|
+
constructor(config?: RetryConfig);
|
|
23
|
+
/**
|
|
24
|
+
* 计算重试延迟(指数退避 + equal jitter)
|
|
25
|
+
*/
|
|
26
|
+
getRetryDelay(): number;
|
|
27
|
+
/**
|
|
28
|
+
* 记录重试尝试
|
|
29
|
+
*/
|
|
30
|
+
recordAttempt(): void;
|
|
31
|
+
/**
|
|
32
|
+
* 重置重试计数
|
|
33
|
+
*/
|
|
34
|
+
reset(): void;
|
|
35
|
+
/**
|
|
36
|
+
* 检查是否应该重试
|
|
37
|
+
*/
|
|
38
|
+
shouldRetry(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 获取当前尝试次数
|
|
41
|
+
*/
|
|
42
|
+
getAttemptCount(): number;
|
|
43
|
+
/**
|
|
44
|
+
* 等待重试延迟
|
|
45
|
+
*/
|
|
46
|
+
waitForRetry(): Promise<void>;
|
|
47
|
+
}
|