create-basicjs 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/create-basicjs.js +31 -4
- package/bin/verify-package.js +1 -1
- package/package.json +2 -2
- package/payload/starter/AGENTS.md +11 -6
- package/payload/starter/README.md +1 -1
- package/payload/starter/_basic/VERSION +1 -1
- package/payload/starter/_basic/assets/cards/almond-blossom.png +0 -0
- package/payload/starter/_basic/assets/cards/blackberry.png +0 -0
- package/payload/starter/_basic/assets/cards/borage.png +0 -0
- package/payload/starter/_basic/assets/cards/chamomile.png +0 -0
- package/payload/starter/_basic/assets/cards/dill.png +0 -0
- package/payload/starter/_basic/assets/cards/eucalyptus.png +0 -0
- package/payload/starter/_basic/assets/cards/fennel.png +0 -0
- package/payload/starter/_basic/assets/cards/fig.png +0 -0
- package/payload/starter/_basic/assets/cards/juniper.png +0 -0
- package/payload/starter/_basic/assets/cards/lavender.png +0 -0
- package/payload/starter/_basic/assets/cards/lemon.png +0 -0
- package/payload/starter/_basic/assets/cards/olives.png +0 -0
- package/payload/starter/_basic/assets/cards/oregano.png +0 -0
- package/payload/starter/_basic/assets/cards/pepper.png +0 -0
- package/payload/starter/_basic/assets/cards/physalis.png +0 -0
- package/payload/starter/_basic/assets/cards/pomegranate.png +0 -0
- package/payload/starter/_basic/assets/cards/poppy.png +0 -0
- package/payload/starter/_basic/assets/cards/rosehip.png +0 -0
- package/payload/starter/_basic/assets/cards/saffron.png +0 -0
- package/payload/starter/_basic/assets/categories/cappuccino.png +0 -0
- package/payload/starter/_basic/assets/categories/chocolate-milk.png +0 -0
- package/payload/starter/_basic/assets/categories/coffee.png +0 -0
- package/payload/starter/_basic/assets/categories/frappe.png +0 -0
- package/payload/starter/_basic/assets/categories/iced-caffee.png +0 -0
- package/payload/starter/_basic/assets/categories/milkshake.png +0 -0
- package/payload/starter/_basic/assets/categories/orange-juice.png +0 -0
- package/payload/starter/_basic/assets/categories/tea.png +0 -0
- package/payload/starter/_basic/assets/fruids/brokoli.png +0 -0
- package/payload/starter/_basic/assets/fruids/cilek.png +0 -0
- package/payload/starter/_basic/assets/fruids/domates.png +0 -0
- package/payload/starter/_basic/assets/fruids/elma.png +0 -0
- package/payload/starter/_basic/assets/fruids/havuc.png +0 -0
- package/payload/starter/_basic/assets/fruids/karpuz.png +0 -0
- package/payload/starter/_basic/assets/fruids/limon.png +0 -0
- package/payload/starter/_basic/assets/fruids/muz.png +0 -0
- package/payload/starter/_basic/assets/fruids/nar.png +0 -0
- package/payload/starter/_basic/assets/fruids/patlican.png +0 -0
- package/payload/starter/_basic/assets/fruids/yabanmersini.png +0 -0
- package/payload/starter/_basic/assets/fruids/yesilbiber.png +0 -0
- package/payload/starter/_basic/basic/LICENSE +1 -1
- package/payload/starter/_basic/basic/basic.css +3 -6
- package/payload/starter/_basic/basic/basic.js +154 -60
- package/payload/starter/_basic/basic/basic.min.js +19 -6
- package/payload/starter/_basic/basic/scroll-bar.js +4 -2
- package/payload/starter/_basic/basic/scroll-bar.min.js +1 -0
- package/payload/starter/_basic/comp/accordion.js +659 -0
- package/payload/starter/_basic/comp/action-button.js +22 -23
- package/payload/starter/_basic/comp/action-tab-bar.js +8 -8
- package/payload/starter/_basic/comp/app-bar.js +12 -11
- package/payload/starter/_basic/comp/{badge-v2.js → badge.js} +51 -5
- package/payload/starter/_basic/comp/bottom-bar.js +31 -23
- package/payload/starter/_basic/comp/breadcrumbs.js +4 -2
- package/payload/starter/_basic/comp/canvas.js +652 -0
- package/payload/starter/_basic/comp/chat-view.js +827 -0
- package/payload/starter/_basic/comp/check-box.js +137 -21
- package/payload/starter/_basic/comp/code-editor.js +953 -0
- package/payload/starter/_basic/comp/{select-color.js → color-picker.js} +62 -29
- package/payload/starter/_basic/comp/context-menu.js +342 -30
- package/payload/starter/_basic/comp/{currency-input-b.js → currency-field.js} +48 -29
- package/payload/starter/_basic/comp/data-table.js +114 -42
- package/payload/starter/_basic/comp/{select-date.js → date-picker.js} +104 -52
- package/payload/starter/_basic/comp/dialog.js +214 -76
- package/payload/starter/_basic/comp/email-field.js +65 -0
- package/payload/starter/_basic/comp/{select-file.js → file-picker.js} +245 -57
- package/payload/starter/_basic/comp/filters.js +374 -60
- package/payload/starter/_basic/comp/form.js +38 -26
- package/payload/starter/_basic/comp/full-screen-select.js +36 -33
- package/payload/starter/_basic/comp/gauge.js +12 -8
- package/payload/starter/_basic/comp/graph-box.js +3911 -0
- package/payload/starter/_basic/comp/grid-group.js +185 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button.js +16 -7
- package/payload/starter/_basic/comp/image-view.js +598 -0
- package/payload/starter/_basic/comp/item-list.js +507 -163
- package/payload/starter/_basic/comp/json-editor.js +3221 -0
- package/payload/starter/_basic/comp/json-view.js +597 -0
- package/payload/starter/_basic/comp/label-editor.js +22 -19
- package/payload/starter/_basic/comp/left-menu.js +89 -22
- package/payload/starter/_basic/comp/line-progress-bar.js +196 -45
- package/payload/starter/_basic/comp/loading-screen.js +49 -18
- package/payload/starter/_basic/comp/log-view.js +530 -0
- package/payload/starter/_basic/comp/{login-page-v2.js → login-page.js} +205 -106
- package/payload/starter/_basic/comp/markdown-view.js +1044 -0
- package/payload/starter/_basic/comp/menu-bar.js +624 -0
- package/payload/starter/_basic/comp/mini-graph-box.js +20 -11
- package/payload/starter/_basic/comp/minimal-accent.js +208 -0
- package/payload/starter/_basic/comp/notice.js +15 -13
- package/payload/starter/_basic/comp/{number-input-b.js → number-field.js} +26 -19
- package/payload/starter/_basic/comp/numeric-keyboard.js +15 -13
- package/payload/starter/_basic/comp/page-control.js +21 -4
- package/payload/starter/_basic/comp/page-header.js +7 -6
- package/payload/starter/_basic/comp/password-field.js +192 -0
- package/payload/starter/_basic/comp/period-bar.js +8 -7
- package/payload/starter/_basic/comp/{phone-input-b.js → phone-field.js} +80 -45
- package/payload/starter/_basic/comp/progress-bar.js +401 -85
- package/payload/starter/_basic/comp/property-panel.js +1022 -123
- package/payload/starter/_basic/comp/radio-button.js +79 -19
- package/payload/starter/_basic/comp/range-slider.js +569 -0
- package/payload/starter/_basic/comp/rich-text-editor.js +33 -30
- package/payload/starter/_basic/comp/scroll-area.js +308 -0
- package/payload/starter/_basic/comp/scrolling-text.js +10 -9
- package/payload/starter/_basic/comp/search-input.js +725 -0
- package/payload/starter/_basic/comp/search-results.js +60 -24
- package/payload/starter/_basic/comp/select-box.js +229 -107
- package/payload/starter/_basic/comp/settings-row.js +20 -19
- package/payload/starter/_basic/comp/side-panel.js +53 -10
- package/payload/starter/_basic/comp/slider-field.js +264 -88
- package/payload/starter/_basic/comp/slider.js +541 -86
- package/payload/starter/_basic/comp/smart-button.js +433 -352
- package/payload/starter/_basic/comp/smart-table.js +740 -185
- package/payload/starter/_basic/comp/sortable-list.js +47 -38
- package/payload/starter/_basic/comp/spark-line-box.js +25 -16
- package/payload/starter/_basic/comp/splitter.js +411 -0
- package/payload/starter/_basic/comp/status-bar.js +408 -0
- package/payload/starter/_basic/comp/step-bar.js +345 -0
- package/payload/starter/_basic/comp/stepper.js +77 -49
- package/payload/starter/_basic/comp/tabs.js +67 -18
- package/payload/starter/_basic/comp/tag-input.js +50 -10
- package/payload/starter/_basic/comp/tap-effect.js +6 -4
- package/payload/starter/_basic/comp/text-area-field.js +233 -0
- package/payload/starter/_basic/comp/text-field.js +1006 -0
- package/payload/starter/_basic/comp/time-line.js +102 -28
- package/payload/starter/_basic/comp/{select-time.js → time-picker.js} +104 -51
- package/payload/starter/_basic/comp/tiny-select.js +79 -39
- package/payload/starter/_basic/comp/tiny-table.js +12 -8
- package/payload/starter/_basic/comp/toast.js +87 -34
- package/payload/starter/_basic/comp/toggle.js +147 -27
- package/payload/starter/_basic/comp/tool-bar.js +760 -0
- package/payload/starter/_basic/comp/tooltip.js +80 -17
- package/payload/starter/_basic/comp/tree-view.js +124 -41
- package/payload/starter/_basic/comp/ui-effects.js +17 -11
- package/payload/starter/_basic/comp/ui-standards.js +5 -4
- package/payload/starter/_basic/comp/url-field.js +190 -0
- package/payload/starter/_basic/comp/web-view.js +70 -16
- package/payload/starter/_basic/docs/basic-js-animated-rules.md +15 -9
- package/payload/starter/_basic/docs/basic-js-code-rules.md +42 -5
- package/payload/starter/_basic/docs/basic-js-components.md +12 -17
- package/payload/starter/_basic/docs/basic-js-core.md +5 -4
- package/payload/starter/_basic/docs/component-index.md +245 -104
- package/payload/starter/_basic/docs/component-template.js +28 -24
- package/payload/starter/_basic/docs/handbook/00-introduction.md +6 -2
- package/payload/starter/_basic/docs/handbook/00-what-is-new.md +21 -0
- package/payload/starter/_basic/docs/handbook/01-label.md +4 -4
- package/payload/starter/_basic/docs/handbook/02-box.md +7 -7
- package/payload/starter/_basic/docs/handbook/03-image.md +4 -4
- package/payload/starter/_basic/docs/handbook/04-common-properties.md +6 -5
- package/payload/starter/_basic/docs/handbook/05-autolayout.md +8 -7
- package/payload/starter/_basic/docs/handbook/06-button.md +3 -3
- package/payload/starter/_basic/docs/handbook/07-input.md +3 -3
- package/payload/starter/_basic/docs/handbook/08-page.md +3 -3
- package/payload/starter/_basic/docs/handbook/09-useful-examples.md +39 -58
- package/payload/starter/_basic/docs/handbook/10-motion.md +6 -6
- package/payload/starter/_basic/docs/handbook/11-other-functions.md +1 -0
- package/payload/starter/_basic/docs/handbook/13-sound.md +3 -3
- package/payload/starter/_basic/docs/handbook/14-using-components.md +180 -0
- package/payload/starter/_basic/docs/handbook/15-making-a-component.md +338 -0
- package/payload/starter/_basic/docs/what-is-new.md +106 -0
- package/payload/starter/_basic/examples/accordion.htm +174 -0
- package/payload/starter/_basic/examples/action-button.htm +74 -32
- package/payload/starter/_basic/examples/action-tab-bar.htm +5 -6
- package/payload/starter/_basic/examples/app-bar.htm +63 -41
- package/payload/starter/_basic/examples/badge.htm +96 -0
- package/payload/starter/_basic/examples/bottom-bar-2.htm +61 -48
- package/payload/starter/_basic/examples/bottom-bar.htm +74 -16
- package/payload/starter/_basic/examples/breadcrumbs.htm +160 -150
- package/payload/starter/_basic/examples/canvas.htm +190 -0
- package/payload/starter/_basic/examples/chat-view.htm +143 -0
- package/payload/starter/_basic/examples/check-box-2.htm +71 -82
- package/payload/starter/_basic/examples/check-box-3.htm +72 -83
- package/payload/starter/_basic/examples/check-box.htm +207 -0
- package/payload/starter/_basic/examples/code-editor-2.htm +259 -0
- package/payload/starter/_basic/examples/code-editor.htm +225 -0
- package/payload/starter/_basic/examples/color-picker.htm +206 -0
- package/payload/starter/_basic/examples/context-menu.htm +180 -139
- package/payload/starter/_basic/examples/currency-field.htm +105 -0
- package/payload/starter/_basic/examples/data-table-2.htm +2 -1
- package/payload/starter/_basic/examples/data-table-3.htm +1 -1
- package/payload/starter/_basic/examples/data-table-4.htm +15 -12
- package/payload/starter/_basic/examples/data-table-5.htm +11 -3
- package/payload/starter/_basic/examples/data-table.htm +90 -40
- package/payload/starter/_basic/examples/date-picker.htm +239 -0
- package/payload/starter/_basic/examples/dialog-centered.htm +394 -40
- package/payload/starter/_basic/examples/dialog.htm +267 -46
- package/payload/starter/_basic/examples/email-field.htm +102 -0
- package/payload/starter/_basic/examples/file-picker.htm +296 -0
- package/payload/starter/_basic/examples/filters.htm +33 -22
- package/payload/starter/_basic/examples/{form-1.htm → form.htm} +18 -19
- package/payload/starter/_basic/examples/full-screen-select.htm +81 -58
- package/payload/starter/_basic/examples/gauge.htm +95 -81
- package/payload/starter/_basic/examples/graph-box.htm +365 -0
- package/payload/starter/_basic/examples/grid-group.htm +179 -0
- package/payload/starter/_basic/examples/hold-to-confirm-button.htm +102 -113
- package/payload/starter/_basic/examples/image-view.htm +195 -0
- package/payload/starter/_basic/examples/item-list-2.htm +138 -94
- package/payload/starter/_basic/examples/item-list.htm +191 -86
- package/payload/starter/_basic/examples/json-editor.htm +206 -0
- package/payload/starter/_basic/examples/json-view.htm +153 -0
- package/payload/starter/_basic/examples/label-editor.htm +85 -89
- package/payload/starter/_basic/examples/left-menu-2.htm +93 -0
- package/payload/starter/_basic/examples/left-menu.htm +42 -37
- package/payload/starter/_basic/examples/line-progress-bar.htm +155 -114
- package/payload/starter/_basic/examples/loading-screen.htm +149 -125
- package/payload/starter/_basic/examples/log-view.htm +175 -0
- package/payload/starter/_basic/examples/{login-page-dark-v2.htm → login-page-dark.htm} +265 -267
- package/payload/starter/_basic/examples/{login-page-v2.htm → login-page.htm} +266 -267
- package/payload/starter/_basic/examples/markdown-view.htm +220 -0
- package/payload/starter/_basic/examples/menu-bar-2.htm +225 -0
- package/payload/starter/_basic/examples/menu-bar.htm +145 -0
- package/payload/starter/_basic/examples/mini-graph-box.htm +98 -109
- package/payload/starter/_basic/examples/minimal-accent.htm +196 -0
- package/payload/starter/_basic/examples/minimal-theme.htm +432 -0
- package/payload/starter/_basic/examples/notice.htm +13 -4
- package/payload/starter/_basic/examples/number-field.htm +103 -0
- package/payload/starter/_basic/examples/numeric-keyboard.htm +44 -42
- package/payload/starter/_basic/examples/page-control.htm +181 -130
- package/payload/starter/_basic/examples/page-header.htm +57 -30
- package/payload/starter/_basic/examples/password-field.htm +117 -0
- package/payload/starter/_basic/examples/period-bar.htm +43 -29
- package/payload/starter/_basic/examples/phone-field-select-country.htm +292 -0
- package/payload/starter/_basic/examples/phone-field.htm +104 -0
- package/payload/starter/_basic/examples/progress-bar-ozden.htm +229 -92
- package/payload/starter/_basic/examples/progress-bar.htm +222 -174
- package/payload/starter/_basic/examples/property-panel.htm +152 -52
- package/payload/starter/_basic/examples/radio-button-2.htm +101 -109
- package/payload/starter/_basic/examples/radio-button-3.htm +81 -71
- package/payload/starter/_basic/examples/radio-button.htm +289 -0
- package/payload/starter/_basic/examples/range-slider.htm +171 -0
- package/payload/starter/_basic/examples/rich-text-editor.htm +115 -110
- package/payload/starter/_basic/examples/scroll-area.htm +293 -0
- package/payload/starter/_basic/examples/scrolling-text.htm +27 -6
- package/payload/starter/_basic/examples/search-input-2-light.htm +112 -0
- package/payload/starter/_basic/examples/search-input-3-dark.htm +105 -0
- package/payload/starter/_basic/examples/{search-input-v2-place.htm → search-input-place.htm} +25 -26
- package/payload/starter/_basic/examples/search-input.htm +159 -0
- package/payload/starter/_basic/examples/search-results.htm +85 -88
- package/payload/starter/_basic/examples/select-box-ozden-dark-text.htm +70 -0
- package/payload/starter/_basic/examples/select-box-ozden-item.htm +6 -5
- package/payload/starter/_basic/examples/select-box-ozden-text.htm +5 -3
- package/payload/starter/_basic/examples/select-box.htm +190 -159
- package/payload/starter/_basic/examples/settings-row.htm +92 -43
- package/payload/starter/_basic/examples/side-panel-2.htm +63 -25
- package/payload/starter/_basic/examples/side-panel.htm +84 -70
- package/payload/starter/_basic/examples/slider-2-classic.htm +152 -0
- package/payload/starter/_basic/examples/slider-field-ozden.htm +286 -0
- package/payload/starter/_basic/examples/slider-field.htm +174 -134
- package/payload/starter/_basic/examples/slider.htm +257 -180
- package/payload/starter/_basic/examples/smart-button-3-ozden.htm +170 -257
- package/payload/starter/_basic/examples/smart-button-4-dark.htm +86 -47
- package/payload/starter/_basic/examples/smart-button-5-features.htm +130 -125
- package/payload/starter/_basic/examples/smart-button-alternatif.htm +266 -0
- package/payload/starter/_basic/examples/smart-button.htm +207 -174
- package/payload/starter/_basic/examples/smart-table-2.htm +43 -56
- package/payload/starter/_basic/examples/smart-table-3.htm +148 -113
- package/payload/starter/_basic/examples/smart-table-4.htm +37 -50
- package/payload/starter/_basic/examples/{smart-table-1.htm → smart-table-5.htm} +37 -48
- package/payload/starter/_basic/examples/smart-table.htm +183 -0
- package/payload/starter/_basic/examples/sortable-list.htm +191 -142
- package/payload/starter/_basic/examples/spark-line-box.htm +149 -161
- package/payload/starter/_basic/examples/splitter.htm +164 -0
- package/payload/starter/_basic/examples/status-bar.htm +166 -0
- package/payload/starter/_basic/examples/step-bar.htm +129 -0
- package/payload/starter/_basic/examples/stepper-2.htm +71 -59
- package/payload/starter/_basic/examples/stepper.htm +146 -135
- package/payload/starter/_basic/examples/tabs-2.htm +58 -67
- package/payload/starter/_basic/examples/tabs.htm +197 -180
- package/payload/starter/_basic/examples/tag-input.htm +150 -153
- package/payload/starter/_basic/examples/tap-effect.htm +23 -19
- package/payload/starter/_basic/examples/text-area-field.htm +104 -0
- package/payload/starter/_basic/examples/text-field-2.htm +113 -0
- package/payload/starter/_basic/examples/text-field-3-style.htm +105 -0
- package/payload/starter/_basic/examples/text-field-4-custom-unit.htm +96 -0
- package/payload/starter/_basic/examples/{input-b-ex5-warning-icon.htm → text-field-5-warning-icon.htm} +19 -19
- package/payload/starter/_basic/examples/text-field-6-modern-dark.htm +114 -0
- package/payload/starter/_basic/examples/text-field-7-modern.htm +106 -0
- package/payload/starter/_basic/examples/text-field-8-light-dark.htm +159 -0
- package/payload/starter/_basic/examples/text-field.htm +163 -0
- package/payload/starter/_basic/examples/time-line.htm +180 -116
- package/payload/starter/_basic/examples/time-picker.htm +240 -0
- package/payload/starter/_basic/examples/tiny-select.htm +118 -86
- package/payload/starter/_basic/examples/tiny-table.htm +40 -34
- package/payload/starter/_basic/examples/toast.htm +145 -147
- package/payload/starter/_basic/examples/toggle-2.htm +99 -68
- package/payload/starter/_basic/examples/toggle-3.htm +104 -101
- package/payload/starter/_basic/examples/toggle.htm +161 -93
- package/payload/starter/_basic/examples/tool-bar.htm +172 -0
- package/payload/starter/_basic/examples/tooltip-2.htm +110 -60
- package/payload/starter/_basic/examples/tooltip-3.htm +124 -65
- package/payload/starter/_basic/examples/tooltip-4.htm +218 -0
- package/payload/starter/_basic/examples/tooltip.htm +206 -124
- package/payload/starter/_basic/examples/tree-view.htm +210 -182
- package/payload/starter/_basic/examples/ui-effects.htm +207 -185
- package/payload/starter/_basic/examples/ui-standards.htm +200 -139
- package/payload/starter/_basic/examples/url-field.htm +120 -0
- package/payload/starter/_basic/examples/web-view.htm +109 -110
- package/payload/starter/_basic/min/accordion.min.js +2 -0
- package/payload/starter/_basic/min/action-button.min.js +1 -1
- package/payload/starter/_basic/min/app-bar.min.js +1 -1
- package/payload/starter/_basic/min/badge.min.js +2 -0
- package/payload/starter/_basic/min/bottom-bar.min.js +1 -1
- package/payload/starter/_basic/min/canvas.min.js +2 -0
- package/payload/starter/_basic/min/chat-view.min.js +2 -0
- package/payload/starter/_basic/min/check-box.min.js +1 -1
- package/payload/starter/_basic/min/code-editor.min.js +2 -0
- package/payload/starter/_basic/min/color-picker.min.js +2 -0
- package/payload/starter/_basic/min/context-menu.min.js +1 -1
- package/payload/starter/_basic/min/currency-field.min.js +2 -0
- package/payload/starter/_basic/min/data-table.min.js +1 -1
- package/payload/starter/_basic/min/date-picker.min.js +2 -0
- package/payload/starter/_basic/min/dialog.min.js +1 -1
- package/payload/starter/_basic/min/email-field.min.js +2 -0
- package/payload/starter/_basic/min/file-picker.min.js +2 -0
- package/payload/starter/_basic/min/filters.min.js +1 -1
- package/payload/starter/_basic/min/form.min.js +1 -1
- package/payload/starter/_basic/min/full-screen-select.min.js +1 -1
- package/payload/starter/_basic/min/gauge.min.js +1 -1
- package/payload/starter/_basic/min/graph-box.min.js +2 -0
- package/payload/starter/_basic/min/grid-group.min.js +2 -0
- package/payload/starter/_basic/min/hold-to-confirm-button.min.js +1 -1
- package/payload/starter/_basic/min/image-view.min.js +2 -0
- package/payload/starter/_basic/min/item-list.min.js +1 -1
- package/payload/starter/_basic/min/json-editor.min.js +2 -0
- package/payload/starter/_basic/min/json-view.min.js +2 -0
- package/payload/starter/_basic/min/label-editor.min.js +1 -1
- package/payload/starter/_basic/min/left-menu.min.js +1 -1
- package/payload/starter/_basic/min/line-progress-bar.min.js +1 -1
- package/payload/starter/_basic/min/loading-screen.min.js +1 -1
- package/payload/starter/_basic/min/log-view.min.js +2 -0
- package/payload/starter/_basic/min/login-page.min.js +2 -0
- package/payload/starter/_basic/min/markdown-view.min.js +2 -0
- package/payload/starter/_basic/min/menu-bar.min.js +2 -0
- package/payload/starter/_basic/min/mini-graph-box.min.js +1 -1
- package/payload/starter/_basic/min/minimal-accent.min.js +2 -0
- package/payload/starter/_basic/min/notice.min.js +1 -1
- package/payload/starter/_basic/min/number-field.min.js +2 -0
- package/payload/starter/_basic/min/numeric-keyboard.min.js +1 -1
- package/payload/starter/_basic/min/page-control.min.js +1 -1
- package/payload/starter/_basic/min/password-field.min.js +2 -0
- package/payload/starter/_basic/min/phone-field.min.js +2 -0
- package/payload/starter/_basic/min/progress-bar.min.js +1 -1
- package/payload/starter/_basic/min/property-panel.min.js +1 -1
- package/payload/starter/_basic/min/radio-button.min.js +1 -1
- package/payload/starter/_basic/min/range-slider.min.js +2 -0
- package/payload/starter/_basic/min/rich-text-editor.min.js +1 -1
- package/payload/starter/_basic/min/scroll-area.min.js +2 -0
- package/payload/starter/_basic/min/scrolling-text.min.js +1 -1
- package/payload/starter/_basic/min/search-input.min.js +2 -0
- package/payload/starter/_basic/min/search-results.min.js +1 -1
- package/payload/starter/_basic/min/select-box.min.js +1 -1
- package/payload/starter/_basic/min/settings-row.min.js +1 -1
- package/payload/starter/_basic/min/side-panel.min.js +1 -1
- package/payload/starter/_basic/min/slider-field.min.js +1 -1
- package/payload/starter/_basic/min/slider.min.js +1 -1
- package/payload/starter/_basic/min/smart-button.min.js +1 -1
- package/payload/starter/_basic/min/smart-table.min.js +1 -1
- package/payload/starter/_basic/min/sortable-list.min.js +1 -1
- package/payload/starter/_basic/min/spark-line-box.min.js +1 -1
- package/payload/starter/_basic/min/splitter.min.js +2 -0
- package/payload/starter/_basic/min/status-bar.min.js +2 -0
- package/payload/starter/_basic/min/step-bar.min.js +2 -0
- package/payload/starter/_basic/min/stepper.min.js +1 -1
- package/payload/starter/_basic/min/tabs.min.js +1 -1
- package/payload/starter/_basic/min/tag-input.min.js +1 -1
- package/payload/starter/_basic/min/text-area-field.min.js +2 -0
- package/payload/starter/_basic/min/text-field.min.js +2 -0
- package/payload/starter/_basic/min/time-line.min.js +1 -1
- package/payload/starter/_basic/min/time-picker.min.js +2 -0
- package/payload/starter/_basic/min/tiny-select.min.js +1 -1
- package/payload/starter/_basic/min/toast.min.js +1 -1
- package/payload/starter/_basic/min/toggle.min.js +1 -1
- package/payload/starter/_basic/min/tool-bar.min.js +2 -0
- package/payload/starter/_basic/min/tooltip.min.js +1 -1
- package/payload/starter/_basic/min/tree-view.min.js +1 -1
- package/payload/starter/_basic/min/ui-effects.min.js +1 -1
- package/payload/starter/_basic/min/url-field.min.js +2 -0
- package/payload/starter/_basic/min/web-view.min.js +1 -1
- package/payload/templates/booking/app/app.js +11 -8
- package/payload/templates/booking/app/settings.js +4 -4
- package/payload/templates/booking/index.htm +3 -3
- package/payload/templates/booking/pages/account.js +6 -6
- package/payload/templates/booking/pages/book.js +1 -1
- package/payload/templates/booking/pages/services.js +5 -4
- package/payload/templates/classic/app/app.js +15 -11
- package/payload/templates/classic/app/settings.js +22 -20
- package/payload/templates/classic/assets/_attribute.txt +2 -0
- package/payload/templates/classic/assets/cards/dill.png +0 -0
- package/payload/templates/classic/assets/cards/fennel.png +0 -0
- package/payload/templates/classic/assets/cards/juniper.png +0 -0
- package/payload/templates/classic/assets/cards/olives.png +0 -0
- package/payload/templates/classic/assets/cards/oregano.png +0 -0
- package/payload/templates/classic/assets/cards/pepper.png +0 -0
- package/payload/templates/classic/assets/cards/rosehip.png +0 -0
- package/payload/templates/classic/assets/categories/cappuccino.png +0 -0
- package/payload/templates/classic/assets/categories/chocolate-milk.png +0 -0
- package/payload/templates/classic/assets/categories/coffee.png +0 -0
- package/payload/templates/classic/assets/categories/frappe.png +0 -0
- package/payload/templates/classic/assets/categories/iced-caffee.png +0 -0
- package/payload/templates/classic/assets/categories/milkshake.png +0 -0
- package/payload/templates/classic/assets/categories/orange-juice.png +0 -0
- package/payload/templates/classic/assets/categories/tea.png +0 -0
- package/payload/templates/classic/index.htm +2 -2
- package/payload/templates/classic/pages/example.js +10 -10
- package/payload/templates/classic/pages/examples.js +44 -43
- package/payload/templates/classic/pages/home.js +16 -15
- package/payload/templates/classic/pages/info-pages.js +5 -5
- package/payload/templates/classic/pages/search.js +8 -7
- package/payload/templates/classic/pages/settings.js +13 -13
- package/payload/templates/classic/pages/tasks.js +1 -0
- package/payload/templates/classic/pages/template-pages.js +12 -11
- package/payload/templates/coffee-shop/app/app.js +12 -8
- package/payload/templates/coffee-shop/app/settings.js +4 -4
- package/payload/templates/coffee-shop/index.htm +3 -3
- package/payload/templates/coffee-shop/pages/drink.js +1 -1
- package/payload/templates/coffee-shop/pages/menu.js +5 -4
- package/payload/templates/forms/TEMPLATE.md +1 -1
- package/payload/templates/forms/appointment-form.htm +55 -53
- package/payload/templates/forms/contact-form-to-mail.htm +38 -37
- package/payload/templates/forms/contact-form-to-supabase.htm +47 -46
- package/payload/templates/forms/dark-contact-form.htm +43 -40
- package/payload/templates/forms/event-registration-form.htm +80 -77
- package/payload/templates/forms/feedback-form.htm +54 -54
- package/payload/templates/forms/order-form.htm +88 -84
- package/payload/templates/forms/recruitment-form.htm +60 -60
- package/payload/templates/forms/service/readme.md +9 -8
- package/payload/templates/forms/service/send-form-mail.php +38 -21
- package/payload/templates/forms/support-ticket-form.htm +67 -65
- package/payload/templates/panel/common/module-page.js +2 -2
- package/payload/templates/panel/common/theme.js +37 -10
- package/payload/templates/panel/common/top-bar.js +45 -40
- package/payload/templates/panel/index.htm +59 -60
- package/payload/templates/panel/module10/greenhouse.htm +98 -113
- package/payload/templates/panel/module11/arduino-projects.htm +47 -58
- package/payload/templates/panel/module6/energy-hub.htm +71 -103
- package/payload/templates/panel/module7/3d-printers.htm +58 -81
- package/payload/templates/panel/module8/cold-rooms.htm +58 -79
- package/payload/templates/panel/module9/elevator-fleet.htm +72 -93
- package/payload/templates/panel/pages/activity.js +134 -152
- package/payload/templates/panel/pages/contents.js +291 -308
- package/payload/templates/panel/pages/customers.js +250 -267
- package/payload/templates/panel/pages/edit-user.js +31 -30
- package/payload/templates/panel/pages/home.js +39 -70
- package/payload/templates/panel/pages/media.js +166 -183
- package/payload/templates/panel/pages/notifications.js +7 -7
- package/payload/templates/panel/pages/orders.js +200 -217
- package/payload/templates/panel/pages/products.js +259 -278
- package/payload/templates/panel/pages/reports.js +74 -123
- package/payload/templates/panel/pages/roles.js +57 -60
- package/payload/templates/panel/pages/settings.js +127 -143
- package/payload/templates/panel/pages/user-actions.js +106 -110
- package/payload/templates/panel/pages/user-list.js +221 -238
- package/payload/templates/panel/pages/users.js +14 -29
- package/payload/templates/shop/TEMPLATE.md +1 -1
- package/payload/templates/shop/app/app.js +11 -8
- package/payload/templates/shop/app/settings.js +4 -4
- package/payload/templates/shop/index.htm +3 -3
- package/payload/templates/shop/pages/account.js +7 -7
- package/payload/templates/shop/pages/cart.js +1 -1
- package/payload/templates/shop/pages/checkout.js +2 -2
- package/payload/templates/shop/pages/product.js +2 -2
- package/payload/templates/shop/pages/shop.js +6 -5
- package/payload/templates/starter/TEMPLATE.md +1 -1
- package/payload/templates/starter/app/app.js +12 -8
- package/payload/templates/starter/app/settings.js +14 -11
- package/payload/templates/starter/index.htm +3 -3
- package/payload/templates/starter/pages/about.js +1 -1
- package/payload/templates/starter/pages/home.js +2 -2
- package/payload/templates/starter/pages/product.js +1 -1
- package/payload/templates/starter/pages/products.js +5 -5
- package/payload/templates/starter/pages/settings.js +1 -1
- package/payload/templates/starter/pages/tasks.js +8 -8
- package/payload/templates/starter/pages/website.js +1 -1
- package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +0 -13
- package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +0 -9
- package/payload/starter/_basic/comp/chart-box.js +0 -868
- package/payload/starter/_basic/comp/email-input-b.js +0 -57
- package/payload/starter/_basic/comp/input-b.js +0 -759
- package/payload/starter/_basic/comp/password-input-b.js +0 -164
- package/payload/starter/_basic/comp/search-input-v2.js +0 -427
- package/payload/starter/_basic/comp/textarea-b.js +0 -184
- package/payload/starter/_basic/comp/url-input-b.js +0 -145
- package/payload/starter/_basic/examples/badgeV2.htm +0 -68
- package/payload/starter/_basic/examples/chart-box.htm +0 -287
- package/payload/starter/_basic/examples/check-box-1.htm +0 -220
- package/payload/starter/_basic/examples/currency-input-b.htm +0 -71
- package/payload/starter/_basic/examples/email-input-b.htm +0 -67
- package/payload/starter/_basic/examples/input-b-ex1.htm +0 -132
- package/payload/starter/_basic/examples/input-b-ex2.htm +0 -136
- package/payload/starter/_basic/examples/input-b-ex3-style.htm +0 -113
- package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +0 -112
- package/payload/starter/_basic/examples/input-b-ex6-dark.htm +0 -108
- package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +0 -153
- package/payload/starter/_basic/examples/number-input-b.htm +0 -68
- package/payload/starter/_basic/examples/password-input-b.htm +0 -70
- package/payload/starter/_basic/examples/phone-input-b-select-country.htm +0 -298
- package/payload/starter/_basic/examples/phone-input-b.htm +0 -72
- package/payload/starter/_basic/examples/radio-button-1.htm +0 -264
- package/payload/starter/_basic/examples/search-input-v2-ozden.htm +0 -128
- package/payload/starter/_basic/examples/search-input-v2.htm +0 -65
- package/payload/starter/_basic/examples/select-color.htm +0 -215
- package/payload/starter/_basic/examples/select-date.htm +0 -244
- package/payload/starter/_basic/examples/select-file.htm +0 -268
- package/payload/starter/_basic/examples/select-time.htm +0 -249
- package/payload/starter/_basic/examples/smart-button-2.htm +0 -220
- package/payload/starter/_basic/examples/textarea-b.htm +0 -76
- package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +0 -221
- package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +0 -221
- package/payload/starter/_basic/examples/url-input-b.htm +0 -85
- package/payload/starter/_basic/min/badge-v2.min.js +0 -2
- package/payload/starter/_basic/min/chart-box.min.js +0 -2
- package/payload/starter/_basic/min/currency-input-b.min.js +0 -2
- package/payload/starter/_basic/min/email-input-b.min.js +0 -2
- package/payload/starter/_basic/min/input-b.min.js +0 -2
- package/payload/starter/_basic/min/login-page-v2.min.js +0 -2
- package/payload/starter/_basic/min/number-input-b.min.js +0 -2
- package/payload/starter/_basic/min/password-input-b.min.js +0 -2
- package/payload/starter/_basic/min/phone-input-b.min.js +0 -2
- package/payload/starter/_basic/min/search-input-v2.min.js +0 -2
- package/payload/starter/_basic/min/select-color.min.js +0 -2
- package/payload/starter/_basic/min/select-date.min.js +0 -2
- package/payload/starter/_basic/min/select-file.min.js +0 -2
- package/payload/starter/_basic/min/select-time.min.js +0 -2
- package/payload/starter/_basic/min/textarea-b.min.js +0 -2
- package/payload/starter/_basic/min/url-input-b.min.js +0 -2
- package/payload/templates/panel/common/bridge.min.js +0 -0
- package/payload/templates/panel/common/full-view.min.js +0 -1
- package/payload/templates/panel/common/main-view.min.js +0 -1
- package/payload/templates/panel/common/module-page.min.js +0 -1
- package/payload/templates/panel/common/right-view.min.js +0 -1
- package/payload/templates/panel/common/start-page.min.js +0 -1
- package/payload/templates/panel/common/top-bar-v25-07-29-1.js +0 -330
- package/payload/templates/panel/common/top-bar-v25-07-29-2.js +0 -265
- package/payload/templates/panel/common/top-bar.min.js +0 -1
- package/payload/templates/panel/common/ui-standards.min.js +0 -1
- package/payload/templates/panel/managers/database.min.js +0 -1
- package/payload/templates/panel/managers/login.min.js +0 -1
- package/payload/templates/panel/pages/_page-template.min.js +0 -1
- package/payload/templates/panel/pages/contents.min.js +0 -1
- package/payload/templates/panel/pages/edit-user.min.js +0 -1
- package/payload/templates/panel/pages/edit-users-table.min.js +0 -1
- package/payload/templates/panel/pages/home.min.js +0 -1
- package/payload/templates/panel/pages/notifications.min.js +0 -1
- package/payload/templates/panel/pages/reports.min.js +0 -1
- package/payload/templates/panel/pages/settings.min.js +0 -1
- package/payload/templates/panel/pages/user-actions.min.js +0 -2
- package/payload/templates/panel/pages/users.min.js +0 -1
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/hide-btn.png +0 -0
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/hide-btn2.png +0 -0
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/show-btn.png +0 -0
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/show-btn2.png +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/clear-round.svg +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/clear.svg +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/filter.png +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/filter.svg +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/search.svg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* Bismillah */
|
|
2
|
-
"use strict";const ProgressBarDefaults={key:"0",width:320,height:"auto",value:0,secondValue:0,max:100,stripes:0,secondStripes:0,limits:[],indeterminate:0,status:"normal",titleText:"",valuePosition:"top",valueFormat:function(e){return Math.round(e.getPercent())+"%"},onChange:function(e){},onComplete:function(e){},styleName:"classic",style:{layout:{gap:6},track:{height:16,color:"#F2F2F2",round:4,border:2,borderColor:"rgba(0, 0, 0, 0.1)",css:{}},bar:{color:"#141414",fillOpacity:1,border:0,borderColor:"",motion:.3},secondBar:{color:Black(.35),fillOpacity:.2,borderOpacity:.45},stripes:{color:"rgba(255, 255, 255, 0.35)",size:14,speed:.8},limit:{color:"indianred",width:1,round:0,overhang:6,textSize:13,textColor:Black(.7),textSpace:6},successBar:{color:"#2E9E5B"},errorBar:{color:"#D64545"},title:{fontSize:14,textColor:Black(.8)},valueText:{fontSize:14,textColor:Black(.55)},indeterminate:{barWidth:35,duration:1.4}}},ProgressBar=function(e={}){basic.applyStylePackage(e,ProgressBar.styles,ProgressBarDefaults),mergeIntoIfMissing(e,ProgressBarDefaults),e.color="transparent";let t=startObject(e),r=null;const o=function(e){return e=Number(e),isNaN(e)&&(e=0),Math.min(Math.max(e,0),t.max)},a=function(){return"width "+t.style.bar.motion+"s, background-color 0.2s"},s=function(){t.bar.setMotionNow("none"),t.secondBar.setMotionNow("none"),m(),t.bar.elem.offsetWidth,t.bar.setMotionNow(a()),t.secondBar.setMotionNow(a())},i=function(e){return e=Number(e),(isNaN(e)||e<0)&&(e=0),Math.min(e,Math.max(0,t.max-t.value))},n=function(e){return t.max>0?e/t.max*100:0},l=function(e,r,o,a){e.color=o<1?Alpha(r,o):r,t.style.bar.border&&(e.borderColor=a)},c=function(e,r){ProgressBar.injectCss();const o=t.style.stripes;e.elem.classList.toggle("progress-bar-stripes",!!r),e.elem.style.setProperty("--progress-stripe-color",o.color),e.elem.style.setProperty("--progress-stripe-size",o.size+"px"),e.elem.style.setProperty("--progress-stripe-speed",o.speed+"s")},u=function(){t.limitLines.forEach(function(e){e.remove()}),t.limitLines=[];const e=t.style.limit,r=t.style.track.height+2*e.overhang;createIn(t.trackArea,function(){t.limits.forEach(function(o){const a="object"==typeof o&&null!==o?o:{value:o},s=Number(a.value);if(isNaN(s))return;const i=n(Math.min(Math.max(s,0),t.max))+"%",l=Box({top:0,width:e.width,height:r,color:a.color||e.color,round:e.round});if(l.css={left:"calc("+i+" - "+e.width/2+"px)"},t.limitLines.push(l),void 0===a.text||""===a.text)return;const c=Label({top:r+e.textSpace,fontSize:e.textSize,textColor:a.color||e.textColor});c.plainText=a.text,c.css={left:i,transform:"translateX(-50%)",whiteSpace:"nowrap"},t.limitLines.push(c)})}),d()},d=function(){const e=t.style.track,r=t.style.limit,o=t.limits.length>0,a=t.limits.some(function(e){return e&&"object"==typeof e&&void 0!==e.text&&""!==e.text}),s=o?r.overhang:0;t.trackArea.height=e.height+2*s+(a?r.textSpace+Math.ceil(1.4*r.textSize):0),t.track.top=s,t.barLayer.top=s,p(s,a)},p=function(e,r){if(!t.valueLabel||"right"!==t.valuePosition)return;if(!r)return void(t.valueLabel.css={alignSelf:"",marginTop:""});const o=1.36*t.style.valueText.fontSize;t.valueLabel.css={alignSelf:"flex-start",marginTop:Math.round(e+(t.style.track.height-o)/2)+"px"}},b=function(){return"success"===t.status?t.style.successBar.color:"error"===t.status?t.style.errorBar.color:t.style.bar.color},m=function(){!function(){const e=t.style.bar,r=t.style.secondBar,o=b();l(t.bar,o,Number(e.fillOpacity),e.borderColor||o),r.color?l(t.secondBar,r.color,1,e.borderColor||o):l(t.secondBar,o,Number(r.fillOpacity),e.borderColor||Alpha(o,Number(r.borderOpacity)))}(),1==t.indeterminate?(t.bar.visible=1,t.bar.width=t.style.indeterminate.barWidth+"%",t.secondBar.visible=0,function(){if(r||!t.bar.elem.animate)return;const e=Math.ceil(100/t.style.indeterminate.barWidth*100);r=t.bar.elem.animate([{transform:"translateX(-100%)"},{transform:"translateX("+e+"%)"}],{duration:1e3*t.style.indeterminate.duration,iterations:1/0,easing:"ease-in-out"})}(),t.aria={valuenow:null}):(r&&(r.cancel(),r=null),t.bar.width=t.getPercent()+"%",t.bar.visible=t.value>0?1:0,t.secondValue=i(t.secondValue),t.secondBar.width=n(t.value+t.secondValue)+"%",t.secondBar.visible=t.secondValue>0?1:0,t.aria={valuenow:String(t.value)}),t.valueLabel&&(t.valueLabel.text=1==t.indeterminate?"":t.valueFormat(t)),t.aria={valuemax:String(t.max)}};t.getPercent=function(){return t.max>0?t.value/t.max*100:0},t.setValue=function(e,r=0){if(e=o(e),t.value==e&&1!=t.indeterminate)return;const a=t.value>=t.max;t.value=e,1==t.indeterminate?(t.indeterminate=0,s()):m(),r||(t.onChange(t),!a&&t.value>=t.max&&t.onComplete(t))},t.setSecondValue=function(e){t.secondValue=i(e),m()},t.setValues=function(e,r,o=0){t.secondValue=0,t.setValue(e,o),t.setSecondValue(r)},t.setStripes=function(e){t.stripes=basic.isOn(e)?1:0,c(t.bar,t.stripes)},t.setSecondStripes=function(e){t.secondStripes=basic.isOn(e)?1:0,c(t.secondBar,t.secondStripes)},t.setLimits=function(e){t.limits=Array.isArray(e)?e.slice():[],u()},t.addValue=function(e=1){t.setValue(t.value+e)},t.setMax=function(e){e=Number(e),t.max=isNaN(e)||e<0?0:e,t.value=o(t.value),m(),u()},t.setIndeterminate=function(e){t.indeterminate=basic.isOn(e)?1:0,s()},t.setStatus=function(e){t.status="success"===e||"error"===e?e:"normal",m()},t.setTitleText=function(e){t.titleText=e,t.titleLabel.text=e,t.titleLabel.visible=e?1:0,g()},t.reset=function(){t.indeterminate=0,t.status="normal",t.value=0,t.secondValue=0,s()},t.refresh=function(){m()},t.role="progressbar",t.aria={valuemin:"0"},t.contentBox=VGroup({width:"100%",height:"auto",align:"left top",gap:t.style.layout.gap,position:"relative"}),t.topRow=HGroup({width:"100%",height:"auto",align:"left center",gap:10}),t.titleLabel=Label(t.style.title),t.titleLabel.text=t.titleText,t.titleLabel.css={flex:"1 1 auto",minWidth:"0"},t.titleLabel.ellipsis=1,t.titleText||(t.titleLabel.visible=0),"top"===t.valuePosition&&(t.valueLabel=Label(t.style.valueText),t.valueLabel.css={marginLeft:"auto",whiteSpace:"nowrap"}),endGroup(),t.barRow=HGroup({width:"100%",height:"auto",align:"left center",gap:10}),t.trackArea=startBox({width:"auto",height:t.style.track.height,color:"transparent"}),t.trackArea.clipContent=0,t.trackArea.css={flex:"1 1 0",minWidth:"0",position:"relative"},t.track=startBox({left:0,top:0,width:"100%",height:t.style.track.height,color:t.style.track.color,round:t.style.track.round,border:t.style.track.border,borderColor:t.style.track.borderColor}),t.track.css=t.style.track.css||{},endBox(),t.barLayer=startBox({left:0,top:0,width:"100%",height:t.style.track.height,color:"transparent",round:t.style.track.round}),t.barLayer.clipContent=1,t.secondBar=Box({left:0,top:0,width:"0%",height:"100%",color:t.style.secondBar.color,round:t.style.track.round,border:t.style.bar.border,borderColor:t.style.bar.borderColor}),t.bar=Box({left:0,top:0,width:"0%",height:"100%",color:b(),round:t.style.track.round,border:t.style.bar.border,borderColor:t.style.bar.borderColor}),endBox(),endBox(),"right"===t.valuePosition&&(t.valueLabel=Label(t.style.valueText),t.valueLabel.css={whiteSpace:"nowrap",minWidth:"3em"},t.valueLabel.textAlign="right"),endGroup(),endGroup();const g=function(){t.topRow.visible=t.titleText||"top"===t.valuePosition?1:0};return t.max=Number(t.max)>=0?Number(t.max):100,t.value=o(t.value),t.indeterminate=basic.isOn(t.indeterminate)?1:0,t.status="success"===t.status||"error"===t.status?t.status:"normal",t.limits=Array.isArray(t.limits)?t.limits.slice():[],t.limitLines=[],g(),m(),u(),c(t.bar,1==t.stripes),c(t.secondBar,1==t.secondStripes),t.bar.setMotion(a()),t.secondBar.setMotion(a()),endObject(t)};ProgressBar.styles={classic:ProgressBarDefaults.style,ozden:{layout:{gap:8},bar:{color:"#F1C74A",fillOpacity:.5,border:2,borderColor:"",motion:.3},secondBar:{color:"",fillOpacity:.2,borderOpacity:.45},stripes:{color:"rgba(255, 255, 255, 0.55)",size:14,speed:.8},successBar:{color:"#40A5AF"},errorBar:{color:"#FE5D49"},limit:{color:"rgba(0, 0, 0, 0.7)",width:4,round:2,overhang:4,textSize:14,textColor:"rgba(0, 0, 0, 0.7)",textSpace:8},title:{fontSize:15,textColor:"#232323"},valueText:{fontSize:14,textColor:"rgba(35, 35, 35, 0.6)"}},modern:{layout:{gap:8},track:{height:10,color:"#DFECEC",round:100,border:0,borderColor:"transparent"},bar:{color:"cadetblue",motion:.3},successBar:{color:"#6FCF97"},errorBar:{color:"tomato"},title:{fontSize:16,textColor:Black(.85)},valueText:{fontSize:14,textColor:"cadetblue"},indeterminate:{barWidth:35,duration:1.4}}},ProgressBar.injectCss=function(){basic.addCss("progress-bar-css",".progress-bar-stripes { background-image: linear-gradient(45deg, var(--progress-stripe-color) 25%, transparent 25%, transparent 50%, var(--progress-stripe-color) 50%, var(--progress-stripe-color) 75%, transparent 75%, transparent); background-size: var(--progress-stripe-size) var(--progress-stripe-size); animation: progress-bar-stripes var(--progress-stripe-speed) linear infinite; }@keyframes progress-bar-stripes { to { background-position: var(--progress-stripe-size) 0; } }@media (prefers-reduced-motion: reduce) { .progress-bar-stripes { animation: none; } }")};
|
|
2
|
+
"use strict";const ProgressBarDefaults={key:"0",width:320,height:"auto",value:0,secondValue:0,maxValue:100,stripes:0,secondStripes:0,limits:[],darkTrack:0,indeterminate:0,status:"normal",titleText:"",allowHtml:0,valuePosition:"top",valueFormat:function(e){return Math.round(e.getPercent())+"%"},onChange:function(e){},onComplete:function(e){},styleName:"light",style:{layout:{gap:6},track:{height:16,color:"#F2F2F2",round:4,border:2,borderColor:"rgba(0, 0, 0, 0.1)",css:{}},darkTrack:{color:"#242424",borderColor:White(.4),limitColor:White(.7)},bar:{color:"#141414",fillOpacity:1,border:0,borderColor:"",boxShadow:"none",innerRound:"",joinEdge:1,motion:.3},secondBar:{color:Black(.35),fillOpacity:.2,lighten:0,borderOpacity:.45},stripes:{color:"rgba(255, 255, 255, 0.35)",size:14,speed:.8},limit:{shape:"line",color:"indianred",width:1,round:0,overhang:6,dotSize:6,dotOpacity:1,barColor:"white",secondBarColor:"",textSize:13,textColor:Black(.7),textSpace:6},successBar:{color:"#2E9E5B"},errorBar:{color:"#D64545"},title:{fontSize:14,textColor:Black(.8)},valueText:{fontSize:14,textColor:Black(.55)},indeterminate:{barWidth:35,duration:1.4}}},ProgressBar=function(e={}){basic.applyStylePackage(e,ProgressBar.styles,ProgressBarDefaults),mergeIntoIfMissing(e,ProgressBarDefaults),e.color="transparent";let t=startObject(e),r=null;const o=function(e,r){const o=null==r?"":String(r);1==t.allowHtml?e.text=o:e.plainText=o},a=function(e){return e=Number(e),isNaN(e)&&(e=0),Math.min(Math.max(e,0),t.maxValue)},i=function(){return"width "+t.style.bar.motion+"s, background-color 0.2s"},n=function(){t.bar.setMotionNow("none"),t.secondBar.setMotionNow("none"),M(),t.bar.elem.offsetWidth,t.bar.setMotionNow(i()),t.secondBar.setMotionNow(i())},l=function(e){return e=Number(e),(isNaN(e)||e<0)&&(e=0),Math.min(e,Math.max(0,t.maxValue-t.value))},s=function(e){return t.maxValue>0?e/t.maxValue*100:0},c=function(e,r,o,a){e.color=o<1?Alpha(r,o):r,t.style.bar.border&&(e.borderColor=a)},u=function(e){const r=t.style.bar,o=t.style.secondBar;o.color?c(t.secondBar,o.color,1,r.borderColor||e):Number(o.lighten)>0?c(t.secondBar,d(e,Number(o.lighten)),1,r.borderColor||e):c(t.secondBar,e,Number(o.fillOpacity),r.borderColor||Alpha(e,Number(o.borderOpacity)))},d=function(e,t){return"color-mix(in srgb, "+e+" "+Math.round(100*(1-t))+"%, white)"},b=function(){const e=1==t.darkTrack?t.style.darkTrack:t.style.track;t.track.color=e.color,t.track.borderColor=e.borderColor},p=function(){const e=1!=t.indeterminate&&t.value>0&&t.secondValue>0&&0==t.style.bar.joinEdge;t.bar.css={borderRightWidth:(e?0:t.style.bar.border)+"px"}},h=function(e,r,o){const a=(r?t.style.track.round:m())+"px",i=(o?t.style.track.round:m())+"px";e.css={borderRadius:a+" "+i+" "+i+" "+a}},m=function(){const e=t.style.bar.innerRound;return""===e||null==e?t.style.track.round:Number(e)},f=function(e,r){ProgressBar.injectCss();const o=t.style.stripes;e.elem.classList.toggle("progress-bar-stripes",!!r),e.elem.style.setProperty("--progress-stripe-color",o.color),e.elem.style.setProperty("--progress-stripe-size",o.size+"px"),e.elem.style.setProperty("--progress-stripe-speed",o.speed+"s")},g=function(){t.limitLines.forEach(function(e){e.remove()}),t.limitDots.forEach(function(e){e.dot.remove()}),t.limitLines=[],t.limitDots=[],C()?y():x(),B(),V()},x=function(){const e=t.style.limit,r=t.style.track.height+2*e.overhang;createIn(t.trackArea,function(){v().forEach(function(o){const a=Box({top:0,width:e.width,height:r,color:o.color||e.color,round:e.round});a.css={left:"calc("+w(o)+" - "+e.width/2+"px)"},t.limitLines.push(a)})})},y=function(){const e={track:t.trackDots,second:t.secondDots,bar:t.barDots};Object.keys(e).forEach(function(r){const o="track"===r?0:t.style.bar.border;createIn(e[r],function(){v().forEach(function(e){t.limitDots.push({dot:k(e,o),part:r,limit:e})})})}),L()},k=function(e,r){const o=t.style.limit.dotSize,a=Box({top:(t.style.track.height-o)/2-r,width:o,height:o,round:o/2,opacity:t.style.limit.dotOpacity});return a.css={left:"calc("+S(e)+"cqw - "+(r+o/2)+"px)"},a},B=function(){const e=t.style.limit,r=t.style.track.height+2*z()+e.textSpace;createIn(t.trackArea,function(){v().forEach(function(o){if(void 0===o.text||""===o.text)return;const a=Label({top:r,fontSize:e.textSize,textColor:o.color||e.textColor});a.plainText=o.text,a.css={left:w(o),transform:"translateX(-50%)",whiteSpace:"nowrap"},t.limitLines.push(a)})})},C=function(){return"dot"===t.style.limit.shape},v=function(){return t.limits.map(function(e){return"object"==typeof e&&null!==e?e:{value:e}}).filter(function(e){return!isNaN(Number(e.value))})},S=function(e){return s(Math.min(Math.max(Number(e.value),0),t.maxValue))},w=function(e){return S(e)+"%"},z=function(){return t.limits.length>0&&!C()?t.style.limit.overhang:0},L=function(){t.limitDots.forEach(function(e){e.dot.color=O(e.part,e.limit)})},O=function(e,r){const o=t.style.limit;return"bar"===e?o.barColor:"second"===e?o.secondBarColor||P():r.color?r.color:1==t.darkTrack?t.style.darkTrack.limitColor:o.color},T=function(){return Box({left:0,top:0,width:"100%",height:"100%",color:"transparent"})},V=function(){const e=t.style.track,r=t.style.limit,o=t.limits.some(function(e){return e&&"object"==typeof e&&void 0!==e.text&&""!==e.text}),a=z();t.trackArea.height=e.height+2*a+(o?r.textSpace+Math.ceil(1.4*r.textSize):0),t.track.top=a,t.barLayer.top=a,D(a,o)},D=function(e,r){if(!t.valueLabel||"right"!==t.valuePosition)return;if(!r)return void(t.valueLabel.css={alignSelf:"",marginTop:""});const o=1.36*t.style.valueText.fontSize;t.valueLabel.css={alignSelf:"flex-start",marginTop:Math.round(e+(t.style.track.height-o)/2)+"px"}},P=function(){return"success"===t.status?t.style.successBar.color:"error"===t.status?t.style.errorBar.color:t.style.bar.color},M=function(){!function(){const e=t.style.bar,r=P();c(t.bar,r,Number(e.fillOpacity),e.borderColor||r),u(r),t.bar.boxShadow=e.boxShadow,t.secondBar.boxShadow=e.boxShadow}(),1==t.indeterminate?(t.bar.visible=1,t.bar.width=t.style.indeterminate.barWidth+"%",t.secondBar.visible=0,t.barDots.visible=0,function(){if(r||!t.bar.elem.animate)return;const e=Math.ceil(100/t.style.indeterminate.barWidth*100);r=t.bar.elem.animate([{transform:"translateX(-100%)"},{transform:"translateX("+e+"%)"}],{duration:1e3*t.style.indeterminate.duration,iterations:1/0,easing:"ease-in-out"})}(),t.aria={valuenow:null}):(r&&(r.cancel(),r=null),t.bar.width=t.getPercent()+"%",t.bar.visible=t.value>0?1:0,t.barDots.visible=1,t.secondValue=l(t.secondValue),t.secondBar.width=s(t.value+t.secondValue)+"%",t.secondBar.visible=t.secondValue>0?1:0,t.aria={valuenow:String(t.value)}),function(){const e=1==t.indeterminate||t.value>=t.maxValue,r=t.value+t.secondValue>=t.maxValue;h(t.bar,1,e),h(t.secondBar,1,r),p()}(),L(),t.valueLabel&&o(t.valueLabel,1==t.indeterminate?"":t.valueFormat(t)),t.aria={valuemax:String(t.maxValue)}};t.getPercent=function(){return t.maxValue>0?t.value/t.maxValue*100:0},t.setValue=function(e,r=0){if(e=a(e),t.value==e&&1!=t.indeterminate)return;const o=t.value>=t.maxValue;t.value=e,1==t.indeterminate?(t.indeterminate=0,n()):M(),r||(t.onChange(t),!o&&t.value>=t.maxValue&&t.onComplete(t))},t.setSecondValue=function(e){t.secondValue=l(e),M()},t.setValues=function(e,r,o=0){t.secondValue=0,t.setValue(e,o),t.setSecondValue(r)},t.setStripes=function(e){t.stripes=basic.isOn(e)?1:0,f(t.bar,t.stripes)},t.setSecondStripes=function(e){t.secondStripes=basic.isOn(e)?1:0,f(t.secondBar,t.secondStripes)},t.setDarkTrack=function(e){t.darkTrack=basic.isOn(e)?1:0,b(),L()},t.setLimits=function(e){t.limits=Array.isArray(e)?e.slice():[],g()},t.addValue=function(e=1){t.setValue(t.value+e)},t.setMaxValue=function(e){e=Number(e),t.maxValue=isNaN(e)||e<0?0:e,t.value=a(t.value),M(),g()},t.setIndeterminate=function(e){t.indeterminate=basic.isOn(e)?1:0,n()},t.setStatus=function(e){t.status="success"===e||"error"===e?e:"normal",M()},t.setTitleText=function(e){t.titleText=e,o(t.titleLabel,e),t.titleLabel.visible=e?1:0,N()},t.reset=function(){t.indeterminate=0,t.status="normal",t.value=0,t.secondValue=0,n()},t.refresh=function(){b(),M()},t.role="progressbar",t.aria={valuemin:"0"},t.contentBox=VGroup({width:"100%",height:"auto",align:"left top",gap:t.style.layout.gap,position:"relative"}),t.topRow=HGroup({width:"100%",height:"auto",align:"left center",gap:10}),t.titleLabel=Label(t.style.title),o(t.titleLabel,t.titleText),t.titleLabel.css={flex:"1 1 auto",minWidth:"0"},t.titleLabel.ellipsis=1,t.titleText||(t.titleLabel.visible=0),"top"===t.valuePosition&&(t.valueLabel=Label(t.style.valueText),t.valueLabel.css={marginLeft:"auto",whiteSpace:"nowrap"}),endGroup(),t.barRow=HGroup({width:"100%",height:"auto",align:"left center",gap:10}),t.trackArea=startBox({width:"auto",height:t.style.track.height,color:"transparent"}),t.trackArea.clipContent=0,t.trackArea.css={flex:"1 1 0",minWidth:"0",position:"relative"},t.track=startBox({left:0,top:0,width:"100%",height:t.style.track.height,color:t.style.track.color,round:t.style.track.round,border:t.style.track.border,borderColor:t.style.track.borderColor}),t.track.css=t.style.track.css||{},endBox(),t.barLayer=startBox({left:0,top:0,width:"100%",height:t.style.track.height,color:"transparent",round:t.style.track.round}),t.barLayer.clipContent=1,t.barLayer.css={containerType:"inline-size"},t.trackDots=T(),t.secondBar=startBox({left:0,top:0,width:"0%",height:"100%",color:t.style.secondBar.color,round:t.style.track.round,border:t.style.bar.border,borderColor:t.style.bar.borderColor}),t.secondDots=T(),endBox(),t.bar=startBox({left:0,top:0,width:"0%",height:"100%",color:P(),round:t.style.track.round,border:t.style.bar.border,borderColor:t.style.bar.borderColor}),t.barDots=T(),endBox(),endBox(),endBox(),"right"===t.valuePosition&&(t.valueLabel=Label(t.style.valueText),t.valueLabel.css={whiteSpace:"nowrap",minWidth:"3em"},t.valueLabel.textAlign="right"),endGroup(),endGroup();const N=function(){t.topRow.visible=t.titleText||"top"===t.valuePosition?1:0};return t.maxValue=Number(t.maxValue)>=0?Number(t.maxValue):100,t.value=a(t.value),t.indeterminate=basic.isOn(t.indeterminate)?1:0,t.status="success"===t.status||"error"===t.status?t.status:"normal",t.limits=Array.isArray(t.limits)?t.limits.slice():[],t.limitLines=[],t.limitDots=[],t.darkTrack=basic.isOn(t.darkTrack)?1:0,N(),b(),M(),g(),f(t.bar,1==t.stripes),f(t.secondBar,1==t.secondStripes),t.bar.setMotion(i()),t.secondBar.setMotion(i()),endObject(t)};ProgressBar.styles={light:{layout:{gap:6},track:{height:10,color:"#E6E7E3",round:100,border:0,borderColor:"transparent"},darkTrack:{color:"#2E2E2D",borderColor:"transparent",limitColor:White(.7)},bar:{color:"#3D7A6B",fillOpacity:1,border:0,borderColor:"",boxShadow:"none",innerRound:"",joinEdge:1,motion:.3},secondBar:{color:"",fillOpacity:.35,lighten:0,borderOpacity:.45},stripes:{color:"rgba(255, 255, 255, 0.35)",size:14,speed:.8},limit:{shape:"line",color:Black(.45),width:2,round:1,overhang:4,dotSize:6,dotOpacity:1,barColor:"white",secondBarColor:"",textSize:12,textColor:Black(.55),textSpace:6},successBar:{color:"#5DB36B"},errorBar:{color:"#D9534F"},title:{fontSize:14,textColor:Black(.88)},valueText:{fontSize:13,textColor:Black(.55)}},dark:{layout:{gap:6},track:{height:10,color:"#363635",round:100,border:0,borderColor:"transparent"},darkTrack:{color:"#111110",borderColor:White(.2),limitColor:White(.7)},bar:{color:"#65A293",fillOpacity:1,border:0,borderColor:"",boxShadow:"none",innerRound:"",joinEdge:1,motion:.3},secondBar:{color:"",fillOpacity:.35,lighten:0,borderOpacity:.45},stripes:{color:"rgba(255, 255, 255, 0.25)",size:14,speed:.8},limit:{shape:"line",color:White(.5),width:2,round:1,overhang:4,dotSize:6,dotOpacity:1,barColor:"#141414",secondBarColor:"",textSize:12,textColor:White(.55),textSpace:6},successBar:{color:"#7FCB8F"},errorBar:{color:"#FF7B72"},title:{fontSize:14,textColor:White(.9)},valueText:{fontSize:13,textColor:White(.55)}},ozden:{layout:{gap:8},track:{round:100},darkTrack:{color:Black(.85),borderColor:"transparent",limitColor:White(.7)},bar:{color:"#5BBAC1",fillOpacity:1,border:1,borderColor:"rgba(0, 0, 0, 0.35)",boxShadow:"inset 0 -2px 0 rgba(0, 0, 0, 0.25)",innerRound:0,joinEdge:0,motion:.3},secondBar:{color:"",lighten:.5},stripes:{color:"rgba(255, 255, 255, 0.55)",size:14,speed:.8},successBar:{color:"#7BC362"},errorBar:{color:"#DE815B"},limit:{shape:"dot",color:"rgba(0, 0, 0, 0.7)",dotSize:6,dotOpacity:.85,barColor:"white",secondBarColor:"",width:4,round:2,overhang:4,textSize:14,textColor:"rgba(0, 0, 0, 0.7)",textSpace:8},title:{fontSize:15,textColor:"#232323"},valueText:{fontSize:14,textColor:"rgba(35, 35, 35, 0.6)"}},ozdenDark:{layout:{gap:8},track:{color:"#2A2A29",borderColor:White(.18)},bar:{color:"#5BBAC1",fillOpacity:.5,border:2,borderColor:"",motion:.3},secondBar:{color:"",fillOpacity:.2,borderOpacity:.45},stripes:{color:White(.25),size:14,speed:.8},successBar:{color:"#40A5AF"},errorBar:{color:"#FE5D49"},limit:{color:White(.75),width:4,round:2,overhang:4,textSize:14,textColor:White(.75),textSpace:8},title:{fontSize:15,textColor:White(.88)},valueText:{fontSize:14,textColor:White(.6)}},modern:{layout:{gap:8},track:{height:10,color:"#DFECEC",round:100,border:0,borderColor:"transparent"},bar:{color:"cadetblue",motion:.3},successBar:{color:"#6FCF97"},errorBar:{color:"tomato"},title:{fontSize:16,textColor:Black(.85)},valueText:{fontSize:14,textColor:"cadetblue"},indeterminate:{barWidth:35,duration:1.4}}},ProgressBar.styles.classic=ProgressBar.styles.light,ProgressBar.injectCss=function(){basic.addCss("progress-bar-css",".progress-bar-stripes { background-image: linear-gradient(45deg, var(--progress-stripe-color) 25%, transparent 25%, transparent 50%, var(--progress-stripe-color) 50%, var(--progress-stripe-color) 75%, transparent 75%, transparent); background-size: var(--progress-stripe-size) var(--progress-stripe-size); animation: progress-bar-stripes var(--progress-stripe-speed) linear infinite; }@keyframes progress-bar-stripes { to { background-position: var(--progress-stripe-size) 0; } }@media (prefers-reduced-motion: reduce) { .progress-bar-stripes { animation: none; } }")},ProgressBar.createMinimalStyle=function(e){return{layout:{gap:6},track:{height:2,color:e.track,round:1,border:0,borderColor:"transparent"},darkTrack:{color:e.track,borderColor:"transparent",limitColor:e.ink},bar:{color:e.ink,fillOpacity:1,border:0,borderColor:"",boxShadow:"none",innerRound:"",joinEdge:0,motion:.3},secondBar:{color:e.softText,fillOpacity:1,lighten:0,borderOpacity:0},limit:{shape:"line",color:e.danger,width:1,overhang:4,textSize:11,textColor:e.softText},successBar:{color:e.ink},errorBar:{color:e.danger},title:{fontSize:12,textColor:e.text},valueText:{fontSize:12,textColor:e.softText}}},ProgressBar.MINIMAL_COLORS={ink:"#1F1F1F",track:Black(.12),text:Black(.85),softText:Black(.55),danger:"#C24A36"},ProgressBar.styles.minimal=ProgressBar.createMinimalStyle(ProgressBar.MINIMAL_COLORS),ProgressBar.MINIMAL_DARK_COLORS={ink:"#EDEDEB",track:White(.14),text:White(.88),softText:White(.55),danger:"#FF9F93"},ProgressBar.styles.minimalDark=ProgressBar.createMinimalStyle(ProgressBar.MINIMAL_DARK_COLORS);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* Bismillah */
|
|
2
|
-
"use strict";const PropertyPanelDefaults={key:"0",width:240,data:{},opened:1,onChange:function(t,e){},palettes:null,recentColorsKey:"",pickColor:null,style:{panel:{color:"#2C2C2C",dividerColor:"#444444",headerHeight:48,paddingLeft:16,paddingRight:8,motion:"0.25s"},grid:{columnWidth:88,iconColumnWidth:24,gap:8,rowGap:8,itemHeight:24},text:{color:"#FFFFFF",softColor:"#A5A5A5",disabledColor:"#6E6E6E",fontSize:12,captionSize:11,titleSize:13,sectionTitleSize:12},field:{color:"#383838",hoverBorderColor:"#4D4D4D",focusBorderColor:"#0C8CE9",round:5},segmented:{selectedColor:"#2C2C2C",selectedBorderColor:"#5C5C5C",hoverColor:"#434343"},button:{hoverColor:"#383838",activeColor:"#34435A",activeIconColor:"#7CC4F8",iconColor:"#E6E6E6"},accent:{color:"#0C8CE9"},menu:{color:"#1E1E1E",borderColor:"#3A3A3A",hoverColor:"#0C8CE9",textColor:"#FFFFFF",round:8,rowHeight:26,maxHeight:320,shadow:"0 8px 24px rgba(0, 0, 0, 0.45)"},constraints:{frameColor:"#555555"},alignGrid:{cellColor:"#6E6E6E",hoverColor:"#A5A5A5",selectedColor:"#0C8CE9"},textarea:{lineHeight:17,fontFamily:"opensans, sans-serif"},colorPicker:{width:240,padding:12,areaHeight:150,handleSize:12,sliderHeight:12,swatchSize:18,swatchGap:6,swatchesMaxHeight:126},empty:{iconSize:26,iconColor:"#A5A5A5",iconBoxColor:"#383838",iconBoxRound:16},swatch:{size:14,borderColor:"rgba(255, 255, 255, 0.25)",emptyColor:"#555555"},scrollBar:{bar_color:"#FFFFFF",bar_mouseOverColor:"#FFFFFF",bar_opacity:.25,bar_mouseOverOpacity:.5,neverHide:0,showDots:0}}},PropertyPanel=function(t={}){mergeIntoIfMissing(t,PropertyPanelDefaults);const e=t.style.panel;t.left="calc(100% - "+t.width+"px)",t.top=0,t.height="100%",t.color=e.color;const o=t.data;t.data={};const n=getDefaultContainerBox();setDefaultContainerBox(page);let r=startObject(t);const i=r.style,l=i.text,a=i.grid,c=Number(r.width)||PropertyPanelDefaults.width;let s={},u=[],h={},d=null,p=null;const f=2147482e3,g=function(t,e=16){if(!t)return"";if(0===String(t).trim().indexOf("<svg"))return t;const o=PropertyPanel.icons[t];return o?'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+e+'" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" style="display:block"><path d="'+o+'"/></svg>':basic.escapeHtml(t)},b=function(t){return"full"===t?c-e.paddingLeft-e.paddingRight:2==t?2*a.columnWidth+a.gap:a.columnWidth},x=function(t,e){return t?e:l.disabledColor},m=function(t,e={}){const o=Label({text:t,fontSize:e.fontSize||l.fontSize,textColor:e.textColor||l.color});return o.clickable=0,o.shrink=0,e.bold&&(o.bold=1),void 0!==e.height&&(o.height=e.height),e.flex?(o.grow=1,o.shrink=1,o.ellipsis=1,o.lineHeight=e.height||a.itemHeight,o.css={flexBasis:"0px",minWidth:"0px"}):(o.css={display:"flex",alignItems:"center",whiteSpace:"nowrap"},void 0!==e.width&&(o.width=e.width,o.css.justifyContent="center")),void 0!==e.plainText&&(o.plainText=e.plainText),o},v=function(t,e){t.boxShadow=e?"inset 0 0 0 1px "+e:"none"},y=function(t,e){t.on("mouseenter",function(){e(1)}),t.on("mouseleave",function(){e(0)})},w=function(t,e,o=[]){t.on("keydown",function(t,n){("Enter"===n.key||" "===n.key||o.indexOf(n.key)>-1)&&(n.preventDefault(),e())})},C=function(t,e){e.isFocus?v(t,i.field.focusBorderColor):e.isHover&&e.enabled?v(t,i.field.hoverBorderColor):v(t,"")},k=function(t){return(t||[]).map(function(t){return null!==t&&"object"==typeof t?{value:t.value,text:void 0!==t.text?t.text:String(t.value),icon:t.icon,hint:t.hint}:{value:t,text:String(t)}})},M=function(t){t.item&&"function"==typeof t.item.onChange&&t.item.onChange(t,r),r.onChange(t,r),u.slice().forEach(function(e){e(t,r)})},H=function(t,e){const o=at[t.type];return o&&o.normalize?o.normalize(e):e},S=function(t,e,o=0){e=H(t.item,e);const n=t.item.value;return PropertyPanel.isSameValue(n,e)?0:(t.item.value=e,o||M({kind:"value",key:t.item.key,value:PropertyPanel.copyValue(e),oldValue:n,item:t.item,sectionKey:t.sectionKey}),1)},z=function(t,e){M({kind:"action",key:t.item.key,value:e,oldValue:void 0,item:t.item,sectionKey:t.sectionKey})},E=function(){if(!p)return;const t=p;p=null,t.obj.remove(),t.onClose&&t.onClose()},F=function(t,e,o,n,r){const l=p&&p.opener===e;if(E(),l)return;if(!o.length)return;const a=t.elem.getBoundingClientRect(),c=Math.max(a.width,140),s=i.menu;createIn(page,function(){const t=VGroup({left:0,top:0,width:c,height:"auto",align:"left top",gap:0,color:s.color,round:s.round});t.boxShadow="0 0 0 1px "+s.borderColor+", "+s.shadow,t.zIndex=f,t.css={padding:"6px 0px",boxSizing:"border-box",maxHeight:s.maxHeight+"px",alignItems:"stretch"},t.scrollY=1,t.role="listbox",o.forEach(function(t){const e=PropertyPanel.isSameValue(t.value,n),o=HGroup({width:"100%",height:s.rowHeight,align:"left center",gap:0,color:"transparent"});o.shrink=0,o.cursor="pointer",o.role="option",o.aria={selected:e?"true":"false"},o.clickable=1,m(e?g("check",14):"",{width:28,height:s.rowHeight,textColor:s.textColor}),t.icon&&m(g(t.icon,16),{width:22,height:s.rowHeight,textColor:s.textColor}),m("",{flex:1,height:s.rowHeight,textColor:s.textColor,plainText:t.text}),endGroup(),y(o,function(t){o.color=t?s.hoverColor:"transparent"}),o.on("click",function(){E(),r(t.value)})}),endGroup(),function(t,e,o){const n=t.elem.offsetHeight;let r=e.bottom+4;r+n>window.innerHeight-8&&(r=Math.max(8,e.top-n-4)),t.left=Math.max(8,Math.min(e.left,window.innerWidth-o-8)),t.top=r}(t,a,c),p={obj:t,opener:e}})},B=function(t,e,o){const n={isHover:0,isFocus:0,enabled:0!=t.enabled},r=function(){C(c,n)},c=HGroup({width:e,height:a.itemHeight,align:"left center",gap:0,color:i.field.color,round:i.field.round});c.shrink=0,c.css={boxSizing:"border-box",transition:"box-shadow 0.12s"};const s=o?m(g(o,16),{width:t.prefixWidth||26,height:a.itemHeight,textColor:l.softColor}):null;s&&(s.css.paddingLeft="2px");const u=Input({width:10,height:a.itemHeight,minimal:1,fontSize:l.fontSize,textColor:l.color});u.grow=1,u.shrink=1,u.css.minWidth="0px";const h=u.inputElement;Object.assign(h.style,{width:"100%",height:"100%",boxSizing:"border-box",padding:s?"0px 4px 0px 2px":"0px 8px",backgroundColor:"transparent",border:"0px",color:l.color,fontSize:l.fontSize+"px"}),h.setAttribute("spellcheck","false"),h.setAttribute("aria-label",t.hint||t.label||t.prefix||t.key),endGroup(),y(c,function(t){n.isHover=t,r()}),h.addEventListener("focus",function(){n.isFocus=1,r()}),h.addEventListener("blur",function(){n.isFocus=0,r()});const d=function(t){n.enabled=!!t,h.disabled=!n.enabled,h.style.color=x(n.enabled,l.color),s&&(s.textColor=x(n.enabled,l.softColor)),r()};return d(n.enabled),{field:c,input:u,el:h,prefix:s,state:n,setEnabled:d}},V=function(t,e){const o=t.item,n=function(t){if(void 0!==t.precision&&"auto"!==t.precision)return Math.max(0,Number(t.precision)||0);const e=String(t.step||1);return e.indexOf(".")>-1?e.split(".")[1].length:0}(o),r=Math.abs(Number(o.step))||1,i=void 0!==o.min?Number(o.min):-1/0,l=void 0!==o.max?Number(o.max):1/0;let a=o.value,c=null;const{field:s,input:u,el:h,prefix:d,state:p,setEnabled:f}=B(o,e,o.icon||o.prefix),g=function(t){return null==t||""===t?o.autoText||"":"string"==typeof t?t:Number(t).toFixed(n)+(o.unit||"")},b=function(t){if("number"==typeof t)return t;if("string"!=typeof t||!o.textToNumber)return null;const e=Number(o.textToNumber(t));return isNaN(e)?null:e},x=function(t){const e=Math.pow(10,n);return Math.round(basic.clamp(t,i,l)*e)/e},m=function(t){if(t=String(t).trim(),o.autoText&&(""===t||t.toLowerCase()===String(o.autoText).toLowerCase()))return null;const e=/^-?\d*[.,]?\d+(px)?$/i.test(t);if(o.parseText&&!e)return o.parseText(t);const n=t.replace(",",".").match(/-?\d*\.?\d+/);return n?x(parseFloat(n[0])):void 0},v=function(e){void 0!==e&&(a=e),u.text=g(a),h.title="string"==typeof a?a:"",void 0!==e&&S(t,a)};h.addEventListener("focus",function(){u.select()}),h.addEventListener("blur",function(){u.text!==g(a)&&v(m(u.text))});const y=function(t){return t.shiftKey?10:1};if(h.addEventListener("keydown",function(t){"Enter"===t.key?(t.preventDefault(),h.blur()):"Escape"===t.key?(t.preventDefault(),u.text=g(a),h.blur()):"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),function(t){const e=b(m(u.text)),o=null===e?b(a):e;if(null===o&&"string"==typeof a)return;const n="ArrowUp"===t.key?1:-1;v(x((o||0)+n*r*y(t))),u.select()}(t))}),d){d.clickable=1,d.css.touchAction="none",d.on("pointerdown",function(t,e){if(!p.enabled||0!==e.button)return;e.preventDefault(),document.activeElement===h&&h.blur();const o=b(a);if(null!==o||"string"!=typeof a){c={id:e.pointerId,x:e.clientX,start:o||0};try{d.elem.setPointerCapture(e.pointerId)}catch(t){}}}),d.on("pointermove",function(t,e){if(!c||e.pointerId!==c.id)return;const o=Math.round(e.clientX-c.x),n=x(c.start+o*r*y(e));n!==a&&v(n)});const t=function(){c=null};d.on("pointerup",t),d.on("pointercancel",t)}const w=function(t){a=t,u.text=g(t),h.title="string"==typeof t?t:""},C=function(t){f(t),d&&(d.cursor=p.enabled?"ew-resize":"default")};return w(a),C(p.enabled),{field:s,setValue:w,setEnabled:C}},G=function(t,e,o){const n=k(t.options),r="plain"===t.look,c={isHover:0,isFocus:0,enabled:0!=t.enabled};let s=t.value;const u=HGroup({width:r?"auto":e,height:a.itemHeight,align:"left center",gap:0,color:r?"transparent":i.field.color,round:i.field.round});u.shrink=0,u.cursor="pointer",u.css={boxSizing:"border-box",outline:"none",paddingLeft:t.icon?"0px":"8px"},u.tabIndex=0,u.role="button",u.aria={haspopup:"listbox",label:t.hint||t.label||t.key||"Select"},u.clickable=1,t.icon&&m(g(t.icon,16),{width:28,height:a.itemHeight,textColor:l.softColor});const h=m("",{flex:!r,height:a.itemHeight}),d=m(g("chevronDown",12),{width:22,height:a.itemHeight,textColor:l.softColor});endGroup();const p=function(){r?u.color=c.isHover&&c.enabled?i.button.hoverColor:"transparent":C(u,c)},f=function(){c.enabled&&F(u,u,n,s,function(t){b(t),o(t)})};u.on("click",f),w(u,f,["ArrowDown"]),y(u,function(t){c.isHover=t,p()}),u.on("focus",function(){c.isFocus=!r,p()}),u.on("blur",function(){c.isFocus=0,p()});const b=function(t){s=t,h.plainText=function(t){const e=function(t,e){for(let o=0;o<t.length;o++)if(t[o].value===e)return t[o];return null}(n,t);return e?e.text:null==t?"":String(t)}(t)},v=function(t){c.enabled=!!t,h.textColor=x(c.enabled,l.color),d.textColor=x(c.enabled,l.softColor),u.cursor=c.enabled?"pointer":"default",u.tabIndex=c.enabled?0:-1,p()};return b(s),v(c.enabled),{field:u,setValue:b,setEnabled:v}},P=["left","center","right"],L=["top","center","bottom"],A=function(t){const e=String(t||"").trim().split(/\s+/);1===e.length&&e.push("center");return/^(top|bottom)$/.test(e[0])||/^(left|right)$/.test(e[1])?e[1]+" "+e[0]:e[0]+" "+e[1]},I=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i,T=/^(#|rgb|hsl)/i,D=/^color-mix\(in srgb,\s*(.+)\s+([\d.]+)%,\s*transparent\)$/i,R="repeating-conic-gradient(#BBBBBB 0% 25%, #FFFFFF 0% 50%) 0 0 / 6px 6px",O=function(t){O.context||(O.context=document.createElement("canvas").getContext("2d"));const e=O.context;e.fillStyle="#000000",e.fillStyle=String(t||"");const o=e.fillStyle;if(e.fillStyle="#FFFFFF",e.fillStyle=String(t||""),o!==e.fillStyle)return null;if("#"===o.charAt(0))return{r:parseInt(o.slice(1,3),16),g:parseInt(o.slice(3,5),16),b:parseInt(o.slice(5,7),16),a:1};const n=o.match(/[\d.]+/g);return{r:Number(n[0]),g:Number(n[1]),b:Number(n[2]),a:void 0!==n[3]?Number(n[3]):1}},j=function(t){return"#"+[t.r,t.g,t.b].map(function(t){return("0"+Math.round(t).toString(16)).slice(-2)}).join("").toUpperCase()},N=function(t){return Math.round(100*basic.clamp(t,0,1))/100},K=function(t){const e=String(null==t?"":t).trim();if(!e)return{base:"",alpha:1};const o=e.match(D);if(o)return{base:o[1].trim(),alpha:Number(o[2])/100};const n=O(e);return n&&T.test(e)?{base:j(n),alpha:n.a}:{base:e,alpha:n?n.a:1}},W=function(t,e){if((e=N(e))>=1)return t;const o=O(t);return o?"rgba("+o.r+", "+o.g+", "+o.b+", "+e+")":Alpha(t,e)},U=function(t){const e=t.r/255,o=t.g/255,n=t.b/255,r=Math.max(e,o,n),i=r-Math.min(e,o,n);let l=0;return i&&r===e?l=(o-n)/i%6:i&&r===o?l=(n-e)/i+2:i&&(l=(e-o)/i+4),{h:(60*l+360)%360,s:r?i/r:0,v:r}};let X=null,_="",$="hex";const J=["hex","rgb","hsl"];let Y=function(){if(!r.recentColorsKey)return[];const t=basic.storage.load(r.recentColorsKey);return Array.isArray(t)?t:[]}();const q=function(t){return t&&"object"==typeof t?t:{value:t,color:t,hint:t}},Q=function(t,e){const o=(e||!X?function(){const t="function"==typeof r.palettes?r.palettes(r):r.palettes;return X=Array.isArray(t)?t:[],X}():X).map(function(t){return Object.assign({},t,{colors:(t.colors||[]).map(q)})}),n=Array.isArray(t.presets)?t.presets.filter(function(t){return"|"!==t}):[];return n.length&&o.unshift({key:"__presets",name:"Presets",colors:n.map(q)}),o},Z=function(t,e){const o=K(e);if(!o.base)return"transparent";let n=o.base;return Q(t).forEach(function(t){t.colors.forEach(function(t){t.value===o.base&&t.color&&(n=t.color)})}),W(n,o.alpha)},tt=function(t,e){t.css.background="linear-gradient("+e+", "+e+"), "+R},et=function(t,o,n){return createIn(t,function(){const r=Box({width:1,height:14,color:e.dividerColor});r.shrink=0,r.clickable=0;const i=Input({width:46,height:a.itemHeight,minimal:1,fontSize:l.fontSize,textColor:l.color});i.shrink=0;const c=i.inputElement;return Object.assign(c.style,{width:"100%",height:"100%",boxSizing:"border-box",padding:"0px 8px 0px 6px",backgroundColor:"transparent",border:"0px",color:l.color,fontSize:l.fontSize+"px"}),c.setAttribute("spellcheck","false"),c.setAttribute("aria-label",n+" opacity (%)"),c.addEventListener("focus",function(){o.isFocus=1,C(t,o),i.select()}),c.addEventListener("blur",function(){o.isFocus=0,C(t,o)}),i})},ot=function(t,e){if("hex"===e||"#"!==t.charAt(0))return t;const o=O(t);if("rgb"===e)return o.r+", "+o.g+", "+o.b;const n=function(t){const e=t.r/255,o=t.g/255,n=t.b/255,r=Math.max(e,o,n),i=Math.min(e,o,n),l=(r+i)/2,a=r-i,c=a?a/(1-Math.abs(2*l-1)):0;return{h:Math.round(U(t).h),s:Math.round(100*c),l:Math.round(100*l)}}(o);return n.h+", "+n.s+"%, "+n.l+"%"},nt=/^\s*([\d.]+)%?\s*[, ]\s*([\d.]+)%?\s*[, ]\s*([\d.]+)%?\s*$/,rt=function(t,e,o,n="hex"){const r=K(o);t.text=ot(r.base,n),e.text=r.base?Math.round(100*r.alpha)+"%":""},it=function(t,e,o){const n=t.inputElement,r=e.inputElement,i=function(){return o.getFormat?o.getFormat():"hex"},l=function(t){const e=K(o.getValue());e.base&&!isNaN(t)?o.commit(W(e.base,basic.clamp(t,0,100)/100)):o.refresh()};n.addEventListener("blur",function(){const e=K(o.getValue()),n=String(t.text).trim();if(n===ot(e.base,i()))return;const r=function(t,e){const o=t.match(nt);if(!o||"hex"===e)return null;const n="rgb"===e?"rgb("+o[1]+", "+o[2]+", "+o[3]+")":"hsl("+o[1]+", "+o[2]+"%, "+o[3]+"%)",r=O(n);return r?j(r):null}(n,i());o.commit(r?W(r,e.alpha):function(t,e){return I.test(t)?W("#"+t.replace("#","").toUpperCase(),e):t}(n,e.alpha))}),n.addEventListener("keydown",function(t){"Enter"===t.key?(t.preventDefault(),n.blur()):"Escape"===t.key&&(t.preventDefault(),o.refresh(),n.blur())}),r.addEventListener("blur",function(){l(parseFloat(String(e.text).replace(",",".")))}),r.addEventListener("keydown",function(t){if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault();const n="ArrowUp"===t.key?1:-1,r=t.shiftKey?10:1;l(Math.round(Math.round(100*K(o.getValue()).alpha)+n*r)),e.select()}else"Enter"===t.key?(t.preventDefault(),r.blur()):"Escape"===t.key&&(t.preventDefault(),o.refresh(),r.blur())})},lt=function(t,e){const o=p&&p.opener===e.opener;if(E(),o)return;const n=i.colorPicker,c=i.menu,u=t.item,h=u.hint||u.label||u.key,d=n.width-2*n.padding,b="function"==typeof window.EyeDropper,x=b||"function"==typeof r.pickColor,v=d-(x?a.itemHeight+a.gap:0);let C=Q(u,1),k=0,H=null,S=[],z={h:0,s:0,v:0},F=1,V=null,G=null,P=null,L=null,A=null,I=null,T=null,D=null,q=null,ot=[];const nt=e.getValue(),lt=function(){return function(t){const e=function(e){const o=(e+t.h/60)%6;return Math.round(255*(t.v-t.v*t.s*Math.max(0,Math.min(o,4-o,1))))};return{r:e(5),g:e(3),b:e(1)}}(z)},at=function(){const t=K(e.getValue()),o=O(Z(u,t.base))||{r:0,g:0,b:0},n=U(o);0!==n.s&&0!==n.v||(n.h=z.h),z=n,F=t.base?t.alpha:1},ct=function(){e.commit(W(j(lt()),F)),ht()},st=function(t){e.commit(t),at(),ht()},ut=function(t,e){t.thumb.css.left=Math.round(e*(t.width-n.sliderHeight))+"px"},ht=function(){const t=lt(),o="rgb("+t.r+", "+t.g+", "+t.b+")";G.color="hsl("+Math.round(z.h)+", 100%, 50%)",P.css.left=Math.round(z.s*d-n.handleSize/2)+"px",P.css.top=Math.round((1-z.v)*n.areaHeight-n.handleSize/2)+"px",P.color=o,ut(L,z.h/360),L.thumb.color="hsl("+Math.round(z.h)+", 100%, 50%)",A.css.background="linear-gradient(to right, rgba("+t.r+", "+t.g+", "+t.b+", 0), "+o+"), "+R,ut(A,F),tt(A.thumb,"rgba("+t.r+", "+t.g+", "+t.b+", "+F+")"),L.aria={valuenow:Math.round(z.h)},A.aria={valuenow:Math.round(100*F)},G.aria={valuetext:"Saturation "+Math.round(100*z.s)+"%, brightness "+Math.round(100*z.v)+"%"},rt(I,T,e.getValue(),$),D.text=$.toUpperCase(),tt(q,Z(u,e.getValue())),dt()},dt=function(){const t=e.getValue();S.concat(ot).forEach(function(e){const o=PropertyPanel.isSameValue(e.value,t);e.obj.boxShadow=o?"0 0 0 2px "+c.color+", 0 0 0 3px "+i.accent.color:"inset 0 0 0 1px "+i.swatch.borderColor})},pt=function(t,e){const o=function(o){const n=t.elem.getBoundingClientRect();e(basic.clamp((o.clientX-n.left)/n.width,0,1),basic.clamp((o.clientY-n.top)/n.height,0,1))};t.elem.addEventListener("pointerdown",function(e){e.preventDefault(),t.elem.focus(),t.elem.setPointerCapture(e.pointerId),o(e);const n=function(t){o(t)},r=function(){t.elem.removeEventListener("pointermove",n),t.elem.removeEventListener("pointerup",r),t.elem.removeEventListener("pointercancel",r)};t.elem.addEventListener("pointermove",n),t.elem.addEventListener("pointerup",r),t.elem.addEventListener("pointercancel",r)})},ft=function(t,e){t.on("keydown",function(t,o){const n=e[o.key];n&&(o.preventDefault(),n(o.shiftKey?10:1),ct())})},gt=function(t,e){const o=startBox({width:v,height:n.sliderHeight,round:n.sliderHeight/2,color:"transparent"});return o.css={position:"relative",left:"0px",top:"0px"},o.clipContent=0,o.clickable=1,o.cursor="pointer",o.tabIndex=0,o.role="slider",o.aria={label:h+" "+t,valuemin:0,valuemax:e},o.setFocusRing(i.accent.color),o.thumb=Box({left:0,top:0,width:n.sliderHeight,height:n.sliderHeight,round:n.sliderHeight/2,color:"transparent"}),o.thumb.boxShadow="0 0 0 2px #FFFFFF, 0 0 0 3px rgba(0, 0, 0, 0.35)",o.thumb.clickable=0,endBox(),o.shrink=0,o},bt=function(t){const e=Box({width:n.swatchSize,height:n.swatchSize,round:4,color:"transparent"});return e.shrink=0,tt(e,t.color||t.value),e.clickable=1,e.cursor="pointer",e.role="button",e.tabIndex=0,e.aria={label:t.hint||t.value},e.elem.title=t.hint||t.value,e.css.transition="transform 0.1s",y(e,function(t){e.css.transform=t?"scale(1.12)":""}),e.on("click",function(){st(t.value)}),w(e,function(){st(t.value)}),{obj:e,value:t.value}},xt=function(){H&&H.remove();const t=C.find(function(t){return t.key===_})||C[0];H=createIn(V,function(){const e=VGroup({width:d,height:"auto",align:"left top",gap:6,color:"transparent"});return e.shrink=0,function(t){HGroup({width:d,height:a.itemHeight,align:"left center",gap:4,color:"transparent"});const e=HGroup({width:10,height:a.itemHeight,align:"left center",gap:2,padding:[6,0],round:i.field.round,color:"transparent"});e.grow=1,e.css={minWidth:"0px"},e.clickable=1,e.cursor="pointer",e.tabIndex=0,e.role="button",e.aria={label:"Color group: "+(t?t.name:"none"),expanded:k?"true":"false"},e.elem.title="Choose a color group",m("",{flex:1,height:a.itemHeight,bold:1,plainText:t?t.name:"No colors"}),m(g(k?"chevronUp":"chevronDown",14),{width:16,height:a.itemHeight,textColor:l.softColor}),endGroup(),y(e,function(t){e.color=t?i.button.hoverColor:"transparent"});const o=function(){k=k?0:1,xt()};if(e.on("click",o),w(e,o),t&&t.canAdd&&!k){const e=m(g("plus",14),{width:a.itemHeight,height:a.itemHeight,textColor:i.button.iconColor});e.round=i.field.round,e.clickable=1,e.cursor="pointer",e.tabIndex=0,e.role="button",e.aria={label:"Add this color to "+t.name},e.elem.title="Add this color to "+t.name,y(e,function(t){e.color=t?i.button.hoverColor:"transparent"}),e.on("click",function(){mt(t)}),w(e,function(){mt(t)})}endGroup()}(t),k?function(t){C.forEach(function(e){const o=e===t,n=HGroup({width:d,height:c.rowHeight,align:"left center",gap:0,round:i.field.round,color:"transparent"});n.shrink=0,n.clickable=1,n.cursor="pointer",n.tabIndex=0,n.role="option",n.aria={selected:o?"true":"false"},m(o?g("check",14):"",{width:24,height:c.rowHeight}),m("",{flex:1,height:c.rowHeight,plainText:e.name}),m("",{height:c.rowHeight,textColor:l.softColor,plainText:String(e.colors.length)}),endGroup(),n.css.paddingRight="6px";const r=function(){_=e.key,k=0,xt()};y(n,function(t){n.color=t?i.button.hoverColor:"transparent"}),n.on("click",r),w(n,r)})}(t):t&&function(t){if(S=[],!t.colors.length)return void(m("",{textColor:l.softColor,plainText:t.emptyText||"No colors yet."}).css={whiteSpace:"normal",lineHeight:"16px",padding:"2px 6px"});const e=HGroup({width:d,height:"auto",align:"left top",gap:n.swatchGap,wrap:1,color:"transparent"});e.css={maxHeight:n.swatchesMaxHeight+"px",padding:"3px",boxSizing:"border-box"},e.scrollY=1,t.colors.forEach(function(t){S.push(bt(t))}),endGroup()}(t),endGroup(),e}),dt(),yt()},mt=function(o){const n=e.getValue();if(!n)return;o.colors.some(function(t){return PropertyPanel.isSameValue(t.value,n)})||M({kind:"addColor",key:o.key,value:n,oldValue:void 0,item:u,sectionKey:t.sectionKey}),C=Q(u,1);const r=C.find(function(t){return t.key===o.key});if(r&&!r.colors.some(function(t){return PropertyPanel.isSameValue(t.value,n)})){const t=(X||[]).find(function(t){return t.key===o.key});t&&(t.colors=(t.colors||[]).concat([n]),C=Q(u))}xt()},vt=function(){const t=m("HEX",{width:34,height:a.itemHeight,fontSize:10,textColor:l.softColor});t.clickable=1,t.cursor="pointer",t.tabIndex=0,t.role="button",t.aria={label:"Color format (HEX, RGB, HSL)"},t.elem.title="Change the format: HEX, RGB, HSL";const e=function(){$=J[(J.indexOf($)+1)%J.length],ht()};return y(t,function(e){t.textColor=e?l.color:l.softColor}),t.on("click",e),w(t,e),t},yt=function(){const t=e.anchor.elem.getBoundingClientRect(),o=r.elem.getBoundingClientRect(),i=V.elem.offsetHeight;let l=o.left-n.width-8,a=t.top;l<8&&(l=Math.min(t.left,window.innerWidth-n.width-8),a=t.bottom+4),V.left=Math.max(8,l),V.top=Math.max(8,Math.min(a,window.innerHeight-i-8))};createIn(page,function(){V=VGroup({left:0,top:0,width:n.width,height:"auto",align:"left top",gap:10,padding:n.padding,color:c.color,round:c.round}),V.boxShadow="0 0 0 1px "+c.borderColor+", "+c.shadow,V.zIndex=f,V.css={boxSizing:"border-box"},V.clipContent=0,V.clickable=1,V.role="dialog",V.aria={label:h+" color"},HGroup({width:d,height:a.itemHeight,align:"left center",gap:4,color:"transparent"}),m("",{flex:1,bold:1,plainText:h});const t=m(g("close",14),{width:a.itemHeight,height:a.itemHeight,textColor:l.softColor});t.round=i.field.round,t.clickable=1,t.cursor="pointer",t.tabIndex=0,t.role="button",t.aria={label:"Close (Escape)"},t.elem.title="Close (Escape)",y(t,function(e){t.color=e?i.button.hoverColor:"transparent"}),t.on("click",E),w(t,E),endGroup(),G=startBox({width:d,height:n.areaHeight,round:4,color:"transparent"}),G.css={position:"relative",left:"0px",top:"0px",backgroundImage:"linear-gradient(to top, #000000, transparent), linear-gradient(to right, #FFFFFF, transparent)"},G.shrink=0,G.clipContent=0,G.clickable=1,G.cursor="crosshair",G.tabIndex=0,G.role="slider",G.aria={label:h+" saturation and brightness"},G.setFocusRing(i.accent.color),P=Box({left:0,top:0,width:n.handleSize,height:n.handleSize,round:n.handleSize/2,color:"transparent"}),P.boxShadow="0 0 0 2px #FFFFFF, 0 0 0 3px rgba(0, 0, 0, 0.35)",P.clickable=0,endBox();if(HGroup({width:d,height:"auto",align:"left center",gap:a.gap,color:"transparent"}).clipContent=0,x){const t=m(g("eyedropper",16),{width:a.itemHeight,height:a.itemHeight,textColor:i.button.iconColor});t.round=i.field.round,t.clickable=1,t.cursor="pointer",t.tabIndex=0,t.role="button";const e=b?"Pick a color from the screen":"Pick a color from the page";t.aria={label:e},t.elem.title=e,y(t,function(e){t.color=e?i.button.hoverColor:"transparent"});const o=function(){const t=u.key,e=F,o=s[t];E(),r.pickColor(r,function(n){r&&n&&s[t]===o&&r.setValue(t,W(String(n).toUpperCase(),e))})},n=function(){b?(new window.EyeDropper).open().then(function(t){V&&!V._isRemoved&&st(W(t.sRGBHex.toUpperCase(),F))}).catch(function(){}):o()};t.on("click",n),w(t,n)}VGroup({width:v,height:"auto",align:"left top",gap:10,color:"transparent"}).clipContent=0,L=gt("hue",360),L.css.background="linear-gradient(to right, #FF0000, #FFFF00, #00FF00, #00FFFF, #0000FF, #FF00FF, #FF0000)",A=gt("opacity",100),endGroup(),endGroup(),HGroup({width:d,height:a.itemHeight,align:"left center",gap:6,color:"transparent"}),function(){const t=HGroup({width:32,height:a.itemHeight,align:"left top",gap:0,round:i.field.round,color:"transparent"});t.shrink=0,t.boxShadow="inset 0 0 0 1px "+i.swatch.borderColor;const e=Box({width:16,height:a.itemHeight,color:"transparent"});tt(e,Z(u,nt)),e.clickable=1,e.cursor="pointer",e.role="button",e.tabIndex=0,e.aria={label:"Back to the color before: "+(nt||"none")},e.elem.title="Before: "+(nt||"none")+" (click to go back)",e.on("click",function(){st(nt)}),w(e,function(){st(nt)}),q=Box({width:16,height:a.itemHeight,color:"transparent"}),q.clickable=0,endGroup()}();const e=B({key:"hex",hint:h},d-32-6);e.el.style.paddingLeft="4px",I=e.input,T=et(e.field,e.state,h),D=createIn(e.field,vt),e.field.elem.insertBefore(D.elem,e.field.elem.firstChild),endGroup(),function(){if(!Y.length)return;m("",{fontSize:l.captionSize,textColor:l.softColor,plainText:"Recent"}).css.paddingLeft="6px";const t=HGroup({width:d,height:"auto",align:"left center",gap:n.swatchGap,color:"transparent"});t.css={padding:"3px",boxSizing:"border-box"},t.clipContent=0,ot=Y.map(function(t){return bt({value:t,color:Z(u,t),hint:t})}),endGroup()}();Box({width:d,height:1,color:c.borderColor}).shrink=0,endGroup()}),p={obj:V,opener:e.opener,ctrl:t,sync:function(){at(),ht()},onClose:function(){const t=e.getValue();t!==nt&&function(t){t&&(Y=[t].concat(Y.filter(function(e){return e!==t})).slice(0,9),r.recentColorsKey&&basic.storage.save(r.recentColorsKey,Y))}(t)}},pt(G,function(t,e){z.s=t,z.v=1-e,ct()}),pt(L,function(t){z.h=Math.min(360*t,359.9),ct()}),pt(A,function(t){F=N(t),ct()}),ft(G,{ArrowLeft:function(t){z.s=basic.clamp(z.s-t/100,0,1)},ArrowRight:function(t){z.s=basic.clamp(z.s+t/100,0,1)},ArrowUp:function(t){z.v=basic.clamp(z.v+t/100,0,1)},ArrowDown:function(t){z.v=basic.clamp(z.v-t/100,0,1)}}),ft(L,{ArrowLeft:function(t){z.h=basic.clamp(z.h-t,0,359.9)},ArrowRight:function(t){z.h=basic.clamp(z.h+t,0,359.9)}}),ft(A,{ArrowLeft:function(t){F=N(F-t/100)},ArrowRight:function(t){F=N(F+t/100)}}),it(I,T,{getValue:e.getValue,commit:st,refresh:ht,getFormat:function(){return $}}),at(),ht(),xt(),G.elem.focus({preventScroll:!0})},at={number:function(t){return V(t,b(t.item.span))},textarea:function(t){const e=t.item,o=i.textarea,n=e.rows||2,r={isHover:0,isFocus:0,enabled:0!=e.enabled},a=VGroup({width:b(e.span||"full"),height:"auto",align:"left top",gap:2,padding:[8,6],color:i.field.color,round:i.field.round});a.shrink=0,a.css={boxSizing:"border-box",transition:"box-shadow 0.12s",alignItems:"stretch"};const c=function(){C(a,r)};endGroup();const s=document.createElement("textarea");s.rows=n,s.spellcheck=!1;const u=[e.caption,e.placeholder].filter(Boolean);s.placeholder=u.join("\n"),s.setAttribute("aria-label",e.caption||e.hint||e.label||e.key),Object.assign(s.style,{width:"100%",boxSizing:"border-box",padding:"0px",border:"0px",outline:"none",resize:"none",background:"transparent",color:l.color,font:l.fontSize+"px "+o.fontFamily,lineHeight:o.lineHeight+"px",pointerEvents:"auto",userSelect:"text"}),a.elem.appendChild(s);const h=function(t){s.value=null==t?"":String(t)};return y(a,function(t){r.isHover=t,c()}),s.addEventListener("focus",function(){r.isFocus=1,c()}),s.addEventListener("blur",function(){r.isFocus=0,c(),S(t,s.value)}),s.addEventListener("keydown",function(e){e.stopPropagation();"Enter"===e.key&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),s.blur()):"Escape"===e.key&&(e.preventDefault(),h(t.item.value),s.blur())}),h(e.value),c(),{field:a,setValue:h,setEnabled:function(t){r.enabled=!!t,s.disabled=!r.enabled,c()}}},text:function(t){const e=t.item,{field:o,input:n,el:r,setEnabled:i}=B(e,b(e.span));e.placeholder&&(n.placeholder=e.placeholder);const l=function(t){n.text=null==t?"":String(t)};return r.addEventListener("blur",function(){S(t,String(n.text))}),r.addEventListener("keydown",function(e){"Enter"===e.key?(e.preventDefault(),r.blur()):"Escape"===e.key&&(e.preventDefault(),l(t.item.value),r.blur())}),l(e.value),{field:o,setValue:l,setEnabled:i}},select:function(t){return G(t.item,b(t.item.span),function(e){S(t,e)})},combo:function(t){const e=t.item,o=b(e.span),n=i.field.round+"px";let r=0!=e.enabled;const c=HGroup({width:o,height:a.itemHeight,align:"left center",gap:1,color:"transparent"});c.shrink=0;const s=V(t,o-22-1);s.field.css.borderRadius=n+" 0px 0px "+n;const u=m(g("chevronDown",12),{width:22,height:a.itemHeight,textColor:l.softColor});u.color=i.field.color,u.clickable=1,u.cursor="pointer",u.css.borderRadius="0px "+n+" "+n+" 0px",endGroup();const h=k(e.options);y(u,function(t){u.color=t&&r?i.segmented.hoverColor:i.field.color}),u.on("click",function(){r&&F(c,u,h,t.item.value,function(e){s.setValue(e),S(t,e)})});return{field:c,setValue:s.setValue,setEnabled:function(t){r=!!t,s.setEnabled(t),u.textColor=x(r,l.softColor)}}},segmented:function(t){const e=t.item,o=k(e.options),n=e.mode?"select"===e.mode:void 0!==e.value,r=i.field.round+"px";let c=e.value,s=0!=e.enabled;const u=[],h=function(t){const e=n&&PropertyPanel.isSameValue(t.option.value,c),o=t.seg;e?o.color=i.segmented.selectedColor:t.isHover&&s?o.color=i.segmented.hoverColor:o.color=n?"transparent":i.field.color,v(o,e?i.segmented.selectedBorderColor:""),o.textColor=x(s,n&&!e?l.softColor:i.button.iconColor),n&&(o.aria={checked:e?"true":"false"})},d=function(){u.forEach(h)},p=function(t){return n?r:0===t?r+" 0 0 "+r:t===o.length-1?"0 "+r+" "+r+" 0":"0"},f=HGroup({width:b(e.span),height:a.itemHeight,align:"left center",gap:n?0:1,color:n?i.field.color:"transparent",round:i.field.round});return f.shrink=0,f.role=n?"radiogroup":"group",f.aria={label:e.hint||e.label||e.key},o.forEach(function(e,o){const r=e.icon?g(e.icon,16):basic.escapeHtml(e.text),l=m(r,{width:10,height:a.itemHeight,textColor:i.button.iconColor});l.grow=1,l.shrink=1,l.cursor="pointer",l.clickable=1,l.css={flexBasis:"0px",outline:"none",transition:"background-color 0.12s",borderRadius:p(o)},l.tabIndex=0,l.role=n?"radio":"button",l.aria={label:e.hint||e.text},e.hint&&(l.elem.title=e.hint);const f={seg:l,option:e,isHover:0};u.push(f);const b=function(){s&&(n?(c=e.value,d(),S(t,c)):z(t,e.value))};y(l,function(t){f.isHover=t,h(f)}),l.on("click",b),w(l,b)}),endGroup(),d(),{field:f,setValue:function(t){c=t,d()},setEnabled:function(t){s=!!t,d()}}},iconButton:function(t){const e=t.item,o=basic.isOn(e.toggle),n=0!==e.accent,r={value:!!e.value,enabled:0!=e.enabled,isHover:0},l=m("",{width:a.iconColumnWidth,height:a.itemHeight,textColor:i.button.iconColor});l.round=i.field.round,l.clickable=1,l.cursor="pointer",l.css={outline:"none",transition:"background-color 0.12s"},l.tabIndex=0,l.role="button",l.aria={label:e.hint||e.key},e.hint&&(l.elem.title=e.hint);const c=function(){l.text=g(o&&r.value&&e.iconActive?e.iconActive:e.icon,16),o&&(l.aria={pressed:r.value?"true":"false"})},s=function(){const t=o&&r.value&&n;t?l.color=i.button.activeColor:r.isHover&&r.enabled?l.color=i.button.hoverColor:l.color="transparent",l.textColor=x(r.enabled,t?i.button.activeIconColor:i.button.iconColor)},u=function(){r.enabled&&(o?(r.value=!r.value,c(),s(),S(t,r.value)):z(t,e.value))};return y(l,function(t){r.isHover=t,s()}),l.on("click",u),w(l,u),c(),s(),{field:l,setValue:function(t){r.value=!!t,c(),s()},setEnabled:function(t){r.enabled=!!t,l.cursor=r.enabled?"pointer":"default",s()}}},alignGrid:function(t){const e=t.item,o=i.alignGrid,n=2*a.itemHeight+a.rowGap,r=Math.floor(n/3);let l=A(e.value),c=0!=e.enabled;const s=[],u=function(t){const e=t.align===l,n=t.isHover&&c?o.hoverColor:o.cellColor;t.mark.color=e?x(c,o.selectedColor):"transparent",v(t.mark,e?"":n),t.area.aria={checked:e?"true":"false"}},h=function(){s.forEach(u)},d=startBox({width:n,height:n,color:i.field.color,round:i.field.round});d.shrink=0,d.role="radiogroup",d.aria={label:e.hint||e.label||e.key};const p=Math.floor((n-3*r)/2);return L.forEach(function(e,o){P.forEach(function(n,i){const a=n+" "+e,d=startBox({left:p+i*r,top:p+o*r,width:r,height:r,color:"transparent"});d.clickable=1,d.cursor="pointer",d.tabIndex=0,d.role="radio",d.aria={label:a},d.css={outline:"none"},d.elem.title=a;const f=Box({width:8,height:8,color:"transparent",round:2});f.center(),f.css={transition:"background-color 0.12s"},endBox();const g={area:d,mark:f,align:a,isHover:0};s.push(g);const b=function(){c&&(l=a,h(),S(t,l))};y(d,function(t){g.isHover=t,u(g)}),d.on("click",b),w(d,b)})}),endBox(),h(),{field:d,setValue:function(t){l=A(t),h()},setEnabled:function(t){c=!!t,h()}}},color:function(t){const e=t.item,o=i.swatch,n=e.hint||e.label||e.key,{field:r,input:c,el:s,state:u,setEnabled:h}=B(e,b(e.span));e.placeholder&&(c.placeholder=e.placeholder),s.style.paddingLeft="4px";let d="";const f=createIn(r,function(){const t=startBox({width:o.size+12,height:a.itemHeight,color:"transparent"});return t.shrink=0,t.clickable=1,t.cursor="pointer",t.role="button",t.tabIndex=0,t.aria={label:"Open the color picker of "+n,haspopup:"dialog"},t.elem.title="Open the color picker",t.fill=Box({width:o.size,height:o.size,round:3,color:"transparent"}),t.fill.center(),t.fill.clickable=0,endBox(),t});r.elem.insertBefore(f.elem,r.elem.firstChild);const g=et(r,u,n),m=function(){const t=""===K(d).base;tt(f.fill,Z(e,d)),v(f.fill,t?o.emptyColor:o.borderColor),rt(c,g,d)},y=function(e){d=null==e?"":String(e),m(),p&&p.ctrl===t&&p.sync()},C=function(e){d=String(e),m(),S(t,d)},k={anchor:r,opener:f,getValue:function(){return d},commit:C},M=function(){u.enabled&<(t,k)};return f.on("click",M),w(f,M),it(c,g,{getValue:k.getValue,commit:C,refresh:m}),y(e.value),{field:r,setValue:y,setEnabled:function(t){h(t),g.inputElement.disabled=!t,g.inputElement.style.color=x(t,l.color),f.opacity=t?1:.5}}},constraints:function(t){const e=t.item;let o=e.value,n=0!=e.enabled;const r=a.columnWidth,c=2*a.itemHeight+a.rowGap,s=function(e){o=Object.assign({},o,e),z(),S(t,o)},u=HGroup({width:b(2),height:c,align:"left top",gap:a.gap,color:"transparent"});u.shrink=0,VGroup({width:r,height:c,align:"left top",gap:a.rowGap,color:"transparent"}),that.shrink=0;const h=G({key:e.key+"-h",hint:"Horizontal constraint",icon:"constraintH",options:[{value:"left",text:"Left"},{value:"right",text:"Right"},{value:"leftRight",text:"Left and right"},{value:"center",text:"Center"},{value:"scale",text:"Scale"}],value:o.horizontal},r,function(t){s({horizontal:t})}),d=G({key:e.key+"-v",hint:"Vertical constraint",icon:"constraintV",options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"topBottom",text:"Top and bottom"},{value:"center",text:"Center"},{value:"scale",text:"Scale"}],value:o.vertical},r,function(t){s({vertical:t})});endGroup();startBox({width:r,height:c,color:i.field.color,round:i.field.round}).shrink=0;const p=Math.round(r/2),f=Math.round(c/2),g=34,m=22,y=p-17,w=f-11,C=Box({left:y,top:w,width:g,height:m,color:"transparent",round:3});v(C,i.constraints.frameColor);const k=function(t,e,o,n){const r=Box({left:t,top:e,width:o,height:n,color:l.disabledColor,round:1});return r.clickable=0,r},M={top:k(p-1,w-13,2,9),bottom:k(p-1,w+m+4,2,9),left:k(y-17,f-1,13,2),right:k(y+g+4,f-1,13,2),centerH:k(p-6,f,12,1),centerV:k(p,f-6,1,12)},H=function(t,e,o,r,i){const l=Box({left:t,top:e,width:o,height:r,color:"transparent"});return l.clickable=1,l.cursor="pointer",l.on("click",function(t,e){n&&i(e.shiftKey)}),l};H(p-10,0,20,w-2,function(t){s({vertical:t&&"bottom"===o.vertical?"topBottom":"top"})}),H(p-10,w+m+2,20,c-w-m-2,function(t){s({vertical:t&&"top"===o.vertical?"topBottom":"bottom"})}),H(0,f-8,y-2,16,function(t){s({horizontal:t&&"right"===o.horizontal?"leftRight":"left"})}),H(y+g+2,f-8,r-y-g-2,16,function(t){s({horizontal:t&&"left"===o.horizontal?"leftRight":"right"})}),H(y+2,w+2,30,18,function(){s({horizontal:"center",vertical:"center"})}),endBox(),endGroup();const z=function(){const t=o.horizontal,e=o.vertical,r=function(t,e){t.color=e?x(n,i.accent.color):l.disabledColor};r(M.top,"top"===e||"topBottom"===e),r(M.bottom,"bottom"===e||"topBottom"===e),r(M.left,"left"===t||"leftRight"===t),r(M.right,"right"===t||"leftRight"===t),M.centerH.color="center"===t&&n?i.accent.color:l.softColor,M.centerV.color="center"===e&&n?i.accent.color:l.softColor,h.setValue(t),d.setValue(e)};return z(),{field:u,setValue:function(t){o=t,z()},setEnabled:function(t){n=!!t,h.setEnabled(t),d.setEnabled(t),z()}}}};at.constraints.normalize=function(t){return Object.assign({horizontal:"left",vertical:"top"},t||{})};const ct=function(t,e){const o=at[t.type];if(!o)return console.warn("PropertyPanel: Unknown item type: "+t.type),null;t.value=H(t,t.value);const n={item:t,sectionKey:e};return Object.assign(n,o(n)),void 0!==t.key&&(s[t.key]&&console.warn("PropertyPanel: Same key twice: "+t.key),s[t.key]=n),n},st=function(t){if(!t)return;const e=0===t.item.visible||!1===t.item.visible;(t.cell||t.field).visible=e?0:1},ut=function(t,o){const n=VGroup({width:"100%",height:"auto",align:"left top",gap:a.rowGap,color:"transparent"});n.shrink=0,n.css={padding:(o?"8px ":"12px ")+e.paddingRight+"px "+(o?"8px ":"16px ")+e.paddingLeft+"px",boxSizing:"border-box",borderBottom:"1px solid "+e.dividerColor};const r=o||!!t.title||t.actions&&t.actions.length>0?function(t,e,o,n){let r=null;return HGroup({width:"100%",height:n?32:24,align:"left center",gap:2,color:"transparent"}),r=m("",{fontSize:n?l.titleSize:l.sectionTitleSize,bold:1,flex:1,height:24,plainText:t||""}),(e||[]).forEach(function(t){st(ct(Object.assign({type:"iconButton",accent:0},t),o))}),endGroup(),r}(t.title,t.actions,t.key,o):null;return o&&(d=r),(t.items||[]).forEach(function(e){const o=Array.isArray(e)?e:[e],n=o.some(function(t){return!!t.label});HGroup({width:"100%",height:"auto",align:"left bottom",gap:a.gap,color:"transparent"}),o.forEach(function(e){!function(t,e,o){const n=VGroup({hug:1,align:"left top",gap:6,color:"transparent"});n.shrink=0,o&&(m("",{fontSize:l.captionSize,textColor:l.softColor,height:16,plainText:t.label||""}).css={width:"0px",minWidth:"100%"});const r=ct(t,e);endGroup(),r&&(r.cell=n,st(r))}(e,t.key,n)}),endGroup()}),endGroup(),0!==t.visible&&!1!==t.visible||(n.visible=0),n},ht=function(t){const e=t===r.data.activeTab,o=h[t];o.color=e?i.field.color:"transparent",o.textColor=e?l.color:l.softColor,o.bold=e,o.aria={selected:e?"true":"false"}},dt=function(){Object.keys(h).forEach(ht)},pt=function(){r.content&&r.content.remove(),d=null;const t=r.data;t.empty?r.content=createIn(r.scrollBox,function(){return ft(t.empty)}):createIn(r.scrollBox,function(){r.content=VGroup({left:0,top:0,width:"100%",height:"auto",align:"left top",gap:0,color:"transparent"}),(void 0!==t.title||t.titleActions&&t.titleActions.length)&&ut({key:"title",title:t.title,actions:t.titleActions},1),(t.sections||[]).forEach(function(t){ut(t,0)}),endGroup()})},ft=function(t){const o=i.empty,n=VGroup({left:0,top:0,width:"100%",height:"100%",align:"center center",gap:0,color:"transparent"});if(n.css={padding:"24px "+e.paddingRight+"px 72px "+e.paddingLeft+"px",boxSizing:"border-box"},t.icon){const e=m(g(t.icon,o.iconSize),{width:56,height:56,textColor:o.iconColor});e.color=o.iconBoxColor,e.round=o.iconBoxRound,e.css.marginBottom="16px"}if(t.title){const e=m("",{bold:1,fontSize:l.titleSize+1,plainText:t.title});e.role="heading",e.aria={level:2},e.css.marginBottom="6px"}if(t.text){const e=m("",{textColor:l.softColor,plainText:t.text});e.width=184,e.css={display:"block",whiteSpace:"normal",textAlign:"center",lineHeight:"18px"}}if(t.hints&&t.hints.length){VGroup({width:b("full"),height:"auto",align:"left top",gap:8,color:"transparent"}).css={marginTop:"20px",paddingTop:"16px",borderTop:"1px solid "+e.dividerColor},t.hints.forEach(function(t){HGroup({width:"100%",height:"auto",align:"left center",gap:8,color:"transparent"}),m("",{flex:1,height:20,fontSize:l.captionSize,textColor:l.softColor,plainText:t.text});const e=m("",{height:20,fontSize:l.captionSize,plainText:t.keys});e.color=i.field.color,e.round=4,e.css={padding:"0px 6px",minWidth:"20px",justifyContent:"center",boxSizing:"border-box"},endGroup()}),endGroup()}return endGroup(),n},gt=function(){const t=r.footerContent?r.footerBox.elem.offsetHeight:0;r.scrollBox.height="calc(100% - "+(e.headerHeight+t)+"px)"};r.setData=function(t){E(),X=null,s={},r.data=PropertyPanel.copyData(t||{}),function(){const t=r.data;r.headerRow&&r.headerRow.remove(),h={},createIn(r.header,function(){r.headerRow=HGroup({width:"100%",height:"100%",align:"left center",gap:2,color:"transparent"}),void 0!==t.headerTitle&&(r.lblHeaderTitle=m("",{flex:1,bold:1,fontSize:l.titleSize,plainText:t.headerTitle}),r.lblHeaderTitle.css.paddingLeft="6px"),(t.tabs||[]).forEach(function(e){const o=m("",{height:28,plainText:e.text||e.key});o.round=i.field.round,o.clickable=1,o.cursor="pointer",o.css={padding:"0px 10px",outline:"none"},o.tabIndex=0,o.role="tab",h[e.key]=o;const n=function(){r.setActiveTab(e.key)};o.on("click",n),w(o,n),y(o,function(n){n&&t.activeTab!==e.key?o.textColor=l.color:ht(e.key)})}),void 0===t.headerTitle&&(Box({width:10,height:1,color:"transparent"}).grow=1),t.headerItem&&(t.headerItem=Object.assign({type:"select",look:"plain"},t.headerItem),st(ct(t.headerItem,"header"))),endGroup()}),dt()}(),pt(),function(){r.footerContent&&r.footerContent.remove(),r.footerContent=null;const t=r.data.footer;r.footerBox.visible=t?1:0,t&&(r.footerContent=createIn(r.footerBox,function(){const o=ut(Object.assign({key:"footer"},t),0);return o.css.borderBottom="none",o.css.padding="10px "+e.paddingRight+"px 10px "+e.paddingLeft+"px",o})),gt()}()},r.getData=function(){return PropertyPanel.copyData(r.data)},r.getValues=function(){const t={};return Object.keys(s).forEach(function(e){const o=s[e].item.value;void 0!==o&&(t[e]=PropertyPanel.copyValue(o))}),t},r.getValue=function(t){const e=s[t];return e?PropertyPanel.copyValue(e.item.value):void 0},r.setValue=function(t,e,o=0){const n=s[t];if(!n)return console.warn("PropertyPanel: No item with the key: "+t),0;const r=H(n.item,PropertyPanel.copyValue(e));return PropertyPanel.isSameValue(n.item.value,r)||(n.setValue(PropertyPanel.copyValue(r)),S(n,r,o)),1},r.setValues=function(t,e=0){Object.keys(t||{}).forEach(function(o){r.setValue(o,t[o],e)})},r.setEnabled=function(t,e){const o=s[t];return o?(o.item.enabled=basic.isOn(e)?1:0,o.setEnabled(o.item.enabled),1):0},r.setItemVisible=function(t,e){const o=s[t];return o?(o.item.visible=basic.isOn(e)?1:0,st(o),1):0},r.getItem=function(t){const e=s[t];return e?e.item:null},r.setTitle=function(t){r.data.title=t,d?d.plainText=t||"":pt()},r.setActiveTab=function(t,e=0){const o=r.data.activeTab;r.data.activeTab=t,dt(),e||o===t||M({kind:"tab",key:t,value:t,oldValue:o,item:null,sectionKey:"header"})},r.listen=function(t){return u.push(t),function(){u=u.filter(function(e){return e!==t})}},r.open=function(){r.opened=1,r.css.transform="translateX(0px)",r.aria={hidden:"false"}},r.close=function(){E(),r.opened=0,r.css.transform="translateX(100%)",r.aria={hidden:"true"}},r.toggle=function(){basic.isOn(r.opened)?r.close():r.open()};const bt=r.remove;r.superRemove=bt,r.remove=function(){r&&(E(),bt.call(r),r=null)},r.boxShadow="inset 1px 0 0 "+e.dividerColor,r.css.transition="transform "+e.motion+" ease",r.role="complementary",r.aria={label:"Properties"},r.clickable=1,r.header=HGroup({left:0,top:0,width:"100%",height:e.headerHeight,align:"left center",gap:2,color:"transparent"}),r.header.css={padding:"0px "+e.paddingRight+"px 0px 10px",boxSizing:"border-box",borderBottom:"1px solid "+e.dividerColor},r.header.role="tablist",endGroup(),r.scrollBox=Box({left:0,top:e.headerHeight,width:"100%",height:"calc(100% - "+e.headerHeight+"px)",color:"transparent",scrollY:1}),r.footerBox=VGroup({left:0,width:"100%",height:"auto",align:"left top",gap:0,color:e.color}),r.footerBox.css={top:"auto",bottom:"0px",borderTop:"1px solid "+e.dividerColor,boxSizing:"border-box"},endGroup(),r.footerBox.visible=0,r.listenTo(document,"pointerdown",function(t,e){p&&(p.obj.elem.contains(e.target)||p.opener.elem.contains(e.target)||E())},!0),r.listenTo(document,"keydown",function(t,e){if(!p||"Escape"!==e.key)return;e.stopImmediatePropagation();const o=p.opener,n=p.obj.elem.contains(document.activeElement);E(),n&&o.elem.tabIndex>=0&&o.elem.focus()}),r.onPageResize(E),r.scrollBox.elem.addEventListener("scroll",E),r.footerBox.onResize(gt),r.setData(o),"undefined"!=typeof ScrollBar&&ScrollBar({scrollableBox:r.scrollBox,...i.scrollBar}),basic.isOn(r.opened)?r.open():r.close();const xt=endObject(r);return setDefaultContainerBox(n),xt};PropertyPanel.copyValue=function(t){return null!==t&&"object"==typeof t?JSON.parse(JSON.stringify(t)):t},PropertyPanel.isSameValue=function(t,e){return t===e||null!==t&&null!==e&&"object"==typeof t&&"object"==typeof e&&JSON.stringify(t)===JSON.stringify(e)},PropertyPanel.copyData=function(t){if(Array.isArray(t))return t.map(PropertyPanel.copyData);if(null!==t&&"object"==typeof t){const e={};return Object.keys(t).forEach(function(o){e[o]=PropertyPanel.copyData(t[o])}),e}return t},PropertyPanel.icons={alignLeft:"M2.5 2.5v11M5 5.5h8M5 10.5h5",alignCenterH:"M8 2v12M4 5.5h8M5.5 10.5h5",alignRight:"M13.5 2.5v11M3 5.5h8M6 10.5h5",alignTop:"M2.5 2.5h11M5.5 5v8M10.5 5v5",alignCenterV:"M2 8h12M5.5 4v8M10.5 5.5v5",alignBottom:"M2.5 13.5h11M5.5 3v8M10.5 6v5",frame:"M3 4.5h10v7H3zM6 8h4M8 6v4",component:"M5 2.5l1.5 1.5L5 5.5 3.5 4zM11 2.5l1.5 1.5L11 5.5 9.5 4zM5 10.5l1.5 1.5L5 13.5 3.5 12zM11 10.5l1.5 1.5-1.5 1.5L9.5 12z",link:"M7 9l2-2M6.5 5.5l1-1a2.5 2.5 0 013.5 3.5l-1 1M9.5 10.5l-1 1a2.5 2.5 0 01-3.5-3.5l1-1",target:"M8 2.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2.5 8h3M10.5 8h3M8 6.5a1.5 1.5 0 100 3 1.5 1.5 0 000-3z",more:"M3.5 7.2a.8.8 0 100 1.6.8.8 0 000-1.6zM8 7.2a.8.8 0 100 1.6.8.8 0 000-1.6zM12.5 7.2a.8.8 0 100 1.6.8.8 0 000-1.6z",constraintH:"M2.5 5v6M13.5 5v6M2.5 8h11",constraintV:"M5.5 2.5h5M5.5 13.5h5M8 2.5v11",angle:"M3 13h10M3 13V3M3 8.5A4.5 4.5 0 017.5 13",rotate:"M9.5 6.5l3 3-3 3-3-3zM3.5 9A5.5 5.5 0 0111 3.8M11 1.8v2.5H8.5",flipH:"M8 2v12M6 4.5L2.5 11.5H6zM10 4.5l3.5 7H10z",flipV:"M2 8h12M4.5 6l7-3.5V6zM4.5 10l7 3.5V10z",hugWidth:"M3 3v10M6 8h7M10.5 5.5L13 8l-2.5 2.5",fixedWidth:"M2.5 3v10M13.5 3v10M5.5 5.5h5M5.5 8h5M5.5 10.5h3",autoHeight:"M3.5 2.5h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1v-9a1 1 0 011-1zM5.5 5.5h5M5.5 8h5M5.5 10.5h3",clip:"M3.5 2.5h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1v-9a1 1 0 011-1zM9 13.5V9h4.5",eye:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8zM8 6a2 2 0 100 4 2 2 0 000-4z",eyeOff:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8zM8 6a2 2 0 100 4 2 2 0 000-4zM2.5 13.5l11-11",drop:"M8 2.5S4 7 4 9.5a4 4 0 008 0C12 7 8 2.5 8 2.5z",styles:"M5 3a2 2 0 100 4 2 2 0 000-4zM11 3a2 2 0 100 4 2 2 0 000-4zM5 9a2 2 0 100 4 2 2 0 000-4zM11 9a2 2 0 100 4 2 2 0 000-4z",opacity:"M3.5 2.5h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1v-9a1 1 0 011-1zM2.5 8h11M8 2.5v11",radius:"M2.5 6V4.5a2 2 0 012-2H6M10 2.5h1.5a2 2 0 012 2V6M13.5 10v1.5a2 2 0 01-2 2H10M6 13.5H4.5a2 2 0 01-2-2V10",textLeft:"M2.5 4h11M2.5 8h7M2.5 12h9",textCenter:"M2.5 4h11M4.5 8h7M3.5 12h9",textRight:"M2.5 4h11M6.5 8h7M4.5 12h9",textTop:"M3 2.5h10M8 13V6M5.5 8.5L8 6l2.5 2.5",textMiddle:"M3 8h10M8 2v3.5M6 3.5l2 2 2-2M8 14v-3.5M6 12.5l2-2 2 2",textBottom:"M3 13.5h10M8 3v7M5.5 7.5L8 10l2.5-2.5",lineHeight:"M3 2.5h10M3 13.5h10M5.5 11L8 5l2.5 6M6.4 9h3.2",letterSpacing:"M2.5 3v10M13.5 3v10M5.5 11L8 5l2.5 6M6.4 9h3.2",sliders:"M4 2.5v11M12 2.5v11M8 2.5v11M2.5 5.5h3M6.5 10.5h3M10.5 7h3",chevronDown:"M4.5 6.5L8 10l3.5-3.5",chevronUp:"M4.5 9.5L8 6l3.5 3.5",close:"M4 4l8 8M12 4l-8 8",pointer:"M4 2.5l8.5 5.2-3.7 1 2.1 3.9-1.7.9-2.1-3.9L4.3 12.2zM12 1.5v2M14.5 4h-2M13.8 2.2l-1.3 1.3",eyedropper:"M10.2 2.8a1.7 1.7 0 012.4 2.4l-1.4 1.4.7.7-1.1 1.1-3.3-3.3 1.1-1.1.7.7zM7.4 5.9L3 10.3V13h2.7l4.4-4.4",check:"M3.5 8.5l3 3 6-7",plus:"M8 3v10M3 8h10",minus:"M3 8h10",bold:"M5 3h3.8a2.4 2.4 0 0 1 0 4.8H5zM5 7.8h4.4a2.6 2.6 0 0 1 0 5.2H5z",italic:"M7 3h5M4 13h5M9.5 3l-3 10",flowHorizontal:"M2.5 8h11M10 4.5L13.5 8 10 11.5",flowVertical:"M8 2.5v11M4.5 10L8 13.5 11.5 10",wrap:"M2.5 4h11M2.5 8h9a2 2 0 0 1 0 4H8M9.5 10.5L8 12l1.5 1.5M2.5 12h3",ellipsis:"M2.5 8h.01M6 8h.01M9.5 8h.01M2.5 4.5h11M2.5 11.5h7"};
|
|
2
|
+
"use strict";const PropertyPanelDefaults={key:"0",width:240,data:{},opened:1,onChange:function(e,t){},palettes:null,recentColorsKey:"",pickColor:null,style:{panel:{color:"#1F1F1E",dividerColor:"#30302E",markWidth:3,markOpacity:.65,headerHeight:48,paddingLeft:16,paddingRight:8,motion:"0.25s"},grid:{columnWidth:88,iconColumnWidth:24,gap:8,rowGap:8,itemHeight:24},text:{color:"#EDEDEB",softColor:"#9A9A97",disabledColor:"#62625F",fontSize:12,captionSize:11,titleSize:13,sectionTitleSize:11},sectionTitle:{textColor:"#C9C9C6",uppercase:1,letterSpacing:.6},tab:{look:"underline"},field:{color:"#292928",borderColor:"#373735",hoverBorderColor:"#575755",focusBorderColor:"#65A293",round:7},segmented:{selectedColor:"#2E3D39",selectedBorderColor:"#4F7D71",hoverColor:"#333331"},button:{hoverColor:"#2E2E2D",activeColor:"#2E3D39",activeIconColor:"#8CC7B8",iconColor:"#D6D6D3"},accent:{color:"#65A293"},menu:{color:"#232322",borderColor:"#383836",hoverColor:"#333331",textColor:"#EDEDEB",round:10,rowHeight:26,maxHeight:320,shadow:"0 8px 24px rgba(0, 0, 0, 0.5)"},constraints:{frameColor:"#4A4A48"},alignGrid:{cellColor:"#62625F",hoverColor:"#9A9A97",selectedColor:"#65A293"},textarea:{lineHeight:17,fontFamily:"opensans, sans-serif"},colorPicker:{width:240,padding:12,areaHeight:150,handleSize:12,sliderHeight:12,swatchSize:18,swatchGap:5,swatchRoom:4,swatchesMaxHeight:126,quickSwatchSize:14,quickSwatchGap:5},empty:{iconSize:26,iconColor:"#9A9A97",iconBoxColor:"#292928",iconBoxRound:16},swatch:{size:14,borderColor:"rgba(255, 255, 255, 0.25)",emptyColor:"#575755"},scrollBar:{bar_color:"#FFFFFF",bar_mouseOverColor:"#FFFFFF",bar_opacity:.25,bar_mouseOverOpacity:.5,neverHide:0,showDots:0}}},PropertyPanel=function(e={}){mergeIntoIfMissing(e,PropertyPanelDefaults);const t=e.style.panel;e.left="calc(100% - "+e.width+"px)",e.top=0,e.height="100%",e.color=t.color;const o=e.data;e.data={};const n=getDefaultContainerBox();setDefaultContainerBox(page);let r=startObject(e);const i=r.style,l=i.text,c=i.grid,a=Number(r.width)||PropertyPanelDefaults.width;let s={},u=[],d={},p=null,h=null;const f=2147482e3,g=function(e,t=16){if(!e)return"";if(0===String(e).trim().indexOf("<svg"))return e;const o=PropertyPanel.icons[e];return o?'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+t+'" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" style="display:block"><path d="'+o+'"/></svg>':basic.escapeHtml(e)},b=function(e){return"full"===e?a-t.paddingLeft-t.paddingRight:"number"==typeof e&&e>=3?e:2==e?2*c.columnWidth+c.gap:c.columnWidth},m=function(e,t){return e?t:l.disabledColor},x=function(e,t={}){const o=Label({text:e,fontSize:t.fontSize||l.fontSize,textColor:t.textColor||l.color});return o.clickable=0,o.shrink=0,t.bold&&(o.bold=1),void 0!==t.height&&(o.height=t.height),t.flex?(o.grow=1,o.shrink=1,o.ellipsis=1,o.lineHeight=t.height||c.itemHeight,o.css={flexBasis:"0px",minWidth:"0px"}):(o.css={display:"flex",alignItems:"center",whiteSpace:"nowrap"},void 0!==t.width&&(o.width=t.width,o.css.justifyContent="center")),void 0!==t.plainText&&(o.plainText=t.plainText),o},v=function(e,t){e.boxShadow=t?"inset 0 0 0 1px "+t:"none"},w=function(e,t){e.on("mouseenter",function(){t(1)}),e.on("mouseleave",function(){t(0)})},y=function(e,t,o=[]){e.on("keydown",function(e,n){("Enter"===n.key||" "===n.key||o.indexOf(n.key)>-1)&&(n.preventDefault(),t())})},k=function(e,t){t.isFocus?v(e,i.field.focusBorderColor):t.isHover&&t.enabled?v(e,i.field.hoverBorderColor):v(e,i.field.borderColor||"")},C=function(e){return(e||[]).map(function(e){return null!==e&&"object"==typeof e?{value:e.value,text:void 0!==e.text?e.text:String(e.value),icon:e.icon,hint:e.hint}:{value:e,text:String(e)}})},M=function(e){e.item&&"function"==typeof e.item.onChange&&e.item.onChange(r,e),r.onChange(r,e),u.slice().forEach(function(t){t(r,e)})},H=function(e,t){const o=Le[e.type];return o&&o.normalize?o.normalize(t):t},S=function(e,t,o=0){t=H(e.item,t);const n=e.item.value;return PropertyPanel.isSameValue(n,t)?0:(e.item.value=t,o||M({kind:"value",key:e.item.key,value:PropertyPanel.copyValue(t),oldValue:n,item:e.item,sectionKey:e.sectionKey}),1)},E=function(e,t){M({kind:"action",key:e.item.key,value:t,oldValue:void 0,item:e.item,sectionKey:e.sectionKey})},z=function(e){M({kind:"action",key:e.item.key,value:"button",oldValue:void 0,item:e.item,sectionKey:e.sectionKey,field:e.field})},B=function(){if(!h)return;const e=h;h=null,e.obj.remove(),e.onClose&&e.onClose()},F=function(e,t,o){const n=e.elem.offsetHeight;let r=t.bottom+4;r+n>window.innerHeight-8&&(r=Math.max(8,t.top-n-4)),e.left=Math.max(8,Math.min(t.left,window.innerWidth-o-8)),e.top=r},V=function(e,t,o,n,r){const l=h&&h.opener===t;if(B(),l)return;if(!o.length)return;const c=e.elem.getBoundingClientRect(),a=Math.max(c.width,140),s=i.menu;createIn(page,function(){const e=VGroup({left:0,top:0,width:a,height:"auto",align:"left top",gap:0,color:s.color,round:s.round});e.boxShadow="0 0 0 1px "+s.borderColor+", "+s.shadow,e.zIndex=f,e.css={padding:"6px 0px",boxSizing:"border-box",maxHeight:s.maxHeight+"px",alignItems:"stretch"},e.scrollY=1,e.role="listbox",o.forEach(function(e){const t=PropertyPanel.isSameValue(e.value,n),o=HGroup({width:"100%",height:s.rowHeight,align:"left center",gap:0,color:"transparent"});o.shrink=0,o.cursor="pointer",o.role="option",o.aria={selected:t?"true":"false"},o.clickable=1,x(t?g("check",14):"",{width:28,height:s.rowHeight,textColor:s.textColor}),e.icon&&x(g(e.icon,16),{width:22,height:s.rowHeight,textColor:s.textColor}),x("",{flex:1,height:s.rowHeight,textColor:s.textColor,plainText:e.text}),endGroup(),w(o,function(e){o.color=e?s.hoverColor:"transparent"}),o.on("click",function(){B(),r(e.value)})}),endGroup(),F(e,c,a),h={obj:e,opener:t}})},G=function(e,t,o){const n={isHover:0,isFocus:0,enabled:0!=e.enabled},r=function(){k(a,n)},a=HGroup({width:t,height:c.itemHeight,align:"left center",gap:0,color:i.field.color,round:i.field.round});a.shrink=0,a.css={boxSizing:"border-box",transition:"box-shadow 0.12s"};const s=o?x(g(o,16),{width:e.prefixWidth||26,height:c.itemHeight,textColor:l.softColor}):null;s&&(s.css.paddingLeft="2px");const u=Input({width:10,height:c.itemHeight,minimal:1,fontSize:l.fontSize,textColor:l.color});u.grow=1,u.shrink=1,u.css.minWidth="0px";const d=u.inputElement;Object.assign(d.style,{width:"100%",height:"100%",boxSizing:"border-box",padding:s?"0px 4px 0px 2px":"0px 8px",backgroundColor:"transparent",border:"0px",color:l.color,fontSize:l.fontSize+"px"}),d.setAttribute("spellcheck","false"),d.setAttribute("aria-label",e.hint||e.label||e.prefix||e.key);let p=null;e.button&&(p=x(g(e.button.icon,14),{width:22,height:c.itemHeight,textColor:l.softColor}),p.clickable=1,p.css.borderRadius="0px "+i.field.round+"px "+i.field.round+"px 0px",p.role="button",p.aria={label:e.button.hint||""},p.elem.title=e.button.hint||""),endGroup(),w(a,function(e){n.isHover=e,r()}),p&&w(p,function(e){const t=e&&n.enabled;p.color=t?i.segmented.hoverColor:"transparent",p.textColor=t?l.color:m(n.enabled,l.softColor)}),d.addEventListener("focus",function(){n.isFocus=1,r()}),d.addEventListener("blur",function(){n.isFocus=0,r()});const h=function(e){n.enabled=!!e,d.disabled=!n.enabled,d.style.color=m(n.enabled,l.color),s&&(s.textColor=m(n.enabled,l.softColor)),p&&(p.textColor=m(n.enabled,l.softColor),p.cursor=n.enabled?"pointer":"default"),r()};return h(n.enabled),{field:a,input:u,el:d,prefix:s,button:p,state:n,setEnabled:h}},L=function(e,t){const o=e.item,n=function(e){if(void 0!==e.precision&&"auto"!==e.precision)return Math.max(0,Number(e.precision)||0);const t=String(e.step||1);return t.indexOf(".")>-1?t.split(".")[1].length:0}(o),r=Math.abs(Number(o.step))||1,i=void 0!==o.min?Number(o.min):-1/0,c=void 0!==o.max?Number(o.max):1/0;let a=o.value,s=null;const{field:u,input:d,el:p,prefix:h,button:f,state:g,setEnabled:b}=G(o,t,o.icon||o.prefix),m=function(e){return null==e||""===e?o.autoText||"":"string"==typeof e?e:Number(e).toFixed(n)+(o.unit||"")},x=function(e){if("number"==typeof e)return e;if("string"!=typeof e||!o.textToNumber)return null;const t=Number(o.textToNumber(e));return isNaN(t)?null:t},v=function(e){const t=Math.pow(10,n);return Math.round(basic.clamp(e,i,c)*t)/t},y=function(e){if(e=String(e).trim(),o.autoText&&(""===e||e.toLowerCase()===String(o.autoText).toLowerCase()))return null;const t=(o.commaIsList?/^-?\d*\.?\d+(px)?$/i:/^-?\d*[.,]?\d+(px)?$/i).test(e);if(o.parseText&&!t)return o.parseText(e);const n=e.replace(",",".").match(/-?\d*\.?\d+/);return n?v(parseFloat(n[0])):void 0},k=function(t){void 0!==t&&(a=t),d.text=m(a),p.title="string"==typeof a?a:"",void 0!==t&&S(e,a)};p.addEventListener("focus",function(){d.select()}),p.addEventListener("blur",function(){d.text!==m(a)&&k(y(d.text))});const C=function(e){return e.shiftKey?10:1};p.addEventListener("keydown",function(t){"Enter"===t.key?(t.preventDefault(),p.blur()):"Escape"===t.key?(t.preventDefault(),d.text=m(a),p.blur()):f&&t.altKey&&"ArrowDown"===t.key?(t.preventDefault(),p.blur(),z(e)):"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),function(e){const t=x(y(d.text)),o=null===t?x(a):t;if(null===o&&"string"==typeof a)return;const n="ArrowUp"===e.key?1:-1;k(v((o||0)+n*r*C(e))),d.select()}(t))}),f&&f.on("click",function(){g.enabled&&z(e)});const M=void 0!==o.prefixClick;if(h){h.clickable=1,h.css.touchAction="none",h.on("pointerdown",function(e,t){if(!g.enabled||0!==t.button)return;t.preventDefault(),document.activeElement===p&&p.blur();const o=x(a),n=!(null===o&&"string"==typeof a);s={id:t.pointerId,x:t.clientX,start:o||0,canScrub:n,isMoved:0};try{h.elem.setPointerCapture(t.pointerId)}catch(e){}}),h.on("pointermove",function(e,t){if(!s||t.pointerId!==s.id)return;const o=Math.round(t.clientX-s.x);if(Math.abs(o)>=3&&(s.isMoved=1),!s.canScrub||!s.isMoved)return;const n=v(s.start+o*r*C(t));n!==a&&k(n)});const t=function(){s=null};h.on("pointerup",function(n,r){const i=s&&!s.isMoved&&r.pointerId===s.id;t(),i&&g.enabled&&(M?(H(o.prefixClick),S(e,o.prefixClick)):f&&z(e))}),h.on("pointercancel",t),M&&(h.aria={label:o.prefixHint||""},h.elem.title=o.prefixHint||"",w(h,function(e){h.textColor=e&&g.enabled?l.color:l.softColor}))}const H=function(e){a=e,d.text=m(e),p.title="string"==typeof e?e:""},E=function(e){if(b(e),!h)return;const t=M?"pointer":"ew-resize";h.cursor=g.enabled?t:"default"};return H(a),E(g.enabled),{field:u,setValue:H,setEnabled:E}},P=function(e,t,o){const n=C(e.options),r="plain"===e.look,a={isHover:0,isFocus:0,enabled:0!=e.enabled};let s=e.value;const u=HGroup({width:r?"auto":t,height:c.itemHeight,align:"left center",gap:0,color:r?"transparent":i.field.color,round:i.field.round});u.shrink=0,u.cursor="pointer",u.css={boxSizing:"border-box",outline:"none",paddingLeft:e.icon?"0px":"8px"},u.tabIndex=0,u.role="button",u.aria={haspopup:"listbox",label:e.hint||e.label||e.key||"Select"},u.clickable=1,e.icon&&x(g(e.icon,16),{width:28,height:c.itemHeight,textColor:l.softColor});const d=x("",{flex:!r,height:c.itemHeight}),p=x(g("chevronDown",12),{width:22,height:c.itemHeight,textColor:l.softColor});endGroup();const h=function(){r?u.color=a.isHover&&a.enabled?i.button.hoverColor:"transparent":k(u,a)},f=function(){a.enabled&&V(u,u,n,s,function(e){b(e),o(e)})};u.on("click",f),y(u,f,["ArrowDown"]),w(u,function(e){a.isHover=e,h()}),u.on("focus",function(){a.isFocus=!r,h()}),u.on("blur",function(){a.isFocus=0,h()});const b=function(e){s=e,d.plainText=function(e){const t=function(e,t){for(let o=0;o<e.length;o++)if(e[o].value===t)return e[o];return null}(n,e);return t?t.text:null==e?"":String(e)}(e)},v=function(e){a.enabled=!!e,d.textColor=m(a.enabled,l.color),p.textColor=m(a.enabled,l.softColor),u.cursor=a.enabled?"pointer":"default",u.tabIndex=a.enabled?0:-1,h()};return b(s),v(a.enabled),{field:u,setValue:b,setEnabled:v}},D=["left","center","right"],I=["top","center","bottom"],R=function(e){const t=String(e||"").trim().split(/\s+/);1===t.length&&t.push("center");return/^(top|bottom)$/.test(t[0])||/^(left|right)$/.test(t[1])?t[1]+" "+t[0]:t[0]+" "+t[1]},A=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i,T=/^(#|rgb|hsl)/i,O=/^color-mix\(in srgb,\s*(.+)\s+([\d.]+)%,\s*transparent\)$/i,j="repeating-conic-gradient(#BBBBBB 0% 25%, #FFFFFF 0% 50%) 0 0 / 6px 6px";let K=null;const N=function(e){N.context||(N.context=document.createElement("canvas").getContext("2d"));const t=N.context;t.fillStyle="#000000",t.fillStyle=String(e||"");const o=t.fillStyle;if(t.fillStyle="#FFFFFF",t.fillStyle=String(e||""),o!==t.fillStyle)return null;if("#"===o.charAt(0))return{r:parseInt(o.slice(1,3),16),g:parseInt(o.slice(3,5),16),b:parseInt(o.slice(5,7),16),a:1};const n=o.match(/[\d.]+/g);return{r:Number(n[0]),g:Number(n[1]),b:Number(n[2]),a:void 0!==n[3]?Number(n[3]):1}},W=function(e){return"#"+[e.r,e.g,e.b].map(function(e){return("0"+Math.round(e).toString(16)).slice(-2)}).join("").toUpperCase()},X=function(e){return Math.round(100*basic.clamp(e,0,1))/100},U=function(e){const t=String(null==e?"":e).trim();if(!t)return{base:"",alpha:1};const o=t.match(O);if(o)return{base:o[1].trim(),alpha:Number(o[2])/100};const n=N(t);return n&&T.test(t)?{base:W(n),alpha:n.a}:{base:t,alpha:n?n.a:1}},q=function(e,t){if((t=X(t))>=1)return e;const o=N(e);return o?"rgba("+o.r+", "+o.g+", "+o.b+", "+t+")":Alpha(e,t)},Y=function(e){const t=e.r/255,o=e.g/255,n=e.b/255,r=Math.max(t,o,n),i=r-Math.min(t,o,n);let l=0;return i&&r===t?l=(o-n)/i%6:i&&r===o?l=(n-t)/i+2:i&&(l=(t-o)/i+4),{h:(60*l+360)%360,s:r?i/r:0,v:r}};let _=null,$="",J="hex";const Q=["hex","rgb","hsl"];let Z=function(){if(!r.recentColorsKey)return[];const e=basic.storage.load(r.recentColorsKey);return Array.isArray(e)?e:[]}();const ee=function(){r.recentColorsKey&&basic.storage.save(r.recentColorsKey,Z)},te="-quick",oe=function(){const e=r.recentColorsKey?basic.storage.load(r.recentColorsKey+te):null;return Object.assign({recent:0,group:0,paletteKey:""},e||{})}();$=oe.paletteKey;const ne=function(){oe.paletteKey=$,r.recentColorsKey&&basic.storage.save(r.recentColorsKey+te,oe)};let re=[];const ie=function(){re=re.filter(function(e){return!e.obj._isRemoved}),re.forEach(function(e){e.draw()})},le=function(e){return e&&"object"==typeof e?e:{value:e,color:e,hint:e}},ce=function(){const e="function"==typeof r.palettes?r.palettes(r):r.palettes;return _=Array.isArray(e)?e:[],_},ae=function(e,t){const o=(t||!_?ce():_).map(function(e){return Object.assign({},e,{colors:(e.colors||[]).map(le)})}),n=Array.isArray(e.presets)?e.presets.filter(function(e){return"|"!==e}):[];return n.length&&o.unshift({key:"__presets",name:"Presets",colors:n.map(le)}),o},se=function(e,t){const o=U(t);if(!o.base)return"transparent";let n=o.base;return ae(e).forEach(function(e){e.colors.forEach(function(e){e.value===o.base&&e.color&&(n=e.color)})}),q(n,o.alpha)},ue=function(e,t){e.css.background="linear-gradient("+t+", "+t+"), "+j},de=function(e,t,o){e.boxShadow=t?"0 0 0 2px "+o+", 0 0 0 3px "+i.accent.color:"inset 0 0 0 1px "+i.swatch.borderColor},pe=function(e,t,o){const n=x("",{width:14,height:14,textColor:"#FFFFFF"});n.round=3,n.clickable=1,n.cursor="pointer",n.tabIndex=0,n.role="checkbox",n.elem.title=t,n.setOn=function(o){e=o,n.text=o?g("check",12):"",n.color=o?i.accent.color:"transparent",v(n,o?"":l.softColor),n.aria={label:t,checked:o?"true":"false"}};const r=function(){n.setOn(e?0:1),o(e)};return n.on("click",r),y(n,r),n.setOn(e),n},he={key:"__recent",name:"Recent",isRecent:1},fe=function(e){return e&&"object"==typeof e?e.value:e},ge=function(e,t){return e.some(function(e){return PropertyPanel.isSameValue(fe(e),t)})},be=function(e){return e.isRecent||e.canAdd?1:0},me=function(e,t,o){return ae(e).filter(function(e){return e.canAdd&&e.key!==t.key&&!ge(e.colors,o)})},xe=function(e,t,o,n){if(M(Object.assign({key:t.key,oldValue:void 0,item:e.item,sectionKey:e.sectionKey},o)),ce(),"function"!=typeof r.palettes){const e=_.find(function(e){return e.key===t.key});e&&(e.colors=n((e.colors||[]).slice()))}ie()},ve=function(e,t,o){o&&!ge(t.colors,o)&&xe(e,t,{kind:"addColor",value:o},function(e){return ge(e,o)?e:e.concat([o])})},we=function(e,t,o){if(t.isRecent)return function(e){Z=Z.filter(function(t){return t!==e}),ee()}(o),void ie();xe(e,t,{kind:"removeColor",value:o},function(e){return e.filter(function(e){return!PropertyPanel.isSameValue(fe(e),o)})})},ye=150,ke=function(e,t,o,n){const r=i.menu,c=HGroup({width:"100%",height:r.rowHeight,align:"left center",gap:0,padding:[8,0],color:"transparent"});c.shrink=0,c.clickable=1,c.cursor="pointer",c.tabIndex=0,c.role="menuitem",c.aria={label:o},e&&x(g(e,14),{width:24,height:r.rowHeight,textColor:r.textColor});const a=x("",{flex:1,height:r.rowHeight,textColor:r.textColor,plainText:t});return e||(a.css.paddingLeft="4px"),n&&x(g(n,14),{width:18,height:r.rowHeight,textColor:l.softColor}),endGroup(),w(c,function(e){c.color=e||c.keepHover?r.hoverColor:"transparent"}),c},Ce=function(e){const t=i.menu,o=VGroup({width:ye,height:"auto",align:"left top",gap:0,color:t.color,round:t.round});o.css={position:"absolute",padding:"4px 0px",boxSizing:"border-box",alignItems:"stretch"},o.boxShadow="0 0 0 1px "+t.borderColor+", "+t.shadow,o.clickable=1,o.clipContent=0,o.role="menu",o.aria={label:e.value};let n=null,r=null;const l=function(){n&&(n.remove(),n=null,r.keepHover=0,r.color="transparent")},c=function(i){n||(n=createIn(o,function(){const o=VGroup({width:ye,height:"auto",align:"left top",gap:0,color:t.color,round:t.round});return o.css={position:"absolute",padding:"4px 0px",boxSizing:"border-box",alignItems:"stretch"},o.boxShadow="0 0 0 1px "+t.borderColor+", "+t.shadow,o.clickable=1,o.role="menu",o.aria={label:"Copy to"},e.targets.forEach(function(t){const o=ke("",t.name,"Copy "+e.value+" to "+t.name,""),n=function(){e.close(),e.onCopy(t)};o.on("click",n),y(o,n)}),endGroup(),o.on("keydown",function(e,t){"ArrowLeft"!==t.key&&"Escape"!==t.key||(t.preventDefault(),t.stopPropagation(),l(),r.elem.focus())}),o}),r.keepHover=1,r.color=t.hoverColor,r.aria={expanded:"true"},function(){const e=o.elem.getBoundingClientRect(),t=n.elem.offsetWidth,i=n.elem.offsetHeight,l=e.right+t-4<=window.innerWidth-8;n.left=l?e.width-4:4-t;const c=r.elem.offsetTop-4,a=e.top+c+i-(window.innerHeight-8);n.top=c-Math.max(0,a)}()),i&&n.elem.querySelector("[role=menuitem]").focus({preventScroll:!0})};if(e.targets.length&&(r=ke("copy","Copy to","Copy "+e.value+" to a color group","chevronRight"),r.aria={haspopup:"menu",expanded:"false"},r.on("mouseenter",function(){c(0)}),r.on("click",function(){c(1)}),y(r,function(){c(1)},["ArrowRight"])),e.targets.length&&e.canDelete){const e=Box({width:"100%",height:1,color:t.borderColor});e.shrink=0,e.css.margin="4px 0px"}if(e.canDelete){const t=ke("trash","Delete","Delete "+e.value+" from "+e.groupName,""),o=function(){e.close(),e.onDelete()};t.on("mouseenter",l),t.on("click",o),y(t,o)}return endGroup(),o};let Me=null,He=null;const Se=function(e,o,n){const c=e.item,a=i.colorPicker,s=a.quickSwatchSize,u=a.quickSwatchGap,d=a.swatchRoom,p=HGroup({width:o,height:"auto",align:"left center",gap:u,wrap:1,color:"transparent"});p.css={padding:d+"px",boxSizing:"border-box"},p.shrink=0,endGroup();const b=Math.max(1,Math.floor((o-2*d+u)/(s+u))),m={obj:p,value:"",squares:[],parts:[],enabled:1,isOpen:0},v=function(t,o,n,a){if(!m.enabled)return;if("function"==typeof ContextMenu)return void function(e,t,o,n,c){const a=me(e.item,o,n),s=be(o);if(!a.length&&!s)return;if(B(),!Me){const e=i.menu;Me=r.own(ContextMenu({styleName:"dark",minWidth:ye,style:{menu:{color:e.color,borderColor:e.borderColor,shadow:e.shadow,round:e.round,zIndex:f},item:{height:e.rowHeight,fontSize:l.fontSize,textColor:e.textColor},itemHover:{color:e.hoverColor,textColor:e.textColor}},onClick:function(e,t){He&&He(t)}}))}const u=[];a.length&&u.push({text:"Copy to",icon:g("copy",16),items:a.map(function(e){return{text:e.name,key:"copy",data:e}})}),a.length&&s&&u.push("-"),s&&u.push({text:"Delete",key:"delete",icon:g("trash",16)}),He=function(t){"copy"===t.key&&ve(e,t.data,n),"delete"===t.key&&we(e,o,n)},Me.setItems(u);const d=t.elem.getBoundingClientRect(),p=c?c.clientX:d.left,h=c?c.clientY:d.bottom;Me.openAt(p,h,t),c||Me.activateFirst()}(e,t,o,n,a);const s=h&&h.opener===t;if(B(),s)return;const u=me(c,o,n),d=be(o);(u.length||d)&&(createIn(page,function(){const r=Ce({value:n,targets:u,canDelete:d,groupName:o.name,onCopy:function(t){ve(e,t,n)},onDelete:function(){we(e,o,n)},close:B});r.zIndex=f,F(r,t.elem.getBoundingClientRect(),ye),h={obj:r,opener:t}}),h.obj.elem.querySelector("[role=menuitem]").focus({preventScroll:!0}))},k=function(e,t){const o=Box({width:s,height:s,round:3,color:"transparent"});o.shrink=0,ue(o,e.color||e.value),o.clickable=1,o.cursor="pointer",o.role="button",o.tabIndex=0,o.aria={label:e.hint||e.value},o.elem.title=e.hint||e.value,o.css.transition="transform 0.1s",w(o,function(e){o.css.transform=e&&m.enabled?"scale(1.1)":""});const r=function(){m.enabled&&n(e.value)};return o.on("click",r),y(o,r),o.elem.addEventListener("contextmenu",function(n){n.preventDefault(),v(o,t,e.value,n)}),o.on("keydown",function(n,r){("ContextMenu"===r.key||"F10"===r.key&&r.shiftKey)&&(r.preventDefault(),v(o,t,e.value,null))}),o.presetValue=e.value,m.squares.push(o),o},C=function(e,t){const o=x("",{width:2*s+u,height:s,fontSize:l.captionSize,textColor:l.softColor,plainText:e});o.round=3,o.clickable=1,o.cursor="pointer",o.role="button",o.tabIndex=0,o.aria={label:t},o.elem.title=t,w(o,function(e){o.textColor=e?l.color:l.softColor});const n=function(){m.isOpen=m.isOpen?0:1,m.draw()};return o.on("click",n),y(o,n),o};return m.draw=function(){m.parts.forEach(function(e){e.remove()}),m.parts=[],m.squares=[];const e=oe.recent?Z:[],o=oe.group?function(e){const t=ae(e);return t.find(function(e){return e.key===$})||t[0]||null}(c):null,n=o?o.colors:[],r=e.length&&n.length?1:0;p.visible=m.isHidden||!e.length&&!n.length?0:1;const i=e.length+r+n.length,l=2*b,a=i>l,u=a&&!m.isOpen,d=u?l-2:i,h=e.slice(0,d),f=r&&d>h.length,g=n.slice(0,Math.max(0,d-h.length-(f?1:0))),x=e.length+n.length-h.length-g.length;createIn(p,function(){if(h.forEach(function(e){m.parts.push(k({value:e,color:se(c,e),hint:e+" (Recent)"},he))}),f){const e=Box({width:1,height:s,color:t.dividerColor});e.shrink=0,e.clickable=0,m.parts.push(e)}g.forEach(function(e){const t=(e.hint||e.value)+" ("+o.name+")";m.parts.push(k({value:e.value,color:e.color,hint:t},o))}),u?m.parts.push(C("+"+x,"Show "+x+" more colors")):a&&m.parts.push(C("Less","Show two rows of colors"))}),m.paint(m.value)},m.paint=function(e){m.value=e,m.squares.forEach(function(o){de(o,PropertyPanel.isSameValue(o.presetValue,e),t.color)})},m.setEnabled=function(e){m.enabled=e,p.opacity=e?1:.5},m.setHidden=function(e){m.isHidden=e?1:0,m.draw()},re.push(m),m.draw(),m},Ee=function(e,o,n){return createIn(e,function(){const r=Box({width:1,height:14,color:t.dividerColor});r.shrink=0,r.clickable=0;const i=Input({width:46,height:c.itemHeight,minimal:1,fontSize:l.fontSize,textColor:l.color});i.shrink=0;const a=i.inputElement;return Object.assign(a.style,{width:"100%",height:"100%",boxSizing:"border-box",padding:"0px 8px 0px 6px",backgroundColor:"transparent",border:"0px",color:l.color,fontSize:l.fontSize+"px"}),a.setAttribute("spellcheck","false"),a.setAttribute("aria-label",n+" opacity (%)"),a.addEventListener("focus",function(){o.isFocus=1,k(e,o),i.select()}),a.addEventListener("blur",function(){o.isFocus=0,k(e,o)}),i})},ze=function(e,t){if("hex"===t||"#"!==e.charAt(0))return e;const o=N(e);if(!o)return e;if("rgb"===t)return o.r+", "+o.g+", "+o.b;const n=function(e){const t=e.r/255,o=e.g/255,n=e.b/255,r=Math.max(t,o,n),i=Math.min(t,o,n),l=(r+i)/2,c=r-i,a=c?c/(1-Math.abs(2*l-1)):0;return{h:Math.round(Y(e).h),s:Math.round(100*a),l:Math.round(100*l)}}(o);return n.h+", "+n.s+"%, "+n.l+"%"},Be=/^\s*([\d.]+)%?\s*[, ]\s*([\d.]+)%?\s*[, ]\s*([\d.]+)%?\s*$/,Fe=function(e,t,o,n="hex"){const r=U(o);e.text=ze(r.base,n),t.text=r.base?Math.round(100*r.alpha)+"%":""},Ve=function(e,t,o){const n=e.inputElement,r=t.inputElement,i=function(){return o.getFormat?o.getFormat():"hex"},l=function(e){const t=U(o.getValue());t.base&&!isNaN(e)?o.commit(q(t.base,basic.clamp(e,0,100)/100)):o.refresh()};n.addEventListener("blur",function(){const t=U(o.getValue()),n=String(e.text).trim();if(n===ze(t.base,i()))return;const r=function(e,t){const o=e.match(Be);if(!o||"hex"===t)return null;const n="rgb"===t?"rgb("+o[1]+", "+o[2]+", "+o[3]+")":"hsl("+o[1]+", "+o[2]+"%, "+o[3]+"%)",r=N(n);return r?W(r):null}(n,i());o.commit(r?q(r,t.alpha):function(e,t){return A.test(e)?q("#"+e.replace("#","").toUpperCase(),t):e}(n,t.alpha))}),n.addEventListener("keydown",function(e){"Enter"===e.key?(e.preventDefault(),n.blur()):"Escape"===e.key&&(e.preventDefault(),o.refresh(),n.blur())}),r.addEventListener("blur",function(){const e=U(o.getValue()),n=e.base?Math.round(100*e.alpha)+"%":"";String(t.text).trim()!==n&&l(parseFloat(String(t.text).replace(",",".")))}),r.addEventListener("keydown",function(e){if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();const n="ArrowUp"===e.key?1:-1,r=e.shiftKey?10:1;l(Math.round(Math.round(100*U(o.getValue()).alpha)+n*r)),t.select()}else"Enter"===e.key?(e.preventDefault(),r.blur()):"Escape"===e.key&&(e.preventDefault(),o.refresh(),r.blur())})},Ge=function(e,t){const o=h&&h.opener===t.opener;if(B(),o)return;const n=i.colorPicker,a=i.menu,u=e.item,d=u.hint||u.label||u.key,p=n.width-2*n.padding,b="function"==typeof window.EyeDropper,m="function"==typeof r.pickColor&&!t.noPagePick,v=b||m,k=p-(v?c.itemHeight+c.gap:0);let C=ae(u,1),M=0,H=null,S=[],E={h:0,s:0,v:0},z=1,F=null,V=null,L=null,P=null,D=null,I=null,R=null,A=null,T=null,O=[],_=null;const te=n.swatchRoom,re=t.getValue(),le=function(){return function(e){const t=function(t){const o=(t+e.h/60)%6;return Math.round(255*(e.v-e.v*e.s*Math.max(0,Math.min(o,4-o,1))))};return{r:t(5),g:t(3),b:t(1)}}(E)},ce=function(){const e=U(t.getValue()),o=N(se(u,e.base))||{r:0,g:0,b:0},n=Y(o);0!==n.s&&0!==n.v||(n.h=E.h),E=n,z=e.base?e.alpha:1},ge=function(){t.commit(q(W(le()),z)),He()},ke=function(e){t.commit(e),ce(),He()},Me=function(e,t){e.thumb.css.left=Math.round(t*(e.width-n.sliderHeight))+"px"},He=function(){const e=le(),o="rgb("+e.r+", "+e.g+", "+e.b+")";V.color="hsl("+Math.round(E.h)+", 100%, 50%)",L.css.left=Math.round(E.s*p-n.handleSize/2)+"px",L.css.top=Math.round((1-E.v)*n.areaHeight-n.handleSize/2)+"px",L.color=o,Me(P,E.h/360),P.thumb.color="hsl("+Math.round(E.h)+", 100%, 50%)",D.css.background="linear-gradient(to right, rgba("+e.r+", "+e.g+", "+e.b+", 0), "+o+"), "+j,Me(D,z),ue(D.thumb,"rgba("+e.r+", "+e.g+", "+e.b+", "+z+")"),P.aria={valuenow:Math.round(E.h)},D.aria={valuenow:Math.round(100*z)},V.aria={valuetext:"Saturation "+Math.round(100*E.s)+"%, brightness "+Math.round(100*E.v)+"%"},Fe(I,R,t.getValue(),J),A.text=J.toUpperCase(),ue(T,se(u,t.getValue())),Se()},Se=function(){const e=t.getValue();S.concat(O).forEach(function(t){de(t.obj,PropertyPanel.isSameValue(t.value,e),a.color)})},ze=function(e,t){const o=function(o){const n=e.elem.getBoundingClientRect();t(basic.clamp((o.clientX-n.left)/n.width,0,1),basic.clamp((o.clientY-n.top)/n.height,0,1))};e.elem.addEventListener("pointerdown",function(t){t.preventDefault(),e.elem.focus(),e.elem.setPointerCapture(t.pointerId),o(t);const n=function(e){o(e)},r=function(){e.elem.removeEventListener("pointermove",n),e.elem.removeEventListener("pointerup",r),e.elem.removeEventListener("pointercancel",r)};e.elem.addEventListener("pointermove",n),e.elem.addEventListener("pointerup",r),e.elem.addEventListener("pointercancel",r)})},Be=function(e,t){e.on("keydown",function(e,o){const n=t[o.key];n&&(o.preventDefault(),n(o.shiftKey?10:1),ge())})},Ge=function(e,t){const o=startBox({width:k,height:n.sliderHeight,round:n.sliderHeight/2,color:"transparent"});return o.css={position:"relative",left:"0px",top:"0px"},o.clipContent=0,o.clickable=1,o.cursor="pointer",o.tabIndex=0,o.role="slider",o.aria={label:d+" "+e,valuemin:0,valuemax:t},o.setFocusRing(i.accent.color),o.thumb=Box({left:0,top:0,width:n.sliderHeight,height:n.sliderHeight,round:n.sliderHeight/2,color:"transparent"}),o.thumb.boxShadow="0 0 0 2px #FFFFFF, 0 0 0 3px rgba(0, 0, 0, 0.35)",o.thumb.clickable=0,endBox(),o.shrink=0,o},Le=function(e,t,o){const r=Box({width:n.swatchSize,height:n.swatchSize,round:4,color:"transparent"});r.shrink=0,ue(r,e.color||e.value),r.clickable=1,r.cursor="pointer",r.role="button",r.tabIndex=0,r.aria={label:e.hint||e.value},r.elem.title=e.hint||e.value,r.css.transition="transform 0.1s",w(r,function(e){r.css.transform=e?"scale(1.1)":""});const i={obj:r,value:e.value,fixed:e.fixed};r.on("click",function(){r.wasDragged||ke(e.value)}),y(r,function(){ke(e.value)}),r.elem.addEventListener("contextmenu",function(e){e.preventDefault(),Ie(i,t,e)}),r.on("keydown",function(e,o){("ContextMenu"===o.key||"F10"===o.key&&o.shiftKey)&&(o.preventDefault(),Ie(i,t,null))});return o&&t.canAdd&&!e.fixed&&je(i,t,o),i};let Pe=null;const De=function(){Pe&&(Pe.remove(),Pe=null)},Ie=function(e,t,o){De();const n=me(u,t,e.value),r=be(t);if(!n.length&&!r)return;Pe=createIn(F,function(){const o=Ce({value:e.value,targets:n,canDelete:r,groupName:t.name,onCopy:function(t){Ae(t,e.value)},onDelete:function(){Te(e,t)},close:De});return o.zIndex=1,o}),Pe.on("keydown",function(t,o){"Escape"===o.key&&(o.stopPropagation(),De(),e.obj.elem.focus())});const i=F.elem.getBoundingClientRect(),l=e.obj.elem.getBoundingClientRect(),c=o?o.clientX:l.left,a=o?o.clientY:l.bottom,s=i.width-ye-4,d=i.height-Pe.elem.offsetHeight-4;Pe.left=Math.round(basic.clamp(c-i.left,4,s)),Pe.top=Math.round(Math.max(4,Math.min(a-i.top,d)));const p=Pe.elem.querySelector("[role=menuitem]");p&&p.focus({preventScroll:!0})},Re=function(){C=ae(u),Ke(),Ne()},Ae=function(t,o){ve(e,t,o),Re()},Te=function(t,o){we(e,o,t.value),Re()},Oe=function(t,o){const n=[];Array.prototype.forEach.call(o.elem.children,function(e){const t=S.find(function(t){return t.obj.elem===e});t&&n.push(t.value)});n.every(function(e,o){return PropertyPanel.isSameValue(e,t.colors[o].value)})||(!function(e,t,o){xe(e,t,{kind:"orderColors",value:o},function(e){return o.map(function(t){return e.find(function(e){return PropertyPanel.isSameValue(fe(e),t)})}).filter(function(e){return void 0!==e})})}(e,t,n),Re())},je=function(e,t,o){const n=e.obj;n.elem.addEventListener("pointerdown",function(r){if(0!==r.button)return;const i=r.clientX,l=r.clientY;let c=0;const a=function(t){const r=Math.abs(t.clientX-i)+Math.abs(t.clientY-l);!c&&r<4||(c||(c=1,n.opacity=.5,n.cursor="grabbing",De()),function(t,r){const i=S.find(function(o){if(o===e||o.fixed)return!1;const n=o.obj.elem.getBoundingClientRect();return t>=n.left&&t<=n.right&&r>=n.top&&r<=n.bottom});if(!i)return;const l=i.obj.elem.getBoundingClientRect(),c=t<l.left+l.width/2;o.elem.insertBefore(n.elem,c?i.obj.elem:i.obj.elem.nextSibling)}(t.clientX,t.clientY))},s=function(){window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),c&&!n._isRemoved&&(n.opacity=1,n.cursor="pointer",n.wasDragged=1,n.after(0,function(){n.wasDragged=0}),Oe(t,o))};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)})},Ke=function(){(_.parts||[]).forEach(function(e){e.remove()}),O=[],_.visible=Z.length?1:0,Z.length&&(_.parts=createIn(_,function(){const e=HGroup({width:p,height:16,align:"left center",gap:6,color:"transparent"});pe(oe.recent,"Show the recent colors under the color fields",function(e){oe.recent=e,ne(),ie()}).css.marginLeft=te+"px",x("",{fontSize:l.captionSize,textColor:l.softColor,plainText:"Recent"}),endGroup();const t=HGroup({width:p,height:"auto",align:"left center",gap:n.swatchGap,color:"transparent"});return t.css={padding:n.swatchRoom+"px",boxSizing:"border-box"},t.clipContent=0,O=Z.map(function(e){return Le({value:e,color:se(u,e),hint:e},he,null)}),endGroup(),[e,t]}),Se())},Ne=function(){De();const e=C.find(function(e){return e.key===$})||C[0],o=H&&e&&H.paletteKey===e.key&&H.grid?H.grid.elem.scrollTop:0;H&&H.remove(),H=createIn(F,function(){const o=VGroup({width:p,height:"auto",align:"left top",gap:6,color:"transparent"});return o.shrink=0,function(e){HGroup({width:p,height:c.itemHeight,align:"left center",gap:4,color:"transparent"}),pe(oe.group,"Show the colors of the selected group under the color fields",function(e){oe.group=e,ne(),ie()}).css.marginLeft=te+"px";const o=HGroup({width:10,height:c.itemHeight,align:"left center",gap:2,padding:[6,0],round:i.field.round,color:"transparent"});o.grow=1,o.css={minWidth:"0px"},o.clickable=1,o.cursor="pointer",o.tabIndex=0,o.role="button",o.aria={label:"Color group: "+(e?e.name:"none"),expanded:M?"true":"false"},o.elem.title="Choose a color group",x("",{flex:1,height:c.itemHeight,bold:1,plainText:e?e.name:"No colors"}),x(g(M?"chevronUp":"chevronDown",14),{width:16,height:c.itemHeight,textColor:l.softColor}),endGroup(),w(o,function(e){o.color=e?i.button.hoverColor:"transparent"});const n=function(){M=M?0:1,Ne()};if(o.on("click",n),y(o,n),e&&e.canAdd&&!M){const o=x(g("plus",14),{width:c.itemHeight,height:c.itemHeight,textColor:i.button.iconColor});o.round=i.field.round,o.clickable=1,o.cursor="pointer",o.tabIndex=0,o.role="button",o.aria={label:"Add this color to "+e.name},o.elem.title="Add this color to "+e.name,w(o,function(e){o.color=e?i.button.hoverColor:"transparent"}),o.on("click",function(){Ae(e,t.getValue())}),y(o,function(){Ae(e,t.getValue())})}endGroup()}(e),M?function(e){C.forEach(function(t){const o=t===e,n=HGroup({width:p,height:a.rowHeight,align:"left center",gap:0,round:i.field.round,color:"transparent"});n.shrink=0,n.clickable=1,n.cursor="pointer",n.tabIndex=0,n.role="option",n.aria={selected:o?"true":"false"},x(o?g("check",14):"",{width:24,height:a.rowHeight}),x("",{flex:1,height:a.rowHeight,plainText:t.name}),x("",{height:a.rowHeight,textColor:l.softColor,plainText:String(t.colors.length)}),endGroup(),n.css.paddingRight="6px";const r=function(){$=t.key,M=0,ne(),Ne(),oe.group&&ie()};w(n,function(e){n.color=e?i.button.hoverColor:"transparent"}),n.on("click",r),y(n,r)})}(e):e&&(o.grid=function(e){if(S=[],!e.colors.length)return x("",{textColor:l.softColor,plainText:e.emptyText||"No colors yet."}).css={whiteSpace:"normal",lineHeight:"16px",padding:"2px 6px"},null;const t=HGroup({width:p,height:"auto",align:"left top",gap:n.swatchGap,wrap:1,color:"transparent"});return t.css={maxHeight:n.swatchesMaxHeight+"px",padding:n.swatchRoom+"px",boxSizing:"border-box"},t.scrollY=1,e.colors.forEach(function(o){S.push(Le(o,e,t))}),endGroup(),t}(e)),endGroup(),o}),H.paletteKey=e?e.key:"",H.grid&&(H.grid.elem.scrollTop=o),Se(),Ye()},We=function(){const e=x("HEX",{width:34,height:c.itemHeight,fontSize:10,textColor:l.softColor});e.clickable=1,e.cursor="pointer",e.tabIndex=0,e.role="button",e.aria={label:"Color format (HEX, RGB, HSL)"},e.elem.title="Change the format: HEX, RGB, HSL";const t=function(){J=Q[(Q.indexOf(J)+1)%Q.length],He()};return w(e,function(t){e.textColor=t?l.color:l.softColor}),e.on("click",t),y(e,t),e},Xe=t.rect||t.anchor.elem.getBoundingClientRect(),Ue=t.besideRect||r.elem.getBoundingClientRect();let qe=t.besideRect?null:K;const Ye=function(){const e=F.elem.offsetHeight;let t=Ue.left-n.width-8,o=Xe.top;t<8&&(t=Math.min(Xe.left,window.innerWidth-n.width-8),o=Xe.bottom+4),qe&&(t=Math.min(qe.left,window.innerWidth-n.width-8),o=qe.top),F.left=Math.max(8,t),F.top=Math.max(8,Math.min(o,window.innerHeight-e-8))},_e=function(e){qe=e,t.besideRect||(K=e)};createIn(page,function(){F=VGroup({left:0,top:0,width:n.width,height:"auto",align:"left top",gap:10,padding:n.padding,color:a.color,round:a.round}),F.boxShadow="0 0 0 1px "+a.borderColor+", "+a.shadow,F.zIndex=f,F.css={boxSizing:"border-box"},F.clipContent=0,F.clickable=1,F.role="dialog",F.aria={label:d+" color"};const e=HGroup({width:p,height:c.itemHeight,align:"left center",gap:4,color:"transparent"});x("",{flex:1,bold:1,plainText:d});const o=x(g("close",14),{width:c.itemHeight,height:c.itemHeight,textColor:l.softColor});var h;o.round=i.field.round,o.clickable=1,o.cursor="pointer",o.tabIndex=0,o.role="button",o.aria={label:"Close (Escape)"},o.elem.title="Close (Escape)",w(o,function(e){o.color=e?i.button.hoverColor:"transparent"}),o.on("click",B),y(o,B),endGroup(),(h=e).clickable=1,h.cursor="move",h.elem.title="Drag to move · Double click: back to its place",h.elem.addEventListener("pointerdown",function(e){if(0!==e.button||e.target!==h.elem)return;e.preventDefault();const t=e.clientX-F.elem.getBoundingClientRect().left,o=e.clientY-F.elem.getBoundingClientRect().top,n=function(e){_e({left:e.clientX-t,top:e.clientY-o}),Ye()},r=function(){window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",r),window.removeEventListener("pointercancel",r)};window.addEventListener("pointermove",n),window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)}),h.elem.addEventListener("dblclick",function(e){e.target===h.elem&&(_e(null),Ye())}),V=startBox({width:p,height:n.areaHeight,round:4,color:"transparent"}),V.css={position:"relative",left:"0px",top:"0px",backgroundImage:"linear-gradient(to top, #000000, transparent), linear-gradient(to right, #FFFFFF, transparent)"},V.shrink=0,V.clipContent=0,V.clickable=1,V.cursor="crosshair",V.tabIndex=0,V.role="slider",V.aria={label:d+" saturation and brightness"},V.setFocusRing(i.accent.color),L=Box({left:0,top:0,width:n.handleSize,height:n.handleSize,round:n.handleSize/2,color:"transparent"}),L.boxShadow="0 0 0 2px #FFFFFF, 0 0 0 3px rgba(0, 0, 0, 0.35)",L.clickable=0,endBox();if(HGroup({width:p,height:"auto",align:"left center",gap:c.gap,color:"transparent"}).clipContent=0,v){const e=x(g("eyedropper",16),{width:c.itemHeight,height:c.itemHeight,textColor:i.button.iconColor});e.round=i.field.round,e.clickable=1,e.cursor="pointer",e.tabIndex=0,e.role="button";const o=b?"Pick a color from the screen":"Pick a color from the page";e.aria={label:o},e.elem.title=o,w(e,function(t){e.color=t?i.button.hoverColor:"transparent"});const n=function(){const e=u.key,o=z,n=s[e];B(),r.pickColor(r,function(i){if(!r||!i)return;const l=q(String(i).toUpperCase(),o);t.isOutside?t.commit(l):s[e]===n&&r.setValue(e,l)})},l=function(){b?(new window.EyeDropper).open().then(function(e){F&&!F._isRemoved&&ke(q(e.sRGBHex.toUpperCase(),z))}).catch(function(){}):n()};e.on("click",l),y(e,l)}VGroup({width:k,height:"auto",align:"left top",gap:10,color:"transparent"}).clipContent=0,P=Ge("hue",360),P.css.background="linear-gradient(to right, #FF0000, #FFFF00, #00FF00, #00FFFF, #0000FF, #FF00FF, #FF0000)",D=Ge("opacity",100),endGroup(),endGroup(),HGroup({width:p,height:c.itemHeight,align:"left center",gap:6,color:"transparent"}),function(){const e=HGroup({width:32,height:c.itemHeight,align:"left top",gap:0,round:i.field.round,color:"transparent"});e.shrink=0,e.boxShadow="inset 0 0 0 1px "+i.swatch.borderColor;const t=Box({width:16,height:c.itemHeight,color:"transparent"});ue(t,se(u,re)),t.clickable=1,t.cursor="pointer",t.role="button",t.tabIndex=0,t.aria={label:"Back to the color before: "+(re||"none")},t.elem.title="Before: "+(re||"none")+" (click to go back)",t.on("click",function(){ke(re)}),y(t,function(){ke(re)}),T=Box({width:16,height:c.itemHeight,color:"transparent"}),T.clickable=0,endGroup()}();const m=G({key:"hex",hint:d},p-32-6);m.el.style.paddingLeft="4px",I=m.input,R=Ee(m.field,m.state,d),A=createIn(m.field,We),m.field.elem.insertBefore(A.elem,m.field.elem.firstChild),endGroup(),_=VGroup({width:p,height:"auto",align:"left top",gap:6,color:"transparent"}),_.shrink=0,_.clipContent=0,endGroup();Box({width:p,height:1,color:a.borderColor}).shrink=0,endGroup()}),h={obj:F,opener:t.opener,ctrl:e,colorField:t,sync:function(){ce(),He()},onClose:function(){Pe=null;const e=t.getValue();e!==re&&(!function(e){e&&(Z=[e].concat(Z.filter(function(t){return t!==e})).slice(0,9),ee())}(e),oe.recent&&ie()),t.onClose&&t.onClose()}},F.elem.addEventListener("pointerdown",function(e){Pe&&!Pe.elem.contains(e.target)&&De()},!0),ze(V,function(e,t){E.s=e,E.v=1-t,ge()}),ze(P,function(e){E.h=Math.min(360*e,359.9),ge()}),ze(D,function(e){z=X(e),ge()}),Be(V,{ArrowLeft:function(e){E.s=basic.clamp(E.s-e/100,0,1)},ArrowRight:function(e){E.s=basic.clamp(E.s+e/100,0,1)},ArrowUp:function(e){E.v=basic.clamp(E.v+e/100,0,1)},ArrowDown:function(e){E.v=basic.clamp(E.v-e/100,0,1)}}),Be(P,{ArrowLeft:function(e){E.h=basic.clamp(E.h-e,0,359.9)},ArrowRight:function(e){E.h=basic.clamp(E.h+e,0,359.9)}}),Be(D,{ArrowLeft:function(e){z=X(z-e/100)},ArrowRight:function(e){z=X(z+e/100)}}),Ve(I,R,{getValue:t.getValue,commit:ke,refresh:He,getFormat:function(){return J}}),ce(),Ke(),He(),Ne(),V.elem.focus({preventScroll:!0})},Le={number:function(e){return L(e,b(e.item.span))},textarea:function(e){const t=e.item,o=i.textarea,n=t.rows||2,r={isHover:0,isFocus:0,enabled:0!=t.enabled},c=VGroup({width:b(t.span||"full"),height:"auto",align:"left top",gap:2,padding:[8,6],color:i.field.color,round:i.field.round});c.shrink=0,c.css={boxSizing:"border-box",transition:"box-shadow 0.12s",alignItems:"stretch"};const a=function(){k(c,r)};endGroup();const s=document.createElement("textarea");s.rows=n,s.spellcheck=!1;const u=[t.caption,t.placeholder].filter(Boolean);s.placeholder=u.join("\n"),s.setAttribute("aria-label",t.caption||t.hint||t.label||t.key),Object.assign(s.style,{width:"100%",boxSizing:"border-box",padding:"0px",border:"0px",outline:"none",resize:"none",background:"transparent",color:l.color,font:l.fontSize+"px "+o.fontFamily,lineHeight:o.lineHeight+"px",pointerEvents:"auto",userSelect:"text"}),c.elem.appendChild(s);const d=function(e){s.value=null==e?"":String(e)};return w(c,function(e){r.isHover=e,a()}),s.addEventListener("focus",function(){r.isFocus=1,a()}),s.addEventListener("blur",function(){r.isFocus=0,a(),S(e,s.value)}),s.addEventListener("keydown",function(t){t.stopPropagation();"Enter"===t.key&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),s.blur()):"Escape"===t.key&&(t.preventDefault(),d(e.item.value),s.blur())}),d(t.value),a(),{field:c,setValue:d,setEnabled:function(e){r.enabled=!!e,s.disabled=!r.enabled,a()}}},text:function(e){const t=e.item,{field:o,input:n,el:r,button:i,state:l,setEnabled:c}=G(t,b(t.span));t.placeholder&&(n.placeholder=t.placeholder);const a=function(e){n.text=null==e?"":String(e)};return r.addEventListener("blur",function(){S(e,String(n.text))}),r.addEventListener("keydown",function(t){"Enter"===t.key?(t.preventDefault(),r.blur()):"Escape"===t.key?(t.preventDefault(),a(e.item.value),r.blur()):i&&t.altKey&&"ArrowDown"===t.key&&(t.preventDefault(),r.blur(),z(e))}),i&&i.on("click",function(){l.enabled&&z(e)}),a(t.value),{field:o,setValue:a,setEnabled:c}},select:function(e){return P(e.item,b(e.item.span),function(t){S(e,t)})},combo:function(e){const t=e.item,o=b(t.span),n=i.field.round+"px";let r=0!=t.enabled;const a=HGroup({width:o,height:c.itemHeight,align:"left center",gap:1,color:"transparent"});a.shrink=0;const s=L(e,o-22-1);s.field.css.borderRadius=n+" 0px 0px "+n;const u=x(g("chevronDown",12),{width:22,height:c.itemHeight,textColor:l.softColor});u.color=i.field.color,u.clickable=1,u.cursor="pointer",u.css.borderRadius="0px "+n+" "+n+" 0px",endGroup();const d=C(t.options);w(u,function(e){u.color=e&&r?i.segmented.hoverColor:i.field.color}),u.on("click",function(){r&&V(a,u,d,e.item.value,function(t){s.setValue(t),S(e,t)})});return{field:a,setValue:s.setValue,setEnabled:function(e){r=!!e,s.setEnabled(e),u.textColor=m(r,l.softColor)}}},segmented:function(e){const t=e.item,o=C(t.options),n=t.mode?"select"===t.mode:void 0!==t.value,r=i.field.round+"px";let a=t.value,s=0!=t.enabled;const u=[],d=function(e){const t=n&&PropertyPanel.isSameValue(e.option.value,a),o=e.seg;t?o.color=i.segmented.selectedColor:e.isHover&&s?o.color=i.segmented.hoverColor:o.color=n?"transparent":i.field.color,v(o,t?i.segmented.selectedBorderColor:""),o.textColor=m(s,n&&!t?l.softColor:i.button.iconColor),n&&(o.aria={checked:t?"true":"false"})},p=function(){u.forEach(d)},h=function(e){return n?r:0===e?r+" 0 0 "+r:e===o.length-1?"0 "+r+" "+r+" 0":"0"},f=HGroup({width:b(t.span),height:c.itemHeight,align:"left center",gap:n?0:1,color:n?i.field.color:"transparent",round:i.field.round});return f.shrink=0,n&&v(f,i.field.borderColor||""),f.role=n?"radiogroup":"group",f.aria={label:t.hint||t.label||t.key},o.forEach(function(t,o){const r=t.icon?g(t.icon,16):basic.escapeHtml(t.text),l=x(r,{width:10,height:c.itemHeight,textColor:i.button.iconColor});l.grow=1,l.shrink=1,l.cursor="pointer",l.clickable=1,l.css={flexBasis:"0px",outline:"none",transition:"background-color 0.12s",borderRadius:h(o)},l.tabIndex=0,l.role=n?"radio":"button",l.aria={label:t.hint||t.text},t.hint&&(l.elem.title=t.hint);const f={seg:l,option:t,isHover:0};u.push(f);const b=function(){s&&(n?(a=t.value,p(),S(e,a)):E(e,t.value))};w(l,function(e){f.isHover=e,d(f)}),l.on("click",b),y(l,b)}),endGroup(),p(),{field:f,setValue:function(e){a=e,p()},setEnabled:function(e){s=!!e,p()}}},iconButton:function(e){const t=e.item,o=basic.isOn(t.toggle),n=0!==t.accent,r={value:!!t.value,enabled:0!=t.enabled,isHover:0},l=x("",{width:c.iconColumnWidth,height:c.itemHeight,textColor:i.button.iconColor});l.round=i.field.round,l.clickable=1,l.cursor="pointer",l.css={outline:"none",transition:"background-color 0.12s"},l.tabIndex=0,l.role="button",l.aria={label:t.hint||t.key},t.hint&&(l.elem.title=t.hint);const a=function(){l.text=g(o&&r.value&&t.iconActive?t.iconActive:t.icon,16),o&&(l.aria={pressed:r.value?"true":"false"})},s=function(){const e=o&&r.value&&n;e?l.color=i.button.activeColor:r.isHover&&r.enabled?l.color=i.button.hoverColor:l.color="transparent",l.textColor=m(r.enabled,e?i.button.activeIconColor:i.button.iconColor)},u=function(){r.enabled&&(o?(r.value=!r.value,a(),s(),S(e,r.value)):E(e,t.value))};return w(l,function(e){r.isHover=e,s()}),l.on("click",u),y(l,u),a(),s(),{field:l,setValue:function(e){r.value=!!e,a(),s()},setEnabled:function(e){r.enabled=!!e,l.cursor=r.enabled?"pointer":"default",s()}}},alignGrid:function(e){const t=e.item,o=i.alignGrid,n=2*c.itemHeight+c.rowGap,r=Math.floor(n/3);let l=R(t.value),a=0!=t.enabled;const s=[],u=function(e){const t=e.align===l,n=e.isHover&&a?o.hoverColor:o.cellColor;e.mark.color=t?m(a,o.selectedColor):"transparent",v(e.mark,t?"":n),e.area.aria={checked:t?"true":"false"}},d=function(){s.forEach(u)},p=startBox({width:n,height:n,color:i.field.color,round:i.field.round});p.shrink=0,p.role="radiogroup",p.aria={label:t.hint||t.label||t.key};const h=Math.floor((n-3*r)/2);return I.forEach(function(t,o){D.forEach(function(n,i){const c=n+" "+t,p=startBox({left:h+i*r,top:h+o*r,width:r,height:r,color:"transparent"});p.clickable=1,p.cursor="pointer",p.tabIndex=0,p.role="radio",p.aria={label:c},p.css={outline:"none"},p.elem.title=c;const f=Box({width:8,height:8,color:"transparent",round:2});f.center(),f.css={transition:"background-color 0.12s"},endBox();const g={area:p,mark:f,align:c,isHover:0};s.push(g);const b=function(){a&&(l=c,d(),S(e,l))};w(p,function(e){g.isHover=e,u(g)}),p.on("click",b),y(p,b)})}),endBox(),d(),{field:p,setValue:function(e){l=R(e),d()},setEnabled:function(e){a=!!e,d()}}},color:function(e){const t=e.item,o=i.swatch,n=t.hint||t.label||t.key,{field:r,input:a,el:s,state:u,setEnabled:d}=G(t,b(t.span));t.placeholder&&(a.placeholder=t.placeholder),s.style.paddingLeft="4px";let p="";const f=createIn(r,function(){const e=startBox({width:o.size+12,height:c.itemHeight,color:"transparent"});return e.shrink=0,e.clickable=1,e.cursor="pointer",e.role="button",e.tabIndex=0,e.aria={label:"Open the color picker of "+n,haspopup:"dialog"},e.elem.title="Open the color picker",e.fill=Box({width:o.size,height:o.size,round:3,color:"transparent"}),e.fill.center(),e.fill.clickable=0,endBox(),e});r.elem.insertBefore(f.elem,r.elem.firstChild);const g=Ee(r,u,n),x=function(){const e=""===U(p).base;ue(f.fill,se(t,p)),v(f.fill,e?o.emptyColor:o.borderColor),Fe(a,g,p),C.paint(p)},w=function(t){p=null==t?"":String(t),x(),h&&h.ctrl===e&&h.sync()},k=function(t){p=String(t),x(),S(e,p)},C=Se(e,b(t.span),function(e){u.enabled&&k(e)}),M={anchor:r,opener:f,getValue:function(){return p},commit:k},H=function(){u.enabled&&Ge(e,M)};return f.on("click",H),y(f,H),Ve(a,g,{getValue:M.getValue,commit:k,refresh:x}),w(t.value),{field:r,setValue:w,setEnabled:function(e){d(e),g.inputElement.disabled=!e,g.inputElement.style.color=m(e,l.color),f.opacity=e?1:.5,C.setEnabled(e)}}},constraints:function(e){const t=e.item;let o=t.value,n=0!=t.enabled;const r=c.columnWidth,a=2*c.itemHeight+c.rowGap,s=function(t){o=Object.assign({},o,t),E(),S(e,o)},u=HGroup({width:b(2),height:a,align:"left top",gap:c.gap,color:"transparent"});u.shrink=0,VGroup({width:r,height:a,align:"left top",gap:c.rowGap,color:"transparent"}),that.shrink=0;const d=P({key:t.key+"-h",hint:"Horizontal constraint",icon:"constraintH",options:[{value:"left",text:"Left"},{value:"right",text:"Right"},{value:"leftRight",text:"Left and right"},{value:"center",text:"Center"},{value:"scale",text:"Scale"}],value:o.horizontal},r,function(e){s({horizontal:e})}),p=P({key:t.key+"-v",hint:"Vertical constraint",icon:"constraintV",options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"topBottom",text:"Top and bottom"},{value:"center",text:"Center"},{value:"scale",text:"Scale"}],value:o.vertical},r,function(e){s({vertical:e})});endGroup();startBox({width:r,height:a,color:i.field.color,round:i.field.round}).shrink=0;const h=Math.round(r/2),f=Math.round(a/2),g=34,x=22,w=h-17,y=f-11,k=Box({left:w,top:y,width:g,height:x,color:"transparent",round:3});v(k,i.constraints.frameColor);const C=function(e,t,o,n){const r=Box({left:e,top:t,width:o,height:n,color:l.disabledColor,round:1});return r.clickable=0,r},M={top:C(h-1,y-13,2,9),bottom:C(h-1,y+x+4,2,9),left:C(w-17,f-1,13,2),right:C(w+g+4,f-1,13,2),centerH:C(h-6,f,12,1),centerV:C(h,f-6,1,12)},H=function(e,t,o,r,i){const l=Box({left:e,top:t,width:o,height:r,color:"transparent"});return l.clickable=1,l.cursor="pointer",l.on("click",function(e,t){n&&i(t.shiftKey)}),l};H(h-10,0,20,y-2,function(e){s({vertical:e&&"bottom"===o.vertical?"topBottom":"top"})}),H(h-10,y+x+2,20,a-y-x-2,function(e){s({vertical:e&&"top"===o.vertical?"topBottom":"bottom"})}),H(0,f-8,w-2,16,function(e){s({horizontal:e&&"right"===o.horizontal?"leftRight":"left"})}),H(w+g+2,f-8,r-w-g-2,16,function(e){s({horizontal:e&&"left"===o.horizontal?"leftRight":"right"})}),H(w+2,y+2,30,18,function(){s({horizontal:"center",vertical:"center"})}),endBox(),endGroup();const E=function(){const e=o.horizontal,t=o.vertical,r=function(e,t){e.color=t?m(n,i.accent.color):l.disabledColor};r(M.top,"top"===t||"topBottom"===t),r(M.bottom,"bottom"===t||"topBottom"===t),r(M.left,"left"===e||"leftRight"===e),r(M.right,"right"===e||"leftRight"===e),M.centerH.color="center"===e&&n?i.accent.color:l.softColor,M.centerV.color="center"===t&&n?i.accent.color:l.softColor,d.setValue(e),p.setValue(t)};return E(),{field:u,setValue:function(e){o=e,E()},setEnabled:function(e){n=!!e,d.setEnabled(e),p.setEnabled(e),E()}}}};Le.constraints.normalize=function(e){return Object.assign({horizontal:"left",vertical:"top"},e||{})};const Pe=function(e,t){const o=Le[e.type];if(!o)return console.warn("PropertyPanel: Unknown item type: "+e.type),null;e.value=H(e,e.value);const n={item:e,sectionKey:t};return Object.assign(n,o(n)),void 0!==e.key&&(s[e.key]&&console.warn("PropertyPanel: Same key twice: "+e.key),s[e.key]=n),n},De=function(e){if(!e)return;const t=0===e.item.visible||!1===e.item.visible;(e.cell||e.field).visible=t?0:1},Ie=function(e,o){const n=VGroup({width:"100%",height:"auto",align:"left top",gap:c.rowGap,color:"transparent"});n.shrink=0,n.css={padding:(o?"8px ":"12px ")+t.paddingRight+"px "+(o?"8px ":"16px ")+t.paddingLeft+"px",boxSizing:"border-box",borderBottom:"1px solid "+t.dividerColor},e.mark&&(n.boxShadow="inset "+t.markWidth+"px 0 0 "+Alpha(i.accent.color,t.markOpacity));const r=o||!!e.title||e.actions&&e.actions.length>0?function(e,t,o,n){let r=null;HGroup({width:"100%",height:n?32:24,align:"left center",gap:2,color:"transparent"});const c=i.sectionTitle;return r=x("",{fontSize:n?l.titleSize:l.sectionTitleSize,textColor:n?l.color:c.textColor||l.color,bold:1,flex:1,height:24,plainText:e||""}),!n&&c.uppercase&&(r.css={textTransform:"uppercase",letterSpacing:c.letterSpacing+"px"}),(t||[]).forEach(function(e){De(Pe(Object.assign({type:"iconButton",accent:0},e),o))}),endGroup(),r}(e.title,e.actions,e.key,o):null;return o&&(p=r),(e.items||[]).forEach(function(t){const o=Array.isArray(t)?t:[t],n=o.some(function(e){return!!e.label});HGroup({width:"100%",height:"auto",align:"left bottom",gap:c.gap,color:"transparent"}),o.forEach(function(t){!function(e,t,o){const n=VGroup({hug:1,align:"left top",gap:6,color:"transparent"});n.shrink=0,o&&(x("",{fontSize:l.captionSize,textColor:l.softColor,height:16,plainText:e.label||""}).css={width:"0px",minWidth:"100%"});const r=Pe(e,t);endGroup(),r&&(r.cell=n,De(r))}(t,e.key,n)}),endGroup()}),endGroup(),0!==e.visible&&!1!==e.visible||(n.visible=0),n},Re=function(e){const t=e===r.data.activeTab,o="pill"===i.tab.look,n=d[e];n.color=t&&o?i.field.color:"transparent",n.boxShadow=t&&!o?"inset 0 -2px 0 "+i.accent.color:"none",n.textColor=t?l.color:l.softColor,n.bold=t,n.aria={selected:t?"true":"false"}},Ae=function(){Object.keys(d).forEach(Re)},Te=function(){r.content&&r.content.remove(),p=null;const e=r.data;e.empty?r.content=createIn(r.scrollBox,function(){return Oe(e.empty)}):createIn(r.scrollBox,function(){r.content=VGroup({left:0,top:0,width:"100%",height:"auto",align:"left top",gap:0,color:"transparent"}),(void 0!==e.title||e.titleActions&&e.titleActions.length)&&Ie({key:"title",title:e.title,actions:e.titleActions},1),(e.sections||[]).forEach(function(e){Ie(e,0)}),endGroup()})},Oe=function(e){const o=i.empty,n=VGroup({left:0,top:0,width:"100%",height:"100%",align:"center center",gap:0,color:"transparent"});if(n.css={padding:"24px "+t.paddingRight+"px 72px "+t.paddingLeft+"px",boxSizing:"border-box"},e.icon){const t=x(g(e.icon,o.iconSize),{width:56,height:56,textColor:o.iconColor});t.color=o.iconBoxColor,t.round=o.iconBoxRound,t.css.marginBottom="16px"}if(e.title){const t=x("",{bold:1,fontSize:l.titleSize+1,plainText:e.title});t.role="heading",t.aria={level:2},t.css.marginBottom="6px"}if(e.text){const t=x("",{textColor:l.softColor,plainText:e.text});t.width=184,t.css={display:"block",whiteSpace:"normal",textAlign:"center",lineHeight:"18px"}}if(e.hints&&e.hints.length){VGroup({width:b("full"),height:"auto",align:"left top",gap:8,color:"transparent"}).css={marginTop:"20px",paddingTop:"16px",borderTop:"1px solid "+t.dividerColor},e.hints.forEach(function(e){HGroup({width:"100%",height:"auto",align:"left center",gap:8,color:"transparent"}),x("",{flex:1,height:20,fontSize:l.captionSize,textColor:l.softColor,plainText:e.text});const t=x("",{height:20,fontSize:l.captionSize,plainText:e.keys});t.color=i.field.color,t.round=4,t.css={padding:"0px 6px",minWidth:"20px",justifyContent:"center",boxSizing:"border-box"},endGroup()}),endGroup()}return endGroup(),n},je=function(){const e=r.footerContent?r.footerBox.elem.offsetHeight:0;r.scrollBox.height="calc(100% - "+(t.headerHeight+e)+"px)"};r.setData=function(e){B(),_=null,s={},re=re.filter(function(e){return e.isOutside}),r.data=PropertyPanel.copyData(e||{}),function(){const e=r.data;r.headerRow&&r.headerRow.remove(),d={},createIn(r.header,function(){r.headerRow=HGroup({width:"100%",height:"100%",align:"left center",gap:2,color:"transparent"}),void 0!==e.headerTitle&&(r.lblHeaderTitle=x("",{flex:1,bold:1,fontSize:l.titleSize,plainText:e.headerTitle}),r.lblHeaderTitle.css.paddingLeft="6px"),(e.tabs||[]).forEach(function(t){const o="pill"===i.tab.look,n=x("",{height:o?28:"100%",plainText:t.text||t.key});o&&(n.round=i.field.round),n.clickable=1,n.cursor="pointer",n.css={padding:"0px 10px",outline:"none"},n.tabIndex=0,n.role="tab",d[t.key]=n;const c=function(){r.setActiveTab(t.key)};n.on("click",c),y(n,c),w(n,function(o){o&&e.activeTab!==t.key?n.textColor=l.color:Re(t.key)})}),void 0===e.headerTitle&&(Box({width:10,height:1,color:"transparent"}).grow=1),e.headerItem&&(e.headerItem=Object.assign({type:"select",look:"plain"},e.headerItem),De(Pe(e.headerItem,"header"))),endGroup()}),Ae()}(),Te(),function(){r.footerContent&&r.footerContent.remove(),r.footerContent=null;const e=r.data.footer;r.footerBox.visible=e?1:0,e&&(r.footerContent=createIn(r.footerBox,function(){const o=Ie(Object.assign({key:"footer"},e),0);return o.css.borderBottom="none",o.css.padding="10px "+t.paddingRight+"px 10px "+t.paddingLeft+"px",o})),je()}()},r.getData=function(){return PropertyPanel.copyData(r.data)},r.getValues=function(){const e={};return Object.keys(s).forEach(function(t){const o=s[t].item.value;void 0!==o&&(e[t]=PropertyPanel.copyValue(o))}),e},r.getValue=function(e){const t=s[e];return t?PropertyPanel.copyValue(t.item.value):void 0},r.setValue=function(e,t,o=0){const n=s[e];if(!n)return console.warn("PropertyPanel: No item with the key: "+e),0;const r=H(n.item,PropertyPanel.copyValue(t));return PropertyPanel.isSameValue(n.item.value,r)||(n.setValue(PropertyPanel.copyValue(r)),S(n,r,o)),1},r.openColorPickerFor=function(e){let t=String(e.value??"");const o={isOutside:1,opener:e.opener||{elem:document.createElement("div")},rect:e.rect,besideRect:e.besideRect,noPagePick:e.noPagePick,onClose:e.onClose,getValue:function(){return t},commit:function(o){t=String(o),e.commit(t)}};Ge({item:{key:e.key,hint:e.hint},sectionKey:""},o)},r.buildColorStrip=function(e){const t=Se({item:{key:e.key,hint:e.hint},sectionKey:""},e.width,e.onPick);return t.isOutside=1,t},r.isColorPickerOpen=function(){return!(!h||!h.colorField)},r.closeColorPicker=function(){r.isColorPickerOpen()&&B()},r.isPopupElement=function(e){return!(!h||!h.obj.elem.contains(e))},r.setValues=function(e,t=0){Object.keys(e||{}).forEach(function(o){r.setValue(o,e[o],t)})},r.setEnabled=function(e,t){const o=s[e];return o?(o.item.enabled=basic.isOn(t)?1:0,o.setEnabled(o.item.enabled),1):0},r.setItemVisible=function(e,t){const o=s[e];return o?(o.item.visible=basic.isOn(t)?1:0,De(o),1):0},r.getItem=function(e){const t=s[e];return t?t.item:null},r.setTitle=function(e){r.data.title=e,p?p.plainText=e||"":Te()},r.setActiveTab=function(e,t=0){const o=r.data.activeTab;r.data.activeTab=e,Ae(),t||o===e||M({kind:"tab",key:e,value:e,oldValue:o,item:null,sectionKey:"header"})},r.listen=function(e){return u.push(e),function(){u=u.filter(function(t){return t!==e})}},r.open=function(){r.opened=1,r.css.transform="translateX(0px)",r.aria={hidden:"false"}},r.close=function(){B(),r.opened=0,r.css.transform="translateX(100%)",r.aria={hidden:"true"}},r.toggle=function(){basic.isOn(r.opened)?r.close():r.open()};const Ke=r.remove;r.superRemove=Ke,r.remove=function(){r&&(B(),Ke.call(r),r=null)},r.boxShadow="inset 1px 0 0 "+t.dividerColor,r.css.transition="transform "+t.motion+" ease",r.role="complementary",r.aria={label:"Properties"},r.clickable=1,r.header=HGroup({left:0,top:0,width:"100%",height:t.headerHeight,align:"left center",gap:2,color:"transparent"}),r.header.css={padding:"0px "+t.paddingRight+"px 0px 10px",boxSizing:"border-box",borderBottom:"1px solid "+t.dividerColor},r.header.role="tablist",endGroup(),r.scrollBox=Box({left:0,top:t.headerHeight,width:"100%",height:"calc(100% - "+t.headerHeight+"px)",color:"transparent",scrollY:1}),r.footerBox=VGroup({left:0,width:"100%",height:"auto",align:"left top",gap:0,color:t.color}),r.footerBox.css={top:"auto",bottom:"0px",borderTop:"1px solid "+t.dividerColor,boxSizing:"border-box"},endGroup(),r.footerBox.visible=0,r.listenTo(document,"pointerdown",function(e,t){h&&(h.obj.elem.contains(t.target)||h.opener.elem.contains(t.target)||B())},!0),r.listenTo(document,"keydown",function(e,t){if(!h||"Escape"!==t.key)return;t.stopImmediatePropagation();const o=h.opener,n=h.obj.elem.contains(document.activeElement);B(),n&&o.elem.tabIndex>=0&&o.elem.focus()}),r.onPageResize(B),r.scrollBox.elem.addEventListener("scroll",B),r.footerBox.onResize(je),r.setData(o),"undefined"!=typeof ScrollBar&&ScrollBar({scrollableBox:r.scrollBox,...i.scrollBar}),basic.isOn(r.opened)?r.open():r.close();const Ne=endObject(r);return setDefaultContainerBox(n),Ne};PropertyPanel.copyValue=function(e){return null!==e&&"object"==typeof e?JSON.parse(JSON.stringify(e)):e},PropertyPanel.isSameValue=function(e,t){return e===t||null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&JSON.stringify(e)===JSON.stringify(t)},PropertyPanel.copyData=function(e){if(Array.isArray(e))return e.map(PropertyPanel.copyData);if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach(function(o){t[o]=PropertyPanel.copyData(e[o])}),t}return e},PropertyPanel.icons={alignLeft:"M2.5 2.5v11M5 5.5h8M5 10.5h5",alignCenterH:"M8 2v12M4 5.5h8M5.5 10.5h5",alignRight:"M13.5 2.5v11M3 5.5h8M6 10.5h5",alignTop:"M2.5 2.5h11M5.5 5v8M10.5 5v5",alignCenterV:"M2 8h12M5.5 4v8M10.5 5.5v5",alignBottom:"M2.5 13.5h11M5.5 3v8M10.5 6v5",frame:"M3 4.5h10v7H3zM6 8h4M8 6v4",component:"M5 2.5l1.5 1.5L5 5.5 3.5 4zM11 2.5l1.5 1.5L11 5.5 9.5 4zM5 10.5l1.5 1.5L5 13.5 3.5 12zM11 10.5l1.5 1.5-1.5 1.5L9.5 12z",link:"M7 9l2-2M6.5 5.5l1-1a2.5 2.5 0 013.5 3.5l-1 1M9.5 10.5l-1 1a2.5 2.5 0 01-3.5-3.5l1-1",target:"M8 2.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2.5 8h3M10.5 8h3M8 6.5a1.5 1.5 0 100 3 1.5 1.5 0 000-3z",more:"M3.5 7.2a.8.8 0 100 1.6.8.8 0 000-1.6zM8 7.2a.8.8 0 100 1.6.8.8 0 000-1.6zM12.5 7.2a.8.8 0 100 1.6.8.8 0 000-1.6z",constraintH:"M2.5 5v6M13.5 5v6M2.5 8h11",constraintV:"M5.5 2.5h5M5.5 13.5h5M8 2.5v11",angle:"M3 13h10M3 13V3M3 8.5A4.5 4.5 0 017.5 13",rotate:"M9.5 6.5l3 3-3 3-3-3zM3.5 9A5.5 5.5 0 0111 3.8M11 1.8v2.5H8.5",flipH:"M8 2v12M6 4.5L2.5 11.5H6zM10 4.5l3.5 7H10z",flipV:"M2 8h12M4.5 6l7-3.5V6zM4.5 10l7 3.5V10z",hugWidth:"M3 3v10M6 8h7M10.5 5.5L13 8l-2.5 2.5",fixedWidth:"M2.5 3v10M13.5 3v10M5.5 5.5h5M5.5 8h5M5.5 10.5h3",autoHeight:"M3.5 2.5h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1v-9a1 1 0 011-1zM5.5 5.5h5M5.5 8h5M5.5 10.5h3",clip:"M3.5 2.5h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1v-9a1 1 0 011-1zM9 13.5V9h4.5",eye:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8zM8 6a2 2 0 100 4 2 2 0 000-4z",eyeOff:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8zM8 6a2 2 0 100 4 2 2 0 000-4zM2.5 13.5l11-11",drop:"M8 2.5S4 7 4 9.5a4 4 0 008 0C12 7 8 2.5 8 2.5z",styles:"M5 3a2 2 0 100 4 2 2 0 000-4zM11 3a2 2 0 100 4 2 2 0 000-4zM5 9a2 2 0 100 4 2 2 0 000-4zM11 9a2 2 0 100 4 2 2 0 000-4z",opacity:"M3.5 2.5h9a1 1 0 011 1v9a1 1 0 01-1 1h-9a1 1 0 01-1-1v-9a1 1 0 011-1zM2.5 8h11M8 2.5v11",radius:"M2.5 6V4.5a2 2 0 012-2H6M10 2.5h1.5a2 2 0 012 2V6M13.5 10v1.5a2 2 0 01-2 2H10M6 13.5H4.5a2 2 0 01-2-2V10",textLeft:"M2.5 4h11M2.5 8h7M2.5 12h9",textCenter:"M2.5 4h11M4.5 8h7M3.5 12h9",textRight:"M2.5 4h11M6.5 8h7M4.5 12h9",textTop:"M3 2.5h10M8 13V6M5.5 8.5L8 6l2.5 2.5",textMiddle:"M3 8h10M8 2v3.5M6 3.5l2 2 2-2M8 14v-3.5M6 12.5l2-2 2 2",textBottom:"M3 13.5h10M8 3v7M5.5 7.5L8 10l2.5-2.5",lineHeight:"M3 2.5h10M3 13.5h10M5.5 11L8 5l2.5 6M6.4 9h3.2",letterSpacing:"M2.5 3v10M13.5 3v10M5.5 11L8 5l2.5 6M6.4 9h3.2",sliders:"M4 2.5v11M12 2.5v11M8 2.5v11M2.5 5.5h3M6.5 10.5h3M10.5 7h3",chevronDown:"M4.5 6.5L8 10l3.5-3.5",chevronUp:"M4.5 9.5L8 6l3.5 3.5",close:"M4 4l8 8M12 4l-8 8",pointer:"M4 2.5l8.5 5.2-3.7 1 2.1 3.9-1.7.9-2.1-3.9L4.3 12.2zM12 1.5v2M14.5 4h-2M13.8 2.2l-1.3 1.3",eyedropper:"M10.2 2.8a1.7 1.7 0 012.4 2.4l-1.4 1.4.7.7-1.1 1.1-3.3-3.3 1.1-1.1.7.7zM7.4 5.9L3 10.3V13h2.7l4.4-4.4",check:"M3.5 8.5l3 3 6-7",copy:"M6 6h7v7H6zM10 6V3H3v7h3",trash:"M2.5 4.5h11M6.5 4.5V3h3v1.5M4 4.5l.7 8.5h6.6l.7-8.5M6.8 7v3.5M9.2 7v3.5",chevronRight:"M6.5 4.5L10 8l-3.5 3.5",plus:"M8 3v10M3 8h10",minus:"M3 8h10",bold:"M5 3h3.8a2.4 2.4 0 0 1 0 4.8H5zM5 7.8h4.4a2.6 2.6 0 0 1 0 5.2H5z",italic:"M7 3h5M4 13h5M9.5 3l-3 10",flowHorizontal:"M2.5 8h11M10 4.5L13.5 8 10 11.5",flowVertical:"M8 2.5v11M4.5 10L8 13.5 11.5 10",wrap:"M2.5 4h11M2.5 8h9a2 2 0 0 1 0 4H8M9.5 10.5L8 12l1.5 1.5M2.5 12h3",ellipsis:"M2.5 8h.01M6 8h.01M9.5 8h.01M2.5 4.5h11M2.5 11.5h7"};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* Bismillah */
|
|
2
|
-
"use strict";const RadioButtonDefaults={key:"0",width:"auto",height:"auto",group:"default",value:"",checked:0,enabled:1,labelText:"",labelPosition:"right",onChange:function(o){},styleName:"
|
|
2
|
+
"use strict";const RadioButtonDefaults={key:"0",width:"auto",height:"auto",group:"default",value:"",checked:0,enabled:1,labelText:"",allowHtml:0,labelPosition:"right",onChange:function(o){},styleName:"light",style:{box:{color:"transparent",round:0},hoverBox:{color:null},checkedBox:{color:null},hoverCheckedBox:{color:null},layout:{gap:10,padding:[0,4],align:"left center"},mark:{width:22,height:22,color:White(1),border:2,borderColor:Black(.35),round:100},checkedMark:{color:White(1),borderColor:"#242424"},hoverMark:{color:null,borderColor:Black(.7)},dot:{color:"#242424",size:.5,round:100},label:{fontSize:16,textColor:Black(.8)},disabled:{opacity:.4},focus:{ringColor:""}}},RadioButton=function(o={}){basic.applyStylePackage(o,RadioButton.styles,RadioButtonDefaults),mergeIntoIfMissing(o,RadioButtonDefaults),o.color=o.style.box.color,o.round=o.style.box.round;let e=startObject(o),t=0;const r="0.15s",l=function(o,t){const r=null==t?"":String(t);1==e.allowHtml?o.text=r:o.plainText=r},n=function(){return RadioButton.getGroup(e.group)},a=function(){const o=t&&1==e.enabled;e.color=function(o){const t=e.style.box.color,r=e.style.checkedBox.color||t;return 1==e.checked?o&&e.style.hoverCheckedBox.color||r:o&&e.style.hoverBox.color||t}(o),function(o){if(1==e.checked)return e.mark.color=e.style.checkedMark.color,e.mark.borderColor=e.style.checkedMark.borderColor,void(e.dot.css={opacity:"1",transform:"scale(1)"});const t=e.style.hoverMark.color;e.mark.color=o&&t?t:e.style.mark.color,e.mark.borderColor=o?e.style.hoverMark.borderColor:e.style.mark.borderColor,e.dot.css={opacity:"0",transform:"scale(0.3)"}}(o),function(){const o=1==e.enabled;e.opacity=o?1:e.style.disabled.opacity,e.cursor=o?"pointer":"default",e.tabIndex=o?0:-1}(),e.aria={checked:1==e.checked,disabled:1!=e.enabled}},c=function(o){const t=n().filter(function(o){return 1==o.enabled});if(0==t.length)return;let r=t.indexOf(e)+o;r<0&&(r=t.length-1),r>=t.length&&(r=0),t[r].select(),t[r].elem.focus()};e.select=function(o=0){e.setChecked(1,o)},e.setChecked=function(o,t=0){o=basic.isOn(o)?1:0,e.checked!=o&&(1==o&&n().forEach(function(o){o!==e&&1==o.checked&&o._uncheck()}),e.checked=o,a(),1!=o||t||e.onChange(e))},e._uncheck=function(){e.checked=0,a()},e.setEnabled=function(o){e.enabled=basic.isOn(o)?1:0,a()},e.setLabelText=function(o){e.labelText=o,l(e.label,o),e.label.visible=o?1:0},e.refresh=function(){a()};const i=e.remove;e.superRemove=i,e.remove=function(){e&&(!function(){const o=n(),t=o.indexOf(e);t>-1&&o.splice(t,1)}(),i.call(e),e=null)},e.clickable=1,e.role="radio",e.css={outline:"none",userSelect:"none"},e.setMotion("background-color "+r),e.contentBox=HGroup({width:"auto",height:"auto",position:"relative",...e.style.layout});const d=function(){e.label=Label(e.style.label),l(e.label,e.labelText),e.label.css.whiteSpace="nowrap",e.labelText||(e.label.visible=0)};"left"===e.labelPosition&&d(),e.mark=startBox({width:e.style.mark.width,height:e.style.mark.height,color:e.style.mark.color,border:e.style.mark.border,borderColor:e.style.mark.borderColor,round:e.style.mark.round}),e.mark.setMotion("background-color 0.15s, border-color "+r),e.mark.css.boxSizing="border-box",function(){const o=e.style.focus.ringColor;o&&(RadioButton.addFocusCss(),e.elem.classList.add("radio-button-focus"),e.mark.elem.classList.add("radio-button-mark"),e.elem.style.setProperty("--radio-button-focus",o))}();const s=e.style.mark.width-2*e.style.mark.border,u=e.style.mark.height-2*e.style.mark.border,h=Math.round((s-s*e.style.dot.size)/2),b=Math.round((u-u*e.style.dot.size)/2);e.dot=Box({left:h,top:b,width:s-2*h,height:u-2*b,color:e.style.dot.color,round:e.style.dot.round}),e.dot.css.transition="transform 0.15s, opacity "+r,endBox(),"left"!==e.labelPosition&&d(),endGroup(),e.on("click",function(o,t){1==e.enabled&&e.select()}),e.on("keydown",function(o,t){if(1==e.enabled)switch(t.key){case" ":case"Enter":t.preventDefault(),e.select();break;case"ArrowDown":case"ArrowRight":t.preventDefault(),c(1);break;case"ArrowUp":case"ArrowLeft":t.preventDefault(),c(-1)}}),e.on("mouseover",function(){t=1,a()}),e.on("mouseout",function(){t=0,a()}),n().push(e),e.enabled=basic.isOn(e.enabled)?1:0;const k=basic.isOn(e.checked);return e.checked=0,a(),k&&e.setChecked(1,1),endObject(e)};RadioButton.groups={},RadioButton.getGroup=function(o="default"){return RadioButton.groups[o]||(RadioButton.groups[o]=[]),RadioButton.groups[o]},RadioButton.getSelected=function(o="default"){return RadioButton.getGroup(o).find(function(o){return 1==o.checked})||null},RadioButton.getValue=function(o="default"){const e=RadioButton.getSelected(o);return e?e.value:""},RadioButton.setValue=function(o="default",e,t=0){const r=RadioButton.getGroup(o).find(function(o){return o.value===e});r&&r.setChecked(1,t)},RadioButton.clear=function(o="default"){RadioButton.getGroup(o).forEach(function(o){o._uncheck()})},RadioButton.styles={light:RadioButtonDefaults.style,modern:{box:{color:"transparent",round:8},hoverBox:{color:"whitesmoke"},checkedBox:{color:"#EFF5F6"},hoverCheckedBox:{color:"#DFECEC"},layout:{gap:12,padding:[12,10],align:"left center"},mark:{width:22,height:22,color:"whitesmoke",border:1,borderColor:Black(.7),round:100},checkedMark:{color:"white",borderColor:Black(.7)},hoverMark:{color:"white",borderColor:Black(.7)},dot:{color:"cadetblue",size:.5,round:100},label:{fontSize:16,textColor:Black(.85)},disabled:{opacity:.4}},dark:{mark:{color:"#2A2A29",borderColor:White(.3)},checkedMark:{color:"#2A2A29",borderColor:"#65A293"},hoverMark:{borderColor:White(.6)},dot:{color:"#65A293"},label:{textColor:White(.85)}}},RadioButton.styles.classic=RadioButton.styles.light,RadioButton.createMinimalStyle=function(o){return{layout:{gap:8,padding:[0,2],align:"left center"},mark:{width:14,height:14,color:"transparent",border:1,borderColor:o.line,round:100},checkedMark:{color:"transparent",borderColor:o.ink},hoverMark:{color:null,borderColor:o.lineHover},dot:{color:o.ink,size:.5,round:100},label:{fontSize:13,textColor:o.text},disabled:{opacity:.4},focus:{ringColor:o.focus}}},RadioButton.MINIMAL_COLORS={line:Black(.45),lineHover:Black(.65),ink:"#1F1F1F",text:Black(.85),focus:"#3D8BD9"},RadioButton.styles.minimal=RadioButton.createMinimalStyle(RadioButton.MINIMAL_COLORS),RadioButton.MINIMAL_DARK_COLORS={line:White(.42),lineHover:White(.62),ink:"#EDEDEB",text:White(.88),focus:"#7FB6DE"},RadioButton.styles.minimalDark=RadioButton.createMinimalStyle(RadioButton.MINIMAL_DARK_COLORS),RadioButton.addFocusCss=function(){basic.addCss("radio-button-focus",".radio-button-focus:focus { outline: none; }.radio-button-focus:focus-visible .radio-button-mark { border-color: var(--radio-button-focus) !important; box-shadow: inset 0 0 0 1px var(--radio-button-focus); }")};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
"use strict";const RangeSliderDefaults={key:"0",left:0,top:0,width:250,height:44,minValue:0,maxValue:100,step:1,lowValue:null,highValue:null,minGap:0,showValueOnMove:1,formatValue:null,enabled:1,lowAriaLabel:"Minimum",highAriaLabel:"Maximum",onChange:function(n){},onChangeEnd:function(n){},styleName:"round",style:{track:{height:6,round:3,color:Black(.12),fillColor:"cadetblue"},knob:{size:24,round:12,color:"white",shadow:"0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.04)"},dragging:{ringSize:6,ringOpacity:.2},value:{color:"#232323",textColor:"white",fontSize:13,padding:[9,5],round:8,space:10},disabled:{opacity:.4},focus:{ringColor:"rgba(63, 141, 148, 0.8)"}}},RangeSlider=function(n={}){const e=n.style;basic.applyStylePackage(n,RangeSlider.styles,RangeSliderDefaults),mergeIntoIfMissing(n,RangeSliderDefaults);const t=startObject(n);let l=t.style,i=null,o=null,a=null,r=null;const u=function(){return t.step>0?t.step:1},c=function(){const n=t.maxValue-t.minValue;return n>0?n:1},s=function(n){const e=Number(n),l=isFinite(e)?e:t.minValue,i=Math.round((l-t.minValue)/u());return Number((t.minValue+i*u()).toFixed(RangeSlider.decimalsOf(u())))},g=function(n,e,t){return Math.min(Math.max(n,e),t)},d=function(n){return n===o?t.minValue:Math.min(t.lowValue+t.minGap,t.maxValue)},h=function(n){return n===o?Math.max(t.highValue-t.minGap,t.minValue):t.maxValue},f=function(n){return n===o?t.lowValue:t.highValue},p=function(n){return"function"==typeof t.formatValue?String(t.formatValue(n)):String(n)},m=function(n){return g((n-t.minValue)/c(),0,1)},b=function(n){const e=f(n);n.lblValue.plainText=p(e),n.aria={valuenow:String(e),valuetext:p(e),valuemin:String(d(n)),valuemax:String(h(n))}},V=function(){!function(){const n=l.knob.size,e=m(t.lowValue),i=m(t.highValue);o.css.left="calc((100% - "+n+"px) * "+e+")",a.css.left="calc((100% - "+n+"px) * "+i+")",t.fill.css.left="calc("+n/2+"px + (100% - "+n+"px) * "+e+")",t.fill.css.width="calc((100% - "+n+"px) * "+(i-e)+")"}(),b(o),b(a)},x=function(n,e){const t=e?", 0 0 0 "+l.dragging.ringSize+"px "+Alpha(l.track.fillColor,l.dragging.ringOpacity):"";n.boxShadow=l.knob.shadow+t},k=function(n){o.zIndex=n===o?2:1,a.zIndex=n===a?2:1},w=function(n){1==t.showValueOnMove&&(r&&r(),r=null,o.lblValue.visible=n===o?1:0,a.lblValue.visible=n===a?1:0)},S=function(){o.lblValue.visible=0,a.lblValue.visible=0},C=function(n,e){const l=g(s(e),d(n),h(n));return l!==f(n)&&(n===o?t.lowValue=l:t.highValue=l,V(),!0)},y=function(n){const e=n.elem.getBoundingClientRect();return e.left+e.width/2},M=function(n){const e=Math.abs(n-y(o)),t=Math.abs(n-y(a));return e!==t?e<t?o:a:n<y(o)?o:a},R=function(n){i.knob=n,i.isChosen=1,k(n),x(n,1),w(n)},I=function(n){const e=C(i.knob,function(n){const e=t.elem.getBoundingClientRect(),l=o.elem.getBoundingClientRect().width,i=e.width-l;if(i<=0)return t.lowValue;const a=(n-e.left-l/2)/i;return t.minValue+g(a,0,1)*c()}(n-i.grabSpace));e&&(i.hasMoved=1,t.onChange(t))},F=function(n,e){i.grabSpace=e.clientX-y(n);t.lowValue===t.highValue||R(n)},v=function(){const n=i.isChosen?i.knob:null;i=null,S(),n&&x(n,0)},O=function(n,e){if(1!=t.enabled)return;const l=function(n,e){const t=f(n);return{ArrowRight:t+u(),ArrowUp:t+u(),ArrowLeft:t-u(),ArrowDown:t-u(),PageUp:t+10*u(),PageDown:t-10*u(),Home:d(n),End:h(n)}[e]}(n,e.key);void 0!==l&&(e.preventDefault(),C(n,l)&&(k(n),w(n),r=t.after(1e3,S),t.onChange(t),t.onChangeEnd(t)))},A=function(n){const e=Box({top:0,shrink:0,clipContent:0,role:"slider",tabIndex:0,cursor:"grab",clickable:1});return e.aria={label:n},e.css.touchAction="none",e.lblValue=createIn(e,function(){return Label({visible:0,css:{whiteSpace:"nowrap",left:"50%",transform:"translateX(-50%)",top:"auto",width:"max-content"}})}),e.on("keydown",function(n,t){O(e,t)}),e},N=function(n){n.props({width:l.knob.size,height:l.knob.size,round:l.knob.round,color:l.knob.color}),n.css.top="calc(50% - "+l.knob.size/2+"px)",n.setFocusRing(l.focus.ringColor);const e=l.value;n.lblValue.props({fontSize:e.fontSize,color:e.color,textColor:e.textColor,round:e.round}),n.lblValue.css.padding=e.padding[1]+"px "+e.padding[0]+"px",n.lblValue.css.bottom=l.knob.size+e.space+"px",x(n,0)},D=function(){const n=l.track;t.track.props({height:n.height,round:n.round,color:n.color}),t.track.css.top="calc(50% - "+n.height/2+"px)",t.track.css.left="0",t.track.css.width="100%",t.fill.props({height:n.height,round:n.round,color:n.fillColor}),t.fill.css.top=t.track.css.top,N(o),N(a)},z=function(){const n=1==t.enabled;t.opacity=n?1:l.disabled.opacity,t.cursor=n?"pointer":"default",o.tabIndex=n?0:-1,a.tabIndex=n?0:-1,o.aria={disabled:n?"false":"true"},a.aria={disabled:n?"false":"true"}},L=function(){const n=g(s(t.lowValue),t.minValue,t.maxValue),e=g(s(t.highValue),t.minValue,t.maxValue);t.lowValue=Math.min(n,e),t.highValue=Math.max(n,e),t.highValue-t.lowValue>=t.minGap||(t.highValue=Math.min(t.lowValue+t.minGap,t.maxValue),t.lowValue=Math.max(t.highValue-t.minGap,t.minValue))};return t.setValues=function(n,e){t.lowValue=null==n?t.lowValue:Number(n),t.highValue=null==e?t.highValue:Number(e),L(),V()},t.getValues=function(){return[t.lowValue,t.highValue]},t.setMinValue=function(n){t.minValue=Number(n),L(),V()},t.setMaxValue=function(n){t.maxValue=Number(n),L(),V()},t.setStep=function(n){t.step=Number(n),L(),V()},t.setMinGap=function(n){t.minGap=Number(n),L(),V()},t.setEnabled=function(n){t.enabled=basic.isOn(n)?1:0,z()},t.setTheme=function(n){t.styleName=n,l=function(n){const t={styleName:n,style:e};return basic.applyStylePackage(t,RangeSlider.styles,RangeSliderDefaults),mergeIntoIfMissing(t,RangeSliderDefaults),t.style}(n),t.style=l,D(),z()},t.clipContent=0,t.minValue=Number(t.minValue),t.maxValue=Number(t.maxValue),t.step=Number(t.step),t.minGap=Number(t.minGap),t.lowValue=null===t.lowValue?t.minValue:Number(t.lowValue),t.highValue=null===t.highValue?t.maxValue:Number(t.highValue),t.track=Box({top:0,left:0}),t.fill=Box({top:0,left:0}),o=A(t.lowAriaLabel),a=A(t.highAriaLabel),t.lowKnob=o,t.highKnob=a,t.clickable=1,t.css.touchAction="pan-y",t.on("pointerdown",function(n,e){if(1!=t.enabled||0!==e.button||i)return;const l=(r=e.target,o.elem.contains(r)?o:a.elem.contains(r)?a:null);var r;const u="touch"===e.pointerType;i={knob:l,pointerId:e.pointerId,startX:e.clientX,isFromFinger:u,isOnTrack:!l,isChosen:0,hasMoved:0,grabSpace:0},function(n){try{t.elem.setPointerCapture(n)}catch(n){console.warn("RangeSlider: "+n.message)}}(e.pointerId),l?F(l,e):u||(R(M(e.clientX)),I(e.clientX))}),t.on("pointermove",function(n,e){if(i&&e.pointerId===i.pointerId){if(i.isFromFinger&&i.isOnTrack&&!i.isChosen){if(Math.abs(e.clientX-i.startX)<6)return;R(M(i.startX))}i.isChosen||function(n){const e=n-i.startX;0!==e&&R(e>0?a:o)}(e.clientX),i.isChosen&&I(e.clientX)}}),t.on("pointerup",function(n,e){if(!i||e.pointerId!==i.pointerId)return;i.isFromFinger&&i.isOnTrack&&!i.isChosen&&(R(M(i.startX)),I(i.startX));const l=i.hasMoved;v(),l&&t.onChangeEnd(t)}),t.on("pointercancel",function(n,e){if(!i||e.pointerId!==i.pointerId)return;const l=i.hasMoved;v(),l&&t.onChangeEnd(t)}),D(),L(),V(),k(a),z(),endObject(t)};RangeSlider.decimalsOf=function(n){const e=String(n),t=e.indexOf(".");return t<0?0:e.length-t-1},RangeSlider.styles={round:RangeSliderDefaults.style,roundDark:{track:{color:White(.16),fillColor:"#5BBAC1"},knob:{shadow:"0 1px 3px rgba(0, 0, 0, 0.5)"},dragging:{ringOpacity:.3},value:{color:"#F2F2F2",textColor:"#232323"},focus:{ringColor:"rgba(111, 198, 205, 0.8)"}}},RangeSlider.createMinimalStyle=function(n){return{height:24,style:{track:{height:2,round:1,color:n.track,fillColor:n.ink},knob:{size:12,round:6,color:n.ground,shadow:"0 0 0 1px "+n.ink},dragging:{ringSize:0,ringOpacity:0},value:{color:n.ink,textColor:n.onInk,fontSize:11,padding:[6,2],round:3,space:6},focus:{ringColor:n.focus}}}},RangeSlider.MINIMAL_COLORS={ground:"#FFFFFF",ink:"#1F1F1F",onInk:"#FFFFFF",track:Black(.12),focus:"#3D8BD9"},RangeSlider.styles.minimal=RangeSlider.createMinimalStyle(RangeSlider.MINIMAL_COLORS),RangeSlider.MINIMAL_DARK_COLORS={ground:"#1A1A19",ink:"#EDEDEB",onInk:"#1A1A19",track:White(.14),focus:"#7FB6DE"},RangeSlider.styles.minimalDark=RangeSlider.createMinimalStyle(RangeSlider.MINIMAL_DARK_COLORS);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* Bismillah */
|
|
2
|
-
"use strict";const RichTextEditorDefaults={key:"0",width:560,height:300,htmlText:"",placeholderText:"Write something...",tools:["bold","italic","underline","strike","|","h2","h3","|","ul","ol","quote","|","link","clear","|","undo","redo"],pasteAs:"clean",maxLength:0,showCounter:0,readOnly:0,enabled:1,spellCheck:1,useScrollBar:1,ariaLabel:"Text editor",texts:{bold:"Bold",italic:"Italic",underline:"Underline",strike:"Strikethrough",h2:"Heading",h3:"Subheading",ul:"Bulleted list",ol:"Numbered list",quote:"Quote",link:"Link",clear:"Clear formatting",undo:"Undo",redo:"Redo",linkPlaceholder:"https://example.com",linkApply:"Apply",linkRemove:"Remove",counter:"{count} / {max}",counterNoLimit:"{count} characters"},onChange:function(t){},onFocus:function(t){},onBlur:function(t){},styleName:"classic",style:{box:{color:White(1),border:1,borderColor:Black(.2),round:8},boxFocus:{borderColor:"#141414"},toolbar:{color:"#F7F7F6",dividerColor:Black(.1),padding:6,gap:2},button:{size:32,iconSize:18,iconColor:"#4A4A48",hoverColor:Black(.06),activeColor:Black(.1),activeIconColor:"#141414",round:6},separator:{color:Black(.12)},content:{fontSize:15,lineHeight:1.6,textColor:"#141414",fontFamily:"",padding:[16,14],linkColor:"#2F6FB0",quoteColor:Black(.6),quoteBorderColor:Black(.2),placeholderColor:Black(.35),selectionColor:"rgba(47, 111, 176, 0.2)"},linkBar:{color:"#F7F7F6",inputColor:White(1),inputBorderColor:Black(.2),textColor:"#141414",buttonColor:"#141414",buttonTextColor:White(1),secondaryTextColor:Black(.6)},counter:{fontSize:12,textColor:Black(.45),limitColor:"#C0392B"},disabled:{opacity:.55},scrollBar:{bar_color:"#9A9A98",bar_mouseOverColor:"#6A6A68",bar_width:4,bar_round:3,bar_opacity:.4,bar_mouseOverOpacity:.9,bar_padding:2}}},RichTextEditor=function(t={}){basic.applyStylePackage(t,RichTextEditor.styles,RichTextEditorDefaults),mergeIntoIfMissing(t,RichTextEditorDefaults);const e=t.style.box;t.color=e.color,t.border=e.border,t.borderColor=e.borderColor,t.round=e.round,RichTextEditor.injectCss();let o=startObject(t);const n=o.style,r={};let i=null,l=0,a="";const c=function(){return 1==o.enabled&&1!=o.readOnly},d=function(){return o.editor.textContent.length},s=function(){const t=window.getSelection();return!(!t||0==t.rangeCount)&&o.editor.contains(t.getRangeAt(0).commonAncestorContainer)},u=function(t){const e=window.getSelection();e.removeAllRanges(),e.addRange(t)},p=function(t){const e=document.createRange();e.selectNodeContents(t),u(e)},h=function(){o.editor.focus({preventScroll:!0}),i&&u(i)},f=function(){if(!s())return"";let t=window.getSelection().getRangeAt(0).startContainer;for(;t&&t!==o.editor;){if(1===t.nodeType&&/^(H2|H3|BLOCKQUOTE|P|DIV|LI)$/.test(t.nodeName)){if("LI"===t.nodeName){t=t.parentNode;continue}return t.nodeName.toLowerCase()}t=t.parentNode}return""},b=function(){if(!s())return null;let t=window.getSelection().getRangeAt(0).startContainer;for(;t&&t!==o.editor;){if("A"===t.nodeName)return t;t=t.parentNode}return null},m=function(t,e=null){document.execCommand(t,!1,e)},g=function(t,e){return{run:function(){m(t)},state:function(){return document.queryCommandState(t)},keys:e}},x=function(t){return{run:function(){!function(t){m("formatBlock",f()===t?"<p>":"<"+t+">")}(t)},state:function(){return f()===t}}},C=function(){return!1},k={bold:g("bold","B"),italic:g("italic","I"),underline:g("underline","U"),strike:g("strikeThrough"),h2:x("h2"),h3:x("h3"),ul:g("insertUnorderedList"),ol:g("insertOrderedList"),quote:x("blockquote"),link:{run:function(){A()},state:function(){return!!b()},keys:"K"},clear:{run:function(){m("removeFormat"),m("unlink"),m("formatBlock","<p>")},state:C},undo:{run:function(){m("undo")},state:C,keys:"Z"},redo:{run:function(){m("redo")},state:C}},y=function(){if(!o)return;const t=s();Object.keys(r).forEach(function(e){const o=r[e],i=t&&c()&&k[e].state()?1:0;o.isActive=i,o.color=i?n.button.activeColor:"transparent",o.textColor=i?n.button.activeIconColor:n.button.iconColor,o.aria={pressed:i?"true":"false"}})},E=function(){if(!o.lblCounter)return;const t=d(),e=o.maxLength>0,r=e?o.texts.counter:o.texts.counterNoLimit;o.lblCounter.plainText=r.replace("{count}",String(t)).replace("{max}",String(o.maxLength));const i=e&&t>=o.maxLength;o.lblCounter.textColor=i?n.counter.limitColor:n.counter.textColor},T=function(){o.borderColor=l&&c()?n.boxFocus.borderColor:n.box.borderColor},v=function(t){if(o.editor.classList.toggle("is-empty",1==o.isEmpty()),E(),y(),o.scrollBar&&o.scrollBar.refreshScroll(),!t)return void(a=o.getHtml());const e=o.getHtml();e!==a&&(a=e,o.onChange(o))},B=function(){if(!(o.maxLength>0))return 1/0;let t=0;return s()&&(t=window.getSelection().toString().length),Math.max(0,o.maxLength-d()+t)},L=function(t){const e=B();t.length>e&&(t=t.slice(0,e)),t&&m("insertText",t)},A=function(){if(!c())return;s()&&(i=window.getSelection().getRangeAt(0).cloneRange());const t=b();o.linkInput.text=t&&t.getAttribute("href")||"",o.btnLinkRemove.visible=t?1:0,o.linkBar.visible=1,o.linkInput.inputElement.focus({preventScroll:!0}),o.linkInput.inputElement.select()},S=function(t=1){1==o.linkBar.visible&&(o.linkBar.visible=0,t&&h(),i=null)},w=function(){const t=String(o.linkInput.text||"").trim();if(h(),t){const e=function(t){return/^[^\s@\/]+@[^\s@\/]+\.[^\s@\/]+$/.test(t)?"mailto:"+t:/^([a-z][a-z0-9+.-]*:|\/|#|\.)/i.test(t)?t:"https://"+t}(t);if(!RichTextEditor.isSafeHref(e))return void o.linkInput.inputElement.focus();if(!function(t){const e=window.getSelection();if(e.isCollapsed&&!b()){if(t.length>B())return S(1),0;const e=RichTextEditor.escapeHtml(t);return m("insertHTML",'<a href="'+e+'">'+e+"</a> "),1}return e.isCollapsed&&p(b()),m("createLink",t),1}(e))return}else m("unlink");o.linkBar.visible=0,i=null,v(1)},R=function(t,e){e.preventDefault()};o.getHtml=function(){return o.isEmpty()?"":RichTextEditor.cleanHtml(o.editor.innerHTML)},o.setHtml=function(t){o.htmlText=RichTextEditor.cleanHtml(t||""),o.editor.innerHTML=o.htmlText||"<p><br></p>",v(0)},o.getText=function(){return RichTextEditor.htmlToText(o.editor.innerHTML)},o.getLength=function(){return d()},o.isEmpty=function(){return""!==o.editor.textContent.trim()||o.editor.querySelector("li, a")?0:1},o.clear=function(){o.setHtml("")},o.insertText=function(t){c()&&(s()||o.focusEnd(),L(String(t??"")))},o.insertHtml=function(t){if(!c())return;s()||o.focusEnd();const e=RichTextEditor.cleanHtml(t||"");RichTextEditor.htmlToText(e).length<=B()&&m("insertHTML",e)},o.runTool=function(t){c()&&k[t]&&(s()||h(),k[t].run(),"link"!==t&&v(1))},o.focus=function(){o.editor.focus({preventScroll:!0})},o.focusEnd=function(){o.editor.focus({preventScroll:!0});const t=document.createRange();t.selectNodeContents(o.editor),t.collapse(!1),u(t)},o.setPlaceholderText=function(t){o.placeholderText=String(t??""),o.editor.setAttribute("data-placeholder",o.placeholderText)},o.setMaxLength=function(t){o.maxLength=Math.max(0,Number(t)||0),E()},o.setReadOnly=function(t){o.readOnly=basic.isOn(t)?1:0,H()},o.setEnabled=function(t){o.enabled=basic.isOn(t)?1:0,H()};const H=function(){const t=c();o.editor.contentEditable=t?"true":"false",o.editor.tabIndex=1==o.enabled?0:-1,o.editor.setAttribute("aria-readonly",1==o.readOnly?"true":"false"),o.editor.setAttribute("aria-disabled",1==o.enabled?"false":"true"),o.editor.style.userSelect=1==o.enabled?"text":"none",o.css.opacity=1==o.enabled?"1":String(n.disabled.opacity),o.toolbar.css={opacity:t?"1":"0.45",pointerEvents:t?"":"none"},t||1!=o.linkBar.visible||S(0),T(),y()};o.refresh=function(){v(0)},o.clipContent=1,o.css.transition="border-color 0.15s";const I=function(t){const e=o.texts[t]||t,i=Label({text:RichTextEditor.getIconSvg(t,n.button.iconSize),width:n.button.size,height:n.button.size,round:n.button.round,color:"transparent",textColor:n.button.iconColor,clickable:1});return i.elem.style.display="flex",i.css={alignItems:"center",justifyContent:"center",transition:"background-color 0.12s"},i.lineHeight="0",i.shrink=0,i.cursor="pointer",i.role="button",i.aria={label:e},i.elem.setAttribute("title",e+function(t){const e=k[t].keys;return e?" ("+(/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl+")+e+")":""}(t)),i.isActive=0,i.on("mouseenter",function(){i.isActive||(i.color=n.button.hoverColor)}),i.on("mouseleave",function(){i.color=i.isActive?n.button.activeColor:"transparent"}),i.on("mousedown",R),i.on("click",function(){o.runTool(t)}),r[t]=i,i};o.layout=VGroup({width:"100%",height:"100%",align:"left top",gap:0}),o.layout.css.alignItems="stretch",o.toolbar=HGroup({width:"100%",height:"auto",align:"left center",gap:n.toolbar.gap,padding:n.toolbar.padding,color:n.toolbar.color,wrap:1}),o.toolbar.shrink=0,o.toolbar.css.borderBottom="1px solid "+n.toolbar.dividerColor,o.toolbar.role="toolbar",o.toolbar.aria={label:o.ariaLabel},o.tools.forEach(function(t){"|"===t?(Box({width:1,height:Math.round(.6*n.button.size),color:n.separator.color}),that.css.margin="0px 4px",that.shrink=0):k[t]?I(t):console.warn("RichTextEditor: Unknown tool: "+t)}),endGroup(),o.linkBar=HGroup({width:"100%",height:"auto",align:"left center",gap:6,padding:[n.toolbar.padding+2,n.toolbar.padding],color:n.linkBar.color}),o.linkBar.shrink=0,o.linkBar.css.borderBottom="1px solid "+n.toolbar.dividerColor,o.linkInput=Input({width:"auto",height:32,minimal:1,fontSize:14,color:n.linkBar.inputColor,textColor:n.linkBar.textColor,round:6,border:1,borderColor:n.linkBar.inputBorderColor}),o.linkInput.css={flex:"1 1 0",minWidth:"0"},o.linkInput.inputElement.style.padding="0px 10px",o.linkInput.inputElement.style.width="100%",o.linkInput.inputElement.style.height="100%",o.linkInput.inputElement.style.boxSizing="border-box",o.linkInput.inputElement.style.backgroundColor="transparent",o.linkInput.inputElement.setAttribute("placeholder",o.texts.linkPlaceholder),o.linkInput.inputElement.setAttribute("aria-label",o.texts.link),o.linkInput.inputElement.setAttribute("inputmode","url"),o.btnLinkApply=Label({plainText:o.texts.linkApply,height:32,padding:[14,0],fontSize:13,round:6,color:n.linkBar.buttonColor,textColor:n.linkBar.buttonTextColor,clickable:1}),o.btnLinkApply.elem.style.display="flex",o.btnLinkApply.css.alignItems="center",o.btnLinkApply.shrink=0,o.btnLinkApply.cursor="pointer",o.btnLinkApply.role="button",o.btnLinkRemove=Label({plainText:o.texts.linkRemove,height:32,padding:[8,0],fontSize:13,color:"transparent",textColor:n.linkBar.secondaryTextColor,clickable:1}),o.btnLinkRemove.elem.style.display="flex",o.btnLinkRemove.css.alignItems="center",o.btnLinkRemove.shrink=0,o.btnLinkRemove.cursor="pointer",o.btnLinkRemove.role="button",endGroup(),o.linkBar.visible=0,o.editHolder=startBox({width:"100%",height:"auto",color:"transparent"}),o.editHolder.css={flex:"1 1 0",minHeight:"0"},o.editArea=Box(0,0,"100%","100%",{color:"transparent",scrollY:1}),o.editArea.cursor="text",o.editArea.clickable=1,o.editor=document.createElement("div"),o.editor.className="rich-text-editor-content",o.editor.setAttribute("role","textbox"),o.editor.setAttribute("aria-multiline","true"),o.editor.setAttribute("aria-label",o.ariaLabel),o.editor.spellcheck=1==o.spellCheck;const F=n.content,O=o.editor.style;if(O.minHeight="100%",O.boxSizing="border-box",O.padding=F.padding[1]+"px "+F.padding[0]+"px",O.fontSize=F.fontSize+"px",O.lineHeight=String(F.lineHeight),O.color=F.textColor,F.fontFamily&&(O.fontFamily=F.fontFamily),O.setProperty("--rte-link",F.linkColor),O.setProperty("--rte-quote",F.quoteColor),O.setProperty("--rte-quote-border",F.quoteBorderColor),O.setProperty("--rte-placeholder",F.placeholderColor),O.setProperty("--rte-selection",F.selectionColor),o.editArea.elem.appendChild(o.editor),1==o.useScrollBar&&"undefined"!=typeof ScrollBar){const t={scrollableBox:o.editArea,neverHide:0,showDots:0};o.scrollBar=ScrollBar(Object.assign(t,n.scrollBar))}endBox(),1==o.showCounter&&(o.lblCounter=Label({plainText:"",width:"100%",fontSize:n.counter.fontSize,textColor:n.counter.textColor,textAlign:"right",padding:[n.content.padding[0],6]}),o.lblCounter.shrink=0,o.lblCounter.css.fontVariantNumeric="tabular-nums"),endGroup();try{document.execCommand("styleWithCSS",!1,!1)}catch(t){}try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(t){}return o.editor.addEventListener("input",function(){v(1)}),o.editor.addEventListener("beforeinput",function(t){if(!c())return void t.preventDefault();if(!(o.maxLength>0))return;const e=t.inputType||"";0===e.indexOf("insert")&&"insertFromPaste"!==e&&"insertLink"!==e&&(B()>0||"insertParagraph"!==e&&"insertLineBreak"!==e&&t.preventDefault())}),o.editor.addEventListener("paste",function(t){if(t.preventDefault(),!c())return;const e=t.clipboardData;if(!e)return;const n=e.getData("text/plain")||"",r="clean"===o.pasteAs?e.getData("text/html"):"";if(r){const t=RichTextEditor.cleanHtml(r);if(RichTextEditor.htmlToText(t).length<=B())return void m("insertHTML",t)}L(n)}),o.editor.addEventListener("drop",function(t){const e=t.dataTransfer&&t.dataTransfer.files;e&&e.length&&t.preventDefault()}),o.editor.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&!t.altKey&&("k"!==t.key&&"K"!==t.key||(t.preventDefault(),r.link&&A()))}),o.editor.addEventListener("focus",function(){l=1,T(),y(),o.onFocus(o)}),o.editor.addEventListener("blur",function(){l=0,T(),o.onBlur(o)}),o.editArea.on("mousedown",function(t,e){e.target===o.editArea.elem&&c()&&(e.preventDefault(),o.focusEnd())}),o.listenTo(document,"selectionchange",function(){s()&&y()}),o.linkInput.inputElement.addEventListener("keydown",function(t){if("Enter"===t.key)return t.preventDefault(),void w();"Escape"===t.key&&(t.preventDefault(),S(1))}),o.btnLinkApply.on("mousedown",R),o.btnLinkApply.on("click",w),o.btnLinkRemove.on("mousedown",R),o.btnLinkRemove.on("click",function(){h();const t=b();t&&p(t),m("unlink"),o.linkBar.visible=0,i=null,v(1)}),o.setPlaceholderText(o.placeholderText),o.setHtml(o.htmlText),o.setMaxLength(o.maxLength),H(),endObject(o)};RichTextEditor.ALLOWED_TAGS=["B","STRONG","I","EM","U","S","STRIKE","DEL","H2","H3","P","DIV","BR","UL","OL","LI","BLOCKQUOTE","A"],RichTextEditor.DROPPED_TAGS=["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","NOSCRIPT","TEMPLATE","HEAD","TITLE","META","LINK","SVG","MATH","IMG","VIDEO","AUDIO","CANVAS","INPUT","TEXTAREA","SELECT","BUTTON","FORM"],RichTextEditor.isSafeHref=function(t){const e=String(t||"").trim();if(!e)return!1;if(/^(https?:|mailto:|tel:)/i.test(e))return!0;const o=e.replace(/[\s\u0000-\u001F]/g,"");return!/^[a-z][a-z0-9+.-]*:/i.test(o)},RichTextEditor.cleanHtml=function(t){const e=(new DOMParser).parseFromString("<body>"+String(t||"")+"</body>","text/html"),o=document.createElement("div"),n=function(t,e){t.childNodes.forEach(function(t){if(3===t.nodeType)return void e.appendChild(document.createTextNode(t.nodeValue));if(1!==t.nodeType)return;const o=t.nodeName.toUpperCase();if(RichTextEditor.DROPPED_TAGS.indexOf(o)>-1)return;if(-1===RichTextEditor.ALLOWED_TAGS.indexOf(o))return void n(t,e);const r=document.createElement(o.toLowerCase());if("A"===o){const o=t.getAttribute("href");if(!RichTextEditor.isSafeHref(o))return void n(t,e);r.setAttribute("href",o.trim())}n(t,r),e.appendChild(r)})};return n(e.body,o),o.innerHTML},RichTextEditor.htmlToText=function(t){const e=(new DOMParser).parseFromString("<body>"+String(t||"")+"</body>","text/html"),o=[];let n="";const r=function(){o.push(n),n=""},i=function(t){t.childNodes.forEach(function(t){if(3===t.nodeType)return void(n+=t.nodeValue.replace(/\s+/g," "));if(1!==t.nodeType)return;const e=t.nodeName;if("BR"===e)return void r();const o=/^(P|DIV|H[1-6]|LI|BLOCKQUOTE|UL|OL)$/.test(e);o&&n.trim()&&r(),"LI"===e&&(n="- "),i(t),o&&n.trim()&&r()})};return i(e.body),n.trim()&&o.push(n),o.map(function(t){return t.trim()}).join("\n").trim()},RichTextEditor.escapeHtml=basic.escapeHtml,RichTextEditor.getIconSvg=function(t,e){const o=function(t,e){return'<text x="12" y="17.5" text-anchor="middle" font-size="16" fill="currentColor" stroke="none" font-family="Georgia, \'Times New Roman\', serif" '+(e||"")+">"+t+"</text>"};return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+({bold:o("B",'font-weight="700"'),italic:o("I",'font-style="italic"'),underline:o("U",'y="16"')+'<path d="M6 21h12"/>',strike:o("S")+'<path d="M4 12h16"/>',h2:'<text x="12" y="16.5" text-anchor="middle" font-size="12" font-weight="700" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H2</text>',h3:'<text x="12" y="16.5" text-anchor="middle" font-size="12" font-weight="700" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H3</text>',ul:'<path d="M9 6h11M9 12h11M9 18h11"/><circle cx="4.5" cy="6" r="1" fill="currentColor"/><circle cx="4.5" cy="12" r="1" fill="currentColor"/><circle cx="4.5" cy="18" r="1" fill="currentColor"/>',ol:'<path d="M10 6h10M10 12h10M10 18h10"/><path d="M4 5l1.5-1v5" stroke-width="1.6"/><path d="M3.5 14.5c0-1 2.5-1.2 2.5 0 0 1-2.5 2-2.5 3.5H6" stroke-width="1.6"/>',quote:'<path d="M7 7h3v4c0 3-1.5 5-4 6M15 7h3v4c0 3-1.5 5-4 6"/>',link:'<path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/>',clear:o("T",'x="10"')+'<path d="M15 14l6 6M21 14l-6 6"/>',undo:'<path d="M9 14L4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 0 11H11"/>',redo:'<path d="M15 14l5-5-5-5"/><path d="M20 9H9.5a5.5 5.5 0 0 0 0 11H13"/>'}[t]||"")+"</svg>"},RichTextEditor.injectCss=function(){const t=".rich-text-editor-content";basic.addCss("rich-text-editor-css",t+" { position: relative; outline: none; pointer-events: auto; user-select: text; -webkit-user-select: text; overflow-wrap: break-word; word-break: break-word; }"+t+" p, "+t+" div { margin: 0 0 0.6em 0; }"+t+" h2 { font-size: 1.45em; line-height: 1.3; margin: 0.4em 0 0.4em 0; font-weight: 700; }"+t+" h3 { font-size: 1.2em; line-height: 1.35; margin: 0.4em 0 0.35em 0; font-weight: 700; }"+t+" b, "+t+" strong { font-weight: 700; }"+t+" ul, "+t+" ol { margin: 0 0 0.6em 0; padding-left: 1.6em; }"+t+" li { margin: 0.15em 0; }"+t+" blockquote { margin: 0 0 0.6em 0; padding: 0.1em 0 0.1em 1em; border-left: 3px solid var(--rte-quote-border); color: var(--rte-quote); }"+t+" a { color: var(--rte-link); text-decoration: underline; cursor: text; }"+t+" > :first-child { margin-top: 0; }"+t+" ::selection { background: var(--rte-selection); }"+t+".is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--rte-placeholder); pointer-events: none; }")},RichTextEditor.styles={classic:RichTextEditorDefaults.style,modern:{box:{color:White(1),border:1,borderColor:"#D9DADB",round:14},boxFocus:{borderColor:"cadetblue"},toolbar:{color:White(1),dividerColor:"#E3ECEC",padding:8,gap:2},button:{size:32,iconSize:18,iconColor:"#4F7C7D",hoverColor:"#EEF5F5",activeColor:"#DFECEC",activeIconColor:"#2F5F61",round:100},separator:{color:"#E3ECEC"},content:{fontSize:15,lineHeight:1.6,textColor:"#2F5F61",fontFamily:"",padding:[18,14],linkColor:"#2E8B8F",quoteColor:"#5C8A8B",quoteBorderColor:"cadetblue",placeholderColor:"#8FB5B6",selectionColor:"rgba(95, 158, 160, 0.22)"},linkBar:{color:"#F5F9F9",inputColor:White(1),inputBorderColor:"#CFE2E2",textColor:"#2F5F61",buttonColor:"cadetblue",buttonTextColor:White(1),secondaryTextColor:"#5C8A8B"},counter:{fontSize:12,textColor:"#6E9A9B",limitColor:"#C0392B"},scrollBar:{bar_color:"#CFE2E2",bar_mouseOverColor:"cadetblue",bar_width:4,bar_round:3,bar_opacity:.6,bar_mouseOverOpacity:1,bar_padding:2}},dark:{box:{color:"#232322",border:1,borderColor:"rgba(255, 255, 255, 0.10)",round:8},boxFocus:{borderColor:"#65A293"},toolbar:{color:"#1C1C1B",dividerColor:"rgba(255, 255, 255, 0.08)",padding:6,gap:2},button:{size:32,iconSize:18,iconColor:"rgba(255, 255, 255, 0.65)",hoverColor:"rgba(255, 255, 255, 0.08)",activeColor:"rgba(101, 162, 147, 0.25)",activeIconColor:"#8FD1BF",round:6},separator:{color:"rgba(255, 255, 255, 0.12)"},content:{fontSize:15,lineHeight:1.6,textColor:"rgba(255, 255, 255, 0.90)",fontFamily:"",padding:[16,14],linkColor:"#7FC4B2",quoteColor:"rgba(255, 255, 255, 0.6)",quoteBorderColor:"#65A293",placeholderColor:"rgba(255, 255, 255, 0.35)",selectionColor:"rgba(101, 162, 147, 0.35)"},linkBar:{color:"#1C1C1B",inputColor:"#2A2A29",inputBorderColor:"rgba(255, 255, 255, 0.12)",textColor:"rgba(255, 255, 255, 0.9)",buttonColor:"#3D7A6B",buttonTextColor:White(1),secondaryTextColor:"rgba(255, 255, 255, 0.6)"},counter:{fontSize:12,textColor:"rgba(255, 255, 255, 0.45)",limitColor:"#E57B6B"},disabled:{opacity:.45},scrollBar:{bar_color:"#8A8A88",bar_mouseOverColor:"#BFBFBD",bar_width:4,bar_round:3,bar_opacity:.4,bar_mouseOverOpacity:.9,bar_padding:2}}};
|
|
2
|
+
"use strict";const RichTextEditorDefaults={key:"0",width:560,height:300,htmlText:"",placeholder:"Write something...",tools:["bold","italic","underline","strike","|","h2","h3","|","ul","ol","quote","|","link","clear","|","undo","redo"],pasteAs:"clean",maxLength:0,showCounter:0,readOnly:0,enabled:1,spellCheck:1,useScrollBar:1,ariaLabel:"Text editor",texts:{bold:"Bold",italic:"Italic",underline:"Underline",strike:"Strikethrough",h2:"Heading",h3:"Subheading",ul:"Bulleted list",ol:"Numbered list",quote:"Quote",link:"Link",clear:"Clear formatting",undo:"Undo",redo:"Redo",linkPlaceholder:"https://example.com",linkApply:"Apply",linkRemove:"Remove",counter:"{count} / {max}",counterNoLimit:"{count} characters"},onChange:function(t){},onFocus:function(t){},onBlur:function(t){},styleName:"light",style:{box:{color:White(1),border:1,borderColor:Black(.2),round:8},boxFocus:{borderColor:"#141414"},toolbar:{color:"#F7F7F6",dividerColor:Black(.1),padding:6,gap:2},button:{size:32,iconSize:18,iconColor:"#4A4A48",hoverColor:Black(.06),activeColor:Black(.1),activeIconColor:"#141414",round:6},separator:{color:Black(.12)},content:{fontSize:15,lineHeight:1.6,textColor:"#141414",fontFamily:"",padding:[16,14],linkColor:"#2F6FB0",quoteColor:Black(.6),quoteBorderColor:Black(.2),placeholderColor:Black(.35),selectionColor:"rgba(47, 111, 176, 0.2)"},linkBar:{color:"#F7F7F6",inputColor:White(1),inputBorderColor:Black(.2),textColor:"#141414",buttonColor:"#141414",buttonTextColor:White(1),secondaryTextColor:Black(.6)},counter:{fontSize:12,textColor:Black(.45),limitColor:"#C0392B"},disabled:{opacity:.55},scrollBar:{bar_color:"#9A9A98",bar_mouseOverColor:"#6A6A68",bar_width:4,bar_round:3,bar_opacity:.4,bar_mouseOverOpacity:.9,bar_padding:2}}},RichTextEditor=function(t={}){basic.applyStylePackage(t,RichTextEditor.styles,RichTextEditorDefaults),mergeIntoIfMissing(t,RichTextEditorDefaults);const e=t.style.box;t.color=e.color,t.border=e.border,t.borderColor=e.borderColor,t.round=e.round,RichTextEditor.injectCss();let o=startObject(t);const n=o.style,r={};let i=null,l=0,a="";const c=function(){return 1==o.enabled&&1!=o.readOnly},d=function(){return o.editor.textContent.length},s=function(){const t=window.getSelection();return!(!t||0==t.rangeCount)&&o.editor.contains(t.getRangeAt(0).commonAncestorContainer)},u=function(t){const e=window.getSelection();e.removeAllRanges(),e.addRange(t)},p=function(t){const e=document.createRange();e.selectNodeContents(t),u(e)},h=function(){o.editor.focus({preventScroll:!0}),i&&u(i)},f=function(){if(!s())return"";let t=window.getSelection().getRangeAt(0).startContainer;for(;t&&t!==o.editor;){if(1===t.nodeType&&/^(H2|H3|BLOCKQUOTE|P|DIV|LI)$/.test(t.nodeName)){if("LI"===t.nodeName){t=t.parentNode;continue}return t.nodeName.toLowerCase()}t=t.parentNode}return""},b=function(){if(!s())return null;let t=window.getSelection().getRangeAt(0).startContainer;for(;t&&t!==o.editor;){if("A"===t.nodeName)return t;t=t.parentNode}return null},m=function(t,e=null){document.execCommand(t,!1,e)},g=function(t,e){return{run:function(){m(t)},state:function(){return document.queryCommandState(t)},keys:e}},x=function(t){return{run:function(){!function(t){m("formatBlock",f()===t?"<p>":"<"+t+">")}(t)},state:function(){return f()===t}}},C=function(){return!1},k={bold:g("bold","B"),italic:g("italic","I"),underline:g("underline","U"),strike:g("strikeThrough"),h2:x("h2"),h3:x("h3"),ul:g("insertUnorderedList"),ol:g("insertOrderedList"),quote:x("blockquote"),link:{run:function(){A()},state:function(){return!!b()},keys:"K"},clear:{run:function(){m("removeFormat"),m("unlink"),m("formatBlock","<p>")},state:C},undo:{run:function(){m("undo")},state:C,keys:"Z"},redo:{run:function(){m("redo")},state:C}},y=function(){if(!o)return;const t=s();Object.keys(r).forEach(function(e){const o=r[e],i=t&&c()&&k[e].state()?1:0;o.isActive=i,o.color=i?n.button.activeColor:"transparent",o.textColor=i?n.button.activeIconColor:n.button.iconColor,o.aria={pressed:i?"true":"false"}})},E=function(){if(!o.lblCounter)return;const t=d(),e=o.maxLength>0,r=e?o.texts.counter:o.texts.counterNoLimit;o.lblCounter.plainText=r.replace("{count}",String(t)).replace("{max}",String(o.maxLength));const i=e&&t>=o.maxLength;o.lblCounter.textColor=i?n.counter.limitColor:n.counter.textColor},T=function(){o.borderColor=l&&c()?n.boxFocus.borderColor:n.box.borderColor},v=function(t){if(o.editor.classList.toggle("is-empty",1==o.isEmpty()),E(),y(),o.scrollBar&&o.scrollBar.refreshScroll(),!t)return void(a=o.getHtmlText());const e=o.getHtmlText();e!==a&&(a=e,o.onChange(o))},B=function(){if(!(o.maxLength>0))return 1/0;let t=0;return s()&&(t=window.getSelection().toString().length),Math.max(0,o.maxLength-d()+t)},L=function(t){const e=B();t.length>e&&(t=t.slice(0,e)),t&&m("insertText",t)},A=function(){if(!c())return;s()&&(i=window.getSelection().getRangeAt(0).cloneRange());const t=b();o.linkInput.text=t&&t.getAttribute("href")||"",o.btnLinkRemove.visible=t?1:0,o.linkBar.visible=1,o.linkInput.inputElement.focus({preventScroll:!0}),o.linkInput.inputElement.select()},S=function(t=1){1==o.linkBar.visible&&(o.linkBar.visible=0,t&&h(),i=null)},R=function(){const t=String(o.linkInput.text||"").trim();if(h(),t){const e=function(t){return/^[^\s@\/]+@[^\s@\/]+\.[^\s@\/]+$/.test(t)?"mailto:"+t:/^([a-z][a-z0-9+.-]*:|\/|#|\.)/i.test(t)?t:"https://"+t}(t);if(!RichTextEditor.isSafeHref(e))return void o.linkInput.inputElement.focus();if(!function(t){const e=window.getSelection();if(e.isCollapsed&&!b()){if(t.length>B())return S(1),0;const e=RichTextEditor.escapeHtml(t);return m("insertHTML",'<a href="'+e+'">'+e+"</a> "),1}return e.isCollapsed&&p(b()),m("createLink",t),1}(e))return}else m("unlink");o.linkBar.visible=0,i=null,v(1)},w=function(t,e){e.preventDefault()};o.getHtmlText=function(){return o.isEmpty()?"":RichTextEditor.cleanHtml(o.editor.innerHTML)},o.setHtmlText=function(t){o.htmlText=RichTextEditor.cleanHtml(t||""),o.editor.innerHTML=o.htmlText||"<p><br></p>",v(0)},o.getText=function(){return RichTextEditor.htmlToText(o.editor.innerHTML)},o.getLength=function(){return d()},o.isEmpty=function(){return""!==o.editor.textContent.trim()||o.editor.querySelector("li, a")?0:1},o.clear=function(){o.setHtmlText("")},o.insertText=function(t){c()&&(s()||o.focusEnd(),L(String(t??"")))},o.insertHtml=function(t){if(!c())return;s()||o.focusEnd();const e=RichTextEditor.cleanHtml(t||"");RichTextEditor.htmlToText(e).length<=B()&&m("insertHTML",e)},o.runTool=function(t){c()&&k[t]&&(s()||h(),k[t].run(),"link"!==t&&v(1))},o.focus=function(){o.editor.focus({preventScroll:!0})},o.focusEnd=function(){o.editor.focus({preventScroll:!0});const t=document.createRange();t.selectNodeContents(o.editor),t.collapse(!1),u(t)},o.setPlaceholder=function(t){o.placeholder=String(t??""),o.editor.setAttribute("data-placeholder",o.placeholder)},o.setMaxLength=function(t){o.maxLength=Math.max(0,Number(t)||0),E()},o.setReadOnly=function(t){o.readOnly=basic.isOn(t)?1:0,H()},o.setEnabled=function(t){o.enabled=basic.isOn(t)?1:0,H()};const H=function(){const t=c();o.editor.contentEditable=t?"true":"false",o.editor.tabIndex=1==o.enabled?0:-1,o.editor.setAttribute("aria-readonly",1==o.readOnly?"true":"false"),o.editor.setAttribute("aria-disabled",1==o.enabled?"false":"true"),o.editor.style.userSelect=1==o.enabled?"text":"none",o.css.opacity=1==o.enabled?"1":String(n.disabled.opacity),o.toolbar.css={opacity:t?"1":"0.45",pointerEvents:t?"":"none"},t||1!=o.linkBar.visible||S(0),T(),y()};o.refresh=function(){v(0)},o.clipContent=1,o.css.transition="border-color 0.15s";const I=function(t){const e=o.texts[t]||t,i=Label({text:RichTextEditor.getIconSvg(t,n.button.iconSize),width:n.button.size,height:n.button.size,round:n.button.round,color:"transparent",textColor:n.button.iconColor,clickable:1});return i.elem.style.display="flex",i.css={alignItems:"center",justifyContent:"center",transition:"background-color 0.12s"},i.lineHeight="0",i.shrink=0,i.cursor="pointer",i.role="button",i.aria={label:e},i.elem.setAttribute("title",e+function(t){const e=k[t].keys;return e?" ("+(/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl+")+e+")":""}(t)),i.isActive=0,i.on("mouseenter",function(){i.isActive||(i.color=n.button.hoverColor)}),i.on("mouseleave",function(){i.color=i.isActive?n.button.activeColor:"transparent"}),i.on("mousedown",w),i.on("click",function(){o.runTool(t)}),r[t]=i,i};o.layout=VGroup({width:"100%",height:"100%",align:"left top",gap:0}),o.layout.css.alignItems="stretch",o.toolbar=HGroup({width:"100%",height:"auto",align:"left center",gap:n.toolbar.gap,padding:n.toolbar.padding,color:n.toolbar.color,wrap:1}),o.toolbar.shrink=0,o.toolbar.css.borderBottom="1px solid "+n.toolbar.dividerColor,o.toolbar.role="toolbar",o.toolbar.aria={label:o.ariaLabel},o.tools.forEach(function(t){"|"===t?(Box({width:1,height:Math.round(.6*n.button.size),color:n.separator.color}),that.css.margin="0px 4px",that.shrink=0):k[t]?I(t):console.warn("RichTextEditor: Unknown tool: "+t)}),endGroup(),o.linkBar=HGroup({width:"100%",height:"auto",align:"left center",gap:6,padding:[n.toolbar.padding+2,n.toolbar.padding],color:n.linkBar.color}),o.linkBar.shrink=0,o.linkBar.css.borderBottom="1px solid "+n.toolbar.dividerColor,o.linkInput=Input({width:"auto",height:32,minimal:1,fontSize:14,color:n.linkBar.inputColor,textColor:n.linkBar.textColor,round:6,border:1,borderColor:n.linkBar.inputBorderColor}),o.linkInput.css={flex:"1 1 0",minWidth:"0"},o.linkInput.inputElement.style.padding="0px 10px",o.linkInput.inputElement.style.width="100%",o.linkInput.inputElement.style.height="100%",o.linkInput.inputElement.style.boxSizing="border-box",o.linkInput.inputElement.style.backgroundColor="transparent",o.linkInput.inputElement.setAttribute("placeholder",o.texts.linkPlaceholder),o.linkInput.inputElement.setAttribute("aria-label",o.texts.link),o.linkInput.inputElement.setAttribute("inputmode","url"),o.btnLinkApply=Label({plainText:o.texts.linkApply,height:32,padding:[14,0],fontSize:13,round:6,color:n.linkBar.buttonColor,textColor:n.linkBar.buttonTextColor,clickable:1}),o.btnLinkApply.elem.style.display="flex",o.btnLinkApply.css.alignItems="center",o.btnLinkApply.shrink=0,o.btnLinkApply.cursor="pointer",o.btnLinkApply.role="button",o.btnLinkRemove=Label({plainText:o.texts.linkRemove,height:32,padding:[8,0],fontSize:13,color:"transparent",textColor:n.linkBar.secondaryTextColor,clickable:1}),o.btnLinkRemove.elem.style.display="flex",o.btnLinkRemove.css.alignItems="center",o.btnLinkRemove.shrink=0,o.btnLinkRemove.cursor="pointer",o.btnLinkRemove.role="button",endGroup(),o.linkBar.visible=0,o.editHolder=startBox({width:"100%",height:"auto",color:"transparent"}),o.editHolder.css={flex:"1 1 0",minHeight:"0"},o.editArea=Box(0,0,"100%","100%",{color:"transparent",scrollY:1}),o.editArea.cursor="text",o.editArea.clickable=1,o.editor=document.createElement("div"),o.editor.className="rich-text-editor-content",o.editor.setAttribute("role","textbox"),o.editor.setAttribute("aria-multiline","true"),o.editor.setAttribute("aria-label",o.ariaLabel),o.editor.spellcheck=1==o.spellCheck;const F=n.content,O=o.editor.style;if(O.minHeight="100%",O.boxSizing="border-box",O.padding=F.padding[1]+"px "+F.padding[0]+"px",O.fontSize=F.fontSize+"px",O.lineHeight=String(F.lineHeight),O.color=F.textColor,F.fontFamily&&(O.fontFamily=F.fontFamily),O.setProperty("--rte-link",F.linkColor),O.setProperty("--rte-quote",F.quoteColor),O.setProperty("--rte-quote-border",F.quoteBorderColor),O.setProperty("--rte-placeholder",F.placeholderColor),O.setProperty("--rte-selection",F.selectionColor),o.editArea.elem.appendChild(o.editor),1==o.useScrollBar&&"undefined"!=typeof ScrollBar){const t={scrollableBox:o.editArea,neverHide:0,showDots:0};o.scrollBar=ScrollBar(Object.assign(t,n.scrollBar))}endBox(),1==o.showCounter&&(o.lblCounter=Label({plainText:"",width:"100%",fontSize:n.counter.fontSize,textColor:n.counter.textColor,textAlign:"right",padding:[n.content.padding[0],6]}),o.lblCounter.shrink=0,o.lblCounter.css.fontVariantNumeric="tabular-nums"),endGroup();try{document.execCommand("styleWithCSS",!1,!1)}catch(t){}try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(t){}return o.editor.addEventListener("input",function(){v(1)}),o.editor.addEventListener("beforeinput",function(t){if(!c())return void t.preventDefault();if(!(o.maxLength>0))return;const e=t.inputType||"";0===e.indexOf("insert")&&"insertFromPaste"!==e&&"insertLink"!==e&&(B()>0||"insertParagraph"!==e&&"insertLineBreak"!==e&&t.preventDefault())}),o.editor.addEventListener("paste",function(t){if(t.preventDefault(),!c())return;const e=t.clipboardData;if(!e)return;const n=e.getData("text/plain")||"",r="clean"===o.pasteAs?e.getData("text/html"):"";if(r){const t=RichTextEditor.cleanHtml(r);if(RichTextEditor.htmlToText(t).length<=B())return void m("insertHTML",t)}L(n)}),o.editor.addEventListener("drop",function(t){const e=t.dataTransfer&&t.dataTransfer.files;e&&e.length&&t.preventDefault()}),o.editor.addEventListener("keydown",function(t){(t.ctrlKey||t.metaKey)&&!t.altKey&&("k"!==t.key&&"K"!==t.key||(t.preventDefault(),r.link&&A()))}),o.editor.addEventListener("focus",function(){l=1,T(),y(),o.onFocus(o)}),o.editor.addEventListener("blur",function(){l=0,T(),o.onBlur(o)}),o.editArea.on("mousedown",function(t,e){e.target===o.editArea.elem&&c()&&(e.preventDefault(),o.focusEnd())}),o.listenTo(document,"selectionchange",function(){s()&&y()}),o.linkInput.inputElement.addEventListener("keydown",function(t){if("Enter"===t.key)return t.preventDefault(),void R();"Escape"===t.key&&(t.preventDefault(),S(1))}),o.btnLinkApply.on("mousedown",w),o.btnLinkApply.on("click",R),o.btnLinkRemove.on("mousedown",w),o.btnLinkRemove.on("click",function(){h();const t=b();t&&p(t),m("unlink"),o.linkBar.visible=0,i=null,v(1)}),o.setPlaceholder(o.placeholder),o.setHtmlText(o.htmlText),o.setMaxLength(o.maxLength),H(),endObject(o)};RichTextEditor.ALLOWED_TAGS=["B","STRONG","I","EM","U","S","STRIKE","DEL","H2","H3","P","DIV","BR","UL","OL","LI","BLOCKQUOTE","A"],RichTextEditor.DROPPED_TAGS=["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","NOSCRIPT","TEMPLATE","HEAD","TITLE","META","LINK","SVG","MATH","IMG","VIDEO","AUDIO","CANVAS","INPUT","TEXTAREA","SELECT","BUTTON","FORM"],RichTextEditor.isSafeHref=function(t){const e=String(t||"").trim();if(!e)return!1;if(/^(https?:|mailto:|tel:)/i.test(e))return!0;const o=e.replace(/[\s\u0000-\u001F]/g,"");return!/^[a-z][a-z0-9+.-]*:/i.test(o)},RichTextEditor.cleanHtml=function(t){const e=(new DOMParser).parseFromString("<body>"+String(t||"")+"</body>","text/html"),o=document.createElement("div"),n=function(t,e){t.childNodes.forEach(function(t){if(3===t.nodeType)return void e.appendChild(document.createTextNode(t.nodeValue));if(1!==t.nodeType)return;const o=t.nodeName.toUpperCase();if(RichTextEditor.DROPPED_TAGS.indexOf(o)>-1)return;if(-1===RichTextEditor.ALLOWED_TAGS.indexOf(o))return void n(t,e);const r=document.createElement(o.toLowerCase());if("A"===o){const o=t.getAttribute("href");if(!RichTextEditor.isSafeHref(o))return void n(t,e);r.setAttribute("href",o.trim())}n(t,r),e.appendChild(r)})};return n(e.body,o),o.innerHTML},RichTextEditor.htmlToText=function(t){const e=(new DOMParser).parseFromString("<body>"+String(t||"")+"</body>","text/html"),o=[];let n="";const r=function(){o.push(n),n=""},i=function(t){t.childNodes.forEach(function(t){if(3===t.nodeType)return void(n+=t.nodeValue.replace(/\s+/g," "));if(1!==t.nodeType)return;const e=t.nodeName;if("BR"===e)return void r();const o=/^(P|DIV|H[1-6]|LI|BLOCKQUOTE|UL|OL)$/.test(e);o&&n.trim()&&r(),"LI"===e&&(n="- "),i(t),o&&n.trim()&&r()})};return i(e.body),n.trim()&&o.push(n),o.map(function(t){return t.trim()}).join("\n").trim()},RichTextEditor.escapeHtml=basic.escapeHtml,RichTextEditor.getIconSvg=function(t,e){const o=function(t,e){return'<text x="12" y="17.5" text-anchor="middle" font-size="16" fill="currentColor" stroke="none" font-family="Georgia, \'Times New Roman\', serif" '+(e||"")+">"+t+"</text>"};return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+({bold:o("B",'font-weight="700"'),italic:o("I",'font-style="italic"'),underline:o("U",'y="16"')+'<path d="M6 21h12"/>',strike:o("S")+'<path d="M4 12h16"/>',h2:'<text x="12" y="16.5" text-anchor="middle" font-size="12" font-weight="700" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H2</text>',h3:'<text x="12" y="16.5" text-anchor="middle" font-size="12" font-weight="700" fill="currentColor" stroke="none" font-family="system-ui, sans-serif">H3</text>',ul:'<path d="M9 6h11M9 12h11M9 18h11"/><circle cx="4.5" cy="6" r="1" fill="currentColor"/><circle cx="4.5" cy="12" r="1" fill="currentColor"/><circle cx="4.5" cy="18" r="1" fill="currentColor"/>',ol:'<path d="M10 6h10M10 12h10M10 18h10"/><path d="M4 5l1.5-1v5" stroke-width="1.6"/><path d="M3.5 14.5c0-1 2.5-1.2 2.5 0 0 1-2.5 2-2.5 3.5H6" stroke-width="1.6"/>',quote:'<path d="M7 7h3v4c0 3-1.5 5-4 6M15 7h3v4c0 3-1.5 5-4 6"/>',link:'<path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/>',clear:o("T",'x="10"')+'<path d="M15 14l6 6M21 14l-6 6"/>',undo:'<path d="M9 14L4 9l5-5"/><path d="M4 9h10.5a5.5 5.5 0 0 1 0 11H11"/>',redo:'<path d="M15 14l5-5-5-5"/><path d="M20 9H9.5a5.5 5.5 0 0 0 0 11H13"/>'}[t]||"")+"</svg>"},RichTextEditor.injectCss=function(){const t=".rich-text-editor-content";basic.addCss("rich-text-editor-css",t+" { position: relative; outline: none; pointer-events: auto; user-select: text; -webkit-user-select: text; overflow-wrap: break-word; word-break: break-word; }"+t+" p, "+t+" div { margin: 0 0 0.6em 0; }"+t+" h2 { font-size: 1.45em; line-height: 1.3; margin: 0.4em 0 0.4em 0; font-weight: 700; }"+t+" h3 { font-size: 1.2em; line-height: 1.35; margin: 0.4em 0 0.35em 0; font-weight: 700; }"+t+" b, "+t+" strong { font-weight: 700; }"+t+" ul, "+t+" ol { margin: 0 0 0.6em 0; padding-left: 1.6em; }"+t+" li { margin: 0.15em 0; }"+t+" blockquote { margin: 0 0 0.6em 0; padding: 0.1em 0 0.1em 1em; border-left: 3px solid var(--rte-quote-border); color: var(--rte-quote); }"+t+" a { color: var(--rte-link); text-decoration: underline; cursor: text; }"+t+" > :first-child { margin-top: 0; }"+t+" ::selection { background: var(--rte-selection); }"+t+".is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--rte-placeholder); pointer-events: none; }")},RichTextEditor.styles={light:RichTextEditorDefaults.style,modern:{box:{color:White(1),border:1,borderColor:"#D9DADB",round:14},boxFocus:{borderColor:"cadetblue"},toolbar:{color:White(1),dividerColor:"#E3ECEC",padding:8,gap:2},button:{size:32,iconSize:18,iconColor:"#4F7C7D",hoverColor:"#EEF5F5",activeColor:"#DFECEC",activeIconColor:"#2F5F61",round:100},separator:{color:"#E3ECEC"},content:{fontSize:15,lineHeight:1.6,textColor:"#2F5F61",fontFamily:"",padding:[18,14],linkColor:"#2E8B8F",quoteColor:"#5C8A8B",quoteBorderColor:"cadetblue",placeholderColor:"#8FB5B6",selectionColor:"rgba(95, 158, 160, 0.22)"},linkBar:{color:"#F5F9F9",inputColor:White(1),inputBorderColor:"#CFE2E2",textColor:"#2F5F61",buttonColor:"cadetblue",buttonTextColor:White(1),secondaryTextColor:"#5C8A8B"},counter:{fontSize:12,textColor:"#6E9A9B",limitColor:"#C0392B"},scrollBar:{bar_color:"#CFE2E2",bar_mouseOverColor:"cadetblue",bar_width:4,bar_round:3,bar_opacity:.6,bar_mouseOverOpacity:1,bar_padding:2}},dark:{box:{color:"#232322",border:1,borderColor:"rgba(255, 255, 255, 0.10)",round:8},boxFocus:{borderColor:"#65A293"},toolbar:{color:"#1C1C1B",dividerColor:"rgba(255, 255, 255, 0.08)",padding:6,gap:2},button:{size:32,iconSize:18,iconColor:"rgba(255, 255, 255, 0.65)",hoverColor:"rgba(255, 255, 255, 0.08)",activeColor:"rgba(101, 162, 147, 0.25)",activeIconColor:"#8FD1BF",round:6},separator:{color:"rgba(255, 255, 255, 0.12)"},content:{fontSize:15,lineHeight:1.6,textColor:"rgba(255, 255, 255, 0.90)",fontFamily:"",padding:[16,14],linkColor:"#7FC4B2",quoteColor:"rgba(255, 255, 255, 0.6)",quoteBorderColor:"#65A293",placeholderColor:"rgba(255, 255, 255, 0.35)",selectionColor:"rgba(101, 162, 147, 0.35)"},linkBar:{color:"#1C1C1B",inputColor:"#2A2A29",inputBorderColor:"rgba(255, 255, 255, 0.12)",textColor:"rgba(255, 255, 255, 0.9)",buttonColor:"#3D7A6B",buttonTextColor:White(1),secondaryTextColor:"rgba(255, 255, 255, 0.6)"},counter:{fontSize:12,textColor:"rgba(255, 255, 255, 0.45)",limitColor:"#E57B6B"},disabled:{opacity:.45},scrollBar:{bar_color:"#8A8A88",bar_mouseOverColor:"#BFBFBD",bar_width:4,bar_round:3,bar_opacity:.4,bar_mouseOverOpacity:.9,bar_padding:2}}},RichTextEditor.styles.classic=RichTextEditor.styles.light;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
"use strict";const ScrollAreaDefaults={key:"0",left:0,top:0,width:"100%",height:"100%",align:"left top",gap:0,padding:0,scrollY:1,scrollX:0,useScrollBar:1,onScroll:function(l){},styleName:"light",style:{scrollBar:{}}},ScrollArea=function(l={}){basic.applyStylePackage(l,ScrollArea.styles,ScrollAreaDefaults),mergeIntoIfMissing(l,ScrollAreaDefaults);const o=ScrollArea.flowOf(getDefaultContainerBox()),r="column"===o&&"100%"===String(l.height),t="row"===o&&"100%"===String(l.width);let e=startObject(l);const c=e.style;e.scrollBox=null,e.content=null,e.scrollBar=null;const n=function(){e.css.padding="0px",e.content.padding=e.padding},s=function(){e.clickable=0,e.scrollBox.scrollY=e.scrollY,e.scrollBox.scrollX=e.scrollX,1!=e.scrollY&&(e.scrollBox.elem.scrollTop=0),1!=e.scrollX&&(e.scrollBox.elem.scrollLeft=0),e.content.width=1==e.scrollX?"fit-content":"100%",e.content.css.minWidth=1==e.scrollX?"100%":"",e.scrollBar&&e.scrollBar.refreshScroll()};return e.setAlign=function(l){e.align=l,e.content.align=l},e.setGap=function(l){e.gap=l,e.content.gap=l},e.setPadding=function(l){e.padding=l,n()},e.setScrollY=function(l){e.scrollY=basic.isOn(l)?1:0,s()},e.setScrollX=function(l){e.scrollX=basic.isOn(l)?1:0,s()},e.getScrollTop=function(){return e.scrollBox.elem.scrollTop},e.setScrollTop=function(l){e.scrollBox.elem.scrollTop=l},e.scrollToTop=function(){e.scrollBox.elem.scrollTop=0,e.scrollBox.elem.scrollLeft=0},e.scrollToEnd=function(){const l=e.scrollBox.elem;1!=e.scrollY?l.scrollLeft=l.scrollWidth:l.scrollTop=l.scrollHeight},e.scrollToObject=function(l){const o=e.scrollBox.elem;if(!l||!l.elem||!o.contains(l.elem))return;const r=o.getBoundingClientRect(),t=l.elem.getBoundingClientRect();o.scrollTop+=ScrollArea.distanceToShow(t.top-r.top,t.bottom-r.top,o.clientHeight),o.scrollLeft+=ScrollArea.distanceToShow(t.left-r.left,t.right-r.left,o.clientWidth)},(r||t)&&(e.grow=1,r&&(e.height="auto",e.css={flexBasis:"0px",minHeight:"0px"}),t&&(e.width="auto",e.css={flexBasis:"0px",minWidth:"0px"})),e.scrollBox=Box(0,0,"100%","100%",{color:"transparent"}),1==e.useScrollBar&&"undefined"!=typeof ScrollBar&&(e.scrollBar=ScrollBar(Object.assign({scrollableBox:e.scrollBox},c.scrollBar))),e.scrollBox.on("scroll",function(){e.onScroll(e)}),endObject(e),saveCurrentThat(),e.content=VGroup({width:"100%",height:"auto",align:e.align,gap:e.gap,color:"transparent",clipContent:0}),e.scrollBox.add(e.content),e.content.position="absolute",e.content.left=0,e.content.top=0,e.content.css.minHeight="100%",restoreThatFromSaved(),n(),s(),e};ScrollArea.flowOf=function(l){const o=l&&l.elem?l.elem.style.flexDirection:"";return 0===o.indexOf("column")?"column":0===o.indexOf("row")?"row":""},ScrollArea.distanceToShow=function(l,o,r){return l<0?l:o>r?Math.min(o-r,l):0},ScrollArea.styles={light:ScrollAreaDefaults.style,dark:{scrollBar:{bar_color:"#CFCFCD",bar_mouseOverColor:"#CFCFCD"}}},ScrollArea.createMinimalStyle=function(l){return{scrollBar:{bar_color:l.scrollBar,bar_mouseOverColor:l.scrollBar,bar_width:3,bar_mouseOverWidth:4,showDots:0}}},ScrollArea.MINIMAL_COLORS={scrollBar:"#373836"},ScrollArea.styles.minimal=ScrollArea.createMinimalStyle(ScrollArea.MINIMAL_COLORS),ScrollArea.MINIMAL_DARK_COLORS={scrollBar:"#CFCFCD"},ScrollArea.styles.minimalDark=ScrollArea.createMinimalStyle(ScrollArea.MINIMAL_DARK_COLORS);
|