@flashist/appframework 0.0.107 → 0.0.109
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/display/views/button/simple-image-button/SimpleImageButton.d.ts +30 -0
- package/display/views/button/simple-image-button/SimpleImageButton.js +186 -0
- package/display/views/button/simple-image-button/SimpleImageButton.js.map +1 -0
- package/display/views/button/simple-image-button/SimpleImageButtonConfig.d.ts +9 -0
- package/display/views/button/simple-image-button/SimpleImageButtonConfig.js +4 -0
- package/display/views/button/simple-image-button/SimpleImageButtonConfig.js.map +1 -0
- package/display/views/button/simple-image-button/SimpleImageButtonState.d.ts +22 -0
- package/display/views/button/simple-image-button/SimpleImageButtonState.js +57 -0
- package/display/views/button/simple-image-button/SimpleImageButtonState.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FContainer, Sprite } from "@flashist/flibs";
|
|
2
|
+
import { SimpleImageButtonConfig } from "./SimpleImageButtonConfig";
|
|
3
|
+
import { ResizableContainer } from "../../resize";
|
|
4
|
+
import { IToggableItem } from "../../togglegroup";
|
|
5
|
+
export declare class SimpleImageButton<DataType extends object = object> extends ResizableContainer<DataType> implements IToggableItem {
|
|
6
|
+
id: string;
|
|
7
|
+
private _enabled;
|
|
8
|
+
protected _state: string;
|
|
9
|
+
protected _selected: boolean;
|
|
10
|
+
protected config: SimpleImageButtonConfig;
|
|
11
|
+
protected contentCont: FContainer;
|
|
12
|
+
protected image: Sprite;
|
|
13
|
+
protected lastProcessedState: string;
|
|
14
|
+
constructor(config: Partial<SimpleImageButtonConfig>);
|
|
15
|
+
protected construction(config: Partial<SimpleImageButtonConfig>): void;
|
|
16
|
+
protected addListeners(): void;
|
|
17
|
+
private onOver;
|
|
18
|
+
private onDown;
|
|
19
|
+
private onOut;
|
|
20
|
+
protected onTap(): void;
|
|
21
|
+
protected arrange(): void;
|
|
22
|
+
get enabled(): boolean;
|
|
23
|
+
set enabled(value: boolean);
|
|
24
|
+
get state(): string;
|
|
25
|
+
set state(value: string);
|
|
26
|
+
protected commitData(): void;
|
|
27
|
+
get selected(): boolean;
|
|
28
|
+
set selected(value: boolean);
|
|
29
|
+
protected findStateValue(normalState: string): string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { DisplayTools, FContainer, InteractiveEvent, Sprite } from "@flashist/flibs";
|
|
17
|
+
import { ObjectTools } from '@flashist/fcore';
|
|
18
|
+
import { SimpleImageButtonDefaultConfig } from "./SimpleImageButtonConfig";
|
|
19
|
+
import { SimpleImageButtonState, SimpleImageButtonStateNormalToSelectedMap, SimpleImageButtonStateSelectedToNormalMap } from "./SimpleImageButtonState";
|
|
20
|
+
import { ResizableContainer } from "../../resize";
|
|
21
|
+
var SimpleImageButton = /** @class */ (function (_super) {
|
|
22
|
+
__extends(SimpleImageButton, _super);
|
|
23
|
+
function SimpleImageButton(config) {
|
|
24
|
+
return _super.call(this, config) || this;
|
|
25
|
+
}
|
|
26
|
+
SimpleImageButton.prototype.construction = function (config) {
|
|
27
|
+
_super.prototype.construction.call(this);
|
|
28
|
+
// First "write" default values
|
|
29
|
+
this.config = ObjectTools.clone(SimpleImageButtonDefaultConfig);
|
|
30
|
+
// Then override them with passed config
|
|
31
|
+
ObjectTools.copyProps(this.config, config);
|
|
32
|
+
this.contentCont = new FContainer();
|
|
33
|
+
this.addChild(this.contentCont);
|
|
34
|
+
// this.bg = this.createBg();
|
|
35
|
+
// this.contentCont.addChild(this.bg);
|
|
36
|
+
// this.label = new FLabel(this.config.labelConfig);
|
|
37
|
+
// this.contentCont.addChild(this.label);
|
|
38
|
+
// //
|
|
39
|
+
// this.label.interactive = true;
|
|
40
|
+
// this.label.interactiveChildren = true;
|
|
41
|
+
this.state = SimpleImageButtonState.NORMAL;
|
|
42
|
+
this.enabled = true;
|
|
43
|
+
// if (!this.config.bgConfig?.resizeBg) {
|
|
44
|
+
// this.resize(
|
|
45
|
+
// this.bg.width,
|
|
46
|
+
// this.bg.height
|
|
47
|
+
// );
|
|
48
|
+
// }
|
|
49
|
+
};
|
|
50
|
+
SimpleImageButton.prototype.addListeners = function () {
|
|
51
|
+
_super.prototype.addListeners.call(this);
|
|
52
|
+
this.eventListenerHelper.addEventListener(this, InteractiveEvent.OVER, this.onOver);
|
|
53
|
+
this.eventListenerHelper.addEventListener(this, InteractiveEvent.DOWN, this.onDown);
|
|
54
|
+
this.eventListenerHelper.addEventListener(this, InteractiveEvent.OUT, this.onOut);
|
|
55
|
+
this.eventListenerHelper.addEventListener(this, InteractiveEvent.TAP, this.onTap);
|
|
56
|
+
this.eventListenerHelper.addEventListener(this, InteractiveEvent.UP_OUTSIDE, this.onOut);
|
|
57
|
+
};
|
|
58
|
+
SimpleImageButton.prototype.onOver = function () {
|
|
59
|
+
// this.contentCont.alpha = 1;
|
|
60
|
+
this.state = this.findStateValue(SimpleImageButtonState.OVER);
|
|
61
|
+
};
|
|
62
|
+
SimpleImageButton.prototype.onDown = function () {
|
|
63
|
+
// this.contentCont.alpha = 1;
|
|
64
|
+
this.state = this.findStateValue(SimpleImageButtonState.PRESS);
|
|
65
|
+
};
|
|
66
|
+
SimpleImageButton.prototype.onOut = function () {
|
|
67
|
+
// this.contentCont.alpha = 0.75;
|
|
68
|
+
this.state = this.findStateValue(SimpleImageButtonState.NORMAL);
|
|
69
|
+
};
|
|
70
|
+
SimpleImageButton.prototype.onTap = function () {
|
|
71
|
+
// this.onOut();
|
|
72
|
+
};
|
|
73
|
+
SimpleImageButton.prototype.arrange = function () {
|
|
74
|
+
_super.prototype.arrange.call(this);
|
|
75
|
+
// if (this.config.bgConfig?.resizeBg) {
|
|
76
|
+
// if (this.bg.width !== this.resizeSize.x ||
|
|
77
|
+
// this.bg.height !== this.resizeSize.y) {
|
|
78
|
+
// this.updateBg();
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
// this.label.width = this.bg.width;
|
|
82
|
+
// this.label.height = this.bg.height;
|
|
83
|
+
// this.label.x = this.bg.x + Math.floor((this.bg.width - this.label.width) / 2);
|
|
84
|
+
// this.label.y = this.bg.y + Math.floor((this.bg.height - this.label.height) / 2);
|
|
85
|
+
};
|
|
86
|
+
Object.defineProperty(SimpleImageButton.prototype, "enabled", {
|
|
87
|
+
get: function () {
|
|
88
|
+
return this._enabled;
|
|
89
|
+
},
|
|
90
|
+
set: function (value) {
|
|
91
|
+
if (value === this._enabled) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this._enabled = value;
|
|
95
|
+
this.commitData();
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(SimpleImageButton.prototype, "state", {
|
|
101
|
+
// public get text(): string {
|
|
102
|
+
// return this.label.text;
|
|
103
|
+
// }
|
|
104
|
+
//
|
|
105
|
+
// public set text(value: string) {
|
|
106
|
+
// this.label.text = value;
|
|
107
|
+
// this.arrange();
|
|
108
|
+
// }
|
|
109
|
+
get: function () {
|
|
110
|
+
return this._state;
|
|
111
|
+
},
|
|
112
|
+
set: function (value) {
|
|
113
|
+
if (value == this.state) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this._state = value;
|
|
117
|
+
this.commitData();
|
|
118
|
+
},
|
|
119
|
+
enumerable: false,
|
|
120
|
+
configurable: true
|
|
121
|
+
});
|
|
122
|
+
SimpleImageButton.prototype.commitData = function () {
|
|
123
|
+
_super.prototype.commitData.call(this);
|
|
124
|
+
var tempConfigState = this.state;
|
|
125
|
+
if (!this.config.states[tempConfigState]) {
|
|
126
|
+
if (this.selected) {
|
|
127
|
+
tempConfigState = SimpleImageButtonStateSelectedToNormalMap[this.state];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!this.config.states[tempConfigState]) {
|
|
131
|
+
tempConfigState = this.findStateValue(SimpleImageButtonState.NORMAL);
|
|
132
|
+
}
|
|
133
|
+
var tempConfig = this.config.states[tempConfigState];
|
|
134
|
+
if (tempConfig.alpha || tempConfig.alpha === 0) {
|
|
135
|
+
this.alpha = tempConfig.alpha;
|
|
136
|
+
}
|
|
137
|
+
if (tempConfig.imageId || tempConfig.imageId === "") {
|
|
138
|
+
if (this.image) {
|
|
139
|
+
DisplayTools.childRemoveItselfFromParent(this.image);
|
|
140
|
+
this.image = null;
|
|
141
|
+
}
|
|
142
|
+
if (tempConfig.imageId) {
|
|
143
|
+
this.image = Sprite.from(tempConfig.imageId);
|
|
144
|
+
this.contentCont.addChild(this.image);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (this.enabled) {
|
|
148
|
+
this.interactive = true;
|
|
149
|
+
this.buttonMode = true;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this.interactive = false;
|
|
153
|
+
this.buttonMode = false;
|
|
154
|
+
}
|
|
155
|
+
this.lastProcessedState = tempConfigState;
|
|
156
|
+
// this.updateBg();
|
|
157
|
+
this.arrange();
|
|
158
|
+
};
|
|
159
|
+
Object.defineProperty(SimpleImageButton.prototype, "selected", {
|
|
160
|
+
get: function () {
|
|
161
|
+
return this._selected;
|
|
162
|
+
},
|
|
163
|
+
set: function (value) {
|
|
164
|
+
if (value == this.selected) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this._selected = value;
|
|
168
|
+
this.state = this.findStateValue(SimpleImageButtonState.NORMAL);
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
173
|
+
SimpleImageButton.prototype.findStateValue = function (normalState) {
|
|
174
|
+
var result;
|
|
175
|
+
if (this.selected) {
|
|
176
|
+
result = SimpleImageButtonStateNormalToSelectedMap[normalState];
|
|
177
|
+
}
|
|
178
|
+
if (!result) {
|
|
179
|
+
result = normalState;
|
|
180
|
+
}
|
|
181
|
+
return result;
|
|
182
|
+
};
|
|
183
|
+
return SimpleImageButton;
|
|
184
|
+
}(ResizableContainer));
|
|
185
|
+
export { SimpleImageButton };
|
|
186
|
+
//# sourceMappingURL=SimpleImageButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleImageButton.js","sourceRoot":"","sources":["../../../../../src/display/views/button/simple-image-button/SimpleImageButton.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAGH,8BAA8B,EACjC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,sBAAsB,EACtB,yCAAyC,EACzC,yCAAyC,EAC5C,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD;IAAyE,qCAA4B;IAiBjG,2BAAY,MAAwC;eAChD,kBAAM,MAAM,CAAC;IACjB,CAAC;IAES,wCAAY,GAAtB,UAAuB,MAAwC;QAC3D,iBAAM,YAAY,WAAE,CAAC;QACrB,+BAA+B;QAC/B,IAAI,CAAC,MAAM,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YACzB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;QAED,IAAI,CAAC,kBAAkB,GAAG,eAAe,CAAC;QAE1C,mBAAmB;QACnB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,sBAAW,uCAAQ;aAAnB;YACI,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAED,UAAoB,KAAc;YAC9B,IAAI,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACxB,OAAO;aACV;YAED,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YAEvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC;;;OAVA;IAYS,0CAAc,GAAxB,UAAyB,WAAmB;QACxC,IAAI,MAAc,CAAC;QAEnB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,MAAM,GAAG,yCAAyC,CAAC,WAAW,CAAC,CAAC;SACnE;QAED,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,GAAG,WAAW,CAAC;SACxB;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAyCL,wBAAC;AAAD,CAAC,AAzQD,CAAyE,kBAAkB,GAyQ1F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SimpleImageButtonState } from "./SimpleImageButtonState";
|
|
2
|
+
export declare const SimpleImageButtonDefaultConfig: {
|
|
3
|
+
states: Record<SimpleImageButtonState, ISimpleImageButtonStateVO>;
|
|
4
|
+
};
|
|
5
|
+
export interface ISimpleImageButtonStateVO {
|
|
6
|
+
imageId?: string;
|
|
7
|
+
alpha?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare type SimpleImageButtonConfig = typeof SimpleImageButtonDefaultConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleImageButtonConfig.js","sourceRoot":"","sources":["../../../../../src/display/views/button/simple-image-button/SimpleImageButtonConfig.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,8BAA8B,GAAG;IAC1C,MAAM,EAAE,EAA+D;CAC1E,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum SimpleImageButtonState {
|
|
2
|
+
NORMAL = "normal",
|
|
3
|
+
OVER = "over",
|
|
4
|
+
PRESS = "press",
|
|
5
|
+
DISABLED = "disabled",
|
|
6
|
+
SELECTED_NORMAL = "selected_normal",
|
|
7
|
+
SELECTED_OVER = "selected_over",
|
|
8
|
+
SELECTED_PRESS = "selected_press",
|
|
9
|
+
SELECTED_DISABLED = "selected_disabled"
|
|
10
|
+
}
|
|
11
|
+
export declare const SimpleImageButtonStateNormalToSelectedMap: {
|
|
12
|
+
normal: SimpleImageButtonState;
|
|
13
|
+
over: SimpleImageButtonState;
|
|
14
|
+
press: SimpleImageButtonState;
|
|
15
|
+
disabled: SimpleImageButtonState;
|
|
16
|
+
};
|
|
17
|
+
export declare const SimpleImageButtonStateSelectedToNormalMap: {
|
|
18
|
+
selected_normal: SimpleImageButtonState;
|
|
19
|
+
selected_over: SimpleImageButtonState;
|
|
20
|
+
selected_press: SimpleImageButtonState;
|
|
21
|
+
selected_disabled: SimpleImageButtonState;
|
|
22
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var _a, _b;
|
|
2
|
+
export var SimpleImageButtonState;
|
|
3
|
+
(function (SimpleImageButtonState) {
|
|
4
|
+
SimpleImageButtonState["NORMAL"] = "normal";
|
|
5
|
+
SimpleImageButtonState["OVER"] = "over";
|
|
6
|
+
SimpleImageButtonState["PRESS"] = "press";
|
|
7
|
+
SimpleImageButtonState["DISABLED"] = "disabled";
|
|
8
|
+
SimpleImageButtonState["SELECTED_NORMAL"] = "selected_normal";
|
|
9
|
+
SimpleImageButtonState["SELECTED_OVER"] = "selected_over";
|
|
10
|
+
SimpleImageButtonState["SELECTED_PRESS"] = "selected_press";
|
|
11
|
+
SimpleImageButtonState["SELECTED_DISABLED"] = "selected_disabled";
|
|
12
|
+
})(SimpleImageButtonState || (SimpleImageButtonState = {}));
|
|
13
|
+
;
|
|
14
|
+
export var SimpleImageButtonStateNormalToSelectedMap = (_a = {},
|
|
15
|
+
_a[SimpleImageButtonState.NORMAL] = SimpleImageButtonState.SELECTED_NORMAL,
|
|
16
|
+
_a[SimpleImageButtonState.OVER] = SimpleImageButtonState.SELECTED_OVER,
|
|
17
|
+
_a[SimpleImageButtonState.PRESS] = SimpleImageButtonState.SELECTED_PRESS,
|
|
18
|
+
_a[SimpleImageButtonState.DISABLED] = SimpleImageButtonState.SELECTED_DISABLED,
|
|
19
|
+
_a);
|
|
20
|
+
export var SimpleImageButtonStateSelectedToNormalMap = (_b = {},
|
|
21
|
+
_b[SimpleImageButtonState.SELECTED_NORMAL] = SimpleImageButtonState.NORMAL,
|
|
22
|
+
_b[SimpleImageButtonState.SELECTED_OVER] = SimpleImageButtonState.OVER,
|
|
23
|
+
_b[SimpleImageButtonState.SELECTED_PRESS] = SimpleImageButtonState.PRESS,
|
|
24
|
+
_b[SimpleImageButtonState.SELECTED_DISABLED] = SimpleImageButtonState.DISABLED,
|
|
25
|
+
_b);
|
|
26
|
+
// export class SimpleButtonState {
|
|
27
|
+
// public static NORMAL:string = "normal";
|
|
28
|
+
// public static OVER:string = "over";
|
|
29
|
+
// public static PRESS:string = "press";
|
|
30
|
+
// public static DISABLED:string = "disabled";
|
|
31
|
+
//
|
|
32
|
+
// public static SELECTED_NORMAL:string = "selected_normal";
|
|
33
|
+
// public static SELECTED_OVER:string = "selected_over";
|
|
34
|
+
// public static SELECTED_PRESS:string = "selected_press";
|
|
35
|
+
// public static SELECTED_DISABLED:string = "selected_disabled";
|
|
36
|
+
//
|
|
37
|
+
// public static NORMAL_TO_SELECTED_MAP = ((): any => {
|
|
38
|
+
// let result = {};
|
|
39
|
+
// result[SimpleButtonState.NORMAL] = SimpleButtonState.SELECTED_NORMAL;
|
|
40
|
+
// result[SimpleButtonState.OVER] = SimpleButtonState.SELECTED_OVER;
|
|
41
|
+
// result[SimpleButtonState.PRESS] = SimpleButtonState.SELECTED_PRESS;
|
|
42
|
+
// result[SimpleButtonState.DISABLED] = SimpleButtonState.SELECTED_DISABLED;
|
|
43
|
+
//
|
|
44
|
+
// return result;
|
|
45
|
+
// })();
|
|
46
|
+
//
|
|
47
|
+
// public static SELECTED_TO_NORMAL_MAP = ((): any => {
|
|
48
|
+
// let result = {};
|
|
49
|
+
// result[SimpleButtonState.SELECTED_NORMAL] = SimpleButtonState.NORMAL;
|
|
50
|
+
// result[SimpleButtonState.SELECTED_OVER] = SimpleButtonState.OVER;
|
|
51
|
+
// result[SimpleButtonState.SELECTED_PRESS] = SimpleButtonState.PRESS;
|
|
52
|
+
// result[SimpleButtonState.SELECTED_DISABLED] = SimpleButtonState.DISABLED;
|
|
53
|
+
//
|
|
54
|
+
// return result;
|
|
55
|
+
// })();
|
|
56
|
+
// }
|
|
57
|
+
//# sourceMappingURL=SimpleImageButtonState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleImageButtonState.js","sourceRoot":"","sources":["../../../../../src/display/views/button/simple-image-button/SimpleImageButtonState.ts"],"names":[],"mappings":";AAAA,MAAM,CAAN,IAAY,sBAUX;AAVD,WAAY,sBAAsB;IAC9B,2CAAiB,CAAA;IACjB,uCAAa,CAAA;IACb,yCAAe,CAAA;IACf,+CAAqB,CAAA;IAErB,6DAAmC,CAAA;IACnC,yDAA+B,CAAA;IAC/B,2DAAiC,CAAA;IACjC,iEAAuC,CAAA;AAC3C,CAAC,EAVW,sBAAsB,KAAtB,sBAAsB,QAUjC;AAAA,CAAC;AAEF,MAAM,CAAC,IAAM,yCAAyC;IAClD,GAAC,sBAAsB,CAAC,MAAM,IAAG,sBAAsB,CAAC,eAAe;IACvE,GAAC,sBAAsB,CAAC,IAAI,IAAG,sBAAsB,CAAC,aAAa;IACnE,GAAC,sBAAsB,CAAC,KAAK,IAAG,sBAAsB,CAAC,c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