• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the 'License');
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an 'AS IS' BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16if (!('finalizeConstruction' in ViewPU.prototype)) {
17    Reflect.set(ViewPU.prototype, 'finalizeConstruction', () => { });
18}
19const KeyCode = requireNapi('multimodalInput.keyCode').KeyCode;
20const hilog = requireNapi('hilog');
21const SymbolGlyphModifier = requireNapi('arkui.modifier').SymbolGlyphModifier;
22const PUBLIC_BACK = { 'id': -1, 'type': 40000, params: ['sys.symbol.arrow_left'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
23const PUBLIC_MORE = { 'id': -1, 'type': 40000, params: ['sys.symbol.dot_grid_2x2'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
24const RESOURCE_TYPE_SYMBOL = 40000;
25const TEXT_EDITABLE_DIALOG = '18.3fp';
26const IMAGE_SIZE = '64vp';
27const MAX_DIALOG = '256vp';
28const MIN_DIALOG = '216vp';
29class ButtonGestureModifier {
30    constructor(n36) {
31        this.fontSize = 1;
32        this.controller = null;
33        this.controller = n36;
34    }
35    applyGesture(m36) {
36        if (this.fontSize >= ButtonGestureModifier.minFontSize) {
37            m36.addGesture(new LongPressGestureHandler({ repeat: false, duration: ButtonGestureModifier.longPressTime })
38                .onAction(() => {
39                    if (m36) {
40                        this.controller?.open();
41                    }
42                })
43                .onActionEnd(() => {
44                    this.controller?.close();
45                }));
46        }
47        else {
48            m36.clearGestures();
49        }
50    }
51}
52ButtonGestureModifier.longPressTime = 500;
53ButtonGestureModifier.minFontSize = 1.75;
54export class SelectTitleBar extends ViewPU {
55    constructor(g36, h36, i36, j36 = -1, k36 = undefined, l36) {
56        super(g36, i36, j36, l36);
57        if (typeof k36 === 'function') {
58            this.paramsGenerator_ = k36;
59        }
60        this.__selected = new SynchedPropertySimpleOneWayPU(h36.selected, this, 'selected');
61        this.options = [];
62        this.menuItems = [];
63        this.subtitle = '';
64        this.badgeValue = 0;
65        this.hidesBackButton = false;
66        this.messageDesc = '';
67        this.onSelected = () => { };
68        this.__selectMaxWidth = new ObservedPropertySimplePU(0, this, 'selectMaxWidth');
69        this.__fontSize = new ObservedPropertySimplePU(1, this, 'fontSize');
70        this.setInitiallyProvidedValue(h36);
71        this.finalizeConstruction();
72    }
73    setInitiallyProvidedValue(f36) {
74        if (f36.selected === undefined) {
75            this.__selected.set(0);
76        }
77        if (f36.options !== undefined) {
78            this.options = f36.options;
79        }
80        if (f36.menuItems !== undefined) {
81            this.menuItems = f36.menuItems;
82        }
83        if (f36.subtitle !== undefined) {
84            this.subtitle = f36.subtitle;
85        }
86        if (f36.badgeValue !== undefined) {
87            this.badgeValue = f36.badgeValue;
88        }
89        if (f36.hidesBackButton !== undefined) {
90            this.hidesBackButton = f36.hidesBackButton;
91        }
92        if (f36.messageDesc !== undefined) {
93            this.messageDesc = f36.messageDesc;
94        }
95        if (f36.onSelected !== undefined) {
96            this.onSelected = f36.onSelected;
97        }
98        if (f36.selectMaxWidth !== undefined) {
99            this.selectMaxWidth = f36.selectMaxWidth;
100        }
101        if (f36.fontSize !== undefined) {
102            this.fontSize = f36.fontSize;
103        }
104    }
105    updateStateVars(e36) {
106        this.__selected.reset(e36.selected);
107    }
108    purgeVariableDependenciesOnElmtId(d36) {
109        this.__selected.purgeDependencyOnElmtId(d36);
110        this.__selectMaxWidth.purgeDependencyOnElmtId(d36);
111        this.__fontSize.purgeDependencyOnElmtId(d36);
112    }
113    aboutToBeDeleted() {
114        this.__selected.aboutToBeDeleted();
115        this.__selectMaxWidth.aboutToBeDeleted();
116        this.__fontSize.aboutToBeDeleted();
117        SubscriberManager.Get().delete(this.id__());
118        this.aboutToBeDeletedInternal();
119    }
120    get selected() {
121        return this.__selected.get();
122    }
123    set selected(c36) {
124        this.__selected.set(c36);
125    }
126    get selectMaxWidth() {
127        return this.__selectMaxWidth.get();
128    }
129    set selectMaxWidth(b36) {
130        this.__selectMaxWidth.set(b36);
131    }
132    get fontSize() {
133        return this.__fontSize.get();
134    }
135    set fontSize(a36) {
136        this.__fontSize.set(a36);
137    }
138    initialRender() {
139        this.observeComponentCreation2((u35, v35) => {
140            Flex.create({
141                justifyContent: FlexAlign.SpaceBetween,
142                alignItems: ItemAlign.Stretch
143            });
144            Flex.width('100%');
145            Flex.height(SelectTitleBar.totalHeight);
146            Flex.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_background'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
147            Flex.onAreaChange((w35, x35) => {
148                let y35 = Number(x35.width);
149                if (!this.hidesBackButton) {
150                    y35 -= ImageMenuItem.imageHotZoneWidth;
151                    y35 += SelectTitleBar.leftPadding;
152                    y35 -= SelectTitleBar.leftPaddingWithBack;
153                }
154                if (this.menuItems !== undefined) {
155                    let z35 = this.menuItems.length;
156                    if (z35 >= CollapsibleMenuSection.maxCountOfVisibleItems) {
157                        y35 -= ImageMenuItem.imageHotZoneWidth * CollapsibleMenuSection.maxCountOfVisibleItems;
158                    }
159                    else if (z35 > 0) {
160                        y35 -= ImageMenuItem.imageHotZoneWidth * z35;
161                    }
162                }
163                if (this.badgeValue) {
164                    this.selectMaxWidth = y35 - SelectTitleBar.badgeSize - SelectTitleBar.leftPadding -
165                    SelectTitleBar.rightPadding - SelectTitleBar.badgePadding;
166                }
167                else {
168                    this.selectMaxWidth = y35 - SelectTitleBar.leftPadding - SelectTitleBar.rightPadding;
169                }
170            });
171        }, Flex);
172        this.observeComponentCreation2((s35, t35) => {
173            Row.create();
174            Row.margin({ left: this.hidesBackButton ? { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_max_padding_start'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } : { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_default_padding_start'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } });
175        }, Row);
176        this.observeComponentCreation2((m35, n35) => {
177            If.create();
178            if (!this.hidesBackButton) {
179                this.ifElseBranchUpdateFunction(0, () => {
180                    {
181                        this.observeComponentCreation2((o35, p35) => {
182                            if (p35) {
183                                let q35 = new ImageMenuItem(this, { item: {
184                                    value: '',
185                                    symbolStyle: new SymbolGlyphModifier(PUBLIC_BACK),
186                                    isEnabled: true,
187                                    label: getContext()?.resourceManager?.getStringByNameSync('icon_back'),
188                                    action: () => this.getUIContext()?.getRouter()?.back()
189                                }, index: -1 }, undefined, o35, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 105, col: 11 });
190                                ViewPU.create(q35);
191                                let r35 = () => {
192                                    return {
193                                        item: {
194                                            value: '',
195                                            symbolStyle: new SymbolGlyphModifier(PUBLIC_BACK),
196                                            isEnabled: true,
197                                            label: getContext()?.resourceManager?.getStringByNameSync('icon_back'),
198                                            action: () => this.getUIContext()?.getRouter()?.back()
199                                        },
200                                        index: -1
201                                    };
202                                };
203                                q35.paramsGenerator_ = r35;
204                            }
205                            else {
206                                this.updateStateVarsOfChildByElmtId(o35, {});
207                            }
208                        }, { name: 'ImageMenuItem' });
209                    }
210                });
211            }
212            else {
213                this.ifElseBranchUpdateFunction(1, () => {
214                });
215            }
216        }, If);
217        If.pop();
218        this.observeComponentCreation2((k35, l35) => {
219            Column.create();
220            Column.justifyContent(FlexAlign.Start);
221            Column.alignItems(HorizontalAlign.Start);
222            Column.constraintSize({ maxWidth: this.selectMaxWidth });
223        }, Column);
224        this.observeComponentCreation2((y34, z34) => {
225            If.create();
226            if (this.badgeValue) {
227                this.ifElseBranchUpdateFunction(0, () => {
228                    this.observeComponentCreation2((i35, j35) => {
229                        Badge.create({
230                            count: this.badgeValue,
231                            position: BadgePosition.Right,
232                            style: {
233                                badgeColor: { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_emphasize'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
234                                borderColor: { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_emphasize'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
235                                borderWidth: 0
236                            }
237                        });
238                        Badge.accessibilityGroup(true);
239                        Badge.accessibilityLevel('no');
240                    }, Badge);
241                    this.observeComponentCreation2((g35, h35) => {
242                        Row.create();
243                        Row.justifyContent(FlexAlign.Start);
244                        Row.margin({ right: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_elements_margin_horizontal_l'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } });
245                    }, Row);
246                    this.observeComponentCreation2((e35, f35) => {
247                        Select.create(this.options);
248                        Select.selected(this.selected);
249                        Select.value(this.selected >= 0 && this.selected < this.options.length ?
250                        this.options[this.selected].value : '');
251                        Select.font({ size: this.hidesBackButton && !this.subtitle
252                            ? { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } : { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } });
253                        Select.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_text'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
254                        Select.backgroundColor(Color.Transparent);
255                        Select.onSelect(this.onSelected);
256                        Select.constraintSize({ maxWidth: this.selectMaxWidth });
257                        Select.offset({ x: -4 });
258                        Select.accessibilityLevel('yes');
259                        Select.accessibilityDescription(this.messageDesc.replace('%d', this.badgeValue.toString()));
260                    }, Select);
261                    Select.pop();
262                    Row.pop();
263                    Badge.pop();
264                });
265            }
266            else {
267                this.ifElseBranchUpdateFunction(1, () => {
268                    this.observeComponentCreation2((c35, d35) => {
269                        Row.create();
270                        Row.justifyContent(FlexAlign.Start);
271                    }, Row);
272                    this.observeComponentCreation2((a35, b35) => {
273                        Select.create(this.options);
274                        Select.selected(this.selected);
275                        Select.value(this.selected >= 0 && this.selected < this.options.length ?
276                        this.options[this.selected].value : '');
277                        Select.font({ size: this.hidesBackButton && !this.subtitle
278                            ? { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } : { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } });
279                        Select.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_text'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
280                        Select.backgroundColor(Color.Transparent);
281                        Select.onSelect(this.onSelected);
282                        Select.constraintSize({ maxWidth: this.selectMaxWidth });
283                        Select.offset({ x: -4 });
284                    }, Select);
285                    Select.pop();
286                    Row.pop();
287                });
288            }
289        }, If);
290        If.pop();
291        this.observeComponentCreation2((s34, t34) => {
292            If.create();
293            if (this.subtitle !== undefined) {
294                this.ifElseBranchUpdateFunction(0, () => {
295                    this.observeComponentCreation2((w34, x34) => {
296                        Row.create();
297                        Row.justifyContent(FlexAlign.Start);
298                        Row.margin({ left: SelectTitleBar.subtitleLeftPadding });
299                    }, Row);
300                    this.observeComponentCreation2((u34, v34) => {
301                        Text.create(this.subtitle);
302                        Text.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_over_line'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
303                        Text.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_subtitle_text'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
304                        Text.maxLines(1);
305                        Text.textOverflow({ overflow: TextOverflow.Ellipsis });
306                        Text.constraintSize({ maxWidth: this.selectMaxWidth });
307                        Text.offset({ y: -4 });
308                    }, Text);
309                    Text.pop();
310                    Row.pop();
311                });
312            }
313            else {
314                this.ifElseBranchUpdateFunction(1, () => {
315                });
316            }
317        }, If);
318        If.pop();
319        Column.pop();
320        Row.pop();
321        this.observeComponentCreation2((m34, n34) => {
322            If.create();
323            if (this.menuItems !== undefined && this.menuItems.length > 0) {
324                this.ifElseBranchUpdateFunction(0, () => {
325                    {
326                        this.observeComponentCreation2((o34, p34) => {
327                            if (p34) {
328                                let q34 = new CollapsibleMenuSection(this, { menuItems: this.menuItems, index: 1 + SelectTitleBar.instanceCount++ }, undefined, o34, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 185, col: 9 });
329                                ViewPU.create(q34);
330                                let r34 = () => {
331                                    return {
332                                        menuItems: this.menuItems,
333                                        index: 1 + SelectTitleBar.instanceCount++
334                                    };
335                                };
336                                q34.paramsGenerator_ = r34;
337                            }
338                            else {
339                                this.updateStateVarsOfChildByElmtId(o34, {});
340                            }
341                        }, { name: 'CollapsibleMenuSection' });
342                    }
343                });
344            }
345            else {
346                this.ifElseBranchUpdateFunction(1, () => {
347                });
348            }
349        }, If);
350        If.pop();
351        Flex.pop();
352    }
353    aboutToAppear() {
354        try {
355            let l34 = getContext().resourceManager;
356            this.messageDesc =
357                l34?.getPluralStringByNameSync('selecttitlebar_accessibility_message_desc_new', this.badgeValue);
358        }
359        catch (i34) {
360            let j34 = i34.code;
361            let k34 = i34.message;
362            hilog.error(0x3900, 'Ace', `Faild to getPluralStringByNameSync,cause, code: ${j34}, message: ${k34}`);
363        }
364    }
365    rerender() {
366        this.updateDirtyElements();
367    }
368}
369SelectTitleBar.badgeSize = 16;
370SelectTitleBar.totalHeight = 56;
371SelectTitleBar.leftPadding = 24;
372SelectTitleBar.leftPaddingWithBack = 12;
373SelectTitleBar.rightPadding = 24;
374SelectTitleBar.badgePadding = 16;
375SelectTitleBar.subtitleLeftPadding = 4;
376SelectTitleBar.instanceCount = 0;
377class CollapsibleMenuSection extends ViewPU {
378    constructor(a34, b34, c34, d34 = -1, e34 = undefined, f34) {
379        super(a34, c34, d34, f34);
380        if (typeof e34 === 'function') {
381            this.paramsGenerator_ = e34;
382        }
383        this.menuItems = [];
384        this.item = {
385            symbolStyle: new SymbolGlyphModifier(PUBLIC_MORE),
386            label: { 'id': -1, 'type': 10003, params: ['sys.string.ohos_toolbar_more'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
387        };
388        this.index = 0;
389        this.minFontSize = 1.75;
390        this.isFollowingSystemFontScale = false;
391        this.maxFontScale = 1;
392        this.systemFontScale = 1;
393        this.firstFocusableIndex = -1;
394        this.__isPopupShown = new ObservedPropertySimplePU(false, this, 'isPopupShown');
395        this.__isMoreIconOnFocus = new ObservedPropertySimplePU(false, this, 'isMoreIconOnFocus');
396        this.__isMoreIconOnHover = new ObservedPropertySimplePU(false, this, 'isMoreIconOnHover');
397        this.__isMoreIconOnClick = new ObservedPropertySimplePU(false, this, 'isMoreIconOnClick');
398        this.__fontSize = new SynchedPropertySimpleOneWayPU(b34.fontSize, this, 'fontSize');
399        this.dialogController = new CustomDialogController({
400            builder: () => {
401                let g34 = new SelectTitleBarDialog(this, {
402                    cancel: () => {
403                    },
404                    confirm: () => {
405                    },
406                    selectTitleDialog: this.item,
407                    selectTitleBarDialog: this.item.label ? this.item.label : '',
408                    fontSize: this.fontSize,
409                }, undefined, -1, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 254, col: 14 });
410                g34.setController(this.dialogController);
411                ViewPU.create(g34);
412                let h34 = () => {
413                    return {
414                        cancel: () => {
415                        },
416                        confirm: () => {
417                        },
418                        selectTitleDialog: this.item,
419                        selectTitleBarDialog: this.item.label ? this.item.label : '',
420                        fontSize: this.fontSize
421                    };
422                };
423                g34.paramsGenerator_ = h34;
424            },
425            maskColor: Color.Transparent,
426            isModal: true,
427            customStyle: true
428        }, this);
429        this.__buttonGestureModifier = new ObservedPropertyObjectPU(new ButtonGestureModifier(this.dialogController), this, 'buttonGestureModifier');
430        this.setInitiallyProvidedValue(b34);
431        this.declareWatch('fontSize', this.onFontSizeUpdated);
432        this.finalizeConstruction();
433    }
434    setInitiallyProvidedValue(z33) {
435        if (z33.menuItems !== undefined) {
436            this.menuItems = z33.menuItems;
437        }
438        if (z33.item !== undefined) {
439            this.item = z33.item;
440        }
441        if (z33.index !== undefined) {
442            this.index = z33.index;
443        }
444        if (z33.minFontSize !== undefined) {
445            this.minFontSize = z33.minFontSize;
446        }
447        if (z33.isFollowingSystemFontScale !== undefined) {
448            this.isFollowingSystemFontScale = z33.isFollowingSystemFontScale;
449        }
450        if (z33.maxFontScale !== undefined) {
451            this.maxFontScale = z33.maxFontScale;
452        }
453        if (z33.systemFontScale !== undefined) {
454            this.systemFontScale = z33.systemFontScale;
455        }
456        if (z33.firstFocusableIndex !== undefined) {
457            this.firstFocusableIndex = z33.firstFocusableIndex;
458        }
459        if (z33.isPopupShown !== undefined) {
460            this.isPopupShown = z33.isPopupShown;
461        }
462        if (z33.isMoreIconOnFocus !== undefined) {
463            this.isMoreIconOnFocus = z33.isMoreIconOnFocus;
464        }
465        if (z33.isMoreIconOnHover !== undefined) {
466            this.isMoreIconOnHover = z33.isMoreIconOnHover;
467        }
468        if (z33.isMoreIconOnClick !== undefined) {
469            this.isMoreIconOnClick = z33.isMoreIconOnClick;
470        }
471        if (z33.fontSize === undefined) {
472            this.__fontSize.set(1);
473        }
474        if (z33.dialogController !== undefined) {
475            this.dialogController = z33.dialogController;
476        }
477        if (z33.buttonGestureModifier !== undefined) {
478            this.buttonGestureModifier = z33.buttonGestureModifier;
479        }
480    }
481    updateStateVars(y33) {
482        this.__fontSize.reset(y33.fontSize);
483    }
484    purgeVariableDependenciesOnElmtId(x33) {
485        this.__isPopupShown.purgeDependencyOnElmtId(x33);
486        this.__isMoreIconOnFocus.purgeDependencyOnElmtId(x33);
487        this.__isMoreIconOnHover.purgeDependencyOnElmtId(x33);
488        this.__isMoreIconOnClick.purgeDependencyOnElmtId(x33);
489        this.__fontSize.purgeDependencyOnElmtId(x33);
490        this.__buttonGestureModifier.purgeDependencyOnElmtId(x33);
491    }
492    aboutToBeDeleted() {
493        this.__isPopupShown.aboutToBeDeleted();
494        this.__isMoreIconOnFocus.aboutToBeDeleted();
495        this.__isMoreIconOnHover.aboutToBeDeleted();
496        this.__isMoreIconOnClick.aboutToBeDeleted();
497        this.__fontSize.aboutToBeDeleted();
498        this.__buttonGestureModifier.aboutToBeDeleted();
499        SubscriberManager.Get().delete(this.id__());
500        this.aboutToBeDeletedInternal();
501    }
502    get isPopupShown() {
503        return this.__isPopupShown.get();
504    }
505    set isPopupShown(w33) {
506        this.__isPopupShown.set(w33);
507    }
508    get isMoreIconOnFocus() {
509        return this.__isMoreIconOnFocus.get();
510    }
511    set isMoreIconOnFocus(v33) {
512        this.__isMoreIconOnFocus.set(v33);
513    }
514    get isMoreIconOnHover() {
515        return this.__isMoreIconOnHover.get();
516    }
517    set isMoreIconOnHover(u33) {
518        this.__isMoreIconOnHover.set(u33);
519    }
520    get isMoreIconOnClick() {
521        return this.__isMoreIconOnClick.get();
522    }
523    set isMoreIconOnClick(t33) {
524        this.__isMoreIconOnClick.set(t33);
525    }
526    get fontSize() {
527        return this.__fontSize.get();
528    }
529    set fontSize(s33) {
530        this.__fontSize.set(s33);
531    }
532    get buttonGestureModifier() {
533        return this.__buttonGestureModifier.get();
534    }
535    set buttonGestureModifier(r33) {
536        this.__buttonGestureModifier.set(r33);
537    }
538    getMoreIconFgColor() {
539        return this.isMoreIconOnClick
540            ? { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon_pressed'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } : { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
541    }
542    getMoreIconBgColor() {
543        if (this.isMoreIconOnClick) {
544            return { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_click_effect'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
545        }
546        else if (this.isMoreIconOnHover) {
547            return { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_hover'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
548        }
549        else {
550            return Color.Transparent;
551        }
552    }
553    aboutToAppear() {
554        try {
555            let q33 = this.getUIContext();
556            this.isFollowingSystemFontScale = q33.isFollowingSystemFontScale();
557            this.maxFontScale = q33.getMaxFontScale();
558        }
559        catch (n33) {
560            let o33 = n33.code;
561            let p33 = n33.message;
562            hilog.error(0x3900, 'Ace', `Faild to decideFontScale,cause, code: ${o33}, message: ${p33}`);
563        }
564        this.menuItems.forEach((l33, m33) => {
565            if (l33.isEnabled && this.firstFocusableIndex === -1 &&
566                m33 > CollapsibleMenuSection.maxCountOfVisibleItems - 2) {
567                this.firstFocusableIndex = this.index * 1000 + m33 + 1;
568            }
569        });
570        this.fontSize = this.decideFontScale();
571    }
572    decideFontScale() {
573        let k33 = this.getUIContext();
574        this.systemFontScale = k33.getHostContext()?.config?.fontSizeScale ?? 1;
575        if (!this.isFollowingSystemFontScale) {
576            return 1;
577        }
578        return Math.min(this.systemFontScale, this.maxFontScale);
579    }
580    onFontSizeUpdated() {
581        this.buttonGestureModifier.fontSize = this.fontSize;
582    }
583    initialRender() {
584        this.observeComponentCreation2((i33, j33) => {
585            Column.create();
586            Column.height('100%');
587            Column.margin({ right: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_default_padding_end'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } });
588            Column.justifyContent(FlexAlign.Center);
589        }, Column);
590        this.observeComponentCreation2((g33, h33) => {
591            Row.create();
592        }, Row);
593        this.observeComponentCreation2((c32, d32) => {
594            If.create();
595            if (this.menuItems.length <= CollapsibleMenuSection.maxCountOfVisibleItems) {
596                this.ifElseBranchUpdateFunction(0, () => {
597                    this.observeComponentCreation2((w32, x32) => {
598                        ForEach.create();
599                        const y32 = (z32, a33) => {
600                            const b33 = z32;
601                            {
602                                this.observeComponentCreation2((c33, d33) => {
603                                    if (d33) {
604                                        let e33 = new ImageMenuItem(this, { item: b33, index: this.index * 1000 + a33 + 1 }, undefined, c33, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 324, col: 13 });
605                                        ViewPU.create(e33);
606                                        let f33 = () => {
607                                            return {
608                                                item: b33,
609                                                index: this.index * 1000 + a33 + 1
610                                            };
611                                        };
612                                        e33.paramsGenerator_ = f33;
613                                    }
614                                    else {
615                                        this.updateStateVarsOfChildByElmtId(c33, {});
616                                    }
617                                }, { name: 'ImageMenuItem' });
618                            }
619                        };
620                        this.forEachUpdateFunction(w32, this.menuItems, y32, undefined, true, false);
621                    }, ForEach);
622                    ForEach.pop();
623                });
624            }
625            else {
626                this.ifElseBranchUpdateFunction(1, () => {
627                    this.observeComponentCreation2((m32, n32) => {
628                        ForEach.create();
629                        const o32 = (p32, q32) => {
630                            const r32 = p32;
631                            {
632                                this.observeComponentCreation2((s32, t32) => {
633                                    if (t32) {
634                                        let u32 = new ImageMenuItem(this, { item: r32, index: this.index * 1000 + q32 + 1 }, undefined, s32, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 329, col: 15 });
635                                        ViewPU.create(u32);
636                                        let v32 = () => {
637                                            return {
638                                                item: r32,
639                                                index: this.index * 1000 + q32 + 1
640                                            };
641                                        };
642                                        u32.paramsGenerator_ = v32;
643                                    }
644                                    else {
645                                        this.updateStateVarsOfChildByElmtId(s32, {});
646                                    }
647                                }, { name: 'ImageMenuItem' });
648                            }
649                        };
650                        this.forEachUpdateFunction(m32, this.menuItems.slice(0, CollapsibleMenuSection.maxCountOfVisibleItems - 1), o32, undefined, true, false);
651                    }, ForEach);
652                    ForEach.pop();
653                    this.observeComponentCreation2((g32, h32) => {
654                        Button.createWithChild({ type: ButtonType.Normal, stateEffect: true });
655                        Button.accessibilityText({ 'id': -1, 'type': 10003, params: ['sys.string.ohos_toolbar_more'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
656                        Button.width(ImageMenuItem.imageHotZoneWidth);
657                        Button.height(ImageMenuItem.imageHotZoneWidth);
658                        Button.borderRadius(ImageMenuItem.buttonBorderRadius);
659                        Button.foregroundColor(this.getMoreIconFgColor());
660                        Button.backgroundColor(this.getMoreIconBgColor());
661                        ViewStackProcessor.visualState('focused');
662                        Button.border({
663                            radius: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_corner_radius_clicked'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
664                            width: ImageMenuItem.focusBorderWidth,
665                            color: { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_focused_outline'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
666                            style: BorderStyle.Solid
667                        });
668                        ViewStackProcessor.visualState('normal');
669                        Button.border({
670                            radius: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_corner_radius_clicked'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
671                            width: 0
672                        });
673                        ViewStackProcessor.visualState();
674                        Button.onFocus(() => this.isMoreIconOnFocus = true);
675                        Button.onBlur(() => this.isMoreIconOnFocus = false);
676                        Button.onHover((l32) => this.isMoreIconOnHover = l32);
677                        Button.onKeyEvent((k32) => {
678                            if (k32.keyCode !== KeyCode.KEYCODE_ENTER && k32.keyCode !== KeyCode.KEYCODE_SPACE) {
679                                return;
680                            }
681                            if (k32.type === KeyType.Down) {
682                                this.isMoreIconOnClick = true;
683                            }
684                            if (k32.type === KeyType.Up) {
685                                this.isMoreIconOnClick = false;
686                            }
687                        });
688                        Button.onTouch((j32) => {
689                            if (j32.type === TouchType.Down) {
690                                this.isMoreIconOnClick = true;
691                            }
692                            if (j32.type === TouchType.Up || j32.type === TouchType.Cancel) {
693                                this.isMoreIconOnClick = false;
694                                if (this.fontSize >= this.minFontSize) {
695                                    this.dialogController?.close();
696                                }
697                            }
698                        });
699                        Button.onClick(() => this.isPopupShown = true);
700                        Button.gestureModifier(ObservedObject.GetRawObject(this.buttonGestureModifier));
701                        Button.bindPopup(this.isPopupShown, {
702                            builder: { builder: this.popupBuilder.bind(this) },
703                            placement: Placement.Bottom,
704                            popupColor: Color.White,
705                            enableArrow: false,
706                            onStateChange: (i32) => {
707                                this.isPopupShown = i32.isVisible;
708                                if (!i32.isVisible) {
709                                    this.isMoreIconOnClick = false;
710                                }
711                            }
712                        });
713                    }, Button);
714                    this.observeComponentCreation2((e32, f32) => {
715                        SymbolGlyph.create(PUBLIC_MORE);
716                        SymbolGlyph.fontSize(ImageMenuItem.imageSize);
717                        SymbolGlyph.draggable(false);
718                        SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
719                        SymbolGlyph.focusable(true);
720                    }, SymbolGlyph);
721                    Button.pop();
722                });
723            }
724        }, If);
725        If.pop();
726        Row.pop();
727        Column.pop();
728    }
729    onPlaceChildren(y31, z31, a32) {
730        z31.forEach((b32) => {
731            b32.layout({ x: 0, y: 0 });
732        });
733        this.fontSize = this.decideFontScale();
734    }
735    popupBuilder(l31 = null) {
736        this.observeComponentCreation2((w31, x31) => {
737            Column.create();
738            Column.width(ImageMenuItem.imageHotZoneWidth + CollapsibleMenuSection.focusPadding * CollapsibleMenuSection.marginsNum);
739            Column.margin({ top: CollapsibleMenuSection.focusPadding, bottom: CollapsibleMenuSection.focusPadding });
740            Column.onAppear(() => {
741                focusControl.requestFocus(ImageMenuItem.focusablePrefix + this.firstFocusableIndex);
742            });
743        }, Column);
744        this.observeComponentCreation2((m31, n31) => {
745            ForEach.create();
746            const o31 = (p31, q31) => {
747                const r31 = p31;
748                {
749                    this.observeComponentCreation2((s31, t31) => {
750                        if (t31) {
751                            let u31 = new ImageMenuItem(this, { item: r31, index: this.index * 1000 +
752                            CollapsibleMenuSection.maxCountOfVisibleItems + q31, isPopup: false }, undefined, s31, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 420, col: 11 });
753                            ViewPU.create(u31);
754                            let v31 = () => {
755                                return {
756                                    item: r31,
757                                    index: this.index * 1000 +
758                                    CollapsibleMenuSection.maxCountOfVisibleItems + q31,
759                                    isPopup: false
760                                };
761                            };
762                            u31.paramsGenerator_ = v31;
763                        }
764                        else {
765                            this.updateStateVarsOfChildByElmtId(s31, {});
766                        }
767                    }, { name: 'ImageMenuItem' });
768                }
769            };
770            this.forEachUpdateFunction(m31, this.menuItems.slice(CollapsibleMenuSection.maxCountOfVisibleItems - 1, this.menuItems.length), o31, undefined, true, false);
771        }, ForEach);
772        ForEach.pop();
773        Column.pop();
774    }
775    rerender() {
776        this.updateDirtyElements();
777    }
778}
779CollapsibleMenuSection.maxCountOfVisibleItems = 3;
780CollapsibleMenuSection.focusPadding = 4;
781CollapsibleMenuSection.marginsNum = 2;
782class ImageMenuItem extends ViewPU {
783    constructor(d31, e31, f31, g31 = -1, h31 = undefined, i31) {
784        super(d31, f31, g31, i31);
785        if (typeof h31 === 'function') {
786            this.paramsGenerator_ = h31;
787        }
788        this.item = {};
789        this.index = 0;
790        this.minFontSize = 1.75;
791        this.isFollowingSystemFontScale = false;
792        this.maxFontScale = 1;
793        this.systemFontScale = 1;
794        this.isPopup = true;
795        this.__isOnFocus = new ObservedPropertySimplePU(false, this, 'isOnFocus');
796        this.__isOnHover = new ObservedPropertySimplePU(false, this, 'isOnHover');
797        this.__isOnClick = new ObservedPropertySimplePU(false, this, 'isOnClick');
798        this.__fontSize = new SynchedPropertySimpleOneWayPU(e31.fontSize, this, 'fontSize');
799        this.dialogController = new CustomDialogController({
800            builder: () => {
801                let j31 = new SelectTitleBarDialog(this, {
802                    cancel: () => {
803                    },
804                    confirm: () => {
805                    },
806                    selectTitleDialog: this.item,
807                    selectTitleBarDialog: this.item.label ? this.item.label : this.textDialog(),
808                    fontSize: this.fontSize,
809                }, undefined, -1, () => { }, { page: 'library/src/main/ets/components/selecttitlebar.ets', line: 454, col: 14 });
810                j31.setController(this.dialogController);
811                ViewPU.create(j31);
812                let k31 = () => {
813                    return {
814                        cancel: () => {
815                        },
816                        confirm: () => {
817                        },
818                        selectTitleDialog: this.item,
819                        selectTitleBarDialog: this.item.label ? this.item.label : this.textDialog(),
820                        fontSize: this.fontSize
821                    };
822                };
823                j31.paramsGenerator_ = k31;
824            },
825            maskColor: Color.Transparent,
826            isModal: true,
827            customStyle: true
828        }, this);
829        this.__buttonGestureModifier = new ObservedPropertyObjectPU(new ButtonGestureModifier(this.dialogController), this, 'buttonGestureModifier');
830        this.setInitiallyProvidedValue(e31);
831        this.declareWatch('fontSize', this.onFontSizeUpdated);
832        this.finalizeConstruction();
833    }
834    setInitiallyProvidedValue(c31) {
835        if (c31.item !== undefined) {
836            this.item = c31.item;
837        }
838        if (c31.index !== undefined) {
839            this.index = c31.index;
840        }
841        if (c31.minFontSize !== undefined) {
842            this.minFontSize = c31.minFontSize;
843        }
844        if (c31.isFollowingSystemFontScale !== undefined) {
845            this.isFollowingSystemFontScale = c31.isFollowingSystemFontScale;
846        }
847        if (c31.maxFontScale !== undefined) {
848            this.maxFontScale = c31.maxFontScale;
849        }
850        if (c31.systemFontScale !== undefined) {
851            this.systemFontScale = c31.systemFontScale;
852        }
853        if (c31.isPopup !== undefined) {
854            this.isPopup = c31.isPopup;
855        }
856        if (c31.isOnFocus !== undefined) {
857            this.isOnFocus = c31.isOnFocus;
858        }
859        if (c31.isOnHover !== undefined) {
860            this.isOnHover = c31.isOnHover;
861        }
862        if (c31.isOnClick !== undefined) {
863            this.isOnClick = c31.isOnClick;
864        }
865        if (c31.fontSize === undefined) {
866            this.__fontSize.set(1);
867        }
868        if (c31.dialogController !== undefined) {
869            this.dialogController = c31.dialogController;
870        }
871        if (c31.buttonGestureModifier !== undefined) {
872            this.buttonGestureModifier = c31.buttonGestureModifier;
873        }
874    }
875    updateStateVars(b31) {
876        this.__fontSize.reset(b31.fontSize);
877    }
878    purgeVariableDependenciesOnElmtId(a31) {
879        this.__isOnFocus.purgeDependencyOnElmtId(a31);
880        this.__isOnHover.purgeDependencyOnElmtId(a31);
881        this.__isOnClick.purgeDependencyOnElmtId(a31);
882        this.__fontSize.purgeDependencyOnElmtId(a31);
883        this.__buttonGestureModifier.purgeDependencyOnElmtId(a31);
884    }
885    aboutToBeDeleted() {
886        this.__isOnFocus.aboutToBeDeleted();
887        this.__isOnHover.aboutToBeDeleted();
888        this.__isOnClick.aboutToBeDeleted();
889        this.__fontSize.aboutToBeDeleted();
890        this.__buttonGestureModifier.aboutToBeDeleted();
891        SubscriberManager.Get().delete(this.id__());
892        this.aboutToBeDeletedInternal();
893    }
894    get isOnFocus() {
895        return this.__isOnFocus.get();
896    }
897    set isOnFocus(z30) {
898        this.__isOnFocus.set(z30);
899    }
900    get isOnHover() {
901        return this.__isOnHover.get();
902    }
903    set isOnHover(y30) {
904        this.__isOnHover.set(y30);
905    }
906    get isOnClick() {
907        return this.__isOnClick.get();
908    }
909    set isOnClick(x30) {
910        this.__isOnClick.set(x30);
911    }
912    get fontSize() {
913        return this.__fontSize.get();
914    }
915    set fontSize(w30) {
916        this.__fontSize.set(w30);
917    }
918    get buttonGestureModifier() {
919        return this.__buttonGestureModifier.get();
920    }
921    set buttonGestureModifier(v30) {
922        this.__buttonGestureModifier.set(v30);
923    }
924    textDialog() {
925        if (this.item.value === PUBLIC_MORE) {
926            return { 'id': -1, 'type': 10003, params: ['sys.string.ohos_toolbar_more'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
927        }
928        else if (this.item.value === PUBLIC_BACK) {
929            return { 'id': -1, 'type': 10003, params: ['sys.string.icon_back'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
930        }
931        else {
932            return this.item.label ? this.item.label : '';
933        }
934    }
935    getFgColor() {
936        return this.isOnClick
937            ? { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon_pressed'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } : { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
938    }
939    getBgColor() {
940        if (this.isOnClick) {
941            return { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_click_effect'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
942        }
943        else if (this.isOnHover) {
944            return { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_hover'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' };
945        }
946        else {
947            return Color.Transparent;
948        }
949    }
950    aboutToAppear() {
951        try {
952            let u30 = this.getUIContext();
953            this.isFollowingSystemFontScale = u30.isFollowingSystemFontScale();
954            this.maxFontScale = u30.getMaxFontScale();
955        }
956        catch (r30) {
957            let s30 = r30.code;
958            let t30 = r30.message;
959            hilog.error(0x3900, 'Ace', `Faild to decideFontScale,cause, code: ${s30}, message: ${t30}`);
960        }
961        this.fontSize = this.decideFontScale();
962    }
963    decideFontScale() {
964        let q30 = this.getUIContext();
965        this.systemFontScale = q30.getHostContext()?.config?.fontSizeScale ?? 1;
966        if (!this.isFollowingSystemFontScale) {
967            return 1;
968        }
969        return Math.min(this.systemFontScale, this.maxFontScale);
970    }
971    toStringFormat(l30) {
972        if (typeof l30 === 'string') {
973            return l30;
974        }
975        else if (typeof l30 === 'undefined') {
976            return '';
977        }
978        else {
979            let m30 = '';
980            try {
981                m30 = getContext()?.resourceManager?.getStringSync(l30);
982            }
983            catch (n30) {
984                let o30 = n30?.code;
985                let p30 = n30?.message;
986                hilog.error(0x3900, 'Ace', `Faild to SelectTitleBar toStringFormat,code: ${o30},message:${p30}`);
987            }
988            return m30;
989        }
990    }
991    getAccessibilityReadText() {
992        if (this.item.value === PUBLIC_BACK) {
993            return getContext()?.resourceManager?.getStringByNameSync('icon_back');
994        }
995        else if (this.item.value === PUBLIC_MORE) {
996            return getContext()?.resourceManager?.getStringByNameSync('ohos_toolbar_more');
997        }
998        else if (this.item.accessibilityText) {
999            return this.toStringFormat(this.item.accessibilityText);
1000        }
1001        else if (this.item.label) {
1002            return this.toStringFormat(this.item.label);
1003        }
1004        return ' ';
1005    }
1006    onPlaceChildren(h30, i30, j30) {
1007        i30.forEach((k30) => {
1008            k30.layout({ x: 0, y: 0 });
1009        });
1010        this.fontSize = this.decideFontScale();
1011    }
1012    onFontSizeUpdated() {
1013        this.buttonGestureModifier.fontSize = this.fontSize;
1014    }
1015    initialRender() {
1016        this.observeComponentCreation2((b29, c29) => {
1017            If.create();
1018            if (this.isPopup) {
1019                this.ifElseBranchUpdateFunction(0, () => {
1020                    this.observeComponentCreation2((c30, d30) => {
1021                        Button.createWithChild({ type: ButtonType.Normal, stateEffect: this.item.isEnabled });
1022                        Button.accessibilityText(this.getAccessibilityReadText());
1023                        Button.accessibilityLevel(this.item?.accessibilityLevel ?? 'auto');
1024                        Button.accessibilityDescription(this.toStringFormat(this.item?.accessibilityDescription));
1025                        Button.width(ImageMenuItem.imageHotZoneWidth);
1026                        Button.height(ImageMenuItem.imageHotZoneWidth);
1027                        Button.borderRadius(ImageMenuItem.buttonBorderRadius);
1028                        Button.foregroundColor(this.getFgColor());
1029                        Button.backgroundColor(this.getBgColor());
1030                        Button.enabled(this.item.isEnabled ? this.item.isEnabled : false);
1031                        ViewStackProcessor.visualState('focused');
1032                        Button.border({
1033                            radius: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_corner_radius_clicked'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1034                            width: ImageMenuItem.focusBorderWidth,
1035                            color: { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_focused_outline'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1036                            style: BorderStyle.Solid
1037                        });
1038                        ViewStackProcessor.visualState('normal');
1039                        Button.border({
1040                            radius: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_corner_radius_clicked'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1041                            width: 0
1042                        });
1043                        ViewStackProcessor.visualState();
1044                        Button.onFocus(() => {
1045                            if (!this.item.isEnabled) {
1046                                return;
1047                            }
1048                            this.isOnFocus = true;
1049                        });
1050                        Button.onBlur(() => this.isOnFocus = false);
1051                        Button.onHover((g30) => {
1052                            if (!this.item.isEnabled) {
1053                                return;
1054                            }
1055                            this.isOnHover = g30;
1056                        });
1057                        Button.onKeyEvent((f30) => {
1058                            if (!this.item.isEnabled) {
1059                                return;
1060                            }
1061                            if (f30.keyCode !== KeyCode.KEYCODE_ENTER && f30.keyCode !== KeyCode.KEYCODE_SPACE) {
1062                                return;
1063                            }
1064                            if (f30.type === KeyType.Down) {
1065                                this.isOnClick = true;
1066                            }
1067                            if (f30.type === KeyType.Up) {
1068                                this.isOnClick = false;
1069                            }
1070                        });
1071                        Button.onTouch((e30) => {
1072                            if (!this.item.isEnabled) {
1073                                return;
1074                            }
1075                            if (e30.type === TouchType.Down) {
1076                                this.isOnClick = true;
1077                            }
1078                            if (e30.type === TouchType.Up || e30.type === TouchType.Cancel) {
1079                                this.isOnClick = false;
1080                                if (this.fontSize >= this.minFontSize) {
1081                                    this.dialogController?.close();
1082                                }
1083                            }
1084                        });
1085                        Button.onClick(() => this.item.isEnabled && this.item.action && this.item.action());
1086                        Button.gestureModifier(ObservedObject.GetRawObject(this.buttonGestureModifier));
1087                    }, Button);
1088                    this.observeComponentCreation2((s29, t29) => {
1089                        If.create();
1090                        if (this.item.symbolStyle) {
1091                            this.ifElseBranchUpdateFunction(0, () => {
1092                                this.observeComponentCreation2((a30, b30) => {
1093                                    SymbolGlyph.create();
1094                                    SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1095                                    SymbolGlyph.attributeModifier.bind(this)(this.item.symbolStyle);
1096                                    SymbolGlyph.fontSize(ImageMenuItem.imageSize);
1097                                    SymbolGlyph.draggable(false);
1098                                    SymbolGlyph.focusable(this.item?.isEnabled);
1099                                    SymbolGlyph.key(ImageMenuItem.focusablePrefix + this.index);
1100                                    SymbolGlyph.symbolEffect(new SymbolEffect(), false);
1101                                }, SymbolGlyph);
1102                            });
1103                        }
1104                        else {
1105                            this.ifElseBranchUpdateFunction(1, () => {
1106                                this.observeComponentCreation2((u29, v29) => {
1107                                    If.create();
1108                                    if (Util.isSymbolResource(this.item.value)) {
1109                                        this.ifElseBranchUpdateFunction(0, () => {
1110                                            this.observeComponentCreation2((y29, z29) => {
1111                                                SymbolGlyph.create(this.item.value);
1112                                                SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1113                                                SymbolGlyph.fontSize(ImageMenuItem.imageSize);
1114                                                SymbolGlyph.draggable(false);
1115                                                SymbolGlyph.focusable(this.item?.isEnabled);
1116                                                SymbolGlyph.key(ImageMenuItem.focusablePrefix + this.index);
1117                                            }, SymbolGlyph);
1118                                        });
1119                                    }
1120                                    else {
1121                                        this.ifElseBranchUpdateFunction(1, () => {
1122                                            this.observeComponentCreation2((w29, x29) => {
1123                                                Image.create(this.item.value);
1124                                                Image.draggable(false);
1125                                                Image.width(ImageMenuItem.imageSize);
1126                                                Image.height(ImageMenuItem.imageSize);
1127                                                Image.focusable(this.item.isEnabled);
1128                                                Image.key(ImageMenuItem.focusablePrefix + this.index);
1129                                                Image.fillColor({ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1130                                            }, Image);
1131                                        });
1132                                    }
1133                                }, If);
1134                                If.pop();
1135                            });
1136                        }
1137                    }, If);
1138                    If.pop();
1139                    Button.pop();
1140                });
1141            }
1142            else {
1143                this.ifElseBranchUpdateFunction(1, () => {
1144                    this.observeComponentCreation2((n29, o29) => {
1145                        Button.createWithChild({ type: ButtonType.Normal, stateEffect: this.item.isEnabled });
1146                        Button.accessibilityText(this.getAccessibilityReadText());
1147                        Button.accessibilityLevel(this.item?.accessibilityLevel ?? 'auto');
1148                        Button.accessibilityDescription(this.toStringFormat(this.item?.accessibilityDescription));
1149                        Button.width(ImageMenuItem.imageHotZoneWidth);
1150                        Button.height(ImageMenuItem.imageHotZoneWidth);
1151                        Button.borderRadius(ImageMenuItem.buttonBorderRadius);
1152                        Button.foregroundColor(this.getFgColor());
1153                        Button.backgroundColor(this.getBgColor());
1154                        Button.enabled(this.item.isEnabled ? this.item.isEnabled : false);
1155                        ViewStackProcessor.visualState('focused');
1156                        Button.border({
1157                            radius: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_corner_radius_clicked'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1158                            width: ImageMenuItem.focusBorderWidth,
1159                            color: { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_focused_outline'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1160                            style: BorderStyle.Solid
1161                        });
1162                        ViewStackProcessor.visualState('normal');
1163                        Button.border({
1164                            radius: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_corner_radius_clicked'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1165                            width: 0
1166                        });
1167                        ViewStackProcessor.visualState();
1168                        Button.onFocus(() => {
1169                            if (!this.item.isEnabled) {
1170                                return;
1171                            }
1172                            this.isOnFocus = true;
1173                        });
1174                        Button.onBlur(() => this.isOnFocus = false);
1175                        Button.onHover((r29) => {
1176                            if (!this.item.isEnabled) {
1177                                return;
1178                            }
1179                            this.isOnHover = r29;
1180                        });
1181                        Button.onKeyEvent((q29) => {
1182                            if (!this.item.isEnabled) {
1183                                return;
1184                            }
1185                            if (q29.keyCode !== KeyCode.KEYCODE_ENTER && q29.keyCode !== KeyCode.KEYCODE_SPACE) {
1186                                return;
1187                            }
1188                            if (q29.type === KeyType.Down) {
1189                                this.isOnClick = true;
1190                            }
1191                            if (q29.type === KeyType.Up) {
1192                                this.isOnClick = false;
1193                            }
1194                        });
1195                        Button.onTouch((p29) => {
1196                            if (!this.item.isEnabled) {
1197                                return;
1198                            }
1199                            if (p29.type === TouchType.Down) {
1200                                this.isOnClick = true;
1201                            }
1202                            if (p29.type === TouchType.Up || p29.type === TouchType.Cancel) {
1203                                this.isOnClick = false;
1204                                if (this.fontSize >= this.minFontSize) {
1205                                    this.dialogController?.close();
1206                                }
1207                            }
1208                        });
1209                        Button.onClick(() => this.item.isEnabled && this.item.action && this.item.action());
1210                    }, Button);
1211                    this.observeComponentCreation2((d29, e29) => {
1212                        If.create();
1213                        if (this.item.symbolStyle) {
1214                            this.ifElseBranchUpdateFunction(0, () => {
1215                                this.observeComponentCreation2((l29, m29) => {
1216                                    SymbolGlyph.create();
1217                                    SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1218                                    SymbolGlyph.attributeModifier.bind(this)(this.item.symbolStyle);
1219                                    SymbolGlyph.fontSize(ImageMenuItem.imageSize);
1220                                    SymbolGlyph.draggable(false);
1221                                    SymbolGlyph.focusable(this.item?.isEnabled);
1222                                    SymbolGlyph.key(ImageMenuItem.focusablePrefix + this.index);
1223                                    SymbolGlyph.symbolEffect(new SymbolEffect(), false);
1224                                }, SymbolGlyph);
1225                            });
1226                        }
1227                        else {
1228                            this.ifElseBranchUpdateFunction(1, () => {
1229                                this.observeComponentCreation2((f29, g29) => {
1230                                    If.create();
1231                                    if (Util.isSymbolResource(this.item.value)) {
1232                                        this.ifElseBranchUpdateFunction(0, () => {
1233                                            this.observeComponentCreation2((j29, k29) => {
1234                                                SymbolGlyph.create(this.item.value);
1235                                                SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1236                                                SymbolGlyph.fontSize(ImageMenuItem.imageSize);
1237                                                SymbolGlyph.draggable(false);
1238                                                SymbolGlyph.focusable(this.item?.isEnabled);
1239                                                SymbolGlyph.key(ImageMenuItem.focusablePrefix + this.index);
1240                                            }, SymbolGlyph);
1241                                        });
1242                                    }
1243                                    else {
1244                                        this.ifElseBranchUpdateFunction(1, () => {
1245                                            this.observeComponentCreation2((h29, i29) => {
1246                                                Image.create(this.item.value);
1247                                                Image.draggable(false);
1248                                                Image.width(ImageMenuItem.imageSize);
1249                                                Image.height(ImageMenuItem.imageSize);
1250                                                Image.focusable(this.item.isEnabled);
1251                                                Image.key(ImageMenuItem.focusablePrefix + this.index);
1252                                                Image.fillColor({ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1253                                            }, Image);
1254                                        });
1255                                    }
1256                                }, If);
1257                                If.pop();
1258                            });
1259                        }
1260                    }, If);
1261                    If.pop();
1262                    Button.pop();
1263                });
1264            }
1265        }, If);
1266        If.pop();
1267    }
1268    rerender() {
1269        this.updateDirtyElements();
1270    }
1271}
1272ImageMenuItem.imageSize = '24vp';
1273ImageMenuItem.imageHotZoneWidth = 48;
1274ImageMenuItem.buttonBorderRadius = 8;
1275ImageMenuItem.focusBorderWidth = 2;
1276ImageMenuItem.focusablePrefix = 'Id-SelectTitleBar-ImageMenuItem-';
1277class SelectTitleBarDialog extends ViewPU {
1278    constructor(v28, w28, x28, y28 = -1, z28 = undefined, a29) {
1279        super(v28, x28, y28, a29);
1280        if (typeof z28 === 'function') {
1281            this.paramsGenerator_ = z28;
1282        }
1283        this.selectTitleDialog = {};
1284        this.callbackId = undefined;
1285        this.selectTitleBarDialog = '';
1286        this.mainWindowStage = undefined;
1287        this.controller = undefined;
1288        this.minFontSize = 1.75;
1289        this.maxFontSize = 3.2;
1290        this.screenWidth = 640;
1291        this.verticalScreenLines = 6;
1292        this.horizontalsScreenLines = 1;
1293        this.__mainWindow = this.createStorageLink('mainWindow', undefined, 'mainWindow');
1294        this.__fontSize = new ObservedPropertySimplePU(1, this, 'fontSize');
1295        this.__maxLines = new ObservedPropertySimplePU(1, this, 'maxLines');
1296        this.__windowStandardHeight = this.createStorageProp('windowStandardHeight', 0, 'windowStandardHeight');
1297        this.cancel = () => {
1298        };
1299        this.confirm = () => {
1300        };
1301        this.setInitiallyProvidedValue(w28);
1302        this.finalizeConstruction();
1303    }
1304    setInitiallyProvidedValue(u28) {
1305        if (u28.selectTitleDialog !== undefined) {
1306            this.selectTitleDialog = u28.selectTitleDialog;
1307        }
1308        if (u28.callbackId !== undefined) {
1309            this.callbackId = u28.callbackId;
1310        }
1311        if (u28.selectTitleBarDialog !== undefined) {
1312            this.selectTitleBarDialog = u28.selectTitleBarDialog;
1313        }
1314        if (u28.mainWindowStage !== undefined) {
1315            this.mainWindowStage = u28.mainWindowStage;
1316        }
1317        if (u28.controller !== undefined) {
1318            this.controller = u28.controller;
1319        }
1320        if (u28.minFontSize !== undefined) {
1321            this.minFontSize = u28.minFontSize;
1322        }
1323        if (u28.maxFontSize !== undefined) {
1324            this.maxFontSize = u28.maxFontSize;
1325        }
1326        if (u28.screenWidth !== undefined) {
1327            this.screenWidth = u28.screenWidth;
1328        }
1329        if (u28.verticalScreenLines !== undefined) {
1330            this.verticalScreenLines = u28.verticalScreenLines;
1331        }
1332        if (u28.horizontalsScreenLines !== undefined) {
1333            this.horizontalsScreenLines = u28.horizontalsScreenLines;
1334        }
1335        if (u28.fontSize !== undefined) {
1336            this.fontSize = u28.fontSize;
1337        }
1338        if (u28.maxLines !== undefined) {
1339            this.maxLines = u28.maxLines;
1340        }
1341        if (u28.cancel !== undefined) {
1342            this.cancel = u28.cancel;
1343        }
1344        if (u28.confirm !== undefined) {
1345            this.confirm = u28.confirm;
1346        }
1347    }
1348    updateStateVars(t28) {
1349    }
1350    purgeVariableDependenciesOnElmtId(s28) {
1351        this.__mainWindow.purgeDependencyOnElmtId(s28);
1352        this.__fontSize.purgeDependencyOnElmtId(s28);
1353        this.__maxLines.purgeDependencyOnElmtId(s28);
1354        this.__windowStandardHeight.purgeDependencyOnElmtId(s28);
1355    }
1356    aboutToBeDeleted() {
1357        this.__mainWindow.aboutToBeDeleted();
1358        this.__fontSize.aboutToBeDeleted();
1359        this.__maxLines.aboutToBeDeleted();
1360        this.__windowStandardHeight.aboutToBeDeleted();
1361        SubscriberManager.Get().delete(this.id__());
1362        this.aboutToBeDeletedInternal();
1363    }
1364    setController(r28) {
1365        this.controller = r28;
1366    }
1367    get mainWindow() {
1368        return this.__mainWindow.get();
1369    }
1370    set mainWindow(q28) {
1371        this.__mainWindow.set(q28);
1372    }
1373    get fontSize() {
1374        return this.__fontSize.get();
1375    }
1376    set fontSize(p28) {
1377        this.__fontSize.set(p28);
1378    }
1379    get maxLines() {
1380        return this.__maxLines.get();
1381    }
1382    set maxLines(o28) {
1383        this.__maxLines.set(o28);
1384    }
1385    get windowStandardHeight() {
1386        return this.__windowStandardHeight.get();
1387    }
1388    set windowStandardHeight(n28) {
1389        this.__windowStandardHeight.set(n28);
1390    }
1391    initialRender() {
1392        this.observeComponentCreation2((j27, k27) => {
1393            If.create();
1394            if (this.selectTitleBarDialog) {
1395                this.ifElseBranchUpdateFunction(0, () => {
1396                    this.observeComponentCreation2((l28, m28) => {
1397                        Column.create();
1398                        Column.width(this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG);
1399                        Column.constraintSize({ minHeight: this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG });
1400                        Column.backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK);
1401                        Column.shadow(ShadowStyle.OUTER_DEFAULT_LG);
1402                        Column.borderRadius({ 'id': -1, 'type': 10002, params: ['sys.float.corner_radius_level10'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1403                    }, Column);
1404                    this.observeComponentCreation2((b28, c28) => {
1405                        If.create();
1406                        if (this.selectTitleDialog.symbolStyle) {
1407                            this.ifElseBranchUpdateFunction(0, () => {
1408                                this.observeComponentCreation2((j28, k28) => {
1409                                    SymbolGlyph.create();
1410                                    SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1411                                    SymbolGlyph.attributeModifier.bind(this)(this.selectTitleDialog.symbolStyle);
1412                                    SymbolGlyph.fontSize(IMAGE_SIZE);
1413                                    SymbolGlyph.draggable(false);
1414                                    SymbolGlyph.focusable(this.selectTitleDialog.isEnabled);
1415                                    SymbolGlyph.margin({
1416                                        top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level24'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1417                                        bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1418                                    });
1419                                    SymbolGlyph.symbolEffect(new SymbolEffect(), false);
1420                                }, SymbolGlyph);
1421                            });
1422                        }
1423                        else if (this.selectTitleDialog.value) {
1424                            this.ifElseBranchUpdateFunction(1, () => {
1425                                this.observeComponentCreation2((d28, e28) => {
1426                                    If.create();
1427                                    if (Util.isSymbolResource(this.selectTitleDialog.value)) {
1428                                        this.ifElseBranchUpdateFunction(0, () => {
1429                                            this.observeComponentCreation2((h28, i28) => {
1430                                                SymbolGlyph.create(this.selectTitleDialog.value);
1431                                                SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1432                                                SymbolGlyph.fontSize(IMAGE_SIZE);
1433                                                SymbolGlyph.draggable(false);
1434                                                SymbolGlyph.focusable(this.selectTitleDialog.isEnabled);
1435                                                SymbolGlyph.margin({
1436                                                    top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level24'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1437                                                    bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1438                                                });
1439                                            }, SymbolGlyph);
1440                                        });
1441                                    }
1442                                    else {
1443                                        this.ifElseBranchUpdateFunction(1, () => {
1444                                            this.observeComponentCreation2((f28, g28) => {
1445                                                Image.create(this.selectTitleDialog.value);
1446                                                Image.width(IMAGE_SIZE);
1447                                                Image.height(IMAGE_SIZE);
1448                                                Image.margin({
1449                                                    top: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level24'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1450                                                    bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level8'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1451                                                });
1452                                                Image.fillColor({ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1453                                            }, Image);
1454                                        });
1455                                    }
1456                                }, If);
1457                                If.pop();
1458                            });
1459                        }
1460                        else {
1461                            this.ifElseBranchUpdateFunction(2, () => {
1462                            });
1463                        }
1464                    }, If);
1465                    If.pop();
1466                    this.observeComponentCreation2((z27, a28) => {
1467                        Column.create();
1468                        Column.width('100%');
1469                        Column.padding({
1470                            left: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level4'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1471                            right: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level4'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1472                            bottom: { 'id': -1, 'type': 10002, params: ['sys.float.padding_level12'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' },
1473                        });
1474                    }, Column);
1475                    this.observeComponentCreation2((x27, y27) => {
1476                        Text.create(this.selectTitleBarDialog);
1477                        Text.fontSize(TEXT_EDITABLE_DIALOG);
1478                        Text.textOverflow({ overflow: TextOverflow.Ellipsis });
1479                        Text.maxLines(this.maxLines);
1480                        Text.width('100%');
1481                        Text.textAlign(TextAlign.Center);
1482                        Text.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1483                    }, Text);
1484                    Text.pop();
1485                    Column.pop();
1486                    Column.pop();
1487                });
1488            }
1489            else {
1490                this.ifElseBranchUpdateFunction(1, () => {
1491                    this.observeComponentCreation2((v27, w27) => {
1492                        Column.create();
1493                        Column.width(this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG);
1494                        Column.constraintSize({ minHeight: this.fontSize === this.maxFontSize ? MAX_DIALOG : MIN_DIALOG });
1495                        Column.backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK);
1496                        Column.shadow(ShadowStyle.OUTER_DEFAULT_LG);
1497                        Column.borderRadius({ 'id': -1, 'type': 10002, params: ['sys.float.corner_radius_level10'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1498                        Column.justifyContent(FlexAlign.Center);
1499                    }, Column);
1500                    this.observeComponentCreation2((l27, m27) => {
1501                        If.create();
1502                        if (this.selectTitleDialog.symbolStyle) {
1503                            this.ifElseBranchUpdateFunction(0, () => {
1504                                this.observeComponentCreation2((t27, u27) => {
1505                                    SymbolGlyph.create();
1506                                    SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1507                                    SymbolGlyph.attributeModifier.bind(this)(this.selectTitleDialog.symbolStyle);
1508                                    SymbolGlyph.fontSize(IMAGE_SIZE);
1509                                    SymbolGlyph.draggable(false);
1510                                    SymbolGlyph.focusable(this.selectTitleDialog.isEnabled);
1511                                    SymbolGlyph.symbolEffect(new SymbolEffect(), false);
1512                                }, SymbolGlyph);
1513                            });
1514                        }
1515                        else if (this.selectTitleDialog.value) {
1516                            this.ifElseBranchUpdateFunction(1, () => {
1517                                this.observeComponentCreation2((n27, o27) => {
1518                                    If.create();
1519                                    if (Util.isSymbolResource(this.selectTitleDialog.value)) {
1520                                        this.ifElseBranchUpdateFunction(0, () => {
1521                                            this.observeComponentCreation2((r27, s27) => {
1522                                                SymbolGlyph.create(this.selectTitleDialog.value);
1523                                                SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]);
1524                                                SymbolGlyph.fontSize(IMAGE_SIZE);
1525                                                SymbolGlyph.draggable(false);
1526                                                SymbolGlyph.focusable(this.selectTitleDialog.isEnabled);
1527                                            }, SymbolGlyph);
1528                                        });
1529                                    }
1530                                    else {
1531                                        this.ifElseBranchUpdateFunction(1, () => {
1532                                            this.observeComponentCreation2((p27, q27) => {
1533                                                Image.create(this.selectTitleDialog.value);
1534                                                Image.width(IMAGE_SIZE);
1535                                                Image.height(IMAGE_SIZE);
1536                                                Image.fillColor({ 'id': -1, 'type': 10001, params: ['sys.color.icon_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' });
1537                                            }, Image);
1538                                        });
1539                                    }
1540                                }, If);
1541                                If.pop();
1542                            });
1543                        }
1544                        else {
1545                            this.ifElseBranchUpdateFunction(2, () => {
1546                            });
1547                        }
1548                    }, If);
1549                    If.pop();
1550                    Column.pop();
1551                });
1552            }
1553        }, If);
1554        If.pop();
1555    }
1556    async aboutToAppear() {
1557        let g27 = this.getUIContext().getHostContext();
1558        this.mainWindowStage = g27.windowStage.getMainWindowSync();
1559        let h27 = this.mainWindowStage.getWindowProperties();
1560        let i27 = h27.windowRect;
1561        if (px2vp(i27.height) > this.screenWidth) {
1562            this.maxLines = this.verticalScreenLines;
1563        }
1564        else {
1565            this.maxLines = this.horizontalsScreenLines;
1566        }
1567    }
1568    rerender() {
1569        this.updateDirtyElements();
1570    }
1571}
1572class Util {
1573    static isSymbolResource(e27) {
1574        if (!Util.isResourceType(e27)) {
1575            return false;
1576        }
1577        let f27 = e27;
1578        return f27.type == RESOURCE_TYPE_SYMBOL;
1579    }
1580    static isResourceType(d27) {
1581        if (!d27) {
1582            return false;
1583        }
1584        if (typeof d27 === 'string' || typeof d27 === 'undefined') {
1585            return false;
1586        }
1587        return true;
1588    }
1589}
1590
1591export default {
1592    SelectTitleBar: SelectTitleBar,
1593};
1594