206 lines
5.7 KiB
JavaScript
206 lines
5.7 KiB
JavaScript
// Metro module 6286 (f6287).
|
|
import { MessageType, MESSAGE_TYPE, reflectionMergePartial, UnknownFieldHandler, WireType } from "./Module1307";
|
|
import { ButtonAction } from "./Module6270";
|
|
import { HelpArticle } from "./Module6269";
|
|
import { LocalizedString } from "./Module6268";
|
|
import { UInt64Value } from "./Module1337";
|
|
import { $callWithNewTarget } from "../_hermes/prelude";
|
|
function $mk78224($env) {
|
|
return () => ["discord_protos.premium_marketing.v1.ButtonAction", ButtonAction, "BUTTON_ACTION_"];
|
|
}
|
|
function $mk78225($env) {
|
|
return () => HelpArticle;
|
|
}
|
|
function $mk78226($env) {
|
|
return () => LocalizedString;
|
|
}
|
|
function $mk78227($env) {
|
|
return () => LocalizedString;
|
|
}
|
|
function $mk78228($env) {
|
|
return () => UInt64Value;
|
|
}
|
|
let c4002_3;
|
|
let env4002;
|
|
const r3 = env4002 = {};
|
|
class Nagbar$Type extends MessageType {
|
|
constructor() {
|
|
const r1 = env4002;
|
|
const r2 = [{
|
|
no: 1,
|
|
name: "body",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 2,
|
|
name: "cta_label",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 3,
|
|
name: "cta_action",
|
|
kind: "enum",
|
|
T: $mk78224(r1)
|
|
}, {
|
|
no: 4,
|
|
name: "deeplink_section",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 5,
|
|
name: "help_article",
|
|
kind: "message",
|
|
T: $mk78225(r1)
|
|
}, {
|
|
no: 6,
|
|
name: "body_localized",
|
|
kind: "message",
|
|
T: $mk78226(r1)
|
|
}, {
|
|
no: 7,
|
|
name: "cta_label_localized",
|
|
kind: "message",
|
|
T: $mk78227(r1)
|
|
}, {
|
|
no: 8,
|
|
name: "navigable_storefront_application_id",
|
|
kind: "message",
|
|
T: $mk78228(r1)
|
|
}];
|
|
super("discord_protos.premium_marketing.v1.Nagbar", r2);
|
|
}
|
|
create(a0) {
|
|
const r1 = {
|
|
body: "",
|
|
ctaLabel: "",
|
|
ctaAction: 0,
|
|
deeplinkSection: ""
|
|
};
|
|
globalThis.globalThis.Object.defineProperty(r1, MESSAGE_TYPE, {
|
|
enumerable: false,
|
|
value: this
|
|
});
|
|
if (a0 !== void 0) {
|
|
reflectionMergePartial(this, r1, a0);
|
|
}
|
|
return r1;
|
|
}
|
|
internalBinaryRead(a0, a1, a2, a3) {
|
|
const r11 = a3 == null ? this.create() : a3;
|
|
const r14 = a0.pos + a1;
|
|
while (a0.pos < r14) {
|
|
const [r25, r24] = a0.tag();
|
|
if (r25 === 1) {
|
|
r11.body = a0.string();
|
|
} else if (r25 === 2) {
|
|
r11.ctaLabel = a0.string();
|
|
} else if (r25 === 3) {
|
|
r11.ctaAction = a0.int32();
|
|
} else if (r25 === 4) {
|
|
r11.deeplinkSection = a0.string();
|
|
} else if (r25 === 5) {
|
|
r11.helpArticle = HelpArticle.internalBinaryRead(a0, a0.uint32(), a2, r11.helpArticle);
|
|
} else if (r25 === 6) {
|
|
r11.bodyLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r11.bodyLocalized);
|
|
} else if (r25 === 7) {
|
|
r11.ctaLabelLocalized = LocalizedString.internalBinaryRead(a0, a0.uint32(), a2, r11.ctaLabelLocalized);
|
|
} else if (r25 === 8) {
|
|
r11.navigableStorefrontApplicationId = UInt64Value.internalBinaryRead(a0, a0.uint32(), a2, r11.navigableStorefrontApplicationId);
|
|
} else {
|
|
let readUnknownField = a2.readUnknownField;
|
|
if (readUnknownField === "throw") {
|
|
throw new globalThis.globalThis.Error(`Unknown field ${r25} (wire type ${r24}) for ${this.typeName}`);
|
|
}
|
|
const r40 = a0.skip(r24);
|
|
if (readUnknownField !== false) {
|
|
if (readUnknownField === true) {
|
|
readUnknownField = UnknownFieldHandler.onRead;
|
|
}
|
|
readUnknownField(this.typeName, r11, r25, r24, r40);
|
|
}
|
|
}
|
|
}
|
|
return r11;
|
|
}
|
|
internalBinaryWrite(a0, a1, a2) {
|
|
if (a0.body !== "") {
|
|
a1.tag(1, WireType.LengthDelimited).string(a0.body);
|
|
}
|
|
if (a0.ctaLabel !== "") {
|
|
a1.tag(2, WireType.LengthDelimited).string(a0.ctaLabel);
|
|
}
|
|
if (a0.ctaAction !== 0) {
|
|
a1.tag(3, WireType.Varint).int32(a0.ctaAction);
|
|
}
|
|
if (a0.deeplinkSection !== "") {
|
|
a1.tag(4, WireType.LengthDelimited).string(a0.deeplinkSection);
|
|
}
|
|
if (a0.helpArticle) {
|
|
HelpArticle.internalBinaryWrite(a0.helpArticle, a1.tag(5, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.bodyLocalized) {
|
|
LocalizedString.internalBinaryWrite(a0.bodyLocalized, a1.tag(6, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.ctaLabelLocalized) {
|
|
LocalizedString.internalBinaryWrite(a0.ctaLabelLocalized, a1.tag(7, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
if (a0.navigableStorefrontApplicationId) {
|
|
UInt64Value.internalBinaryWrite(a0.navigableStorefrontApplicationId, a1.tag(8, WireType.LengthDelimited).fork(), a2).join();
|
|
}
|
|
let writeUnknownFields = a2.writeUnknownFields;
|
|
if (writeUnknownFields !== false) {
|
|
if (writeUnknownFields == 1) {
|
|
writeUnknownFields = UnknownFieldHandler.onWrite;
|
|
}
|
|
writeUnknownFields(this.typeName, a0, a1);
|
|
}
|
|
return a1;
|
|
}
|
|
}
|
|
c4002_3 = Nagbar$Type;
|
|
const prototypeOf = Object.getPrototypeOf(Nagbar$Type);
|
|
const r33 = [{
|
|
no: 1,
|
|
name: "body",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 2,
|
|
name: "cta_label",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 3,
|
|
name: "cta_action",
|
|
kind: "enum",
|
|
T: $mk78224(r3)
|
|
}, {
|
|
no: 4,
|
|
name: "deeplink_section",
|
|
kind: "scalar",
|
|
T: 9
|
|
}, {
|
|
no: 5,
|
|
name: "help_article",
|
|
kind: "message",
|
|
T: $mk78225(r3)
|
|
}, {
|
|
no: 6,
|
|
name: "body_localized",
|
|
kind: "message",
|
|
T: $mk78226(r3)
|
|
}, {
|
|
no: 7,
|
|
name: "cta_label_localized",
|
|
kind: "message",
|
|
T: $mk78227(r3)
|
|
}, {
|
|
no: 8,
|
|
name: "navigable_storefront_application_id",
|
|
kind: "message",
|
|
T: $mk78228(r3)
|
|
}];
|
|
const r45 = Object.create(Nagbar$Type.prototype);
|
|
const r46 = $callWithNewTarget(prototypeOf, r45, Nagbar$Type, "discord_protos.premium_marketing.v1.Nagbar", r33);
|
|
export const Nagbar = r46 instanceof Object ? r46 : r45;
|